+++ /dev/null
-;$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
+++ /dev/null
-<?php\r
-\r
-define('CCRM_EXTVALID_XMLFILE_FIELD', 'field_extension_release_xml');\r
-\r
-/**\r
- * Loads and Validates fields from the XML info file:\r
- * Release version == <version> (required)\r
- * Release Date == <releaseDate>\r
- * Release Status == <develStage> (required)\r
- * Release CiviCRM Compatibility == <compatibility><ver> (required)(multiple ok)\r
- * Parent Extension FQN == <extension key="xx.yy.zz"> (required)\r
- * Documentation Link == <url desc="http://example.com">\r
- * (Postponed) Download URL > downloadUrl (required)\r
- * TODO: Fully validate the XML document format against a DOCtype\r
- */\r
-\r
- /**\r
- *\r
- * implements hook_node_validate\r
- */\r
- function ccrm_extensionvalidation_node_validate($node, $form, &$form_state) {\r
- // Make sure author of extension is in maintainers\r
- if ('extension' == $node->type) {\r
- $authornid = $node->uid; $delta = 0; $foundauthor = FALSE; \r
- foreach ($form_state['values']['field_maintainers'][LANGUAGE_NONE] as $index => $ref) {\r
- if (is_numeric($ref['target_id']) \r
- && $form_state['values']['field_maintainers'][LANGUAGE_NONE][$index]['target_id'] == $authornid) {\r
- $foundauthor = TRUE;\r
- }\r
- $delta++;\r
- }\r
- if (FALSE == $foundauthor) {\r
- $form_state['values']['field_maintainers'][LANGUAGE_NONE][$delta]['target_id'] = $authornid;\r
- $form_state['values']['field_maintainers'][LANGUAGE_NONE][$delta]['_weight'] = $delta;\r
- }\r
- }\r
- // Set maintainers on releases from parent extension\r
- if ($node->type == 'extension_release_civicrm') {\r
- $parentnid = $node->field_extension_nr_crm[LANGUAGE_NONE][0]['nid'];\r
- }\r
- if ($node->type == 'extension_release_cms') {\r
- $parentnid = $node->field_extension_nr_cms[LANGUAGE_NONE][0]['nid']; \r
- }\r
- if ($node->type == 'extension_release_civicrm' || $node->type == 'extension_release_cms') {\r
- $parent_node = is_numeric($parentnid) ? node_load($parentnid) : NULL;\r
- if (NULL == $parent_node) {\r
- _ccrmextvalid_formseterror('title', t('Could not determine parent extension. Please add via extension page.'));\r
- return;\r
- }\r
- }\r
- if ($node->type == 'extension_release_cms') {\r
- // Delete current maintainers\r
- foreach ($form_state['values']['field_extension_release_na_mains'][LANGUAGE_NONE] as $index => $ref) {\r
- if (is_numeric($ref['target_id'])) {\r
- $form_state['values']['field_extension_release_na_mains'][LANGUAGE_NONE][$index]['target_id'] = NULL;\r
- }\r
- } \r
- // Check parent node has maintainers set and add maintainers from parent\r
- $delta = 0;\r
- foreach ($parent_node->field_maintainers[LANGUAGE_NONE] as $index => $ref) {\r
- if (is_numeric($ref['target_id'])) {\r
- $form_state['values']['field_extension_release_na_mains'][LANGUAGE_NONE][$index]['target_id'] = $ref['target_id'];\r
- $form_state['values']['field_extension_release_na_mains'][LANGUAGE_NONE][$index]['_weight'] = $delta++;\r
- }\r
- }\r
- }\r
- if ($node->type == 'extension_release_civicrm') {\r
- // Delete current maintainers\r
- foreach ($form_state['values']['field_extension_release_ci_mains'][LANGUAGE_NONE] as $index => $ref) {\r
- if (is_numeric($ref['target_id'])) {\r
- $form_state['values']['field_extension_release_ci_mains'][LANGUAGE_NONE][$index]['target_id'] = NULL;\r
- }\r
- }\r
- // Check parent node has maintainers set and add maintainers from parent\r
- $delta = 0;\r
- foreach ($parent_node->field_maintainers[LANGUAGE_NONE] as $index => $ref) {\r
- if (is_numeric($ref['target_id'])) {\r
- $form_state['values']['field_extension_release_ci_mains'][LANGUAGE_NONE][$index]['target_id'] = $ref['target_id'];\r
- $form_state['values']['field_extension_release_ci_mains'][LANGUAGE_NONE][$index]['_weight'] = $delta++;\r
- }\r
- }\r
- }\r
- if ($node->type == 'extension_release_civicrm') {\r
- _ccrmextvalid_validatexml($node, $form, &$form_state, $parent_node);\r
- }\r
- }\r
- \r
- function _ccrmextvalid_validatexml($node, $form, &$form_state, $parent_node) { \r
- $keeperrors = array(); \r
- $file_id = $form_state['values'][CCRM_EXTVALID_XMLFILE_FIELD][LANGUAGE_NONE][0]['fid'];\r
- \r
- if ($file_id != 0) {\r
- $file = file_load($file_id);\r
- if ($file) {\r
- libxml_use_internal_errors(TRUE);\r
- $doc = new DOMDocument();\r
- $doc->recover = TRUE;\r
- $doc->strictErrorChecking = FALSE;\r
- \r
- if ($doc->load(drupal_realpath($file->uri))) {\r
- // Initialize variables to be read\r
- $got = array('version' => FALSE, 'releaseDate' => FALSE, 'develStage' => FALSE,\r
- 'ver' => FALSE, 'extension' => FALSE, 'documentation' => FALSE); //'downloadUrl' =>FALSE (postponed)\r
- foreach ($got as $tag => $tagcontents) {\r
- $wegotit = _ccrmextvalid_validateTag($node, $form, $form_state, $doc, $tag, $tagcontents, $keeperrors, $parent_node);\r
- $got[$tag] = $tagcontents;\r
- if ($wegotit) {\r
- _ccrmextvalid_assignTag($form, &$form_state, $tag, &$tagcontents);\r
- }\r
- else {\r
- if ($tag == 'extension') {\r
- _ccrmextvalid_seterror('title', t("The Fully Qualified Name in the XML file did not match parent extension: @tagcont",\r
- array('@tagcont' => $tagcontents)), $keeperrors);\r
- }\r
- else {\r
- _ccrmextvalid_seterror('title', t("The Extension Release XML file contained an invalid or empty value for tag '@tag'",\r
- array('@tag' => $tag)), $keeperrors);\r
- }\r
- }\r
- }\r
- }\r
- else {\r
- _ccrmextvalid_seterror( 'title', t('The XML file could not be read'), $keeperrors);\r
- }\r
- }\r
- }\r
- else {\r
- _ccrmextvalid_seterror( CCRM_EXTVALID_XMLFILE_FIELD, t('Please upload an XML file descriptor'), $keeperrors);\r
- }\r
- if (!empty($keeperrors)) {\r
- _ccrmextvalid_formseterror($keeperrors);\r
- }\r
- }\r
-\r
- // return whether we had a\r
- function _ccrmextvalid_validateTag($node, $form, &$form_state, $doc, $tag, &$tagcontents, &$keeperrors, $parent_node) {\r
- $gotit = FALSE; $tagcount = 0; $contents = '';\r
- switch ($tag) {\r
- case 'version':\r
- case 'releaseDate':\r
- case 'develStage':\r
- case 'downloadUrl':\r
- $tagcount = _ccrmextvalid_getOneReqdByTag($doc, $tag, &$tagcontents);\r
- break;\r
- case 'ver':\r
- $tagcount = _ccrmextvalid_getByTag($doc, $tag, &$tagcontents);\r
- break;\r
- case 'documentation':\r
- $domnodes = $doc->getElementsByTagName('url');\r
- $tagcount = $domnodes->length;\r
- foreach ($domnodes as $node) {\r
- if ($node->hasAttributes()) {\r
- $attrib = $node->attributes->getNamedItem('desc');\r
- if (strtolower($attrib->value) == "documentation") {\r
- $tagcontents = $node->nodeValue;\r
- }\r
- }\r
- }\r
- break;\r
- case 'extension':\r
- $domnodes = $doc->getElementsByTagName('extension');\r
- $tagcount = $domnodes->length;\r
- if ($tagcount == 1) {\r
- $elmt = $domnodes->item(0);\r
- if ($elmt->hasAttributes()) {\r
- $tagcontents = $elmt->getAttribute('key');\r
- }\r
- }
- break;\r
- default:\r
- drupal_set_message(t('Invalid tag used in _ccrmextvalid_validateTag: @tag', array('@tag' => $tag)));\r
- return FALSE;\r
- }\r
- if ($tagcount > 0) {\r
- switch ($tag) {\r
- case 'version':\r
- module_load_include('version.inc', 'ccrm_extensionvalidation');\r
- if (ccrm_extensionvalidation_version_isValid($tagcontents)) {\r
- $contents = $tagcontents;\r
- $gotit = TRUE;\r
- }\r
- break;\r
- case 'releaseDate':\r
- $tmp = filter_var($tagcontents, FILTER_SANITIZE_STRING);\r
- if (preg_match('/\d{4}-\d{2}-\d{2}/', $tmp)) {\r
- //$contents = new DateObject($tagcontents, NULL);\r
- $contents = $tmp;\r
- $gotit = TRUE;\r
- }\r
- break;\r
- case 'develStage':\r
- $contents = _ccrmextvalid_checkallowedval($tagcontents, 'field_extension_release_status');\r
- if ($contents && (count($contents) == 1)) {\r
- $gotit = TRUE;\r
- }\r
- $contents = $contents[0];\r
- break;\r
- case 'ver':\r
- if ($tagcount == 1) {\r
- $tagcontents = array($tagcontents);\r
- }\r
- $vers = array_map('_ccrmextvalid_mapversionval', $tagcontents);\r
- $okvers = _ccrmextvalid_checkallowedval($vers, 'field_extension_release_civicrm');\r
- if (count($okvers) == count($vers)) {\r
- $gotit = TRUE;\r
- $contents = array_map('_ccrmextvalid_mapversionvaltid', $okvers);\r
- }\r
- break;\r
- case 'documentation':\r
- $contents = filter_var($tagcontents, FILTER_VALIDATE_URL);\r
- $gotit = TRUE;\r
- break;\r
- case 'extension':\r
- $parentkey = isset($parent_node) ? $parent_node->field_extension_fq_name[LANGUAGE_NONE][0]['safe_value'] : NULL;\r
- $contents = $parentkey . ' vs. ' . $tagcontents;\r
- if ($tagcontents == $parentkey) {\r
- $gotit = TRUE;\r
- }\r
- break;\r
- default:\r
- return FALSE;\r
- }\r
- $tagcontents = $contents;\r
- }\r
- return $gotit;\r
- }\r
-\r
- function _ccrmextvalid_assignTag($form, &$form_state, $tag, &$tagcontents) {\r
- // Add $tagcontents to $form_state\r
- switch ($tag) {\r
- case 'version':\r
- module_load_include('version.inc', 'ccrm_extensionvalidation');\r
- $form_state['values']['field_extension_release_version'][LANGUAGE_NONE][0]['value'] = t('Version @ver', array('@ver' => $tagcontents));\r
- $form_state['values']['field_extension_release_vc'][LANGUAGE_NONE][0]['value'] = ccrm_extensionvalidation_version_normalize($tagcontents);\r
- break;\r
- case 'releaseDate':\r
- $form_state['values']['field_extension_release_date'][LANGUAGE_NONE][0]['value'] = $tagcontents;\r
- break;\r
- case 'develStage':\r
- $form_state['values']['field_extension_release_status'][LANGUAGE_NONE][0]['value'] = $tagcontents;\r
- break;\r
- case 'downloadUrl':\r
- $form_state['values']['field_extension_release_url'][LANGUAGE_NONE][0]['url'] = $tagcontents;\r
- break;\r
- case 'ver':\r
- $form_state['values']['field_extension_release_civicrm'][LANGUAGE_NONE] = $tagcontents;\r
- break;\r
- case 'documentation':\r
- $form_state['values']['field_documentation'][LANGUAGE_NONE][0]['url'] = $tagcontents;\r
- break;\r
- }\r
- }\r
-\r
- // Get the value of a single tag from the XML that should only have one value\r
- function _ccrmextvalid_getOneReqdByTag($doc, $tagname, &$values) {\r
- $defaultval = $values;\r
- $tagcount = _ccrmextvalid_getByTag($doc, $tagname, &$values);\r
- if ($tagcount > 1) {\r
- form_set_error(CCRM_EXTVALID_XMLFILE_FIELD,\r
- t("XML file must contain only one '@tagname' element"), array('tagname' => $tagname));\r
- }\r
- return $tagcount;\r
- }\r
-\r
- // Get all tags by value from the XML\r
- function _ccrmextvalid_getByTag($doc, $tagname, &$values) {\r
- $domnodes = $doc->getElementsByTagName($tagname);\r
- $nodecount = $domnodes->length;\r
- if ($nodecount > 0) {\r
- if ($nodecount > 1) {\r
- $values = array();\r
- for ($i = 0; $i < $domnodes->length; $i++) {\r
- $values[] = $domnodes->item($i)->nodeValue;\r
- }\r
- }\r
- else {\r
- $values = $domnodes->item(0)->nodeValue;\r
- }\r
- }\r
- return $nodecount;\r
-\r
- }\r
-\r
- // Compare a value with the allowed values (lower case)\r
- function _ccrmextvalid_checkallowedval($vals, $fieldname) {\r
- $retvals = array();\r
- $vals = !is_array($vals) ? array($vals) : $vals;\r
- $fld = field_info_field($fieldname);\r
- if ($fld['type'] == 'taxonomy_term_reference') {\r
- $allowedvals1 = taxonomy_allowed_values($fld);\r
- }\r
- elseif ($fld['type'] == 'list_text') {\r
- $allowedvals1 = list_allowed_values(field_info_field($fieldname));\r
- }\r
- else {\r
- // No other field types handled\r
- return $retvals;\r
- }\r
- // Taxonomy tags search in values, list search in keys\r
- $allowedvals = array_map('strtolower', $allowedvals1);\r
- foreach ($vals as $key => $val) {\r
- if ($fld['type'] == 'list_text') {\r
- if (array_key_exists($val, $allowedvals)) {\r
- $retvals[] = $val;\r
- }\r
- }\r
- else {\r
- $retvals = array_merge($retvals, array_keys($allowedvals, $val));\r
- }\r
- }\r
- return $retvals;\r
- }\r
-\r
- // Little helper function for array_map\r
- function _ccrmextvalid_mapversionval($val) {\r
- return "civicrm {$val}";\r
- }\r
-\r
- // Little helper function for array_map\r
- function _ccrmextvalid_mapversionvaltid($val) {\r
- return array( 'tid' => $val);\r
- }\r
-\r
- function _ccrmextvalid_seterror( $name, $message, &$keeperrors) {\r
- // Form_set_error can only happen once on an element so collect the errors\r
- $keeperrors[$name] = empty($keeperrors[$name]) ? $message : $keeperrors[$name] . " " . $message;\r
- }\r
-\r
- function _ccrmextvalid_formseterror($errors) {\r
- foreach ($errors as $name => $err) {\r
- // No other field is working reliably, tried the file upload button & others so usually use title\r
- form_set_error(check_plain($name), check_plain($err));\r
- }\r
- }
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * @file
- * Tests for ccrm_extensionvalidation.module.
- */
-
-/**
- * Tests version validation/formatting logic
- */
-class CcrmExtensionValidatationTestCase extends DrupalUnitTestCase {
-
- public static function getInfo() {
- return array(
- 'name' => '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;
- }
- }
-}
+++ /dev/null
-<?php
-
-define(CCRM_EXTENSIONVALIDATION_PAD, 7);
-
-/**
- * Determine if a version is valid
- *
- * @return bool
- */
-function ccrm_extensionvalidation_version_isValid($ver) {
- $parts = ccrm_extensionvalidation_version_split($ver);
- foreach ($parts as $part) {
- if (!preg_match('/^(z[0-9]+|pre[0-9]+)$/', $part)) {
- return FALSE;
- }
- }
- return TRUE;
-}
-
-/**
- * Normalize version, producing a code that can be correclty
- * sorted in SQL.
- *
- * @return string
- */
-function ccrm_extensionvalidation_version_normalize($ver) {
- return implode('-', ccrm_extensionvalidation_version_split($ver));
-}
-
-
-/**
- * Clean version number:
- * - Use consistent delimiter
- * - Change revision #s (r456) to straight numbers (456)
- * - Explode into numeric and alphabetic parts
- * - Make numerals higher than alphas (1.2.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;
-}
+++ /dev/null
-name = CiviCRM Professional List
-description = Contains hooks used for professional list
-version = 4.1
-package = CiviCRM
-core = 7.x
-php = 5.2
+++ /dev/null
-<?php
-
-/**
- * Hook to add user to civicrm group when professional form is submitted
- *
- */
-function civicrm_professionals_node_insert($node) {
-
- if ($node->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);
- }
-}
-
+++ /dev/null
-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
+++ /dev/null
-<?php
-/*
- +--------------------------------------------------------------------+
- | 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 |
- +--------------------------------------------------------------------+
-*/
-
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2011
- * $Id$
- *
- */
-
-// ** REGSITE settings **
-define('REGSITE_PROFILE_ID', 15);
-define('EMPOYER_RELATIONSHIP_TYPE_ID', 4);
-define('REGSITE_INDIVIDUAL_GROUP', 16);
-
-define('CIVICRM_REGSITE_FROM_EMAIL', "CiviCRM Site Registration <info@civicrm.org>");
-define('CIVICRM_SURVEY_FROM_EMAIL', "CiviCRM Training <info@civicrm.org>");
-define('CIVICRM_ARCHIVE_EMAIL', "CiviCRM Email Archival <archive@civicrm.org>");
-
-// ** 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');
-}
-
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | 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'}
-<script type="text/javascript" src="{$config->resourceBase}js/Common.js"></script>
-{/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}" *}
-<div id="crm-container" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
- {if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) }
- <div class="crm-submit-buttons">
- <span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>
- </div>
- {/if}
- {if $mode eq 1 || $activeComponent neq "CiviCRM"}
- {include file="CRM/Form/body.tpl"}
- {/if}
- {strip}
- {if $help_pre && $action neq 4}
- <div class="messages help">{$help_pre}</div>
- {/if}
-
- {include file="CRM/common/CMSUser.tpl"}
-
- <div class="messages status">
- {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}
- </div>
-
- <fieldset>
- <legend>Personal Information</legend>
- <div class="form-layout-compressed">
- <div id="editrow-personal-first" class="crm-section editrow_personal-first-section form-item">
- <div class="label">{$form.regsite_first_name.label}</div>
- <div class="edit-value content">{$form.regsite_first_name.html}</div>
- </div>
- <div id="editrow-personal-last" class="crm-section editrow_personal-last-section form-item">
- <div class="label">{$form.regsite_last_name.label}</div>
- <div class="edit-value content">{$form.regsite_last_name.html}</div>
- </div>
- <div id="editrow-personal-email" class="crm-section editrow_personal-email-section form-item">
- <div class="label">{$form.regsite_email.label}</div>
- <div class="edit-value content">{$form.regsite_email.html}</div>
- </div>
- </div>
- </fieldset>
-
- <fieldset>
- <legend>Organization Information</legend>
- {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}
- <div class="messages help">{$groupHelpPost}</div>
- {/if}
- {if $mode neq 8 && $mode neq 4}
- </fieldset>
- </div>
- {/if}
- {/if}
-
- {if $mode neq 8 && $mode neq 4}
- <div {if $context neq 'dialog'}id="profilewrap{$field.group_id}"{/if}>
- <fieldset><legend>{$field.groupTitle}</legend>
- {/if}
- {assign var=fieldset value=`$field.groupTitle`}
- {assign var=groupHelpPost value=`$field.groupHelpPost`}
- {if $field.groupHelpPre}
- <div class="messages help">{$field.groupHelpPre}</div>
- {/if}
- <div class="form-layout-compressed">
- {/if}
-
- {if $field.options_per_line}
- <div class="crm-section editrow_{$n}-section form-item" id="editrow-{$n}">
- <div class="label">{$form.$n.label}</div>
- <div class="content edit-value">
- {assign var="count" value="1"}
- {strip}
- <table class="form-layout-compressed">
- <tr>
- {* 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}
- <td class="labels font-light">{$form.$n.$key.html}</td>
- {if $count == $field.options_per_line}
- </tr>
- <tr>
- {assign var="count" value="1"}
- {else}
- {assign var="count" value=`$count+1`}
- {/if}
- {/if}
- {/foreach}
- </tr>
- </table>
- {if $field.html_type eq 'Radio' and $form.formName eq 'Edit' and $field.is_view neq 1 }
- <span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('{$n}', '{$form.formName}'); return false;">{ts}clear{/ts}</a>)</span>
- {/if}
- {/strip}
- </div>
- <div class="clear"></div>
- </div>{* end of main edit section div*}
- {else}
- <div id="editrow-{$n}" class="crm-section editrow_{$n}-section form-item">
- <div class="label">{$form.$n.label}</div>
- <div class="edit-value content">
- {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}
- <div class="crm-section contact_image-section">
- <div class="content">
- {include file="CRM/Contact/Page/ContactImage.tpl"}
- </div>
- </div>
- {/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)}
- <span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('{$n}', '{$form.formName}'); return false;">{ts}clear{/ts}</a>)</span>
- {elseif $field.html_type eq 'Autocomplete-Select'}
- {include file="CRM/Custom/Form/AutoComplete.tpl" element_name = $n}
- {/if}
- {/if}
- </div>
- <div class="clear"></div>
- </div>
-
- {if $form.$n.type eq 'file'}
- <div class="crm-section file_displayURL-section file_displayURL{$n}-section"><div class="content">{$customFiles.$n.displayURL}</div></div>
- <div class="crm-section file_deleteURL-section file_deleteURL{$n}-section"><div class="content">{$customFiles.$n.deleteURL}</div></div>
- {/if}
- {/if}
-
- {* Show explanatory text for field if not in 'view' mode *}
- {if $field.help_post && $action neq 4 && $form.$n.html}
- <div class="crm-section helprow-{$n}-section" id="helprow-{$n}">
- <div class="content description">{$field.help_post}</div>
- </div>
- {/if}
- {/if}{* end of main if field name if *}
- {/foreach}
- </div> {* 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'}
- <script type="text/javascript">cj('.recaptcha_label').attr('width', '140px');</script>
- {/if}
-
- {if $field.groupHelpPost}
- <div class="messages help">{$field.groupHelpPost}</div>
- {/if}
-
- {if $mode neq 8 && $mode neq 4}
- </fieldset>
- </div>
- {/if}
-
- {if ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192)}
- <div class="crm-submit-buttons">
- {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
- </div>
- {/if}
- {if $help_post && $action neq 4}<br /><div class="messages help">{$help_post}</div>{/if}
- {/strip}
-
- </fieldset> {* organization info *}
-
-</div> {* end crm-container div *}
-
-<script type="text/javascript">
- {if $drupalCms}
- {literal}
- if ( document.getElementsByName("cms_create_account")[0].checked ) {
- show('details');
- } else {
- hide('details');
- }
- {/literal}
- {/if}
-</script>
-{/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}
- <div class="messages status">
- <div class="icon inform-icon"></div>
- {$statusMessage}
- </div>
-{/if}
-{literal}
-<script type="text/javascript">
-
-cj(document).ready(function(){
- cj('#selector tr:even').addClass('odd-row ');
- cj('#selector tr:odd ').addClass('even-row');
-});
-{/literal}
-{if $context eq 'dialog'}
-{literal}
- var options = {
- beforeSubmit: showRequest // pre-submit callback
- };
-
- // bind form using 'ajaxForm'
- cj('#Edit').ajaxForm( options );
-
- // pre-submit callback
- function showRequest(formData, jqForm, options) {
- // formData is an array; here we use $.param to convert it to a string to display it
- // but the form plugin does this for you automatically when it submits the data
- var queryString = cj.param(formData);
- queryString = queryString + '&snippet=5&gid=' + {/literal}"{$profileID}"{literal};
- var postUrl = {/literal}"{crmURL p='civicrm/profile/create' h=0 }"{literal};
- var response = cj.ajax({
- type: "POST",
- url: postUrl,
- async: false,
- data: queryString,
- dataType: "json",
- success: function( response ) {
- if ( response.newContactSuccess ) {
- cj("#contact").val( response.sortName ).focus( );
- if ( typeof(allowMultiClient) != "undefined" ) {
- if ( allowMultiClient ) {
- var newToken = '{"name":"'+response.sortName+'","id":"'+response.contactID+'"},';
- cj('ul.token-input-list-facebook, div.token-input-dropdown-facebook' ).remove();
- addMultiClientOption(newToken);
- }
- }
- cj("input[name=contact_select_id]").val( response.contactID );
- cj("#contact-success").show( );
- cj("#contact-dialog").dialog("close");
- }
- }
- }).responseText;
-
- cj("#contact-dialog").html( response );
-
- // here we could return false to prevent the form from being submitted;
- // returning anything other than false will allow the form submit to continue
- return false;
- }
-
-{/literal}
-{/if}
-{literal}
-</script>
-{/literal}
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | 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'}
-<script type="text/javascript" src="{$config->resourceBase}js/Common.js"></script>
-{/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}" *}
-<div id="crm-container" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
- {if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) }
- <div class="crm-submit-buttons">
- <span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>
- </div>
- {/if}
- {if $mode eq 1 || $activeComponent neq "CiviCRM"}
- {include file="CRM/Form/body.tpl"}
- {/if}
- {strip}
- {if $help_pre && $action neq 4}
- <div class="messages help">{$help_pre}</div>
- {/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}
- <div class="messages help">{$groupHelpPost}</div>
- {/if}
- {if $mode neq 8 && $mode neq 4}
- </div><!-- end form-layout-compressed-div -->
- </fieldset>
- </div>
- {/if}
- {/if}
-
- {if $mode neq 8 && $mode neq 4}
- <div {if $context neq 'dialog'}id="profilewrap{$field.group_id}"{/if}>
- <fieldset><legend>{$field.groupTitle}</legend>
- {/if}
- {assign var=fieldset value=`$field.groupTitle`}
- {assign var=groupHelpPost value=`$field.groupHelpPost`}
- {if $field.groupHelpPre}
- <div class="messages help">{$field.groupHelpPre}</div>
- {/if}
- <div class="form-layout-compressed">
- {/if}
-
- {if $field.options_per_line}
- <div class="crm-section editrow_{$n}-section form-item" id="editrow-{$n}">
- <div class="label">{$form.$n.label}</div>
- <div class="content edit-value">
- {assign var="count" value="1"}
- {strip}
- <table class="form-layout-compressed">
- <tr>
- {* 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}
- <td class="labels font-light">{$form.$n.$key.html}</td>
- {if $count == $field.options_per_line}
- </tr>
- <tr>
- {assign var="count" value="1"}
- {else}
- {assign var="count" value=`$count+1`}
- {/if}
- {/if}
- {/foreach}
- </tr>
- </table>
- {if $field.html_type eq 'Radio' and $form.formName eq 'Edit' and $field.is_view neq 1 }
- <span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('{$n}', '{$form.formName}'); return false;">{ts}clear{/ts}</a>)</span>
- {/if}
- {/strip}
- </div>
- <div class="clear"></div>
- </div>{* end of main edit section div*}
- {else}
- <div id="editrow-{$n}" class="crm-section editrow_{$n}-section form-item">
- <div class="label">{$form.$n.label}</div>
- <div class="edit-value content">
- {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}
- <div class="crm-section contact_image-section">
- <div class="content">
- {include file="CRM/Contact/Page/ContactImage.tpl"}
- </div>
- </div>
- {/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)}
- <span class="crm-clear-link">(<a href="#" title="unselect" onclick="unselectRadio('{$n}', '{$form.formName}'); return false;">{ts}clear{/ts}</a>)</span>
- {elseif $field.html_type eq 'Autocomplete-Select'}
- {include file="CRM/Custom/Form/AutoComplete.tpl" element_name = $n}
- {/if}
- {/if}
- </div>
- <div class="clear"></div>
- </div>
-
- {if $form.$n.type eq 'file'}
- <div class="crm-section file_displayURL-section file_displayURL{$n}-section"><div class="content">{$customFiles.$n.displayURL}</div></div>
- <div class="crm-section file_deleteURL-section file_deleteURL{$n}-section"><div class="content">{$customFiles.$n.deleteURL}</div></div>
- {/if}
- {/if}
-
- {* Show explanatory text for field if not in 'view' mode *}
- {if $field.help_post && $action neq 4 && $form.$n.html}
- <div class="crm-section helprow-{$n}-section" id="helprow-{$n}">
- <div class="content description">{$field.help_post}</div>
- </div>
- {/if}
- {/if}{* end of main if field name if *}
- {/foreach}
- </div><!-- end form-layout-compressed for last profile --> {* 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'}
- <script type="text/javascript">cj('.recaptcha_label').attr('width', '140px');</script>
- {/if}
-
- {if $field.groupHelpPost}
- <div class="messages help">{$field.groupHelpPost}</div>
- {/if}
-
- {if $mode neq 8 && $mode neq 4}
- </fieldset>
- </div>
- {/if}
-
- {foreach from=$event_survey_groupTree item=cd_edit key=group_id}
- {foreach from=$cd_edit.fields item=element key=field_id}
- <table class="form-layout-compressed">
- {include file="CRM/Custom/Form/CustomField.tpl"}
- </table>
- {/foreach}
- {/foreach}
-
- {if ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192)}
- <div class="crm-submit-buttons">
- {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
- </div>
- {/if}
- {if $help_post && $action neq 4}<br /><div class="messages help">{$help_post}</div>{/if}
- {/strip}
-
-</div> {* end crm-container div *}
-
-<script type="text/javascript">
- {if $drupalCms}
- {literal}
- if ( document.getElementsByName("cms_create_account")[0].checked ) {
- show('details');
- } else {
- hide('details');
- }
- {/literal}
- {/if}
-</script>
-{/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}
- <div class="messages status">
- <div class="icon inform-icon"></div>
- {$statusMessage}
- </div>
-{/if}
-{literal}
-<script type="text/javascript">
-
-cj(document).ready(function(){
- cj('#selector tr:even').addClass('odd-row ');
- cj('#selector tr:odd ').addClass('even-row');
-});
-{/literal}
-{if $context eq 'dialog'}
-{literal}
- var options = {
- beforeSubmit: showRequest // pre-submit callback
- };
-
- // bind form using 'ajaxForm'
- cj('#Edit').ajaxForm( options );
-
- // pre-submit callback
- function showRequest(formData, jqForm, options) {
- // formData is an array; here we use $.param to convert it to a string to display it
- // but the form plugin does this for you automatically when it submits the data
- var queryString = cj.param(formData);
- queryString = queryString + '&snippet=5&gid=' + {/literal}"{$profileID}"{literal};
- var postUrl = {/literal}"{crmURL p='civicrm/profile/create' h=0 }"{literal};
- var response = cj.ajax({
- type: "POST",
- url: postUrl,
- async: false,
- data: queryString,
- dataType: "json",
- success: function( response ) {
- if ( response.newContactSuccess ) {
- cj("#contact").val( response.sortName ).focus( );
- if ( typeof(allowMultiClient) != "undefined" ) {
- if ( allowMultiClient ) {
- var newToken = '{"name":"'+response.sortName+'","id":"'+response.contactID+'"},';
- cj('ul.token-input-list-facebook, div.token-input-dropdown-facebook' ).remove();
- addMultiClientOption(newToken);
- }
- }
- cj("input[name=contact_select_id]").val( response.contactID );
- cj("#contact-success").show( );
- cj("#contact-dialog").dialog("close");
- }
- }
- }).responseText;
-
- cj("#contact-dialog").html( response );
-
- // here we could return false to prevent the form from being submitted;
- // returning anything other than false will allow the form submit to continue
- return false;
- }
-
-{/literal}
-{/if}
-{literal}
-</script>
-{/literal}
-
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | 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}
- <div id="crm-container" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
- {if $contactPersonString}
- <div id="row-contactPersonString" class="crm-section contactPersonString-section">
- <div class="label">Contact Person(s)</div>
- <div class="content">{$contactPersonString}</div>
- <div class="clear"></div>
- </div>
- {/if}
- {foreach from=$profileFields item=field key=rowName}
- <div id="row-{$rowName}" class="crm-section {$rowName}-section">
- <div class="label">
- {$field.label}
- </div>
- <div class="content">
- {$field.value}
- </div>
- <div class="clear"></div>
- </div>
- {/foreach}
- </div>
- {/if}
-{/if}
-{* fields array is not empty *}
+++ /dev/null
-{*
- +--------------------------------------------------------------------+
- | 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}
- <br/>
- <div id="crm-container" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
- <table>
- {foreach from=$profileFields item=field key=rowName}
- <tr id="row-{$rowName}">
- <td class="label">{$field.label}</td>
- <td class="html-adjust crm-custom-data">{$field.value}</td>
- </tr>
- {/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}
- </table>
- </div>
- {/if}
-{/if}
-{* fields array is not empty *}
+++ /dev/null
-
-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
+++ /dev/null
-Thank you for registering your CiviCRM site for {$displayValues.organizationName}.
\ No newline at end of file
+++ /dev/null
-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
+++ /dev/null
-Thank you for feedback
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="iso-8859-1" ?>
-
-<CustomData>
- <CustomGroups>
- <CustomGroup>
- <name>CiviCRM_Site_Registration</name>
- <title>CiviCRM Site Registration</title>
- <extends>Organization</extends>
- <style>Tab</style>
- <collapse_display>0</collapse_display>
- <help_pre></help_pre>
- <help_post></help_post>
- <weight>2</weight>
- <is_active>1</is_active>
- <table_name>civicrm_value_civicrm_site_registration_4</table_name>
- <is_multiple>0</is_multiple>
- <collapse_adv_display>0</collapse_adv_display>
- <created_date>0000-00-00 00:00:00</created_date>
- </CustomGroup>
- <CustomGroup>
- <name>Event_Survey</name>
- <title>Event Survey</title>
- <extends>Participant</extends>
- <extends_entity_column_value_option_group>ParticipantEventType</extends_entity_column_value_option_group>
- <extends_entity_column_value_option_value>Fundraiser</extends_entity_column_value_option_value>
- <style>Inline</style>
- <help_pre></help_pre>
- <help_post></help_post>
- <is_active>1</is_active>
- <table_name>civicrm_value_Event_Survey</table_name>
- <is_multiple>0</is_multiple>
- <collapse_adv_display>0</collapse_adv_display>
- </CustomGroup>
- </CustomGroups>
- <CustomFields>
- <CustomField>
- <label>Number of Employees</label>
- <data_type>String</data_type>
- <html_type>Select</html_type>
- <is_required>0</is_required>
- <is_searchable>1</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>1</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>number_of_employees_8</column_name>
- <option_group_name>number_of_employees_20100908143104</option_group_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Annual Budget (USD)</label>
- <data_type>String</data_type>
- <html_type>Select</html_type>
- <is_required>0</is_required>
- <is_searchable>1</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>2</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>annual_budget__usd__9</column_name>
- <option_group_name>annual_budget__usd__20100908143601</option_group_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Organization Category</label>
- <data_type>String</data_type>
- <html_type>CheckBox</html_type>
- <is_required>0</is_required>
- <is_searchable>1</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>3</weight>
- <help_post>Select one or more categories that most closely describe your organization's the focus area(s).</help_post>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <options_per_line>3</options_per_line>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>organization_sector_10</column_name>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Other Category</label>
- <data_type>String</data_type>
- <html_type>Text</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>4</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>other_sector_11</column_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>CiviCRM Components</label>
- <data_type>String</data_type>
- <html_type>CheckBox</html_type>
- <is_required>0</is_required>
- <is_searchable>1</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>5</weight>
- <help_post>Mark the CiviCRM components that your organization uses.</help_post>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <options_per_line>3</options_per_line>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>civicrm_components_12</column_name>
- <option_group_name>civicrm_components_20100908150826</option_group_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>How are you using CiviCRM</label>
- <data_type>Memo</data_type>
- <html_type>TextArea</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>6</weight>
- <help_post>Briefly describe how your organization uses CiviCRM.</help_post>
- <attributes>rows=4, cols=60</attributes>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>how_are_you_using_civicrm_13</column_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Consulting Firm?</label>
- <data_type>String</data_type>
- <html_type>Text</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>7</weight>
- <help_post>If your organization used a consultant to assist in installing, configuring or customizing CiviCRM enter the consulting firm name here.</help_post>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>civicrm_consulting_firm__14</column_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Satisfaction with CiviCRM?</label>
- <data_type>String</data_type>
- <html_type>Radio</html_type>
- <is_required>0</is_required>
- <is_searchable>1</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>8</weight>
- <help_post>Rate your organization's overall satisfaction level with CiviCRM from A (very satisfied) to F (extremely unsatisfied).</help_post>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <options_per_line>5</options_per_line>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>satisfaction_with_civicrm__15</column_name>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Usability Rating</label>
- <data_type>String</data_type>
- <html_type>Radio</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>9</weight>
- <help_post>Rate the overall usability of CiviCRM from A (high usability) to F (extremely difficult to use).</help_post>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <options_per_line>5</options_per_line>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>usability_rating_16</column_name>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Recommend to others?</label>
- <data_type>Boolean</data_type>
- <html_type>Radio</html_type>
- <is_required>0</is_required>
- <is_searchable>1</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>10</weight>
- <help_post>Would you recommend CiviCRM to other organizations like yours?</help_post>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>recommend_to_others__17</column_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Date Added</label>
- <data_type>Date</data_type>
- <html_type>Select Date</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>11</weight>
- <is_active>1</is_active>
- <is_view>1</is_view>
- <text_length>255</text_length>
- <date_format>yy-mm-dd</date_format>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>date_added_18</column_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Added By</label>
- <data_type>ContactReference</data_type>
- <html_type>Autocomplete-Select</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>12</weight>
- <is_active>1</is_active>
- <is_view>1</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>added_by_19</column_name>
- <custom_group_name>CiviCRM_Site_Registration</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Training space and environment</label>
- <data_type>String</data_type>
- <html_type>Radio</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>1</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>training_space_and_environment</column_name>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Presentation quality</label>
- <data_type>String</data_type>
- <html_type>Radio</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>2</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>presentation_quality</column_name>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Presenters/Speakers</label>
- <data_type>String</data_type>
- <html_type>Radio</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>3</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>presenters_speakers</column_name>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Training materials (exercises and other wiki resources)</label>
- <data_type>String</data_type>
- <html_type>Radio</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>4</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>training_materials_exercises</column_name>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Food</label>
- <data_type>String</data_type>
- <html_type>Radio</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>5</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>food_14</column_name>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Were your expectations for the event met? If not, what were you hoping to get out of the training but did not?</label>
- <data_type>Memo</data_type>
- <html_type>TextArea</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>6</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>were_your_expectations_met</column_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>What areas of improvement would you suggest?</label>
- <data_type>Memo</data_type>
- <html_type>TextArea</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>7</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>what_areas_of_improvement</column_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Did you find the case studies helpful? Would you want more or less, and should they be more or less technical?</label>
- <data_type>Memo</data_type>
- <html_type>TextArea</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>8</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>find_case_studies_helpful</column_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>What other resources would be helpful as you work with CiviCRM?</label>
- <data_type>Memo</data_type>
- <html_type>TextArea</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>9</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>what_other_resources</column_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- <CustomField>
- <label>Other comments</label>
- <data_type>Memo</data_type>
- <html_type>TextArea</html_type>
- <is_required>0</is_required>
- <is_searchable>0</is_searchable>
- <is_search_range>0</is_search_range>
- <weight>10</weight>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <text_length>255</text_length>
- <note_columns>60</note_columns>
- <note_rows>4</note_rows>
- <column_name>other_comments</column_name>
- <custom_group_name>Event_Survey</custom_group_name>
- </CustomField>
- </CustomFields>
- <OptionGroups>
- <OptionGroup>
- <name>number_of_employees_20100908143104</name>
- <label>Number of Employees</label>
- <is_active>1</is_active>
- </OptionGroup>
- <OptionGroup>
- <name>annual_budget__usd__20100908143601</name>
- <label>Annual Budget (USD)</label>
- <is_active>1</is_active>
- </OptionGroup>
- <OptionGroup>
- <name>organization_sector_20100908145433</name>
- <label>Organization Sector</label>
- <is_active>1</is_active>
- </OptionGroup>
- <OptionGroup>
- <name>civicrm_components_20100908150826</name>
- <label>CiviCRM Components</label>
- <is_active>1</is_active>
- </OptionGroup>
- <OptionGroup>
- <name>satisfaction_with_civicrm__20100908151542</name>
- <label>Satisfaction with CiviCRM?</label>
- <is_active>1</is_active>
- </OptionGroup>
- </OptionGroups>
- <OptionValues>
- <OptionValue>
- <label>10 or Under</label>
- <value>10 or Under</value>
- <name>10_or_Under</name>
- <is_default>0</is_default>
- <weight>1</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>number_of_employees_20100908143104</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>11 to 29</label>
- <value>11 to 29</value>
- <name>11_to_29</name>
- <is_default>0</is_default>
- <weight>2</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>number_of_employees_20100908143104</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>199 to 249</label>
- <value>100 to 249</value>
- <name>199_to_249</name>
- <is_default>0</is_default>
- <weight>4</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>number_of_employees_20100908143104</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>250 or More</label>
- <value>250 or More</value>
- <name>250_or_More</name>
- <is_default>0</is_default>
- <weight>5</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>number_of_employees_20100908143104</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>30 to 99</label>
- <value>30 to 99</value>
- <name>30_to_99</name>
- <is_default>0</is_default>
- <weight>3</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>number_of_employees_20100908143104</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Don't know</label>
- <value>Don't know</value>
- <name>Don_t_know</name>
- <is_default>0</is_default>
- <weight>6</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>number_of_employees_20100908143104</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>$3 million to $10 million</label>
- <value>$3 million to $10 million</value>
- <name>_3_million_to__10_million</name>
- <is_default>0</is_default>
- <weight>3</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>annual_budget__usd__20100908143601</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>$500k to $3 million</label>
- <value>$500k to $3 million</value>
- <name>_500k_to__3_million</name>
- <is_default>0</is_default>
- <weight>2</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>annual_budget__usd__20100908143601</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Don't know</label>
- <value>Don't know</value>
- <name>Don_t_know</name>
- <is_default>0</is_default>
- <weight>5</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>annual_budget__usd__20100908143601</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>More then $10 million</label>
- <value>More then $10 million</value>
- <name>More_then__10_million</name>
- <is_default>0</is_default>
- <weight>4</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>annual_budget__usd__20100908143601</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Under $500k</label>
- <value>Under $500k</value>
- <name>Under__500k</name>
- <is_default>0</is_default>
- <weight>1</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>annual_budget__usd__20100908143601</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Civil Rights, Social Action and Advocacy</label>
- <value>Civil Rights, Social Action and Advocacy</value>
- <is_default>0</is_default>
- <weight>3</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Community Improvement and Capacity Building</label>
- <value>Community Improvement and Capacity Building</value>
- <is_default>0</is_default>
- <weight>4</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Diseases, Disorders and Medical Disciplines</label>
- <value>Diseases, Disorders and Medical Disciplines</value>
- <is_default>0</is_default>
- <weight>6</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Human Rights, International, Foreign Affairs</label>
- <value>Human Rights, International, Foreign Affairs</value>
- <is_default>0</is_default>
- <weight>15</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Mental Health and Crisis Intervention</label>
- <value>Mental Health and Crisis Intervention</value>
- <is_default>0</is_default>
- <weight>19</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Public Safety, Disaster Preparedness and Relief</label>
- <value>Public Safety, Disaster Preparedness and Relief</value>
- <is_default>0</is_default>
- <weight>24</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Animal-related</label>
- <value>Animal-related</value>
- <name>Animal_related</name>
- <is_default>0</is_default>
- <weight>1</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Arts, Culture, Humanities</label>
- <value>Arts, Culture, Humanities</value>
- <name>Arts_Culture_Humanities</name>
- <is_default>0</is_default>
- <weight>2</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Crime and Legal-related</label>
- <value>Crime and Legal-related</value>
- <name>Crime_and_Legal_related</name>
- <is_default>0</is_default>
- <weight>5</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Education</label>
- <value>Education</value>
- <name>Education</name>
- <is_default>0</is_default>
- <weight>7</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Employment</label>
- <value>Employment</value>
- <name>Employment</name>
- <is_default>0</is_default>
- <weight>8</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Environment</label>
- <value>Environment</value>
- <name>Environment</name>
- <is_default>0</is_default>
- <weight>9</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Food, Agriculture and Nutrition</label>
- <value>Food, Agriculture and Nutrition</value>
- <name>Food_Agriculture_and_Nutrition</name>
- <is_default>0</is_default>
- <weight>10</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Foundation</label>
- <value>Foundation</value>
- <name>Foundation</name>
- <is_default>0</is_default>
- <weight>11</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Government Entity</label>
- <value>Government Entity</value>
- <name>Government_Entity</name>
- <is_default>0</is_default>
- <weight>12</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Health Care</label>
- <value>Health Care</value>
- <name>Health_Care</name>
- <is_default>0</is_default>
- <weight>13</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Housing and Shelter</label>
- <value>Housing and Shelter</value>
- <name>Housing_and_Shelter</name>
- <is_default>0</is_default>
- <weight>14</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Human Services</label>
- <value>Human Services</value>
- <name>Human_Services</name>
- <is_default>0</is_default>
- <weight>16</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Library</label>
- <value>Library</value>
- <name>Library</name>
- <is_default>0</is_default>
- <weight>17</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Medical Research</label>
- <value>Medical Research</value>
- <name>Medical_Research</name>
- <is_default>0</is_default>
- <weight>18</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Other (please specify)</label>
- <value>Other</value>
- <name>Other__please_specify_</name>
- <is_default>0</is_default>
- <weight>30</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Political Campaign</label>
- <value>Political Campaign</value>
- <name>Political_Campaign</name>
- <is_default>0</is_default>
- <weight>20</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Political Group / Party</label>
- <value>Political Group / Party</value>
- <name>Political_Group__Party</name>
- <is_default>0</is_default>
- <weight>21</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Professional Society</label>
- <value>Professional Society</value>
- <name>Professional_Society</name>
- <is_default>0</is_default>
- <weight>22</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Public and Societal Benefit</label>
- <value>Public and Societal Benefit</value>
- <name>Public_and_Societal_Benefit</name>
- <is_default>0</is_default>
- <weight>23</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Recreation and Sports</label>
- <value>Recreation and Sports</value>
- <name>Recreation_and_Sports</name>
- <is_default>0</is_default>
- <weight>25</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Religion-related</label>
- <value>Religion-related</value>
- <name>Religion_related</name>
- <is_default>0</is_default>
- <weight>26</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Science and Technology</label>
- <value>Science and Technology</value>
- <name>Science_and_Technology</name>
- <is_default>0</is_default>
- <weight>27</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Trade Association</label>
- <value>Trade Association</value>
- <name>Trade_Association</name>
- <is_default>0</is_default>
- <weight>28</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Youth Development</label>
- <value>Youth Development</value>
- <name>Youth_Development</name>
- <is_default>0</is_default>
- <weight>29</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>organization_sector_20100908145433</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>CiviCase</label>
- <value>CiviCase</value>
- <name>CiviCase</name>
- <is_default>0</is_default>
- <weight>1</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>civicrm_components_20100908150826</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>CiviContribute</label>
- <value>CiviContribute</value>
- <name>CiviContribute</name>
- <is_default>0</is_default>
- <weight>2</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>civicrm_components_20100908150826</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>CiviEvent</label>
- <value>CiviEvent</value>
- <name>CiviEvent</name>
- <is_default>0</is_default>
- <weight>3</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>civicrm_components_20100908150826</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>CiviGrant</label>
- <value>CiviGrant</value>
- <name>CiviGrant</name>
- <is_default>0</is_default>
- <weight>4</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>civicrm_components_20100908150826</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>CiviMail</label>
- <value>CiviMail</value>
- <name>CiviMail</name>
- <is_default>0</is_default>
- <weight>5</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>civicrm_components_20100908150826</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>CiviMember</label>
- <value>CiviMember</value>
- <name>CiviMember</name>
- <is_default>0</is_default>
- <weight>6</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>civicrm_components_20100908150826</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Excellent</label>
- <value>Excellent</value>
- <is_default>0</is_default>
- <weight>1</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Good</label>
- <value>Good</value>
- <is_default>0</is_default>
- <weight>2</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Average</label>
- <value>Average</value>
- <is_default>0</is_default>
- <weight>3</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Below Average</label>
- <value>Below Average</value>
- <is_default>0</is_default>
- <weight>4</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- </OptionValue>
- <OptionValue>
- <label>Poor</label>
- <value>Poor</value>
- <is_default>0</is_default>
- <weight>5</weight>
- <is_optgroup>0</is_optgroup>
- <is_reserved>0</is_reserved>
- <is_active>1</is_active>
- <option_group_name>satisfaction_with_civicrm__20100908151542</option_group_name>
- </OptionValue>
- </OptionValues>
- <ProfileGroups>
- <ProfileGroup>
- <is_active>1</is_active>
- <group_type>Organization,Contact</group_type>
- <title>Register Your Site Profile</title>
- <add_captcha>0</add_captcha>
- <is_map>0</is_map>
- <is_edit_link>0</is_edit_link>
- <is_uf_link>0</is_uf_link>
- <is_update_dupe>0</is_update_dupe>
- <created_date>2010-09-08 15:14:24</created_date>
- <is_proximity_search>0</is_proximity_search>
- </ProfileGroup>
- </ProfileGroups>
- <ProfileFields>
- <ProfileField>
- <field_name>organization_name</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>1</is_required>
- <weight>1</weight>
- <help_post></help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>1</is_searchable>
- <label>Organization Name</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>email</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>2</weight>
- <help_post></help_post>
- <visibility>Public Pages</visibility>
- <in_selector>1</in_selector>
- <is_searchable>1</is_searchable>
- <label>Email</label>
- <field_type>Contact</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
-11 </ProfileField>
- <ProfileField>
- <field_name>url-1</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>1</is_required>
- <weight>3</weight>
- <help_post></help_post>
- <visibility>Public Pages</visibility>
- <in_selector>1</in_selector>
- <is_searchable>0</is_searchable>
- <label>Website</label>
- <field_type>Contact</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>city</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>4</weight>
- <help_post></help_post>
- <visibility>Public Pages</visibility>
- <in_selector>1</in_selector>
- <is_searchable>0</is_searchable>
- <label>City</label>
- <field_type>Contact</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>state_province</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>5</weight>
- <help_post></help_post>
- <visibility>Public Pages</visibility>
- <in_selector>1</in_selector>
- <is_searchable>0</is_searchable>
- <label>State</label>
- <field_type>Contact</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>country</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>6</weight>
- <help_post></help_post>
- <visibility>Public Pages and Listings</visibility>
- <in_selector>1</in_selector>
- <is_searchable>0</is_searchable>
- <label>Country</label>
- <field_type>Contact</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.annual_budget__usd__9</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>7</weight>
- <help_post></help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>Annual Budget (USD)</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.civicrm_components_12</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>12</weight>
- <help_post>Mark the CiviCRM components that your organization uses.</help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>CiviCRM Components</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.civicrm_consulting_firm__14</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>16</weight>
- <help_post>If your organization used a consultant to assist in installing, configuring or customizing CiviCRM enter the consulting firm name here.</help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>Consulting Firm?</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.how_are_you_using_civicrm_13</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>11</weight>
- <help_post>Briefly describe how your organization uses CiviCRM.</help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>How are you using CiviCRM</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.number_of_employees_8</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>8</weight>
- <help_post></help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>Number of Employees</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.organization_sector_10</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>9</weight>
- <help_post>Select one or more categories that most closely describe your organization's focus area(s).</help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>Organization Category</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.other_sector_11</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>10</weight>
- <help_post></help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>Other Category</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.recommend_to_others__17</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>15</weight>
- <help_post>Would you recommend CiviCRM to other organizations like yours?</help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>Recommend to others?</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.satisfaction_with_civicrm__15</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>13</weight>
- <help_post>Rate your organization's overall satisfaction level with CiviCRM.</help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>Satisfaction with CiviCRM?</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- <ProfileField>
- <field_name>custom.civicrm_value_civicrm_site_registration_4.usability_rating_16</field_name>
- <is_active>1</is_active>
- <is_view>0</is_view>
- <is_required>0</is_required>
- <weight>14</weight>
- <help_post>Rate the overall usability of CiviCRM.</help_post>
- <visibility>Public Pages</visibility>
- <in_selector>0</in_selector>
- <is_searchable>0</is_searchable>
- <label>Usability Rating</label>
- <field_type>Organization</field_type>
- <profile_group_name>Register Your Site Profile</profile_group_name>
- </ProfileField>
- </ProfileFields>
-</CustomData>
+++ /dev/null
-name = Extdir
-description = Export an extensions directory for use by CiviCRM
-package = Other
-core = 7.x
-php = 5.2
+++ /dev/null
-<?php
-
-/**
- * Implements hook_menu
- */
-function extdir_menu() {
- $items = array();
- $items['extdir/%'] = array(
- 'page callback' => '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
+++ /dev/null
-<?php
-
-/**
- * Maximum time an extdir page should be cached (seconds).
- *
- * Note: This overrides the system default.
- */
-// define('EXTDIR_MAX_AGE', 30*60);
-
-/**
- * (Page Callback)
- *
- * Get list of available extensions
- */
-function extdir_pages_listing($filterExpr) {
- $filters = _extdir_pages_filters_parse($filterExpr);
- list($query, $helper) = _extdir_pages_filters_query($filters);
- $helper->innerJoinFieldAPI('extension', 'field_extension_fq_name');
- $query->fields('field_extension_fq_name', array('field_extension_fq_name_value'));
- $query->distinct();
-
- // deliver
- print '<html><body>';
- print theme('extdir_list', array(
- 'extensions' => $query->execute(),
- ));
- print '</body></html>';
- 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, <extension>
- */
-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;
- }
-}
-
+++ /dev/null
-<?php
-
-printf("<ul>\n");
-foreach ($extensions as $extension) {
- $file = check_plain($extension->field_extension_fq_name_value . ".xml");
- printf("<li><a href=\"%s\">%s</a></li>\n",
- $file,
- $file
- );
-}
-printf("</ul>\n");