From d846fba464f7695c5765cbdc3f7e1d4bbc63f40a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 28 Apr 2014 11:10:01 -0700 Subject: [PATCH] INFRA-107 - Cleanup Remove custom Drupal modules for civicrm.org from civicrm-core.git. These are already in civicrm-website-org.git, and those are the versions in use. --- .../ccrm_extensionvalidation.info | 13 - .../ccrm_extensionvalidation.module | 334 ----- .../ccrm_extensionvalidation.test | 170 --- .../ccrm_extensionvalidation.version.inc | 107 -- .../civicrm_professionals.info | 6 - .../civicrm_professionals.module | 44 - .../civicrm_regsite/civicrm_regsite.info | 6 - .../civicrm_regsite/civicrm_regsite.module | 408 ------ .../templates/CRM/Profile/Form/15/Edit.tpl | 307 ---- .../CRM/Profile/Form/Survey/Edit.tpl | 290 ---- .../CRM/Profile/Page/Regsite/Dynamic.tpl | 53 - .../CRM/Profile/Page/Survey/Dynamic.tpl | 51 - .../templates/Mail/RegSite/Message.tpl | 26 - .../templates/Mail/RegSite/Subject.tpl | 1 - .../templates/Mail/Survey/Message.tpl | 10 - .../templates/Mail/Survey/Subject.tpl | 1 - .../civicrm_regsite/xml/CustomGroupData.xml | 1243 ----------------- tools/drupal/modules/extdir/extdir.info | 5 - tools/drupal/modules/extdir/extdir.module | 65 - tools/drupal/modules/extdir/extdir.pages.inc | 258 ---- .../drupal/modules/extdir/extdir_list.tpl.php | 11 - 21 files changed, 3409 deletions(-) delete mode 100644 tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.info delete mode 100644 tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.module delete mode 100644 tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.test delete mode 100644 tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.version.inc delete mode 100644 tools/drupal/modules/civicrm_professionals/civicrm_professionals.info delete mode 100644 tools/drupal/modules/civicrm_professionals/civicrm_professionals.module delete mode 100644 tools/drupal/modules/civicrm_regsite/civicrm_regsite.info delete mode 100644 tools/drupal/modules/civicrm_regsite/civicrm_regsite.module delete mode 100644 tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Form/15/Edit.tpl delete mode 100644 tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Form/Survey/Edit.tpl delete mode 100644 tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Page/Regsite/Dynamic.tpl delete mode 100644 tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Page/Survey/Dynamic.tpl delete mode 100644 tools/drupal/modules/civicrm_regsite/templates/Mail/RegSite/Message.tpl delete mode 100644 tools/drupal/modules/civicrm_regsite/templates/Mail/RegSite/Subject.tpl delete mode 100644 tools/drupal/modules/civicrm_regsite/templates/Mail/Survey/Message.tpl delete mode 100644 tools/drupal/modules/civicrm_regsite/templates/Mail/Survey/Subject.tpl delete mode 100644 tools/drupal/modules/civicrm_regsite/xml/CustomGroupData.xml delete mode 100644 tools/drupal/modules/extdir/extdir.info delete mode 100644 tools/drupal/modules/extdir/extdir.module delete mode 100644 tools/drupal/modules/extdir/extdir.pages.inc delete mode 100644 tools/drupal/modules/extdir/extdir_list.tpl.php diff --git a/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.info b/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.info deleted file mode 100644 index 63c3fb7ebd..0000000000 --- a/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.info +++ /dev/null @@ -1,13 +0,0 @@ -;$Id$ - -name = CCRM Extension Validation -description = Replaces ccrm_validateextrelease. Validates a CiviCRM native module XML descriptor and sets node values to match XML file. Also validates Extension and Release Maintainers. -package = CiviCRM -version = 7.x-1.0 -core = 7.x -files[] = ccrm_extensionvalidation.module -files[] = ccrm_extensionvalidation.version.inc -files[] = ccrm_extensionvalidation.test -dependencies[] = taxonomy -dependencies[] = list -php = 5.2 \ No newline at end of file diff --git a/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.module b/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.module deleted file mode 100644 index eda8a608e6..0000000000 --- a/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.module +++ /dev/null @@ -1,334 +0,0 @@ - (required) - * Release Date == - * Release Status == (required) - * Release CiviCRM Compatibility == (required)(multiple ok) - * Parent Extension FQN == (required) - * Documentation Link == - * (Postponed) Download URL > downloadUrl (required) - * TODO: Fully validate the XML document format against a DOCtype - */ - - /** - * - * implements hook_node_validate - */ - function ccrm_extensionvalidation_node_validate($node, $form, &$form_state) { - // Make sure author of extension is in maintainers - if ('extension' == $node->type) { - $authornid = $node->uid; $delta = 0; $foundauthor = FALSE; - foreach ($form_state['values']['field_maintainers'][LANGUAGE_NONE] as $index => $ref) { - if (is_numeric($ref['target_id']) - && $form_state['values']['field_maintainers'][LANGUAGE_NONE][$index]['target_id'] == $authornid) { - $foundauthor = TRUE; - } - $delta++; - } - if (FALSE == $foundauthor) { - $form_state['values']['field_maintainers'][LANGUAGE_NONE][$delta]['target_id'] = $authornid; - $form_state['values']['field_maintainers'][LANGUAGE_NONE][$delta]['_weight'] = $delta; - } - } - // Set maintainers on releases from parent extension - if ($node->type == 'extension_release_civicrm') { - $parentnid = $node->field_extension_nr_crm[LANGUAGE_NONE][0]['nid']; - } - if ($node->type == 'extension_release_cms') { - $parentnid = $node->field_extension_nr_cms[LANGUAGE_NONE][0]['nid']; - } - if ($node->type == 'extension_release_civicrm' || $node->type == 'extension_release_cms') { - $parent_node = is_numeric($parentnid) ? node_load($parentnid) : NULL; - if (NULL == $parent_node) { - _ccrmextvalid_formseterror('title', t('Could not determine parent extension. Please add via extension page.')); - return; - } - } - if ($node->type == 'extension_release_cms') { - // Delete current maintainers - foreach ($form_state['values']['field_extension_release_na_mains'][LANGUAGE_NONE] as $index => $ref) { - if (is_numeric($ref['target_id'])) { - $form_state['values']['field_extension_release_na_mains'][LANGUAGE_NONE][$index]['target_id'] = NULL; - } - } - // Check parent node has maintainers set and add maintainers from parent - $delta = 0; - foreach ($parent_node->field_maintainers[LANGUAGE_NONE] as $index => $ref) { - if (is_numeric($ref['target_id'])) { - $form_state['values']['field_extension_release_na_mains'][LANGUAGE_NONE][$index]['target_id'] = $ref['target_id']; - $form_state['values']['field_extension_release_na_mains'][LANGUAGE_NONE][$index]['_weight'] = $delta++; - } - } - } - if ($node->type == 'extension_release_civicrm') { - // Delete current maintainers - foreach ($form_state['values']['field_extension_release_ci_mains'][LANGUAGE_NONE] as $index => $ref) { - if (is_numeric($ref['target_id'])) { - $form_state['values']['field_extension_release_ci_mains'][LANGUAGE_NONE][$index]['target_id'] = NULL; - } - } - // Check parent node has maintainers set and add maintainers from parent - $delta = 0; - foreach ($parent_node->field_maintainers[LANGUAGE_NONE] as $index => $ref) { - if (is_numeric($ref['target_id'])) { - $form_state['values']['field_extension_release_ci_mains'][LANGUAGE_NONE][$index]['target_id'] = $ref['target_id']; - $form_state['values']['field_extension_release_ci_mains'][LANGUAGE_NONE][$index]['_weight'] = $delta++; - } - } - } - if ($node->type == 'extension_release_civicrm') { - _ccrmextvalid_validatexml($node, $form, &$form_state, $parent_node); - } - } - - function _ccrmextvalid_validatexml($node, $form, &$form_state, $parent_node) { - $keeperrors = array(); - $file_id = $form_state['values'][CCRM_EXTVALID_XMLFILE_FIELD][LANGUAGE_NONE][0]['fid']; - - if ($file_id != 0) { - $file = file_load($file_id); - if ($file) { - libxml_use_internal_errors(TRUE); - $doc = new DOMDocument(); - $doc->recover = TRUE; - $doc->strictErrorChecking = FALSE; - - if ($doc->load(drupal_realpath($file->uri))) { - // Initialize variables to be read - $got = array('version' => FALSE, 'releaseDate' => FALSE, 'develStage' => FALSE, - 'ver' => FALSE, 'extension' => FALSE, 'documentation' => FALSE); //'downloadUrl' =>FALSE (postponed) - foreach ($got as $tag => $tagcontents) { - $wegotit = _ccrmextvalid_validateTag($node, $form, $form_state, $doc, $tag, $tagcontents, $keeperrors, $parent_node); - $got[$tag] = $tagcontents; - if ($wegotit) { - _ccrmextvalid_assignTag($form, &$form_state, $tag, &$tagcontents); - } - else { - if ($tag == 'extension') { - _ccrmextvalid_seterror('title', t("The Fully Qualified Name in the XML file did not match parent extension: @tagcont", - array('@tagcont' => $tagcontents)), $keeperrors); - } - else { - _ccrmextvalid_seterror('title', t("The Extension Release XML file contained an invalid or empty value for tag '@tag'", - array('@tag' => $tag)), $keeperrors); - } - } - } - } - else { - _ccrmextvalid_seterror( 'title', t('The XML file could not be read'), $keeperrors); - } - } - } - else { - _ccrmextvalid_seterror( CCRM_EXTVALID_XMLFILE_FIELD, t('Please upload an XML file descriptor'), $keeperrors); - } - if (!empty($keeperrors)) { - _ccrmextvalid_formseterror($keeperrors); - } - } - - // return whether we had a - function _ccrmextvalid_validateTag($node, $form, &$form_state, $doc, $tag, &$tagcontents, &$keeperrors, $parent_node) { - $gotit = FALSE; $tagcount = 0; $contents = ''; - switch ($tag) { - case 'version': - case 'releaseDate': - case 'develStage': - case 'downloadUrl': - $tagcount = _ccrmextvalid_getOneReqdByTag($doc, $tag, &$tagcontents); - break; - case 'ver': - $tagcount = _ccrmextvalid_getByTag($doc, $tag, &$tagcontents); - break; - case 'documentation': - $domnodes = $doc->getElementsByTagName('url'); - $tagcount = $domnodes->length; - foreach ($domnodes as $node) { - if ($node->hasAttributes()) { - $attrib = $node->attributes->getNamedItem('desc'); - if (strtolower($attrib->value) == "documentation") { - $tagcontents = $node->nodeValue; - } - } - } - break; - case 'extension': - $domnodes = $doc->getElementsByTagName('extension'); - $tagcount = $domnodes->length; - if ($tagcount == 1) { - $elmt = $domnodes->item(0); - if ($elmt->hasAttributes()) { - $tagcontents = $elmt->getAttribute('key'); - } - } - break; - default: - drupal_set_message(t('Invalid tag used in _ccrmextvalid_validateTag: @tag', array('@tag' => $tag))); - return FALSE; - } - if ($tagcount > 0) { - switch ($tag) { - case 'version': - module_load_include('version.inc', 'ccrm_extensionvalidation'); - if (ccrm_extensionvalidation_version_isValid($tagcontents)) { - $contents = $tagcontents; - $gotit = TRUE; - } - break; - case 'releaseDate': - $tmp = filter_var($tagcontents, FILTER_SANITIZE_STRING); - if (preg_match('/\d{4}-\d{2}-\d{2}/', $tmp)) { - //$contents = new DateObject($tagcontents, NULL); - $contents = $tmp; - $gotit = TRUE; - } - break; - case 'develStage': - $contents = _ccrmextvalid_checkallowedval($tagcontents, 'field_extension_release_status'); - if ($contents && (count($contents) == 1)) { - $gotit = TRUE; - } - $contents = $contents[0]; - break; - case 'ver': - if ($tagcount == 1) { - $tagcontents = array($tagcontents); - } - $vers = array_map('_ccrmextvalid_mapversionval', $tagcontents); - $okvers = _ccrmextvalid_checkallowedval($vers, 'field_extension_release_civicrm'); - if (count($okvers) == count($vers)) { - $gotit = TRUE; - $contents = array_map('_ccrmextvalid_mapversionvaltid', $okvers); - } - break; - case 'documentation': - $contents = filter_var($tagcontents, FILTER_VALIDATE_URL); - $gotit = TRUE; - break; - case 'extension': - $parentkey = isset($parent_node) ? $parent_node->field_extension_fq_name[LANGUAGE_NONE][0]['safe_value'] : NULL; - $contents = $parentkey . ' vs. ' . $tagcontents; - if ($tagcontents == $parentkey) { - $gotit = TRUE; - } - break; - default: - return FALSE; - } - $tagcontents = $contents; - } - return $gotit; - } - - function _ccrmextvalid_assignTag($form, &$form_state, $tag, &$tagcontents) { - // Add $tagcontents to $form_state - switch ($tag) { - case 'version': - module_load_include('version.inc', 'ccrm_extensionvalidation'); - $form_state['values']['field_extension_release_version'][LANGUAGE_NONE][0]['value'] = t('Version @ver', array('@ver' => $tagcontents)); - $form_state['values']['field_extension_release_vc'][LANGUAGE_NONE][0]['value'] = ccrm_extensionvalidation_version_normalize($tagcontents); - break; - case 'releaseDate': - $form_state['values']['field_extension_release_date'][LANGUAGE_NONE][0]['value'] = $tagcontents; - break; - case 'develStage': - $form_state['values']['field_extension_release_status'][LANGUAGE_NONE][0]['value'] = $tagcontents; - break; - case 'downloadUrl': - $form_state['values']['field_extension_release_url'][LANGUAGE_NONE][0]['url'] = $tagcontents; - break; - case 'ver': - $form_state['values']['field_extension_release_civicrm'][LANGUAGE_NONE] = $tagcontents; - break; - case 'documentation': - $form_state['values']['field_documentation'][LANGUAGE_NONE][0]['url'] = $tagcontents; - break; - } - } - - // Get the value of a single tag from the XML that should only have one value - function _ccrmextvalid_getOneReqdByTag($doc, $tagname, &$values) { - $defaultval = $values; - $tagcount = _ccrmextvalid_getByTag($doc, $tagname, &$values); - if ($tagcount > 1) { - form_set_error(CCRM_EXTVALID_XMLFILE_FIELD, - t("XML file must contain only one '@tagname' element"), array('tagname' => $tagname)); - } - return $tagcount; - } - - // Get all tags by value from the XML - function _ccrmextvalid_getByTag($doc, $tagname, &$values) { - $domnodes = $doc->getElementsByTagName($tagname); - $nodecount = $domnodes->length; - if ($nodecount > 0) { - if ($nodecount > 1) { - $values = array(); - for ($i = 0; $i < $domnodes->length; $i++) { - $values[] = $domnodes->item($i)->nodeValue; - } - } - else { - $values = $domnodes->item(0)->nodeValue; - } - } - return $nodecount; - - } - - // Compare a value with the allowed values (lower case) - function _ccrmextvalid_checkallowedval($vals, $fieldname) { - $retvals = array(); - $vals = !is_array($vals) ? array($vals) : $vals; - $fld = field_info_field($fieldname); - if ($fld['type'] == 'taxonomy_term_reference') { - $allowedvals1 = taxonomy_allowed_values($fld); - } - elseif ($fld['type'] == 'list_text') { - $allowedvals1 = list_allowed_values(field_info_field($fieldname)); - } - else { - // No other field types handled - return $retvals; - } - // Taxonomy tags search in values, list search in keys - $allowedvals = array_map('strtolower', $allowedvals1); - foreach ($vals as $key => $val) { - if ($fld['type'] == 'list_text') { - if (array_key_exists($val, $allowedvals)) { - $retvals[] = $val; - } - } - else { - $retvals = array_merge($retvals, array_keys($allowedvals, $val)); - } - } - return $retvals; - } - - // Little helper function for array_map - function _ccrmextvalid_mapversionval($val) { - return "civicrm {$val}"; - } - - // Little helper function for array_map - function _ccrmextvalid_mapversionvaltid($val) { - return array( 'tid' => $val); - } - - function _ccrmextvalid_seterror( $name, $message, &$keeperrors) { - // Form_set_error can only happen once on an element so collect the errors - $keeperrors[$name] = empty($keeperrors[$name]) ? $message : $keeperrors[$name] . " " . $message; - } - - function _ccrmextvalid_formseterror($errors) { - foreach ($errors as $name => $err) { - // No other field is working reliably, tried the file upload button & others so usually use title - form_set_error(check_plain($name), check_plain($err)); - } - } \ No newline at end of file diff --git a/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.test b/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.test deleted file mode 100644 index c541e60794..0000000000 --- a/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.test +++ /dev/null @@ -1,170 +0,0 @@ - 'Version Formatting', - 'description' => 'Tests version validation/formatting logic', - 'group' => 'ccrm_extensionvalidation', - ); - } - - public function setUp() { - parent::setUp(); - module_load_include('version.inc', 'ccrm_extensionvalidation'); - } - - public function testIsValid() { - $valids = array( - '1', - '1.1', - '1.2.3.4', - '1.2-3', - '1.2.alpha2', - '1.2.rc2', - '2012-01-01-1', - '2012-01-01', - 'r456', - 'r5000', - ); - $invalids = array( - 'Four', - '1.2 alpha', - '1 2', - '1.2-a', - '1/2', - '1,2', - '1.2-generalrelease', - '123456789', // exceeds padding limit - '20120101', // exceeds padding limit - '20120101124556', // exceeds padding limit - 'XIV', - '1.pre10', - ); - - foreach ($valids as $valid) { - $this->assertEqual( - TRUE, - ccrm_extensionvalidation_version_isValid($valid), - "Expected that '$valid' is valid" - ); - } - foreach ($invalids as $invalid) { - $this->assertEqual( - FALSE, - ccrm_extensionvalidation_version_isValid($invalid), - "Expected that '$invalid' is invalid" - ); - } - } - - public function testSortNormalizedValues() { - $cases = array( - array('1.alpha1', '1.alpha2', '1.beta', '1.0', '1.0.1', '1.1'), - array('1.alpha.1', '1.beta2','1.rc1'), - array('4.2.alpha1', '4.2.alpha2', '4.2.beta1', '4.2.beta2', '4.2.0'), - array('1.9', '1.9.1', '1.10', '1.10.1'), - array('r1', 'r9', 'r10', 'r900', 'r1001'), - array('1', '2', '9', '10', '11'), - array('1.0', '1.1', '2.0', '2.1', '3.0', '3.1'), - ); - foreach ($cases as $case) { - $expectedOrder = array(); - foreach ($case as $ver) { - $expectedOrder[] = ccrm_extensionvalidation_version_normalize($ver); - } - - // shuffle and sort using MySQL ordering - $actualOrder = $expectedOrder; - shuffle($actualOrder); - //$actualOrder = self::sqlSort($actualOrder); - usort($actualOrder, array(__CLASS__, 'cmpSql')); - - // did we get it right? - $this->assertEqual($expectedOrder, $actualOrder); - } - } - - public function testSplit() { - $cases = array( - '1' => array('z0000001'), - '1.1' => array('z0000001', 'z0000001'), - '1.2.3.4' => array('z0000001', 'z0000002', 'z0000003', 'z0000004'), - '1.2-3' => array('z0000001', 'z0000002', 'z0000003'), - '1.2.alpha2' => array('z0000001', 'z0000002', 'pre010', 'z0000002'), - '1.2beta2' => array('z0000001', 'z0000002', 'pre020', 'z0000002'), - '2012-01-01-1' => array('z0002012', 'z0000001', 'z0000001', 'z0000001'), - '20120101' => array('invalid'), - 'r456' => array('z0000456'), - 'r5000' => array('z0005000'), - 'whiz' => array('whiz'), - ); - foreach ($cases as $input => $expect) { - $actual = ccrm_extensionvalidation_version_split($input, CCRM_VALIDATEEXTRELEASE_PAD); - $this->assertEqual($actual, $expect, sprintf("input=[%s] expect=[%s] actual=[%s]", - $input, - implode('/', $expect), - implode('/', $actual) - )); - } - } - - - /** - * Sort a list using MySQL's default sort for VARCHARs - * - static protected function sqlSort($values) { - db_query("CREATE TEMPORARY TABLE tmp_sort (value VARCHAR(128)) ENGINE=MEMORY")->execute(); - - foreach ($values as $value) { - db_query("INSERT INTO tmp_sort (value) VALUES ('$value')"); - //db_query("INSERT INTO tmp_sort (value) VALUES (:value)", array( - // ':value' => $value, - //)); - } - $result = array(); - $q = db_query("SELECT value FROM tmp_sort ORDER BY value"); - $q->execute(); - while ($row = $q->fetchAssoc()) { - $result[] = $row['value']; - } - - db_query("DROP TEMPORARY TABLE tmp_sort")->execute(); - return $result; - } */ - - /** - * Compare two values using MySQL string comparison - * - * Note: SQL injection because WTF but doesn't matter because inputs are controlled test data - */ - static protected function cmpSql($a, $b) { - // Note: SQL injection from test data - $q = db_query("SELECT IF('$a' < '$b', 'lt','gte') as lt, IF('$a' = '$b', 'eq','ne') as eq"); - /* - $q = db_query("SELECT IF(:a < :b,'lt','gte') as lt, IF(:a = :b,'eq','ne') as eq", array( - ':a' => $a, - ':b' => $b, - )); - */ - $q->execute(); - $res = $q->fetchAssoc(); - - if ($res['eq'] == 'eq') { - return 0; - } elseif ($res['lt'] == 'lt') { - return -1; - } else { - return 1; - } - } -} diff --git a/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.version.inc b/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.version.inc deleted file mode 100644 index a9f9fdab9b..0000000000 --- a/tools/drupal/modules/ccrm_extensionvalidation/ccrm_extensionvalidation/ccrm_extensionvalidation.version.inc +++ /dev/null @@ -1,107 +0,0 @@ - 1.2.alpha) - * - * @return array of version parts - */ -function ccrm_extensionvalidation_version_split($ver, $pad = CCRM_EXTENSIONVALIDATION_PAD) { - $ver = strtolower($ver); - $ver = preg_replace('/-/', '.', $ver); - $ver = preg_replace('/^r/', '', $ver); - $ver .= '.'; - - $parts = array(); - $len = strlen($ver); - $buf = ''; - $state = 'NEW'; - for ($i = 0; $i < $len; $i++) { - if ($ver{$i} == '.') { - $newCharType = 'SEP'; - } elseif (is_numeric($ver{$i})) { - $newCharType = 'NUM'; - } else { - $newCharType = 'ALPHA'; - } - - // printf("ver=[%s] state=%-5s newCharType=%-5s char=[%s] parts=[%-12s] buf=[%s]\n", $ver, $state, $newCharType, $ver{$i}, implode('/', $parts), $buf); - switch ($state) { - case 'NEW': - $buf .= $ver{$i}; - $state = $newCharType; - break; - case 'NUM': - case 'ALPHA': - default: - if ($state == $newCharType) { - $buf .= $ver{$i}; - } elseif ($newCharType == 'SEP') { - $parts[] = $buf; - $buf = ''; - $state = 'NEW'; - } elseif ($newCharType == 'NUM') { - $parts[] = $buf; - $buf = $ver{$i}; - $state = $newCharType; - } elseif ($newCharType == 'ALPHA') { - $parts[] = $buf; - $buf = $ver{$i}; - $state = $newCharType; - } - break; - } - } - - $codes = array( - 'alpha' => 'pre010', - 'beta' => 'pre020', - 'rc' => 'pre030', - ); - foreach ($parts as $i => &$part) { - if (is_numeric($part)) { - if (strlen($part) > $pad) { - $part = 'invalid'; - } else { - $part = sprintf("z%0${pad}s", $part); - } - } else { - if (isset($codes[$part])) { - $part = $codes[$part]; - } - } - } - - return $parts; -} diff --git a/tools/drupal/modules/civicrm_professionals/civicrm_professionals.info b/tools/drupal/modules/civicrm_professionals/civicrm_professionals.info deleted file mode 100644 index 4cd8845dce..0000000000 --- a/tools/drupal/modules/civicrm_professionals/civicrm_professionals.info +++ /dev/null @@ -1,6 +0,0 @@ -name = CiviCRM Professional List -description = Contains hooks used for professional list -version = 4.1 -package = CiviCRM -core = 7.x -php = 5.2 diff --git a/tools/drupal/modules/civicrm_professionals/civicrm_professionals.module b/tools/drupal/modules/civicrm_professionals/civicrm_professionals.module deleted file mode 100644 index 2270d96bb3..0000000000 --- a/tools/drupal/modules/civicrm_professionals/civicrm_professionals.module +++ /dev/null @@ -1,44 +0,0 @@ -type == 'professionals') { - civicrm_initialize(); - global $user; - - // get the contact id of logged in user - require_once 'CRM/Core/BAO/UFMatch.php'; - $contactId = CRM_Core_BAO_UFMatch::getContactId($user->uid); - - if (!$contactId) { - drupal_set_message(t("Contact record for '@contact' not found in civicrm.", array('@contact' => $user->name)), 'error'); - return; - } - - require_once "api/api.php"; - $params = array('version' => 3); - - // make sure the group name Professional_Services match with the name in civicrm_group table - $params['name'] = 'Professional_Services'; - $result = civicrm_api('Group', 'get', $params); - - if (empty($params) || civicrm_error($result)) { - drupal_set_message(t("Group '@grp' not found in civicrm.", array('@grp' => CIVICRM_PROFESSIONALS_GROUP_NAME)), 'error'); - return; - } - - $groupId = $result['id']; - - $params = array('version' => 3, - 'contact_id' => $contactId, - 'group_id' => $groupId, - ); - - civicrm_api('GroupContact', 'create', $params); - } -} - diff --git a/tools/drupal/modules/civicrm_regsite/civicrm_regsite.info b/tools/drupal/modules/civicrm_regsite/civicrm_regsite.info deleted file mode 100644 index 60d4bcb97a..0000000000 --- a/tools/drupal/modules/civicrm_regsite/civicrm_regsite.info +++ /dev/null @@ -1,6 +0,0 @@ -name = CiviCRM Register Your Site Project -description = Helper module to collect individual and organization info for CiviCRM install -dependencies[] = civicrm -package = CiviCRM -core = 7.x -version = 4.1 diff --git a/tools/drupal/modules/civicrm_regsite/civicrm_regsite.module b/tools/drupal/modules/civicrm_regsite/civicrm_regsite.module deleted file mode 100644 index 293efe82c4..0000000000 --- a/tools/drupal/modules/civicrm_regsite/civicrm_regsite.module +++ /dev/null @@ -1,408 +0,0 @@ -"); -define('CIVICRM_SURVEY_FROM_EMAIL', "CiviCRM Training "); -define('CIVICRM_ARCHIVE_EMAIL', "CiviCRM Email Archival "); - -// ** SURVEY settings ** -// ======================= -define('CIVICRM_EVENT_SURVEY_CG_TITLE', 'Event_Survey'); -// Note: Don't forget to change name of the event type in xml data file -// when you change the event type id below -define('CIVICRM_EVENT_SURVEY_EVENT_TYPE_ID', 3); -// Note: Don't forget to change name of the template directory -// when you change the profile id below -define('CIVICRM_EVENT_SURVEY_PROFILE_ID', 9); -function civicrm_regsite_civicrm_config(&$config) { - $template = &CRM_Core_Smarty::singleton(); - - $regsiteRoot = dirname(__FILE__) . DIRECTORY_SEPARATOR; - - $regsiteDir = $regsiteRoot . 'templates'; - - if (is_array($template->template_dir)) { - array_unshift($template->template_dir, $regsiteDir); - } - else { - $template->template_dir = array($regsiteDir, $template->template_dir); - } - - // also fix php include path - $include_path = $regsiteRoot . PATH_SEPARATOR . get_include_path(); - set_include_path($include_path); - - // set the timezone - date_default_timezone_set('America/Los_Angeles'); -} - -function civicrm_regsite_civicrm_buildForm($formName, &$form) { - if ($formName == 'CRM_Profile_Form_Edit') { - if ($form->getVar('_gid') == REGSITE_PROFILE_ID) { - _civicrm_regsite_civicrm_buildForm_Profile_RegSite($form); - } - elseif ($form->getVar('_gid') == CIVICRM_EVENT_SURVEY_PROFILE_ID) { - _event_survey_civicrm_buildForm_Profile($formName, $form); - } - } -} - -function &_civicrm_regsite_get_permissioned_contacts($orgID) { - $sql = " -SELECT c.first_name, c.last_name, c.display_name, e.email -FROM civicrm_contact c -INNER JOIN civicrm_email e on e.contact_id = c.id -INNER JOIN civicrm_relationship r on r.contact_id_a = c.id -WHERE r.contact_id_b = %1 -AND r.relationship_type_id = %2 -AND r.is_active = 1 -AND r.is_permission_a_b = 1 -AND e.is_primary = 1 -"; - $params = array(1 => array($orgID, 'Integer'), - 2 => array(EMPOYER_RELATIONSHIP_TYPE_ID, 'Integer'), - ); - return CRM_Core_DAO::executeQuery($sql, $params); -} - -function _civicrm_regsite_civicrm_buildForm_Profile_RegSite(&$form) { - // add first name, last name and email - $attributes = CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact'); - - // first_name - $form->add('text', 'regsite_first_name', ts('First Name'), $attributes['first_name'], TRUE); - - // last_name - $form->add('text', 'regsite_last_name', ts('Last Name'), $attributes['last_name'], TRUE); - - // email - $form->add('text', 'regsite_email', ts('Email'), $attributes['first_name'], TRUE); - - $defaults = array(); - - // also set the default appropriately - // if logged in user, use logged in users name and email - $session = &CRM_Core_Session::singleton(); - $contactID = $session->get('userID'); - if ($contactID) { - $params = array('contact_id' => $contactID, - 'return.first_name' => 1, - 'return.last_name' => 1, - 'return.email' => 1, - 'version' => 3, - ); - - require_once 'api/api.php'; - $contact = civicrm_api('contact', 'get', $params); - if (!civicrm_error($contact)) { - $defaults['regsite_first_name'] = CRM_Utils_Array::value('first_name', $contact['values'][$contactID]); - $defaults['regsite_last_name'] = CRM_Utils_Array::value('last_name', $contact['values'][$contactID]); - $defaults['regsite_email'] = CRM_Utils_Array::value('email', $contact['values'][$contactID]); - } - } - - $orgID = $form->getVar('_id'); - if (empty($defaults) && - $orgID - ) { - $dao = &_civicrm_regsite_get_permissioned_contacts($orgID); - - // and then check for all permissioned relatioships in that org - if ($dao->fetch()) { - $defaults['regsite_first_name'] = $dao->first_name; - $defaults['regsite_last_name'] = $dao->last_name; - $defaults['regsite_email'] = $dao->email; - } - } - - $form->setDefaults($defaults); -} - -function civicrm_regsite_civicrm_postProcess($class, &$form) { - if (is_a($form, 'CRM_Profile_Form_Edit')) { - $gid = $form->getVar('_gid'); - if ($form->getVar('_gid') == REGSITE_PROFILE_ID) { - _civicrm_regsite_civicrm_postProcess_Profile_RegSite($form); - } - elseif ($form->getVar('_gid') == CIVICRM_EVENT_SURVEY_PROFILE_ID) { - _event_survey_civicrm_postProcess_Profile($class, $form); - } - } -} - -function _civicrm_regsite_civicrm_postProcess_Profile_RegSite(&$form) { - $params = $form->controller->exportValues($form->getName()); - - // first create the contact from the name and email - $orgContactParams = array('first_name' => CRM_Utils_Array::value('regsite_first_name', $params), - 'last_name' => CRM_Utils_Array::value('regsite_last_name', $params), - 'email' => CRM_Utils_Array::value('regsite_email', $params), - ); - - $dedupeParams = CRM_Dedupe_Finder::formatParams($orgContactParams, 'Individual'); - $dedupeParams['check_permission'] = FALSE; - $dupeIDs = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual', 'Unsupervised'); - - $contactID = NULL; - if (is_array($dupeIDs) && !empty($dupeIDs)) { - $contactID = array_pop($dupeIDs); - } - - $orgContactParams['email'] = array(); - $orgContactParams['email'][1] = array(); - $orgContactParams['email'][1]['email'] = CRM_Utils_Array::value('regsite_email', $params); - $orgContactParams['email'][1]['is_primary'] = 1; - $orgContactParams['email'][1]['location_type_id'] = 3; - $contactID = CRM_Contact_BAO_Contact::createProfileContact($orgContactParams, - CRM_Core_DAO::$_nullArray, - $contactID - ); - - // now lets add the contact to the group as specified in the constants - $groupParams = array('contact_id' => $contactID, - 'group_id' => REGSITE_INDIVIDUAL_GROUP, - 'version' => 3, - ); - require_once 'api/api.php'; - civicrm_api('GroupContact', 'create', $groupParams); - - // check that there is a employee / employer relationship between the two - // and if so permission that relationship, if no create it - $relationship = new CRM_Contact_DAO_Relationship(); - $relationship->contact_id_a = $contactID; - $relationship->contact_id_b = $form->getVar('_id'); - $relationship->relationship_type_id = EMPOYER_RELATIONSHIP_TYPE_ID; - - $relationship->selectAdd(); - $relationship->selectAdd('id, is_active, is_permission_a_b'); - $relationship->find(TRUE); - - $relationship->is_active = 1; - $relationship->is_permission_a_b = 1; - $relationship->save(); - - $smarty = &CRM_Core_Smarty::singleton(); - - // lets get the profile values - require_once 'CRM/Core/BAO/UFGroup.php'; - $smartyParams = array(); - - $smartyParams['organizationName'] = CRM_Utils_Array::value('organization_name', $params); - $smartyParams['contactName'] = "{$params['regsite_first_name']} {$params['regsite_last_name']} ({$params['regsite_email']})"; - - $profileValues = array(); - CRM_Core_BAO_UFGroup::getValues($form->getVar('_id'), - $form->getVar('_fields'), - $profileValues - ); - - // create a hashLink - $orgID = $form->getVar('_id'); - $smartyParams['hashLink'] = CRM_Utils_System::url('civicrm/profile/edit', - "reset=1&id=$orgID&gid=" . REGSITE_PROFILE_ID . - "&cs=" . - CRM_Contact_BAO_Contact_Utils::generateChecksum($orgID), - TRUE, NULL, FALSE - ); - - $smarty->assign_by_ref('displayValues', $smartyParams); - $smarty->assign_by_ref('profileValues', $profileValues); - - $subject = $smarty->fetch('Mail/RegSite/Subject.tpl'); - $body = $smarty->fetch('Mail/RegSite/Message.tpl'); - - // now send email to both user and org - $params = array('from' => CIVICRM_REGSITE_FROM_EMAIL, - 'toName' => "{$params['regsite_first_name']} {$params['regsite_last_name']}", - 'toEmail' => CRM_Utils_Array::value('regsite_email', $params), - 'cc' => CRM_Utils_Array::value('email-Primary', $params), - 'bcc' => CIVICRM_ARCHIVE_EMAIL, - 'subject' => $subject, - 'text' => $body, - ); - - require_once 'CRM/Utils/Mail.php'; - CRM_Utils_Mail::send($params); -} - -function civicrm_regsite_civicrm_pageRun(&$page) { - $name = $page->getVar('_name'); - if ($name == 'CRM_Profile_Page_Dynamic') { - if ($page->getVar('_gid') == REGSITE_PROFILE_ID) { - return _civicrm_regsite_civicrm_pageRun_Profile_RegSite($page); - } - elseif ($page->getVar('_gid') == CIVICRM_EVENT_SURVEY_PROFILE_ID) { - _event_survey_civicrm_pageRun_Profile($page); - } - } -} - -function _civicrm_regsite_civicrm_pageRun_Profile_RegSite(&$page) { - // get the id of the org - $orgID = $page->getVar('_id'); - - $dao = &_civicrm_regsite_get_permissioned_contacts($orgID); - - $names = array(); - while ($dao->fetch()) { - $names[] = "{$dao->display_name} ({$dao->email})"; - } - - if (!empty($names)) { - $contactPersonString = implode(', ', $names); - $page->assign('contactPersonString', $contactPersonString); - } -} - -function civicrm_regsite_civicrm_links($op, $objectName, $objectId, &$links) { - if ($op != 'view.contact.userDashBoard') { - return; - } - - // take the update link and move it to the profile - $links[CRM_Core_Action::UPDATE]['url'] = 'civicrm/profile/edit'; - $links[CRM_Core_Action::UPDATE]['qs'] = "reset=1&gid=" . REGSITE_PROFILE_ID . "&id=%%cbid%%"; - - return $links; -} - -function _event_survey_civicrm_buildForm_Profile($formName, &$form) { - $cgID = _event_survey_civicrm_getCustomGroupID(CIVICRM_EVENT_SURVEY_CG_TITLE); - if (empty($cgID)) { - return; - } - require_once 'CRM/Core/BAO/CustomGroup.php'; - $groupTree = &CRM_Core_BAO_CustomGroup::getTree('Participant', - $form, - NULL, - $cgID, - CIVICRM_EVENT_SURVEY_EVENT_TYPE_ID - ); - // simplified formatted groupTree - $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, 1, $form); - CRM_Core_BAO_CustomGroup::buildQuickForm($form, $groupTree, FALSE, 'event_survey_'); - - if (isset($groupTree) && is_array($groupTree)) { - $participantId = CRM_Utils_Request::retrieve('pid', 'Positive', $form, TRUE, 0, 'REQUEST'); - $contactId = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Participant", $participantId, 'contact_id'); - $form->setVar('_id', $contactId); - } -} - -function _event_survey_civicrm_postProcess_Profile($class, &$form) { - $cgID = _event_survey_civicrm_getCustomGroupID(CIVICRM_EVENT_SURVEY_CG_TITLE); - if (empty($cgID)) { - return; - } - require_once 'CRM/Core/BAO/CustomGroup.php'; - $groupTree = &CRM_Core_BAO_CustomGroup::getTree('Participant', - $form, - NULL, - $cgID, - CIVICRM_EVENT_SURVEY_EVENT_TYPE_ID - ); - // simplified formatted groupTree - $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, 1, $form); - - if (isset($groupTree) && is_array($groupTree)) { - $participantId = CRM_Utils_Request::retrieve('pid', 'Positive', $form, TRUE, 0, 'REQUEST'); - - $params = $form->controller->exportValues($form->getVar('_name')); - require_once 'CRM/Core/BAO/CustomValueTable.php'; - CRM_Core_BAO_CustomValueTable::postProcess($params, - $groupTree[$cgID]['fields'], - 'civicrm_participant', - $participantId, - 'Participant' - ); - // mailing part - $smarty = &CRM_Core_Smarty::singleton(); - $smarty->assign_by_ref('profileValues', $params); - - $subject = $smarty->fetch('Mail/Survey/Subject.tpl'); - $body = $smarty->fetch('Mail/Survey/Message.tpl'); - - // now send email to both user and org - $params = array('from' => CIVICRM_REGSITE_FROM_EMAIL, - 'toName' => "{$params['first_name']} {$params['last_name']}", - 'toEmail' => $params['email-Primary'], - 'bcc' => CIVICRM_ARCHIVE_EMAIL, - 'subject' => $subject, - 'text' => $body, - ); - require_once 'CRM/Utils/Mail.php'; - CRM_Utils_Mail::send($params); - - return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/profile/view', - "reset=1&gid=" . $form->getVar('_gid') . - "&id=" . $form->getVar('_id') . - "&pid=" . $participantId - )); - } -} - -function _event_survey_civicrm_pageRun_Profile(&$page) { - $cgID = _survey_civicrm_getCustomGroupID(CIVICRM_EVENT_SURVEY_CG_TITLE); - if (empty($cgID)) { - return; - } - $participantId = CRM_Utils_Request::retrieve('pid', 'Positive', $page, TRUE, 0, 'REQUEST'); - $contactID = $page->getVar('_id'); - - require_once 'CRM/Core/BAO/CustomGroup.php'; - $groupTree = &CRM_Core_BAO_CustomGroup::getTree('Participant', - $form, - $participantId, - $cgID, - CIVICRM_EVENT_SURVEY_EVENT_TYPE_ID - ); - CRM_Core_BAO_CustomGroup::buildCustomDataView($page, - $groupTree, - FALSE, NULL, - 'event_survey_' - ); -} - -function _event_survey_civicrm_getCustomGroupID($customGroupName) { - require_once 'CRM/Utils/Type.php'; - $customGroupName = CRM_Utils_Type::escape($customGroupName, 'String'); - return CRM_Core_DAO::getFieldValue("CRM_Core_DAO_CustomGroup", $customGroupName, 'id', 'name'); -} - diff --git a/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Form/15/Edit.tpl b/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Form/15/Edit.tpl deleted file mode 100644 index 4d14f86413..0000000000 --- a/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Form/15/Edit.tpl +++ /dev/null @@ -1,307 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.1 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2011 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM. | - | | - | CiviCRM is free software; you can copy, modify, and distribute it | - | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | - | | - | CiviCRM is distributed in the hope that it will be useful, but | - | WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | - | See the GNU Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License and the CiviCRM Licensing Exception along | - | with this program; if not, contact CiviCRM LLC | - | at info[AT]civicrm[DOT]org. If you have questions about the | - | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} -{* Profile forms when embedded in CMS account create (mode=1) or cms account edit (mode=8) or civicrm/profile (mode=4) pages *} -{if $context neq 'dialog'} - -{/if} -{if ! empty( $fields )} -{* Wrap in crm-container div so crm styles are used.*} -{* Replace div id with this logic if you want CMS account create and CMS edit to use CMS theme styles: id="{if $mode eq 4}crm-container{else}crm-profile-block{/if}" *} -
- {if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) } -
- {$form._qf_Edit_upload_duplicate.html} -
- {/if} - {if $mode eq 1 || $activeComponent neq "CiviCRM"} - {include file="CRM/Form/body.tpl"} - {/if} - {strip} - {if $help_pre && $action neq 4} -
{$help_pre}
- {/if} - - {include file="CRM/common/CMSUser.tpl"} - -
- {ts}Help strengthen the CiviCRM ecosystem to taking a few minutes to fill out this registration form. - The information collected will help us prioritize improvements, target our communications and build the community.{/ts} -
- -
- Personal Information -
-
-
{$form.regsite_first_name.label}
-
{$form.regsite_first_name.html}
-
-
-
{$form.regsite_last_name.label}
-
{$form.regsite_last_name.html}
-
- -
-
- -
- Organization Information - {assign var=zeroField value="Initial Non Existent Fieldset"} - {assign var=fieldset value=$zeroField} - {foreach from=$fields item=field key=fieldName} - {assign var="profileID" value=$field.group_id} - {assign var=n value=$field.name} - {if $form.$n} - {if $field.groupTitle != $fieldset} - {if $fieldset != $zeroField} - {if $groupHelpPost} -
{$groupHelpPost}
- {/if} - {if $mode neq 8 && $mode neq 4} -
-
- {/if} - {/if} - - {if $mode neq 8 && $mode neq 4} -
-
{$field.groupTitle} - {/if} - {assign var=fieldset value=`$field.groupTitle`} - {assign var=groupHelpPost value=`$field.groupHelpPost`} - {if $field.groupHelpPre} -
{$field.groupHelpPre}
- {/if} -
- {/if} - - {if $field.options_per_line} -
-
{$form.$n.label}
-
- {assign var="count" value="1"} - {strip} - - - {* sort by fails for option per line. Added a variable to iterate through the element array*} - {assign var="index" value="1"} - {foreach name=outer key=key item=item from=$form.$n} - {if $index < 10} - {assign var="index" value=`$index+1`} - {else} - - {if $count == $field.options_per_line} - - - {assign var="count" value="1"} - {else} - {assign var="count" value=`$count+1`} - {/if} - {/if} - {/foreach} - -
{$form.$n.$key.html}
- {if $field.html_type eq 'Radio' and $form.formName eq 'Edit' and $field.is_view neq 1 } -  ({ts}clear{/ts}) - {/if} - {/strip} -
-
-
{* end of main edit section div*} - {else} -
-
{$form.$n.label}
-
- {if $n|substr:0:3 eq 'im-'} - {assign var="provider" value=$n|cat:"-provider_id"} - {$form.$provider.html}  - {else if $n|substr:0:4 eq 'url-'} - {assign var="websiteType" value=$n|cat:"-website_type_id"} - {$form.$websiteType.html}  - {/if} - {if $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'} - {include file="CRM/Profile/Form/GreetingType.tpl"} - {elseif ( $n eq 'group' && $form.group ) || ( $n eq 'tag' && $form.tag )} - {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$n} - {elseif ( $form.$n.name eq 'image_URL' )} - {$form.$n.html} - {if $imageURL} -
-
- {include file="CRM/Contact/Page/ContactImage.tpl"} -
-
- {/if} - {else} - {if ( $field.data_type eq 'Date' or - ( ( ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) ) ) ) and $field.is_view neq 1 } - {include file="CRM/common/jcalendar.tpl" elementName=$n} - {else} - {$form.$n.html} - {/if} - {if (($n eq 'gender') or ($field.html_type eq 'Radio' and $form.formName eq 'Edit' and $field.is_required neq 1)) and - ($field.is_view neq 1)} -  ({ts}clear{/ts}) - {elseif $field.html_type eq 'Autocomplete-Select'} - {include file="CRM/Custom/Form/AutoComplete.tpl" element_name = $n} - {/if} - {/if} -
-
-
- - {if $form.$n.type eq 'file'} -
{$customFiles.$n.displayURL}
-
{$customFiles.$n.deleteURL}
- {/if} - {/if} - - {* Show explanatory text for field if not in 'view' mode *} - {if $field.help_post && $action neq 4 && $form.$n.html} -
-
{$field.help_post}
-
- {/if} - {/if}{* end of main if field name if *} - {/foreach} -
{* closing main form layout div when all the fields are built*} - - - {if $isCaptcha && ( $mode eq 8 || $mode eq 4 || $mode eq 1 ) } - {include file='CRM/common/ReCAPTCHA.tpl'} - - {/if} - - {if $field.groupHelpPost} -
{$field.groupHelpPost}
- {/if} - - {if $mode neq 8 && $mode neq 4} -
-
- {/if} - - {if ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192)} -
- {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if} -
- {/if} - {if $help_post && $action neq 4}
{$help_post}
{/if} - {/strip} - - {* organization info *} - - {* end crm-container div *} - - -{/if} {* fields array is not empty *} - -{if $drupalCms} -{include file="CRM/common/showHideByFieldValue.tpl" -trigger_field_id ="create_account" -trigger_value ="" -target_element_id ="details" -target_element_type ="block" -field_type ="radio" -invert = 0 -} -{elseif $statusMessage} -
-
- {$statusMessage} -
-{/if} -{literal} - -{/literal} diff --git a/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Form/Survey/Edit.tpl b/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Form/Survey/Edit.tpl deleted file mode 100644 index a65c1a7158..0000000000 --- a/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Form/Survey/Edit.tpl +++ /dev/null @@ -1,290 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.1 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2011 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM. | - | | - | CiviCRM is free software; you can copy, modify, and distribute it | - | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | - | | - | CiviCRM is distributed in the hope that it will be useful, but | - | WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | - | See the GNU Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License and the CiviCRM Licensing Exception along | - | with this program; if not, contact CiviCRM LLC | - | at info[AT]civicrm[DOT]org. If you have questions about the | - | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} -{* Profile forms when embedded in CMS account create (mode=1) or cms account edit (mode=8) or civicrm/profile (mode=4) pages *} -{if $context neq 'dialog'} - -{/if} -{if ! empty( $fields )} -{* Wrap in crm-container div so crm styles are used.*} -{* Replace div id with this logic if you want CMS account create and CMS edit to use CMS theme styles: id="{if $mode eq 4}crm-container{else}crm-profile-block{/if}" *} -
- {if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) } -
- {$form._qf_Edit_upload_duplicate.html} -
- {/if} - {if $mode eq 1 || $activeComponent neq "CiviCRM"} - {include file="CRM/Form/body.tpl"} - {/if} - {strip} - {if $help_pre && $action neq 4} -
{$help_pre}
- {/if} - - {include file="CRM/common/CMSUser.tpl"} - - {assign var=zeroField value="Initial Non Existent Fieldset"} - {assign var=fieldset value=$zeroField} - {foreach from=$fields item=field key=fieldName} - {assign var="profileID" value=$field.group_id} - {assign var=n value=$field.name} - {if $form.$n} - {if $field.groupTitle != $fieldset} - {if $fieldset != $zeroField} - {if $groupHelpPost} -
{$groupHelpPost}
- {/if} - {if $mode neq 8 && $mode neq 4} -
- - - {/if} - {/if} - - {if $mode neq 8 && $mode neq 4} -
-
{$field.groupTitle} - {/if} - {assign var=fieldset value=`$field.groupTitle`} - {assign var=groupHelpPost value=`$field.groupHelpPost`} - {if $field.groupHelpPre} -
{$field.groupHelpPre}
- {/if} -
- {/if} - - {if $field.options_per_line} -
-
{$form.$n.label}
-
- {assign var="count" value="1"} - {strip} - - - {* sort by fails for option per line. Added a variable to iterate through the element array*} - {assign var="index" value="1"} - {foreach name=outer key=key item=item from=$form.$n} - {if $index < 10} - {assign var="index" value=`$index+1`} - {else} - - {if $count == $field.options_per_line} - - - {assign var="count" value="1"} - {else} - {assign var="count" value=`$count+1`} - {/if} - {/if} - {/foreach} - -
{$form.$n.$key.html}
- {if $field.html_type eq 'Radio' and $form.formName eq 'Edit' and $field.is_view neq 1 } -  ({ts}clear{/ts}) - {/if} - {/strip} -
-
-
{* end of main edit section div*} - {else} -
-
{$form.$n.label}
-
- {if $n|substr:0:3 eq 'im-'} - {assign var="provider" value=$n|cat:"-provider_id"} - {$form.$provider.html}  - {else if $n|substr:0:4 eq 'url-'} - {assign var="websiteType" value=$n|cat:"-website_type_id"} - {$form.$websiteType.html}  - {/if} - {if $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'} - {include file="CRM/Profile/Form/GreetingType.tpl"} - {elseif ( $n eq 'group' && $form.group ) || ( $n eq 'tag' && $form.tag )} - {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$n} - {elseif ( $form.$n.name eq 'image_URL' )} - {$form.$n.html} - {if $imageURL} -
-
- {include file="CRM/Contact/Page/ContactImage.tpl"} -
-
- {/if} - {else} - {if ( $field.data_type eq 'Date' or - ( ( ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) ) ) ) and $field.is_view neq 1 } - {include file="CRM/common/jcalendar.tpl" elementName=$n} - {else} - {$form.$n.html} - {/if} - {if (($n eq 'gender') or ($field.html_type eq 'Radio' and $form.formName eq 'Edit' and $field.is_required neq 1)) and - ($field.is_view neq 1)} -  ({ts}clear{/ts}) - {elseif $field.html_type eq 'Autocomplete-Select'} - {include file="CRM/Custom/Form/AutoComplete.tpl" element_name = $n} - {/if} - {/if} -
-
-
- - {if $form.$n.type eq 'file'} -
{$customFiles.$n.displayURL}
-
{$customFiles.$n.deleteURL}
- {/if} - {/if} - - {* Show explanatory text for field if not in 'view' mode *} - {if $field.help_post && $action neq 4 && $form.$n.html} -
-
{$field.help_post}
-
- {/if} - {/if}{* end of main if field name if *} - {/foreach} -
{* closing main form layout div when all the fields are built*} - - - {if $isCaptcha && ( $mode eq 8 || $mode eq 4 || $mode eq 1 ) } - {include file='CRM/common/ReCAPTCHA.tpl'} - - {/if} - - {if $field.groupHelpPost} -
{$field.groupHelpPost}
- {/if} - - {if $mode neq 8 && $mode neq 4} -
-
- {/if} - - {foreach from=$event_survey_groupTree item=cd_edit key=group_id} - {foreach from=$cd_edit.fields item=element key=field_id} - - {include file="CRM/Custom/Form/CustomField.tpl"} -
- {/foreach} - {/foreach} - - {if ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192)} -
- {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if} -
- {/if} - {if $help_post && $action neq 4}
{$help_post}
{/if} - {/strip} - - {* end crm-container div *} - - -{/if} {* fields array is not empty *} - -{if $drupalCms} -{include file="CRM/common/showHideByFieldValue.tpl" -trigger_field_id ="create_account" -trigger_value ="" -target_element_id ="details" -target_element_type ="block" -field_type ="radio" -invert = 0 -} -{elseif $statusMessage} -
-
- {$statusMessage} -
-{/if} -{literal} - -{/literal} - diff --git a/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Page/Regsite/Dynamic.tpl b/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Page/Regsite/Dynamic.tpl deleted file mode 100644 index dff645db79..0000000000 --- a/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Page/Regsite/Dynamic.tpl +++ /dev/null @@ -1,53 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.1 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2011 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM. | - | | - | CiviCRM is free software; you can copy, modify, and distribute it | - | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | - | | - | CiviCRM is distributed in the hope that it will be useful, but | - | WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | - | See the GNU Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License and the CiviCRM Licensing Exception along | - | with this program; if not, contact CiviCRM LLC | - | at info[AT]civicrm[DOT]org. If you have questions about the | - | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} -{if ! empty( $row )} -{* wrap in crm-container div so crm styles are used *} - {if $overlayProfile } - {include file="CRM/Profile/Page/Overlay.tpl"} - {else} -
- {if $contactPersonString} -
-
Contact Person(s)
-
{$contactPersonString}
-
-
- {/if} - {foreach from=$profileFields item=field key=rowName} -
-
- {$field.label} -
-
- {$field.value} -
-
-
- {/foreach} -
- {/if} -{/if} -{* fields array is not empty *} diff --git a/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Page/Survey/Dynamic.tpl b/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Page/Survey/Dynamic.tpl deleted file mode 100644 index 773c727034..0000000000 --- a/tools/drupal/modules/civicrm_regsite/templates/CRM/Profile/Page/Survey/Dynamic.tpl +++ /dev/null @@ -1,51 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | CiviCRM version 4.1 | - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2011 | - +--------------------------------------------------------------------+ - | This file is a part of CiviCRM. | - | | - | CiviCRM is free software; you can copy, modify, and distribute it | - | under the terms of the GNU Affero General Public License | - | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | - | | - | CiviCRM is distributed in the hope that it will be useful, but | - | WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | - | See the GNU Affero General Public License for more details. | - | | - | You should have received a copy of the GNU Affero General Public | - | License and the CiviCRM Licensing Exception along | - | with this program; if not, contact CiviCRM LLC | - | at info[AT]civicrm[DOT]org. If you have questions about the | - | GNU Affero General Public License or the licensing of CiviCRM, | - | see the CiviCRM license FAQ at http://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} -{if ! empty( $row )} -{* wrap in crm-container div so crm styles are used *} - {if $overlayProfile } - {include file="CRM/Profile/Page/Overlay.tpl"} - {else} -
-
- - {foreach from=$profileFields item=field key=rowName} - - - - - {/foreach} - {foreach from=$event_survey_viewCustomData item=customValues key=customGroupId} - {foreach from=$customValues item=cd_edit key=cvID} - {foreach from=$cd_edit.fields item=element key=field_id} - {include file="CRM/Contact/Page/View/CustomDataFieldView.tpl"} - {/foreach} - {/foreach} - {/foreach} -
{$field.label}{$field.value}
-
- {/if} -{/if} -{* fields array is not empty *} diff --git a/tools/drupal/modules/civicrm_regsite/templates/Mail/RegSite/Message.tpl b/tools/drupal/modules/civicrm_regsite/templates/Mail/RegSite/Message.tpl deleted file mode 100644 index 6f5c1e32e2..0000000000 --- a/tools/drupal/modules/civicrm_regsite/templates/Mail/RegSite/Message.tpl +++ /dev/null @@ -1,26 +0,0 @@ - -Dear {$displayValues.contactName}: - -Thank you for registering your organization - {$displayValues.organizationName} - as part of the -CiviCRM Register Your Site project. Registration information will be used to help improve CiviCRM -as a project, and help in building a stronger ecosystem. - -Here are the values you entered on the form: - -{foreach from=$profileValues item=value key=name} -{$name}: {$value|strip_tags:false} -{/foreach} - -If you want to modify this information, please click this link: {$displayValues.hashLink} - -NOTE: The link above will expire in 7 days. After that time, you will need to login into -CiviCRM.org and click on the "Contact Dashboard" link available at the top left hand corner -of your screen. - -Regards - -The CiviCRM Team - -p.s. Have you done your part to "make it happen"? The "CiviCRM Make It Happen" Project gives every -member of the CiviCRM community an opportunity to support improvements that are important to them. -Consider making a contribution now at: http://civicrm.org/contribute \ No newline at end of file diff --git a/tools/drupal/modules/civicrm_regsite/templates/Mail/RegSite/Subject.tpl b/tools/drupal/modules/civicrm_regsite/templates/Mail/RegSite/Subject.tpl deleted file mode 100644 index b2d8ca5371..0000000000 --- a/tools/drupal/modules/civicrm_regsite/templates/Mail/RegSite/Subject.tpl +++ /dev/null @@ -1 +0,0 @@ -Thank you for registering your CiviCRM site for {$displayValues.organizationName}. \ No newline at end of file diff --git a/tools/drupal/modules/civicrm_regsite/templates/Mail/Survey/Message.tpl b/tools/drupal/modules/civicrm_regsite/templates/Mail/Survey/Message.tpl deleted file mode 100644 index 9956ca417d..0000000000 --- a/tools/drupal/modules/civicrm_regsite/templates/Mail/Survey/Message.tpl +++ /dev/null @@ -1,10 +0,0 @@ -Dear {$profileValues.first_name} {$profileValues.last_name}, - -Thank you for providing valuable feedback which will help us improve future training and sprint events. - -Regards, -The CiviCRM Team - -p.s. Have you done your part to "make it happen"? The "CiviCRM Make It Happen" Project gives every -member of the CiviCRM community an opportunity to support improvements that are important to them. -Consider making a contribution now at: http://civicrm.org/contribute \ No newline at end of file diff --git a/tools/drupal/modules/civicrm_regsite/templates/Mail/Survey/Subject.tpl b/tools/drupal/modules/civicrm_regsite/templates/Mail/Survey/Subject.tpl deleted file mode 100644 index 59657e1b27..0000000000 --- a/tools/drupal/modules/civicrm_regsite/templates/Mail/Survey/Subject.tpl +++ /dev/null @@ -1 +0,0 @@ -Thank you for feedback \ No newline at end of file diff --git a/tools/drupal/modules/civicrm_regsite/xml/CustomGroupData.xml b/tools/drupal/modules/civicrm_regsite/xml/CustomGroupData.xml deleted file mode 100644 index 7dac31f9f0..0000000000 --- a/tools/drupal/modules/civicrm_regsite/xml/CustomGroupData.xml +++ /dev/null @@ -1,1243 +0,0 @@ - - - - - - CiviCRM_Site_Registration - CiviCRM Site Registration - Organization - - 0 - - - 2 - 1 - civicrm_value_civicrm_site_registration_4 - 0 - 0 - 0000-00-00 00:00:00 - - - Event_Survey - Event Survey - Participant - ParticipantEventType - Fundraiser - - - - 1 - civicrm_value_Event_Survey - 0 - 0 - - - - - - String - Select - 0 - 1 - 0 - 1 - 1 - 0 - 255 - 60 - 4 - number_of_employees_8 - number_of_employees_20100908143104 - CiviCRM_Site_Registration - - - - String - Select - 0 - 1 - 0 - 2 - 1 - 0 - 255 - 60 - 4 - annual_budget__usd__9 - annual_budget__usd__20100908143601 - CiviCRM_Site_Registration - - - - String - CheckBox - 0 - 1 - 0 - 3 - Select one or more categories that most closely describe your organization's the focus area(s). - 1 - 0 - 3 - 255 - 60 - 4 - organization_sector_10 - organization_sector_20100908145433 - CiviCRM_Site_Registration - - - - String - Text - 0 - 0 - 0 - 4 - 1 - 0 - 255 - 60 - 4 - other_sector_11 - CiviCRM_Site_Registration - - - - String - CheckBox - 0 - 1 - 0 - 5 - Mark the CiviCRM components that your organization uses. - 1 - 0 - 3 - 255 - 60 - 4 - civicrm_components_12 - civicrm_components_20100908150826 - CiviCRM_Site_Registration - - - - Memo - TextArea - 0 - 0 - 0 - 6 - Briefly describe how your organization uses CiviCRM. - rows=4, cols=60 - 1 - 0 - 255 - 60 - 4 - how_are_you_using_civicrm_13 - CiviCRM_Site_Registration - - - - String - Text - 0 - 0 - 0 - 7 - If your organization used a consultant to assist in installing, configuring or customizing CiviCRM enter the consulting firm name here. - 1 - 0 - 255 - 60 - 4 - civicrm_consulting_firm__14 - CiviCRM_Site_Registration - - - - String - Radio - 0 - 1 - 0 - 8 - Rate your organization's overall satisfaction level with CiviCRM from A (very satisfied) to F (extremely unsatisfied). - 1 - 0 - 5 - 255 - 60 - 4 - satisfaction_with_civicrm__15 - satisfaction_with_civicrm__20100908151542 - CiviCRM_Site_Registration - - - - String - Radio - 0 - 0 - 0 - 9 - Rate the overall usability of CiviCRM from A (high usability) to F (extremely difficult to use). - 1 - 0 - 5 - 255 - 60 - 4 - usability_rating_16 - satisfaction_with_civicrm__20100908151542 - CiviCRM_Site_Registration - - - - Boolean - Radio - 0 - 1 - 0 - 10 - Would you recommend CiviCRM to other organizations like yours? - 1 - 0 - 255 - 60 - 4 - recommend_to_others__17 - CiviCRM_Site_Registration - - - - Date - Select Date - 0 - 0 - 0 - 11 - 1 - 1 - 255 - yy-mm-dd - 60 - 4 - date_added_18 - CiviCRM_Site_Registration - - - - ContactReference - Autocomplete-Select - 0 - 0 - 0 - 12 - 1 - 1 - 255 - 60 - 4 - added_by_19 - CiviCRM_Site_Registration - - - - String - Radio - 0 - 0 - 0 - 1 - 1 - 0 - 255 - 60 - 4 - training_space_and_environment - satisfaction_with_civicrm__20100908151542 - Event_Survey - - - - String - Radio - 0 - 0 - 0 - 2 - 1 - 0 - 255 - 60 - 4 - presentation_quality - satisfaction_with_civicrm__20100908151542 - Event_Survey - - - - String - Radio - 0 - 0 - 0 - 3 - 1 - 0 - 255 - 60 - 4 - presenters_speakers - satisfaction_with_civicrm__20100908151542 - Event_Survey - - - - String - Radio - 0 - 0 - 0 - 4 - 1 - 0 - 255 - 60 - 4 - training_materials_exercises - satisfaction_with_civicrm__20100908151542 - Event_Survey - - - - String - Radio - 0 - 0 - 0 - 5 - 1 - 0 - 255 - 60 - 4 - food_14 - satisfaction_with_civicrm__20100908151542 - Event_Survey - - - - Memo - TextArea - 0 - 0 - 0 - 6 - 1 - 0 - 255 - 60 - 4 - were_your_expectations_met - Event_Survey - - - - Memo - TextArea - 0 - 0 - 0 - 7 - 1 - 0 - 255 - 60 - 4 - what_areas_of_improvement - Event_Survey - - - - Memo - TextArea - 0 - 0 - 0 - 8 - 1 - 0 - 255 - 60 - 4 - find_case_studies_helpful - Event_Survey - - - - Memo - TextArea - 0 - 0 - 0 - 9 - 1 - 0 - 255 - 60 - 4 - what_other_resources - Event_Survey - - - - Memo - TextArea - 0 - 0 - 0 - 10 - 1 - 0 - 255 - 60 - 4 - other_comments - Event_Survey - - - - - number_of_employees_20100908143104 - - 1 - - - annual_budget__usd__20100908143601 - - 1 - - - organization_sector_20100908145433 - - 1 - - - civicrm_components_20100908150826 - - 1 - - - satisfaction_with_civicrm__20100908151542 - - 1 - - - - - - 10 or Under - 10_or_Under - 0 - 1 - 0 - 0 - 1 - number_of_employees_20100908143104 - - - - 11 to 29 - 11_to_29 - 0 - 2 - 0 - 0 - 1 - number_of_employees_20100908143104 - - - - 100 to 249 - 199_to_249 - 0 - 4 - 0 - 0 - 1 - number_of_employees_20100908143104 - - - - 250 or More - 250_or_More - 0 - 5 - 0 - 0 - 1 - number_of_employees_20100908143104 - - - - 30 to 99 - 30_to_99 - 0 - 3 - 0 - 0 - 1 - number_of_employees_20100908143104 - - - - Don't know - Don_t_know - 0 - 6 - 0 - 0 - 1 - number_of_employees_20100908143104 - - - - $3 million to $10 million - _3_million_to__10_million - 0 - 3 - 0 - 0 - 1 - annual_budget__usd__20100908143601 - - - - $500k to $3 million - _500k_to__3_million - 0 - 2 - 0 - 0 - 1 - annual_budget__usd__20100908143601 - - - - Don't know - Don_t_know - 0 - 5 - 0 - 0 - 1 - annual_budget__usd__20100908143601 - - - - More then $10 million - More_then__10_million - 0 - 4 - 0 - 0 - 1 - annual_budget__usd__20100908143601 - - - - Under $500k - Under__500k - 0 - 1 - 0 - 0 - 1 - annual_budget__usd__20100908143601 - - - - Civil Rights, Social Action and Advocacy - 0 - 3 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Community Improvement and Capacity Building - 0 - 4 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Diseases, Disorders and Medical Disciplines - 0 - 6 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Human Rights, International, Foreign Affairs - 0 - 15 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Mental Health and Crisis Intervention - 0 - 19 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Public Safety, Disaster Preparedness and Relief - 0 - 24 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Animal-related - Animal_related - 0 - 1 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Arts, Culture, Humanities - Arts_Culture_Humanities - 0 - 2 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Crime and Legal-related - Crime_and_Legal_related - 0 - 5 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Education - Education - 0 - 7 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Employment - Employment - 0 - 8 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Environment - Environment - 0 - 9 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Food, Agriculture and Nutrition - Food_Agriculture_and_Nutrition - 0 - 10 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Foundation - Foundation - 0 - 11 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Government Entity - Government_Entity - 0 - 12 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Health Care - Health_Care - 0 - 13 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Housing and Shelter - Housing_and_Shelter - 0 - 14 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Human Services - Human_Services - 0 - 16 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Library - Library - 0 - 17 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Medical Research - Medical_Research - 0 - 18 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Other - Other__please_specify_ - 0 - 30 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Political Campaign - Political_Campaign - 0 - 20 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Political Group / Party - Political_Group__Party - 0 - 21 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Professional Society - Professional_Society - 0 - 22 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Public and Societal Benefit - Public_and_Societal_Benefit - 0 - 23 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Recreation and Sports - Recreation_and_Sports - 0 - 25 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Religion-related - Religion_related - 0 - 26 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Science and Technology - Science_and_Technology - 0 - 27 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Trade Association - Trade_Association - 0 - 28 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - Youth Development - Youth_Development - 0 - 29 - 0 - 0 - 1 - organization_sector_20100908145433 - - - - CiviCase - CiviCase - 0 - 1 - 0 - 0 - 1 - civicrm_components_20100908150826 - - - - CiviContribute - CiviContribute - 0 - 2 - 0 - 0 - 1 - civicrm_components_20100908150826 - - - - CiviEvent - CiviEvent - 0 - 3 - 0 - 0 - 1 - civicrm_components_20100908150826 - - - - CiviGrant - CiviGrant - 0 - 4 - 0 - 0 - 1 - civicrm_components_20100908150826 - - - - CiviMail - CiviMail - 0 - 5 - 0 - 0 - 1 - civicrm_components_20100908150826 - - - - CiviMember - CiviMember - 0 - 6 - 0 - 0 - 1 - civicrm_components_20100908150826 - - - - Excellent - 0 - 1 - 0 - 0 - 1 - satisfaction_with_civicrm__20100908151542 - - - - Good - 0 - 2 - 0 - 0 - 1 - satisfaction_with_civicrm__20100908151542 - - - - Average - 0 - 3 - 0 - 0 - 1 - satisfaction_with_civicrm__20100908151542 - - - - Below Average - 0 - 4 - 0 - 0 - 1 - satisfaction_with_civicrm__20100908151542 - - - - Poor - 0 - 5 - 0 - 0 - 1 - satisfaction_with_civicrm__20100908151542 - - - - - 1 - Organization,Contact - Register Your Site Profile - 0 - 0 - 0 - 0 - 0 - 2010-09-08 15:14:24 - 0 - - - - - organization_name - 1 - 0 - 1 - 1 - - Public Pages - 0 - 1 - - Organization - Register Your Site Profile - - - email - 1 - 0 - 0 - 2 - - Public Pages - 1 - 1 - - Contact - Register Your Site Profile -11 - - url-1 - 1 - 0 - 1 - 3 - - Public Pages - 1 - 0 - - Contact - Register Your Site Profile - - - city - 1 - 0 - 0 - 4 - - Public Pages - 1 - 0 - - Contact - Register Your Site Profile - - - state_province - 1 - 0 - 0 - 5 - - Public Pages - 1 - 0 - - Contact - Register Your Site Profile - - - country - 1 - 0 - 0 - 6 - - Public Pages and Listings - 1 - 0 - - Contact - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.annual_budget__usd__9 - 1 - 0 - 0 - 7 - - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.civicrm_components_12 - 1 - 0 - 0 - 12 - Mark the CiviCRM components that your organization uses. - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.civicrm_consulting_firm__14 - 1 - 0 - 0 - 16 - If your organization used a consultant to assist in installing, configuring or customizing CiviCRM enter the consulting firm name here. - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.how_are_you_using_civicrm_13 - 1 - 0 - 0 - 11 - Briefly describe how your organization uses CiviCRM. - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.number_of_employees_8 - 1 - 0 - 0 - 8 - - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.organization_sector_10 - 1 - 0 - 0 - 9 - Select one or more categories that most closely describe your organization's focus area(s). - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.other_sector_11 - 1 - 0 - 0 - 10 - - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.recommend_to_others__17 - 1 - 0 - 0 - 15 - Would you recommend CiviCRM to other organizations like yours? - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.satisfaction_with_civicrm__15 - 1 - 0 - 0 - 13 - Rate your organization's overall satisfaction level with CiviCRM. - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - custom.civicrm_value_civicrm_site_registration_4.usability_rating_16 - 1 - 0 - 0 - 14 - Rate the overall usability of CiviCRM. - Public Pages - 0 - 0 - - Organization - Register Your Site Profile - - - diff --git a/tools/drupal/modules/extdir/extdir.info b/tools/drupal/modules/extdir/extdir.info deleted file mode 100644 index 1e40ef7a8a..0000000000 --- a/tools/drupal/modules/extdir/extdir.info +++ /dev/null @@ -1,5 +0,0 @@ -name = Extdir -description = Export an extensions directory for use by CiviCRM -package = Other -core = 7.x -php = 5.2 diff --git a/tools/drupal/modules/extdir/extdir.module b/tools/drupal/modules/extdir/extdir.module deleted file mode 100644 index a5f4f1aab4..0000000000 --- a/tools/drupal/modules/extdir/extdir.module +++ /dev/null @@ -1,65 +0,0 @@ - 'extdir_pages_listing', - 'page arguments' => array(1), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - 'file' => 'extdir.pages.inc', - ); - $items['extdir/%/%'] = array( - 'page callback' => 'extdir_pages_xml', - 'page arguments' => array(1,2), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - 'file' => 'extdir.pages.inc', - ); - return $items; -} - -/** - * Implementation of hook_theme - */ -function extdir_theme() { - return array( - 'extdir_list' => array( - 'template' => 'extdir_list', - 'variables' => array('extensions' => NULL), - ), - ); -} - -/** - * Implementation of hook_node_insert - */ -function extdir_node_insert($node) { - switch ($node->type) { - case 'extension': - case 'extension_release_civicrm': - _extdir_flush(); - break; - default: - } -} - -/** - * Implementation of hook_node_update - */ -function extdir_node_update($node) { - switch ($node->type) { - case 'extension': - case 'extension_release_civicrm': - _extdir_flush(); - break; - default: - } -} - -function _extdir_flush() { - db_query('DELETE FROM cache_page WHERE cid LIKE :cid', array(':cid' => '%/extdir/%')); -} \ No newline at end of file diff --git a/tools/drupal/modules/extdir/extdir.pages.inc b/tools/drupal/modules/extdir/extdir.pages.inc deleted file mode 100644 index 05f7d00dfe..0000000000 --- a/tools/drupal/modules/extdir/extdir.pages.inc +++ /dev/null @@ -1,258 +0,0 @@ -innerJoinFieldAPI('extension', 'field_extension_fq_name'); - $query->fields('field_extension_fq_name', array('field_extension_fq_name_value')); - $query->distinct(); - - // deliver - print ''; - print theme('extdir_list', array( - 'extensions' => $query->execute(), - )); - print ''; - return NULL; -} - -/** - * (Page Callback) - * - * Get the metadata for one extension - */ -function extdir_pages_xml($filterExpr, $xmlFile) { - $filters = _extdir_pages_filters_parse($filterExpr); - if (!preg_match('/^(.*)\.xml$/', $xmlFile, $matches)) { - return MENU_NOT_FOUND; - } - $filters['field_extension_fq_name_value'] = $matches[1]; - - list($query, $helper) = _extdir_pages_filters_query($filters); - $query->fields('field_extension_nr_crm', array('entity_id', 'field_extension_nr_crm_nid')); - $helper->innerJoinFieldAPI('release', 'field_extension_release_vc'); - $query->orderBy('field_extension_release_vc_value', 'DESC'); - // $query->orderBy('extrelease.title', 'DESC'); // FIXME dictionary sort != version sort - $query->range(0,1); - - $count = 0; - foreach ($query->execute() as $row) { - $extension = node_load($row->field_extension_nr_crm_nid); - $release = node_load($row->entity_id); - if (!file_exists($release->field_extension_release_xml['und'][0]['uri'])) { - throw new Exception('Failed to read extension XML: file not found: '); - } - $xml = simplexml_load_file($release->field_extension_release_xml['und'][0]['uri']); - _extdir_pages_xml_cleanup($extension, $release, $xml); - $count++; - } - - if ($count == 0) { - return MENU_NOT_FOUND; - } else { -// dpm(array('filters' => $filters, 'query' => $query->__toString(), 'extension' => $extension, 'release' => $release, 'xml' => $xml->asXML())); -// return ''; - - // deliver - $output = $xml->asXML(); - drupal_add_http_header('Content-Type', 'text/xml; utf-8'); - print $output; - return NULL; - - /* - $modified = max($extension->changed, $extension->created, $release->changed, $release->created); - drupal_add_http_header('Content-Type', 'text/xml; utf-8'); - drupal_add_http_header('Expires', gmdate(DATE_RFC1123, REQUEST_TIME + EXTDIR_MAX_AGE)); - drupal_add_http_header('Last-Modified', gmdate(DATE_RFC1123, $modified)); - drupal_add_http_header('Cache-Control', sprintf('max-age=%d, public', EXTDIR_MAX_AGE)); - drupal_add_http_header('ETag', md5($output)); - drupal_page_header(); - print $output; - exit(); - */ - } -} - -/** - * Modify a raw uploaded XML document, mixing in details - * from the extension and release. - * - * @param $extension stdClass, node - * @param $release stdClass, node - * @param $xml SimpleXMLElement, - */ -function _extdir_pages_xml_cleanup($extension, $release, $xml) { - // lots of overlap between node and XML; we'll side with the node - if (!empty($extension->field_extension_fq_name['und'][0]['value'])) { - $xml['key'] = (string) $extension->field_extension_fq_name['und'][0]['value']; - } - if (!empty($release->field_extension_release_url['und'][0]['url'])) { - $xml->downloadUrl = (string) $release->field_extension_release_url['und'][0]['url']; - } - if (!empty($release->field_extension_release_status['und'][0]['value'])) { - $xml->develStage = (string) $release->field_extension_release_status['und'][0]['value']; - } - //if (!empty($release->field_extension_release_ver['und'][0]['value'])) { - // $xml->version = (string) $release->field_extension_release_ver['und'][0]['value']; - //} - //The title field gets munged, so don't use it - //if (!empty($release->title)) { - // $xml->version = (string) $release->title; - //} - $xml->releaseDate = date('Y-m-d', $release->created); -} - -/** - * Parse the filter expression - * - * @param $filterExpr string, eg 'ver=4.2.1|cms=Drupal6' - * @return array, keys: - * - field_extension_cms_tid - * - field_extension_release_status_value - * - field_extension_release_civicrm_tid - * - field_extension_ready_value - */ -function _extdir_pages_filters_parse($filterExpr) { - $args = array(); - $keypairs = explode('|', $filterExpr); - foreach ($keypairs as $keypair) { - list ($key, $value) = explode('=', $keypair); - $args[$key] = $value; - } - - // defaults - $filters = array( - 'field_extension_cms_tid' => 127, // Native extension - 'field_extension_release_status_value' => 'stable', - 'field_extension_ready_value' => 'ready', - ); - - if (array_key_exists('ver', $args)) { - $versionParts = explode('.', $args['ver']); - $termName = sprintf('CiviCRM %d.%d', $versionParts[0], $versionParts[1]); - $terms = taxonomy_get_term_by_name($termName, 'extension_civicrm_compatibility'); - if (empty($terms)) { - $filters['field_extension_release_civicrm_tid'] = -1; - } else { - foreach ($terms as $term) { - $filters['field_extension_release_civicrm_tid'] = $term->tid; - } - } - } - - if (array_key_exists('status', $args)) { - if (empty($args['status'])) { - unset($filters['field_extension_release_status_value']); - } else { - // TODO stable, stable+beta, stable+beta+alpha - $filters['field_extension_release_status_value'] = $args['status']; - } - } - - return $filters; -} - -/** - * This is utterly ridiculous. Welcome to 2012. - * - * EntityFieldQuery doesn't appear to support JOIN, DISTINCT, etc, - * so we reinvent a slightly more usable wheel. - * - * @param $filters array with keys: - * - field_extension_cms_tid - * - field_extension_release_status_value - * - field_extension_release_civicrm_tid - * @return array(SelectQueryInterface,ExtdirQueryHelper) - */ -function _extdir_pages_filters_query($filters) { - $query = db_select('node', 'extrelease'); - // two logical entities in this query - $helper = ExtdirQueryHelper::create($query, array( - 'release' => 'extrelease.nid', - 'extension' => 'field_extension_nr_crm_nid', - )); - $helper->innerJoinFieldAPI('release', 'field_extension_nr_crm'); - - if (isset($filters['field_extension_cms_tid'])) { - $helper->innerJoinFieldAPI('extension', 'field_extension_cms'); - $query->condition('field_extension_cms_tid', $filters['field_extension_cms_tid']); - } - - // FIXME allow releases which are compatible with multiple versions of Civi - if (isset($filters['field_extension_release_civicrm_tid'])) { - $helper->innerJoinFieldAPI('release', 'field_extension_release_civicrm'); - $query->condition('field_extension_release_civicrm_tid', $filters['field_extension_release_civicrm_tid']); - } - - if (isset($filters['field_extension_release_status_value'])) { - $helper->innerJoinFieldAPI('release', 'field_extension_release_status'); - $query->condition('field_extension_release_status_value', $filters['field_extension_release_status_value']); - } - - if (isset($filters['field_release_extension_ready_value'])) { - $helper->innerJoinFieldAPI('release', 'field_release_extension_ready'); - $query->condition('field_release_extension_ready_value', $filters['field_release_extension_ready_value']); - } - - if (isset($filters['field_extension_ready_value'])) { - $helper->innerJoinFieldAPI('extension', 'field_extension_ready'); - $query->condition('field_extension_ready_value', $filters['field_extension_ready_value']); - } - - if (isset($filters['field_extension_fq_name_value'])) { - $helper->innerJoinFieldAPI('extension', 'field_extension_fq_name'); - $query->condition('field_extension_fq_name_value', $filters['field_extension_fq_name_value']); - } - - return array($query, $helper); -} - -/** - * Helper for mixing in DB columns generated by - * Field API's SQL storage engine -- which works - * with multiple entities, JOINs, GROUP BYs, ec - */ -class ExtdirQueryHelper { - /** - * @param $query SelectQueryInterface - * @parm $entityAliases array($niceName => $sqlIdExpression) list of entities - * which are (mentally) part of the query -- and the SQL expressions which - * identify them - */ - function create($query, $entityAliases) { - return new ExtdirQueryHelper($query, $entityAliases); - } - function __construct($query, $entityAliases) { - $this->query = $query; - $this->entityAliases = $entityAliases; - } - function innerJoinFieldAPI($entityAlias, $joinToField, $joinToAlias = NULL, $joinToColumn = 'entity_id') { - return $this->joinFieldAPI('INNER', $entityAlias, $joinToField, $joinToAlias, $joinToColumn); - } - function joinFieldAPI($type, $entityAlias, $joinToField, $joinToAlias = NULL, $joinToColumn = 'entity_id') { - if ($joinToAlias === NULL) { - $joinToAlias = $joinToField; - } - - $fieldInfo = field_info_field($joinToField); - // assumes that field uses one table - foreach ($fieldInfo['storage']['details']['sql']['FIELD_LOAD_CURRENT'] as $table => $columns) { - $condition = $this->entityAliases[$entityAlias]." = ${joinToAlias}.${joinToColumn}"; - $this->query->addJoin($type, $table, $joinToAlias, $condition); - } - return $this; - } -} - diff --git a/tools/drupal/modules/extdir/extdir_list.tpl.php b/tools/drupal/modules/extdir/extdir_list.tpl.php deleted file mode 100644 index 1872fe2d90..0000000000 --- a/tools/drupal/modules/extdir/extdir_list.tpl.php +++ /dev/null @@ -1,11 +0,0 @@ -\n"); -foreach ($extensions as $extension) { - $file = check_plain($extension->field_extension_fq_name_value . ".xml"); - printf("
  • %s
  • \n", - $file, - $file - ); -} -printf("\n"); -- 2.25.1