diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..05088657de17 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +.gitattributes export-ignore +.gitignore export-ignore diff --git a/.gitignore b/.gitignore index 390c2a04945c..4e197028908e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,12 @@ !/ext/sequentialcreditnotes !/ext/flexmailer !/ext/eventcart +!/ext/ewaysingle +!/ext/greenwich +/ext/greenwich/dist +/ext/greenwich/extern !/ext/search +!/ext/financialacls backdrop/ bower_components CRM/Case/xml/configuration diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 988340c94d42..2fa703199fa0 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -204,36 +204,29 @@ protected static function getGroupACLs($contact_id, $aclRoles = FALSE) { protected static function getGroupACLRoles($contact_id) { $contact_id = CRM_Utils_Type::escape($contact_id, 'Integer'); - $rule = new CRM_ACL_BAO_ACL(); - - $aclRole = 'civicrm_acl_role'; - - $aclER = CRM_ACL_DAO_EntityRole::getTableName(); - $c2g = CRM_Contact_BAO_GroupContact::getTableName(); - $query = " SELECT acl.* FROM civicrm_acl acl INNER JOIN civicrm_option_group og ON og.name = 'acl_role' INNER JOIN civicrm_option_value ov - ON acl.entity_table = '$aclRole' + ON acl.entity_table = 'civicrm_acl_role' AND ov.option_group_id = og.id AND acl.entity_id = ov.value AND ov.is_active = 1 - INNER JOIN $aclER - ON $aclER.acl_role_id = acl.entity_id - AND $aclER.is_active = 1 - INNER JOIN $c2g - ON $aclER.entity_id = $c2g.group_id - AND $aclER.entity_table = 'civicrm_group' - WHERE acl.entity_table = '$aclRole' + INNER JOIN civicrm_acl_entity_role acl_entity_role + ON acl_entity_role.acl_role_id = acl.entity_id + AND acl_entity_role.is_active = 1 + INNER JOIN civicrm_group_contact group_contact + ON acl_entity_role.entity_id = group_contact.group_id + AND acl_entity_role.entity_table = 'civicrm_group' + WHERE acl.entity_table = 'civicrm_acl_role' AND acl.is_active = 1 - AND $c2g.contact_id = $contact_id - AND $c2g.status = 'Added'"; + AND group_contact.contact_id = $contact_id + AND group_contact.status = 'Added'"; $results = []; - $rule->query($query); + $rule = CRM_Core_DAO::executeQuery($query); while ($rule->fetch()) { $results[$rule->id] = $rule->toArray(); @@ -254,7 +247,7 @@ protected static function getGroupACLRoles($contact_id) { AND acl.entity_table = 'civicrm_acl_role' "; - $rule->query($query); + $rule = CRM_Core_DAO::executeQuery($query); while ($rule->fetch()) { $results[$rule->id] = $rule->toArray(); } @@ -484,10 +477,10 @@ public static function group( $aclKeys = array_keys($acls); $aclKeys = implode(',', $aclKeys); - $cacheKey = CRM_Utils_Cache::cleanKey("$tableName-$aclKeys"); + $cacheKey = CRM_Utils_Cache::cleanKey("$type-$tableName-$aclKeys"); $cache = CRM_Utils_Cache::singleton(); $ids = $cache->get($cacheKey); - if (!$ids) { + if (!is_array($ids)) { $ids = []; $query = " SELECT a.operation, a.object_id diff --git a/CRM/ACL/DAO/ACL.php b/CRM/ACL/DAO/ACL.php index fa06cf96c5e2..57934d13036c 100644 --- a/CRM/ACL/DAO/ACL.php +++ b/CRM/ACL/DAO/ACL.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/ACL/ACL.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:f75eaa0ee87675c14a224ec22b2c30a7) + * (GenCodeChecksum:54e8c75c28c9dd74192f60bbcf1605f6) */ /** @@ -117,9 +117,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('ACLs'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('ACLs') : ts('ACL'); } /** diff --git a/CRM/ACL/DAO/ACLCache.php b/CRM/ACL/DAO/ACLCache.php index 7e3ac8429f16..4418878c769b 100644 --- a/CRM/ACL/DAO/ACLCache.php +++ b/CRM/ACL/DAO/ACLCache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/ACL/ACLCache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:cbf36d56ce734a5f7ceeb2071b68ebf8) + * (GenCodeChecksum:7faa5879056a56b463304bd81829afda) */ /** @@ -68,9 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('ACLCaches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('ACLCaches') : ts('ACLCache'); } /** @@ -82,7 +85,6 @@ public static function getEntityTitle() { public static function getReferenceColumns() { if (!isset(Civi::$statics[__CLASS__]['links'])) { Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'acl_id', 'civicrm_acl', 'id'); CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); } @@ -120,7 +122,6 @@ public static function &fields() { 'entity' => 'ACLCache', 'bao' => 'CRM_ACL_DAO_ACLCache', 'localizable' => 0, - 'FKClassName' => 'CRM_Contact_DAO_Contact', 'html' => [ 'type' => 'EntityRef', ], @@ -228,6 +229,14 @@ public static function &export($prefix = FALSE) { */ public static function indices($localize = TRUE) { $indices = [ + 'index_contact_id' => [ + 'name' => 'index_contact_id', + 'field' => [ + 0 => 'contact_id', + ], + 'localizable' => FALSE, + 'sig' => 'civicrm_acl_cache::0::contact_id', + ], 'index_acl_id' => [ 'name' => 'index_acl_id', 'field' => [ diff --git a/CRM/ACL/DAO/EntityRole.php b/CRM/ACL/DAO/EntityRole.php index 9130d307ae4c..4e31bd8466f9 100644 --- a/CRM/ACL/DAO/EntityRole.php +++ b/CRM/ACL/DAO/EntityRole.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/ACL/EntityRole.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:d985c951ef9a8872008576b41c1f2b9c) + * (GenCodeChecksum:c1087517beb5b266d4a1a0a1a342ced0) */ /** @@ -75,9 +75,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Entity Roles'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Entity Roles') : ts('Entity Role'); } /** diff --git a/CRM/ACL/Form/ACL.php b/CRM/ACL/Form/ACL.php index de1665dcd466..1c7af2a0952f 100644 --- a/CRM/ACL/Form/ACL.php +++ b/CRM/ACL/Form/ACL.php @@ -96,11 +96,12 @@ public function buildQuickForm() { $this->add('text', 'name', ts('Description'), CRM_Core_DAO::getAttribute('CRM_ACL_DAO_ACL', 'name'), TRUE); - $operations = ['' => ts('- select -')] + CRM_ACL_BAO_ACL::operation(); $this->add('select', 'operation', ts('Operation'), - $operations, TRUE + CRM_ACL_BAO_ACL::operation(), + TRUE, + ['placeholder' => TRUE] ); $objTypes = [ @@ -129,22 +130,22 @@ public function buildQuickForm() { $this->add('select', 'entity_id', $label, $role, TRUE); $group = [ - '-1' => ts('- select -'), + '-1' => ts('- select group -'), '0' => ts('All Groups'), ] + CRM_Core_PseudoConstant::group(); $customGroup = [ - '-1' => ts('- select -'), + '-1' => ts('- select set of custom fields -'), '0' => ts('All Custom Groups'), ] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id'); $ufGroup = [ - '-1' => ts('- select -'), + '-1' => ts('- select profile -'), '0' => ts('All Profiles'), ] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); $event = [ - '-1' => ts('- select -'), + '-1' => ts('- select event -'), '0' => ts('All Events'), ] + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )"); diff --git a/CRM/ACL/Form/EntityRole.php b/CRM/ACL/Form/EntityRole.php index d12686fe433e..7d599deff475 100644 --- a/CRM/ACL/Form/EntityRole.php +++ b/CRM/ACL/Form/EntityRole.php @@ -26,9 +26,8 @@ public function buildQuickForm() { return; } - $aclRoles = ['' => ts('- select -')] + CRM_Core_OptionGroup::values('acl_role'); $this->add('select', 'acl_role_id', ts('ACL Role'), - $aclRoles, TRUE + CRM_Core_OptionGroup::values('acl_role'), TRUE, ['placeholder' => TRUE] ); $label = ts('Assigned to'); diff --git a/CRM/Activity/ActionMapping.php b/CRM/Activity/ActionMapping.php index 05abcf9e24c9..9f73592644b7 100644 --- a/CRM/Activity/ActionMapping.php +++ b/CRM/Activity/ActionMapping.php @@ -118,4 +118,12 @@ public function createQuery($schedule, $phase, $defaultParams) { return $query; } + /** + * Determine whether a schedule based on this mapping should + * send to additional contacts. + */ + public function sendToAdditional($entityId): bool { + return TRUE; + } + } diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 3c8a0eb1551f..8414c93660d9 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -9,6 +9,8 @@ +--------------------------------------------------------------------+ */ +use Civi\Api4\ActivityContact; + /** * * @package CRM @@ -315,13 +317,8 @@ public static function create(&$params) { $params['assignee_contact_id'] = array_unique($params['assignee_contact_id']); } - // CRM-9137 - if (!empty($params['id'])) { - CRM_Utils_Hook::pre('edit', 'Activity', $params['id'], $params); - } - else { - CRM_Utils_Hook::pre('create', 'Activity', NULL, $params); - } + $action = empty($params['id']) ? 'create' : 'edit'; + CRM_Utils_Hook::pre($action, 'Activity', $params['id'] ?? NULL, $params); $activity->copyValues($params); if (isset($params['case_id'])) { @@ -344,124 +341,79 @@ public static function create(&$params) { } $activityId = $activity->id; - $sourceID = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Source'); - $assigneeID = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Assignees'); - $targetID = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Targets'); - - if (isset($params['source_contact_id'])) { - $acParams = [ - 'activity_id' => $activityId, - 'contact_id' => $params['source_contact_id'], - 'record_type_id' => $sourceID, - ]; - self::deleteActivityContact($activityId, $sourceID); - CRM_Activity_BAO_ActivityContact::create($acParams); - } - - // check and attach and files as needed - CRM_Core_BAO_File::processAttachment($params, 'civicrm_activity', $activityId); - - // attempt to save activity assignment - $resultAssignment = NULL; - if (!empty($params['assignee_contact_id'])) { - - $assignmentParams = ['activity_id' => $activityId]; + $activityRecordTypes = [ + 'source_contact_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Source'), + 'assignee_contact_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Assignees'), + 'target_contact_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Targets'), + ]; - if (is_array($params['assignee_contact_id'])) { - if (CRM_Utils_Array::value('deleteActivityAssignment', $params, TRUE)) { - // first delete existing assignments if any - self::deleteActivityContact($activityId, $assigneeID); + $activityContacts = []; + // Cast to an array if we just have an integer. Index by record type id. + foreach ($activityRecordTypes as $key => $recordTypeID) { + if (isset($params[$key])) { + if (empty($params[$key])) { + $activityContacts[$recordTypeID] = []; } - - foreach ($params['assignee_contact_id'] as $acID) { - if ($acID) { - $assigneeParams = [ - 'activity_id' => $activityId, - 'contact_id' => $acID, - 'record_type_id' => $assigneeID, - ]; - CRM_Activity_BAO_ActivityContact::create($assigneeParams); + else { + foreach ((array) $params[$key] as $contactID) { + $activityContacts[$recordTypeID][$contactID] = (int) $contactID; } } } - else { - $assignmentParams['contact_id'] = $params['assignee_contact_id']; - $assignmentParams['record_type_id'] = $assigneeID; - if (!empty($params['id'])) { - $assignment = new CRM_Activity_BAO_ActivityContact(); - $assignment->activity_id = $activityId; - $assignment->record_type_id = $assigneeID; - $assignment->find(TRUE); - - if ($assignment->contact_id != $params['assignee_contact_id']) { - $assignmentParams['id'] = $assignment->id; - $resultAssignment = CRM_Activity_BAO_ActivityContact::create($assignmentParams); - } + } + + if ($action === 'edit' && !empty($activityContacts)) { + $wheres = []; + foreach ($activityContacts as $recordTypeID => $contactIDs) { + if (!empty($contactIDs)) { + $wheres[$key] = "(record_type_id = $recordTypeID AND contact_id IN (" . implode(',', $contactIDs) . '))'; } - else { - $resultAssignment = CRM_Activity_BAO_ActivityContact::create($assignmentParams); + } + $existingArray = empty($wheres) ? [] : CRM_Core_DAO::executeQuery(" + SELECT id, contact_id, record_type_id + FROM civicrm_activity_contact + WHERE activity_id = %1 + AND (" . implode(' OR ', $wheres) . ')', + [1 => [$params['id'], 'Integer']])->fetchAll(); + + $recordsToKeep = []; + $wheres = [['activity_id', '=', $params['id']], ['record_type_id', 'IN', array_keys($activityContacts)]]; + + foreach ($existingArray as $existingRecords) { + $recordsToKeep[$existingRecords['id']] = ['contact_id' => $existingRecords['contact_id'], 'record_type_id' => $existingRecords['record_type_id']]; + unset($activityContacts[$recordTypeID][$existingRecords['contact_id']]); + if (empty($activityContacts[$recordTypeID])) { + // If we just removed the last one to update then also unset the key. + unset($activityContacts[$recordTypeID]); } } - } - else { - if (CRM_Utils_Array::value('deleteActivityAssignment', $params, TRUE)) { - self::deleteActivityContact($activityId, $assigneeID); + + if (!empty($recordsToKeep)) { + $wheres[] = ['id', 'NOT IN', array_keys($recordsToKeep)]; } - } - if (is_a($resultAssignment, 'CRM_Core_Error')) { - $transaction->rollback(); - return $resultAssignment; + // Delete all existing records for the types to be updated. Do a quick check to make sure there + // is at least one to avoid a delete query if not necessary (delete queries are more likely to cause contention). + if (ActivityContact::get($params['check_permissions'] ?? FALSE)->setLimit(1)->setWhere($wheres)->selectRowCount()->execute()) { + ActivityContact::delete($params['check_permissions'] ?? FALSE)->setWhere($wheres)->execute(); + } } - // attempt to save activity targets - $resultTarget = NULL; - if (!empty($params['target_contact_id'])) { - - $targetParams = ['activity_id' => $activityId]; - $resultTarget = []; - if (is_array($params['target_contact_id'])) { - if (CRM_Utils_Array::value('deleteActivityTarget', $params, TRUE)) { - // first delete existing targets if any - self::deleteActivityContact($activityId, $targetID); - } - - foreach ($params['target_contact_id'] as $tid) { - if ($tid) { - $targetContactParams = [ - 'activity_id' => $activityId, - 'contact_id' => $tid, - 'record_type_id' => $targetID, - ]; - CRM_Activity_BAO_ActivityContact::create($targetContactParams); - } - } - } - else { - $targetParams['contact_id'] = $params['target_contact_id']; - $targetParams['record_type_id'] = $targetID; - if (!empty($params['id'])) { - $target = new CRM_Activity_BAO_ActivityContact(); - $target->activity_id = $activityId; - $target->record_type_id = $targetID; - $target->find(TRUE); - - if ($target->contact_id != $params['target_contact_id']) { - $targetParams['id'] = $target->id; - $resultTarget = CRM_Activity_BAO_ActivityContact::create($targetParams); - } - } - else { - $resultTarget = CRM_Activity_BAO_ActivityContact::create($targetParams); - } + $activityContactApiValues = []; + foreach ($activityContacts as $recordTypeID => $contactIDs) { + foreach ($contactIDs as $contactID) { + $activityContactApiValues[] = ['record_type_id' => $recordTypeID, 'contact_id' => $contactID]; } } - else { - if (CRM_Utils_Array::value('deleteActivityTarget', $params, TRUE)) { - self::deleteActivityContact($activityId, $targetID); - } + + if (!empty($activityContactApiValues)) { + ActivityContact::save($params['check_permissions'] ?? FALSE)->addDefault('activity_id', $activityId) + ->setRecords($activityContactApiValues)->execute(); } + // check and attach and files as needed + CRM_Core_BAO_File::processAttachment($params, 'civicrm_activity', $activityId); + // write to changelog before transaction is committed/rolled // back (and prepare status to display) if (!empty($params['id'])) { @@ -607,13 +559,7 @@ public static function create(&$params) { self::logActivityAction($activity, "Case details for {$matches[1]} not found while recording an activity on case."); } } - if (!empty($params['id'])) { - CRM_Utils_Hook::post('edit', 'Activity', $activity->id, $activity); - } - else { - CRM_Utils_Hook::post('create', 'Activity', $activity->id, $activity); - } - + CRM_Utils_Hook::post($action, 'Activity', $activity->id, $activity); return $result; } @@ -1694,21 +1640,12 @@ public static function getContactActivity($contactId) { */ public static function addActivity( $activity, - $activityType = 'Membership Signup', + $activityType, $targetContactID = NULL, $params = [] ) { $date = date('YmdHis'); - if ($activity->__table == 'civicrm_membership') { - $component = 'Membership'; - } - elseif ($activity->__table == 'civicrm_participant') { - if ($activityType != 'Email') { - $activityType = 'Event Registration'; - } - $component = 'Event'; - } - elseif ($activity->__table == 'civicrm_contribution') { + if ($activity->__table == 'civicrm_contribution') { // create activity record only for Completed Contributions $contributionCompletedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); if ($activity->contribution_status_id != $contributionCompletedStatusId) { @@ -1718,7 +1655,6 @@ public static function addActivity( } $params['status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', 'Scheduled'); } - $activityType = $component = 'Contribution'; // retrieve existing activity based on source_record_id and activity_type if (empty($params['id'])) { @@ -1732,7 +1668,7 @@ public static function addActivity( $params['campaign_id'] = $activity->campaign_id; } - $date = CRM_Utils_Date::isoToMysql($activity->receive_date); + $date = $activity->receive_date; } $activityParams = [ @@ -1772,7 +1708,7 @@ public static function addActivity( // @todo - use api - remove lots of wrangling above. Remove deprecated fatal & let form layer // deal with any exceptions. if (is_a(self::create($activityParams), 'CRM_Core_Error')) { - throw new CRM_Core_Exception("Failed creating Activity for $component of id {$activity->id}"); + throw new CRM_Core_Exception("Failed creating Activity of type $activityType for entity id {$activity->id}"); } } @@ -2164,7 +2100,6 @@ public static function exportableFields($name = 'Activity') { ], ]; $fields = array_merge($activityFields, $exportableFields); - $fields['activity_type_id']['title'] = ts('Activity Type ID'); $fields['activity_priority_id'] = $fields['priority_id']; if ($name === 'Case') { @@ -2631,7 +2566,7 @@ public static function getContactActivitySelector(&$params) { } } } - elseif (!$values['target_contact_name']) { + elseif (empty($values['target_contact_name'])) { $activity['target_contact_name'] = 'n/a'; } diff --git a/CRM/Activity/BAO/ActivityContact.php b/CRM/Activity/BAO/ActivityContact.php index 527e664da5da..6efa32ab9ddd 100644 --- a/CRM/Activity/BAO/ActivityContact.php +++ b/CRM/Activity/BAO/ActivityContact.php @@ -37,13 +37,22 @@ public function __construct() { * activity_contact object */ public static function create($params) { + $errorScope = CRM_Core_TemporaryErrorScope::useException(); $activityContact = new CRM_Activity_DAO_ActivityContact(); - $activityContact->copyValues($params); - if (!$activityContact->find(TRUE)) { + try { return $activityContact->save(); } - return $activityContact; + catch (PEAR_Exception $e) { + // This check used to be done first, creating an extra query before each insert. + // However, in none of the core tests was this ever called with values that already + // existed, meaning that this line would never or almost never be hit. + // hence it's better to save the select query here. + if ($activityContact->find(TRUE)) { + return $activityContact; + } + throw $e; + } } /** diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index d432467e8d40..0aa2df666a3f 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -478,7 +478,7 @@ public static function buildSearchForm(&$form) { 'multiple' => 'multiple', 'class' => 'crm-select2', - 'placeholder' => ts('- select -'), + 'placeholder' => ts('- select tags -'), ] ); } diff --git a/CRM/Activity/DAO/Activity.php b/CRM/Activity/DAO/Activity.php index 3221932f12ea..26f50e0b5f65 100644 --- a/CRM/Activity/DAO/Activity.php +++ b/CRM/Activity/DAO/Activity.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Activity/Activity.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:acbed5c46fa2f00de06493210358c684) + * (GenCodeChecksum:c1b4cc908c0220abf69f57d281eeda95) */ /** @@ -226,9 +226,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Activities'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Activities') : ts('Activity'); } /** @@ -288,7 +291,7 @@ public static function &fields() { 'activity_type_id' => [ 'name' => 'activity_type_id', 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Activity Type'), + 'title' => ts('Activity Type ID'), 'description' => ts('FK to civicrm_option_value.id, that has to be valid, registered activity type.'), 'required' => TRUE, 'import' => TRUE, @@ -302,6 +305,7 @@ public static function &fields() { 'localizable' => 0, 'html' => [ 'type' => 'Select', + 'label' => ts("Activity Type"), ], 'pseudoconstant' => [ 'optionGroupName' => 'activity_type', @@ -391,7 +395,7 @@ public static function &fields() { 'phone_id' => [ 'name' => 'phone_id', 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Phone (called)'), + 'title' => ts('Phone (called) ID'), 'description' => ts('Phone ID of the number called (optional - used if an existing phone number is selected).'), 'where' => 'civicrm_activity.phone_id', 'table_name' => 'civicrm_activity', @@ -401,6 +405,7 @@ public static function &fields() { 'FKClassName' => 'CRM_Core_DAO_Phone', 'html' => [ 'type' => 'EntityRef', + 'label' => ts("Phone (called)"), ], 'add' => '2.0', ], diff --git a/CRM/Activity/DAO/ActivityContact.php b/CRM/Activity/DAO/ActivityContact.php index 61676f395b5f..fd6633a19111 100644 --- a/CRM/Activity/DAO/ActivityContact.php +++ b/CRM/Activity/DAO/ActivityContact.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Activity/ActivityContact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:777598f3625dfeaf37a81de282808c60) + * (GenCodeChecksum:60851972b9f03efb52350929e557c768) */ /** @@ -68,9 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Activity Contacts'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Activity Contacts') : ts('Activity Contact'); } /** diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 329e33096067..c6b07c4a397d 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -503,7 +503,7 @@ public function preProcess() { } if ($this->_action & CRM_Core_Action::VIEW) { - $this->_values['details'] = CRM_Utils_String::purifyHtml($this->_values['details']); + $this->_values['details'] = CRM_Utils_String::purifyHtml($this->_values['details'] ?? ''); $url = CRM_Utils_System::url(implode("/", $this->urlPath), "reset=1&id={$this->_activityId}&action=view&cid={$this->_values['source_contact_id']}"); CRM_Utils_Recent::add(CRM_Utils_Array::value('subject', $this->_values, ts('(no subject)')), $url, @@ -628,10 +628,11 @@ public function buildQuickForm() { $this->assign('suppressForm', FALSE); $element = $this->add('select', 'activity_type_id', ts('Activity Type'), - ['' => '- ' . ts('select') . ' -'] + $this->_fields['followup_activity_type_id']['attributes'], + $this->_fields['followup_activity_type_id']['attributes'], FALSE, [ 'onchange' => "CRM.buildCustomData( 'Activity', this.value, false, false, false, false, false, false, {$this->_currentlyViewedContactId});", 'class' => 'crm-select2 required', + 'placeholder' => TRUE, ] ); @@ -695,7 +696,8 @@ public function buildQuickForm() { $responseOptions = CRM_Campaign_BAO_Survey::getResponsesOptions($surveyId); if ($responseOptions) { $this->add('select', 'result', ts('Result'), - ['' => ts('- select -')] + array_combine($responseOptions, $responseOptions) + array_combine($responseOptions, $responseOptions), + FALSE, ['placeholder' => TRUE] ); } $surveyTitle = NULL; diff --git a/CRM/Activity/Form/Task.php b/CRM/Activity/Form/Task.php index 462499c38fd3..3be85d5bc302 100644 --- a/CRM/Activity/Form/Task.php +++ b/CRM/Activity/Form/Task.php @@ -38,18 +38,16 @@ public function preProcess() { /** * Common pre-process function. * - * @param CRM_Core_Form $form + * @param \CRM_Core_Form_Task $form * * @throws \CRM_Core_Exception */ public static function preProcessCommon(&$form) { $form->_activityHolderIds = []; - $values = $form->controller->exportValues($form->get('searchFormName')); + $values = $form->getSearchFormValues(); $form->_task = $values['task']; - $activityTasks = CRM_Activity_Task::tasks(); - $form->assign('taskName', $activityTasks[$form->_task]); $ids = []; if ($values['radio_ts'] == 'ts_sel') { diff --git a/CRM/Activity/Form/Task/SearchTaskHookSample.php b/CRM/Activity/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 003dd58c7e2b..000000000000 --- a/CRM/Activity/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,73 +0,0 @@ -_activityHolderIds); - - $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); - $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); - $query = " - SELECT at.subject as subject, - ov.label as activity_type, - at.activity_date_time as activity_date, - ct.display_name as display_name - FROM civicrm_activity at -LEFT JOIN civicrm_activity_contact ac ON ( ac.activity_id = at.id AND ac.record_type_id = {$sourceID} ) -INNER JOIN civicrm_contact ct ON ( ac.contact_id = ct.id ) - LEFT JOIN civicrm_option_group og ON ( og.name = 'activity_type' ) - LEFT JOIN civicrm_option_value ov ON (at.activity_type_id = ov.value AND og.id = ov.option_group_id ) - WHERE at.id IN ( $activityIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - - while ($dao->fetch()) { - $rows[] = [ - 'subject' => $dao->subject, - 'activity_type' => $dao->activity_type, - 'activity_date' => $dao->activity_date, - 'display_name' => $dao->display_name, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 65262d50f96f..f61df22bb478 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -275,7 +275,7 @@ public static function _convertToCaseActivity($params) { if (!$otherActivity->find(TRUE)) { return (['error_msg' => 'activity record is missing.']); } - $actDateTime = CRM_Utils_Date::isoToMysql($otherActivity->activity_date_time); + $actDateTime = $otherActivity->activity_date_time; // Create new activity record. $mainActivity = new CRM_Activity_DAO_Activity(); diff --git a/CRM/Activity/Tokens.php b/CRM/Activity/Tokens.php index fff8e6224a50..250f88a38dcd 100644 --- a/CRM/Activity/Tokens.php +++ b/CRM/Activity/Tokens.php @@ -134,7 +134,7 @@ public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefe $activity = (object) $prefetch['activity'][$activityId]; - if (in_array($field, ['activity_date_time', 'created_date'])) { + if (in_array($field, ['activity_date_time', 'created_date', 'modified_date'])) { $row->tokens($entity, $field, \CRM_Utils_Date::customFormat($activity->$field)); } elseif (isset($mapping[$field]) and (isset($activity->{$mapping[$field]}))) { @@ -179,11 +179,12 @@ protected function getBasicTokens() { 'subject' => ts('Activity Subject'), 'details' => ts('Activity Details'), 'activity_date_time' => ts('Activity Date-Time'), + 'created_date' => ts('Activity Created Date'), + 'modified_date' => ts('Activity Modified Date'), 'activity_type_id' => ts('Activity Type ID'), 'status' => ts('Activity Status'), 'status_id' => ts('Activity Status ID'), 'location' => ts('Activity Location'), - 'created_date' => ts('Activity Creation Date'), 'duration' => ts('Activity Duration'), 'campaign' => ts('Activity Campaign'), 'campaign_id' => ts('Activity Campaign ID'), diff --git a/CRM/Admin/Form/Job.php b/CRM/Admin/Form/Job.php index 0f69059f7b3e..2738c1b49c17 100644 --- a/CRM/Admin/Form/Job.php +++ b/CRM/Admin/Form/Job.php @@ -24,6 +24,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form { public function preProcess() { parent::preProcess(); + $this->setContext(); CRM_Utils_System::setTitle(ts('Manage - Scheduled Jobs')); @@ -97,10 +98,10 @@ public function buildQuickForm($check = FALSE) { $this->add('select', 'run_frequency', ts('Run frequency'), CRM_Core_SelectValues::getJobFrequency()); // CRM-17686 - $this->add('datepicker', 'scheduled_run_date', ts('Scheduled Run Date'), NULL, FALSE, ['minDate' => time()]); + $this->add('datepicker', 'scheduled_run_date', ts('Scheduled Run Date'), NULL, FALSE, ['minDate' => date('Y-m-d')]); $this->add('textarea', 'parameters', ts('Command parameters'), - "cols=50 rows=6" + ['cols' => 50, 'rows' => 6] ); // is this job active ? @@ -194,7 +195,15 @@ public function postProcess() { $jm->executeJobById($this->_id); $jobName = self::getJobName($this->_id); CRM_Core_Session::setStatus(ts('%1 Scheduled Job has been executed. See the log for details.', [1 => $jobName]), ts("Executed"), "success"); - CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/job', 'reset=1')); + + if ($this->getContext() === 'joblog') { + // If we were triggered via the joblog form redirect back there when we finish + $redirectUrl = CRM_Utils_System::url('civicrm/admin/joblog', 'reset=1&jid=' . $this->_id); + } + else { + $redirectUrl = CRM_Utils_System::url('civicrm/admin/job', 'reset=1'); + } + CRM_Utils_System::redirect($redirectUrl); return; } diff --git a/CRM/Admin/Form/MailSettings.php b/CRM/Admin/Form/MailSettings.php index 4de49fe41356..70c227b1ede4 100644 --- a/CRM/Admin/Form/MailSettings.php +++ b/CRM/Admin/Form/MailSettings.php @@ -70,6 +70,9 @@ public function buildQuickForm() { ]; $this->add('select', 'is_default', ts('Used For?'), $usedfor); $this->addField('activity_status', ['placeholder' => FALSE]); + + $this->add('checkbox', 'is_non_case_email_skipped', ts('Skip emails which do not have a Case ID or Case hash')); + $this->add('checkbox', 'is_contact_creation_disabled_if_no_match', ts('Do not create new contacts when filing emails')); } /** @@ -146,6 +149,8 @@ public function postProcess() { 'is_ssl', 'is_default', 'activity_status', + 'is_non_case_email_skipped', + 'is_contact_creation_disabled_if_no_match', ]; $params = []; @@ -153,6 +158,8 @@ public function postProcess() { if (in_array($f, [ 'is_default', 'is_ssl', + 'is_non_case_email_skipped', + 'is_contact_creation_disabled_if_no_match', ])) { $params[$f] = CRM_Utils_Array::value($f, $formValues, FALSE); } @@ -164,7 +171,7 @@ public function postProcess() { $params['domain_id'] = CRM_Core_Config::domainID(); // assign id only in update mode - $status = ts('Your New Email Settings have been saved.'); + $status = ts('Your New Email Settings have been saved.'); if ($this->_action & CRM_Core_Action::UPDATE) { $params['id'] = $this->_id; $status = ts('Your Email Settings have been updated.'); diff --git a/CRM/Admin/Form/MessageTemplates.php b/CRM/Admin/Form/MessageTemplates.php index 5f809f25bedd..47567b474274 100644 --- a/CRM/Admin/Form/MessageTemplates.php +++ b/CRM/Admin/Form/MessageTemplates.php @@ -179,7 +179,7 @@ public function buildQuickForm() { ) ) { $this->add('textarea', 'msg_html', ts('HTML Message'), - "cols=50 rows=6" + ['cols' => 50, 'rows' => 6] ); } else { @@ -194,7 +194,7 @@ public function buildQuickForm() { } $this->add('textarea', 'msg_text', ts('Text Message'), - "cols=50 rows=6" + ['cols' => 50, 'rows' => 6] ); $this->add('select', 'pdf_format_id', ts('PDF Page Format'), diff --git a/CRM/Admin/Form/OptionGroup.php b/CRM/Admin/Form/OptionGroup.php index af8ca876340c..2a5ec115a29c 100644 --- a/CRM/Admin/Form/OptionGroup.php +++ b/CRM/Admin/Form/OptionGroup.php @@ -133,7 +133,7 @@ public function postProcess() { } $optionGroup = CRM_Core_BAO_OptionGroup::add($params); - CRM_Core_Session::setStatus(ts('The Option Group \'%1\' has been saved.', [1 => $optionGroup->name]), ts('Saved'), 'success'); + CRM_Core_Session::setStatus(ts('The Option Group \'%1\' has been saved.', [1 => $optionGroup->title]), ts('Saved'), 'success'); } } diff --git a/CRM/Admin/Form/PdfFormats.php b/CRM/Admin/Form/PdfFormats.php index 0ec9042d5839..1f7c10a0f50c 100644 --- a/CRM/Admin/Form/PdfFormats.php +++ b/CRM/Admin/Form/PdfFormats.php @@ -67,7 +67,7 @@ public function buildQuickForm() { ['onChange' => "selectPaper( this.value );"] ); - $this->add('static', 'paper_dimensions', NULL, ts('Width x Height')); + $this->add('static', 'paper_dimensions', ts('Width x Height')); $this->add('select', 'orientation', ts('Orientation'), CRM_Core_BAO_PdfFormat::getPageOrientations(), FALSE, ['onChange' => "updatePaperDimensions();"] ); diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index 775fa2c04ec5..0716cdebd233 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -50,7 +50,17 @@ public function buildQuickForm() { $invoiceSettings = Civi::settings()->get('contribution_invoice_settings'); $this->assign('invoicing', CRM_Invoicing_Utils::isInvoicingEnabled()); - $this->addElement('submit', 'ckeditor_config', ts('Configure CKEditor')); + $this->addElement( + 'xbutton', + 'ckeditor_config', + CRM_Core_Page::crmIcon('fa-wrench') . ' ' . ts('Configure CKEditor'), + [ + 'type' => 'submit', + 'class' => 'crm-button', + 'style' => 'display:inline-block;vertical-align:middle;float:none!important;', + 'value' => 1, + ] + ); $editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0'); $this->assign('editOptions', $editOptions); diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index c881ef779387..f9ab1c98a6a2 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -250,7 +250,7 @@ public function buildQuickForm() { $this->addEntityRef('recipient_manual_id', ts('Manual Recipients'), ['multiple' => TRUE, 'create' => TRUE]); $this->add('select', 'group_id', ts('Group'), - CRM_Core_PseudoConstant::nestedGroup('Mailing'), FALSE, ['class' => 'crm-select2 huge'] + CRM_Core_PseudoConstant::nestedGroup(), FALSE, ['class' => 'crm-select2 huge'] ); // multilingual only options diff --git a/CRM/Admin/Form/Setting/Smtp.php b/CRM/Admin/Form/Setting/Smtp.php index da909c7f0877..79e0da4f7782 100644 --- a/CRM/Admin/Form/Setting/Smtp.php +++ b/CRM/Admin/Form/Setting/Smtp.php @@ -61,7 +61,12 @@ public function buildQuickForm() { $this->addFormRule(['CRM_Admin_Form_Setting_Smtp', 'formRule']); parent::buildQuickForm(); $buttons = $this->getElement('buttons')->getElements(); - $buttons[] = $this->createElement('submit', $this->_testButtonName, ts('Save & Send Test Email'), ['crm-icon' => 'fa-envelope-o']); + $buttons[] = $this->createElement( + 'xbutton', + $this->_testButtonName, + CRM_Core_Page::crmIcon('fa-envelope-o') . ' ' . ts('Save & Send Test Email'), + ['type' => 'submit'] + ); $this->getElement('buttons')->setElements($buttons); if (!empty($setStatus)) { diff --git a/CRM/Admin/Form/Setting/UF.php b/CRM/Admin/Form/Setting/UF.php index 62c12870f974..208b2f3cf16a 100644 --- a/CRM/Admin/Form/Setting/UF.php +++ b/CRM/Admin/Form/Setting/UF.php @@ -61,7 +61,8 @@ public function buildQuickForm() { $config->dsn != $config->userFrameworkDSN || !empty($drupal_prefix) ) ) { - $dsnArray = DB::parseDSN($config->dsn); + $dsn = CRM_Utils_SQL::autoSwitchDSN($config->dsn); + $dsnArray = DB::parseDSN($dsn); $tableNames = CRM_Core_DAO::getTableNames(); asort($tableNames); $tablePrefixes = '$databases[\'default\'][\'default\'][\'prefix\']= array('; diff --git a/CRM/Admin/Page/Job.php b/CRM/Admin/Page/Job.php index 2164d2b7cefa..5a8d30767c57 100644 --- a/CRM/Admin/Page/Job.php +++ b/CRM/Admin/Page/Job.php @@ -117,6 +117,9 @@ public function run() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0 ); + $this->_context = CRM_Utils_Request::retrieve('context', 'String', + $this, FALSE, 0 + ); if (($this->_action & CRM_Core_Action::COPY) && (!empty($this->_id))) { try { diff --git a/CRM/Admin/Page/JobLog.php b/CRM/Admin/Page/JobLog.php index c7b1226535f9..e31a52558d6f 100644 --- a/CRM/Admin/Page/JobLog.php +++ b/CRM/Admin/Page/JobLog.php @@ -73,17 +73,17 @@ public function run() { * Browse all jobs. */ public function browse() { - $jid = CRM_Utils_Request::retrieve('jid', 'Positive', $this); + $jid = CRM_Utils_Request::retrieve('jid', 'Positive'); $sj = new CRM_Core_JobManager(); - $jobName = NULL; if ($jid) { $jobName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Job', $jid); + $this->assign('jobName', $jobName); + $jobRunUrl = CRM_Utils_System::url('civicrm/admin/job', 'action=view&reset=1&context=joblog&id=' . $jid); + $this->assign('jobRunUrl', $jobRunUrl); } - $this->assign('jobName', $jobName); - $dao = new CRM_Core_DAO_JobLog(); $dao->orderBy('id desc'); diff --git a/CRM/Api4/Page/Api4Explorer.php b/CRM/Api4/Page/Api4Explorer.php index 3daba0733836..d78ef91ddc55 100644 --- a/CRM/Api4/Page/Api4Explorer.php +++ b/CRM/Api4/Page/Api4Explorer.php @@ -11,6 +11,7 @@ */ use Civi\Api4\Service\Schema\Joinable\Joinable; +use Civi\Api4\Utils\CoreUtil; /** * @@ -30,7 +31,7 @@ public function run() { }); } $vars = [ - 'operators' => \CRM_Core_DAO::acceptedSQLOperators(), + 'operators' => CoreUtil::getOperators(), 'basePath' => Civi::resources()->getUrl('civicrm'), 'schema' => (array) \Civi\Api4\Entity::get()->setChain(['fields' => ['$name', 'getFields']])->execute(), 'links' => $entityLinks, @@ -39,9 +40,9 @@ public function run() { 'groupOptions' => array_column((array) $groupOptions, 'options', 'name'), ]; Civi::resources() + ->addBundle('bootstrap3') ->addVars('api4', $vars) ->addPermissions(['access debug output', 'edit groups', 'administer reserved groups']) - ->addScriptFile('civicrm', 'js/load-bootstrap.js') ->addScriptFile('civicrm', 'bower_components/js-yaml/dist/js-yaml.min.js') ->addScriptFile('civicrm', 'bower_components/marked/marked.min.js') ->addScriptFile('civicrm', 'bower_components/google-code-prettify/bin/prettify.min.js') diff --git a/CRM/Batch/DAO/Batch.php b/CRM/Batch/DAO/Batch.php index f2571b674f83..7e153f47861e 100644 --- a/CRM/Batch/DAO/Batch.php +++ b/CRM/Batch/DAO/Batch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Batch/Batch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:8169fc2f338afc4a163214c0018030be) + * (GenCodeChecksum:29e187971d03eba3ce5e3848f2ea1a5b) */ /** @@ -157,9 +157,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Batches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Batches') : ts('Batch'); } /** diff --git a/CRM/Batch/DAO/EntityBatch.php b/CRM/Batch/DAO/EntityBatch.php index 6c697fb37073..f7e2fffb74bd 100644 --- a/CRM/Batch/DAO/EntityBatch.php +++ b/CRM/Batch/DAO/EntityBatch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Batch/EntityBatch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6b6bd1337d9011c2a262de0e62c1e8e1) + * (GenCodeChecksum:aaeb317f89d831d683f53e7c45e1b175) */ /** @@ -68,9 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Entity Batches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Entity Batches') : ts('Entity Batch'); } /** diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index e60ababdb45c..35c407a79f26 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -173,9 +173,14 @@ public function buildQuickForm() { // add the force save button $forceSave = $this->getButtonName('upload', 'force'); - $this->addElement('submit', + $this->addElement('xbutton', $forceSave, - ts('Ignore Mismatch & Process the Batch?') + ts('Ignore Mismatch & Process the Batch?'), + [ + 'type' => 'submit', + 'value' => 1, + 'class' => 'crm-button crm-button_qf_Entry_upload_force-save', + ] ); $this->addButtons([ diff --git a/CRM/Campaign/DAO/Campaign.php b/CRM/Campaign/DAO/Campaign.php index 742996a6bde2..8dc0245910ea 100644 --- a/CRM/Campaign/DAO/Campaign.php +++ b/CRM/Campaign/DAO/Campaign.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Campaign/Campaign.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:cfa77579eb9b91b31b6c5618b52c6e87) + * (GenCodeChecksum:a5a49e13e66a5d32b690835a49baf535) */ /** @@ -166,9 +166,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Campaigns'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Campaigns') : ts('Campaign'); } /** diff --git a/CRM/Campaign/DAO/CampaignGroup.php b/CRM/Campaign/DAO/CampaignGroup.php index 97d4abd5af18..581ab4e5052b 100644 --- a/CRM/Campaign/DAO/CampaignGroup.php +++ b/CRM/Campaign/DAO/CampaignGroup.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Campaign/CampaignGroup.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:74c02a4708ef706860d023c1635b98c4) + * (GenCodeChecksum:55b3974bbc1aa8405d11a5c396401fa9) */ /** @@ -75,9 +75,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Campaign Groups'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Campaign Groups') : ts('Campaign Group'); } /** diff --git a/CRM/Campaign/DAO/Survey.php b/CRM/Campaign/DAO/Survey.php index 9c9626b6be8c..b6bc19126061 100644 --- a/CRM/Campaign/DAO/Survey.php +++ b/CRM/Campaign/DAO/Survey.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Campaign/Survey.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:e955546c8081852591bc08b1fdee4213) + * (GenCodeChecksum:afb7cfcccd2a6177b2b10e07afa92e8e) */ /** @@ -187,9 +187,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Surveys'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Surveys') : ts('Survey'); } /** diff --git a/CRM/Campaign/Form/Task.php b/CRM/Campaign/Form/Task.php index f59cc30ea60f..61411931d0ad 100644 --- a/CRM/Campaign/Form/Task.php +++ b/CRM/Campaign/Form/Task.php @@ -34,9 +34,6 @@ public function preProcess() { $values = $this->controller->exportValues('Search'); $this->_task = $values['task']; - $campaignTasks = CRM_Campaign_Task::tasks(); - $taskName = $campaignTasks[$this->_task] ?? NULL; - $this->assign('taskName', $taskName); $ids = []; if ($values['radio_ts'] == 'ts_sel') { diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 5a3f0b81061b..96a511e69bc9 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -1890,6 +1890,7 @@ public static function getRelatedCases($caseId, $excludeDeleted = TRUE) { 'case_id' => $dao->id, 'case_type' => $dao->case_type, 'client_name' => $clientView, + 'status_id' => $dao->status_id, 'case_status' => $statuses[$dao->status_id], 'links' => $caseView, ]; @@ -2069,7 +2070,7 @@ public static function mergeCases( CRM_Core_DAO::storeValues($otherActivity, $mainActVals); $mainActivity->copyValues($mainActVals); $mainActivity->id = NULL; - $mainActivity->activity_date_time = CRM_Utils_Date::isoToMysql($otherActivity->activity_date_time); + $mainActivity->activity_date_time = $otherActivity->activity_date_time; $mainActivity->source_record_id = CRM_Utils_Array::value($mainActivity->source_record_id, $activityMappingIds ); diff --git a/CRM/Case/DAO/Case.php b/CRM/Case/DAO/Case.php index 946c992f4b6a..ebf2311f678e 100644 --- a/CRM/Case/DAO/Case.php +++ b/CRM/Case/DAO/Case.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Case/Case.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:8b18140da75bbf971a143c205f2af1cd) + * (GenCodeChecksum:bae905b3b253acc0df005cc66dd9b717) */ /** @@ -115,9 +115,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Cases'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Cases') : ts('Case'); } /** diff --git a/CRM/Case/DAO/CaseActivity.php b/CRM/Case/DAO/CaseActivity.php index 9efe7b4af3e5..e0d65cb58b8d 100644 --- a/CRM/Case/DAO/CaseActivity.php +++ b/CRM/Case/DAO/CaseActivity.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Case/CaseActivity.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:974d18e84d3416c98293bedd66c3384c) + * (GenCodeChecksum:565c78ce07c94d858e5e6e400c4d1ad6) */ /** @@ -61,9 +61,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Case Activities'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Case Activities') : ts('Case Activity'); } /** diff --git a/CRM/Case/DAO/CaseContact.php b/CRM/Case/DAO/CaseContact.php index 788b1e58f948..d5b524ae02b4 100644 --- a/CRM/Case/DAO/CaseContact.php +++ b/CRM/Case/DAO/CaseContact.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Case/CaseContact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:b315f42d7c886c123c9e87c9713c4911) + * (GenCodeChecksum:57c93b00e00d0a48d5071d5a991289ab) */ /** @@ -61,9 +61,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Case Contacts'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Case Contacts') : ts('Case Contact'); } /** diff --git a/CRM/Case/DAO/CaseType.php b/CRM/Case/DAO/CaseType.php index dbafcb30a8db..246edc51fd66 100644 --- a/CRM/Case/DAO/CaseType.php +++ b/CRM/Case/DAO/CaseType.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Case/CaseType.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:cde81a56b0e8201eac521b92ded6fb45) + * (GenCodeChecksum:52f839e38c020cd422ef99dff4ab5f1b) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Case Types'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Case Types') : ts('Case Type'); } /** diff --git a/CRM/Case/Form/CaseView.php b/CRM/Case/Form/CaseView.php index 7c9724a53c83..f2300dadb23e 100644 --- a/CRM/Case/Form/CaseView.php +++ b/CRM/Case/Form/CaseView.php @@ -275,7 +275,10 @@ public function buildQuickForm() { // This button is hidden but gets clicked by javascript at // https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L194 // by the onChange handler for the above timeline_id select. - $this->addElement('submit', $this->getButtonName('next'), ' ', ['class' => 'hiddenElement']); + $this->addElement('xbutton', $this->getButtonName('next'), ' ', [ + 'class' => 'hiddenElement', + 'type' => 'submit', + ]); $this->buildMergeCaseForm(); @@ -523,11 +526,12 @@ public function buildMergeCaseForm() { // This button is hidden but gets clicked by javascript at // https://github.com/civicrm/civicrm-core/blob/bd28ecf8121a85bc069cad3ab912a0c3dff8fdc5/templates/CRM/Case/Form/CaseView.js#L55 // when the mergeCasesDialog is saved. - $this->addElement('submit', + $this->addElement('xbutton', $this->getButtonName('next', 'merge_case'), ts('Merge'), [ 'class' => 'hiddenElement', + 'type' => 'submit', ] ); } diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php index b22ab8c08e97..d3ba7a07c4d7 100644 --- a/CRM/Case/Form/Search.php +++ b/CRM/Case/Form/Search.php @@ -58,6 +58,9 @@ public function getDefaultEntity() { * Processing needed for buildForm and later. */ public function preProcess() { + // SearchFormName is deprecated & to be removed - the replacement is for the task to + // call $this->form->getSearchFormValues() + // A couple of extensions use it. $this->set('searchFormName', 'Search'); //check for civicase access. diff --git a/CRM/Case/Form/Task/SearchTaskHookSample.php b/CRM/Case/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index df83772a1ff0..000000000000 --- a/CRM/Case/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,68 +0,0 @@ -_entityIds); - $statusId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'case_status', 'id', 'name'); - $query = " -SELECT ct.display_name as display_name, - cs.start_date as start_date, - ov.label as status - -FROM civicrm_case cs -INNER JOIN civicrm_case_contact cc ON ( cs.id = cc.case_id) -INNER JOIN civicrm_contact ct ON ( cc.contact_id = ct.id) -LEFT JOIN civicrm_option_value ov ON (cs.status_id = ov.value AND ov.option_group_id = {$statusId} ) -WHERE cs.id IN ( {$caseIDs} )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'start_date' => CRM_Utils_Date::customFormat($dao->start_date), - 'status' => $dao->status, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Case/XMLProcessor/Process.php b/CRM/Case/XMLProcessor/Process.php index d010a47c6835..3a75649f0bfd 100644 --- a/CRM/Case/XMLProcessor/Process.php +++ b/CRM/Case/XMLProcessor/Process.php @@ -85,7 +85,13 @@ public function process($xml, &$params) { // create relationships for the ones that are required foreach ($xml->CaseRoles as $caseRoleXML) { foreach ($caseRoleXML->RelationshipType as $relationshipTypeXML) { - if ($relationshipTypeXML->creator) { + // simplexml treats node values differently than you'd expect, + // e.g. as an array + // Just using `if ($relationshipTypeXML->creator)` ends up always + // being true, so you have to cast to int or somehow force evaluation + // of the actual value. And casting to (bool) seems to behave + // differently on these objects than casting to (int). + if (!empty($relationshipTypeXML->creator)) { if (!$this->createRelationships($relationshipTypeXML, $params ) @@ -105,7 +111,7 @@ public function process($xml, &$params) { foreach ($xml->ActivitySets as $activitySetsXML) { foreach ($activitySetsXML->ActivitySet as $activitySetXML) { if ($standardTimeline) { - if ($activitySetXML->timeline) { + if (!empty($activitySetXML->timeline)) { return $this->processStandardTimeline($activitySetXML, $params); } } diff --git a/CRM/Contact/ActionMapping.php b/CRM/Contact/ActionMapping.php index f4aee154e830..ea96b5da7863 100644 --- a/CRM/Contact/ActionMapping.php +++ b/CRM/Contact/ActionMapping.php @@ -139,4 +139,12 @@ public function createQuery($schedule, $phase, $defaultParams) { return $query; } + /** + * Determine whether a schedule based on this mapping should + * send to additional contacts. + */ + public function sendToAdditional($entityId): bool { + return TRUE; + } + } diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 29c82bd90095..138b9569bb8d 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -1543,14 +1543,17 @@ public static function &exportableFields($contactType = 'Individual', $status = [ 'name' => 'organization_name', 'title' => ts('Current Employer'), + 'type' => CRM_Utils_Type::T_STRING, ], ]); + // This probably would be added anyway by appendPseudoConstantsToFields. $locationType = [ 'location_type' => [ 'name' => 'location_type', 'where' => 'civicrm_location_type.name', 'title' => ts('Location Type'), + 'type' => CRM_Utils_Type::T_STRING, ], ]; @@ -1559,6 +1562,7 @@ public static function &exportableFields($contactType = 'Individual', $status = 'name' => 'im_provider', 'where' => 'civicrm_im.provider_id', 'title' => ts('IM Provider'), + 'type' => CRM_Utils_Type::T_STRING, ], ]; @@ -1609,7 +1613,6 @@ public static function &exportableFields($contactType = 'Individual', $status = ); } } - $fields['current_employer_id']['title'] = ts('Current Employer ID'); //fix for CRM-791 if ($export) { $fields = array_merge($fields, [ @@ -2565,33 +2568,6 @@ public static function getPrimaryEmail($contactID, $polite = FALSE) { return $email; } - /** - * Function to get primary OpenID of the contact. - * - * @param int $contactID - * Contact id. - * - * @return string - * >openid OpenID if present else null - */ - public static function getPrimaryOpenId($contactID) { - // fetch the primary OpenID - $query = " -SELECT civicrm_openid.openid as openid -FROM civicrm_contact -LEFT JOIN civicrm_openid ON ( civicrm_contact.id = civicrm_openid.contact_id ) -WHERE civicrm_contact.id = %1 -AND civicrm_openid.is_primary = 1"; - $p = [1 => [$contactID, 'Integer']]; - $dao = CRM_Core_DAO::executeQuery($query, $p); - - $openId = NULL; - if ($dao->fetch()) { - $openId = $dao->openid; - } - return $openId; - } - /** * Fetch the object and store the values in the values array. * diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 056f792c290f..7e5477e18e04 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -80,7 +80,7 @@ public static function getImage($contactType, $urlOnly = FALSE, $contactId = NUL } $profileURL = CRM_Utils_System::url('civicrm/profile/view', - "reset=1&gid={$summaryOverlayProfileId}&id={$contactId}&snippet=4" + "reset=1&gid={$summaryOverlayProfileId}&id={$contactId}&snippet=4&is_show_email_task=1" ); $imageInfo[$contactType]['summary-link'] = '' . $imageInfo[$contactType]['image'] . ''; diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index fae22f03b844..96d94f478d84 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -118,7 +118,7 @@ public static function discard($id) { */ public static function getGroupContacts($id) { $params = [['group', 'IN', [1 => $id], 0, 0]]; - list($contacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, ['contact_id']); + [$contacts] = CRM_Contact_BAO_Query::apiQuery($params, ['contact_id']); return $contacts; } @@ -1223,6 +1223,14 @@ public static function whereClause(&$params, $sortBy = TRUE, $excludeHidden = TR $clauses[] = '`groups`.parents IS NULL'; } + $savedSearch = $params['savedSearch'] ?? NULL; + if ($savedSearch == 1) { + $clauses[] = '`groups`.saved_search_id IS NOT NULL'; + } + elseif ($savedSearch == 2) { + $clauses[] = '`groups`.saved_search_id IS NULL'; + } + // only show child groups of a specific parent group $parent_id = $params['parent_id'] ?? NULL; if ($parent_id) { @@ -1329,7 +1337,7 @@ protected function assignTestValue($fieldName, &$fieldDef, $counter) { $this->{$fieldName} = "NULL"; } else { - parent::assignTestValues($fieldName, $fieldDef, $counter); + parent::assignTestValue($fieldName, $fieldDef, $counter); } } diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 8e44e6aa4006..714ccf4ce09b 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -555,7 +555,7 @@ public static function isContactInGroup($contactID, $groupID) { ['group', 'IN', [$groupID], 0, 0], ['contact_id', '=', $contactID, 0, 0], ]; - list($contacts, $_) = CRM_Contact_BAO_Query::apiQuery($params, ['contact_id']); + [$contacts] = CRM_Contact_BAO_Query::apiQuery($params, ['contact_id']); if (!empty($contacts)) { return TRUE; diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index d4700184f81b..ce082757662b 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -9,6 +9,8 @@ +--------------------------------------------------------------------+ */ +use Civi\Api4\Query\SqlExpression; + /** * * @package CRM @@ -701,16 +703,18 @@ public static function invalidateGroupContactCache($groupID) { */ protected static function getApiSQL(array $savedSearch, string $addSelect, string $excludeClause) { $apiParams = $savedSearch['api_params'] + ['select' => ['id'], 'checkPermissions' => FALSE]; - list($idField) = explode(' AS ', $apiParams['select'][0]); - $apiParams['select'] = [ - $addSelect, - $idField, - ]; + $idField = SqlExpression::convert($apiParams['select'][0], TRUE)->getAlias(); + // Unless there's a HAVING clause, we don't care about other columns + if (empty($apiParams['having'])) { + $apiParams['select'] = array_slice($apiParams['select'], 0, 1); + } $api = \Civi\API\Request::create($savedSearch['api_entity'], 'get', $apiParams); $query = new \Civi\Api4\Query\Api4SelectQuery($api); $query->forceSelectId = FALSE; $query->getQuery()->having("$idField $excludeClause"); - return $query->getSql(); + $sql = $query->getSql(); + // Place sql in a nested sub-query, otherwise HAVING is impossible on any field other than contact_id + return "SELECT $addSelect, `$idField` AS contact_id FROM ($sql) api_query"; } /** diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index c5cd15e6e4df..d2ed700e7dcd 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -54,9 +54,9 @@ public function getAll() { * @param array $defaults * (reference ) an assoc array to hold the flattened values. * - * @return CRM_Contact_BAO_SavedSearch + * @return CRM_Contact_DAO_SavedSearch */ - public static function retrieve(&$params, &$defaults) { + public static function retrieve($params, &$defaults = []) { $savedSearch = new CRM_Contact_DAO_SavedSearch(); $savedSearch->copyValues($params); if ($savedSearch->find(TRUE)) { @@ -422,4 +422,33 @@ public static function decodeRelativeFields(&$formValues, $fieldName, $op, $valu } } + /** + * Generate a url to the appropriate search form for a given savedSearch + * + * @param int $id + * Saved search id + * @return string + */ + public static function getEditSearchUrl($id) { + $savedSearch = self::retrieve(['id' => $id]); + // APIv4 search + if (!empty($savedSearch->api_entity)) { + $groupName = self::getName($id); + return CRM_Utils_System::url('civicrm/search', NULL, FALSE, "/load/Group/$groupName"); + } + // Classic search builder + if (!empty($savedSearch->mapping_id)) { + $path = 'civicrm/contact/search/builder'; + } + // Classic custom search + elseif (!empty($savedSearch->search_custom_id)) { + $path = 'civicrm/contact/search/custom'; + } + // Classic advanced search + else { + $path = 'civicrm/contact/search/advanced'; + } + return CRM_Utils_System::url($path, ['reset' => 1, 'ssID' => $id]); + } + } diff --git a/CRM/Contact/DAO/ACLContactCache.php b/CRM/Contact/DAO/ACLContactCache.php index 6b319f9636ce..eb34f360002d 100644 --- a/CRM/Contact/DAO/ACLContactCache.php +++ b/CRM/Contact/DAO/ACLContactCache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/ACLContactCache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:97d9be5e13ece64b6c9ad1722d9bca68) + * (GenCodeChecksum:4eaf1e99ce247c430fc280cc6ce68538) */ /** @@ -68,24 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. - */ - public static function getEntityTitle() { - return ts('ACLContact Caches'); - } - - /** - * Returns foreign keys and entity references. * - * @return array - * [CRM_Core_Reference_Interface] + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('ACLContact Caches') : ts('ACLContact Cache'); } /** @@ -132,7 +120,6 @@ public static function &fields() { 'entity' => 'ACLContactCache', 'bao' => 'CRM_Contact_DAO_ACLContactCache', 'localizable' => 0, - 'FKClassName' => 'CRM_Contact_DAO_Contact', 'add' => '3.1', ], 'operation' => [ diff --git a/CRM/Contact/DAO/Contact.php b/CRM/Contact/DAO/Contact.php index 18129eecc974..c585b127039b 100644 --- a/CRM/Contact/DAO/Contact.php +++ b/CRM/Contact/DAO/Contact.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/Contact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7f796d14a0de2afa9ec1d5b658ab9329) + * (GenCodeChecksum:f118596cceae71668861504b7316afa7) */ /** @@ -397,9 +397,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Contacts'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Contacts') : ts('Contact'); } /** @@ -1402,7 +1405,7 @@ public static function &fields() { 'current_employer_id' => [ 'name' => 'employer_id', 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Current Employer'), + 'title' => ts('Current Employer ID'), 'description' => ts('OPTIONAL FK to civicrm_contact record.'), 'where' => 'civicrm_contact.employer_id', 'export' => TRUE, @@ -1414,6 +1417,7 @@ public static function &fields() { 'FKClassName' => 'CRM_Contact_DAO_Contact', 'html' => [ 'type' => 'EntityRef', + 'label' => ts("Current Employer"), ], 'add' => '2.1', ], diff --git a/CRM/Contact/DAO/ContactType.php b/CRM/Contact/DAO/ContactType.php index 41d8b8780369..4f7f63f5a3ed 100644 --- a/CRM/Contact/DAO/ContactType.php +++ b/CRM/Contact/DAO/ContactType.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/ContactType.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:0f7546e10f09f7637d50f7a34c632cb5) + * (GenCodeChecksum:9719ec84435a76decf1937f7a389ac7f) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Contact Types'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Contact Types') : ts('Contact Type'); } /** diff --git a/CRM/Contact/DAO/DashboardContact.php b/CRM/Contact/DAO/DashboardContact.php index 16c0b3b59379..f8f4e87daa3c 100644 --- a/CRM/Contact/DAO/DashboardContact.php +++ b/CRM/Contact/DAO/DashboardContact.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/DashboardContact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:67153c09e74eda2febf15986f9c04439) + * (GenCodeChecksum:ef3a393d20b6654dcef952f21df8072d) */ /** @@ -80,9 +80,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Dashboard Contacts'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Dashboard Contacts') : ts('Dashboard Contact'); } /** diff --git a/CRM/Contact/DAO/Group.php b/CRM/Contact/DAO/Group.php index cdae40198635..c6428e5b0ef4 100644 --- a/CRM/Contact/DAO/Group.php +++ b/CRM/Contact/DAO/Group.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/Group.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6a2a222c5fa5b461727bb95379723b08) + * (GenCodeChecksum:25bcea958ed3b88317a2bbb89169b0a6) */ /** @@ -175,6 +175,20 @@ class CRM_Contact_DAO_Group extends CRM_Core_DAO { */ public $modified_id; + /** + * Alternative public title for this Group. + * + * @var string + */ + public $frontend_title; + + /** + * Alternative public description of the group. + * + * @var text + */ + public $frontend_description; + /** * Class constructor. */ @@ -185,9 +199,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Groups'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Groups') : ts('Group'); } /** @@ -247,8 +264,9 @@ public static function &fields() { 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Group Title'), 'description' => ts('Name of Group.'), - 'maxlength' => 64, - 'size' => CRM_Utils_Type::BIG, + 'required' => TRUE, + 'maxlength' => 255, + 'size' => CRM_Utils_Type::HUGE, 'where' => 'civicrm_group.title', 'table_name' => 'civicrm_group', 'entity' => 'Group', @@ -498,6 +516,42 @@ public static function &fields() { 'FKClassName' => 'CRM_Contact_DAO_Contact', 'add' => '4.5', ], + 'frontend_title' => [ + 'name' => 'frontend_title', + 'type' => CRM_Utils_Type::T_STRING, + 'title' => ts('Public Group Title'), + 'description' => ts('Alternative public title for this Group.'), + 'maxlength' => 255, + 'size' => CRM_Utils_Type::HUGE, + 'where' => 'civicrm_group.frontend_title', + 'default' => 'NULL', + 'table_name' => 'civicrm_group', + 'entity' => 'Group', + 'bao' => 'CRM_Contact_BAO_Group', + 'localizable' => 1, + 'html' => [ + 'type' => 'Text', + ], + 'add' => '5.31', + ], + 'frontend_description' => [ + 'name' => 'frontend_description', + 'type' => CRM_Utils_Type::T_TEXT, + 'title' => ts('Public Group Description'), + 'description' => ts('Alternative public description of the group.'), + 'rows' => 2, + 'cols' => 60, + 'where' => 'civicrm_group.frontend_description', + 'default' => 'NULL', + 'table_name' => 'civicrm_group', + 'entity' => 'Group', + 'bao' => 'CRM_Contact_BAO_Group', + 'localizable' => 1, + 'html' => [ + 'type' => 'TextArea', + ], + 'add' => '5.31', + ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } diff --git a/CRM/Contact/DAO/GroupContact.php b/CRM/Contact/DAO/GroupContact.php index 52c66fd638c9..3cee7b7e0790 100644 --- a/CRM/Contact/DAO/GroupContact.php +++ b/CRM/Contact/DAO/GroupContact.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/GroupContact.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:143ba4d95cae73fc81c8e932970cbc1f) + * (GenCodeChecksum:69e994c5047ecf8d68700c694047720f) */ /** @@ -82,9 +82,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Group Contacts'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Group Contacts') : ts('Group Contact'); } /** diff --git a/CRM/Contact/DAO/GroupContactCache.php b/CRM/Contact/DAO/GroupContactCache.php index 3ee02aa7e209..e4310747a9db 100644 --- a/CRM/Contact/DAO/GroupContactCache.php +++ b/CRM/Contact/DAO/GroupContactCache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/GroupContactCache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:a169b776ec9bfc8864a05750d4ae6b95) + * (GenCodeChecksum:424f49d5c972e05144c327cf7ba0992c) */ /** @@ -61,9 +61,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Group Contact Caches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Group Contact Caches') : ts('Group Contact Cache'); } /** diff --git a/CRM/Contact/DAO/GroupNesting.php b/CRM/Contact/DAO/GroupNesting.php index 90624a6e98fd..6262c1f5a44f 100644 --- a/CRM/Contact/DAO/GroupNesting.php +++ b/CRM/Contact/DAO/GroupNesting.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/GroupNesting.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:0ca7da77b0229b439c9c3a4c4c2e4326) + * (GenCodeChecksum:396dffdb22106c85cc4832b61307c264) */ /** @@ -61,9 +61,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Group Nestings'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Group Nestings') : ts('Group Nesting'); } /** diff --git a/CRM/Contact/DAO/GroupOrganization.php b/CRM/Contact/DAO/GroupOrganization.php index 407ea31d83f5..0553dff9ec64 100644 --- a/CRM/Contact/DAO/GroupOrganization.php +++ b/CRM/Contact/DAO/GroupOrganization.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/GroupOrganization.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:dfe8edf8f786790af95f09f456d1cbe7) + * (GenCodeChecksum:0ae83aef7dbfb877f46a92f27001dd6b) */ /** @@ -61,9 +61,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Group Organizations'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Group Organizations') : ts('Group Organization'); } /** diff --git a/CRM/Contact/DAO/Relationship.php b/CRM/Contact/DAO/Relationship.php index 14b10a52802e..8ad5e40702fd 100644 --- a/CRM/Contact/DAO/Relationship.php +++ b/CRM/Contact/DAO/Relationship.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/Relationship.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:25faea8225f483ae95cf29af08a8542d) + * (GenCodeChecksum:7fed0ad7c2ed2b072582b55afdb6469f) */ /** @@ -124,9 +124,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Relationships'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Relationships') : ts('Relationship'); } /** diff --git a/CRM/Contact/DAO/RelationshipCache.php b/CRM/Contact/DAO/RelationshipCache.php index cfa5a75bc2e0..1e874cb2bd9a 100644 --- a/CRM/Contact/DAO/RelationshipCache.php +++ b/CRM/Contact/DAO/RelationshipCache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/RelationshipCache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:b40781c15c3351a766a6083522f0e5e4) + * (GenCodeChecksum:6de8ba08019ff8821fd4e09f14db6da9) */ /** @@ -124,9 +124,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Relationship Caches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Relationship Caches') : ts('Relationship Cache'); } /** diff --git a/CRM/Contact/DAO/RelationshipType.php b/CRM/Contact/DAO/RelationshipType.php index e703e2fe849b..3ac981c81f84 100644 --- a/CRM/Contact/DAO/RelationshipType.php +++ b/CRM/Contact/DAO/RelationshipType.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/RelationshipType.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6e9767fcd0fc6eba8fcd408588fe0755) + * (GenCodeChecksum:258f862b2238ae69432d8955ae8df803) */ /** @@ -124,9 +124,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Relationship Types'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Relationship Types') : ts('Relationship Type'); } /** diff --git a/CRM/Contact/DAO/SavedSearch.php b/CRM/Contact/DAO/SavedSearch.php index a5fb2d460375..c532997a2a3d 100644 --- a/CRM/Contact/DAO/SavedSearch.php +++ b/CRM/Contact/DAO/SavedSearch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/SavedSearch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:4b2f292a8196a5dc4a73afc078cd11cb) + * (GenCodeChecksum:d863f8b0b8659633bc84578e1d6cbf10) */ /** @@ -82,9 +82,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Saved Searches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Saved Searches') : ts('Saved Search'); } /** diff --git a/CRM/Contact/DAO/SubscriptionHistory.php b/CRM/Contact/DAO/SubscriptionHistory.php index 421ea3381555..cbdab5b5352a 100644 --- a/CRM/Contact/DAO/SubscriptionHistory.php +++ b/CRM/Contact/DAO/SubscriptionHistory.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/SubscriptionHistory.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7c033b0631f14da30172883b14686574) + * (GenCodeChecksum:c38d68dcab2d037fc65d4e59bd30d1d4) */ /** @@ -89,9 +89,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Subscription Histories'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Subscription Histories') : ts('Subscription History'); } /** diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 04e3c8a897e7..798050800c35 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -808,17 +808,31 @@ public function buildQuickForm() { $this->addField('image_URL', ['maxlength' => '255', 'label' => ts('Browse/Upload Image')]); // add the dedupe button - $this->addElement('submit', + $this->addElement('xbutton', $this->_dedupeButtonName, - ts('Check for Matching Contact(s)') + ts('Check for Matching Contact(s)'), + [ + 'type' => 'submit', + 'value' => 1, + 'class' => "crm-button crm-button{$this->_dedupeButtonName}", + ] ); - $this->addElement('submit', + $this->addElement('xbutton', $this->_duplicateButtonName, - ts('Save Matching Contact') + ts('Save Matching Contact'), + [ + 'type' => 'submit', + 'value' => 1, + 'class' => "crm-button crm-button{$this->_duplicateButtonName}", + ] ); - $this->addElement('submit', + $this->addElement('xbutton', $this->getButtonName('next', 'sharedHouseholdDuplicate'), - ts('Save With Duplicate Household') + ts('Save With Duplicate Household'), + [ + 'type' => 'submit', + 'value' => 1, + ] ); $buttons = [ diff --git a/CRM/Contact/Form/Inline/Address.php b/CRM/Contact/Form/Inline/Address.php index e33118c9133f..4170a36f0bd1 100644 --- a/CRM/Contact/Form/Inline/Address.php +++ b/CRM/Contact/Form/Inline/Address.php @@ -169,7 +169,7 @@ public function postProcess() { } // save address changes - $address = CRM_Core_BAO_Address::create($params, TRUE); + $address = CRM_Core_BAO_Address::legacyCreate($params, TRUE); $this->log(); $this->ajaxResponse['addressId'] = $address[0]->id; diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 25c95ac6b7eb..d41d16bb6cd8 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -429,11 +429,10 @@ public function buildQuickForm() { $ssID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'saved_search_id'); $this->assign('ssID', $ssID); - //get the saved search mapping id + //get the saved search edit link if ($ssID) { $this->_ssID = $ssID; - $ssMappingId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $ssID, 'mapping_id'); - $this->assign('ssMappingID', $ssMappingId); + $this->assign('editSmartGroupURL', CRM_Contact_BAO_SavedSearch::getEditSearchUrl($ssID)); } // Set dynamic page title for 'Show Members of Group' @@ -469,8 +468,9 @@ public function buildQuickForm() { // also set the group title and freeze the action task with Add Members to Group $groupValues = ['id' => $this->_amtgID, 'title' => $this->_group[$this->_amtgID]]; $this->assign_by_ref('group', $groupValues); - $this->add('submit', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]), + $this->add('xbutton', $this->_actionButtonName, ts('Add Contacts to %1', [1 => $this->_group[$this->_amtgID]]), [ + 'type' => 'submit', 'class' => 'crm-form-submit', ] ); diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index e579c7433166..95e981a63dad 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -24,6 +24,9 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { * Processing needed for buildForm and later. */ public function preProcess() { + // SearchFormName is deprecated & to be removed - the replacement is for the task to + // call $this->form->getSearchFormValues() + // A couple of extensions use it. $this->set('searchFormName', 'Advanced'); parent::preProcess(); diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index c1e84382319f..6deec9e2a44d 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -117,6 +117,9 @@ public function addRules() { * Processing needed for buildForm and later. */ public function preProcess() { + // SearchFormName is deprecated & to be removed - the replacement is for the task to + // call $this->form->getSearchFormValues() + // A couple of extensions use it. $this->set('searchFormName', 'Basic'); parent::preProcess(); diff --git a/CRM/Contact/Form/Search/Builder.php b/CRM/Contact/Form/Search/Builder.php index fc51f6580d35..0eccbcb5049f 100644 --- a/CRM/Contact/Form/Search/Builder.php +++ b/CRM/Contact/Form/Search/Builder.php @@ -38,6 +38,9 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { * Build the form object. */ public function preProcess() { + // SearchFormName is deprecated & to be removed - the replacement is for the task to + // call $this->form->getSearchFormValues() + // A couple of extensions use it. $this->set('searchFormName', 'Builder'); $this->set('context', 'builder'); diff --git a/CRM/Contact/Form/Search/Custom.php b/CRM/Contact/Form/Search/Custom.php index cfc78ef8355b..d2b4fd4cdd39 100644 --- a/CRM/Contact/Form/Search/Custom.php +++ b/CRM/Contact/Form/Search/Custom.php @@ -19,6 +19,9 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search { protected $_customClass = NULL; public function preProcess() { + // SearchFormName is deprecated & to be removed - the replacement is for the task to + // call $this->form->getSearchFormValues() + // A couple of extensions use it. $this->set('searchFormName', 'Custom'); $this->set('context', 'custom'); diff --git a/CRM/Contact/Form/Search/Custom/Proximity.php b/CRM/Contact/Form/Search/Custom/Proximity.php index 34026c06de81..8d211aafcf7b 100644 --- a/CRM/Contact/Form/Search/Custom/Proximity.php +++ b/CRM/Contact/Form/Search/Custom/Proximity.php @@ -19,9 +19,6 @@ */ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface { - protected $_latitude = NULL; - protected $_longitude = NULL; - protected $_distance = NULL; protected $_aclFrom = NULL; protected $_aclWhere = NULL; @@ -39,21 +36,6 @@ public function __construct(&$formValues) { unset($this->_formValues['uf_group_id']); unset($this->_formValues['component_mode']); unset($this->_formValues['operator']); - - if (!empty($this->_formValues)) { - // add the country and state - self::addGeocodingData($this->_formValues); - $this->_latitude = $this->_formValues['geo_code_1']; - $this->_longitude = $this->_formValues['geo_code_2']; - - if ($this->_formValues['prox_distance_unit'] == "miles") { - $conversionFactor = 1609.344; - } - else { - $conversionFactor = 1000; - } - $this->_distance = $this->_formValues['distance'] * $conversionFactor; - } $this->_group = $this->_formValues['group'] ?? NULL; $this->_tag = $this->_formValues['tag'] ?? NULL; @@ -192,6 +174,10 @@ public function sql( $isCountOnly = TRUE; } + if (empty($this->_formValues['geo_code_1']) || empty($this->_formValues['geo_code_2'])) { + self::addGeocodingData($this->_formValues); + } + $searchParams = [ ['prox_distance_unit', '=', $this->_formValues['prox_distance_unit'], 0, 0], ['prox_distance', '=', $this->_formValues['distance'], 0, 0], diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 2f7695dc7db1..6dd27e02479e 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -78,7 +78,7 @@ public function preProcess() { /** * Common pre-processing function. * - * @param CRM_Core_Form $form + * @param \CRM_Core_Form_Task $form * * @throws \CRM_Core_Exception */ @@ -88,7 +88,7 @@ public static function preProcessCommon(&$form) { $isStandAlone = in_array('task', $form->urlPath) || in_array('standalone', $form->urlPath); if ($isStandAlone) { - list($form->_task, $title) = CRM_Contact_Task::getTaskAndTitleByClass(get_class($form)); + [$form->_task, $title] = CRM_Contact_Task::getTaskAndTitleByClass(get_class($form)); if (!array_key_exists($form->_task, CRM_Contact_Task::permissionedTaskTitles(CRM_Core_Permission::getPermission()))) { CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.')); } @@ -103,19 +103,16 @@ public static function preProcessCommon(&$form) { // we'll need to get fv from either search or adv search in the future $fragment = 'search'; if ($form->_action == CRM_Core_Action::ADVANCED) { - self::$_searchFormValues = $form->controller->exportValues('Advanced'); $fragment .= '/advanced'; } elseif ($form->_action == CRM_Core_Action::PROFILE) { - self::$_searchFormValues = $form->controller->exportValues('Builder'); $fragment .= '/builder'; } elseif ($form->_action == CRM_Core_Action::COPY) { - self::$_searchFormValues = $form->controller->exportValues('Custom'); $fragment .= '/custom'; } - elseif (!$isStandAlone) { - self::$_searchFormValues = $form->controller->exportValues('Basic'); + if (!$isStandAlone) { + self::$_searchFormValues = $form->getSearchFormValues(); } //set the user context for redirection of task actions @@ -125,15 +122,13 @@ public static function preProcessCommon(&$form) { $urlParams .= "&qfKey=$qfKey"; } - $cacheKey = "civicrm search {$qfKey}"; - $url = CRM_Utils_System::url('civicrm/contact/' . $fragment, $urlParams); $session = CRM_Core_Session::singleton(); $session->replaceUserContext($url); + $cacheKey = "civicrm search {$qfKey}"; + $form->_task = self::$_searchFormValues['task'] ?? NULL; - $crmContactTaskTasks = CRM_Contact_Task::taskTitles(); - $form->assign('taskName', CRM_Utils_Array::value($form->_task, $crmContactTaskTasks)); // all contacts or action = save a search if ((CRM_Utils_Array::value('radio_ts', self::$_searchFormValues) == 'ts_all') || diff --git a/CRM/Contact/Form/Task/AddToParentClass.php b/CRM/Contact/Form/Task/AddToParentClass.php index f98aa34e324f..aee54878d475 100644 --- a/CRM/Contact/Form/Task/AddToParentClass.php +++ b/CRM/Contact/Form/Task/AddToParentClass.php @@ -65,8 +65,13 @@ public function buildQuickForm() { $this->assign('searchCount', $searchCount); $this->assign('searchDone', $this->get('searchDone')); $this->assign('contact_type_display', $contactType); - $this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), ['class' => 'crm-form-submit']); - $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), ['class' => 'crm-form-submit']); + $buttonAttrs = [ + 'type' => 'submit', + 'class' => 'crm-form-submit', + 'value' => 1, + ]; + $this->addElement('xbutton', $this->getButtonName('refresh'), ts('Search'), $buttonAttrs); + $this->addElement('xbutton', $this->getButtonName('cancel'), ts('Cancel'), $buttonAttrs); $this->addButtons([ [ 'type' => 'next', diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php index a4996b227f5e..9fac47037a18 100644 --- a/CRM/Contact/Form/Task/Delete.php +++ b/CRM/Contact/Form/Task/Delete.php @@ -119,7 +119,7 @@ public function preProcess() { 'count' => $sharedAddressCount, ]); } - CRM_Core_Session::setStatus($message . ' ' . ts('Shared addresses will not be removed or altered but will no longer be shared.'), ts('Shared Addesses Owner')); + CRM_Core_Session::setStatus($message . ' ' . ts('Shared addresses will not be removed or altered but will no longer be shared.'), ts('Shared Addresses Owner')); } // set in form controller so that queries are not fired again @@ -244,7 +244,7 @@ public function postProcess() { } $message .= ''; - $session->setStatus($message, ts('Shared Addesses Owner Deleted'), 'info', ['expires' => 0]); + $session->setStatus($message, ts('Shared Addresses Owner Deleted'), 'info', ['expires' => 0]); $this->set('sharedAddressMessage', NULL); } diff --git a/CRM/Contact/Form/Task/EmailTrait.php b/CRM/Contact/Form/Task/EmailTrait.php index fb5e6ff51289..67c06172d8e1 100644 --- a/CRM/Contact/Form/Task/EmailTrait.php +++ b/CRM/Contact/Form/Task/EmailTrait.php @@ -247,7 +247,7 @@ public function buildQuickForm() { $this->assign('totalSelectedContacts', count($this->_contactIds)); - $this->add('text', 'subject', ts('Subject'), 'size=50 maxlength=254', TRUE); + $this->add('text', 'subject', ts('Subject'), ['size' => 50, 'maxlength' => 254], TRUE); $this->add('select', 'from_email_address', ts('From'), $this->_fromEmails, TRUE); @@ -558,12 +558,12 @@ protected function getEmailString(array $emailIDs): string { * e.g. Bob Smith' */ protected function getEmailUrlString(array $emailIDs): string { - $urlString = ''; + $urls = []; foreach ($emailIDs as $email) { - $contactURL = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'force' => 1, 'cid' => $this->contactEmails[$email]['contact_id']], TRUE); - $urlString .= "" . $this->contactEmails[$email]['contact.display_name'] . ''; + $contactURL = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'cid' => $this->contactEmails[$email]['contact_id']], TRUE); + $urls[] = "" . $this->contactEmails[$email]['contact.display_name'] . ''; } - return $urlString; + return implode(', ', $urls); } /** diff --git a/CRM/Contact/Form/Task/Label.php b/CRM/Contact/Form/Task/Label.php index 92252cad4b54..724b6ef78645 100644 --- a/CRM/Contact/Form/Task/Label.php +++ b/CRM/Contact/Form/Task/Label.php @@ -96,7 +96,6 @@ public function setDefaultValues() { */ public function postProcess($params = NULL) { $fv = $params ?: $this->controller->exportValues($this->_name); - $config = CRM_Core_Config::singleton(); $locName = NULL; //get the address format sequence from the config file $mailingFormat = Civi::settings()->get('mailing_format'); @@ -146,15 +145,12 @@ public function postProcess($params = NULL) { $returnProperties['last_name'] = 1; } - $individualFormat = FALSE; - /* * CRM-8338: replace ids of household members with the id of their household * so we can merge labels by household. */ if (isset($fv['merge_same_household'])) { $this->mergeContactIdsByHousehold(); - $individualFormat = TRUE; } //get the contacts information @@ -200,13 +196,12 @@ public function postProcess($params = NULL) { //get the total number of contacts to fetch from database. $numberofContacts = count($this->_contactIds); - $query = new CRM_Contact_BAO_Query($params, $returnProperties); - $details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts, TRUE, FALSE, TRUE, CRM_Contact_BAO_Query::MODE_CONTACTS, NULL, $primaryLocationOnly); + [$details] = CRM_Contact_BAO_Query::apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts, TRUE, FALSE, TRUE, CRM_Contact_BAO_Query::MODE_CONTACTS, NULL, $primaryLocationOnly); $messageToken = CRM_Utils_Token::getTokens($mailingFormat); - // $details[0] is an array of [ contactID => contactDetails ] + // $details is an array of [ contactID => contactDetails ] // also get all token values - CRM_Utils_Hook::tokenValues($details[0], + CRM_Utils_Hook::tokenValues($details, $this->_contactIds, NULL, $messageToken, @@ -224,11 +219,11 @@ public function postProcess($params = NULL) { foreach ($this->_contactIds as $value) { foreach ($custom as $cfID) { - if (isset($details[0][$value]["custom_{$cfID}"])) { - $details[0][$value]["custom_{$cfID}"] = CRM_Core_BAO_CustomField::displayValue($details[0][$value]["custom_{$cfID}"], $cfID); + if (isset($details[$value]["custom_{$cfID}"])) { + $details[$value]["custom_{$cfID}"] = CRM_Core_BAO_CustomField::displayValue($details[$value]["custom_{$cfID}"], $cfID); } } - $contact = $details['0'][$value] ?? NULL; + $contact = $details[$value] ?? NULL; if (is_a($contact, 'CRM_Core_Error')) { return NULL; @@ -271,7 +266,7 @@ public function postProcess($params = NULL) { 'im', 'openid', ])) { - if ($k == 'im') { + if ($k === 'im') { $rows[$value][$k] = $v['1']['name']; } else { diff --git a/CRM/Contact/Form/Task/LabelCommon.php b/CRM/Contact/Form/Task/LabelCommon.php index c0c561ff2648..5b7a295e8736 100644 --- a/CRM/Contact/Form/Task/LabelCommon.php +++ b/CRM/Contact/Form/Task/LabelCommon.php @@ -30,7 +30,10 @@ class CRM_Contact_Form_Task_LabelCommon { * @param string $fileName * The name of the file to save the label in. */ - public static function createLabel(&$contactRows, &$format, $fileName = 'MailingLabels_CiviCRM.pdf') { + public static function createLabel($contactRows, $format, $fileName = 'MailingLabels_CiviCRM.pdf') { + if (CIVICRM_UF === 'UnitTests') { + throw new CRM_Core_Exception_PrematureExitException('civiExit called', ['rows' => $contactRows, 'format' => $format, 'file_name' => $fileName]); + } $pdf = new CRM_Utils_PDF_Label($format, 'mm'); $pdf->Open(); $pdf->AddPage(); @@ -136,12 +139,9 @@ public static function getRows($contactIDs, $locationTypeID, $respectDoNotMail, $numberofContacts = count($contactIDs); //this does the same as calling civicrm_api3('contact, get, array('id' => array('IN' => $this->_contactIds) // except it also handles multiple locations - $query = new CRM_Contact_BAO_Query($params, $returnProperties); - $details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts); + [$details] = CRM_Contact_BAO_Query::apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts); - $messageToken = CRM_Utils_Token::getTokens($mailingFormat); - // $details[0] is an array of [ contactID => contactDetails ] - $details = $details[0]; + // $details is an array of [ contactID => contactDetails ] $tokenFields = CRM_Contact_Form_Task_LabelCommon::getTokenData($details); foreach ($contactIDs as $value) { diff --git a/CRM/Contact/Form/Task/SaveSearch.php b/CRM/Contact/Form/Task/SaveSearch.php index a98a29fee0ad..f843f69ecb1b 100644 --- a/CRM/Contact/Form/Task/SaveSearch.php +++ b/CRM/Contact/Form/Task/SaveSearch.php @@ -53,9 +53,7 @@ public function preProcess() { // Get Task name $modeValue = CRM_Contact_Form_Search::getModeValue(CRM_Utils_Array::value('component_mode', $values, CRM_Contact_BAO_Query::MODE_CONTACTS)); $className = $modeValue['taskClassName']; - $taskList = $className::taskTitles(); $this->_task = $values['task'] ?? NULL; - $this->assign('taskName', CRM_Utils_Array::value($this->_task, $taskList)); } /** diff --git a/CRM/Contact/Page/View.php b/CRM/Contact/Page/View.php index faeb0cb8cfcf..ce076fe83c89 100644 --- a/CRM/Contact/Page/View.php +++ b/CRM/Contact/Page/View.php @@ -311,7 +311,13 @@ public static function setTitle($contactId, $isDeleted = FALSE) { } if ($isDeleted) { $title = "{$title}"; - $mergedTo = civicrm_api3('Contact', 'getmergedto', ['contact_id' => $contactId, 'api.Contact.get' => ['return' => 'display_name']]); + try { + $mergedTo = civicrm_api3('Contact', 'getmergedto', ['contact_id' => $contactId, 'api.Contact.get' => ['return' => 'display_name']]); + } + catch (CiviCRM_API3_Exception $e) { + CRM_Core_Session::singleton()->setStatus(ts('This contact was deleted during a merge operation. The contact it was merged into cannot be found and may have been deleted.')); + $mergedTo = ['count' => 0]; + } if ($mergedTo['count']) { $mergedToContactID = $mergedTo['id']; $mergedToDisplayName = $mergedTo['values'][$mergedToContactID]['api.Contact.get']['values'][0]['display_name']; diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index a9f61ee85c27..e173a8df5487 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -425,9 +425,8 @@ public function getTabs() { $weight += 10; } + // Allow other modules to add or remove tabs $context = ['contact_id' => $this->_contactId]; - // see if any other modules want to add any tabs - CRM_Utils_Hook::tabs($allTabs, $this->_contactId); CRM_Utils_Hook::tabset('civicrm/contact/view', $allTabs, $context); // now sort the tabs based on weight diff --git a/CRM/Contact/Task.php b/CRM/Contact/Task.php index 06696a295305..8832759e3cc0 100644 --- a/CRM/Contact/Task.php +++ b/CRM/Contact/Task.php @@ -234,7 +234,7 @@ public static function tasks() { if (CRM_Core_Permission::access('CiviEvent')) { self::$_tasks[self::ADD_EVENT] = array( 'title' => ts('Register participants for event'), - 'class' => 'CRM_Event_Form_Participant', + 'class' => 'CRM_Event_Form_Task_Register', ); } diff --git a/CRM/Contribute/ActionMapping/ByPage.php b/CRM/Contribute/ActionMapping/ByPage.php index 8c09c81cc274..6dcab6e2a7ae 100644 --- a/CRM/Contribute/ActionMapping/ByPage.php +++ b/CRM/Contribute/ActionMapping/ByPage.php @@ -216,4 +216,12 @@ public function resetOnTriggerDateChange($schedule) { return FALSE; } + /** + * Determine whether a schedule based on this mapping should + * send to additional contacts. + */ + public function sendToAdditional($entityId): bool { + return TRUE; + } + } diff --git a/CRM/Contribute/ActionMapping/ByType.php b/CRM/Contribute/ActionMapping/ByType.php index ea259901a569..88d60e49c767 100644 --- a/CRM/Contribute/ActionMapping/ByType.php +++ b/CRM/Contribute/ActionMapping/ByType.php @@ -235,4 +235,12 @@ public function resetOnTriggerDateChange($schedule) { return FALSE; } + /** + * Determine whether a schedule based on this mapping should + * send to additional contacts. + */ + public function sendToAdditional($entityId): bool { + return TRUE; + } + } diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index a74d99bc5736..c279e4df9045 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -12,6 +12,8 @@ use Civi\Api4\Activity; use Civi\Api4\ContributionPage; use Civi\Api4\ContributionRecur; +use Civi\Api4\Participant; +use Civi\Api4\PaymentProcessor; /** * @@ -84,22 +86,17 @@ public function __construct() { * * @param array $params * (reference ) an assoc array of name/value pairs. - * @param array $ids - * The array that holds all the db ids. * * @return \CRM_Contribute_BAO_Contribution * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public static function add(&$params, $ids = []) { + public static function add(&$params) { if (empty($params)) { return NULL; } - if (!empty($ids)) { - CRM_Core_Error::deprecatedFunctionWarning('ids should not be passed into Contribution.add'); - } - //per http://wiki.civicrm.org/confluence/display/CRM/Database+layer we are moving away from $ids array - $contributionID = CRM_Utils_Array::value('contribution', $ids, CRM_Utils_Array::value('id', $params)); + + $contributionID = $params['id'] ?? NULL; $action = $contributionID ? 'edit' : 'create'; $duplicates = []; if (self::checkDuplicate($params, $duplicates, $contributionID)) { @@ -149,18 +146,6 @@ public static function add(&$params, $ids = []) { } $setPrevContribution = TRUE; - // CRM-13964 partial payment - if (!empty($params['partial_payment_total']) && !empty($params['partial_amount_to_pay'])) { - CRM_Core_Error::deprecatedFunctionWarning('partial_amount params are deprecated from Contribution.create - use Payment.create'); - $partialAmtTotal = $params['partial_payment_total']; - $partialAmtPay = $params['partial_amount_to_pay']; - $params['total_amount'] = $partialAmtTotal; - if ($partialAmtPay < $partialAmtTotal) { - $params['contribution_status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Partially paid'); - $params['is_pay_later'] = 0; - $setPrevContribution = FALSE; - } - } if ($contributionID && $setPrevContribution) { $params['prevContribution'] = self::getOriginalContribution($contributionID); } @@ -215,7 +200,7 @@ public static function add(&$params, $ids = []) { CRM_Contribute_BAO_ContributionRecur::updateOnNewPayment( (!empty($params['contribution_recur_id']) ? $params['contribution_recur_id'] : $params['prevContribution']->contribution_recur_id), $contributionStatus, - CRM_Utils_Array::value('receive_date', $params) + $params['receive_date'] ?? NULL ); } @@ -444,7 +429,7 @@ public static function getPaymentProcessorReadyAddressParams($params, $billingLo * * @return int */ - public function getNumTermsByContributionAndMembershipType($membershipTypeID, $contributionID) { + public static function getNumTermsByContributionAndMembershipType($membershipTypeID, $contributionID) { $numTerms = CRM_Core_DAO::singleValueQuery(" SELECT membership_num_terms FROM civicrm_line_item li LEFT JOIN civicrm_price_field_value v ON li.price_field_value_id = v.id @@ -460,8 +445,6 @@ public function getNumTermsByContributionAndMembershipType($membershipTypeID, $c * * @param array $params * (reference ) an assoc array of name/value pairs. - * @param array $ids - * The array that holds all the db ids. * * @return CRM_Contribute_BAO_Contribution * @@ -469,27 +452,11 @@ public function getNumTermsByContributionAndMembershipType($membershipTypeID, $c * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public static function create(&$params, $ids = []) { - $dateFields = [ - 'receive_date', - 'cancel_date', - 'receipt_date', - 'thankyou_date', - 'revenue_recognition_date', - ]; - foreach ($dateFields as $df) { - if (isset($params[$df])) { - $params[$df] = CRM_Utils_Date::isoToMysql($params[$df]); - } - } + public static function create(&$params) { $transaction = new CRM_Core_Transaction(); try { - if (!isset($params['id']) && isset($ids['contribution'])) { - CRM_Core_Error::deprecatedFunctionWarning('ids should not be used for contribution create'); - $params['id'] = $ids['contribution']; - } $contribution = self::add($params); } catch (CRM_Core_Exception $e) { @@ -847,8 +814,6 @@ public static function &exportableFields($checkPermission = TRUE) { CRM_Core_BAO_CustomField::getFieldsForImport('Contribution', FALSE, FALSE, FALSE, $checkPermission) ); - $fields['financial_type_id']['title'] = ts('Financial Type ID'); - self::$_exportableFields = $fields; } @@ -1379,6 +1344,78 @@ protected static function isEmailReceipt(array $input, $contributionPageID, $rec return TRUE; } + /** + * Process failed contribution. + * + * @param $processContributionObject + * @param $memberships + * @param $contributionId + * @param array $membershipStatuses + * @param array $updateResult + * @param $participant + * @param $pledgePayment + * @param $pledgeID + * @param array $pledgePaymentIDs + * @param $contributionStatusId + * + * @return array + * @throws \CRM_Core_Exception + */ + protected static function processFail($processContributionObject, $memberships, $contributionId, array $membershipStatuses, array $updateResult, $participant, $pledgePayment, $pledgeID, array $pledgePaymentIDs, $contributionStatusId): array { + $processContribution = FALSE; + if (is_array($memberships)) { + foreach ($memberships as $membership) { + $update = TRUE; + //Update Membership status if there is no other completed contribution associated with the membership. + $relatedContributions = CRM_Member_BAO_Membership::getMembershipContributionId($membership->id, TRUE); + foreach ($relatedContributions as $contriId) { + if ($contriId == $contributionId) { + continue; + } + $statusId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $contriId, 'contribution_status_id'); + if (CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $statusId) === 'Completed') { + $update = FALSE; + } + } + if ($membership && $update) { + $membership->status_id = array_search('Expired', $membershipStatuses); + $membership->is_override = TRUE; + $membership->status_override_end_date = 'null'; + $membership->save(); + + $updateResult['updatedComponents']['CiviMember'] = $membership->status_id; + if ($processContributionObject) { + $processContribution = TRUE; + } + } + } + } + if ($participant) { + $oldStatus = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', + $participant->id, + 'status_id' + ); + $participantStatuses = CRM_Event_PseudoConstant::participantStatus(); + $updatedStatusId = array_search('Cancelled', $participantStatuses); + CRM_Event_BAO_Participant::updateParticipantStatus($participant->id, $oldStatus, $updatedStatusId, TRUE); + + $updateResult['updatedComponents']['CiviEvent'] = $updatedStatusId; + if ($processContributionObject) { + $processContribution = TRUE; + } + } + + if ($pledgePayment) { + CRM_Pledge_BAO_PledgePayment::updatePledgePaymentStatus($pledgeID, $pledgePaymentIDs, $contributionStatusId); + + $updateResult['updatedComponents']['CiviPledge'] = $contributionStatusId; + if ($processContributionObject) { + $processContribution = TRUE; + } + } + return [$updateResult, $processContribution]; + } + /** * @inheritDoc */ @@ -2143,11 +2180,7 @@ public static function transitionComponents($params, $processContributionObject return $updateResult; } - //now we are ready w/ required ids, start processing. - - $baseIPN = new CRM_Core_Payment_BaseIPN(); - - $input = $ids = $objects = []; + $input = $ids = []; $input['component'] = $componentDetails['component'] ?? NULL; $ids['contribution'] = $contributionId; @@ -2159,14 +2192,16 @@ public static function transitionComponents($params, $processContributionObject $ids['contributionRecur'] = NULL; $ids['contributionPage'] = NULL; - if (!$baseIPN->validateData($input, $ids, $objects, FALSE)) { - throw new CRM_Core_Exception('Unable to validate supplied data'); - } + $contribution = new CRM_Contribute_BAO_Contribution(); + $contribution->id = $ids['contribution']; + $contribution->find(); + + $contribution->loadRelatedObjects($input, $ids); + + $memberships = $contribution->_relatedObjects['membership'] ?? []; + $participant = $contribution->_relatedObjects['participant'] ?? []; + $pledgePayment = $contribution->_relatedObjects['pledge_payment'] ?? []; - $memberships = &$objects['membership']; - $participant = &$objects['participant']; - $pledgePayment = &$objects['pledge_payment']; - $contribution = &$objects['contribution']; $pledgeID = $oldStatus = NULL; $pledgePaymentIDs = []; if ($pledgePayment) { @@ -2192,51 +2227,7 @@ public static function transitionComponents($params, $processContributionObject list($updateResult, $processContribution) = self::cancel($processContributionObject, $memberships, $contributionId, $membershipStatuses, $updateResult, $participant, $oldStatus, $pledgePayment, $pledgeID, $pledgePaymentIDs, $contributionStatusId); } elseif ($contributionStatusId == array_search('Failed', $contributionStatuses)) { - if (is_array($memberships)) { - foreach ($memberships as $membership) { - $update = TRUE; - //Update Membership status if there is no other completed contribution associated with the membership. - $relatedContributions = CRM_Member_BAO_Membership::getMembershipContributionId($membership->id, TRUE); - foreach ($relatedContributions as $contriId) { - if ($contriId == $contributionId) { - continue; - } - $statusId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $contriId, 'contribution_status_id'); - if (CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $statusId) === 'Completed') { - $update = FALSE; - } - } - if ($membership && $update) { - $membership->status_id = array_search('Expired', $membershipStatuses); - $membership->is_override = TRUE; - $membership->status_override_end_date = 'null'; - $membership->save(); - - $updateResult['updatedComponents']['CiviMember'] = $membership->status_id; - if ($processContributionObject) { - $processContribution = TRUE; - } - } - } - } - if ($participant) { - $updatedStatusId = array_search('Cancelled', $participantStatuses); - CRM_Event_BAO_Participant::updateParticipantStatus($participant->id, $oldStatus, $updatedStatusId, TRUE); - - $updateResult['updatedComponents']['CiviEvent'] = $updatedStatusId; - if ($processContributionObject) { - $processContribution = TRUE; - } - } - - if ($pledgePayment) { - CRM_Pledge_BAO_PledgePayment::updatePledgePaymentStatus($pledgeID, $pledgePaymentIDs, $contributionStatusId); - - $updateResult['updatedComponents']['CiviPledge'] = $contributionStatusId; - if ($processContributionObject) { - $processContribution = TRUE; - } - } + list($updateResult, $processContribution) = self::processFail($processContributionObject, $memberships, $contributionId, $membershipStatuses, $updateResult, $participant, $pledgePayment, $pledgeID, $pledgePaymentIDs, $contributionStatusId); } elseif ($contributionStatusId == array_search('Completed', $contributionStatuses)) { @@ -2292,7 +2283,7 @@ public static function transitionComponents($params, $processContributionObject $numterms = 1; $lineitems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($contributionId); foreach ($lineitems as $lineitem) { - if ($membership->membership_type_id == CRM_Utils_Array::value('membership_type_id', $lineitem)) { + if ($membership->membership_type_id == ($lineitem['membership_type_id'] ?? NULL)) { $numterms = $lineitem['membership_num_terms'] ?? NULL; // in case membership_num_terms comes through as null or zero @@ -2331,7 +2322,7 @@ public static function transitionComponents($params, $processContributionObject $calcStatus = CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate($dates['start_date'], $dates['end_date'], $dates['join_date'], - 'today', + 'now', TRUE, $membership->membership_type_id, (array) $membership @@ -2354,7 +2345,7 @@ public static function transitionComponents($params, $processContributionObject //updating the membership log $membershipLog = []; $membershipLog = $formattedParams; - $logStartDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('log_start_date', $dates), $format); + $logStartDate = CRM_Utils_Date::customFormat($dates['log_start_date'] ?? NULL, $format); $logStartDate = ($logStartDate) ? CRM_Utils_Date::isoToMysql($logStartDate) : $formattedParams['start_date']; $membershipLog['start_date'] = $logStartDate; @@ -2804,7 +2795,7 @@ public static function getContributionDates() { * Load all related objects - even where id not passed in? (allows API to call this). * * @return bool - * @throws Exception + * @throws CRM_Core_Exception */ public function loadRelatedObjects($input, &$ids, $loadAll = FALSE) { // @todo deprecate this function - the steps should be @@ -2871,7 +2862,7 @@ public function loadRelatedObjects($input, &$ids, $loadAll = FALSE) { $payment = new CRM_Pledge_BAO_PledgePayment(); $payment->id = $paymentID; if (!$payment->find(TRUE)) { - throw new Exception("Could not find pledge payment record: " . $paymentID); + throw new CRM_Core_Exception("Could not find pledge payment record: " . $paymentID); } $this->_relatedObjects['pledge_payment'][] = $payment; } @@ -2889,7 +2880,7 @@ public function loadRelatedObjects($input, &$ids, $loadAll = FALSE) { if ($ids['event'] && !$event->find(TRUE) ) { - throw new Exception("Could not find event: " . $ids['event']); + throw new CRM_Core_Exception("Could not find event: " . $ids['event']); } $this->_relatedObjects['event'] = &$event; @@ -2899,7 +2890,7 @@ public function loadRelatedObjects($input, &$ids, $loadAll = FALSE) { if ($ids['participant'] && !$participant->find(TRUE) ) { - throw new Exception("Could not find participant: " . $ids['participant']); + throw new CRM_Core_Exception("Could not find participant: " . $ids['participant']); } $participant->register_date = CRM_Utils_Date::isoToMysql($participant->register_date); @@ -3185,10 +3176,10 @@ public function _gatherMessageValues($input, &$values, $ids = []) { foreach ($lineItems as &$eachItem) { if (isset($this->_relatedObjects['membership']) && is_array($this->_relatedObjects['membership']) - && array_key_exists($eachItem['membership_type_id'], $this->_relatedObjects['membership'])) { - $eachItem['join_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['membership_type_id']]->join_date); - $eachItem['start_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['membership_type_id']]->start_date); - $eachItem['end_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['membership_type_id']]->end_date); + && array_key_exists($eachItem['entity_id'] . '_' . $eachItem['membership_type_id'], $this->_relatedObjects['membership'])) { + $eachItem['join_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['entity_id'] . '_' . $eachItem['membership_type_id']]->join_date); + $eachItem['start_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['entity_id'] . '_' . $eachItem['membership_type_id']]->start_date); + $eachItem['end_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['entity_id'] . '_' . $eachItem['membership_type_id']]->end_date); } // This is actually used in conjunction with is_quick_config in the template & we should deprecate it. // However, that does create upgrade pain so would be better to be phased in. @@ -3267,7 +3258,7 @@ public function _assignMessageVariablesToTemplate(&$values, $input, $returnMessa // For some unit tests contribution cannot contain paymentProcessor information $billingMode = empty($this->_relatedObjects['paymentProcessor']) ? CRM_Core_Payment::BILLING_MODE_NOTIFY : $this->_relatedObjects['paymentProcessor']['billing_mode']; - $template->assign('contributeMode', CRM_Utils_Array::value($billingMode, CRM_Core_SelectValues::contributeMode())); + $template->assign('contributeMode', CRM_Core_SelectValues::contributeMode()[$billingMode] ?? NULL); //assign honor information to receipt message $softRecord = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($this->id); @@ -3317,7 +3308,7 @@ public function _assignMessageVariablesToTemplate(&$values, $input, $returnMessa $template->assign('price', $productDAO->price); $template->assign('sku', $productDAO->sku); } - $template->assign('title', CRM_Utils_Array::value('title', $values)); + $template->assign('title', $values['title'] ?? NULL); $values['amount'] = CRM_Utils_Array::value('total_amount', $input, (CRM_Utils_Array::value('amount', $input)), NULL); if (!$values['amount'] && isset($this->total_amount)) { $values['amount'] = $this->total_amount; @@ -3363,11 +3354,7 @@ public function _assignMessageVariablesToTemplate(&$values, $input, $returnMessa ); $values['receipt_date'] = (empty($this->receipt_date) ? NULL : $this->receipt_date); $template->assign('action', $this->is_test ? 1024 : 1); - $template->assign('receipt_text', - CRM_Utils_Array::value('receipt_text', - $values - ) - ); + $template->assign('receipt_text', $values['receipt_text'] ?? NULL); $template->assign('is_monetary', 1); $template->assign('is_recur', !empty($this->contribution_recur_id)); $template->assign('currency', $this->currency); @@ -3571,47 +3558,6 @@ public static function recordFinancialAccounts(&$params, $financialTrxnValues = } $statusId = $params['contribution']->contribution_status_id; - // CRM-13964 partial payment - if ($contributionStatus == 'Partially paid' - && !empty($params['partial_payment_total']) && !empty($params['partial_amount_to_pay']) - ) { - CRM_Core_Error::deprecatedFunctionWarning('partial_amount params are deprecated from Contribution.create - use Payment.create'); - $partialAmtPay = CRM_Utils_Rule::cleanMoney($params['partial_amount_to_pay']); - $partialAmtTotal = CRM_Utils_Rule::cleanMoney($params['partial_payment_total']); - - $fromFinancialAccountId = CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship($params['financial_type_id'], 'Accounts Receivable Account is'); - $statusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); - $params['total_amount'] = $partialAmtPay; - - $balanceTrxnInfo = CRM_Core_BAO_FinancialTrxn::getBalanceTrxnAmt($params['contribution']->id, $params['financial_type_id']); - if (empty($balanceTrxnInfo['trxn_id'])) { - // create new balance transaction record - $toFinancialAccount = CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship($params['financial_type_id'], 'Accounts Receivable Account is'); - - $balanceTrxnParams['total_amount'] = $partialAmtTotal; - $balanceTrxnParams['to_financial_account_id'] = $toFinancialAccount; - $balanceTrxnParams['contribution_id'] = $params['contribution']->id; - $balanceTrxnParams['trxn_date'] = !empty($params['contribution']->receive_date) ? $params['contribution']->receive_date : date('YmdHis'); - $balanceTrxnParams['fee_amount'] = $params['fee_amount'] ?? NULL; - $balanceTrxnParams['net_amount'] = $params['net_amount'] ?? NULL; - $balanceTrxnParams['currency'] = $params['contribution']->currency; - $balanceTrxnParams['trxn_id'] = $params['contribution']->trxn_id; - $balanceTrxnParams['status_id'] = $statusId; - $balanceTrxnParams['payment_instrument_id'] = $params['contribution']->payment_instrument_id; - $balanceTrxnParams['check_number'] = $params['check_number'] ?? NULL; - $balanceTrxnParams['pan_truncation'] = $params['pan_truncation'] ?? NULL; - $balanceTrxnParams['card_type_id'] = $params['card_type_id'] ?? NULL; - if (!empty($balanceTrxnParams['from_financial_account_id']) && - ($statusId == array_search('Completed', $contributionStatuses) || $statusId == array_search('Partially paid', $contributionStatuses)) - ) { - $balanceTrxnParams['is_payment'] = 1; - } - if (!empty($params['payment_processor'])) { - $balanceTrxnParams['payment_processor_id'] = $params['payment_processor']; - } - $financialTxn = CRM_Core_BAO_FinancialTrxn::create($balanceTrxnParams); - } - } // build line item array if its not set in $params if (empty($params['line_item']) || $additionalParticipantId) { @@ -4203,11 +4149,11 @@ public static function getContributionBalance($contributionId, $contributionTota * Get the tax amount (misnamed function). * * @param array $params - * @param bool $isLineItem * * @return array + * @throws \CiviCRM_API3_Exception */ - public static function checkTaxAmount($params, $isLineItem = FALSE) { + protected static function checkTaxAmount($params) { $taxRates = CRM_Core_PseudoConstant::getTaxRates(); // Update contribution. @@ -4253,8 +4199,7 @@ public static function checkTaxAmount($params, $isLineItem = FALSE) { // New Contribution and update of contribution with tax rate financial type if (isset($params['financial_type_id']) && array_key_exists($params['financial_type_id'], $taxRates) && - empty($params['skipLineItem']) && !$isLineItem - ) { + empty($params['skipLineItem'])) { $taxRateParams = $taxRates[$params['financial_type_id']]; $taxAmount = CRM_Contribute_BAO_Contribution_Utils::calculateTaxAmount(CRM_Utils_Array::value('total_amount', $params), $taxRateParams); $params['tax_amount'] = round($taxAmount['tax_amount'], 2); @@ -4286,14 +4231,7 @@ public static function checkTaxAmount($params, $isLineItem = FALSE) { $params['tax_amount'] = array_sum($taxAmountArray); $params['total_amount'] = $params['total_amount'] + $params['tax_amount']; } - else { - // update line item of contrbution - if (isset($params['financial_type_id']) && array_key_exists($params['financial_type_id'], $taxRates) && $isLineItem) { - $taxRate = $taxRates[$params['financial_type_id']]; - $taxAmount = CRM_Contribute_BAO_Contribution_Utils::calculateTaxAmount($params['line_total'], $taxRate); - $params['tax_amount'] = round($taxAmount['tax_amount'], 2); - } - } + return $params; } @@ -4401,22 +4339,6 @@ public static function updateRelatedPledge( } } - /** - * Compute the stats values - * - * @param string $stat either 'mode' or 'median' - * @param string $sql - * @param string $alias of civicrm_contribution - * - * @return array|null - * @deprecated - * - */ - public static function computeStats($stat, $sql, $alias = NULL) { - CRM_Core_Error::deprecatedFunctionWarning('computeStats is now deprecated'); - return []; - } - /** * Is there only one line item attached to the contribution. * @@ -4452,9 +4374,20 @@ public static function isSingleLineItem($id) { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public static function completeOrder($input, &$ids, $objects, $isPostPaymentCreate = FALSE) { + public static function completeOrder($input, $ids, $objects, $isPostPaymentCreate = FALSE) { $transaction = new CRM_Core_Transaction(); $contribution = $objects['contribution']; + // Unset objects just to make it clear it's not used again. + unset($objects); + // @todo see if we even need this - it's used further down to create an activity + // but the BAO layer should create that - we just need to add a test to cover it & can + // maybe remove $ids altogether. + $contributionContactID = $ids['related_contact']; + $participantID = $ids['participant']; + $recurringContributionID = $ids['contributionRecur']; + + // Unset ids just to make it clear it's not used again. + unset($ids); // The previous details are used when calculating line items so keep it before any code that 'does something' if (!empty($contribution->id)) { $input['prevContribution'] = CRM_Contribute_BAO_Contribution::getValues(['id' => $contribution->id]); @@ -4475,35 +4408,20 @@ public static function completeOrder($input, &$ids, $objects, $isPostPaymentCrea 'financial_type_id', ]; - $participant = $objects['participant'] ?? NULL; - $recurContrib = $objects['contributionRecur'] ?? NULL; - $recurringContributionID = (empty($recurContrib->id)) ? NULL : $recurContrib->id; - $event = $objects['event'] ?? NULL; - - $paymentProcessorId = ''; - if (isset($objects['paymentProcessor'])) { - if (is_array($objects['paymentProcessor'])) { - $paymentProcessorId = $objects['paymentProcessor']['id']; - } - else { - $paymentProcessorId = $objects['paymentProcessor']->id; - } - } + $paymentProcessorId = $input['payment_processor_id'] ?? NULL; $completedContributionStatusID = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); $contributionParams = array_merge([ 'contribution_status_id' => $completedContributionStatusID, - 'source' => self::getRecurringContributionDescription($contribution, $event), + 'source' => self::getRecurringContributionDescription($contribution, $participantID), ], array_intersect_key($input, array_fill_keys($inputContributionWhiteList, 1) )); $contributionParams['payment_processor'] = $paymentProcessorId; - // If paymentProcessor is not set then the payment_instrument_id would not be correct. - // not clear when or if this would occur if you encounter this please fix here & add a unit test. - if (empty($contributionParams['payment_instrument_id']) && isset($contribution->_relatedObjects['paymentProcessor']['payment_instrument_id'])) { - $contributionParams['payment_instrument_id'] = $contribution->_relatedObjects['paymentProcessor']['payment_instrument_id']; + if (empty($contributionParams['payment_instrument_id']) && $paymentProcessorId) { + $contributionParams['payment_instrument_id'] = PaymentProcessor::get(FALSE)->addWhere('id', '=', $paymentProcessorId)->addSelect('payment_instrument_id')->execute()->first()['payment_instrument_id']; } if ($recurringContributionID) { @@ -4512,28 +4430,25 @@ public static function completeOrder($input, &$ids, $objects, $isPostPaymentCrea $changeDate = CRM_Utils_Array::value('trxn_date', $input, date('YmdHis')); $contributionResult = self::repeatTransaction($contribution, $input, $contributionParams); + $contributionID = (int) $contribution->id; if ($input['component'] == 'contribute') { if ($contributionParams['contribution_status_id'] === $completedContributionStatusID) { self::updateMembershipBasedOnCompletionOfContribution( - $contribution, + $contributionID, $changeDate ); } } else { if (empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) { - if ($event->is_email_confirm) { - // @todo this should be set by the function that sends the mail after sending. - $contributionParams['receipt_date'] = $changeDate; - } - $participantParams['id'] = $participant->id; + $participantParams['id'] = $participantID; $participantParams['status_id'] = 'Registered'; civicrm_api3('Participant', 'create', $participantParams); } } - $contributionParams['id'] = $contribution->id; + $contributionParams['id'] = $contributionID; $contributionParams['is_post_payment_create'] = $isPostPaymentCreate; if (!$contributionResult) { @@ -4541,23 +4456,17 @@ public static function completeOrder($input, &$ids, $objects, $isPostPaymentCrea } // Add new soft credit against current $contribution. - if (!empty($objects['contributionRecur']) && $objects['contributionRecur']->id) { - CRM_Contribute_BAO_ContributionRecur::addrecurSoftCredit($objects['contributionRecur']->id, $contribution->id); + if ($recurringContributionID) { + CRM_Contribute_BAO_ContributionRecur::addrecurSoftCredit($recurringContributionID, $contributionID); } - if (empty($contribution->_relatedObjects['participant']) && !empty($contribution->_relatedObjects['membership'])) { - // @fixme Can we remove this if altogether? - we removed the participant if / else and left relatedObjects['participant'] to ensure behaviour didn't change but it is probably not required. - // @todo - use getRelatedMemberships instead - $contribution->trxn_id = $input['trxn_id'] ?? NULL; - $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date); - } $contribution->contribution_status_id = $contributionParams['contribution_status_id']; CRM_Core_Error::debug_log_message('Contribution record updated successfully'); $transaction->commit(); // @todo - check if Contribution::create does this, test, remove. - CRM_Contribute_BAO_ContributionRecur::updateRecurLinkedPledge($contribution->id, $recurringContributionID, + CRM_Contribute_BAO_ContributionRecur::updateRecurLinkedPledge($contributionID, $recurringContributionID, $contributionParams['contribution_status_id'], $input['amount']); // create an activity record @@ -4565,16 +4474,16 @@ public static function completeOrder($input, &$ids, $objects, $isPostPaymentCrea if ($input['component'] == 'contribute') { //CRM-4027 $targetContactID = NULL; - if (!empty($ids['related_contact'])) { + if ($contributionContactID) { $targetContactID = $contribution->contact_id; - $contribution->contact_id = $ids['related_contact']; + $contribution->contact_id = $contributionContactID; } - CRM_Activity_BAO_Activity::addActivity($contribution, NULL, $targetContactID); + CRM_Activity_BAO_Activity::addActivity($contribution, 'Contribution', $targetContactID); } if (self::isEmailReceipt($input, $contribution->contribution_page_id, $recurringContributionID)) { civicrm_api3('Contribution', 'sendconfirmation', [ - 'id' => $contribution->id, + 'id' => $contributionID, 'payment_processor_id' => $paymentProcessorId, ]); CRM_Core_Error::debug_log_message("Receipt sent"); @@ -4706,7 +4615,8 @@ public function loadRelatedMembershipObjects($ids = []) { $membership->join_date = CRM_Utils_Date::isoToMysql($membership->join_date); $membership->start_date = CRM_Utils_Date::isoToMysql($membership->start_date); $membership->end_date = CRM_Utils_Date::isoToMysql($membership->end_date); - $this->_relatedObjects['membership'][$membership->membership_type_id] = $membership; + $this->_relatedObjects['membership'][$membership->id . '_' . $membership->membership_type_id] = $membership; + } } } @@ -4717,12 +4627,13 @@ public function loadRelatedMembershipObjects($ids = []) { * Get the description (source field) for the recurring contribution. * * @param CRM_Contribute_BAO_Contribution $contribution - * @param CRM_Event_DAO_Event|null $event + * @param int|null $participantID * * @return string * @throws \CiviCRM_API3_Exception + * @throws \API_Exception */ - protected static function getRecurringContributionDescription($contribution, $event) { + protected static function getRecurringContributionDescription($contribution, $participantID) { if (!empty($contribution->source)) { return $contribution->source; } @@ -4733,8 +4644,12 @@ protected static function getRecurringContributionDescription($contribution, $ev ]); return ts('Online Contribution') . ': ' . $contributionPageTitle; } - elseif ($event) { - return ts('Online Event Registration') . ': ' . $event->title; + elseif ($participantID) { + $eventTitle = Participant::get(FALSE) + ->addSelect('event.title') + ->addWhere('id', '=', (int) $participantID) + ->execute()->first()['event.title']; + return ts('Online Event Registration') . ': ' . $eventTitle; } elseif (!empty($contribution->contribution_recur_id)) { return 'recurring contribution'; @@ -5170,14 +5085,14 @@ protected static function isPaymentInstrumentChange(&$params, $pendingStatuses) * Note that the way in which $memberships are loaded as objects is pretty messy & I think we could just * load them in this function. Code clean up would compensate for any minor performance implication. * - * @param \CRM_Contribute_BAO_Contribution $contribution + * @param int $contributionID * @param string $changeDate * * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public static function updateMembershipBasedOnCompletionOfContribution($contribution, $changeDate) { - $memberships = self::getRelatedMemberships($contribution->id); + public static function updateMembershipBasedOnCompletionOfContribution($contributionID, $changeDate) { + $memberships = self::getRelatedMemberships($contributionID); foreach ($memberships as $membership) { $membershipParams = [ 'id' => $membership['id'], @@ -5215,9 +5130,9 @@ public static function updateMembershipBasedOnCompletionOfContribution($contribu // The api assumes num_terms is a special sauce for 'is_renewal' so we need to not pass it when updating a pending to completed. // ... except testCompleteTransactionMembershipPriceSetTwoTerms hits this line so the above is obviously not true.... // @todo once apiv4 ships with core switch to that & find sanity. - $membershipParams['num_terms'] = $contribution->getNumTermsByContributionAndMembershipType( + $membershipParams['num_terms'] = self::getNumTermsByContributionAndMembershipType( $membershipParams['membership_type_id'], - $contribution->id + $contributionID ); } // @todo remove all this stuff in favour of letting the api call further down handle in @@ -5249,7 +5164,7 @@ public static function updateMembershipBasedOnCompletionOfContribution($contribu $calcStatus = CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate($dates['start_date'], $dates['end_date'], $dates['join_date'], - 'today', + 'now', TRUE, $membershipParams['membership_type_id'], $membershipParams @@ -5261,11 +5176,6 @@ public static function updateMembershipBasedOnCompletionOfContribution($contribu //so make status override false. $membershipParams['is_override'] = FALSE; $membershipParams['status_override_end_date'] = 'null'; - - //CRM-17723 - reset static $relatedContactIds array() - // @todo move it to Civi Statics. - $var = TRUE; - CRM_Member_BAO_Membership::createRelatedMemberships($var, $var, TRUE); civicrm_api3('Membership', 'create', $membershipParams); } } @@ -5304,35 +5214,27 @@ protected static function getContributionPaymentLinks($id, $balance, $contributi 'title' => ts('Record Payment'), ]; - if ((int) $balance > 0) { - // @todo - this should be possible even if not > 0 - test & remove this if. - // it is possible to 'overpay' in the real world & we honor that. - if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { - $actionLinks[] = [ - 'url' => CRM_Utils_System::url('civicrm/payment', [ - 'action' => 'add', - 'reset' => 1, - 'is_refund' => 0, - 'id' => $id, - 'mode' => 'live', - ]), - 'title' => ts('Submit Credit Card payment'), - ]; - } - } - elseif ((int) $balance < 0) { - // @todo - in the future remove this IF - OK to refund money even when not due since - // ... life. + if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { $actionLinks[] = [ 'url' => CRM_Utils_System::url('civicrm/payment', [ 'action' => 'add', 'reset' => 1, + 'is_refund' => 0, 'id' => $id, - 'is_refund' => 1, + 'mode' => 'live', ]), - 'title' => ts('Record Refund'), + 'title' => ts('Submit Credit Card payment'), ]; } + $actionLinks[] = [ + 'url' => CRM_Utils_System::url('civicrm/payment', [ + 'action' => 'add', + 'reset' => 1, + 'id' => $id, + 'is_refund' => 1, + ]), + 'title' => ts('Record Refund'), + ]; return $actionLinks; } @@ -5571,7 +5473,7 @@ public static function createProportionalEntry($entityParams, $eftParams) { $paid = $entityParams['line_item_amount'] * ($entityParams['trxn_total_amount'] / $entityParams['contribution_total_amount']); } // Record Entity Financial Trxn; CRM-20145 - $eftParams['amount'] = CRM_Contribute_BAO_Contribution_Utils::formatAmount($paid); + $eftParams['amount'] = $paid; civicrm_api3('EntityFinancialTrxn', 'create', $eftParams); } diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 21fd4716d431..af50415499f9 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -345,78 +345,6 @@ public static function createCMSUser(&$params, $contactID, $mail) { } } - /** - * @param array $params - * @param string $type - * - * @return bool - */ - public static function _fillCommonParams(&$params, $type = 'paypal') { - if (array_key_exists('transaction', $params)) { - $transaction = &$params['transaction']; - } - else { - $transaction = &$params; - } - - $params['contact_type'] = 'Individual'; - - $billingLocTypeId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_LocationType', 'Billing', 'id', 'name'); - if (!$billingLocTypeId) { - $billingLocTypeId = 1; - } - if (!CRM_Utils_System::isNull($params['address'])) { - $params['address'][1]['is_primary'] = 1; - $params['address'][1]['location_type_id'] = $billingLocTypeId; - } - if (!CRM_Utils_System::isNull($params['email'])) { - $params['email'] = [ - 1 => [ - 'email' => $params['email'], - 'location_type_id' => $billingLocTypeId, - ], - ]; - } - - if (isset($transaction['trxn_id'])) { - // set error message if transaction has already been processed. - $contribution = new CRM_Contribute_DAO_Contribution(); - $contribution->trxn_id = $transaction['trxn_id']; - if ($contribution->find(TRUE)) { - $params['error'][] = ts('transaction already processed.'); - } - } - else { - // generate a new transaction id, if not already exist - $transaction['trxn_id'] = md5(uniqid(rand(), TRUE)); - } - - if (!isset($transaction['financial_type_id'])) { - $contributionTypes = array_keys(CRM_Contribute_PseudoConstant::financialType()); - $transaction['financial_type_id'] = $contributionTypes[0]; - } - - if (($type == 'paypal') && (!isset($transaction['net_amount']))) { - $transaction['net_amount'] = $transaction['total_amount'] - CRM_Utils_Array::value('fee_amount', $transaction, 0); - } - - if (!isset($transaction['invoice_id'])) { - $transaction['invoice_id'] = $transaction['trxn_id']; - } - - $source = ts('ContributionProcessor: %1 API', - [1 => ucfirst($type)] - ); - if (isset($transaction['source'])) { - $transaction['source'] = $source . ':: ' . $transaction['source']; - } - else { - $transaction['source'] = $source; - } - - return TRUE; - } - /** * @param int $contactID * @@ -496,6 +424,7 @@ public static function calculateTaxAmount($amount, $taxRate) { * Amount rounded and returned with the desired decimal places */ public static function formatAmount($amount, $decimals = 2) { + CRM_Core_Error::deprecatedFunctionWarning('Use CRM_Utils_Rule::cleanMoney instead'); return number_format((float) round($amount, (int) $decimals), (int) $decimals, '.', ''); } diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index 63d7799768d3..b7e12eb2c06c 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -261,9 +261,6 @@ public static function cancelRecurContribution($params) { if ($recur->find(TRUE)) { $transaction = new CRM_Core_Transaction(); $recur->contribution_status_id = $cancelledId; - $recur->start_date = CRM_Utils_Date::isoToMysql($recur->start_date); - $recur->create_date = CRM_Utils_Date::isoToMysql($recur->create_date); - $recur->modified_date = CRM_Utils_Date::isoToMysql($recur->modified_date); $recur->cancel_reason = $params['cancel_reason'] ?? NULL; $recur->cancel_date = date('YmdHis'); $recur->save(); diff --git a/CRM/Contribute/DAO/Contribution.php b/CRM/Contribute/DAO/Contribution.php index d40a175b96d7..174e9bf69591 100644 --- a/CRM/Contribute/DAO/Contribution.php +++ b/CRM/Contribute/DAO/Contribution.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/Contribution.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:534963bc67ddc36a182ff4767f223531) + * (GenCodeChecksum:d937ea0497be1a1aeb1bac09986dd802) */ /** @@ -252,9 +252,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Contributions'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Contributions') : ts('Contribution'); } /** @@ -327,7 +330,7 @@ public static function &fields() { 'financial_type_id' => [ 'name' => 'financial_type_id', 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Financial Type'), + 'title' => ts('Financial Type ID'), 'description' => ts('FK to Financial Type for (total_amount - non_deductible_amount).'), 'where' => 'civicrm_contribution.financial_type_id', 'export' => TRUE, @@ -338,6 +341,7 @@ public static function &fields() { 'FKClassName' => 'CRM_Financial_DAO_FinancialType', 'html' => [ 'type' => 'Select', + 'label' => ts("Financial Type"), ], 'pseudoconstant' => [ 'table' => 'civicrm_financial_type', diff --git a/CRM/Contribute/DAO/ContributionPage.php b/CRM/Contribute/DAO/ContributionPage.php index 80ec08d3acf6..be85752fb787 100644 --- a/CRM/Contribute/DAO/ContributionPage.php +++ b/CRM/Contribute/DAO/ContributionPage.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/ContributionPage.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:902bfa164280b9ba21a7cb5a38aceba8) + * (GenCodeChecksum:4910b973830834fcb2ce5bb3637070d6) */ /** @@ -362,9 +362,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Contribution Pages'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Contribution Pages') : ts('Contribution Page'); } /** diff --git a/CRM/Contribute/DAO/ContributionProduct.php b/CRM/Contribute/DAO/ContributionProduct.php index e5a0f053702a..9837f2b8c084 100644 --- a/CRM/Contribute/DAO/ContributionProduct.php +++ b/CRM/Contribute/DAO/ContributionProduct.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/ContributionProduct.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:4e76d9dc75f5bc1b1141645c8ee5e2e4) + * (GenCodeChecksum:a2a4170ca2004a1630e27ba83e5edff3) */ /** @@ -100,9 +100,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Contribution Products'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Contribution Products') : ts('Contribution Product'); } /** diff --git a/CRM/Contribute/DAO/ContributionRecur.php b/CRM/Contribute/DAO/ContributionRecur.php index 2ccd7486d6c3..f61c44705145 100644 --- a/CRM/Contribute/DAO/ContributionRecur.php +++ b/CRM/Contribute/DAO/ContributionRecur.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/ContributionRecur.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:decf43c002d0e4ded0fe5f2a2e2f7bd0) + * (GenCodeChecksum:ba5f7682a5f99b682f70cd45097feb56) */ /** @@ -239,9 +239,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Recurring Contributions'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Recurring Contributions') : ts('Recurring Contribution'); } /** diff --git a/CRM/Contribute/DAO/ContributionSoft.php b/CRM/Contribute/DAO/ContributionSoft.php index 3a1a9b7af760..fa78630bad12 100644 --- a/CRM/Contribute/DAO/ContributionSoft.php +++ b/CRM/Contribute/DAO/ContributionSoft.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/ContributionSoft.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:caa58722ef865c7342fdff08f24d86ee) + * (GenCodeChecksum:e37496d0b9938151e5bcf9e6dad23c0a) */ /** @@ -104,9 +104,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Contribution Softs'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Contribution Softs') : ts('Contribution Soft'); } /** diff --git a/CRM/Contribute/DAO/Premium.php b/CRM/Contribute/DAO/Premium.php index 7e0020c13492..ebbafd660e65 100644 --- a/CRM/Contribute/DAO/Premium.php +++ b/CRM/Contribute/DAO/Premium.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/Premium.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:cd1826e777cea80450636ef175aaab7f) + * (GenCodeChecksum:b35b6fb4895df990a55d9015bb82a852) */ /** @@ -111,9 +111,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Premiums'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Premiums') : ts('Premium'); } /** diff --git a/CRM/Contribute/DAO/PremiumsProduct.php b/CRM/Contribute/DAO/PremiumsProduct.php index b153adb27496..f99e9ddf30b8 100644 --- a/CRM/Contribute/DAO/PremiumsProduct.php +++ b/CRM/Contribute/DAO/PremiumsProduct.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/PremiumsProduct.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:4831cb4c7e0611db0f4312f6522d2c20) + * (GenCodeChecksum:84fea8d6a2a852495da5ed86232d42d1) */ /** @@ -73,9 +73,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Premiums Products'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Premiums Products') : ts('Premiums Product'); } /** diff --git a/CRM/Contribute/DAO/Product.php b/CRM/Contribute/DAO/Product.php index 8433e1820ad0..7b481641af4d 100644 --- a/CRM/Contribute/DAO/Product.php +++ b/CRM/Contribute/DAO/Product.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/Product.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:dea1c7db61776456a70f752fe9f93f06) + * (GenCodeChecksum:d6c90aacbe802ff244a6a4bbaecad4d3) */ /** @@ -170,9 +170,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Products'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Products') : ts('Product'); } /** diff --git a/CRM/Contribute/DAO/Widget.php b/CRM/Contribute/DAO/Widget.php index 5da47438da53..a49f0a9471d9 100644 --- a/CRM/Contribute/DAO/Widget.php +++ b/CRM/Contribute/DAO/Widget.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/Widget.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:e24eaf675b793969d408fbc0f847a9ed) + * (GenCodeChecksum:bb99920b9b2c2a8b7419ecd94dcbf577) */ /** @@ -141,9 +141,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Widgets'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Widgets') : ts('Widget'); } /** diff --git a/CRM/Contribute/Form/CancelSubscription.php b/CRM/Contribute/Form/CancelSubscription.php index ecb18817c51b..a1b8abf9e0cc 100644 --- a/CRM/Contribute/Form/CancelSubscription.php +++ b/CRM/Contribute/Form/CancelSubscription.php @@ -179,7 +179,6 @@ public function buildQuickForm() { */ public function setDefaultValues() { return [ - 'is_notify' => 1, 'send_cancel_request' => 1, ]; } diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index a9a2988d4d97..d9642ae9bcf2 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -93,7 +93,7 @@ public static function handlePledge(&$form, $params, $contributionParams, $pledg $pledgeParams['frequency_interval'] = $params['pledge_frequency_interval']; $pledgeParams['installments'] = $params['pledge_installments']; $pledgeParams['frequency_unit'] = $params['pledge_frequency_unit']; - if ($pledgeParams['frequency_unit'] == 'month') { + if ($pledgeParams['frequency_unit'] === 'month') { $pledgeParams['frequency_day'] = intval(date("d")); } else { @@ -149,6 +149,7 @@ public static function handlePledge(&$form, $params, $contributionParams, $pledg * @param int $recurringContributionID * * @return array + * @throws \CRM_Core_Exception */ public static function getContributionParams( $params, $financialTypeID, @@ -235,7 +236,7 @@ protected static function getNonDeductibleAmount($params, $financialType, $onlin } // if there is a product - compare the value to the contribution amount if (isset($selectProduct) && - $selectProduct != 'no_thanks' + $selectProduct !== 'no_thanks' ) { $productDAO = new CRM_Contribute_DAO_Product(); $productDAO->id = $selectProduct; @@ -332,15 +333,15 @@ public function preProcess() { } if (in_array($field, $addressBlocks)) { - if ($locType == 'Primary') { + if ($locType === 'Primary') { $defaultLocationType = CRM_Core_BAO_LocationType::getDefault(); $locType = $defaultLocationType->id; } - if ($field == 'country') { + if ($field === 'country') { $value = CRM_Core_PseudoConstant::countryIsoCode($value); } - elseif ($field == 'state_province') { + elseif ($field === 'state_province') { $value = CRM_Core_PseudoConstant::stateProvinceAbbreviation($value); } @@ -361,7 +362,7 @@ public function preProcess() { if (!$typeId || is_numeric($typeId)) { $blockName = $fieldName = $field; $locationType = 'location_type_id'; - if ($locType == 'Primary') { + if ($locType === 'Primary') { $defaultLocationType = CRM_Core_BAO_LocationType::getDefault(); $locationValue = $defaultLocationType->id; } @@ -423,7 +424,7 @@ public function preProcess() { $this->_params['onbehalf_location']["{$loc}"] = $value; } else { - if ($loc == 'contact_sub_type') { + if ($loc === 'contact_sub_type') { $this->_params['onbehalf_location'][$loc] = $value; } else { @@ -485,7 +486,7 @@ public function buildQuickForm() { $fieldTypes[] = CRM_Core_BAO_UFGroup::getContactType($this->_values['honoree_profile_id']); $this->buildCustom($this->_values['honoree_profile_id'], 'honoreeProfileFields', TRUE, 'honor', $fieldTypes); } - $this->assign('receiptFromEmail', $this->_values['receipt_from_email']); + $this->assign('receiptFromEmail', $this->_values['receipt_from_email'] ?? NULL); $amount_block_is_active = $this->get('amount_block_is_active'); $this->assign('amount_block_is_active', $amount_block_is_active); @@ -510,7 +511,7 @@ public function buildQuickForm() { $this->_params['is_quick_config'] = 1; } - if (!empty($params['selectProduct']) && $params['selectProduct'] != 'no_thanks') { + if (!empty($params['selectProduct']) && $params['selectProduct'] !== 'no_thanks') { $option = $params['options_' . $params['selectProduct']] ?? NULL; $productID = $params['selectProduct']; CRM_Contribute_BAO_Premium::buildPremiumBlock($this, $this->_id, FALSE, @@ -522,7 +523,7 @@ public function buildQuickForm() { $config = CRM_Core_Config::singleton(); if (in_array('CiviMember', $config->enableComponents) && empty($this->_ccid)) { if (isset($params['selectMembership']) && - $params['selectMembership'] != 'no_thanks' + $params['selectMembership'] !== 'no_thanks' ) { $this->buildMembershipBlock( $this->_membershipContactID, @@ -1020,7 +1021,7 @@ public static function processFormContribution( // create an activity record if ($contribution) { - CRM_Activity_BAO_Activity::addActivity($contribution, NULL, $targetContactID, $actParams); + CRM_Activity_BAO_Activity::addActivity($contribution, 'Contribution', $targetContactID, $actParams); } $transaction->commit(); @@ -1145,19 +1146,9 @@ public static function processOnBehalfOrganization(&$behalfOrganization, &$conta // create employer relationship with $contactID only when new organization is there // else retain the existing relationship else { - // get the Employee relationship type id - $relTypeId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', 'Employee of', 'id', 'name_a_b'); - - // keep relationship params ready - $relParams['relationship_type_id'] = $relTypeId . '_a_b'; - $relParams['is_permission_a_b'] = 1; - $relParams['is_active'] = 1; $isNotCurrentEmployer = TRUE; } - // formalities for creating / editing organization. - $behalfOrganization['contact_type'] = 'Organization'; - if (!$orgID) { // check if matching organization contact exists $dupeIDs = CRM_Contact_BAO_Contact::getDuplicateContacts($behalfOrganization, 'Organization', 'Unsupervised', [], FALSE); @@ -1182,14 +1173,26 @@ public static function processOnBehalfOrganization(&$behalfOrganization, &$conta } // create organization, add location + $behalfOrganization['contact_type'] = 'Organization'; $orgID = CRM_Contact_BAO_Contact::createProfileContact($behalfOrganization, $fields, $orgID, NULL, NULL, 'Organization' ); // create relationship if ($isNotCurrentEmployer) { - $relParams['contact_check'][$orgID] = 1; - $cid = ['contact' => $contactID]; - CRM_Contact_BAO_Relationship::legacyCreateMultiple($relParams, $cid); + try { + \Civi\Api4\Relationship::create(FALSE) + ->addValue('contact_id_a', $contactID) + ->addValue('contact_id_b', $orgID) + ->addValue('relationship_type_id', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', 'Employee of', 'id', 'name_a_b')) + ->addValue('is_permission_a_b:name', 'View and update') + ->execute(); + } + catch (CRM_Core_Exception $e) { + // Ignore if duplicate relationship. + if ($e->getMessage() !== 'Duplicate Relationship') { + throw $e; + } + } } // if multiple match - send a duplicate alert @@ -1903,9 +1906,19 @@ public static function submit($params) { $params['invoiceID'] = md5(uniqid(rand(), TRUE)); // We want to move away from passing in amount as it is calculated by the actually-submitted params. - $params['amount'] = $params['amount'] ?? $form->getMainContributionAmount($params); + if ($form->getMainContributionAmount($params)) { + $params['amount'] = $form->getMainContributionAmount($params); + } $paramsProcessedForForm = $form->_params = self::getFormParams($params['id'], $params); - $form->_amount = $params['amount']; + + $order = new CRM_Financial_BAO_Order(); + $order->setPriceSelectionFromUnfilteredInput($params); + if (isset($params['amount'])) { + // @todo deprecate receiving amount, calculate on the form. + $order->setOverrideTotalAmount($params['amount']); + } + $amount = $order->getTotalAmount(); + $form->_amount = $params['amount'] = $form->_params['amount'] = $params['amount'] ?? $amount; // hack these in for test support. $form->_fields['billing_first_name'] = 1; $form->_fields['billing_last_name'] = 1; @@ -1983,7 +1996,7 @@ public static function getFormParams($id, array $params) { if (!empty($params['payment_processor_id'])) { $params['is_pay_later'] = 0; } - elseif ($params['amount'] !== 0) { + elseif (($params['amount'] ?? 0) !== 0) { $params['is_pay_later'] = civicrm_api3('contribution_page', 'getvalue', [ 'id' => $id, 'return' => 'is_pay_later', diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 7753b2a13573..6ff333e145f9 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -605,11 +605,10 @@ public static function formRule($fields, $files, $self) { $isTest = $self->_action & CRM_Core_Action::PREVIEW; $lifeMember = CRM_Member_BAO_Membership::getAllContactMembership($self->_membershipContactID, $isTest, TRUE); - $membershipOrgDetails = CRM_Member_BAO_MembershipType::getMembershipTypeOrganization(); - + $membershipOrgDetails = CRM_Member_BAO_MembershipType::getAllMembershipTypes(); $unallowedOrgs = []; foreach (array_keys($lifeMember) as $memTypeId) { - $unallowedOrgs[] = $membershipOrgDetails[$memTypeId]; + $unallowedOrgs[] = $membershipOrgDetails[$memTypeId]['member_of_contact_id']; } } @@ -774,7 +773,7 @@ public static function formRule($fields, $files, $self) { if (!empty($lifeMember)) { foreach ($priceFieldIDS as $priceFieldId) { if (($id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldId, 'membership_type_id')) && - in_array($membershipOrgDetails[$id], $unallowedOrgs) + in_array($membershipOrgDetails[$id]['member_of_contact_id'], $unallowedOrgs) ) { $errors['_qf_default'] = ts('You already have a lifetime membership and cannot select a membership with a shorter term.'); break; @@ -791,6 +790,7 @@ public static function formRule($fields, $files, $self) { foreach ($count as $id => $occurrence) { if ($occurrence > 1) { $errors['_qf_default'] = ts('You have selected multiple memberships for the same organization or entity. Please review your selections and choose only one membership per entity. Contact the site administrator if you need assistance.'); + break; } } } diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 6822a355f6f5..7bb940637f2b 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -154,8 +154,18 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { public $_action; /** - * Contribution mode e.g express for payment express, notify for off-site + notification back to CiviCRM + * Contribution mode. + * + * In general we are trying to deprecate this parameter but some templates and processors still + * require it to denote whether the processor redirects offsite (notify) or not. + * + * The intent is that this knowledge should not be required and all contributions should + * be created in a pending state and updated based on the payment result without needing to be + * aware of the processor workings. + * * @var string + * + * @deprecated */ public $_contributeMode; @@ -179,8 +189,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { public $_emailExists = FALSE; /** - * Is this a backoffice form - * (this will affect whether paypal express code is displayed) + * Is this a backoffice form. + * + * Processors may display different options to backoffice users. + * * @var bool */ public $isBackOffice = FALSE; diff --git a/CRM/Contribute/Form/ContributionPage.php b/CRM/Contribute/Form/ContributionPage.php index ba8bb64ec087..76e245eabdb7 100644 --- a/CRM/Contribute/Form/ContributionPage.php +++ b/CRM/Contribute/Form/ContributionPage.php @@ -222,7 +222,10 @@ public function buildQuickForm() { // views are implemented as frozen form if ($this->_action & CRM_Core_Action::VIEW) { $this->freeze(); - $this->addElement('button', 'done', ts('Done'), ['onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'"]); + $this->addElement('xbutton', 'done', ts('Done'), [ + 'type' => 'button', + 'onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'", + ]); } // don't show option for contribution amounts section if membership price set diff --git a/CRM/Contribute/Form/ContributionPage/Premium.php b/CRM/Contribute/Form/ContributionPage/Premium.php index ba5b7863b777..7683f3d90015 100644 --- a/CRM/Contribute/Form/ContributionPage/Premium.php +++ b/CRM/Contribute/Form/ContributionPage/Premium.php @@ -52,7 +52,7 @@ public function buildQuickForm() { $this->addElement('text', 'premiums_intro_title', ts('Title'), $attributes['premiums_intro_title']); - $this->add('textarea', 'premiums_intro_text', ts('Introductory Message'), 'rows=5, cols=50'); + $this->add('textarea', 'premiums_intro_text', ts('Introductory Message'), ['cols' => 50, 'rows' => 5]); $this->add('text', 'premiums_contact_email', ts('Contact Email') . ' ', $attributes['premiums_contact_email']); diff --git a/CRM/Contribute/Form/ContributionPage/Widget.php b/CRM/Contribute/Form/ContributionPage/Widget.php index 7c6ee1bb991c..f962551188c5 100644 --- a/CRM/Contribute/Form/ContributionPage/Widget.php +++ b/CRM/Contribute/Form/ContributionPage/Widget.php @@ -188,9 +188,10 @@ public function buildQuickForm() { $this->assign_by_ref('colorFields', $this->_colorFields); $this->_refreshButtonName = $this->getButtonName('refresh'); - $this->addElement('submit', + $this->addElement('xbutton', $this->_refreshButtonName, - ts('Save and Preview') + ts('Save and Preview'), + ['type' => 'submit', 'class' => 'crm-button crm-form-submit crm-button-type-submit'] ); parent::buildQuickForm(); $this->addFormRule(['CRM_Contribute_Form_ContributionPage_Widget', 'formRule'], $this); diff --git a/CRM/Contribute/Form/ManagePremiums.php b/CRM/Contribute/Form/ManagePremiums.php index 61da18d8f443..85b8ad03c9fb 100644 --- a/CRM/Contribute/Form/ManagePremiums.php +++ b/CRM/Contribute/Form/ManagePremiums.php @@ -81,7 +81,7 @@ public function buildQuickForm() { ]); $this->add('text', 'sku', ts('SKU'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'sku')); - $this->add('textarea', 'description', ts('Description'), 'rows=3, cols=60'); + $this->add('textarea', 'description', ts('Description'), ['cols' => 60, 'rows' => 3]); $image['image'] = $this->createElement('radio', NULL, NULL, ts('Upload from my computer'), 'image', 'onclick="add_upload_file_block(\'image\');'); $image['thumbnail'] = $this->createElement('radio', NULL, NULL, ts('Display image and thumbnail from these locations on the web:'), 'thumbnail', 'onclick="add_upload_file_block(\'thumbnail\');'); @@ -94,7 +94,7 @@ public function buildQuickForm() { $this->addElement('text', 'imageUrl', ts('Image URL')); $this->addElement('text', 'thumbnailUrl', ts('Thumbnail URL')); - $this->add('file', 'uploadFile', ts('Image File Name'), 'onChange="select_option();"'); + $this->add('file', 'uploadFile', ts('Image File Name'), ['onChange' => 'select_option();']); $this->add('text', 'price', ts('Market Value'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'price'), TRUE); $this->addRule('price', ts('Please enter the Market Value for this product.'), 'money'); @@ -105,21 +105,20 @@ public function buildQuickForm() { $this->add('text', 'min_contribution', ts('Minimum Contribution Amount'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'min_contribution'), TRUE); $this->addRule('min_contribution', ts('Please enter a monetary value for the Minimum Contribution Amount.'), 'money'); - $this->add('textarea', 'options', ts('Options'), 'rows=3, cols=60'); + $this->add('textarea', 'options', ts('Options'), ['cols' => 60, 'rows' => 3]); $this->add('select', 'period_type', ts('Period Type'), [ - '' => '- select -', 'rolling' => 'Rolling', 'fixed' => 'Fixed', - ]); + ], FALSE, ['placeholder' => TRUE]); $this->add('text', 'fixed_period_start_day', ts('Fixed Period Start Day'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'fixed_period_start_day')); - $this->add('Select', 'duration_unit', ts('Duration Unit'), ['' => '- select period -'] + CRM_Core_SelectValues::getPremiumUnits()); + $this->add('Select', 'duration_unit', ts('Duration Unit'), CRM_Core_SelectValues::getPremiumUnits(), FALSE, ['placeholder' => ts('- select period -')]); $this->add('text', 'duration_interval', ts('Duration'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'duration_interval')); - $this->add('Select', 'frequency_unit', ts('Frequency Unit'), ['' => '- select period -'] + CRM_Core_SelectValues::getPremiumUnits()); + $this->add('Select', 'frequency_unit', ts('Frequency Unit'), CRM_Core_SelectValues::getPremiumUnits(), FALSE, ['placeholder' => ts('- select period -')]); $this->add('text', 'frequency_interval', ts('Frequency'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'frequency_interval')); @@ -157,7 +156,9 @@ public function buildQuickForm() { 'select', 'financial_type_id', ts('Financial Type'), - ['' => ts('- select -')] + $financialType + $financialType, + FALSE, + ['placeholder' => TRUE] ); $this->add('checkbox', 'is_active', ts('Enabled?')); diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index 4f1009b41a07..866c178848df 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -61,6 +61,9 @@ public function getDefaultEntity() { * @throws \CRM_Core_Exception */ public function preProcess() { + // SearchFormName is deprecated & to be removed - the replacement is for the task to + // call $this->form->getSearchFormValues() + // A couple of extensions use it. $this->set('searchFormName', 'Search'); $this->_actionButtonName = $this->getButtonName('next', 'action'); @@ -386,12 +389,14 @@ public function fixFormValues() { $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this); - if ($cid) { + // skip cid (contact id of membership/participant record) to get associated payments for membership/participant record, + // contribution record may be on different contact id. + $skip_cid = CRM_Utils_Request::retrieve('skip_cid', 'Boolean', $this, FALSE, FALSE); + + if ($cid && !$skip_cid) { $cid = CRM_Utils_Type::escape($cid, 'Integer'); if ($cid > 0) { $this->_formValues['contact_id'] = $cid; - // @todo - why do we retrieve these when they are not used? - list($display, $image) = CRM_Contact_BAO_Contact::getDisplayAndImage($cid); $this->_defaults['sort_name'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'sort_name' ); diff --git a/CRM/Contribute/Form/Task.php b/CRM/Contribute/Form/Task.php index 16d61166670f..e6cc4ea75045 100644 --- a/CRM/Contribute/Form/Task.php +++ b/CRM/Contribute/Form/Task.php @@ -50,16 +50,16 @@ public function preProcess() { } /** - * @param CRM_Core_Form $form + * @param \CRM_Core_Form_Task $form + * + * @throws \CRM_Core_Exception */ public static function preProcessCommon(&$form) { $form->_contributionIds = []; - $values = $form->controller->exportValues($form->get('searchFormName')); + $values = $form->getSearchFormValues(); $form->_task = $values['task'] ?? NULL; - $contributeTasks = CRM_Contribute_Task::tasks(); - $form->assign('taskName', CRM_Utils_Array::value($form->_task, $contributeTasks)); $ids = []; if (isset($values['radio_ts']) && $values['radio_ts'] == 'ts_sel') { diff --git a/CRM/Contribute/Form/Task/Invoice.php b/CRM/Contribute/Form/Task/Invoice.php index b2087a647462..262225d49061 100644 --- a/CRM/Contribute/Form/Task/Invoice.php +++ b/CRM/Contribute/Form/Task/Invoice.php @@ -15,6 +15,8 @@ * @copyright CiviCRM LLC https://civicrm.org/licensing */ +use Civi\Api4\Email; + /** * This class provides the functionality to email a group of * contacts. @@ -143,6 +145,12 @@ public function buildQuickForm() { $this->addRule('from_email_address', ts('From Email Address is required'), 'required'); } + $attributes = ['class' => 'huge']; + $this->addEntityRef('cc_id', ts('CC'), [ + 'entity' => 'Email', + 'multiple' => TRUE, + ]); + $this->add('text', 'subject', ts('Subject'), $attributes + ['placeholder' => ts('Optional')]); $this->add('wysiwyg', 'email_comment', ts('If you would like to add personal message to email please add it here. (If sending to more then one receipient the same message will be sent to each contact.)'), [ 'rows' => 2, 'cols' => 40, @@ -210,7 +218,7 @@ public static function printPDF($contribIDs, &$params, $contactIds) { $pendingStatusId = CRM_Utils_Array::key('Pending', $contributionStatusID); foreach ($invoiceElements['details'] as $contribID => $detail) { - $input = $ids = $objects = []; + $input = $ids = []; if (in_array($detail['contact'], $invoiceElements['excludeContactIds'])) { continue; } @@ -225,11 +233,10 @@ public static function printPDF($contribIDs, &$params, $contactIds) { $ids['participant'] = $detail['participant'] ?? NULL; $ids['event'] = $detail['event'] ?? NULL; - if (!$invoiceElements['baseIPN']->validateData($input, $ids, $objects, FALSE)) { - CRM_Core_Error::statusBounce('Supplied data was not able to be validated'); - } - - $contribution = &$objects['contribution']; + $contribution = new CRM_Contribute_BAO_Contribution(); + $contribution->id = $contribID; + $contribution->fetch(); + $contribution->loadRelatedObjects($input, $ids, TRUE); $input['amount'] = $contribution->total_amount; $input['invoice_id'] = $contribution->invoice_id; @@ -237,8 +244,6 @@ public static function printPDF($contribIDs, &$params, $contactIds) { $input['contribution_status_id'] = $contribution->contribution_status_id; $input['organization_name'] = $contribution->_relatedObjects['contact']->organization_name; - $objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date); - // Fetch the billing address. getValues should prioritize the billing // address, otherwise will return the primary address. $billingAddress = []; @@ -413,6 +418,34 @@ public static function printPDF($contribIDs, &$params, $contactIds) { // from email address $fromEmailAddress = $params['from_email_address'] ?? NULL; + if (!empty($params['cc_id'])) { + // get contacts and their emails from email id + $emailIDs = $params['cc_id'] ? explode(',', $params['cc_id']) : []; + $emails = Email::get() + ->addWhere('id', 'IN', $emailIDs) + ->setCheckPermissions(FALSE) + ->setSelect(['contact_id', 'email', 'contact.sort_name', 'contact.display_name'])->execute(); + $emailStrings = $contactUrlStrings = []; + foreach ($emails as $email) { + $emailStrings[] = '"' . $email['contact.sort_name'] . '" <' . $email['email'] . '>'; + // generate the contact url to put in Activity + $contactURL = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'force' => 1, 'cid' => $email['contact_id']], TRUE); + $contactUrlStrings[] = "" . $email['contact.display_name'] . ''; + } + $cc_emails = implode(',', $emailStrings); + $values['cc_receipt'] = $cc_emails; + $ccContactsDetails = implode(',', $contactUrlStrings); + // add CC emails as activity details + $params['activity_details'] = "\ncc : " . $ccContactsDetails; + + // unset bcc to avoid unknown email come from online page configuration. + unset($values['bcc_receipt']); + } + + // get subject from UI + if (!empty($params['subject'])) { + $sendTemplateParams['subject'] = $values['subject'] = $params['subject']; + } // condition to check for download PDF Invoice or email Invoice if ($invoiceElements['createPdf']) { @@ -445,7 +478,12 @@ public static function printPDF($contribIDs, &$params, $contactIds) { list($sent, $subject, $message, $html) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams); // functions call for adding activity with attachment - $fileName = self::putFile($html, $pdfFileName); + // make sure page layout is same for email and download invoices. + $fileName = self::putFile($html, $pdfFileName, [ + 'margin_top' => 10, + 'margin_left' => 65, + 'metric' => 'px', + ]); self::addActivities($subject, $contribution->contact_id, $fileName, $params, $contribution->id); } elseif ($contribution->_component == 'event') { @@ -535,6 +573,7 @@ public static function addActivities($subject, $contactIds, $fileName, $params, 'target_contact_id' => $contactIds, 'activity_type_id' => $activityType, 'activity_date_time' => date('YmdHis'), + 'details' => $params['activity_details'] ?? NULL, 'attachFile_1' => [ 'uri' => $fileName, 'type' => 'application/pdf', diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index e05ebab9d5a8..7b99516a88b9 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -142,12 +142,12 @@ public function postProcess() { $elements = self::getElements($this->_contributionIds, $params, $this->_contactIds); foreach ($elements['details'] as $contribID => $detail) { - $input = $ids = $objects = []; + $input = $ids = []; if (in_array($detail['contact'], $elements['excludeContactIds'])) { continue; } - + // @todo - CRM_Contribute_BAO_Contribution::sendMail re-does pretty much everything between here & when we call it. $input['component'] = $detail['component']; $ids['contact'] = $detail['contact']; @@ -158,11 +158,9 @@ public function postProcess() { $ids['participant'] = $detail['participant'] ?? NULL; $ids['event'] = $detail['event'] ?? NULL; - if (!$elements['baseIPN']->validateData($input, $ids, $objects, FALSE)) { - throw new CRM_Core_Exception('invalid data'); - } - - $contribution = &$objects['contribution']; + $contribution = new CRM_Contribute_BAO_Contribution(); + $contribution->id = $contribID; + $contribution->fetch(); // set some fake input values so we can reuse IPN code $input['amount'] = $contribution->total_amount; @@ -181,9 +179,6 @@ public function postProcess() { 1 => [$contribution->trxn_id, 'String'], ]); - // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date - $objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date); - if (isset($params['from_email_address']) && !$elements['createPdf']) { // If a logged in user from email is used rather than a domain wide from email address // the from_email_address params key will be numerical and we need to convert it to be @@ -195,7 +190,7 @@ public function postProcess() { $input['receipt_from_name'] = str_replace('"', '', $fromDetails[0]); } - $mail = CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $objects['contribution']->id, $elements['createPdf']); + $mail = CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $contribID, $elements['createPdf']); if ($mail['html']) { $message[] = $mail['html']; diff --git a/CRM/Contribute/Form/Task/SearchTaskHookSample.php b/CRM/Contribute/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 0e081647bb22..000000000000 --- a/CRM/Contribute/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,68 +0,0 @@ -_contributionIds); - - $query = " - SELECT co.total_amount as amount, - co.receive_date as receive_date, - co.source as source, - ct.display_name as display_name - FROM civicrm_contribution co -INNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id ) - WHERE co.id IN ( $contribIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'amount' => $dao->amount, - 'source' => $dao->source, - 'receive_date' => $dao->receive_date, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Contribute/Form/UpdateSubscription.php b/CRM/Contribute/Form/UpdateSubscription.php index 51e218b99f3b..31e16f76cff9 100644 --- a/CRM/Contribute/Form/UpdateSubscription.php +++ b/CRM/Contribute/Form/UpdateSubscription.php @@ -131,7 +131,6 @@ public function setDefaultValues() { $this->_defaults['installments'] = $this->_subscriptionDetails->installments; $this->_defaults['campaign_id'] = $this->_subscriptionDetails->campaign_id; $this->_defaults['financial_type_id'] = $this->_subscriptionDetails->financial_type_id; - $this->_defaults['is_notify'] = 1; foreach ($this->editableScheduleFields as $field) { $this->_defaults[$field] = $this->_subscriptionDetails->$field ?? NULL; } diff --git a/CRM/Contribute/Import/Form/DataSource.php b/CRM/Contribute/Import/Form/DataSource.php index f1c72357c7bf..6833eafd0e25 100644 --- a/CRM/Contribute/Import/Form/DataSource.php +++ b/CRM/Contribute/Import/Form/DataSource.php @@ -38,7 +38,10 @@ public function buildQuickForm() { $this->setDefaults(['onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP]); - $this->addElement('submit', 'loadMapping', ts('Load Mapping'), NULL, ['onclick' => 'checkSelect()']); + $this->addElement('xbutton', 'loadMapping', ts('Load Mapping'), [ + 'type' => 'submit', + 'onclick' => 'checkSelect()', + ]); $this->addContactTypeSelector(); } diff --git a/CRM/Core/BAO/Address.php b/CRM/Core/BAO/Address.php index ea7da9440c15..fdbf08fe6b38 100644 --- a/CRM/Core/BAO/Address.php +++ b/CRM/Core/BAO/Address.php @@ -29,82 +29,15 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { * True if you need to fix (format) address values. * before inserting in db * - * @param null $entity - * - * @return array|NULL + * @return array|NULL|self * array of created address */ - public static function create(&$params, $fixAddress = TRUE, $entity = NULL) { + public static function create(&$params, $fixAddress = TRUE) { if (!isset($params['address']) || !is_array($params['address'])) { - return NULL; - } - CRM_Core_BAO_Block::sortPrimaryFirst($params['address']); - $addresses = []; - $contactId = NULL; - - $updateBlankLocInfo = CRM_Utils_Array::value('updateBlankLocInfo', $params, FALSE); - if (!$entity) { - $contactId = $params['contact_id']; - //get all the addresses for this contact - $addresses = self::allAddress($contactId); - } - else { - // get all address from location block - $entityElements = [ - 'entity_table' => $params['entity_table'], - 'entity_id' => $params['entity_id'], - ]; - $addresses = self::allEntityAddress($entityElements); - } - - $isPrimary = $isBilling = TRUE; - $blocks = []; - foreach ($params['address'] as $key => $value) { - if (!is_array($value)) { - continue; - } - - $addressExists = self::dataExists($value); - if (empty($value['id'])) { - if (!empty($addresses) && !empty($value['location_type_id']) && array_key_exists($value['location_type_id'], $addresses)) { - $value['id'] = $addresses[$value['location_type_id']]; - } - } - - // Note there could be cases when address info already exist ($value[id] is set) for a contact/entity - // BUT info is not present at this time, and therefore we should be really careful when deleting the block. - // $updateBlankLocInfo will help take appropriate decision. CRM-5969 - if (isset($value['id']) && !$addressExists && $updateBlankLocInfo) { - //delete the existing record - CRM_Core_BAO_Block::blockDelete('Address', ['id' => $value['id']]); - continue; - } - elseif (!$addressExists) { - continue; - } - - if ($isPrimary && !empty($value['is_primary'])) { - $isPrimary = FALSE; - } - else { - $value['is_primary'] = 0; - } - - if ($isBilling && !empty($value['is_billing'])) { - $isBilling = FALSE; - } - else { - $value['is_billing'] = 0; - } - - if (empty($value['manual_geo_code'])) { - $value['manual_geo_code'] = 0; - } - $value['contact_id'] = $contactId; - $blocks[] = self::add($value, $fixAddress); + return self::add($params, $fixAddress); } - - return $blocks; + CRM_Core_Error::deprecatedFunctionWarning('Use legacyCreate if not doing a single crud action'); + return self::legacyCreate($params, $fixAddress); } /** @@ -131,10 +64,7 @@ public static function add(&$params, $fixAddress = FALSE) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'Address', CRM_Utils_Array::value('id', $params), $params); - // if id is set & is_primary isn't we can assume no change - if (is_numeric(CRM_Utils_Array::value('is_primary', $params)) || empty($params['id'])) { - CRM_Core_BAO_Block::handlePrimary($params, get_class()); - } + CRM_Core_BAO_Block::handlePrimary($params, get_class()); // (prevent chaining 1 and 3) CRM-21214 if (isset($params['master_id']) && !CRM_Utils_System::isNull($params['master_id'])) { @@ -1382,4 +1312,73 @@ public static function addGeocoderData(&$params) { return TRUE; } + /** + * Create multiple addresses using legacy methodology. + * + * @param array $params + * @param bool $fixAddress + * + * @return array|null + */ + public static function legacyCreate(array $params, bool $fixAddress) { + if (!isset($params['address']) || !is_array($params['address'])) { + return NULL; + } + CRM_Core_BAO_Block::sortPrimaryFirst($params['address']); + $contactId = NULL; + + $updateBlankLocInfo = CRM_Utils_Array::value('updateBlankLocInfo', $params, FALSE); + $contactId = $params['contact_id']; + //get all the addresses for this contact + $addresses = self::allAddress($contactId); + + $isPrimary = $isBilling = TRUE; + $blocks = []; + foreach ($params['address'] as $key => $value) { + if (!is_array($value)) { + continue; + } + + $addressExists = self::dataExists($value); + if (empty($value['id'])) { + if (!empty($addresses) && !empty($value['location_type_id']) && array_key_exists($value['location_type_id'], $addresses)) { + $value['id'] = $addresses[$value['location_type_id']]; + } + } + + // Note there could be cases when address info already exist ($value[id] is set) for a contact/entity + // BUT info is not present at this time, and therefore we should be really careful when deleting the block. + // $updateBlankLocInfo will help take appropriate decision. CRM-5969 + if (isset($value['id']) && !$addressExists && $updateBlankLocInfo) { + //delete the existing record + CRM_Core_BAO_Block::blockDelete('Address', ['id' => $value['id']]); + continue; + } + elseif (!$addressExists) { + continue; + } + + if ($isPrimary && !empty($value['is_primary'])) { + $isPrimary = FALSE; + } + else { + $value['is_primary'] = 0; + } + + if ($isBilling && !empty($value['is_billing'])) { + $isBilling = FALSE; + } + else { + $value['is_billing'] = 0; + } + + if (empty($value['manual_geo_code'])) { + $value['manual_geo_code'] = 0; + } + $value['contact_id'] = $contactId; + $blocks[] = self::add($value, $fixAddress); + } + return $blocks; + } + } diff --git a/CRM/Core/BAO/Block.php b/CRM/Core/BAO/Block.php index 0689b0a495bd..18725f489be6 100644 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@ -131,20 +131,15 @@ public static function dataExists($blockFields, &$params) { * Check if the current block exits. * * @param string $blockName - * Bloack name. + * Block name. * @param array $params - * Associated array of submitted fields. + * Array of submitted fields. * * @return bool - * true if the block exits, otherwise false + * true if the block is in the params and is an array */ - public static function blockExists($blockName, &$params) { - // return if no data present - if (empty($params[$blockName]) || !is_array($params[$blockName])) { - return FALSE; - } - - return TRUE; + public static function blockExists($blockName, $params) { + return !empty($params[$blockName]) && is_array($params[$blockName]); } /** @@ -197,14 +192,12 @@ public static function getBlockIds($blockName, $contactId = NULL, $entityElement * @param string $blockName * Block name. * @param array $params - * (reference ) an assoc array of name/value pairs. - * @param null $entity - * @param int $contactId + * Array of name/value pairs. * - * @return object - * CRM_Core_BAO_Block object on success, null otherwise + * @return array|null + * Array of created location entities or NULL if none to create. */ - public static function create($blockName, &$params, $entity = NULL, $contactId = NULL) { + public static function create($blockName, $params) { if (!self::blockExists($blockName, $params)) { return NULL; } @@ -215,15 +208,7 @@ public static function create($blockName, &$params, $entity = NULL, $contactId = $resetPrimaryId = NULL; $primaryId = FALSE; - if ($entity) { - $entityElements = [ - 'entity_table' => $params['entity_table'], - 'entity_id' => $params['entity_id'], - ]; - } - else { - $contactId = $params['contact_id']; - } + $contactId = $params['contact_id']; $updateBlankLocInfo = CRM_Utils_Array::value('updateBlankLocInfo', $params, FALSE); $isIdSet = CRM_Utils_Array::value('isIdSet', $params[$blockName], FALSE); @@ -264,7 +249,7 @@ public static function create($blockName, &$params, $entity = NULL, $contactId = } } } - + $baoString = 'CRM_Core_BAO_' . $name; foreach ($params[$blockName] as $count => $value) { if (!is_array($value)) { continue; @@ -304,7 +289,7 @@ public static function create($blockName, &$params, $entity = NULL, $contactId = // $updateBlankLocInfo will help take appropriate decision. CRM-5969 if (!empty($value['id']) && !$dataExists && $updateBlankLocInfo) { //delete the existing record - self::blockDelete($blockName, ['id' => $value['id']]); + $baoString::del($value['id']); continue; } elseif (!$dataExists) { @@ -328,18 +313,7 @@ public static function create($blockName, &$params, $entity = NULL, $contactId = } $blockFields = array_merge($value, $contactFields); - if ($name === 'Email') { - // @todo ideally all would call the api which is our main tested function, - // and towards that call the create rather than add which is preferred by the - // api. In order to be careful with change only email is swapped over here because it - // is specifically tested in testImportParserWithUpdateWithContactID - // and the primary handling is otherwise bypassed on importing an email update. - $blocks[] = CRM_Core_BAO_Email::create($blockFields); - } - else { - $baoString = 'CRM_Core_BAO_' . $name; - $blocks[] = $baoString::add($blockFields); - } + $blocks[] = $baoString::create($blockFields); } return $blocks; @@ -347,6 +321,7 @@ public static function create($blockName, &$params, $entity = NULL, $contactId = /** * Delete block. + * @deprecated - just call the BAO / api directly. * * @param string $blockName * Block name. @@ -362,15 +337,8 @@ public static function blockDelete($blockName, $params) { $name = 'OpenID'; } - $baoString = 'CRM_Core_DAO_' . $name; - $block = new $baoString(); - - $block->copyValues($params); - - // CRM-11006 add call to pre and post hook for delete action - CRM_Utils_Hook::pre('delete', $name, $block->id, CRM_Core_DAO::$_nullArray); - $block->delete(); - CRM_Utils_Hook::post('delete', $name, $block->id, $block); + $baoString = 'CRM_Core_BAO_' . $name; + $baoString::del($params['id']); } /** @@ -393,6 +361,10 @@ public static function blockDelete($blockName, $params) { * @throws API_Exception */ public static function handlePrimary(&$params, $class) { + if (isset($params['id']) && CRM_Utils_System::isNull($params['is_primary'] ?? NULL)) { + // if id is set & is_primary isn't we can assume no change) + return; + } $table = CRM_Core_DAO_AllCoreTables::getTableForClass($class); if (!$table) { throw new API_Exception("Failed to locate table for class [$class]"); diff --git a/CRM/Core/BAO/ConfigSetting.php b/CRM/Core/BAO/ConfigSetting.php index 45e037897490..54ad2e1a74d1 100644 --- a/CRM/Core/BAO/ConfigSetting.php +++ b/CRM/Core/BAO/ConfigSetting.php @@ -178,7 +178,7 @@ public static function applyLocale($settings, $activatedLocales) { * If the language is specified via "lcMessages" we skip this, since the * intention of the URL query var is to override all other sources. */ - if ($settings->get('inheritLocale') && empty($chosenLocale)) { + if ($settings->get('inheritLocale')) { /* * FIXME: On multi-language installs, CRM_Utils_System::getUFLocale() in diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 66871a7d5d8e..d5a8e326c241 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -157,13 +157,13 @@ public static function bulkSave($bulkParams, $defaults = []) { * Fetch object based on array of properties. * * @param array $params - * (reference ) an assoc array of name/value pairs. + * An assoc array of name/value pairs. * @param array $defaults * (reference ) an assoc array to hold the flattened values. * * @return CRM_Core_DAO_CustomField */ - public static function retrieve(&$params, &$defaults) { + public static function retrieve($params, &$defaults) { return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $params, $defaults); } @@ -250,7 +250,9 @@ public static function buildOptions($fieldName, $context = NULL, $props = []) { // This provides legacy support for APIv3, allowing no-longer-existent html types if ($fieldName == 'html_type' && isset($props['version']) && $props['version'] == 3) { $options['Multi-Select'] = 'Multi-Select'; + $options['Select Country'] = 'Select Country'; $options['Multi-Select Country'] = 'Multi-Select Country'; + $options['Select State/Province'] = 'Select State/Province'; $options['Multi-Select State/Province'] = 'Multi-Select State/Province'; } return $options; @@ -665,114 +667,97 @@ public static function addQuickFormElement( $element = NULL; $customFieldAttributes = []; + if (!isset($label)) { + $label = $field->label; + } + + // DAO stores attributes as a string, but it's hard to manipulate and + // CRM_Core_Form::add() wants them as an array. + $fieldAttributes = self::attributesFromString($field->attributes); + // Custom field HTML should indicate group+field name $groupName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $field->custom_group_id); - $dataCrmCustomVal = $groupName . ':' . $field->name; - $dataCrmCustomAttr = 'data-crm-custom="' . $dataCrmCustomVal . '"'; - $field->attributes .= $dataCrmCustomAttr; + $fieldAttributes['data-crm-custom'] = $groupName . ':' . $field->name; // Fixed for Issue CRM-2183 if ($widget == 'TextArea' && $search) { $widget = 'Text'; } - $placeholder = $search ? ts('- any -') : ($useRequired ? ts('- select -') : ts('- none -')); + $placeholder = $search ? ts('- any %1 -', [1 => $label]) : ts('- select %1 -', [1 => $label]); - // FIXME: Why are select state/country separate widget types? - $isSelect = (in_array($widget, [ + if (in_array($widget, [ 'Select', - 'Select State/Province', - 'Select Country', 'CheckBox', 'Radio', - ])); - - if ($isSelect) { + ])) { $options = $field->getOptions($search ? 'search' : 'create'); // Consolidate widget types to simplify the below switch statement - if ($search || (strpos($widget, 'Select') !== FALSE)) { + if ($search) { $widget = 'Select'; } - $customFieldAttributes['data-crm-custom'] = $dataCrmCustomVal; - $selectAttributes = ['class' => 'crm-select2']; - // Search field is always multi-select if ($search || (self::isSerialized($field) && $widget === 'Select')) { - $selectAttributes['class'] .= ' huge'; - $selectAttributes['multiple'] = 'multiple'; - $selectAttributes['placeholder'] = $placeholder; + $fieldAttributes['class'] = ltrim(($fieldAttributes['class'] ?? '') . ' huge'); + $fieldAttributes['multiple'] = 'multiple'; + $fieldAttributes['placeholder'] = $placeholder; } // Add data for popup link. Normally this is handled by CRM_Core_Form->addSelect $canEditOptions = CRM_Core_Permission::check('administer CiviCRM'); - if ($field->option_group_id && !$search && $isSelect && $canEditOptions) { + if ($field->option_group_id && !$search && $canEditOptions) { $customFieldAttributes += [ 'data-api-entity' => $field->getEntity(), 'data-api-field' => 'custom_' . $field->id, 'data-option-edit-path' => 'civicrm/admin/options/' . CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $field->option_group_id), ]; - $selectAttributes += $customFieldAttributes; + $fieldAttributes = array_merge($fieldAttributes, $customFieldAttributes); } } $rangeDataTypes = ['Int', 'Float', 'Money']; - if (!isset($label)) { - $label = $field->label; - } - // at some point in time we might want to split the below into small functions switch ($widget) { case 'Text': case 'Link': if ($field->is_search_range && $search && in_array($field->data_type, $rangeDataTypes)) { - $qf->add('text', $elementName . '_from', $label . ' ' . ts('From'), $field->attributes); - $qf->add('text', $elementName . '_to', ts('To'), $field->attributes); + $qf->add('text', $elementName . '_from', $label . ' ' . ts('From'), $fieldAttributes); + $qf->add('text', $elementName . '_to', ts('To'), $fieldAttributes); } else { if ($field->text_length) { - $field->attributes .= ' maxlength=' . $field->text_length; + $fieldAttributes['maxlength'] = $field->text_length; if ($field->text_length < 20) { - $field->attributes .= ' size=' . $field->text_length; + $fieldAttributes['size'] = $field->text_length; } } $element = $qf->add('text', $elementName, $label, - $field->attributes, + $fieldAttributes, $useRequired && !$search ); } break; case 'TextArea': - $attributes = $dataCrmCustomAttr; - if ($field->note_rows) { - $attributes .= 'rows=' . $field->note_rows; - } - else { - $attributes .= 'rows=4'; - } - if ($field->note_columns) { - $attributes .= ' cols=' . $field->note_columns; - } - else { - $attributes .= ' cols=60'; - } + $fieldAttributes['rows'] = $field->note_rows ?? 4; + $fieldAttributes['cols'] = $field->note_columns ?? 60; + if ($field->text_length) { - $attributes .= ' maxlength=' . $field->text_length; + $fieldAttributes['maxlength'] = $field->text_length; } $element = $qf->add('textarea', $elementName, $label, - $attributes, + $fieldAttributes, $useRequired && !$search ); break; case 'Select Date': - $attr = ['data-crm-custom' => $dataCrmCustomVal]; //CRM-18379: Fix for date range of 'Select Date' custom field when include in profile. $minYear = isset($field->start_date_years) ? (date('Y') - $field->start_date_years) : NULL; $maxYear = isset($field->end_date_years) ? (date('Y') + $field->end_date_years) : NULL; @@ -785,40 +770,40 @@ public static function addQuickFormElement( 'time' => $field->time_format ? $field->time_format * 12 : FALSE, ]; if ($field->is_search_range && $search) { - $qf->add('datepicker', $elementName . '_from', $label, $attr + array('placeholder' => ts('From')), FALSE, $params); - $qf->add('datepicker', $elementName . '_to', NULL, $attr + array('placeholder' => ts('To')), FALSE, $params); + $qf->add('datepicker', $elementName . '_from', $label, $fieldAttributes + array('placeholder' => ts('From')), FALSE, $params); + $qf->add('datepicker', $elementName . '_to', NULL, $fieldAttributes + array('placeholder' => ts('To')), FALSE, $params); } else { - $element = $qf->add('datepicker', $elementName, $label, $attr, $useRequired && !$search, $params); + $element = $qf->add('datepicker', $elementName, $label, $fieldAttributes, $useRequired && !$search, $params); } break; case 'Radio': if ($field->is_search_range && $search && in_array($field->data_type, $rangeDataTypes)) { - $qf->add('text', $elementName . '_from', $label . ' ' . ts('From'), $field->attributes); - $qf->add('text', $elementName . '_to', ts('To'), $field->attributes); + $qf->add('text', $elementName . '_from', $label . ' ' . ts('From'), $fieldAttributes); + $qf->add('text', $elementName . '_to', ts('To'), $fieldAttributes); } else { - parse_str($field->attributes, $radioAttributes); - $radioAttributes = array_merge($radioAttributes, $customFieldAttributes); + $fieldAttributes = array_merge($fieldAttributes, $customFieldAttributes); if ($search || empty($useRequired)) { - $radioAttributes['allowClear'] = TRUE; + $fieldAttributes['allowClear'] = TRUE; } - $qf->addRadio($elementName, $label, $options, $radioAttributes, NULL, $useRequired); + $qf->addRadio($elementName, $label, $options, $fieldAttributes, NULL, $useRequired); } break; // For all select elements case 'Select': + $fieldAttributes['class'] = ltrim(($fieldAttributes['class'] ?? '') . ' crm-select2'); if ($field->is_search_range && $search && in_array($field->data_type, $rangeDataTypes)) { - $qf->add('text', $elementName . '_from', $label . ' ' . ts('From'), $field->attributes); - $qf->add('text', $elementName . '_to', ts('To'), $field->attributes); + $qf->add('text', $elementName . '_from', $label . ' ' . ts('From'), $fieldAttributes); + $qf->add('text', $elementName . '_to', ts('To'), $fieldAttributes); } else { - if (empty($selectAttributes['multiple'])) { + if (empty($fieldAttributes['multiple'])) { $options = ['' => $placeholder] + $options; } - $element = $qf->add('select', $elementName, $label, $options, $useRequired && !$search, $selectAttributes); + $element = $qf->add('select', $elementName, $label, $options, $useRequired && !$search, $fieldAttributes); // Add and/or option for fields that store multiple values if ($search && self::isSerialized($field)) { @@ -837,6 +822,9 @@ public static function addQuickFormElement( case 'CheckBox': $check = []; foreach ($options as $v => $l) { + // TODO: I'm not sure if this is supposed to exclude whatever might be + // in $field->attributes (available in array format as + // $fieldAttributes). Leaving as-is for now. $check[] = &$qf->addElement('advcheckbox', $v, NULL, $l, $customFieldAttributes); } @@ -860,44 +848,31 @@ public static function addQuickFormElement( strtolower($field->html_type), $elementName, $label, - $field->attributes, + $fieldAttributes, $useRequired && !$search ); $qf->addUploadElement($elementName); break; case 'RichTextEditor': - $attributes = [ - 'rows' => $field->note_rows, - 'cols' => $field->note_columns, - 'data-crm-custom' => $dataCrmCustomVal, - ]; + $fieldAttributes['rows'] = $field->note_rows; + $fieldAttributes['cols'] = $field->note_columns; if ($field->text_length) { - $attributes['maxlength'] = $field->text_length; + $fieldAttributes['maxlength'] = $field->text_length; } - $element = $qf->add('wysiwyg', $elementName, $label, $attributes, $useRequired && !$search); + $element = $qf->add('wysiwyg', $elementName, $label, $fieldAttributes, $useRequired && !$search); break; case 'Autocomplete-Select': static $customUrls = []; - // Fixme: why is this a string in the first place?? - $attributes = []; - if ($field->attributes) { - foreach (explode(' ', $field->attributes) as $at) { - if (strpos($at, '=')) { - list($k, $v) = explode('=', $at); - $attributes[$k] = trim($v, ' "'); - } - } - } if ($field->data_type == 'ContactReference') { // break if contact does not have permission to access ContactReference if (!CRM_Core_Permission::check('access contact reference fields')) { break; } - $attributes['class'] = (isset($attributes['class']) ? $attributes['class'] . ' ' : '') . 'crm-form-contact-reference huge'; - $attributes['data-api-entity'] = 'Contact'; - $element = $qf->add('text', $elementName, $label, $attributes, $useRequired && !$search); + $fieldAttributes['class'] = ltrim(($fieldAttributes['class'] ?? '') . ' crm-form-contact-reference huge'); + $fieldAttributes['data-api-entity'] = 'Contact'; + $element = $qf->add('text', $elementName, $label, $fieldAttributes, $useRequired && !$search); $urlParams = "context=customfield&id={$field->id}"; $idOfelement = $elementName; @@ -916,7 +891,7 @@ public static function addQuickFormElement( } else { // FIXME: This won't work with customFieldOptions hook - $attributes += [ + $fieldAttributes += [ 'entity' => 'OptionValue', 'placeholder' => $placeholder, 'multiple' => $search, @@ -924,7 +899,7 @@ public static function addQuickFormElement( 'params' => ['option_group_id' => $field->option_group_id, 'is_active' => 1], ], ]; - $element = $qf->addEntityRef($elementName, $label, $attributes, $useRequired && !$search); + $element = $qf->addEntityRef($elementName, $label, $fieldAttributes, $useRequired && !$search); } $qf->assign('customUrls', $customUrls); @@ -974,6 +949,27 @@ public static function addQuickFormElement( return $element; } + /** + * Take a string of HTML element attributes and turn it into an associative + * array. + * + * @param string $attrString + * The attributes as a string, e.g. `rows=3 cols=40`. + * + * @return array + * The attributes as an array, e.g. `['rows' => 3, 'cols' => 40]`. + */ + public static function attributesFromString($attrString) { + $attributes = []; + foreach (explode(' ', $attrString) as $at) { + if (strpos($at, '=')) { + list($k, $v) = explode('=', $at); + $attributes[$k] = trim($v, ' "'); + } + } + return $attributes; + } + /** * Delete the Custom Field. * @@ -1057,8 +1053,6 @@ private static function formatDisplayValue($value, $field, $entityId = NULL) { case 'Select': case 'Autocomplete-Select': case 'Radio': - case 'Select Country': - case 'Select State/Province': case 'CheckBox': if ($field['data_type'] == 'ContactReference' && $value) { if (is_numeric($value)) { @@ -1613,10 +1607,15 @@ public static function formatCustomField( */ public static function defaultCustomTableSchema($params) { // add the id and extends_id + $collation = CRM_Core_BAO_SchemaHandler::getInUseCollation(); + $characterSet = 'utf8'; + if (stripos($collation, 'utf8mb4') !== FALSE) { + $characterSet = 'utf8mb4'; + } $table = [ 'name' => $params['name'], 'is_multiple' => $params['is_multiple'], - 'attributes' => "ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci", + 'attributes' => "ENGINE=InnoDB DEFAULT CHARACTER SET {$characterSet} COLLATE {$collation}", 'fields' => [ [ 'name' => 'id', @@ -1699,6 +1698,25 @@ public static function getAlterFieldSQL($field, $operation) { return CRM_Core_BAO_SchemaHandler::getFieldAlterSQL($params, $indexExist); } + /** + * Reformat existing values for a field when changing its serialize attribute + * + * @param CRM_Core_DAO_CustomField $field + * @throws CRM_Core_Exception + */ + private static function alterSerialize($field) { + $table = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $field->custom_group_id, 'table_name'); + $col = $field->column_name; + $sp = CRM_Core_DAO::VALUE_SEPARATOR; + if ($field->serialize) { + $sql = "UPDATE `$table` SET `$col` = CONCAT('$sp', `$col`, '$sp') WHERE `$col` IS NOT NULL AND `$col` NOT LIKE '$sp%' AND `$col` != ''"; + } + else { + $sql = "UPDATE `$table` SET `$col` = SUBSTRING_INDEX(SUBSTRING(`$col`, 2), '$sp', 1) WHERE `$col` LIKE '$sp%'"; + } + CRM_Core_DAO::executeQuery($sql); + } + /** * Determine whether it would be safe to move a field. * @@ -1992,6 +2010,9 @@ protected static function createCustomFieldRecord($params) { $transaction = new CRM_Core_Transaction(); $params = self::prepareCreate($params); + $alterSerialize = isset($params['serialize']) && !empty($params['id']) + && ($params['serialize'] != CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $params['id'], 'serialize')); + $customField = new CRM_Core_DAO_CustomField(); $customField->copyValues($params); $customField->save(); @@ -2011,6 +2032,11 @@ protected static function createCustomFieldRecord($params) { // make sure all values are present in the object for further processing $customField->find(TRUE); + + if ($alterSerialize) { + self::alterSerialize($customField); + } + return $customField; } diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 3a0dac33f161..52a96839fb92 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1121,53 +1121,16 @@ public static function &getActiveGroups($entityType, $path, $cidToken = '%%cid%% * @see _apachesolr_civiAttachments_dereference_file_parent */ public static function getTableNameByEntityName($entityType) { - $tableName = ''; switch ($entityType) { case 'Contact': case 'Individual': case 'Household': case 'Organization': - $tableName = 'civicrm_contact'; - break; - - case 'Contribution': - $tableName = 'civicrm_contribution'; - break; - - case 'Group': - $tableName = 'civicrm_group'; - break; - - // DRAFTING: Verify if we cannot make it pluggable - - case 'Activity': - $tableName = 'civicrm_activity'; - break; - - case 'Relationship': - $tableName = 'civicrm_relationship'; - break; - - case 'Membership': - $tableName = 'civicrm_membership'; - break; - - case 'Participant': - $tableName = 'civicrm_participant'; - break; - - case 'Event': - $tableName = 'civicrm_event'; - break; - - case 'Grant': - $tableName = 'civicrm_grant'; - break; + return 'civicrm_contact'; - // need to add cases for Location, Address + default: + return CRM_Core_DAO_AllCoreTables::getTableForEntityName($entityType); } - - return $tableName; } /** diff --git a/CRM/Core/BAO/Email.php b/CRM/Core/BAO/Email.php index 0dd1bca05a49..aa0fdc956a88 100644 --- a/CRM/Core/BAO/Email.php +++ b/CRM/Core/BAO/Email.php @@ -31,33 +31,11 @@ class CRM_Core_BAO_Email extends CRM_Core_DAO_Email { * @return object */ public static function create($params) { - // if id is set & is_primary isn't we can assume no change - if (is_numeric(CRM_Utils_Array::value('is_primary', $params)) || empty($params['id'])) { - CRM_Core_BAO_Block::handlePrimary($params, get_class()); - } - - $email = CRM_Core_BAO_Email::add($params); + CRM_Core_BAO_Block::handlePrimary($params, get_class()); - return $email; - } - - /** - * Takes an associative array and adds email. - * - * @param array $params - * (reference ) an assoc array of name/value pairs. - * - * @return object - * CRM_Core_BAO_Email object on success, null otherwise - */ - public static function add(&$params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'Email', CRM_Utils_Array::value('id', $params), $params); - if (isset($params['is_bulkmail']) && $params['is_bulkmail'] === 'null') { - CRM_Core_Error::deprecatedFunctionWarning('It is not valid to set bulkmail to null, it is boolean'); - $params['bulkmail'] = 0; - } $email = new CRM_Core_DAO_Email(); $email->copyValues($params); if (!empty($email->email)) { @@ -98,6 +76,20 @@ public static function add(&$params) { return $email; } + /** + * Takes an associative array and adds email. + * + * @param array $params + * (reference ) an assoc array of name/value pairs. + * + * @return object + * CRM_Core_BAO_Email object on success, null otherwise + */ + public static function add(&$params) { + CRM_Core_Error::deprecatedFunctionWarning('apiv4 create'); + return self::create($params); + } + /** * Given the list of params in the params array, fetch the object * and store the values in the values array diff --git a/CRM/Core/BAO/IM.php b/CRM/Core/BAO/IM.php index 3a950122dd68..bca4ce1365df 100644 --- a/CRM/Core/BAO/IM.php +++ b/CRM/Core/BAO/IM.php @@ -24,12 +24,32 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { * Create or update IM record. * * @param array $params - * @return CRM_Core_DAO_IM + * + * @return \CRM_Core_DAO|\CRM_Core_DAO_IM + * @throws \CRM_Core_Exception + * @throws \API_Exception */ - public static function add($params) { + public static function create($params) { + CRM_Core_BAO_Block::handlePrimary($params, __CLASS__); return self::writeRecord($params); } + /** + * Create or update IM record. + * + * @deprecated + * + * @param array $params + * + * @return \CRM_Core_DAO|\CRM_Core_DAO_IM + * @throws \CRM_Core_Exception + * @throws \API_Exception + */ + public static function add($params) { + CRM_Core_Error::deprecatedFunctionWarning('use the v4 api'); + return self::create($params); + } + /** * Given the list of params in the params array, fetch the object * and store the values in the values array diff --git a/CRM/Core/BAO/Location.php b/CRM/Core/BAO/Location.php index 6af1d85bc8cf..fd1545efe911 100644 --- a/CRM/Core/BAO/Location.php +++ b/CRM/Core/BAO/Location.php @@ -35,11 +35,9 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO { * True if you need to fix (format) address values. * before inserting in db * - * @param null $entity - * * @return array */ - public static function create(&$params, $fixAddress = TRUE, $entity = NULL) { + public static function create(&$params, $fixAddress = TRUE) { $location = []; if (!self::dataExists($params)) { return $location; @@ -47,31 +45,20 @@ public static function create(&$params, $fixAddress = TRUE, $entity = NULL) { // create location blocks. foreach (self::$blocks as $block) { - if ($block != 'address') { - $location[$block] = CRM_Core_BAO_Block::create($block, $params, $entity); + if ($block !== 'address') { + $location[$block] = CRM_Core_BAO_Block::create($block, $params); } - else { - $location[$block] = CRM_Core_BAO_Address::create($params, $fixAddress, $entity); + elseif (is_array($params['address'] ?? NULL)) { + $location[$block] = CRM_Core_BAO_Address::legacyCreate($params, $fixAddress); } } - if ($entity) { - // this is a special case for adding values in location block table - $entityElements = [ - 'entity_table' => $params['entity_table'], - 'entity_id' => $params['entity_id'], - ]; - - $location['id'] = self::createLocBlock($location, $entityElements); - } - else { - // when we come from a form which displays all the location elements (like the edit form or the inline block - // elements, we can skip the below check. The below check adds quite a feq queries to an already overloaded - // form - if (empty($params['updateBlankLocInfo'])) { - // make sure contact should have only one primary block, CRM-5051 - self::checkPrimaryBlocks(CRM_Utils_Array::value('contact_id', $params)); - } + // when we come from a form which displays all the location elements (like the edit form or the inline block + // elements, we can skip the below check. The below check adds quite a feq queries to an already overloaded + // form + if (empty($params['updateBlankLocInfo'])) { + // make sure contact should have only one primary block, CRM-5051 + self::checkPrimaryBlocks(CRM_Utils_Array::value('contact_id', $params)); } return $location; @@ -80,12 +67,13 @@ public static function create(&$params, $fixAddress = TRUE, $entity = NULL) { /** * Creates the entry in the civicrm_loc_block. * - * @param string $location + * @param array $location * @param array $entityElements * * @return int */ - public static function createLocBlock(&$location, &$entityElements) { + public static function createLocBlock($location, $entityElements) { + CRM_Core_Error::deprecatedFunctionWarning('Use LocBlock api'); $locId = self::findExisting($entityElements); $locBlock = []; @@ -116,8 +104,7 @@ public static function createLocBlock(&$location, &$entityElements) { return NULL; } - $locBlockInfo = self::addLocBlock($locBlock); - return $locBlockInfo->id; + return self::addLocBlock($locBlock)->id; } /** @@ -147,17 +134,15 @@ public static function findExisting($entityElements) { * Takes an associative array and adds location block. * * @param array $params - * (reference ) an assoc array of name/value pairs. * - * @return CRM_Core_BAO_locBlock + * @return CRM_Core_DAO_LocBlock * Object on success, null otherwise */ - public static function addLocBlock(&$params) { + public static function addLocBlock($params) { $locBlock = new CRM_Core_DAO_LocBlock(); - $locBlock->copyValues($params); - - return $locBlock->save(); + $locBlock->save(); + return $locBlock; } /** diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index e2e0e7057a29..3c9bf18beaa7 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -318,8 +318,12 @@ public static function buildMappingForm(&$form, $mappingId, $columnNo, $blockCou $hasRelationTypes = []; $columnCount = $columnNo; - $form->addElement('submit', 'addBlock', ts('Also include contacts where'), - ['class' => 'submit-link'] + $form->addElement('xbutton', 'addBlock', ts('Also include contacts where'), + [ + 'type' => 'submit', + 'class' => 'submit-link', + 'value' => 1, + ] ); $contactTypes = CRM_Contact_BAO_ContactType::basicTypes(); @@ -553,7 +557,11 @@ public static function buildMappingForm(&$form, $mappingId, $columnNo, $blockCou $form->add('text', "value[$x][$i]", ''); } - $form->addElement('submit', "addMore[$x]", ts('Another search field'), ['class' => 'submit-link']); + $form->addElement('xbutton', "addMore[$x]", ts('Another search field'), [ + 'type' => 'submit', + 'class' => 'submit-link', + 'value' => 1, + ]); } //end of block for diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index 4dedb8c66e7d..e32ab9d4cabd 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -238,7 +238,7 @@ public static function sendReminder($contactId, $email, $messageTemplateID, $fro } $params = [['contact_id', '=', $contactId, 0, 0]]; - list($contact, $_) = CRM_Contact_BAO_Query::apiQuery($params); + [$contact] = CRM_Contact_BAO_Query::apiQuery($params); //CRM-4524 $contact = reset($contact); @@ -464,6 +464,11 @@ public static function sendTemplate($params) { $mailContent['html'] = preg_replace('/html}", $mailContent['html']); } + // Overwrite subject from form field + if (!empty($params['subject'])) { + $mailContent['subject'] = $params['subject']; + } + // replace tokens in the three elements (in subject as if it was the text body) $domain = CRM_Core_BAO_Domain::getDomain(); $hookTokens = []; @@ -576,7 +581,7 @@ public static function sendTemplate($params) { if ($params['toEmail']) { $contactParams = [['email', 'LIKE', $params['toEmail'], 0, 1]]; - list($contact, $_) = CRM_Contact_BAO_Query::apiQuery($contactParams); + [$contact] = CRM_Contact_BAO_Query::apiQuery($contactParams); $prefs = array_pop($contact); diff --git a/CRM/Core/BAO/OpenID.php b/CRM/Core/BAO/OpenID.php index 34326a756257..f2000435737d 100644 --- a/CRM/Core/BAO/OpenID.php +++ b/CRM/Core/BAO/OpenID.php @@ -24,12 +24,33 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID { * Create or update OpenID record. * * @param array $params + * * @return CRM_Core_DAO_OpenID + * + * @throws \API_Exception + * @throws \CRM_Core_Exception */ - public static function add($params) { + public static function create($params) { + CRM_Core_BAO_Block::handlePrimary($params, __CLASS__); return self::writeRecord($params); } + /** + * Create or update OpenID record. + * + * @deprecated + * + * @param array $params + * + * @return \CRM_Core_DAO|\CRM_Core_DAO_IM + * @throws \CRM_Core_Exception + * @throws \API_Exception + */ + public static function add($params) { + CRM_Core_Error::deprecatedFunctionWarning('use the v4 api'); + return self::create($params); + } + /** * Given the list of params in the params array, fetch the object * and store the values in the values array @@ -38,28 +59,12 @@ public static function add($params) { * Input parameters to find object. * * @return mixed + * @throws \CRM_Core_Exception */ public static function &getValues($entityBlock) { return CRM_Core_BAO_Block::getValues('openid', $entityBlock); } - /** - * Returns whether or not this OpenID is allowed to login. - * - * @param string $identity_url - * The OpenID to check. - * - * @return bool - */ - public static function isAllowedToLogin($identity_url) { - $openId = new CRM_Core_DAO_OpenID(); - $openId->openid = $identity_url; - if ($openId->find(TRUE)) { - return $openId->allowed_to_login == 1; - } - return FALSE; - } - /** * Get all the openids for a specified contact_id, with the primary openid being first * diff --git a/CRM/Core/BAO/Phone.php b/CRM/Core/BAO/Phone.php index f5851eee26cf..7e5a7eede55f 100644 --- a/CRM/Core/BAO/Phone.php +++ b/CRM/Core/BAO/Phone.php @@ -26,38 +26,35 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * * @param array $params * - * @return object + * @return \CRM_Core_DAO_Phone + * * @throws API_Exception + * @throws \CRM_Core_Exception */ public static function create($params) { // Ensure mysql phone function exists CRM_Core_DAO::checkSqlFunctionsExist(); - - if (is_numeric(CRM_Utils_Array::value('is_primary', $params)) || - // if id is set & is_primary isn't we can assume no change - empty($params['id']) - ) { - CRM_Core_BAO_Block::handlePrimary($params, get_class()); - } - $phone = self::add($params); - - return $phone; + CRM_Core_BAO_Block::handlePrimary($params, get_class()); + return self::writeRecord($params); } /** * Takes an associative array and adds phone. * + * @deprecated use create. + * * @param array $params * (reference ) an assoc array of name/value pairs. * * @return object * CRM_Core_BAO_Phone object on success, null otherwise + * + * @throws \API_Exception + * @throws \CRM_Core_Exception */ - public static function add(&$params) { - // Ensure mysql phone function exists - CRM_Core_DAO::checkSqlFunctionsExist(); - - return self::writeRecord($params); + public static function add($params) { + CRM_Core_Error::deprecatedFunctionWarning('Use the v4 api'); + return self::create($params); } /** @@ -68,6 +65,7 @@ public static function add(&$params) { * * @return array * array of phone objects + * @throws \CRM_Core_Exception */ public static function &getValues($entityBlock) { $getValues = CRM_Core_BAO_Block::getValues('phone', $entityBlock); diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index 4eae51e91a13..f84454ae72ed 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -121,32 +121,6 @@ public static function deleteItem($id = NULL, $cacheKey = NULL, $entityTable = ' CRM_Core_DAO::executeQuery($sql, $params); } - /** - * Delete pair from the previous next cache table to remove it from further merge consideration. - * - * The pair may have been flipped, so make sure we delete using both orders - * - * @param int $id1 - * @param int $id2 - * @param string $cacheKey - */ - public static function deletePair($id1, $id2, $cacheKey = NULL) { - $sql = "DELETE FROM civicrm_prevnext_cache WHERE entity_table = 'civicrm_contact'"; - - $pair = "(entity_id1 = %2 AND entity_id2 = %3) OR (entity_id1 = %3 AND entity_id2 = %2)"; - $sql .= " AND ( {$pair} )"; - $params[2] = [$id1, 'Integer']; - $params[3] = [$id2, 'Integer']; - - if (isset($cacheKey)) { - $sql .= " AND cachekey LIKE %4"; - // used % to address any row with conflict-cacheKey e.g "merge Individual_8_0_conflicts" - $params[4] = ["{$cacheKey}%", 'String']; - } - - CRM_Core_DAO::executeQuery($sql, $params); - } - /** * Mark contacts as being in conflict. * diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index 5523858d6ac9..5a8d4fa93fa9 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -365,9 +365,9 @@ public static function changeUniqueToIndex($tableName, $dropUnique = TRUE) { * * @param $tables * Tables to create index for in the format: - * array('civicrm_entity_table' => 'entity_id') + * ['civicrm_entity_table' => ['entity_id']] * OR - * array('civicrm_entity_table' => array('entity_id', 'entity_table')) + * array['civicrm_entity_table' => array['entity_id', 'entity_table']] * The latter will create a combined index on the 2 keys (in order). * * Side note - when creating combined indexes the one with the most variation @@ -592,7 +592,8 @@ public static function checkIfFieldExists($tableName, $columnName, $i18nRewrite */ public static function checkFKExists($table_name, $constraint_name) { $config = CRM_Core_Config::singleton(); - $dbUf = DB::parseDSN($config->dsn); + $dsn = CRM_Utils_SQL::autoSwitchDSN($config->dsn); + $dbUf = DB::parseDSN($dsn); $query = " SELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_SCHEMA = %1 @@ -796,30 +797,51 @@ public static function getFieldAlterSQL($params, $indexExist) { * * @param bool $revert * Being able to revert if primarily for unit testing. + * @param array $patterns + * Defaults to ['civicrm\_%'] but can be overridden to specify any pattern. eg ['civicrm\_%', 'civi%\_%', 'veda%\_%']. + * @param array $databaseList + * Allows you to specify an alternative database to the configured CiviCRM database. * * @return bool */ - public static function migrateUtf8mb4($revert = FALSE) { + public static function migrateUtf8mb4($revert = FALSE, $patterns = ['civicrm\_%'], $databaseList = NULL) { $newCharSet = $revert ? 'utf8' : 'utf8mb4'; $newCollation = $revert ? 'utf8_unicode_ci' : 'utf8mb4_unicode_ci'; $newBinaryCollation = $revert ? 'utf8_bin' : 'utf8mb4_bin'; $tables = []; $dao = new CRM_Core_DAO(); - $database = $dao->_database; - CRM_Core_DAO::executeQuery("ALTER DATABASE $database CHARACTER SET = $newCharSet COLLATE = $newCollation"); - $dao = CRM_Core_DAO::executeQuery("SHOW TABLE STATUS WHERE Engine = 'InnoDB' AND Name LIKE 'civicrm\_%'"); - while ($dao->fetch()) { - $tables[$dao->Name] = [ - 'Engine' => $dao->Engine, - ]; - } - $dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN); - $logging_database = $dsn['database']; - $dao = CRM_Core_DAO::executeQuery("SHOW TABLE STATUS FROM `$logging_database` WHERE Engine <> 'MyISAM' AND Name LIKE 'log\_civicrm\_%'"); - while ($dao->fetch()) { - $tables["$logging_database.{$dao->Name}"] = [ - 'Engine' => $dao->Engine, - ]; + $databases = $databaseList ?? [$dao->_database]; + + $tableNameLikePatterns = []; + $logTableNameLikePatterns = []; + + foreach ($patterns as $pattern) { + $pattern = CRM_Utils_Type::escape($pattern, 'String'); + $tableNameLikePatterns[] = "Name LIKE '{$pattern}'"; + $logTableNameLikePatterns[] = "Name LIKE 'log\_{$pattern}'"; + } + + foreach ($databases as $database) { + CRM_Core_DAO::executeQuery("ALTER DATABASE $database CHARACTER SET = $newCharSet COLLATE = $newCollation"); + $dao = CRM_Core_DAO::executeQuery("SHOW TABLE STATUS FROM `{$database}` WHERE Engine = 'InnoDB' AND (" . implode(' OR ', $tableNameLikePatterns) . ")"); + while ($dao->fetch()) { + $tables["{$database}.{$dao->Name}"] = [ + 'Engine' => $dao->Engine, + ]; + } + } + // If we specified a list of databases assume the user knows what they are doing. + // If they specify the database they should also specify the pattern. + if (!$databaseList) { + $dsn = defined('CIVICRM_LOGGING_DSN') ? CRM_Utils_SQL::autoSwitchDSN(CIVICRM_LOGGING_DSN) : CRM_Utils_SQL::autoSwitchDSN(CIVICRM_DSN); + $dsn = DB::parseDSN($dsn); + $logging_database = $dsn['database']; + $dao = CRM_Core_DAO::executeQuery("SHOW TABLE STATUS FROM `{$logging_database}` WHERE Engine <> 'MyISAM' AND (" . implode(' OR ', $logTableNameLikePatterns) . ")"); + while ($dao->fetch()) { + $tables["{$logging_database}.{$dao->Name}"] = [ + 'Engine' => $dao->Engine, + ]; + } } foreach ($tables as $table => $param) { $query = "ALTER TABLE $table"; diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index aca664795e7f..543560b96958 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -1869,7 +1869,7 @@ public static function buildProfile( } } elseif (substr($fieldName, 0, 7) === 'country') { - $form->add('select', $name, $title, ['' => ts('- select -')] + CRM_Core_PseudoConstant::country(), $required, $selectAttributes); + $form->add('select', $name, $title, CRM_Core_PseudoConstant::country(), $required, $selectAttributes); $config = CRM_Core_Config::singleton(); if (!in_array($mode, [CRM_Profile_Form::MODE_EDIT, CRM_Profile_Form::MODE_SEARCH]) && $config->defaultContactCountry @@ -1895,16 +1895,12 @@ public static function buildProfile( $providerName = substr($name, 0, -1) . '-provider_id]'; } $form->add('select', $providerName, NULL, - [ - '' => ts('- select -'), - ] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'), $required + CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'), $required ); } else { $form->add('select', $name . '-provider_id', $title, - [ - '' => ts('- select -'), - ] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'), $required + CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'), $required ); } @@ -1916,7 +1912,7 @@ public static function buildProfile( elseif (CRM_Utils_Array::value('name', $field) == 'membership_type') { list($orgInfo, $types) = CRM_Member_BAO_MembershipType::getMembershipTypeInfo(); $sel = &$form->addElement('hierselect', $name, $title); - $select = ['' => ts('- select -')]; + $select = ['' => ts('- select membership type -')]; if (count($orgInfo) == 1 && $field['is_required']) { // we only have one org - so we should default to it. Not sure about defaulting to first type // as it could be missed - so adding a select @@ -1932,9 +1928,7 @@ public static function buildProfile( } elseif (CRM_Utils_Array::value('name', $field) == 'membership_status') { $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'), $required + CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'), $required ); } elseif (in_array($fieldName, ['gender_id', 'communication_style_id'])) { @@ -1999,7 +1993,7 @@ public static function buildProfile( 'contact_type' => $profileType, 'greeting_type' => $fieldName, ]; - $form->add('select', $name, $title, ['' => ts('- select -')] + CRM_Core_PseudoConstant::greeting($greeting), $required); + $form->add('select', $name, $title, CRM_Core_PseudoConstant::greeting($greeting), $required, ['placeholder' => TRUE]); // add custom greeting element $form->add('text', $fieldName . '_custom', ts('Custom %1', [1 => ucwords(str_replace('_', ' ', $fieldName))]), NULL, FALSE @@ -2019,7 +2013,7 @@ public static function buildProfile( $form->add('select', $name, $title, CRM_Core_SelectValues::pmf()); } elseif ($fieldName === 'preferred_language') { - $form->add('select', $name, $title, ['' => ts('- select -')] + CRM_Contact_BAO_Contact::buildOptions('preferred_language')); + $form->add('select', $name, $title, CRM_Contact_BAO_Contact::buildOptions('preferred_language'), $required, ['placeholder' => TRUE]); } elseif ($fieldName == 'external_identifier') { $form->add('text', $name, $title, $attributes, $required); @@ -2078,35 +2072,29 @@ public static function buildProfile( elseif ($fieldName === 'product_name') { list($products, $options) = CRM_Contribute_BAO_Premium::getPremiumProductInfo(); $sel = &$form->addElement('hierselect', $name, $title); - $products = ['0' => ts('- select -')] + $products; + $products = ['0' => ts('- select %1 -', [1 => $title])] + $products; $sel->setOptions([$products, $options]); } elseif ($fieldName === 'payment_instrument') { $form->add('select', $name, $title, - ['' => ts('- select -')] + CRM_Contribute_PseudoConstant::paymentInstrument(), $required); + CRM_Contribute_PseudoConstant::paymentInstrument(), $required, ['placeholder' => TRUE]); } elseif ($fieldName === 'financial_type') { $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Contribute_PseudoConstant::financialType(), $required + CRM_Contribute_PseudoConstant::financialType(), $required, ['placeholder' => TRUE] ); } elseif ($fieldName === 'contribution_status_id') { $contributionStatuses = CRM_Contribute_BAO_Contribution_Utils::getContributionStatuses(); $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + $contributionStatuses, $required + $contributionStatuses, $required, ['placeholder' => TRUE] ); } elseif ($fieldName === 'soft_credit_type') { $name = "soft_credit_type[$rowNumber]"; $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Core_OptionGroup::values("soft_credit_type") + CRM_Core_OptionGroup::values("soft_credit_type"), ['placeholder' => TRUE] ); //CRM-15350: choose SCT field default value as 'Gift' for membership use //else (for contribution), use configured SCT default value @@ -2124,23 +2112,20 @@ public static function buildProfile( } elseif ($fieldName == 'contribution_page_id') { $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Contribute_PseudoConstant::contributionPage(), $required, 'class="big"' + CRM_Contribute_PseudoConstant::contributionPage(), $required, [ + 'class' => 'big', + 'placeholder' => TRUE, + ] ); } elseif ($fieldName == 'activity_status_id') { $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Core_PseudoConstant::activityStatus(), $required + CRM_Core_PseudoConstant::activityStatus(), $required, ['placeholder' => TRUE] ); } elseif ($fieldName == 'activity_engagement_level') { $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Campaign_PseudoConstant::engagementLevel(), $required + CRM_Campaign_PseudoConstant::engagementLevel(), $required, ['placeholder' => TRUE] ); } elseif ($fieldName == 'participant_status') { @@ -2149,9 +2134,7 @@ public static function buildProfile( $cond = 'visibility_id = 1'; } $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Event_PseudoConstant::participantStatus(NULL, $cond, 'label'), $required + CRM_Event_PseudoConstant::participantStatus(NULL, $cond, 'label'), $required, ['placeholder' => TRUE] ); } elseif ($fieldName == 'participant_role') { @@ -2160,9 +2143,7 @@ public static function buildProfile( } else { $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Event_PseudoConstant::participantRole(), $required + CRM_Event_PseudoConstant::participantRole(), $required, ['placeholder' => TRUE] ); } } @@ -2181,9 +2162,11 @@ public static function buildProfile( $form->_componentCampaigns )); $form->add('select', $name, $title, + $campaigns, $required, [ - '' => ts('- select -'), - ] + $campaigns, $required, 'class="crm-select2 big"' + 'class' => 'crm-select2 big', + 'placeholder' => TRUE, + ] ); } } @@ -2196,10 +2179,8 @@ public static function buildProfile( } elseif ($fieldName == 'case_status') { $form->add('select', $name, $title, - [ - '' => ts('- select -'), - ] + CRM_Case_BAO_Case::buildOptions('case_status_id', 'create'), - $required + CRM_Case_BAO_Case::buildOptions('case_status_id', 'create'), + $required, ['placeholder' => TRUE] ); } else { diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index 9e61b990b3ce..9d0a58bbac35 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -340,6 +340,14 @@ public static function updateUFName($contactId) { return; } + // 1.do check for contact Id. + $ufmatch = new CRM_Core_DAO_UFMatch(); + $ufmatch->contact_id = $contactId; + $ufmatch->domain_id = CRM_Core_Config::domainID(); + if (!$ufmatch->find(TRUE)) { + return; + } + $config = CRM_Core_Config::singleton(); $ufName = CRM_Contact_BAO_Contact::getPrimaryEmail($contactId); @@ -349,13 +357,6 @@ public static function updateUFName($contactId) { $update = FALSE; - // 1.do check for contact Id. - $ufmatch = new CRM_Core_DAO_UFMatch(); - $ufmatch->contact_id = $contactId; - $ufmatch->domain_id = CRM_Core_Config::domainID(); - if (!$ufmatch->find(TRUE)) { - return; - } if ($ufmatch->uf_name != $ufName) { $update = TRUE; } diff --git a/CRM/Core/BAO/Website.php b/CRM/Core/BAO/Website.php index 358ddd2f3c2c..d5f386e8fdb8 100644 --- a/CRM/Core/BAO/Website.php +++ b/CRM/Core/BAO/Website.php @@ -24,9 +24,11 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website { * Create or update Website record. * * @param array $params + * * @return CRM_Core_DAO_Website + * @throws \CRM_Core_Exception */ - public static function add($params) { + public static function create($params) { return self::writeRecord($params); } @@ -36,23 +38,13 @@ public static function add($params) { * If called in a legacy manner this, temporarily, fails back to calling the legacy function. * * @param array $params - * @param int $contactID - * @param bool $skipDelete * * @return bool|CRM_Core_BAO_Website + * @throws \CRM_Core_Exception */ - public static function create($params, $contactID = NULL, $skipDelete = NULL) { - if ($skipDelete !== NULL || ($contactID && !is_array($contactID))) { - \Civi::log()->warning(ts('Calling website:create with vars other than $params is deprecated. Use process'), ['civi.tag' => 'deprecated']); - return self::process($params, $contactID, $skipDelete); - } - foreach ($params as $key => $value) { - if (is_numeric($key)) { - \Civi::log()->warning(ts('Calling website:create for multiple websites $params is deprecated. Use process'), ['civi.tag' => 'deprecated']); - return self::process($params, $contactID, $skipDelete); - } - } - return self::add($params); + public static function add($params) { + CRM_Core_Error::deprecatedFunctionWarning('use apiv4'); + return self::create($params); } /** @@ -65,6 +57,7 @@ public static function create($params, $contactID = NULL, $skipDelete = NULL) { * @param bool $skipDelete * * @return bool + * @throws \CRM_Core_Exception */ public static function process($params, $contactID, $skipDelete) { if (empty($params)) { @@ -87,7 +80,7 @@ public static function process($params, $contactID, $skipDelete) { } if (!empty($values['url'])) { $values['contact_id'] = $contactID; - self::add($values); + self::create($values); } elseif ($skipDelete && !empty($values['id'])) { self::del($values['id']); diff --git a/CRM/Core/CodeGen/GenerateData.php b/CRM/Core/CodeGen/GenerateData.php new file mode 100644 index 000000000000..31a2352c3f8c --- /dev/null +++ b/CRM/Core/CodeGen/GenerateData.php @@ -0,0 +1,1995 @@ +seed = $seed; + $this->time = $time; + $this->numIndividual = self::INDIVIDUAL_PERCENT * self::NUM_CONTACT / 100; + $this->numHousehold = self::HOUSEHOLD_PERCENT * self::NUM_CONTACT / 100; + $this->numOrganization = self::ORGANIZATION_PERCENT * self::NUM_CONTACT / 100; + $this->numStrictIndividual = $this->numIndividual - ($this->numHousehold * self::NUM_INDIVIDUAL_PER_HOUSEHOLD); + + // Parse data file + foreach ((array) simplexml_load_file(self::getCivicrmDir() . '/sql/' . self::DATA_FILENAME) as $key => $val) { + $val = (array) $val; + $this->sampleData[$key] = (array) $val['item']; + } + // Init DB + $config = CRM_Core_Config::singleton(); + + // Relationship types indexed by name_a_b from the table civicrm_relationship_type + $this->relTypes = CRM_Utils_Array::index(array('name_a_b'), CRM_Core_PseudoConstant::relationshipType('name')); + } + + /** + * Create a full, standard set of random data. + */ + public function generateAll() { + $this->initID(); + $this->generate('Domain'); + $this->generate('Contact'); + $this->generate('Individual'); + $this->generate('Household'); + $this->generate('Organization'); + $this->generate('Relationship'); + $this->generate('EntityTag'); + $this->generate('Group'); + $this->generate('Note'); + $this->generate('Activity'); + $this->generate('Event'); + $this->generate('Contribution'); + $this->generate('ContributionLineItem'); + $this->generate('Membership'); + $this->generate('MembershipPayment'); + $this->generate('MembershipLog'); + $this->generate('PCP'); + $this->generate('SoftContribution'); + $this->generate('Pledge'); + $this->generate('PledgePayment'); + $this->generate('Participant'); + $this->generate('ParticipantPayment'); + $this->generate('LineItemParticipants'); + $this->generate('AccountingEntries'); + } + + /** + * Write a log message. + * + * @param string $message + */ + public function write($message) { + echo $message; + } + + /** + * Public wrapper for calling private "add" functions + * Provides user feedback + * @param $itemName + */ + public function generate($itemName) { + $this->write("Generating $itemName\n"); + $fn = "add$itemName"; + $this->$fn(); + } + + /** + * this function creates arrays for the following + * + * domain id + * contact id + * contact_location id + * contact_contact_location id + * contact_email uuid + * contact_phone_uuid + * contact_instant_message uuid + * contact_relationship uuid + * contact_task uuid + * contact_note uuid + */ + public function initID() { + // get the domain and contact id arrays + $this->domain = range(1, self::NUM_DOMAIN); + $this->domain = $this->shuffle($this->domain); + + // Get first contact id + $this->startCid = $cid = CRM_Core_DAO::singleValueQuery("SELECT MAX(id) FROM civicrm_contact"); + $this->contact = range($cid + 1, $cid + self::NUM_CONTACT); + $this->contact = $this->shuffle($this->contact); + + // get the individual, household and organizaton contacts + $offset = 0; + $this->Individual = array_slice($this->contact, $offset, $this->numIndividual); + $offset += $this->numIndividual; + $this->Household = array_slice($this->contact, $offset, $this->numHousehold); + $offset += $this->numHousehold; + $this->Organization = array_slice($this->contact, $offset, $this->numOrganization); + + // get the strict individual contacts (i.e individual contacts not belonging to any household) + $this->strictIndividual = array_slice($this->Individual, 0, $this->numStrictIndividual); + + // get the household to individual mapping array + $this->householdIndividual = array_slice($this->Individual, $this->numStrictIndividual); + $this->householdIndividual = array_chunk($this->householdIndividual, self::NUM_INDIVIDUAL_PER_HOUSEHOLD); + $this->householdIndividual = array_combine($this->Household, $this->householdIndividual); + } + + /* + * private members + * + */ + + /** + * @var int + */ + private $seed; + + /** + * enum's from database + * @var array + */ + private $preferredCommunicationMethod = array('1', '2', '3', '4', '5'); + private $contactType = array('Individual', 'Household', 'Organization'); + private $phoneType = array('1', '2', '3', '4'); + + /** + * customizable enums (foreign keys) + * @var array + */ + private $prefix = array( + // Female + 1 => array( + 1 => 'Mrs.', + 2 => 'Ms.', + 4 => 'Dr.', + ), + // Male + 2 => array( + 3 => 'Mr.', + 4 => 'Dr.', + ), + ); + /** + * @var array + */ + private $suffix = array(1 => 'Jr.', 2 => 'Sr.', 3 => 'II', 4 => 'III'); + private $gender = array(1 => 'female', 2 => 'male'); + + /** + * store domain id's + * @var array + */ + private $domain = array(); + + /** + * store contact id's + * @var array + */ + private $contact = array(); + private $Individual = array(); + private $Household = array(); + private $Organization = array(); + + // store which contacts have a location entity + /** + * for automatic management of is_primary field + * @var array + */ + private $location = array( + 'Email' => array(), + 'Phone' => array(), + 'Address' => array(), + ); + + /** + * stores the strict individual id and household id to individual id mapping + * @var array + */ + private $strictIndividual = array(); + private $householdIndividual = array(); + private $householdName = array(); + + /** + * sample data in xml format + * @var array + */ + private $sampleData = array(); + + /** + * private vars + * @var array + */ + private $startCid; + private $numIndividual = 0; + private $numHousehold = 0; + private $numOrganization = 0; + private $numStrictIndividual = 0; + private $stateMap = array(); + private $states = array(); + + private $groupMembershipStatus = array('Added', 'Removed', 'Pending'); + private $subscriptionHistoryMethod = array('Admin', 'Email'); + private $deceasedContactIds = array(); + + /********************************* + * private methods + * ******************************* + */ + + /** + * Random number generator. + * + * All other random() functions should derive from this. + * + * This is very weak RNG. The goal is to provide a reproducible sequence of + * random-ish values for generating dummy-data. + * + * @param int $min + * @param int $max + * @return int + */ + private function randomInt($min, $max) { + $range = min(1 + $max - $min, mt_getrandmax()); + $this->seed = md5($this->seed . chr(0) . $min . chr(0) . $max); + return $min + (hexdec(substr($this->seed, 20, 8)) % $range); + } + + /** + * Get a randomly generated string. + * + * @param int $size + * + * @return string + */ + private function randomString($size = 32) { + $string = ""; + + // get an ascii code for each character + for ($i = 0; $i < $size; $i++) { + $random_int = $this->randomInt(65, 122); + if (($random_int < 97) && ($random_int > 90)) { + // if ascii code between 90 and 97 substitute with space + $random_int = 32; + } + $random_char = chr($random_int); + $string .= $random_char; + } + return $string; + } + + /** + * @return string + */ + private function randomChar() { + return chr($this->randomInt(65, 90)); + } + + /** + * Get a random item from the sample data or any other array + * + * @param $items (array or string) - if string, used as key for sample data, if array, used as data source + * + * @return mixed (element from array) + * + * @private + */ + private function randomItem($items) { + if (!is_array($items)) { + $key = $items; + $items = $this->sampleData[$key]; + } + if (!$items) { + $this->write("Error: no items found for '$key'\n"); + return FALSE; + } + return $items[$this->randomInt(0, count($items) - 1)]; + } + + /** + * @param $items + * + * @return mixed + */ + private function randomIndex($items) { + return $this->randomItem(array_keys($items)); + } + + /** + * @param $items + * + * @return array + */ + private function randomKeyValue($items) { + $key = $this->randomIndex($items); + return array($key, $items[$key]); + } + + private function shuffle($array) { + for ($i = count($array) - 1; $i >= 1; $i--) { + $j = $this->randomInt(0, $i); + $tmp = $array[$i]; + $array[$i] = $array[$j]; + $array[$j] = $tmp; + } + return $array; + } + + /** + * @param $chance + * + * @return int + */ + private function probability($chance) { + if ($this->randomInt(0, 100) < ($chance * 100)) { + return 1; + } + return 0; + } + + /** + * Generate a random date. + * + * If both $startDate and $endDate are defined generate + * date between them. + * + * If only startDate is specified then date generated is + * between startDate + 1 year. + * + * if only endDate is specified then date generated is + * between endDate - 1 year. + * + * if none are specified - date is between today - 1year + * and today + * + * @param int $startDate Start Date in Unix timestamp + * @param int $endDate End Date in Unix timestamp + * @access private + * + * @return string randomly generated date in the format "Ymd" + * + */ + private function randomDate($startDate = 0, $endDate = 0) { + + // number of seconds per year + $numSecond = 31536000; + $dateFormat = "YmdHis"; + $today = $this->time; + + // both are defined + if ($startDate && $endDate) { + return date($dateFormat, $this->randomInt($startDate, $endDate)); + } + + // only startDate is defined + if ($startDate) { + return date($dateFormat, $this->randomInt($startDate, $startDate + $numSecond)); + } + + // only endDate is defined + if ($startDate) { + return date($dateFormat, $this->randomInt($endDate - $numSecond, $endDate)); + } + + // none are defined + return date($dateFormat, $this->randomInt($today - $numSecond, $today)); + } + + /** + * Automatically manage the is_primary field by tracking which contacts have each item + * @param $cid + * @param $type + * @return int + */ + private function isPrimary($cid, $type) { + if (empty($this->location[$type][$cid])) { + $this->location[$type][$cid] = TRUE; + return 1; + } + return 0; + } + + /** + * Execute a query unless we are doing a dry run + * Note: this wrapper should not be used for SELECT queries + * @param $query + * @param array $params + * @return \CRM_Core_DAO + */ + private function _query($query, $params = array()) { + if (self::ADD_TO_DB) { + return CRM_Core_DAO::executeQuery($query, $params); + } + } + + /** + * Call dao insert method unless we are doing a dry run + * @param $dao + */ + private function _insert(&$dao) { + if (self::ADD_TO_DB) { + $dao->insert(); + } + } + + /** + * Call dao update method unless we are doing a dry run + * @param $dao + */ + private function _update(&$dao) { + if (self::ADD_TO_DB) { + $dao->update(); + } + } + + /** + * Add core DAO object + * @param $type + * @param $params + */ + private function _addDAO($type, $params) { + $daoName = "CRM_Core_DAO_$type"; + $obj = new $daoName(); + foreach ($params as $key => $value) { + $obj->$key = $value; + } + if (isset($this->location[$type])) { + $obj->is_primary = $this->isPrimary($params['contact_id'], $type); + } + $this->_insert($obj); + } + + /** + * Fetch contact type based on stored mapping + * @param $id + * @return string $type + */ + private function getContactType($id) { + foreach (array('Individual', 'Household', 'Organization') as $type) { + if (in_array($id, $this->$type)) { + return $type; + } + } + } + + /** + * This method adds NUM_DOMAIN domains and then adds NUM_REVISION + * revisions for each domain with the latest revision being the last one.. + */ + private function addDomain() { + + /* Add a location for domain 1 */ + + $domain = new CRM_Core_DAO_Domain(); + for ($id = 2; $id <= self::NUM_DOMAIN; $id++) { + // domain name is pretty simple. it is "Domain $id" + $domain->name = "Domain $id"; + $domain->description = "Description $id"; + $domain->contact_name = $this->randomName(); + + // insert domain + $this->_insert($domain); + } + } + + /** + * @return string + */ + public function randomName() { + $first_name = $this->randomItem(($this->probability(.5) ? 'fe' : '') . 'male_name'); + $middle_name = ucfirst($this->randomChar()); + $last_name = $this->randomItem('last_name'); + return "$first_name $middle_name. $last_name"; + } + + /** + * This method adds data to the contact table + * + * id - from $contact + * contact_type 'Individual' 'Household' 'Organization' + * preferred_communication (random 1 to 3) + */ + private function addContact() { + $contact = new CRM_Contact_DAO_Contact(); + $cid = $this->startCid; + + for ($id = $cid + 1; $id <= $cid + self::NUM_CONTACT; $id++) { + $contact->contact_type = $this->getContactType($id); + $contact->do_not_phone = $this->probability(.2); + $contact->do_not_email = $this->probability(.2); + $contact->do_not_post = $this->probability(.2); + $contact->do_not_trade = $this->probability(.2); + $contact->preferred_communication_method = NULL; + if ($this->probability(.5)) { + $contact->preferred_communication_method = CRM_Core_DAO::VALUE_SEPARATOR . $this->randomItem($this->preferredCommunicationMethod) . CRM_Core_DAO::VALUE_SEPARATOR; + } + $contact->source = 'Sample Data'; + $this->_insert($contact); + } + } + + /** + * addIndividual() + * + * This method adds individual's data to the contact table + * + * The following fields are generated and added. + * + * contact_uuid - individual + * contact_rid - latest one + * first_name 'First Name $contact_uuid' + * middle_name 'Middle Name $contact_uuid' + * last_name 'Last Name $contact_uuid' + * job_title 'Job Title $contact_uuid' + * + */ + private function addIndividual() { + + $contact = new CRM_Contact_DAO_Contact(); + $year = 60 * 60 * 24 * 365.25; + $now = $this->time; + + foreach ($this->Individual as $cid) { + $contact->is_deceased = $contact->gender_id = $contact->birth_date = $contact->deceased_date = $email = NULL; + list($gender_id, $gender) = $this->randomKeyValue($this->gender); + $birth_date = $this->randomInt($now - 90 * $year, $now - 10 * $year); + + $contact->last_name = $this->randomItem('last_name'); + + // Manage household names + if (!in_array($contact->id, $this->strictIndividual)) { + // Find position in household + foreach ($this->householdIndividual as $householdId => $house) { + foreach ($house as $position => $memberId) { + if ($memberId == $cid) { + break 2; + } + } + } + // Head of household: set name + if (empty($this->householdName[$householdId])) { + $this->householdName[$householdId] = $contact->last_name; + } + // Kids get household name, spouse might get it + if ($position > 1 || $this->probability(.5)) { + $contact->last_name = $this->householdName[$householdId]; + } + elseif ($this->householdName[$householdId] != $contact->last_name) { + // Spouse might hyphenate name + if ($this->probability(.5)) { + $contact->last_name .= '-' . $this->householdName[$householdId]; + } + // Kids might hyphenate name + else { + $this->householdName[$householdId] .= '-' . $contact->last_name; + } + } + // Sensible ages and genders + $offset = $this->randomInt($now - 40 * $year, $now); + // Parents + if ($position < 2) { + $birth_date = $this->randomInt($offset - 35 * $year, $offset - 20 * $year); + if ($this->probability(.8)) { + $gender_id = 2 - $position; + $gender = $this->gender[$gender_id]; + } + } + // Kids + else { + $birth_date = $this->randomInt($offset - 10 * $year, $offset); + } + } + // Non household people + else { + if ($this->probability(.6)) { + $this->_addAddress($cid); + } + } + + $contact->first_name = $this->randomItem($gender . '_name'); + $contact->middle_name = $this->probability(.5) ? '' : ucfirst($this->randomChar()); + $age = intval(($now - $birth_date) / $year); + + // Prefix and suffix by gender and age + $contact->prefix_id = $contact->suffix_id = $prefix = $suffix = NULL; + if ($this->probability(.5) && $age > 20) { + list($contact->prefix_id, $prefix) = $this->randomKeyValue($this->prefix[$gender_id]); + $prefix .= ' '; + } + if ($gender == 'male' && $this->probability(.50)) { + list($contact->suffix_id, $suffix) = $this->randomKeyValue($this->suffix); + $suffix = ' ' . $suffix; + } + if ($this->probability(.7)) { + $contact->gender_id = $gender_id; + } + if ($this->probability(.7)) { + $contact->birth_date = date("Ymd", $birth_date); + } + + // Deceased probability based on age + if ($contact->gender_id && $contact->gender_id == 2) { + $checkAge = 64; + } + else { + $checkAge = 68; + } + if ($age > $checkAge && count($this->deceasedContactIds) < 4) { + $contact->is_deceased = $this->probability(($age - 30) / 100); + if ($contact->is_deceased && $this->probability(.7)) { + $contact->deceased_date = $this->randomDate(); + } + } + + // Add 0, 1 or 2 email address + $count = $this->randomInt(0, 2); + for ($i = 0; $i < $count; ++$i) { + $email = $this->_individualEmail($contact); + $this->_addEmail($cid, $email, self::HOME); + } + + // Add 0, 1 or 2 phones + $count = $this->randomInt(0, 2); + for ($i = 0; $i < $count; ++$i) { + $this->_addPhone($cid); + } + + // Occasionally you get contacts with just an email in the db + if ($this->probability(.2) && $email) { + $contact->first_name = $contact->last_name = $contact->middle_name = NULL; + $contact->is_deceased = $contact->gender_id = $contact->birth_date = $contact->deceased_date = NULL; + $contact->display_name = $contact->sort_name = $email; + $contact->postal_greeting_display = $contact->email_greeting_display = "Dear $email"; + } + else { + $contact->display_name = $prefix . $contact->first_name . ' ' . $contact->last_name . $suffix; + $contact->sort_name = $contact->last_name . ', ' . $contact->first_name; + $contact->postal_greeting_display = $contact->email_greeting_display = 'Dear ' . $contact->first_name; + } + $contact->addressee_id = $contact->postal_greeting_id = $contact->email_greeting_id = 1; + $contact->addressee_display = $contact->display_name; + $contact->hash = crc32($contact->sort_name); + $contact->id = $cid; + $this->_update($contact); + if ($contact->is_deceased) { + $this->deceasedContactIds[] = $cid; + } + } + } + + /** + * This method adds household's data to the contact table + * + * The following fields are generated and added. + * + * contact_uuid - household_individual + * contact_rid - latest one + * household_name 'household $contact_uuid primary contact $primary_contact_uuid' + * nick_name 'nick $contact_uuid' + * primary_contact_uuid = $household_individual[$contact_uuid][0]; + * + */ + private function addHousehold() { + + $contact = new CRM_Contact_DAO_Contact(); + foreach ($this->Household as $cid) { + // Add address + $this->_addAddress($cid); + + $contact->id = $cid; + $contact->household_name = $this->householdName[$cid] . " family"; + // need to update the sort name for the main contact table + $contact->display_name = $contact->sort_name = $contact->household_name; + $contact->postal_greeting_id = $contact->email_greeting_id = 5; + $contact->postal_greeting_display = $contact->email_greeting_display = 'Dear ' . $contact->household_name; + $contact->addressee_id = 2; + $contact->addressee_display = $contact->display_name; + $contact->hash = crc32($contact->sort_name); + $this->_update($contact); + } + } + + /** + * This method adds organization data to the contact table + * + * The following fields are generated and added. + * + * contact_uuid - organization + * contact_rid - latest one + * organization_name 'organization $contact_uuid' + * legal_name 'legal $contact_uuid' + * nick_name 'nick $contact_uuid' + * sic_code 'sic $contact_uuid' + * primary_contact_id - random individual contact uuid + * + */ + private function addOrganization() { + + $org = new CRM_Contact_DAO_Contact(); + $employees = $this->Individual; + $employees = $this->shuffle($employees); + + foreach ($this->Organization as $key => $id) { + $org->primary_contact_id = $website = $email = NULL; + $org->id = $id; + $address = $this->_addAddress($id); + + $namePre = $this->randomItem('organization_prefix'); + $nameMid = $this->randomItem('organization_name'); + $namePost = $this->randomItem('organization_suffix'); + + // Some orgs are named after their location + if ($this->probability(.7)) { + $place = $this->randomItem(array('city', 'street_name', 'state')); + $namePre = $address[$place]; + } + $org->organization_name = "$namePre $nameMid $namePost"; + + // Most orgs have a website and email + if ($this->probability(.8)) { + $website = $this->_addWebsite($id, $org->organization_name); + $url = str_replace('http://', '', $website['url']); + $email = $this->randomItem('email_address') . '@' . $url; + $this->_addEmail($id, $email, self::MAIN); + } + + // current employee + if ($this->probability(.8)) { + $indiv = new CRM_Contact_DAO_Contact(); + $org->primary_contact_id = $indiv->id = $employees[$key]; + $indiv->organization_name = $org->organization_name; + $indiv->employer_id = $id; + $this->_update($indiv); + // Share address with employee + if ($this->probability(.8)) { + $this->_addAddress($indiv->id, $id); + } + // Add work email for employee + if ($website) { + $indiv->find(TRUE); + $email = $this->_individualEmail($indiv, $url); + $this->_addEmail($indiv->id, $email, self::WORK); + } + } + + // need to update the sort name for the main contact table + $org->display_name = $org->sort_name = $org->organization_name; + $org->addressee_id = 3; + $org->addressee_display = $org->display_name; + $org->hash = crc32($org->sort_name); + $this->_update($org); + } + } + + /** + * This method adds data to the contact_relationship table + */ + private function addRelationship() { + + $relationship = new CRM_Contact_DAO_Relationship(); + + // Household relationships + foreach ($this->householdIndividual as $household_id => $household_member) { + // Default active + $relationship->is_active = 1; + + // add child_of relationship for each child + $relationship->relationship_type_id = $this->relTypes['Child of']['id']; + foreach (array(0, 1) as $parent) { + foreach (array(2, 3) as $child) { + $relationship->contact_id_a = $household_member[$child]; + $relationship->contact_id_b = $household_member[$parent]; + $this->_insert($relationship); + } + } + + // add sibling_of relationship + $relationship->relationship_type_id = $this->relTypes['Sibling of']['id']; + $relationship->contact_id_a = $household_member[3]; + $relationship->contact_id_b = $household_member[2]; + $this->_insert($relationship); + + // add member_of_household relationships and shared address + $relationship->relationship_type_id = $this->relTypes['Household Member of']['id']; + $relationship->contact_id_b = $household_id; + for ($i = 1; $i < 4; ++$i) { + $relationship->contact_id_a = $household_member[$i]; + $this->_insert($relationship); + $this->_addAddress($household_member[$i], $household_id); + } + + // Divorced/separated couples - end relationship and different address + if ($this->probability(.4)) { + $relationship->is_active = 0; + $this->_addAddress($household_member[0]); + } + else { + $this->_addAddress($household_member[0], $household_id); + } + + // add head_of_household relationship 1 for head of house + $relationship->relationship_type_id = $this->relTypes['Head of Household for']['id']; + $relationship->contact_id_a = $household_member[0]; + $relationship->contact_id_b = $household_id; + $this->_insert($relationship); + + // add spouse_of relationship 1 for both the spouses + $relationship->relationship_type_id = $this->relTypes['Spouse of']['id']; + $relationship->contact_id_a = $household_member[1]; + $relationship->contact_id_b = $household_member[0]; + $this->_insert($relationship); + } + + // Add current employer relationships + $this->_query("INSERT INTO civicrm_relationship + (contact_id_a, contact_id_b, relationship_type_id, is_active) + (SELECT id, employer_id, " . $this->relTypes['Employee of']['id'] . ", 1 FROM civicrm_contact WHERE employer_id IN (" . implode(',', $this->Organization) . "))" + ); + } + + /** + * Create an address for a contact + * + * @param $cid int: contact id + * @param $masterContactId int: set if this is a shared address + * + * @return array + */ + private function _addAddress($cid, $masterContactId = NULL) { + + // Share existing address + if ($masterContactId) { + $dao = new CRM_Core_DAO_Address(); + $dao->is_primary = 1; + $dao->contact_id = $masterContactId; + $dao->find(TRUE); + $dao->master_id = $dao->id; + $dao->id = NULL; + $dao->contact_id = $cid; + $dao->is_primary = $this->isPrimary($cid, 'Address'); + $dao->location_type_id = $this->getContactType($masterContactId) == 'Organization' ? self::WORK : self::HOME; + $this->_insert($dao); + } + + // Generate new address + else { + $params = array( + 'contact_id' => $cid, + 'location_type_id' => $this->getContactType($cid) == 'Organization' ? self::MAIN : self::HOME, + 'street_number' => $this->randomInt(1, 1000), + 'street_number_suffix' => ucfirst($this->randomChar()), + 'street_name' => $this->randomItem('street_name'), + 'street_type' => $this->randomItem('street_type'), + 'street_number_postdirectional' => $this->randomItem('address_direction'), + 'county_id' => 1, + ); + + $params['street_address'] = $params['street_number'] . $params['street_number_suffix'] . " " . $params['street_name'] . " " . $params['street_type'] . " " . $params['street_number_postdirectional']; + + if ($params['location_type_id'] == self::MAIN) { + $params['supplemental_address_1'] = $this->randomItem('supplemental_addresses_1'); + } + + // Hack to add lat/long (limited to USA based addresses) + list( + $params['country_id'], + $params['state_province_id'], + $params['city'], + $params['postal_code'], + $params['geo_code_1'], + $params['geo_code_2'], + ) = $this->getZipCodeInfo(); + + $this->_addDAO('Address', $params); + $params['state'] = $this->states[$params['state_province_id']]; + return $params; + } + } + + /** + * Add a phone number for a contact + * + * @param $cid int: contact id + * + * @return array + */ + private function _addPhone($cid) { + $area = $this->probability(.5) ? '' : $this->randomInt(201, 899); + $pre = $this->randomInt(201, 899); + $post = $this->randomInt(1000, 9999); + $params = array( + 'location_type_id' => $this->getContactType($cid) == 'Organization' ? self::MAIN : self::HOME, + 'contact_id' => $cid, + 'phone' => ($area ? "($area) " : '') . "$pre-$post", + 'phone_numeric' => $area . $pre . $post, + 'phone_type_id' => $this->randomInt(1, 2), + ); + $this->_addDAO('Phone', $params); + return $params; + } + + /** + * Add an email for a contact + * + * @param $cid int: contact id + * @param $email + * @param $locationType + * + * @return array + */ + private function _addEmail($cid, $email, $locationType) { + $params = array( + 'location_type_id' => $locationType, + 'contact_id' => $cid, + 'email' => $email, + ); + $this->_addDAO('Email', $params); + return $params; + } + + /** + * Add a website based on organization name + * Using common naming patterns + * + * @param $cid int: contact id + * @param $name str: contact name + * + * @return array + */ + private function _addWebsite($cid, $name) { + $part = array_pad(explode(' ', strtolower($name)), 3, ''); + if (count($part) > 3) { + // Abbreviate the place name if it's two words + $domain = $part[0][0] . $part[1][0] . $part[2] . $part[3]; + } + else { + // Common naming patterns + switch ($this->randomInt(1, 3)) { + case 1: + $domain = $part[0] . $part[1] . $part[2]; + break; + + case 2: + $domain = $part[0] . $part[1]; + break; + + case 3: + $domain = $part[0] . $part[2]; + break; + } + } + $params = array( + 'website_type_id' => 1, + 'location_type_id' => self::MAIN, + 'contact_id' => $cid, + 'url' => "http://$domain.org", + ); + $this->_addDAO('Website', $params); + return $params; + } + + /** + * Create an email address based on a person's name + * Using common naming patterns + * + * @param $contact obj: individual contact record + * @param $domain str: supply a domain (i.e. for a work address) + * + * @return string + */ + private function _individualEmail($contact, $domain = NULL) { + $first = $contact->first_name; + $last = $contact->last_name; + $f = $first[0]; + $l = $last[0]; + $m = $contact->middle_name ? $contact->middle_name[0] . '.' : ''; + // Common naming patterns + switch ($this->randomInt(1, 6)) { + case 1: + $email = $first . $last; + break; + + case 2: + $email = "$last.$first"; + break; + + case 3: + $email = $last . $f; + break; + + case 4: + $email = $first . $l; + break; + + case 5: + $email = "$last.$m$first"; + break; + + case 6: + $email = "$f$m$last"; + break; + } + //to ensure we dont insert + //invalid characters in email + $email = preg_replace("([^a-zA-Z0-9_\.-]*)", "", $email); + + // Some people have numbers in their address + if ($this->probability(.4)) { + $email .= $this->randomInt(1, 99); + } + // Generate random domain if not specified + if (!$domain) { + $domain = $this->randomItem('email_domain') . '.' . $this->randomItem('email_tld'); + } + return strtolower($email) . '@' . $domain; + } + + /** + * This method populates the civicrm_entity_tag table + */ + private function addEntityTag() { + + $entity_tag = new CRM_Core_DAO_EntityTag(); + + // add categories 1,2,3 for Organizations. + for ($i = 0; $i < $this->numOrganization; $i += 2) { + $org_id = $this->Organization[$i]; + // echo "org_id = $org_id\n"; + $entity_tag->entity_id = $this->Organization[$i]; + $entity_tag->entity_table = 'civicrm_contact'; + $entity_tag->tag_id = $this->randomInt(1, 3); + $this->_insert($entity_tag); + } + + // add categories 4,5 for Individuals. + for ($i = 0; $i < $this->numIndividual; $i += 2) { + $entity_tag->entity_table = 'civicrm_contact'; + $entity_tag->entity_id = $this->Individual[$i]; + if (($entity_tag->entity_id) % 3) { + $entity_tag->tag_id = $this->randomInt(4, 5); + $this->_insert($entity_tag); + } + else { + // some of the individuals are in both categories (4 and 5). + $entity_tag->tag_id = 4; + $this->_insert($entity_tag); + $entity_tag->tag_id = 5; + $this->_insert($entity_tag); + } + } + } + + /** + * This method populates the civicrm_group_contact table + */ + private function addGroup() { + // add the 3 groups first + foreach ($this->sampleData['group'] as $groupName) { + $group = new CRM_Contact_BAO_Group(); + $group->name = $group->title = $groupName; + $group->group_type = "12"; + $group->visibility = 'Public Pages'; + $group->is_active = 1; + $group->save(); + } + + // 60 are for newsletter + for ($i = 0; $i < 60; $i++) { + $groupContact = new CRM_Contact_DAO_GroupContact(); + // newsletter subscribers + $groupContact->group_id = 2; + $groupContact->contact_id = $this->Individual[$i]; + // always add members + $groupContact->status = 'Added'; + + $subscriptionHistory = new CRM_Contact_DAO_SubscriptionHistory(); + $subscriptionHistory->contact_id = $groupContact->contact_id; + + $subscriptionHistory->group_id = $groupContact->group_id; + $subscriptionHistory->status = $groupContact->status; + // method + $subscriptionHistory->method = $this->randomItem($this->subscriptionHistoryMethod); + $subscriptionHistory->date = $this->randomDate(); + if ($groupContact->status != 'Pending') { + $this->_insert($groupContact); + } + $this->_insert($subscriptionHistory); + } + + // 15 volunteers + for ($i = 0; $i < 15; $i++) { + $groupContact = new CRM_Contact_DAO_GroupContact(); + // Volunteers + $groupContact->group_id = 3; + $groupContact->contact_id = $this->Individual[$i + 60]; + // membership status + $groupContact->status = 'Added'; + + $subscriptionHistory = new CRM_Contact_DAO_SubscriptionHistory(); + $subscriptionHistory->contact_id = $groupContact->contact_id; + $subscriptionHistory->group_id = $groupContact->group_id; + $subscriptionHistory->status = $groupContact->status; + // method + $subscriptionHistory->method = $this->randomItem($this->subscriptionHistoryMethod); + $subscriptionHistory->date = $this->randomDate(); + + if ($groupContact->status != 'Pending') { + $this->_insert($groupContact); + } + $this->_insert($subscriptionHistory); + } + + // 8 advisory board group + for ($i = 0; $i < 8; $i++) { + $groupContact = new CRM_Contact_DAO_GroupContact(); + // advisory board group + $groupContact->group_id = 4; + $groupContact->contact_id = $this->Individual[$i * 7]; + // membership status + $groupContact->status = 'Added'; + + $subscriptionHistory = new CRM_Contact_DAO_SubscriptionHistory(); + $subscriptionHistory->contact_id = $groupContact->contact_id; + $subscriptionHistory->group_id = $groupContact->group_id; + $subscriptionHistory->status = $groupContact->status; + // method + $subscriptionHistory->method = $this->randomItem($this->subscriptionHistoryMethod); + $subscriptionHistory->date = $this->randomDate(); + + if ($groupContact->status != 'Pending') { + $this->_insert($groupContact); + } + $this->_insert($subscriptionHistory); + } + + //In this function when we add groups that time we are cache the contact fields + //But at the end of setup we are appending sample custom data, so for consistency + //reset the cache. + Civi::cache('fields')->flush(); + CRM_Core_BAO_Cache::resetCaches(); + } + + /** + * This method populates the civicrm_note table + */ + private function addNote() { + $params = array( + 'entity_table' => 'civicrm_contact', + 'contact_id' => 1, + 'privacy' => 0, + ); + for ($i = 0; $i < self::NUM_CONTACT; $i += 10) { + $params['entity_id'] = $this->randomItem($this->contact); + $params['note'] = $this->randomItem('note'); + $params['modified_date'] = $this->randomDate(); + $this->_addDAO('Note', $params); + } + } + + /** + * This method populates the civicrm_activity_history table + */ + private function addActivity() { + $contactDAO = new CRM_Contact_DAO_Contact(); + $contactDAO->contact_type = 'Individual'; + $contactDAO->selectAdd(); + $contactDAO->selectAdd('id'); + $contactDAO->orderBy('sort_name'); + $contactDAO->find(); + + $count = 0; + $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); + while ($contactDAO->fetch()) { + if ($count++ > 2) { + break; + } + for ($i = 0; $i < self::NUM_ACTIVITY; $i++) { + $activityDAO = new CRM_Activity_DAO_Activity(); + $activityId = CRM_Core_OptionGroup::values('activity_type', NULL, NULL, NULL, ' AND v.name IN ("Tell A Friend", "Pledge Acknowledgment")'); + $activityTypeID = $this->randomIndex($activityId); + $activity = CRM_Core_PseudoConstant::activityType(); + $activityDAO->activity_type_id = $activityTypeID; + $activityDAO->subject = "Subject for $activity[$activityTypeID]"; + $activityDAO->activity_date_time = $this->randomDate(); + $activityDAO->status_id = 2; + $this->_insert($activityDAO); + + $activityContactDAO = new CRM_Activity_DAO_ActivityContact(); + $activityContactDAO->activity_id = $activityDAO->id; + $activityContactDAO->contact_id = $contactDAO->id; + $activityContactDAO->record_type_id = CRM_Utils_Array::key('Activity Source', $activityContacts); + $this->_insert($activityContactDAO); + + if ($activityTypeID == 9) { + $activityContactDAO = new CRM_Activity_DAO_ActivityContact(); + $activityContactDAO->activity_id = $activityDAO->id; + $activityContactDAO->contact_id = $this->randomInt(1, 101); + $activityContactDAO->record_type_id = CRM_Utils_Array::key('Activity Targets', $activityContacts); + $this->_insert($activityContactDAO); + } + } + } + } + + /** + * @return array + */ + public function getZipCodeInfo() { + + if (!$this->stateMap) { + $query = 'SELECT id, name, abbreviation from civicrm_state_province where country_id = 1228'; + $dao = new CRM_Core_DAO(); + $dao->query($query); + $this->stateMap = array(); + while ($dao->fetch()) { + $this->stateMap[$dao->abbreviation] = $dao->id; + $this->states[$dao->id] = $dao->name; + } + } + + static $zipCodes = NULL; + if ($zipCodes === NULL) { + $zipCodes = json_decode(file_get_contents(self::getCivicrmDir() . '/sql/zipcodes.json')); + } + + $zipCode = $zipCodes[$this->randomInt(0, count($zipCodes))]; + + if ($this->stateMap[$zipCode->state]) { + $stateID = $this->stateMap[$zipCode->state]; + } + else { + $stateID = 1004; + } + + $zip = str_pad($zipCode->zip, 5, '0', STR_PAD_LEFT); + return array(1228, $stateID, $zipCode->city, $zip, $zipCode->latitude, $zipCode->longitude); + } + + /** + * @param $zipCode + * + * @return array + */ + public static function getLatLong($zipCode) { + $query = "http://maps.google.com/maps?q=$zipCode&output=js"; + $userAgent = "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0"; + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $query); + curl_setopt($ch, CURLOPT_HEADER, FALSE); + curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + + // grab URL and pass it to the browser + $outstr = curl_exec($ch); + + // close CURL resource, and free up system resources + curl_close($ch); + + $preg = "/'(<\?xml.+?)',/s"; + preg_match($preg, $outstr, $matches); + if ($matches[1]) { + $xml = simplexml_load_string($matches[1]); + $attributes = $xml->center->attributes(); + if (!empty($attributes)) { + return array((float ) $attributes['lat'], (float ) $attributes['lng']); + } + } + return array(NULL, NULL); + } + + private function addMembershipType() { + $organizationDAO = new CRM_Contact_DAO_Contact(); + $organizationDAO->id = 5; + $organizationDAO->find(TRUE); + $contact_id = $organizationDAO->contact_id; + + $membershipType = "INSERT INTO civicrm_membership_type + (name, description, member_of_contact_id, financial_type_id, minimum_fee, duration_unit, duration_interval, period_type, fixed_period_start_day, fixed_period_rollover_day, relationship_type_id, relationship_direction, visibility, weight, is_active) + VALUES + ('General', 'Regular annual membership.', " . $contact_id . ", 2, 100, 'year', 1, 'rolling',null, null, 7, 'b_a', 'Public', 1, 1), + ('Student', 'Discount membership for full-time students.', " . $contact_id . ", 2, 50, 'year', 1, 'rolling', null, null, 7, 'b_a', 'Public', 2, 1), + ('Lifetime', 'Lifetime membership.', " . $contact_id . ", 2, 1200, 'lifetime', 1, 'rolling', null, null, 7, 'b_a', 'Admin', 3, 1); + "; + $this->_query($membershipType); + } + + private function addMembership() { + $contact = new CRM_Contact_DAO_Contact(); + $contact->query("SELECT id FROM civicrm_contact where contact_type = 'Individual'"); + $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); + while ($contact->fetch()) { + $contacts[] = $contact->id; + } + $contacts = $this->shuffle($contacts); + + $randomContacts = array_slice($contacts, 20, 30); + + $sources = array('Payment', 'Donation', 'Check'); + $membershipTypes = array(1, 2); + $membershipTypeNames = array('General', 'Student'); + $statuses = array(3, 4); + + $membership = " +INSERT INTO civicrm_membership + (contact_id, membership_type_id, join_date, start_date, end_date, source, status_id) +VALUES +"; + + $activity = " +INSERT INTO civicrm_activity + (source_record_id, activity_type_id, subject, activity_date_time, duration, location, phone_id, phone_number, details, priority_id,parent_id, is_test, status_id) +VALUES +"; + + $activityContact = " +INSERT INTO civicrm_activity_contact + (activity_id, contact_id, record_type_id) +VALUES +"; + + $currentActivityID = CRM_Core_DAO::singleValueQuery("SELECT MAX(id) FROM civicrm_activity"); + $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); + foreach ($randomContacts as $count => $dontCare) { + $source = $this->randomItem($sources); + $activitySourceId = $count + 1; + $currentActivityID++; + $activityContact .= "( $currentActivityID, {$randomContacts[$count]}, {$sourceID} )"; + if ((($count + 1) % 11 == 0)) { + // lifetime membership, status can be anything + $startDate = date('Y-m-d', mktime(0, 0, 0, date('m'), (date('d') - $count), date('Y'))); + $membership .= "( {$randomContacts[$count]}, 3, '{$startDate}', '{$startDate}', null, '{$source}', 1)"; + $activity .= "( {$activitySourceId}, 7, 'Lifetime', '{$startDate} 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 )"; + } + elseif (($count + 1) % 5 == 0) { + // Grace or expired, memberhsip type is random of 1 & 2 + $randIndex = $this->randomIndex($membershipTypes); + $membershipTypeId = $membershipTypes[$randIndex]; + $membershipStatusId = $statuses[$randIndex]; + $membershipTypeName = $membershipTypeNames[$randIndex]; + $YearFactor = $membershipTypeId * 2; + //reverse the type and consider as year factor. + if ($YearFactor != 2) { + $YearFactor = 1; + } + $dateFactor = ($count * ($YearFactor) * ($YearFactor) * ($YearFactor)); + $startDate = date('Y-m-d', mktime(0, 0, 0, + date('m'), + (date('d') - ($dateFactor)), + (date('Y') - ($YearFactor)) + )); + $partOfDate = explode('-', $startDate); + $endDate = date('Y-m-d', mktime(0, 0, 0, + $partOfDate[1], + ($partOfDate[2] - 1), + ($partOfDate[0] + ($YearFactor)) + )); + + $membership .= "( {$randomContacts[$count]}, {$membershipTypeId}, '{$startDate}', '{$startDate}', '{$endDate}', '{$source}', {$membershipStatusId})"; + $activity .= "( {$activitySourceId}, 7, '{$membershipTypeName}', '{$startDate} 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 )"; + } + elseif (($count + 1) % 2 == 0) { + // membership type 2 + $startDate = date('Y-m-d', mktime(0, 0, 0, date('m'), (date('d') - $count), date('Y'))); + $endDate = date('Y-m-d', mktime(0, 0, 0, date('m'), (date('d') - ($count + 1)), (date('Y') + 1))); + $membership .= "( {$randomContacts[$count]}, 2, '{$startDate}', '{$startDate}', '{$endDate}', '{$source}', 1)"; + $activity .= "( {$activitySourceId}, 7, 'Student', '{$startDate} 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 )"; + } + else { + // membership type 1 + $startDate = date('Y-m-d', mktime(0, 0, 0, date('m'), (date('d') - $count), date('Y'))); + $endDate = date('Y-m-d', mktime(0, 0, 0, date('m'), (date('d') - ($count + 1)), (date('Y') + 2))); + $membership .= "( {$randomContacts[$count]}, 1, '{$startDate}', '{$startDate}', '{$endDate}', '{$source}', 1)"; + $activity .= "( {$activitySourceId}, 7, 'General', '{$startDate} 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 )"; + } + + if ($count != 29) { + $membership .= ","; + $activity .= ","; + $activityContact .= ","; + } + } + + $this->_query($membership); + $this->_query($activity); + $this->_query($activityContact); + } + + /** + * @param $date + * + * @return string + */ + public static function repairDate($date) { + $dropArray = array('-' => '', ':' => '', ' ' => ''); + return strtr($date, $dropArray); + } + + private function addMembershipLog() { + $membership = new CRM_Member_DAO_Membership(); + $membership->query("SELECT id FROM civicrm_membership"); + while ($membership->fetch()) { + $ids[] = $membership->id; + } + foreach ($ids as $id) { + $membership = new CRM_Member_DAO_Membership(); + $membership->id = $id; + $membershipLog = new CRM_Member_DAO_MembershipLog(); + if ($membership->find(TRUE)) { + $membershipLog->membership_id = $membership->id; + $membershipLog->status_id = $membership->status_id; + $membershipLog->start_date = self::repairDate($membership->start_date); + $membershipLog->end_date = self::repairDate($membership->end_date); + $membershipLog->modified_id = $membership->contact_id; + $membershipLog->modified_date = date("Ymd"); + $membershipLog->membership_type_id = $membership->membership_type_id; + $membershipLog->save(); + } + $membershipLog = NULL; + } + } + + private function addEvent() { + $event = "INSERT INTO civicrm_address ( contact_id, location_type_id, is_primary, is_billing, street_address, street_number, street_number_suffix, street_number_predirectional, street_name, street_type, street_number_postdirectional, street_unit, supplemental_address_1, supplemental_address_2, supplemental_address_3, city, county_id, state_province_id, postal_code_suffix, postal_code, usps_adc, country_id, geo_code_1, geo_code_2, timezone) + VALUES + ( NULL, 1, 1, 1, '14S El Camino Way E', 14, 'S', NULL, 'El Camino', 'Way', NULL, NULL, NULL, NULL, NULL, 'Collinsville', NULL, 1006, NULL, '6022', NULL, 1228, 41.8328, -72.9253, NULL), + ( NULL, 1, 1, 1, '11B Woodbridge Path SW', 11, 'B', NULL, 'Woodbridge', 'Path', NULL, NULL, NULL, NULL, NULL, 'Dayton', NULL, 1034, NULL, '45417', NULL, 1228, 39.7531, -84.2471, NULL), + ( NULL, 1, 1, 1, '581O Lincoln Dr SW', 581, 'O', NULL, 'Lincoln', 'Dr', NULL, NULL, NULL, NULL, NULL, 'Santa Fe', NULL, 1030, NULL, '87594', NULL, 1228, 35.5212, -105.982, NULL) + "; + $this->_query($event); + + $sql = "SELECT id from civicrm_address where street_address = '14S El Camino Way E'"; + $eventAdd1 = CRM_Core_DAO::singleValueQuery($sql); + $sql = "SELECT id from civicrm_address where street_address = '11B Woodbridge Path SW'"; + $eventAdd2 = CRM_Core_DAO::singleValueQuery($sql); + $sql = "SELECT id from civicrm_address where street_address = '581O Lincoln Dr SW'"; + $eventAdd3 = CRM_Core_DAO::singleValueQuery($sql); + + $event = "INSERT INTO civicrm_email (contact_id, location_type_id, email, is_primary, is_billing, on_hold, hold_date, reset_date) + VALUES + (NULL, 1, 'development@example.org', 0, 0, 0, NULL, NULL), + (NULL, 1, 'tournaments@example.org', 0, 0, 0, NULL, NULL), + (NULL, 1, 'celebration@example.org', 0, 0, 0, NULL, NULL) + "; + $this->_query($event); + + $sql = "SELECT id from civicrm_email where email = 'development@example.org'"; + $eventEmail1 = CRM_Core_DAO::singleValueQuery($sql); + $sql = "SELECT id from civicrm_email where email = 'tournaments@example.org'"; + $eventEmail2 = CRM_Core_DAO::singleValueQuery($sql); + $sql = "SELECT id from civicrm_email where email = 'celebration@example.org'"; + $eventEmail3 = CRM_Core_DAO::singleValueQuery($sql); + + $event = "INSERT INTO civicrm_phone (contact_id, location_type_id, is_primary, is_billing, mobile_provider_id, phone, phone_numeric, phone_type_id) + VALUES + (NULL, 1, 0, 0, NULL, '204 222-1000', '2042221000', '1'), + (NULL, 1, 0, 0, NULL, '204 223-1000', '2042231000', '1'), + (NULL, 1, 0, 0, NULL, '303 323-1000', '3033231000', '1') + "; + $this->_query($event); + + $sql = "SELECT id from civicrm_phone where phone = '204 222-1000'"; + $eventPhone1 = CRM_Core_DAO::singleValueQuery($sql); + $sql = "SELECT id from civicrm_phone where phone = '204 223-1000'"; + $eventPhone2 = CRM_Core_DAO::singleValueQuery($sql); + $sql = "SELECT id from civicrm_phone where phone = '303 323-1000'"; + $eventPhone3 = CRM_Core_DAO::singleValueQuery($sql); + + $event = "INSERT INTO civicrm_loc_block ( address_id, email_id, phone_id, address_2_id, email_2_id, phone_2_id) + VALUES + ( $eventAdd1, $eventEmail1, $eventPhone1, NULL,NULL,NULL), + ( $eventAdd2, $eventEmail2, $eventPhone2, NULL,NULL,NULL), + ( $eventAdd3, $eventEmail3, $eventPhone3, NULL,NULL,NULL) + "; + + $this->_query($event); + + $sql = "SELECT id from civicrm_loc_block where phone_id = $eventPhone1 AND email_id = $eventEmail1 AND address_id = $eventAdd1"; + $eventLok1 = CRM_Core_DAO::singleValueQuery($sql); + $sql = "SELECT id from civicrm_loc_block where phone_id = $eventPhone2 AND email_id = $eventEmail2 AND address_id = $eventAdd2"; + $eventLok2 = CRM_Core_DAO::singleValueQuery($sql); + $sql = "SELECT id from civicrm_loc_block where phone_id = $eventPhone3 AND email_id = $eventEmail3 AND address_id = $eventAdd3"; + $eventLok3 = CRM_Core_DAO::singleValueQuery($sql); + + $event = "INSERT INTO civicrm_event + ( title, summary, description, event_type_id, participant_listing_id, is_public, start_date, end_date, is_online_registration, registration_link_text, max_participants, event_full_text, is_monetary, financial_type_id, is_map, is_active, fee_label, is_show_location, loc_block_id,intro_text, footer_text, confirm_title, confirm_text, confirm_footer_text, is_email_confirm, confirm_email_text, confirm_from_name, confirm_from_email, cc_confirm, bcc_confirm, default_fee_id, thankyou_title, thankyou_text, thankyou_footer_text, is_pay_later, pay_later_text, pay_later_receipt, is_multiple_registrations, allow_same_participant_emails, currency ) + VALUES + ( 'Fall Fundraiser Dinner', 'Kick up your heels at our Fall Fundraiser Dinner/Dance at Glen Echo Park! Come by yourself or bring a partner, friend or the entire family!', 'This event benefits our teen programs. Admission includes a full 3 course meal and wine or soft drinks. Grab your dancing shoes, bring the kids and come join the party!', 3, 1, 1, '" . date('Y-m-d 17:00:00', strtotime("+6 months", $this->time)) . "', '" . date('Y-m-d 17:00:00', strtotime("+6 months +2 days", $this->time)) . "', 1, 'Register Now', 100, 'Sorry! The Fall Fundraiser Dinner is full. Please call Jane at 204 222-1000 ext 33 if you want to be added to the waiting list.', 1, 4, 1, 1, 'Dinner Contribution', 1 ,$eventLok1,'Fill in the information below to join as at this wonderful dinner event.', NULL, 'Confirm Your Registration Information', 'Review the information below carefully.', NULL, 1, 'Contact the Development Department if you need to make any changes to your registration.', 'Fundraising Dept.', 'development@example.org', NULL, NULL, NULL, 'Thanks for Registering!', '

Thank you for your support. Your contribution will help us build even better tools.

Please tell your friends and colleagues about this wonderful event.

', '

Back to CiviCRM Home Page

', 1, 'I will send payment by check', 'Send a check payable to Our Organization within 3 business days to hold your reservation. Checks should be sent to: 100 Main St., Suite 3, San Francisco CA 94110', 1, 0, 'USD' ), + ( 'Summer Solstice Festival Day Concert', 'Festival Day is coming! Join us and help support your parks.', 'We will gather at noon, learn a song all together, and then join in a joyous procession to the pavilion. We will be one of many groups performing at this wonderful concert which benefits our city parks.', 5, 1, 1, '" . date('Y-m-d 12:00:00', strtotime("-1 day", $this->time)) . "', '" . date('Y-m-d 17:00:00', strtotime("-1 day", $this->time)) . "', 1, 'Register Now', 50, 'We have all the singers we can handle. Come to the pavilion anyway and join in from the audience.', 1, 2, NULL, 1, 'Festival Fee', 1, $eventLok2, 'Complete the form below and click Continue to register online for the festival. Or you can register by calling us at 204 222-1000 ext 22.', '', 'Confirm Your Registration Information', '', '', 1, 'This email confirms your registration. If you have questions or need to change your registration - please do not hesitate to call us.', 'Event Dept.', 'events@example.org', '', NULL, NULL, 'Thanks for Your Joining In!', '

Thank you for your support. Your participation will help build new parks.

Please tell your friends and colleagues about the concert.

', '

Back to CiviCRM Home Page

', 0, NULL, NULL, 1, 0, 'USD' ), + ( 'Rain-forest Cup Youth Soccer Tournament', 'Sign up your team to participate in this fun tournament which benefits several Rain-forest protection groups in the Amazon basin.', 'This is a FYSA Sanctioned Tournament, which is open to all USSF/FIFA affiliated organizations for boys and girls in age groups: U9-U10 (6v6), U11-U12 (8v8), and U13-U17 (Full Sided).', 3, 1, 1, '" . date('Y-m-d 07:00:00', strtotime("+7 months", $this->time)) . "', '" . date('Y-m-d 17:00:00', strtotime("+7 months +3 days", $this->time)) . "', 1, 'Register Now', 500, 'Sorry! All available team slots for this tournament have been filled. Contact Jill Futbol for information about the waiting list and next years event.', 1, 4, NULL, 1, 'Tournament Fees',1, $eventLok3, 'Complete the form below to register your team for this year''s tournament.', 'A Soccer Youth Event', 'Review and Confirm Your Registration Information', '', 'A Soccer Youth Event', 1, 'Contact our Tournament Director for eligibility details.', 'Tournament Director', 'tournament@example.org', '', NULL, NULL, 'Thanks for Your Support!', '

Thank you for your support. Your participation will help save thousands of acres of rainforest.

', '

Back to CiviCRM Home Page

', 0, NULL, NULL, 0, 0, 'USD' ) + "; + $this->_query($event); + + //CRM-4464 + $eventTemplates = "INSERT INTO civicrm_event + ( is_template, template_title, event_type_id, default_role_id, participant_listing_id, is_public, is_monetary, is_online_registration, is_multiple_registrations, allow_same_participant_emails, is_email_confirm, financial_type_id, fee_label, confirm_title, thankyou_title, confirm_from_name, confirm_from_email, is_active, currency ) + VALUES + ( 1, 'Free Meeting without Online Registration', 4, 1, 1, 1, 0, 0, null, null, null, null, null, null, null, null, null, 1, 'USD' ), + ( 1, 'Free Meeting with Online Registration', 4, 1, 1, 1, 0, 1, 1, 1, 0, null, null, 'Confirm Your Registration Information', 'Thanks for Registering!', null, null, 1, 'USD' ), + ( 1, 'Paid Conference with Online Registration', 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 'Conference Fee', 'Confirm Your Registration Information', 'Thanks for Registering!', 'Event Template Dept.', 'event_templates@example.org', 1, 'USD' )"; + + $this->_query($eventTemplates); + + $ufJoinValues = $tellFriendValues = array(); + $profileID = CRM_Core_DAO::singleValueQuery("Select id from civicrm_uf_group where name ='event_registration'"); + + // grab id's for all events and event templates + $query = " +SELECT id + FROM civicrm_event"; + + $template = CRM_Core_DAO::executeQuery($query); + while ($template->fetch()) { + if ($profileID) { + $ufJoinValues[] = "( 1, 'CiviEvent', 'civicrm_event', {$template->id}, 1, {$profileID} )"; + } + $tellFriendValues[] = "( 'civicrm_event', {$template->id}, 'Tell A Friend', '

Help us spread the word about this event. Use the space below to personalize your email message - let your friends know why you''re attending. Then fill in the name(s) and email address(es) and click ''Send Your Message''.

', 'Thought you might be interested in checking out this event. I''m planning on attending.', NULL, 'Thanks for Spreading the Word', '

Thanks for spreading the word about this event to your friends.

', 1)"; + } + + //insert values in civicrm_uf_join for the required event_registration profile - CRM-9587 + if (!empty($ufJoinValues)) { + $includeProfile = "INSERT INTO civicrm_uf_join + (is_active, module, entity_table, entity_id, weight, uf_group_id ) + VALUES " . implode(',', $ufJoinValues); + $this->_query($includeProfile); + } + + //insert values in civicrm_tell_friend + if (!empty($tellFriendValues)) { + $tellFriend = "INSERT INTO civicrm_tell_friend + (entity_table, entity_id, title, intro, suggested_message, + general_link, thankyou_title, thankyou_text, is_active) + VALUES " . implode(',', $tellFriendValues); + $this->_query($tellFriend); + } + } + + private function addParticipant() { + $contact = new CRM_Contact_DAO_Contact(); + $contact->query("SELECT id FROM civicrm_contact"); + while ($contact->fetch()) { + $contacts[] = $contact->id; + } + $contacts = $this->shuffle($contacts); + $randomContacts = array_slice($contacts, 20, 50); + + $participant = " +INSERT INTO civicrm_participant + (contact_id, event_id, status_id, role_id, register_date, source, fee_level, is_test, fee_amount, fee_currency) +VALUES + ( " . $randomContacts[0] . ", 1, 1, 1, '2009-01-21', 'Check', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[1] . ", 2, 2, 2, '2008-05-07', 'Credit Card', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[2] . ", 3, 3, 3, '2008-05-05', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD') , + ( " . $randomContacts[3] . ", 1, 4, 4, '2008-10-21', 'Direct Transfer', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[4] . ", 2, 1, 1, '2008-01-10', 'Check', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[5] . ", 3, 2, 2, '2008-03-05', 'Direct Transfer', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[6] . ", 1, 3, 3, '2009-07-21', 'Direct Transfer', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[7] . ", 2, 4, 4, '2009-03-07', 'Credit Card', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[8] . ", 3, 1, 1, '2008-02-05', 'Direct Transfer', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[9] . ", 1, 2, 2, '2008-02-01', 'Check', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[10] . ", 2, 3, 3, '2009-01-10', 'Direct Transfer', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[11] . ", 3, 4, 4, '2009-03-06', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[12] . ", 1, 1, 2, '2008-06-04', 'Credit Card', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[13] . ", 2, 2, 3, '2008-01-10', 'Direct Transfer', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[14] . ", 3, 4, 1, '2008-07-04', 'Check', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[15] . ", 1, 4, 2, '2009-01-21', 'Credit Card', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[16] . ", 2, 2, 3, '2008-01-10', 'Credit Card', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[17] . ", 3, 3, 1, '2009-03-05', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[18] . ", 1, 2, 1, '2008-10-21', 'Direct Transfer', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[19] . ", 2, 4, 1, '2009-01-10', 'Credit Card', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[20] . ", 3, 1, 4, '2008-03-25', 'Check', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[21] . ", 1, 2, 3, '2009-10-21', 'Direct Transfer', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[22] . ", 2, 4, 1, '2008-01-10', 'Direct Transfer', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[23] . ", 3, 3, 1, '2008-03-11', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[24] . ", 3, 2, 2, '2008-04-05', 'Direct Transfer', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[25] . ", 1, 1, 1, '2009-01-21', 'Check', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[26] . ", 2, 2, 2, '2008-05-07', 'Credit Card', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[27] . ", 3, 3, 3, '2009-12-12', 'Direct Transfer', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[28] . ", 1, 4, 4, '2009-12-13', 'Credit Card', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[29] . ", 2, 1, 1, '2009-12-14', 'Direct Transfer', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[30] . ", 3, 2, 2, '2009-12-15', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[31] . ", 1, 3, 3, '2009-07-21', 'Check', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[32] . ", 2, 4, 4, '2009-03-07', 'Direct Transfer', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[33] . ", 3, 1, 1, '2009-12-15', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[34] . ", 1, 2, 2, '2009-12-13', 'Direct Transfer', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[35] . ", 2, 3, 3, '2009-01-10', 'Direct Transfer', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[36] . ", 3, 4, 4, '2009-03-06', 'Check', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[37] . ", 1, 1, 2, '2009-12-13', 'Direct Transfer', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[38] . ", 2, 2, 3, '2008-01-10', 'Direct Transfer', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[39] . ", 3, 4, 1, '2009-12-14', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[40] . ", 1, 4, 2, '2009-01-21', 'Credit Card', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[41] . ", 2, 2, 3, '2009-12-15', 'Credit Card', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[42] . ", 3, 3, 1, '2009-03-05', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[43] . ", 1, 2, 1, '2009-12-13', 'Direct Transfer', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[44] . ", 2, 4, 1, '2009-01-10', 'Direct Transfer', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[45] . ", 3, 1, 4, '2009-12-13', 'Check', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[46] . ", 1, 2, 3, '2009-10-21', 'Credit Card', 'Single', 0, 50, 'USD'), + ( " . $randomContacts[47] . ", 2, 4, 1, '2009-12-10', 'Credit Card', 'Soprano', 0, 50, 'USD'), + ( " . $randomContacts[48] . ", 3, 3, 1, '2009-03-11', 'Credit Card', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'), + ( " . $randomContacts[49] . ", 3, 2, 2, '2009-04-05', 'Check', 'Tiny-tots (ages 5-8)', 0, 800, 'USD'); +"; + $this->_query($participant); + + $query = " +INSERT INTO civicrm_activity + (source_record_id, activity_type_id, subject, activity_date_time, duration, location, phone_id, phone_number, details, priority_id,parent_id, is_test, status_id) +VALUES + (01, 5, 'NULL', '2009-01-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (02, 5, 'NULL', '2008-05-07 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (03, 5, 'NULL', '2008-05-05 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (04, 5, 'NULL', '2008-10-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (05, 5, 'NULL', '2008-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (06, 5, 'NULL', '2008-03-05 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (07, 5, 'NULL', '2009-07-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (08, 5, 'NULL', '2009-03-07 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (09, 5, 'NULL', '2008-02-05 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (10, 5, 'NULL', '2008-02-01 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (11, 5, 'NULL', '2009-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (12, 5, 'NULL', '2009-03-06 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (13, 5, 'NULL', '2008-06-04 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (14, 5, 'NULL', '2008-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (15, 5, 'NULL', '2008-07-04 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (16, 5, 'NULL', '2009-01-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (17, 5, 'NULL', '2008-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (18, 5, 'NULL', '2009-03-05 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (19, 5, 'NULL', '2008-10-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (20, 5, 'NULL', '2009-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (21, 5, 'NULL', '2008-03-25 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (22, 5, 'NULL', '2009-10-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (23, 5, 'NULL', '2008-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (24, 5, 'NULL', '2008-03-11 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (25, 5, 'NULL', '2008-04-05 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (26, 5, 'NULL', '2009-01-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (27, 5, 'NULL', '2008-05-07 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (28, 5, 'NULL', '2009-12-12 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (29, 5, 'NULL', '2009-12-13 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (30, 5, 'NULL', '2009-12-14 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (31, 5, 'NULL', '2009-12-15 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (32, 5, 'NULL', '2009-07-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (33, 5, 'NULL', '2009-03-07 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (34, 5, 'NULL', '2009-12-15 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (35, 5, 'NULL', '2009-12-13 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (36, 5, 'NULL', '2009-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (37, 5, 'NULL', '2009-03-06 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (38, 5, 'NULL', '2009-12-13 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (39, 5, 'NULL', '2008-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (40, 5, 'NULL', '2009-12-14 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (41, 5, 'NULL', '2009-01-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (42, 5, 'NULL', '2009-12-15 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (43, 5, 'NULL', '2009-03-05 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (44, 5, 'NULL', '2009-12-13 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (45, 5, 'NULL', '2009-01-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (46, 5, 'NULL', '2009-12-13 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (47, 5, 'NULL', '2009-10-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (48, 5, 'NULL', '2009-12-10 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (49, 5, 'NULL', '2009-03-11 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (50, 5, 'NULL', '2009-04-05 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ) + "; + $this->_query($query); + + $activityContact = " +INSERT INTO civicrm_activity_contact + (contact_id, activity_id, record_type_id) +VALUES +"; + $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); + $currentActivityID = CRM_Core_DAO::singleValueQuery("SELECT MAX(id) FROM civicrm_activity"); + $currentActivityID -= 50; + $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); + for ($i = 0; $i < 50; $i++) { + $currentActivityID++; + $activityContact .= "({$randomContacts[$i]}, $currentActivityID, $sourceID)"; + if ($i != 49) { + $activityContact .= ", "; + } + } + $this->_query($activityContact); + } + + private function addPCP() { + $query = " +INSERT INTO `civicrm_pcp` + (contact_id, status_id, title, intro_text, page_text, donate_link_text, page_id, page_type, is_thermometer, is_honor_roll, goal_amount, currency, is_active, pcp_block_id, is_notify) +VALUES + ({$this->Individual[3]}, 2, 'My Personal Civi Fundraiser', 'I''m on a mission to get all my friends and family to help support my favorite open-source civic sector CRM.', '

Friends and family - please help build much needed infrastructure for the civic sector by supporting my personal campaign!

\r\n

You can learn more about CiviCRM here.

\r\n

Then click the Contribute Now button to go to our easy-to-use online contribution form.

', 'Contribute Now', 1, 'contribute', 1, 1, 5000.00, 'USD', 1, 1, 1); +"; + $this->_query($query); + } + + private function addContribution() { + $query = " +INSERT INTO civicrm_contribution + (contact_id, financial_type_id, payment_instrument_id, receive_date, non_deductible_amount, total_amount, trxn_id, check_number, currency, cancel_date, cancel_reason, receipt_date, thankyou_date, source ) +VALUES + (2, 1, 4, '2010-04-11 00:00:00', 0.00, 125.00, NULL, '1041', 'USD', NULL, NULL, NULL, NULL, 'Apr 2007 Mailer 1' ), + (4, 1, 1, '2010-03-21 00:00:00', 0.00, 50.00, 'P20901X1', NULL, 'USD', NULL, NULL, NULL, NULL, 'Online: Save the Penguins' ), + (6, 1, 4, '2010-04-29 00:00:00', 0.00, 25.00, NULL, '2095', 'USD', NULL, NULL, NULL, NULL, 'Apr 2007 Mailer 1' ), + (8, 1, 4, '2010-04-11 00:00:00', 0.00, 50.00, NULL, '10552', 'USD', NULL, NULL, NULL, NULL, 'Apr 2007 Mailer 1' ), + (16, 1, 4, '2010-04-15 00:00:00', 0.00, 500.00, NULL, '509', 'USD', NULL, NULL, NULL, NULL, 'Apr 2007 Mailer 1' ), + (19, 1, 4, '2010-04-11 00:00:00', 0.00, 175.00, NULL, '102', 'USD', NULL, NULL, NULL, NULL, 'Apr 2007 Mailer 1' ), + (82, 1, 1, '2010-03-27 00:00:00', 0.00, 50.00, 'P20193L2', NULL, 'USD', NULL, NULL, NULL, NULL, 'Online: Save the Penguins' ), + (92, 1, 1, '2010-03-08 00:00:00', 0.00, 10.00, 'P40232Y3', NULL, 'USD', NULL, NULL, NULL, NULL, 'Online: Help CiviCRM' ), + (34, 1, 1, '2010-04-22 00:00:00', 0.00, 250.00, 'P20193L6', NULL, 'USD', NULL, NULL, NULL, NULL, 'Online: Help CiviCRM' ), + (71, 1, 1, '2009-07-01 11:53:50', 0.00, 500.00, 'PL71', NULL, 'USD', NULL, NULL, NULL, NULL, NULL ), + (43, 1, 1, '2009-07-01 12:55:41', 0.00, 200.00, 'PL43II', NULL, 'USD', NULL, NULL, NULL, NULL, NULL ), + (32, 1, 1, '2009-10-01 11:53:50', 0.00, 200.00, 'PL32I', NULL, 'USD', NULL, NULL, NULL, NULL, NULL ), + (32, 1, 1, '2009-12-01 12:55:41', 0.00, 200.00, 'PL32II', NULL, 'USD', NULL, NULL, NULL, NULL, NULL ); +"; + $this->_query($query); + + $currentActivityID = CRM_Core_DAO::singleValueQuery("SELECT MAX(id) FROM civicrm_activity"); + $query = " +INSERT INTO civicrm_activity + (source_record_id, activity_type_id, subject, activity_date_time, duration, location, phone_id, phone_number, details, priority_id,parent_id, is_test, status_id) +VALUES + (1, 6, '$ 125.00-Apr 2007 Mailer 1', '2010-04-11 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (2, 6, '$ 50.00-Online: Save the Penguins', '2010-03-21 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (3, 6, '$ 25.00-Apr 2007 Mailer 1', '2010-04-29 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (4, 6, '$ 50.00-Apr 2007 Mailer 1', '2010-04-11 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (5, 6, '$ 500.00-Apr 2007 Mailer 1', '2010-04-15 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (6, 6, '$ 175.00-Apr 2007 Mailer 1', '2010-04-11 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (7, 6, '$ 50.00-Online: Save the Penguins', '2010-03-27 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (8, 6, '$ 10.00-Online: Save the Penguins', '2010-03-08 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (9, 6, '$ 250.00-Online: Save the Penguins', '2010-04-22 00:00:00', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (10, 6, NULL, '2009-07-01 11:53:50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (11, 6, NULL, '2009-07-01 12:55:41', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (12, 6, NULL, '2009-10-01 11:53:50', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ), + (13, 6, NULL, '2009-12-01 12:55:41', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2 ); + "; + $this->_query($query); + + $activityContact = " +INSERT INTO civicrm_activity_contact + (contact_id, activity_id, record_type_id) +VALUES +"; + + $arbitraryNumbers = array(2, 4, 6, 8, 16, 19, 82, 92, 34, 71, 43, 32, 32); + for ($i = 0; $i < count($arbitraryNumbers); $i++) { + $currentActivityID++; + $activityContact .= "({$arbitraryNumbers[$i]}, $currentActivityID, 2)"; + if ($i != count($arbitraryNumbers) - 1) { + $activityContact .= ", "; + } + } + $this->_query($activityContact); + } + + private function addSoftContribution() { + + $sql = "SELECT id from civicrm_contribution where contact_id = 92"; + $contriId1 = CRM_Core_DAO::singleValueQuery($sql); + + $sql = "SELECT id from civicrm_contribution where contact_id = 34"; + $contriId2 = CRM_Core_DAO::singleValueQuery($sql); + + $sql = "SELECT cov.value FROM civicrm_option_value cov LEFT JOIN civicrm_option_group cog ON cog.id = cov.option_group_id WHERE cov.name = 'pcp' AND cog.name = 'soft_credit_type'"; + + $pcpId = CRM_Core_DAO::singleValueQuery($sql); + + $query = " +INSERT INTO `civicrm_contribution_soft` + ( contribution_id, contact_id ,amount , currency, pcp_id , pcp_display_in_roll ,pcp_roll_nickname,pcp_personal_note, soft_credit_type_id ) +VALUES + ( $contriId1, {$this->Individual[3]}, 10.00, 'USD', 1, 1, 'Jones Family', 'Helping Hands', $pcpId), + ( $contriId2, {$this->Individual[3]}, 250.00, 'USD', 1, 1, 'Annie and the kids', 'Annie Helps', $pcpId); + "; + + $this->_query($query); + } + + private function addPledge() { + $pledge = "INSERT INTO civicrm_pledge + (contact_id, financial_type_id, contribution_page_id, amount, original_installment_amount, currency,frequency_unit, frequency_interval, frequency_day, installments, start_date, create_date, acknowledge_date, modified_date, cancel_date, end_date, status_id, is_test) + VALUES + (71, 1, 1, 500.00, '500', 'USD', 'month', 1, 1, 1, '2009-07-01 00:00:00', '2009-06-26 00:00:00', NULL, NULL, NULL,'2009-07-01 00:00:00', 1, 0), + (43, 1, 1, 800.00, '200', 'USD', 'month', 3, 1, 4, '2009-07-01 00:00:00', '2009-06-23 00:00:00', '2009-06-23 00:00:00', NULL, NULL, '2009-04-01 10:11:40', 5, 0), + (32, 1, 1, 600.00, '200', 'USD', 'month', 1, 1, 3, '2009-10-01 00:00:00', '2009-09-14 00:00:00', '2009-09-14 00:00:00', NULL, NULL, '2009-12-01 00:00:00', 5, 0); +"; + $this->_query($pledge); + } + + private function addPledgePayment() { + $pledgePayment = "INSERT INTO civicrm_pledge_payment + ( pledge_id, contribution_id, scheduled_amount, actual_amount, currency, scheduled_date, reminder_date, reminder_count, status_id) + VALUES + (1, 10, 500.00, 500.00, 'USD','2009-07-01 00:00:00', null, 0, 1 ), + (2, 11, 200.00, 200.00, 'USD','2009-07-01 00:00:00', null, 0, 1 ), + (2, null, 200.00, null, 'USD', '2009-10-01 00:00:00', null, 0, 2 ), + (2, null, 200.00, null, 'USD', '2009-01-01 00:00:00', null, 0, 2 ), + (2, null, 200.00, null, 'USD', '2009-04-01 00:00:00', null, 0, 2 ), + + (3, 12, 200.00, 200.00, 'USD', '2009-10-01 00:00:00', null, 0, 1 ), + (3, 13, 200.00, 200.00, 'USD', '2009-11-01 00:0:00', '2009-10-28 00:00:00', 1, 1), + (3, null, 200.00, null, 'USD', '2009-12-01 00:00:00', null, 0, 2 ); + "; + $this->_query($pledgePayment); + } + + private function addContributionLineItem() { + $query = " INSERT INTO civicrm_line_item (`entity_table`, `entity_id`, contribution_id, `price_field_id`, `label`, `qty`, `unit_price`, `line_total`, `participant_count`, `price_field_value_id`, `financial_type_id`) +SELECT 'civicrm_contribution', cc.id, cc.id contribution_id, cpf.id as price_field, cpfv.label, 1, cc.total_amount, cc.total_amount line_total, 0, cpfv.id as price_field_value, cpfv.financial_type_id +FROM civicrm_contribution cc +LEFT JOIN civicrm_price_set cps ON cps.name = 'default_contribution_amount' +LEFT JOIN civicrm_price_field cpf ON cpf.price_set_id = cps.id +LEFT JOIN civicrm_price_field_value cpfv ON cpfv.price_field_id = cpf.id +order by cc.id; "; + $this->_query($query); + } + + private function addAccountingEntries() { + $components = array('contribution', 'membership', 'participant'); + $select = 'SELECT contribution.id contribution_id, cli.id as line_item_id, contribution.contact_id, contribution.receive_date, contribution.total_amount, contribution.currency, cli.label, + cli.financial_type_id, cefa.financial_account_id, contribution.payment_instrument_id, contribution.check_number, contribution.trxn_id'; + $where = 'WHERE cefa.account_relationship = 1'; + $financialAccountId = CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount(4); + foreach ($components as $component) { + if ($component == 'contribution') { + $from = 'FROM `civicrm_contribution` contribution'; + } + else { + $from = " FROM `civicrm_{$component}` {$component} + INNER JOIN civicrm_{$component}_payment cpp ON cpp.{$component}_id = {$component}.id + INNER JOIN civicrm_contribution contribution on contribution.id = cpp.contribution_id"; + } + $from .= " INNER JOIN civicrm_line_item cli ON cli.entity_id = {$component}.id and cli.entity_table = 'civicrm_{$component}' + INNER JOIN civicrm_entity_financial_account cefa ON cefa.entity_id = cli.financial_type_id "; + $sql = " {$select} {$from} {$where} "; + $result = CRM_Core_DAO::executeQuery($sql); + $this->addFinancialItem($result, $financialAccountId); + } + } + + /** + * @param $result + * @param null $financialAccountId + */ + private function addFinancialItem($result, $financialAccountId) { + $defaultFinancialAccount = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_financial_account WHERE is_default = 1 AND financial_account_type_id = 1"); + while ($result->fetch()) { + $trxnParams = array( + 'trxn_date' => CRM_Utils_Date::processDate($result->receive_date), + 'total_amount' => $result->total_amount, + 'currency' => $result->currency, + 'status_id' => 1, + 'trxn_id' => $result->trxn_id, + 'contribution_id' => $result->contribution_id, + 'to_financial_account_id' => empty($financialAccountId[$result->payment_instrument_id]) ? $defaultFinancialAccount : $financialAccountId[$result->payment_instrument_id], + 'payment_instrument_id' => $result->payment_instrument_id, + 'check_number' => $result->check_number, + 'is_payment' => 1, + ); + $trxn = CRM_Core_BAO_FinancialTrxn::create($trxnParams); + $financialItem = array( + 'transaction_date' => CRM_Utils_Date::processDate($result->receive_date), + 'amount' => $result->total_amount, + 'currency' => $result->currency, + 'status_id' => 1, + 'entity_id' => $result->line_item_id, + 'contact_id' => $result->contact_id, + 'entity_table' => 'civicrm_line_item', + 'description' => $result->label, + 'financial_account_id' => $result->financial_account_id, + ); + $trxnId['id'] = $trxn->id; + CRM_Financial_BAO_FinancialItem::create($financialItem, NULL, $trxnId); + } + } + + private function addLineItemParticipants() { + $participant = new CRM_Event_DAO_Participant(); + $participant->query("INSERT INTO civicrm_line_item (`entity_table`, `entity_id`, contribution_id, `price_field_id`, `label`, `qty`, `unit_price`, `line_total`, `participant_count`, `price_field_value_id`, `financial_type_id`) +SELECT 'civicrm_participant', cp.id, cpp.contribution_id, cpfv.price_field_id, cpfv.label, 1, cpfv.amount, cpfv.amount as line_total, 0, cpfv.id, cpfv.financial_type_id FROM civicrm_participant cp LEFT JOIN civicrm_participant_payment cpp ON cpp.participant_id = cp.id +LEFT JOIN civicrm_price_set_entity cpe ON cpe.entity_id = cp.event_id LEFT JOIN civicrm_price_field cpf ON cpf.price_set_id = cpe.price_set_id LEFT JOIN civicrm_price_field_value cpfv ON cpfv.price_field_id = cpf.id WHERE cpfv.label = cp.fee_level"); + } + + private function addMembershipPayment() { + $maxContribution = CRM_Core_DAO::singleValueQuery("select max(id) from civicrm_contribution"); + $financialTypeID = CRM_Core_DAO::singleValueQuery("select id from civicrm_financial_type where name = 'Member Dues'"); + $paymentInstrumentID = CRM_Core_DAO::singleValueQuery("select value from civicrm_option_value where name = 'Credit Card' AND option_group_id = (SELECT id from civicrm_option_group where name = 'payment_instrument')"); + $sql = "INSERT INTO civicrm_contribution (contact_id,financial_type_id,payment_instrument_id, receive_date, total_amount, currency, source, contribution_status_id) +SELECT cm.contact_id, $financialTypeID, $paymentInstrumentID, now(), cmt.minimum_fee, 'USD', CONCAT(cmt.name, ' Membership: Offline signup'), 1 FROM `civicrm_membership` cm +LEFT JOIN civicrm_membership_type cmt ON cmt.id = cm.membership_type_id;"; + + $this->_query($sql); + + $sql = "INSERT INTO civicrm_membership_payment (contribution_id,membership_id) +SELECT cc.id, cm.id FROM civicrm_contribution cc +LEFT JOIN civicrm_membership cm ON cm.contact_id = cc.contact_id +WHERE cc.id > $maxContribution;"; + + $this->_query($sql); + + $sql = "INSERT INTO civicrm_line_item (entity_table, entity_id, contribution_id, price_field_value_id, price_field_id, label, qty, unit_price, line_total, financial_type_id) +SELECT 'civicrm_membership', cm.id, cmp.contribution_id, cpfv.id, cpfv.price_field_id, cpfv.label, 1, cpfv.amount, cpfv.amount as unit_price, cpfv.financial_type_id FROM `civicrm_membership` cm +LEFT JOIN civicrm_membership_payment cmp ON cmp.membership_id = cm.id +LEFT JOIN civicrm_price_field_value cpfv ON cpfv.membership_type_id = cm.membership_type_id +LEFT JOIN civicrm_price_field cpf ON cpf.id = cpfv.price_field_id +LEFT JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id +WHERE cps.name = 'default_membership_type_amount'"; + $this->_query($sql); + + $sql = "INSERT INTO civicrm_activity(source_record_id, activity_type_id, subject, activity_date_time, status_id, details) +SELECT id, 6, CONCAT('$ ', total_amount, ' - ', source), now(), 2, 'Membership Payment' FROM civicrm_contribution WHERE id > $maxContribution"; + $this->_query($sql); + + $sql = "INSERT INTO civicrm_activity_contact(contact_id, activity_id, record_type_id) +SELECT c.contact_id, a.id, 2 +FROM civicrm_contribution c, civicrm_activity a +WHERE c.id > $maxContribution +AND a.source_record_id = c.id +AND a.details = 'Membership Payment' +"; + $this->_query($sql); + } + + private function addParticipantPayment() { + $maxContribution = CRM_Core_DAO::singleValueQuery("select max(id) from civicrm_contribution"); + $financialTypeID = CRM_Core_DAO::singleValueQuery("select id from civicrm_financial_type where name = 'Event Fee'"); + $paymentInstrumentID = CRM_Core_DAO::singleValueQuery("select value from civicrm_option_value where name = 'Credit Card' AND option_group_id = (SELECT id from civicrm_option_group where name = 'payment_instrument')"); + $sql = "INSERT INTO civicrm_contribution (contact_id, financial_type_id, payment_instrument_id, receive_date, total_amount, currency, receipt_date, source, contribution_status_id) +SELECT `contact_id`, $financialTypeID, $paymentInstrumentID, now(), `fee_amount`, 'USD', now(), CONCAT(ce.title, ' : Offline registration'), 1 FROM `civicrm_participant` cp +LEFT JOIN civicrm_event ce ON ce.id = cp.event_id +group by `contact_id`, `fee_amount`, `title`;"; + + $this->_query($sql); + + $sql = "INSERT INTO civicrm_participant_payment (contribution_id,participant_id) +SELECT cc.id, cp.id FROM civicrm_contribution cc +LEFT JOIN civicrm_participant cp ON cp.contact_id = cc.contact_id +WHERE cc.id > $maxContribution"; + + $this->_query($sql); + + $sql = "INSERT INTO civicrm_activity(source_record_id, activity_type_id, subject, activity_date_time, status_id, details) +SELECT id, 6, CONCAT('$ ', total_amount, ' - ', source), now(), 2, 'Participant' FROM `civicrm_contribution` WHERE id > $maxContribution"; + $this->_query($sql); + + $sql = "INSERT INTO civicrm_activity_contact(contact_id, activity_id, record_type_id) +SELECT c.contact_id, a.id, 2 +FROM civicrm_contribution c, civicrm_activity a +WHERE c.id > $maxContribution +AND a.source_record_id = c.id +AND a.details = 'Participant Payment' +"; + $this->_query($sql); + } + + /** + * @return string + */ + protected static function getCivicrmDir():string { + return dirname(dirname(dirname(__DIR__))); + } + +} diff --git a/CRM/Core/CodeGen/Main.php b/CRM/Core/CodeGen/Main.php index 1b754b959fb4..d10810225961 100644 --- a/CRM/Core/CodeGen/Main.php +++ b/CRM/Core/CodeGen/Main.php @@ -5,6 +5,10 @@ */ class CRM_Core_CodeGen_Main { public $buildVersion; + + /** + * @var string + */ public $db_version; /** * drupal, joomla, wordpress @@ -76,11 +80,11 @@ public function __construct($CoreDAOCodePath, $sqlCodePath, $phpCodePath, $tplCo $versionFile = $this->phpCodePath . "/xml/version.xml"; $versionXML = CRM_Core_CodeGen_Util_Xml::parse($versionFile); - $this->db_version = $versionXML->version_no; + $this->db_version = (string) $versionXML->version_no; $this->buildVersion = preg_replace('/^(\d{1,2}\.\d{1,2})\.(\d{1,2}|\w{4,7})$/i', '$1', $this->db_version); if (isset($argVersion)) { // change the version to that explicitly passed, if any - $this->db_version = $argVersion; + $this->db_version = (string) $argVersion; } $this->schemaPath = $schemaPath; diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index 4d2be52ad41a..6a96e0d7c2ab 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -204,13 +204,15 @@ public function getTable($tableXML, &$database, &$tables) { } } + $titleFromClass = preg_replace('/([a-z])([A-Z])/', '$1 $2', $klass); $table = [ 'name' => $name, 'base' => $daoPath, 'sourceFile' => $sourceFile, 'fileName' => $klass . '.php', 'objectName' => $klass, - 'title' => $tableXML->title ?? self::nameToTitle($klass), + 'title' => $tableXML->title ?? $titleFromClass, + 'titlePlural' => $tableXML->titlePlural ?? CRM_Utils_String::pluralize($tableXML->title ?? $titleFromClass), 'icon' => $tableXML->icon ?? NULL, 'add' => $tableXML->add ?? NULL, 'labelName' => substr($name, 8), @@ -746,15 +748,4 @@ protected function getSize($fieldXML) { return 'CRM_Utils_Type::HUGE'; } - /** - * Converts an entity name to a user friendly string. - * - * @param string $name - * return string - */ - public static function nameToTitle(string $name) { - $name = preg_replace('/([a-z])([A-Z])/', '$1 $2', $name); - return CRM_Utils_String::pluralize($name); - } - } diff --git a/CRM/Core/Config/MagicMerge.php b/CRM/Core/Config/MagicMerge.php index 88110b643209..6050c22a2dac 100644 --- a/CRM/Core/Config/MagicMerge.php +++ b/CRM/Core/Config/MagicMerge.php @@ -170,7 +170,6 @@ public static function getPropertyMap() { 'userFrameworkUsersTableName' => ['setting'], 'verpSeparator' => ['setting'], 'wkhtmltopdfPath' => ['setting'], - 'wpBasePage' => ['setting'], 'wpLoadPhp' => ['setting'], // "path" properties are managed via Civi::paths and $civicrm_paths @@ -204,6 +203,7 @@ public static function getPropertyMap() { // @todo remove geocodeMethod. As of Feb 2018, $config->geocodeMethod works but gives a deprecation warning. 'geocodeMethod' => ['callback', 'CRM_Utils_Geocode', 'getProviderClass'], 'defaultCurrencySymbol' => ['callback', 'CRM_Core_BAO_Country', 'getDefaultCurrencySymbol'], + 'wpBasePage' => ['callback', 'CRM_Utils_System_WordPress', 'getBasePage'], ]; } diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 2d3ce654cec8..f29b13cca901 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -121,11 +121,12 @@ public function __construct() { /** * Returns localized title of this entity. + * * @return string */ public static function getEntityTitle() { $className = static::class; - Civi::log()->warning("$className needs to be regeneraged. Missing getEntityTitle method.", ['civi.tag' => 'deprecated']); + Civi::log()->warning("$className needs to be regenerated. Missing getEntityTitle method.", ['civi.tag' => 'deprecated']); return CRM_Core_DAO_AllCoreTables::getBriefName($className); } @@ -146,10 +147,21 @@ public function __destruct() { } /** - * Empty definition for virtual function. + * Returns the name of this table + * + * @return string */ public static function getTableName() { - return NULL; + return self::getLocaleTableName(static::$_tableName ?? NULL); + } + + /** + * Returns if this table needs to be logged + * + * @return bool + */ + public function getLog() { + return static::$_log ?? FALSE; } /** @@ -161,6 +173,7 @@ public static function getTableName() { public static function init($dsn) { Civi::$statics[__CLASS__]['init'] = 1; $options = &PEAR::getStaticProperty('DB_DataObject', 'options'); + $dsn = CRM_Utils_SQL::autoSwitchDSN($dsn); $options['database'] = $dsn; $options['quote_identifiers'] = TRUE; if (CRM_Utils_SQL::isSSLDSN($dsn)) { @@ -2725,11 +2738,11 @@ public static function buildOptionsContext($context = NULL) { */ public function getFieldSpec($fieldName) { $fields = $this->fields(); - $fieldKeys = $this->fieldKeys(); // Support "unique names" as well as sql names $fieldKey = $fieldName; if (empty($fields[$fieldKey])) { + $fieldKeys = $this->fieldKeys(); $fieldKey = $fieldKeys[$fieldName] ?? NULL; } // If neither worked then this field doesn't exist. Return false. @@ -2829,7 +2842,7 @@ public static function createSQLFilter($fieldName, $filter, $type = NULL, $alias /** * @see http://issues.civicrm.org/jira/browse/CRM-9150 * support for other syntaxes is discussed in ticket but being put off for now - * @return array + * @return string[] */ public static function acceptedSQLOperators() { return [ @@ -3128,4 +3141,14 @@ private function clearDbColumnValueCache() { } } + /** + * Return a mapping from field-name to the corresponding key (as used in fields()). + * + * @return array + * Array(string $name => string $uniqueName). + */ + public static function fieldKeys() { + return array_flip(CRM_Utils_Array::collect('name', static::fields())); + } + } diff --git a/CRM/Core/DAO/ActionLog.php b/CRM/Core/DAO/ActionLog.php index f725a2558a18..8eb9523e50a5 100644 --- a/CRM/Core/DAO/ActionLog.php +++ b/CRM/Core/DAO/ActionLog.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/ActionLog.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:2ccef6f7cc6a43d833301e93a2a0d61f) + * (GenCodeChecksum:a449765feaf80c56214be9fce2f118b4) */ /** @@ -108,9 +108,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Action Logs'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Action Logs') : ts('Action Log'); } /** diff --git a/CRM/Core/DAO/ActionMapping.php b/CRM/Core/DAO/ActionMapping.php index 8a61ce5bbc49..3224bc1269fa 100644 --- a/CRM/Core/DAO/ActionMapping.php +++ b/CRM/Core/DAO/ActionMapping.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/ActionMapping.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:037a3f26719a4774957814f28c499e60) + * (GenCodeChecksum:7db8e13984f33629f584a8a54c37fd4a) */ /** @@ -101,9 +101,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Action Mappings'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Action Mappings') : ts('Action Mapping'); } /** diff --git a/CRM/Core/DAO/ActionSchedule.php b/CRM/Core/DAO/ActionSchedule.php index 2762cb3f8885..181a1bdee506 100644 --- a/CRM/Core/DAO/ActionSchedule.php +++ b/CRM/Core/DAO/ActionSchedule.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/ActionSchedule.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:caf8b2cabbe06570dcf6cb93144004d2) + * (GenCodeChecksum:77bfa18590c85ad7b6430c018acd508c) */ /** @@ -300,9 +300,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Action Schedules'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Action Schedules') : ts('Action Schedule'); } /** @@ -409,6 +412,7 @@ public static function &fields() { 'entity' => 'ActionSchedule', 'bao' => 'CRM_Core_BAO_ActionSchedule', 'localizable' => 0, + 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED, 'add' => '3.4', ], 'entity_status' => [ @@ -423,6 +427,7 @@ public static function &fields() { 'entity' => 'ActionSchedule', 'bao' => 'CRM_Core_BAO_ActionSchedule', 'localizable' => 0, + 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED, 'add' => '3.4', ], 'start_action_offset' => [ @@ -617,6 +622,7 @@ public static function &fields() { 'entity' => 'ActionSchedule', 'bao' => 'CRM_Core_BAO_ActionSchedule', 'localizable' => 0, + 'serialize' => self::SERIALIZE_COMMA, 'add' => '3.4', ], 'recipient_listing' => [ diff --git a/CRM/Core/DAO/Address.php b/CRM/Core/DAO/Address.php index 7151847db2f9..257de9924f39 100644 --- a/CRM/Core/DAO/Address.php +++ b/CRM/Core/DAO/Address.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Address.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:a6b8f21dd3839de1ce1273e0910f0c8c) + * (GenCodeChecksum:01b95dc4df972f40d718b61c77cd3b58) */ /** @@ -250,9 +250,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Addresses'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Addresses') : ts('Address'); } /** diff --git a/CRM/Core/DAO/AddressFormat.php b/CRM/Core/DAO/AddressFormat.php index 762b90b6a177..d1c1d088427b 100644 --- a/CRM/Core/DAO/AddressFormat.php +++ b/CRM/Core/DAO/AddressFormat.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/AddressFormat.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:1ce11647576d05acfc364969eddfcce4) + * (GenCodeChecksum:7cc2864a78be48031ca829de49afeef6) */ /** @@ -54,9 +54,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Address Formats'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Address Formats') : ts('Address Format'); } /** diff --git a/CRM/Core/DAO/AllCoreTables.data.php b/CRM/Core/DAO/AllCoreTables.data.php index fcf35a9eed48..fdbda3a704c3 100644 --- a/CRM/Core/DAO/AllCoreTables.data.php +++ b/CRM/Core/DAO/AllCoreTables.data.php @@ -77,6 +77,11 @@ 'class' => 'CRM_ACL_DAO_ACL', 'table' => 'civicrm_acl', ], + 'CRM_ACL_DAO_ACLCache' => [ + 'name' => 'ACLCache', + 'class' => 'CRM_ACL_DAO_ACLCache', + 'table' => 'civicrm_acl_cache', + ], 'CRM_ACL_DAO_EntityRole' => [ 'name' => 'EntityRole', 'class' => 'CRM_ACL_DAO_EntityRole', @@ -392,11 +397,6 @@ 'class' => 'CRM_Core_DAO_StatusPreference', 'table' => 'civicrm_status_pref', ], - 'CRM_ACL_DAO_ACLCache' => [ - 'name' => 'ACLCache', - 'class' => 'CRM_ACL_DAO_ACLCache', - 'table' => 'civicrm_acl_cache', - ], 'CRM_Contact_DAO_Group' => [ 'name' => 'Group', 'class' => 'CRM_Contact_DAO_Group', diff --git a/CRM/Core/DAO/AllCoreTables.php b/CRM/Core/DAO/AllCoreTables.php index 5b9ffe5ef671..9e4970c301d4 100644 --- a/CRM/Core/DAO/AllCoreTables.php +++ b/CRM/Core/DAO/AllCoreTables.php @@ -280,7 +280,7 @@ public static function getClasses() { * Get the classname for the table. * * @param string $tableName - * @return string + * @return string|CRM_Core_DAO|NULL */ public static function getClassForTable($tableName) { //CRM-19677: on multilingual setup, trim locale from $tableName to fetch class name @@ -296,7 +296,7 @@ public static function getClassForTable($tableName) { * * @param string $daoName * Ex: 'Contact'. - * @return CRM_Core_DAO|NULL + * @return string|CRM_Core_DAO|NULL * Ex: 'CRM_Contact_DAO_Contact'. */ public static function getFullName($daoName) { diff --git a/CRM/Core/DAO/Cache.php b/CRM/Core/DAO/Cache.php index 01bc33ea91c5..f8366cb2d037 100644 --- a/CRM/Core/DAO/Cache.php +++ b/CRM/Core/DAO/Cache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Cache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:af1401f844c699c6ad35366a32a8db03) + * (GenCodeChecksum:bafe6ce2f7fd94b2581bfc4dad813130) */ /** @@ -89,9 +89,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Caches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Caches') : ts('Cache'); } /** diff --git a/CRM/Core/DAO/Component.php b/CRM/Core/DAO/Component.php index f9b7b077f9ad..f1d560b656b6 100644 --- a/CRM/Core/DAO/Component.php +++ b/CRM/Core/DAO/Component.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Component.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6c3fd2c8e875746c0ceffa499624f77c) + * (GenCodeChecksum:a5136517000cfab182cdacc3130bc29c) */ /** @@ -61,9 +61,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Components'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Components') : ts('Component'); } /** diff --git a/CRM/Core/DAO/Country.php b/CRM/Core/DAO/Country.php index 24d458b99cef..b91e0062fb23 100644 --- a/CRM/Core/DAO/Country.php +++ b/CRM/Core/DAO/Country.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Country.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:cdd80b394924586274cf4b91183d3637) + * (GenCodeChecksum:2215bb79c9fe62c60700f232598a9462) */ /** @@ -103,9 +103,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Countries'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Countries') : ts('Country'); } /** diff --git a/CRM/Core/DAO/County.php b/CRM/Core/DAO/County.php index 97d2fae58ea1..9b05e4bee6cc 100644 --- a/CRM/Core/DAO/County.php +++ b/CRM/Core/DAO/County.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/County.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:96f94dbbafff9a4e1f0ff276799fcbbd) + * (GenCodeChecksum:5620d2136c764c786eef1c15853eaf9b) */ /** @@ -68,9 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Counties'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Counties') : ts('County'); } /** diff --git a/CRM/Core/DAO/CustomField.php b/CRM/Core/DAO/CustomField.php index 137fbf81a247..a453096360b9 100644 --- a/CRM/Core/DAO/CustomField.php +++ b/CRM/Core/DAO/CustomField.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/CustomField.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:200b28277fc9e025b42d3f3e45fde020) + * (GenCodeChecksum:3a8f6978ec00d7e2cff93f2915ac1f48) */ /** @@ -227,7 +227,7 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { public $option_group_id; /** - * Serialization method - a non-null value indicates a multi-valued field. + * Serialization method - a non-zero value indicates a multi-valued field. * * @var int */ @@ -257,9 +257,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Custom Fields'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Custom Fields') : ts('Custom Field'); } /** @@ -365,6 +368,7 @@ public static function &fields() { 'localizable' => 0, 'html' => [ 'type' => 'Select', + 'label' => ts("Data Type"), ], 'pseudoconstant' => [ 'callback' => 'CRM_Core_BAO_CustomField::dataType', @@ -384,6 +388,10 @@ public static function &fields() { 'entity' => 'CustomField', 'bao' => 'CRM_Core_BAO_CustomField', 'localizable' => 0, + 'html' => [ + 'type' => 'Select', + 'label' => ts("Field Input Type"), + ], 'pseudoconstant' => [ 'callback' => 'CRM_Core_SelectValues::customHtmlType', ], @@ -688,8 +696,10 @@ public static function &fields() { 'name' => 'serialize', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Serialize'), - 'description' => ts('Serialization method - a non-null value indicates a multi-valued field.'), + 'description' => ts('Serialization method - a non-zero value indicates a multi-valued field.'), + 'required' => TRUE, 'where' => 'civicrm_custom_field.serialize', + 'default' => '0', 'table_name' => 'civicrm_custom_field', 'entity' => 'CustomField', 'bao' => 'CRM_Core_BAO_CustomField', diff --git a/CRM/Core/DAO/CustomGroup.php b/CRM/Core/DAO/CustomGroup.php index 12dd47769ebc..8be9d28b2426 100644 --- a/CRM/Core/DAO/CustomGroup.php +++ b/CRM/Core/DAO/CustomGroup.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/CustomGroup.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:494d883be861157d8067e6a6c50c23f6) + * (GenCodeChecksum:3436e2a4cf99bd9b7c859170db37bce3) */ /** @@ -194,9 +194,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Custom Groups'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Custom Groups') : ts('Custom Group'); } /** diff --git a/CRM/Core/DAO/Dashboard.php b/CRM/Core/DAO/Dashboard.php index a9d40d32437c..57773da9dfce 100644 --- a/CRM/Core/DAO/Dashboard.php +++ b/CRM/Core/DAO/Dashboard.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Dashboard.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:2d134bfa6938d2e8a8d8e25e99769823) + * (GenCodeChecksum:262213759ac6f4c9943f4ebd454256ae) */ /** @@ -115,9 +115,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Dashboards'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Dashboards') : ts('Dashboard'); } /** diff --git a/CRM/Core/DAO/Discount.php b/CRM/Core/DAO/Discount.php index ed2f53e1e1d5..a18cacfb6003 100644 --- a/CRM/Core/DAO/Discount.php +++ b/CRM/Core/DAO/Discount.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Discount.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:a23716379d3cccf678a9d8e423690e7c) + * (GenCodeChecksum:5fbe08bc556f5b913860a55c6d0cedc4) */ /** @@ -82,9 +82,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Discounts'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Discounts') : ts('Discount'); } /** diff --git a/CRM/Core/DAO/Domain.php b/CRM/Core/DAO/Domain.php index 82ccf0f5a8f9..ce6b480508f9 100644 --- a/CRM/Core/DAO/Domain.php +++ b/CRM/Core/DAO/Domain.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Domain.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:57a526de0b2bc02fed832a22dc50ad80) + * (GenCodeChecksum:99a50c29878792b8864e20d184ce9bbb) */ /** @@ -89,9 +89,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Domains'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Domains') : ts('Domain'); } /** diff --git a/CRM/Core/DAO/Email.php b/CRM/Core/DAO/Email.php index 7c0a55b812bd..4f890d5cf0b0 100644 --- a/CRM/Core/DAO/Email.php +++ b/CRM/Core/DAO/Email.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Email.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:866b627595adac9091080a4e4ab146bc) + * (GenCodeChecksum:2736b767bcd747315f0382f4e298ad35) */ /** @@ -131,9 +131,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Emails'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Emails') : ts('Email'); } /** diff --git a/CRM/Core/DAO/EntityFile.php b/CRM/Core/DAO/EntityFile.php index 0d32257d1e18..e405a0d0d6a6 100644 --- a/CRM/Core/DAO/EntityFile.php +++ b/CRM/Core/DAO/EntityFile.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/EntityFile.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:f2d4dfec2466ad664b4949983b1c7e58) + * (GenCodeChecksum:70221552c8c9532b2aaf9cd89e73a68d) */ /** @@ -68,9 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Entity Files'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Entity Files') : ts('Entity File'); } /** diff --git a/CRM/Core/DAO/EntityTag.php b/CRM/Core/DAO/EntityTag.php index eb2be19b6666..6db35b547c23 100644 --- a/CRM/Core/DAO/EntityTag.php +++ b/CRM/Core/DAO/EntityTag.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/EntityTag.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:58f15f695b38fa4cacfdf82d2734e0f0) + * (GenCodeChecksum:82e27d87178a408cd0a1c201f3501dd2) */ /** @@ -68,9 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Entity Tags'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Entity Tags') : ts('Entity Tag'); } /** diff --git a/CRM/Core/DAO/Extension.php b/CRM/Core/DAO/Extension.php index c666e3ab0222..b1fc0de3f60f 100644 --- a/CRM/Core/DAO/Extension.php +++ b/CRM/Core/DAO/Extension.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Extension.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:08d2151b75e68f334bd88475b58fab7b) + * (GenCodeChecksum:46f6ff725b1ad9909d2340d728438d36) */ /** @@ -94,9 +94,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Extensions'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Extensions') : ts('Extension'); } /** diff --git a/CRM/Core/DAO/File.php b/CRM/Core/DAO/File.php index dc6508d4a6e4..620734811c1e 100644 --- a/CRM/Core/DAO/File.php +++ b/CRM/Core/DAO/File.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/File.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:aa0883a815a43dd250612348f3ec470e) + * (GenCodeChecksum:dd8a70727f67481339dd514fdca6aae5) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Files'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Files') : ts('File'); } /** diff --git a/CRM/Core/DAO/IM.php b/CRM/Core/DAO/IM.php index 958b4dda190c..fdc40df188c4 100644 --- a/CRM/Core/DAO/IM.php +++ b/CRM/Core/DAO/IM.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/IM.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:da6b080a31b208a71635d272fabab7ec) + * (GenCodeChecksum:f64b9a15f4a240d7a137cb5655feb696) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Instant Messaging'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Instant Messaging') : ts('Instant Messaging'); } /** diff --git a/CRM/Core/DAO/Job.php b/CRM/Core/DAO/Job.php index ebdb62818e4e..cbc870082e44 100644 --- a/CRM/Core/DAO/Job.php +++ b/CRM/Core/DAO/Job.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Job.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:6e3a5de515fda550b1b5aeb493c50f0b) + * (GenCodeChecksum:bbc36abe96310ec5cf23d46d2d1728cb) */ /** @@ -117,9 +117,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Jobs'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Jobs') : ts('Job'); } /** diff --git a/CRM/Core/DAO/JobLog.php b/CRM/Core/DAO/JobLog.php index b59a98b1f5b2..51db9714637f 100644 --- a/CRM/Core/DAO/JobLog.php +++ b/CRM/Core/DAO/JobLog.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/JobLog.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:eca8e7af1026dbfaf7beecb95ce02361) + * (GenCodeChecksum:74e191eba977eb496bae109ca9720ab7) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Job Logs'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Job Logs') : ts('Job Log'); } /** diff --git a/CRM/Core/DAO/LocBlock.php b/CRM/Core/DAO/LocBlock.php index 154a2e776c61..2eca88b4b625 100644 --- a/CRM/Core/DAO/LocBlock.php +++ b/CRM/Core/DAO/LocBlock.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/LocBlock.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:8459c5a6d25e5c70e44de49b109a82fa) + * (GenCodeChecksum:801a2e7e05f688cf38882b466f22a292) */ /** @@ -87,9 +87,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Loc Blocks'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Loc Blocks') : ts('Loc Block'); } /** diff --git a/CRM/Core/DAO/LocationType.php b/CRM/Core/DAO/LocationType.php index 70648f67db31..3427ba89b38b 100644 --- a/CRM/Core/DAO/LocationType.php +++ b/CRM/Core/DAO/LocationType.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/LocationType.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:325ccb933339bc909efc7d6b60c7186b) + * (GenCodeChecksum:450719aeeb146b60007152d03e0b6faf) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Location Types'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Location Types') : ts('Location Type'); } /** diff --git a/CRM/Core/DAO/Log.php b/CRM/Core/DAO/Log.php index 182d42f5d40e..b550b04515c6 100644 --- a/CRM/Core/DAO/Log.php +++ b/CRM/Core/DAO/Log.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Log.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:5dfdb2863ba1bc7b84288a522cdaef51) + * (GenCodeChecksum:3b97d17eeaa407d9f7f7aa6e1d819090) */ /** @@ -82,9 +82,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Logs'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Logs') : ts('Log'); } /** diff --git a/CRM/Core/DAO/MailSettings.php b/CRM/Core/DAO/MailSettings.php index acc8278c1904..6c3c02f70d60 100644 --- a/CRM/Core/DAO/MailSettings.php +++ b/CRM/Core/DAO/MailSettings.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/MailSettings.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:b43716d8c8e362738d8d3420e8fbe03d) + * (GenCodeChecksum:310f3c60fe656e8ef27a67234d6fa80c) */ /** @@ -145,9 +145,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Mail Settingses'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mail Settingses') : ts('Mail Settings'); } /** diff --git a/CRM/Core/DAO/Managed.php b/CRM/Core/DAO/Managed.php index 212817ec7860..a67271247cbe 100644 --- a/CRM/Core/DAO/Managed.php +++ b/CRM/Core/DAO/Managed.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Managed.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:e6146e35f8c8321e600a4198cbd6949e) + * (GenCodeChecksum:119de7e386aa83b1ca5038a1e409aafe) */ /** @@ -82,9 +82,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Manageds'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Manageds') : ts('Managed'); } /** diff --git a/CRM/Core/DAO/Mapping.php b/CRM/Core/DAO/Mapping.php index 59505d1d5fb0..3c7639a857d5 100644 --- a/CRM/Core/DAO/Mapping.php +++ b/CRM/Core/DAO/Mapping.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Mapping.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:c97b13ea2aaccdf8ba13b6552ccb59f2) + * (GenCodeChecksum:49336d40a24f0312944123741932dd25) */ /** @@ -68,9 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Mappings'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mappings') : ts('Mapping'); } /** diff --git a/CRM/Core/DAO/MappingField.php b/CRM/Core/DAO/MappingField.php index cd5f06e741b4..bfe139eda992 100644 --- a/CRM/Core/DAO/MappingField.php +++ b/CRM/Core/DAO/MappingField.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/MappingField.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:3702a3c3cb9cd696eb829d15f4676439) + * (GenCodeChecksum:7197da108e5452be6ab8b419a1506aec) */ /** @@ -137,9 +137,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Mapping Fields'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Mapping Fields') : ts('Mapping Field'); } /** diff --git a/CRM/Core/DAO/Menu.php b/CRM/Core/DAO/Menu.php index 98f3f4ad1491..3fb9a797c3e0 100644 --- a/CRM/Core/DAO/Menu.php +++ b/CRM/Core/DAO/Menu.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Menu.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:8be7941b4dccb08266109e3e1599159f) + * (GenCodeChecksum:b94ecc10dafe21deb7e5067ef46f32af) */ /** @@ -190,9 +190,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Menus'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Menus') : ts('Menu'); } /** diff --git a/CRM/Core/DAO/MessageTemplate.php b/CRM/Core/DAO/MessageTemplate.php index 5c7965c83f83..f3da47e578b7 100644 --- a/CRM/Core/DAO/MessageTemplate.php +++ b/CRM/Core/DAO/MessageTemplate.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/MessageTemplate.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:68dd4ac3c9f098e3577dbed8d5a2a105) + * (GenCodeChecksum:6881b34cbbefc06722c58fe7f20b1c58) */ /** @@ -120,9 +120,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Message Templates'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Message Templates') : ts('Message Template'); } /** diff --git a/CRM/Core/DAO/Navigation.php b/CRM/Core/DAO/Navigation.php index b567777810a4..ed52b19610f3 100644 --- a/CRM/Core/DAO/Navigation.php +++ b/CRM/Core/DAO/Navigation.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Navigation.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:34c3d3b834400b49f1b8c6c99a08c99e) + * (GenCodeChecksum:8cc5473f0cd98bf289dc455eefb0af76) */ /** @@ -122,9 +122,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Navigations'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Navigations') : ts('Navigation'); } /** diff --git a/CRM/Core/DAO/Note.php b/CRM/Core/DAO/Note.php index 748d1076f18e..3c730b47ee70 100644 --- a/CRM/Core/DAO/Note.php +++ b/CRM/Core/DAO/Note.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Note.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:86e72396a497a58c1568d0d081435e75) + * (GenCodeChecksum:75161cdedcd719f035387c9c1d0d83dd) */ /** @@ -103,9 +103,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Notes'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Notes') : ts('Note'); } /** diff --git a/CRM/Core/DAO/OpenID.php b/CRM/Core/DAO/OpenID.php index 1a61aba15603..dfe13c489d5c 100644 --- a/CRM/Core/DAO/OpenID.php +++ b/CRM/Core/DAO/OpenID.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/OpenID.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:4d60933113e2b5330dd8194e7ebe6ae4) + * (GenCodeChecksum:7af55174e40a30da959ad7734573eb9a) */ /** @@ -82,9 +82,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Open IDs'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Open IDs') : ts('Open ID'); } /** diff --git a/CRM/Core/DAO/OptionGroup.php b/CRM/Core/DAO/OptionGroup.php index 9feb9fd8f107..76ef9a0bcff1 100644 --- a/CRM/Core/DAO/OptionGroup.php +++ b/CRM/Core/DAO/OptionGroup.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/OptionGroup.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:d0011ad2bb6c090eeb86d25916c5624b) + * (GenCodeChecksum:e9bb68e874d377a0c30b433103d438d4) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Option Groups'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Option Groups') : ts('Option Group'); } /** diff --git a/CRM/Core/DAO/OptionValue.php b/CRM/Core/DAO/OptionValue.php index 7f0c3644f208..5fb8ddb4521f 100644 --- a/CRM/Core/DAO/OptionValue.php +++ b/CRM/Core/DAO/OptionValue.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/OptionValue.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:e51b16ecfe5f8302c8610b7f5dfd55e5) + * (GenCodeChecksum:f47024ac081427ddadce4c569934f8a6) */ /** @@ -164,9 +164,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Option Values'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Option Values') : ts('Option Value'); } /** diff --git a/CRM/Core/DAO/Phone.php b/CRM/Core/DAO/Phone.php index 9a6b668620a6..5c0b7816a5c2 100644 --- a/CRM/Core/DAO/Phone.php +++ b/CRM/Core/DAO/Phone.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Phone.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:efdb60e03b54f246e73588b6eb99611d) + * (GenCodeChecksum:f77d3ef5985c8945730c2fe22bb3fa45) */ /** @@ -117,9 +117,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Phones'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Phones') : ts('Phone'); } /** diff --git a/CRM/Core/DAO/PreferencesDate.php b/CRM/Core/DAO/PreferencesDate.php index b1d08e7cd045..78fa11538f44 100644 --- a/CRM/Core/DAO/PreferencesDate.php +++ b/CRM/Core/DAO/PreferencesDate.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/PreferencesDate.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:21383b05b8c8e98ed1721aab06031907) + * (GenCodeChecksum:d0de29e655d17a479ec8cfc762582c39) */ /** @@ -87,9 +87,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Preferences Dates'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Preferences Dates') : ts('Preferences Date'); } /** diff --git a/CRM/Core/DAO/PrevNextCache.php b/CRM/Core/DAO/PrevNextCache.php index a39549db9e6c..258e3ef5c403 100644 --- a/CRM/Core/DAO/PrevNextCache.php +++ b/CRM/Core/DAO/PrevNextCache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/PrevNextCache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:8086ffe55554b0fba698136fd6dee894) + * (GenCodeChecksum:325d605774498631dd0a2742963d1032) */ /** @@ -85,9 +85,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Prev Next Caches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Prev Next Caches') : ts('Prev Next Cache'); } /** diff --git a/CRM/Core/DAO/PrintLabel.php b/CRM/Core/DAO/PrintLabel.php index 129e80804da9..97575a87dd91 100644 --- a/CRM/Core/DAO/PrintLabel.php +++ b/CRM/Core/DAO/PrintLabel.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/PrintLabel.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:484a16ebc1b881e7718bfcf139024ee7) + * (GenCodeChecksum:9612aababed43ba4eaacc71a727c5ed9) */ /** @@ -115,9 +115,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Print Labels'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Print Labels') : ts('Print Label'); } /** diff --git a/CRM/Core/DAO/RecurringEntity.php b/CRM/Core/DAO/RecurringEntity.php index d22aa96ac773..1cffe8c273d4 100644 --- a/CRM/Core/DAO/RecurringEntity.php +++ b/CRM/Core/DAO/RecurringEntity.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/RecurringEntity.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:b78474c715335f7689a9a5fcdcb5718e) + * (GenCodeChecksum:2667b60a5f917352d52964de09cf85fa) */ /** @@ -73,9 +73,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Recurring Entities'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Recurring Entities') : ts('Recurring Entity'); } /** diff --git a/CRM/Core/DAO/Setting.php b/CRM/Core/DAO/Setting.php index 160f781cda0f..4fb42fd82a45 100644 --- a/CRM/Core/DAO/Setting.php +++ b/CRM/Core/DAO/Setting.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Setting.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:c1fda2807e8265021ffaa490325a7e4f) + * (GenCodeChecksum:24ec63102452f5cdff8424b5caf8b679) */ /** @@ -101,9 +101,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Settings'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Settings') : ts('Setting'); } /** diff --git a/CRM/Core/DAO/StateProvince.php b/CRM/Core/DAO/StateProvince.php index 80a91c2e1f15..e376f57c6555 100644 --- a/CRM/Core/DAO/StateProvince.php +++ b/CRM/Core/DAO/StateProvince.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/StateProvince.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:2dced9a7a3e6be3d05ea7b7babe4b113) + * (GenCodeChecksum:504a7092bbd803d38b7f0fb91756bede) */ /** @@ -68,9 +68,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('State Provinces'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('States/Provinces') : ts('State/Province'); } /** diff --git a/CRM/Core/DAO/StatusPreference.php b/CRM/Core/DAO/StatusPreference.php index b06b206f2483..e5654e60147c 100644 --- a/CRM/Core/DAO/StatusPreference.php +++ b/CRM/Core/DAO/StatusPreference.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/StatusPreference.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:1fa80acc24bcb14df3947cba2daa930f) + * (GenCodeChecksum:7c7deea1bd07dccee5a5bae0b1d6c4c7) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Status Preferences'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Status Preferences') : ts('Status Preference'); } /** diff --git a/CRM/Core/DAO/SystemLog.php b/CRM/Core/DAO/SystemLog.php index c18ee55ebca7..d3cc2ec35880 100644 --- a/CRM/Core/DAO/SystemLog.php +++ b/CRM/Core/DAO/SystemLog.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/SystemLog.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:46d7f317ffb5d01d9cb22898ce38abb3) + * (GenCodeChecksum:3765c5a89ca1e9ff224fbd49e31a4037) */ /** @@ -89,9 +89,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('System Logs'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('System Logs') : ts('System Log'); } /** diff --git a/CRM/Core/DAO/Tag.php b/CRM/Core/DAO/Tag.php index 65ae7a378b80..15078e57da7e 100644 --- a/CRM/Core/DAO/Tag.php +++ b/CRM/Core/DAO/Tag.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Tag.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7a2eb010fd96445604104b6ada9c0b99) + * (GenCodeChecksum:8a5eeefa40273898a4e3661b1ef43b3d) */ /** @@ -118,9 +118,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Tags'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Tags') : ts('Tag'); } /** diff --git a/CRM/Core/DAO/Timezone.php b/CRM/Core/DAO/Timezone.php index 5f9abdfc6c34..bae04f5e2d28 100644 --- a/CRM/Core/DAO/Timezone.php +++ b/CRM/Core/DAO/Timezone.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Timezone.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:fb1089cb65c1587b1242b9d250c664f7) + * (GenCodeChecksum:b49b5541f20c732fc7ff4cdc3687899b) */ /** @@ -80,9 +80,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Timezones'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Timezones') : ts('Timezone'); } /** diff --git a/CRM/Core/DAO/UFField.php b/CRM/Core/DAO/UFField.php index a112e1c6f32f..87cde6f32d88 100644 --- a/CRM/Core/DAO/UFField.php +++ b/CRM/Core/DAO/UFField.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/UFField.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:e717ec384cfe13629b4fc440af2a99d5) + * (GenCodeChecksum:1cf845aa31eed1a29bffcd4404862f6a) */ /** @@ -173,9 +173,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('UFFields'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('UFFields') : ts('UFField'); } /** diff --git a/CRM/Core/DAO/UFGroup.php b/CRM/Core/DAO/UFGroup.php index ae79d22da8e8..89d25b997ee0 100644 --- a/CRM/Core/DAO/UFGroup.php +++ b/CRM/Core/DAO/UFGroup.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/UFGroup.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:1cac6e6b80a630f69ce25f709a20e4a3) + * (GenCodeChecksum:e33df676b4e3ae50e18f1c44e437e3ea) */ /** @@ -227,9 +227,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('UFGroups'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('UFGroups') : ts('UFGroup'); } /** diff --git a/CRM/Core/DAO/UFJoin.php b/CRM/Core/DAO/UFJoin.php index 98639423b142..28f3f56340ba 100644 --- a/CRM/Core/DAO/UFJoin.php +++ b/CRM/Core/DAO/UFJoin.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/UFJoin.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:191143bced279d48cf34cdf6cf85a5fb) + * (GenCodeChecksum:4bcf2b3e5905f98d83d449b1226903da) */ /** @@ -96,9 +96,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('UFJoins'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('UFJoins') : ts('UFJoin'); } /** diff --git a/CRM/Core/DAO/UFMatch.php b/CRM/Core/DAO/UFMatch.php index fa08f60b222f..6a5d32b772a0 100644 --- a/CRM/Core/DAO/UFMatch.php +++ b/CRM/Core/DAO/UFMatch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/UFMatch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:4fca2151c2ecbd762ac9e2f067f0030f) + * (GenCodeChecksum:613e38722266d0117e69f521e4f0d140) */ /** @@ -82,9 +82,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('UFMatches'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('UFMatches') : ts('UFMatch'); } /** diff --git a/CRM/Core/DAO/Website.php b/CRM/Core/DAO/Website.php index e9415359c114..aed21d3676e1 100644 --- a/CRM/Core/DAO/Website.php +++ b/CRM/Core/DAO/Website.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Website.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:9e449b1f3a997b63c79066bd5cd782ae) + * (GenCodeChecksum:1d9c6cf4e3d809a3b3f5963ccb189e83) */ /** @@ -75,9 +75,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Websites'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Websites') : ts('Website'); } /** diff --git a/CRM/Core/DAO/WordReplacement.php b/CRM/Core/DAO/WordReplacement.php index 65ac087b5543..691291abcfc1 100644 --- a/CRM/Core/DAO/WordReplacement.php +++ b/CRM/Core/DAO/WordReplacement.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/WordReplacement.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:f4afc331da543068dba6d243d98b8e39) + * (GenCodeChecksum:104090c38770547ffa491fccdf299765) */ /** @@ -80,9 +80,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Word Replacements'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Word Replacements') : ts('Word Replacement'); } /** diff --git a/CRM/Core/DAO/Worldregion.php b/CRM/Core/DAO/Worldregion.php index 1dd866013d60..0974aecff55c 100644 --- a/CRM/Core/DAO/Worldregion.php +++ b/CRM/Core/DAO/Worldregion.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Worldregion.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:0312ba4169a285839ec54d655ff5ceb3) + * (GenCodeChecksum:af9fba05839764ec479cc5fad738390a) */ /** @@ -54,9 +54,12 @@ public function __construct() { /** * Returns localized title of this entity. + * + * @param bool $plural + * Whether to return the plural version of the title. */ - public static function getEntityTitle() { - return ts('Worldregions'); + public static function getEntityTitle($plural = FALSE) { + return $plural ? ts('Worldregions') : ts('Worldregion'); } /** diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index ee418c306b8b..ec287600277d 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -529,11 +529,14 @@ public static function debug_var($variable_name, $variable, $print = TRUE, $log $out = "\$$variable_name = $out"; } else { - // use var_dump - ob_start(); - var_dump($variable); - $dump = ob_get_contents(); - ob_end_clean(); + // Use Symfony var-dumper to avoid circular references that exhaust + // memory when using var_dump(). + // Use its CliDumper since if we use the simpler `dump()` then it + // comes out as some overly decorated html which is hard to read. + $dump = (new \Symfony\Component\VarDumper\Dumper\CliDumper('php://output')) + ->dump( + (new \Symfony\Component\VarDumper\Cloner\VarCloner())->cloneVar($variable), + TRUE); $out = "\n\$$variable_name = $dump"; } // reset if it is an array @@ -600,13 +603,15 @@ public static function debug_log_message($message, $out = FALSE, $prefix = '', $ * @param string $string */ public static function debug_query($string) { - if (defined('CIVICRM_DEBUG_LOG_QUERY')) { - if (CIVICRM_DEBUG_LOG_QUERY === 'backtrace') { - CRM_Core_Error::backtrace($string, TRUE); - } - elseif (CIVICRM_DEBUG_LOG_QUERY) { - CRM_Core_Error::debug_var('Query', $string, TRUE, TRUE, 'sql_log', PEAR_LOG_DEBUG); - } + if (!defined('CIVICRM_DEBUG_LOG_QUERY')) { + // TODO: When its updated to support getenv(), call CRM_Utils_Constant::value('CIVICRM_DEBUG_LOG_QUERY', FALSE) + define('CIVICRM_DEBUG_LOG_QUERY', getenv('CIVICRM_DEBUG_LOG_QUERY')); + } + if (CIVICRM_DEBUG_LOG_QUERY === 'backtrace') { + CRM_Core_Error::backtrace($string, TRUE); + } + elseif (CIVICRM_DEBUG_LOG_QUERY) { + CRM_Core_Error::debug_var('Query', $string, TRUE, TRUE, 'sql_log' . CIVICRM_DEBUG_LOG_QUERY, PEAR_LOG_DEBUG); } } diff --git a/CRM/Core/Exception/PrematureExitException.php b/CRM/Core/Exception/PrematureExitException.php index e0eee738b926..f46bbfff8e55 100644 --- a/CRM/Core/Exception/PrematureExitException.php +++ b/CRM/Core/Exception/PrematureExitException.php @@ -25,6 +25,13 @@ */ class CRM_Core_Exception_PrematureExitException extends RuntimeException { + /** + * Contextual data. + * + * @var array + */ + public $errorData; + /** * Construct the exception. Note: The message is NOT binary safe. * diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 98526b5a8198..2cd2c226b5db 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -350,7 +350,7 @@ public function registerRules() { * @param string $type * @param string $name * @param string $label - * @param string|array $attributes (options for select elements) + * @param array $attributes (options for select elements) * @param bool $required * @param array $extra * (attributes for select elements). @@ -364,11 +364,18 @@ public function registerRules() { */ public function &add( $type, $name, $label = '', - $attributes = '', $required = FALSE, $extra = NULL + $attributes = NULL, $required = FALSE, $extra = NULL ) { if ($type === 'radio') { CRM_Core_Error::deprecatedFunctionWarning('CRM_Core_Form::addRadio'); } + + if ($attributes && !is_array($attributes)) { + // The $attributes param used to allow for strings and would default to an + // empty string. However, now that the variable is heavily manipulated, + // we should expect it to always be an array. + Civi::log()->warning('Attributes passed to CRM_Core_Form::add() are not an array.', ['civi.tag' => 'deprecated']); + } // Fudge some extra types that quickform doesn't support $inputType = $type; if ($type == 'wysiwyg' || in_array($type, self::$html5Types)) { @@ -413,7 +420,7 @@ public function &add( $attributes['data-crm-datepicker'] = json_encode((array) $extra); if (!empty($attributes['aria-label']) || $label) { - $attributes['aria-label'] = CRM_Utils_Array::value('aria-label', $attributes, $label); + $attributes['aria-label'] = $attributes['aria-label'] ?? $label; } $type = "text"; } @@ -429,7 +436,7 @@ public function &add( // Add placeholder option for select if (isset($extra['placeholder'])) { if ($extra['placeholder'] === TRUE) { - $extra['placeholder'] = $required ? ts('- select -') : ts('- none -'); + $extra['placeholder'] = ts('- select %1 -', [1 => $label]); } if (($extra['placeholder'] || $extra['placeholder'] === '') && empty($extra['multiple']) && is_array($attributes) && !isset($attributes[''])) { $attributes = ['' => $extra['placeholder']] + $attributes; @@ -668,6 +675,13 @@ public function addButtons($params) { $attrs = ['class' => 'crm-form-submit'] + (array) CRM_Utils_Array::value('js', $button); + // A lot of forms use the hacky method of looking at + // `$params['button name']` (dating back to them being inputs with a + // "value" of the button label) rather than looking at + // `$this->controller->getButtonName()`. It makes sense to give buttons a + // value by default as a precaution. + $attrs['value'] = 1; + if (!empty($button['class'])) { $attrs['class'] .= ' ' . $button['class']; } @@ -686,7 +700,8 @@ public function addButtons($params) { } if ($button['type'] === 'reset') { - $prevnext[] = $this->createElement($button['type'], 'reset', $button['name'], $attrs); + $attrs['type'] = 'reset'; + $prevnext[] = $this->createElement('xbutton', 'reset', $button['name'], $attrs); } else { if (!empty($button['subName'])) { @@ -704,12 +719,11 @@ public function addButtons($params) { if (in_array($button['type'], ['next', 'upload', 'done']) && $button['name'] === ts('Save')) { $attrs['accesskey'] = 'S'; } - $icon = CRM_Utils_Array::value('icon', $button, $defaultIcon); - if ($icon) { - $attrs['crm-icon'] = $icon; - } + $buttonContents = CRM_Core_Page::crmIcon($button['icon'] ?? $defaultIcon) . ' ' . $button['name']; $buttonName = $this->getButtonName($button['type'], CRM_Utils_Array::value('subName', $button)); - $prevnext[] = $this->createElement('submit', $buttonName, $button['name'], $attrs); + $attrs['class'] .= " crm-button crm-button-type-{$button['type']} crm-button{$buttonName}"; + $attrs['type'] = 'submit'; + $prevnext[] = $this->createElement('xbutton', $buttonName, $buttonContents, $attrs); } if (!empty($button['isDefault'])) { $this->setDefaultAction($button['type']); @@ -1197,12 +1211,7 @@ public function &addRadio($name, $title, $values, $attributes = [], $separator = $optAttributes = $attributes; if (!empty($optionAttributes[$key])) { foreach ($optionAttributes[$key] as $optAttr => $optVal) { - if (!empty($optAttributes[$optAttr])) { - $optAttributes[$optAttr] .= ' ' . $optVal; - } - else { - $optAttributes[$optAttr] = $optVal; - } + $optAttributes[$optAttr] = ltrim(($optAttributes[$optAttr] ?? '') . ' ' . $optVal); } } // We use a class here to avoid html5 issues with collapsed cutsomfield sets. @@ -1489,8 +1498,8 @@ public function addSelect($name, $props = [], $required = FALSE) { $info = civicrm_api3($props['entity'], 'getoptions', $props); $options = $info['values']; } - if (!array_key_exists('placeholder', $props)) { - $props['placeholder'] = $required ? ts('- select -') : (CRM_Utils_Array::value('context', $props) == 'search' ? ts('- any -') : ts('- none -')); + if (!array_key_exists('placeholder', $props) && $placeholder = self::selectOrAnyPlaceholder($props, $required)) { + $props['placeholder'] = $placeholder; } // Handle custom field if (strpos($name, 'custom_') === 0 && is_numeric($name[7])) { @@ -1525,6 +1534,34 @@ public function addSelect($name, $props = [], $required = FALSE) { return $this->add('select', $name, $label, $options, $required, $props); } + /** + * Handles a repeated bit supplying a placeholder for entity selection + * + * @param string $props + * The field properties, including the entity and context. + * @param bool $required + * If the field is required. + * @return string + * The placeholder text. + */ + private static function selectOrAnyPlaceholder($props, $required) { + if (empty($props['entity'])) { + return NULL; + } + $daoToClass = CRM_Core_DAO_AllCoreTables::daoToClass(); + if (array_key_exists($props['entity'], $daoToClass)) { + $daoClass = $daoToClass[$props['entity']]; + $tsPlaceholder = $daoClass::getEntityTitle(); + } + else { + $tsPlaceholder = ts('option'); + } + if (($props['context'] ?? '') == 'search' && !$required) { + return ts('- any %1 -', [1 => $tsPlaceholder]); + } + return ts('- select %1 -', [1 => $tsPlaceholder]); + } + /** * Adds a field based on metadata. * @@ -1681,8 +1718,8 @@ public function addField($name, $props = [], $required = FALSE, $legacyDate = TR case 'Select': case 'Select2': $props['class'] = CRM_Utils_Array::value('class', $props, 'big') . ' crm-select2'; - if (!array_key_exists('placeholder', $props)) { - $props['placeholder'] = $required ? ts('- select -') : ($context == 'search' ? ts('- any -') : ts('- none -')); + if (!array_key_exists('placeholder', $props) && $placeholder = self::selectOrAnyPlaceholder($props, $required)) { + $props['placeholder'] = $placeholder; } // TODO: Add and/or option for fields that store multiple values return $this->add(strtolower($widget), $name, $label, $options, $required, $props); @@ -2052,14 +2089,14 @@ public function addCurrency( public function addEntityRef($name, $label = '', $props = [], $required = FALSE) { // Default properties $props['api'] = CRM_Utils_Array::value('api', $props, []); - $props['entity'] = CRM_Core_DAO_AllCoreTables::convertEntityNameToCamel(CRM_Utils_Array::value('entity', $props, 'Contact')); - $props['class'] = ltrim(CRM_Utils_Array::value('class', $props, '') . ' crm-form-entityref'); + $props['entity'] = CRM_Core_DAO_AllCoreTables::convertEntityNameToCamel($props['entity'] ?? 'Contact'); + $props['class'] = ltrim(($props['class'] ?? '') . ' crm-form-entityref'); if (array_key_exists('create', $props) && empty($props['create'])) { unset($props['create']); } - $props['placeholder'] = CRM_Utils_Array::value('placeholder', $props, $required ? ts('- select %1 -', [1 => ts(str_replace('_', ' ', $props['entity']))]) : ts('- none -')); + $props['placeholder'] = $props['placeholder'] ?? self::selectOrAnyPlaceholder($props, $required); $defaults = []; if (!empty($props['multiple'])) { @@ -2391,6 +2428,7 @@ public function setPageTitle($entityLabel) { * @return HTML_QuickForm_Element */ public function addChainSelect($elementName, $settings = []) { + $label = strpos($elementName, 'rovince') ? CRM_Core_DAO_StateProvince::getEntityTitle() : CRM_Core_DAO_County::getEntityTitle(); $props = $settings += [ 'control_field' => str_replace(['state_province', 'StateProvince', 'county', 'County'], [ 'country', @@ -2399,12 +2437,12 @@ public function addChainSelect($elementName, $settings = []) { 'StateProvince', ], $elementName), 'data-callback' => strpos($elementName, 'rovince') ? 'civicrm/ajax/jqState' : 'civicrm/ajax/jqCounty', - 'label' => strpos($elementName, 'rovince') ? ts('State/Province') : ts('County'), + 'label' => $label, 'data-empty-prompt' => strpos($elementName, 'rovince') ? ts('Choose country first') : ts('Choose state first'), 'data-none-prompt' => ts('- N/A -'), 'multiple' => FALSE, 'required' => FALSE, - 'placeholder' => empty($settings['required']) ? ts('- none -') : ts('- select -'), + 'placeholder' => ts('- select %1 -', [1 => $label]), ]; CRM_Utils_Array::remove($props, 'label', 'required', 'control_field', 'context'); $props['class'] = (empty($props['class']) ? '' : "{$props['class']} ") . 'crm-select2'; @@ -2448,7 +2486,10 @@ public function addTaskMenu($tasks) { $this->_actionButtonName = $this->getButtonName('next', 'action'); } $this->assign('actionButtonName', $this->_actionButtonName); - $this->add('submit', $this->_actionButtonName, ts('Go'), ['class' => 'hiddenElement crm-search-go-button']); + $this->add('xbutton', $this->_actionButtonName, ts('Go'), [ + 'type' => 'submit', + 'class' => 'hiddenElement crm-search-go-button', + ]); // Radio to choose "All items" or "Selected items only" $selectedRowsRadio = $this->addElement('radio', 'radio_ts', NULL, '', 'ts_sel', ['checked' => 'checked']); diff --git a/CRM/Core/Form/Task.php b/CRM/Core/Form/Task.php index 67ca0537adce..2bc0033da670 100644 --- a/CRM/Core/Form/Task.php +++ b/CRM/Core/Form/Task.php @@ -92,12 +92,9 @@ public function preProcess() { public static function preProcessCommon(&$form) { $form->_entityIds = []; - $searchFormValues = $form->controller->exportValues($form->get('searchFormName')); + $searchFormValues = $form->getSearchFormValues(); $form->_task = $searchFormValues['task']; - $className = 'CRM_' . ucfirst($form::$entityShortname) . '_Task'; - $entityTasks = $className::tasks(); - $form->assign('taskName', $entityTasks[$form->_task]); $entityIds = []; if ($searchFormValues['radio_ts'] == 'ts_sel') { @@ -251,4 +248,25 @@ public function orderBy() { return ''; } + /** + * Get the submitted values for the form. + * + * @return array + */ + public function getSearchFormValues() { + if ($this->_action === CRM_Core_Action::ADVANCED) { + return $this->controller->exportValues('Advanced'); + } + if ($this->_action === CRM_Core_Action::PROFILE) { + return $this->controller->exportValues('Builder'); + } + if ($this->_action == CRM_Core_Action::COPY) { + return $this->controller->exportValues('Custom'); + } + if ($this->get('entity') !== 'Contact') { + return $this->controller->exportValues('Search'); + } + return $this->controller->exportValues('Basic'); + } + } diff --git a/CRM/Core/I18n/SchemaStructure.php b/CRM/Core/I18n/SchemaStructure.php index 02a51c9a7874..641d565d23d6 100644 --- a/CRM/Core/I18n/SchemaStructure.php +++ b/CRM/Core/I18n/SchemaStructure.php @@ -92,7 +92,9 @@ public static function &columns() { 'description' => "text COMMENT 'Optional description.'", ], 'civicrm_group' => [ - 'title' => "varchar(64) COMMENT 'Name of Group.'", + 'title' => "varchar(255) NOT NULL COMMENT 'Name of Group.'", + 'frontend_title' => "varchar(255) DEFAULT NULL COMMENT 'Alternative public title for this Group.'", + 'frontend_description' => "text DEFAULT NULL COMMENT 'Alternative public description of the group.'", ], 'civicrm_contribution_page' => [ 'title' => "varchar(255) COMMENT 'Contribution Page title. For top of page display'", @@ -412,6 +414,15 @@ public static function &widgets() { 'civicrm_group' => [ 'title' => [ 'type' => "Text", + 'required' => "true", + ], + 'frontend_title' => [ + 'type' => "Text", + ], + 'frontend_description' => [ + 'type' => "TextArea", + 'rows' => "2", + 'cols' => "60", ], ], 'civicrm_contribution_page' => [ diff --git a/CRM/Core/I18n/SchemaStructure_5_31_alpha1.php b/CRM/Core/I18n/SchemaStructure_5_31_alpha1.php new file mode 100644 index 000000000000..bc9ced236d25 --- /dev/null +++ b/CRM/Core/I18n/SchemaStructure_5_31_alpha1.php @@ -0,0 +1,722 @@ + [ + 'display_name' => "varchar(64) COMMENT 'Location Type Display Name.'", + ], + 'civicrm_option_group' => [ + 'title' => "varchar(255) COMMENT 'Option Group title.'", + 'description' => "varchar(255) COMMENT 'Option group description.'", + ], + 'civicrm_relationship_type' => [ + 'label_a_b' => "varchar(64) COMMENT 'label for relationship of contact_a to contact_b.'", + 'label_b_a' => "varchar(64) COMMENT 'Optional label for relationship of contact_b to contact_a.'", + 'description' => "varchar(255) COMMENT 'Optional verbose description of the relationship type.'", + ], + 'civicrm_contact_type' => [ + 'label' => "varchar(64) COMMENT 'localized Name of Contact Type.'", + 'description' => "text COMMENT 'localized Optional verbose description of the type.'", + ], + 'civicrm_batch' => [ + 'title' => "varchar(255) COMMENT 'Friendly Name.'", + 'description' => "text COMMENT 'Description of this batch set.'", + ], + 'civicrm_premiums' => [ + 'premiums_intro_title' => "varchar(255) COMMENT 'Title for Premiums section.'", + 'premiums_intro_text' => "text COMMENT 'Displayed in
at top of Premiums section of page. Text and HTML allowed.'", + 'premiums_nothankyou_label' => "varchar(255) COMMENT 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)'", + ], + 'civicrm_membership_status' => [ + 'label' => "varchar(128) COMMENT 'Label for Membership Status'", + ], + 'civicrm_survey' => [ + 'title' => "varchar(255) NOT NULL COMMENT 'Title of the Survey.'", + 'instructions' => "text COMMENT 'Script instructions for volunteers to use for the survey.'", + 'thankyou_title' => "varchar(255) COMMENT 'Title for Thank-you page (header title tag, and display at the top of the page).'", + 'thankyou_text' => "text COMMENT 'text and html allowed. displayed above result on success page'", + ], + 'civicrm_participant_status_type' => [ + 'label' => "varchar(255) COMMENT 'localized label for display of this status type'", + ], + 'civicrm_case_type' => [ + 'title' => "varchar(64) NOT NULL COMMENT 'Natural language name for Case Type'", + 'description' => "varchar(255) COMMENT 'Description of the Case Type'", + ], + 'civicrm_tell_friend' => [ + 'title' => "varchar(255)", + 'intro' => "text COMMENT 'Introductory message to contributor or participant displayed on the Tell a Friend form.'", + 'suggested_message' => "text COMMENT 'Suggested message to friends, provided as default on the Tell A Friend form.'", + 'thankyou_title' => "varchar(255) COMMENT 'Text for Tell a Friend thank you page header and HTML title.'", + 'thankyou_text' => "text COMMENT 'Thank you message displayed on success page.'", + ], + 'civicrm_custom_group' => [ + 'title' => "varchar(64) NOT NULL COMMENT 'Friendly Name.'", + 'help_pre' => "text COMMENT 'Description and/or help text to display before fields in form.'", + 'help_post' => "text COMMENT 'Description and/or help text to display after fields in form.'", + ], + 'civicrm_custom_field' => [ + 'label' => "varchar(255) NOT NULL COMMENT 'Text for form field label (also friendly name for administering this custom property).'", + 'help_pre' => "text COMMENT 'Description and/or help text to display before this field.'", + 'help_post' => "text COMMENT 'Description and/or help text to display after this field.'", + ], + 'civicrm_option_value' => [ + 'label' => "varchar(512) NOT NULL COMMENT 'Option string as displayed to users - e.g. the label in an HTML OPTION tag.'", + 'description' => "text COMMENT 'Optional description.'", + ], + 'civicrm_group' => [ + 'title' => "varchar(255) NOT NULL COMMENT 'Name of Group.'", + 'frontend_title' => "varchar(255) DEFAULT NULL COMMENT 'Alternative public title for this Group.'", + 'frontend_description' => "text DEFAULT NULL COMMENT 'Alternative public description of the group.'", + ], + 'civicrm_contribution_page' => [ + 'title' => "varchar(255) COMMENT 'Contribution Page title. For top of page display'", + 'intro_text' => "text COMMENT 'Text and html allowed. Displayed below title.'", + 'pay_later_text' => "text COMMENT 'The text displayed to the user in the main form'", + 'pay_later_receipt' => "text COMMENT 'The receipt sent to the user instead of the normal receipt text'", + 'initial_amount_label' => "varchar(255) COMMENT 'Initial amount label for partial payment'", + 'initial_amount_help_text' => "text COMMENT 'Initial amount help text for partial payment'", + 'thankyou_title' => "varchar(255) COMMENT 'Title for Thank-you page (header title tag, and display at the top of the page).'", + 'thankyou_text' => "text COMMENT 'text and html allowed. displayed above result on success page'", + 'thankyou_footer' => "text COMMENT 'Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.'", + 'receipt_from_name' => "varchar(255) COMMENT 'FROM email name used for receipts generated by contributions to this contribution page.'", + 'receipt_text' => "text COMMENT 'text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now'", + 'footer_text' => "text COMMENT 'Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.'", + 'frontend_title' => "varchar(255) DEFAULT NULL COMMENT 'Contribution Page Public title'", + ], + 'civicrm_product' => [ + 'name' => "varchar(255) NOT NULL COMMENT 'Required product/premium name'", + 'description' => "text COMMENT 'Optional description of the product/premium.'", + 'options' => "text COMMENT 'Store comma-delimited list of color, size, etc. options for the product.'", + ], + 'civicrm_payment_processor' => [ + 'title' => "varchar(127) COMMENT 'Payment Processor Descriptive Name.'", + ], + 'civicrm_membership_type' => [ + 'name' => "varchar(128) NOT NULL COMMENT 'Name of Membership Type'", + 'description' => "varchar(255) COMMENT 'Description of Membership Type'", + ], + 'civicrm_membership_block' => [ + 'new_title' => "varchar(255) COMMENT 'Title to display at top of block'", + 'new_text' => "text COMMENT 'Text to display below title'", + 'renewal_title' => "varchar(255) COMMENT 'Title for renewal'", + 'renewal_text' => "text COMMENT 'Text to display for member renewal'", + ], + 'civicrm_price_set' => [ + 'title' => "varchar(255) NOT NULL COMMENT 'Displayed title for the Price Set.'", + 'help_pre' => "text COMMENT 'Description and/or help text to display before fields in form.'", + 'help_post' => "text COMMENT 'Description and/or help text to display after fields in form.'", + ], + 'civicrm_dashboard' => [ + 'label' => "varchar(255) COMMENT 'dashlet title'", + ], + 'civicrm_uf_group' => [ + 'title' => "varchar(64) NOT NULL COMMENT 'Form title.'", + 'frontend_title' => "varchar(64) COMMENT 'Profile Form Public title'", + 'help_pre' => "text COMMENT 'Description and/or help text to display before fields in form.'", + 'help_post' => "text COMMENT 'Description and/or help text to display after fields in form.'", + 'cancel_button_text' => "varchar(64) DEFAULT NULL COMMENT 'Custom Text to display on the Cancel button when used in create or edit mode'", + 'submit_button_text' => "varchar(64) DEFAULT NULL COMMENT 'Custom Text to display on the submit button on profile edit/create screens'", + ], + 'civicrm_uf_field' => [ + 'help_post' => "text COMMENT 'Description and/or help text to display after this field.'", + 'help_pre' => "text COMMENT 'Description and/or help text to display before this field.'", + 'label' => "varchar(255) NOT NULL COMMENT 'To save label for fields.'", + ], + 'civicrm_price_field' => [ + 'label' => "varchar(255) NOT NULL COMMENT 'Text for form field label (also friendly name for administering this field).'", + 'help_pre' => "text COMMENT 'Description and/or help text to display before this field.'", + 'help_post' => "text COMMENT 'Description and/or help text to display after this field.'", + ], + 'civicrm_price_field_value' => [ + 'label' => "varchar(255) DEFAULT NULL COMMENT 'Price field option label'", + 'description' => "text DEFAULT NULL COMMENT 'Price field option description.'", + 'help_pre' => "text DEFAULT NULL COMMENT 'Price field option pre help text.'", + 'help_post' => "text DEFAULT NULL COMMENT 'Price field option post field help.'", + ], + 'civicrm_pcp_block' => [ + 'link_text' => "varchar(255) DEFAULT NULL COMMENT 'Link text for PCP.'", + ], + 'civicrm_event' => [ + 'title' => "varchar(255) COMMENT 'Event Title (e.g. Fall Fundraiser Dinner)'", + 'summary' => "text COMMENT 'Brief summary of event. Text and html allowed. Displayed on Event Registration form and can be used on other CMS pages which need an event summary.'", + 'description' => "text COMMENT 'Full description of event. Text and html allowed. Displayed on built-in Event Information screens.'", + 'registration_link_text' => "varchar(255) COMMENT 'Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true.'", + 'event_full_text' => "text COMMENT 'Message to display on Event Information page and INSTEAD OF Event Registration form if maximum participants are signed up. Can include email address/info about getting on a waiting list, etc. Text and html allowed.'", + 'fee_label' => "varchar(255)", + 'intro_text' => "text COMMENT 'Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.'", + 'footer_text' => "text COMMENT 'Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.'", + 'confirm_title' => "varchar(255) DEFAULT NULL COMMENT 'Title for Confirmation page.'", + 'confirm_text' => "text COMMENT 'Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.'", + 'confirm_footer_text' => "text COMMENT 'Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.'", + 'confirm_email_text' => "text COMMENT 'text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now'", + 'confirm_from_name' => "varchar(255) COMMENT 'FROM email name used for confirmation emails.'", + 'thankyou_title' => "varchar(255) DEFAULT NULL COMMENT 'Title for ThankYou page.'", + 'thankyou_text' => "text COMMENT 'ThankYou Text.'", + 'thankyou_footer_text' => "text COMMENT 'Footer message.'", + 'pay_later_text' => "text COMMENT 'The text displayed to the user in the main form'", + 'pay_later_receipt' => "text COMMENT 'The receipt sent to the user instead of the normal receipt text'", + 'initial_amount_label' => "varchar(255) COMMENT 'Initial amount label for partial payment'", + 'initial_amount_help_text' => "text COMMENT 'Initial amount help text for partial payment'", + 'waitlist_text' => "text COMMENT 'Text to display when the event is full, but participants can signup for a waitlist.'", + 'approval_req_text' => "text COMMENT 'Text to display when the approval is required to complete registration for an event.'", + 'template_title' => "varchar(255) COMMENT 'Event Template Title'", + ], + ]; + } + return $result; + } + + /** + * Get a table indexed array of the indices for translatable fields. + * + * @return array + * Indices for translatable fields. + */ + public static function &indices() { + static $result = NULL; + if (!$result) { + $result = [ + 'civicrm_custom_group' => [ + 'UI_title_extends' => [ + 'name' => 'UI_title_extends', + 'field' => [ + 'title', + 'extends', + ], + 'unique' => 1, + ], + ], + 'civicrm_custom_field' => [ + 'UI_label_custom_group_id' => [ + 'name' => 'UI_label_custom_group_id', + 'field' => [ + 'label', + 'custom_group_id', + ], + 'unique' => 1, + ], + ], + 'civicrm_group' => [ + 'UI_title' => [ + 'name' => 'UI_title', + 'field' => [ + 'title', + ], + 'unique' => 1, + ], + ], + ]; + } + return $result; + } + + /** + * Get tables with translatable fields. + * + * @return array + * Array of names of tables with fields that can be translated. + */ + public static function &tables() { + static $result = NULL; + if (!$result) { + $result = array_keys(self::columns()); + } + return $result; + } + + /** + * Get a list of widgets for editing translatable fields. + * + * @return array + * Array of the widgets for editing translatable fields. + */ + public static function &widgets() { + static $result = NULL; + if (!$result) { + $result = [ + 'civicrm_location_type' => [ + 'display_name' => [ + 'type' => "Text", + ], + ], + 'civicrm_option_group' => [ + 'title' => [ + 'type' => "Text", + ], + 'description' => [ + 'type' => "Text", + ], + ], + 'civicrm_relationship_type' => [ + 'label_a_b' => [ + 'type' => "Text", + ], + 'label_b_a' => [ + 'type' => "Text", + ], + 'description' => [ + 'type' => "Text", + ], + ], + 'civicrm_contact_type' => [ + 'label' => [ + 'type' => "Text", + ], + 'description' => [ + 'type' => "TextArea", + 'rows' => "2", + 'cols' => "60", + ], + ], + 'civicrm_batch' => [ + 'title' => [ + 'type' => "Text", + ], + 'description' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + ], + 'civicrm_premiums' => [ + 'premiums_intro_title' => [ + 'type' => "Text", + ], + 'premiums_intro_text' => [ + 'type' => "Text", + ], + 'premiums_nothankyou_label' => [ + 'type' => "Text", + ], + ], + 'civicrm_membership_status' => [ + 'label' => [ + 'type' => "Text", + ], + ], + 'civicrm_survey' => [ + 'title' => [ + 'type' => "Text", + 'required' => "true", + ], + 'instructions' => [ + 'type' => "TextArea", + 'rows' => "20", + 'cols' => "80", + ], + 'thankyou_title' => [ + 'type' => "Text", + ], + 'thankyou_text' => [ + 'type' => "TextArea", + 'rows' => "8", + 'cols' => "60", + ], + ], + 'civicrm_participant_status_type' => [ + 'label' => [ + 'type' => "Text", + ], + ], + 'civicrm_case_type' => [ + 'title' => [ + 'type' => "Text", + 'required' => "true", + ], + 'description' => [ + 'type' => "Text", + ], + ], + 'civicrm_tell_friend' => [ + 'title' => [ + 'type' => "Text", + ], + 'intro' => [ + 'type' => "Text", + ], + 'suggested_message' => [ + 'type' => "Text", + ], + 'thankyou_title' => [ + 'type' => "Text", + ], + 'thankyou_text' => [ + 'type' => "Text", + ], + ], + 'civicrm_custom_group' => [ + 'title' => [ + 'type' => "Text", + 'required' => "true", + ], + 'help_pre' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + 'help_post' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + ], + 'civicrm_custom_field' => [ + 'label' => [ + 'type' => "Text", + 'required' => "true", + ], + 'help_pre' => [ + 'type' => "Text", + ], + 'help_post' => [ + 'type' => "Text", + ], + ], + 'civicrm_option_value' => [ + 'label' => [ + 'type' => "Text", + 'required' => "true", + ], + 'description' => [ + 'type' => "TextArea", + 'rows' => "8", + 'cols' => "60", + ], + ], + 'civicrm_group' => [ + 'title' => [ + 'type' => "Text", + 'required' => "true", + ], + 'frontend_title' => [ + 'type' => "Text", + ], + 'frontend_description' => [ + 'type' => "TextArea", + 'rows' => "2", + 'cols' => "60", + ], + ], + 'civicrm_contribution_page' => [ + 'title' => [ + 'type' => "Text", + ], + 'intro_text' => [ + 'type' => "RichTextEditor", + 'rows' => "6", + 'cols' => "50", + ], + 'pay_later_text' => [ + 'type' => "Text", + ], + 'pay_later_receipt' => [ + 'type' => "Text", + ], + 'initial_amount_label' => [ + 'type' => "Text", + ], + 'initial_amount_help_text' => [ + 'type' => "Text", + ], + 'thankyou_title' => [ + 'type' => "Text", + ], + 'thankyou_text' => [ + 'type' => "RichTextEditor", + 'rows' => "8", + 'cols' => "60", + ], + 'thankyou_footer' => [ + 'type' => "RichTextEditor", + 'rows' => "8", + 'cols' => "60", + ], + 'receipt_from_name' => [ + 'type' => "Text", + ], + 'receipt_text' => [ + 'type' => "TextArea", + 'rows' => "6", + 'cols' => "50", + ], + 'footer_text' => [ + 'type' => "RichTextEditor", + 'rows' => "6", + 'cols' => "50", + ], + 'frontend_title' => [ + 'type' => "Text", + ], + ], + 'civicrm_product' => [ + 'name' => [ + 'type' => "Text", + 'required' => "true", + ], + 'description' => [ + 'type' => "Text", + ], + 'options' => [ + 'type' => "Text", + ], + ], + 'civicrm_payment_processor' => [ + 'title' => [ + 'type' => "Text", + ], + ], + 'civicrm_membership_type' => [ + 'name' => [ + 'type' => "Text", + 'label' => "Name", + 'required' => "true", + ], + 'description' => [ + 'type' => "TextArea", + 'rows' => "6", + 'cols' => "50", + 'label' => "Description", + ], + ], + 'civicrm_membership_block' => [ + 'new_title' => [ + 'type' => "Text", + ], + 'new_text' => [ + 'type' => "Text", + ], + 'renewal_title' => [ + 'type' => "Text", + ], + 'renewal_text' => [ + 'type' => "Text", + ], + ], + 'civicrm_price_set' => [ + 'title' => [ + 'type' => "Text", + 'required' => "true", + ], + 'help_pre' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + 'help_post' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + ], + 'civicrm_dashboard' => [ + 'label' => [ + 'type' => "Text", + ], + ], + 'civicrm_uf_group' => [ + 'title' => [ + 'type' => "Text", + 'required' => "true", + ], + 'frontend_title' => [ + 'type' => "Text", + ], + 'help_pre' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + 'help_post' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + 'cancel_button_text' => [ + 'type' => "Text", + ], + 'submit_button_text' => [ + 'type' => "Text", + ], + ], + 'civicrm_uf_field' => [ + 'help_post' => [ + 'type' => "Text", + ], + 'help_pre' => [ + 'type' => "Text", + ], + 'label' => [ + 'type' => "Text", + 'required' => "true", + ], + ], + 'civicrm_price_field' => [ + 'label' => [ + 'type' => "Text", + 'required' => "true", + ], + 'help_pre' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + 'help_post' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "80", + ], + ], + 'civicrm_price_field_value' => [ + 'label' => [ + 'type' => "Text", + ], + 'description' => [ + 'type' => "TextArea", + 'rows' => "2", + 'cols' => "60", + ], + 'help_pre' => [ + 'type' => "TextArea", + 'rows' => "2", + 'cols' => "60", + ], + 'help_post' => [ + 'type' => "TextArea", + 'rows' => "2", + 'cols' => "60", + ], + ], + 'civicrm_pcp_block' => [ + 'link_text' => [ + 'type' => "Text", + ], + ], + 'civicrm_event' => [ + 'title' => [ + 'type' => "Text", + ], + 'summary' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "60", + ], + 'description' => [ + 'type' => "RichTextEditor", + 'rows' => "8", + 'cols' => "60", + ], + 'registration_link_text' => [ + 'type' => "Text", + ], + 'event_full_text' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "60", + ], + 'fee_label' => [ + 'type' => "Text", + ], + 'intro_text' => [ + 'type' => "RichTextEditor", + 'rows' => "6", + 'cols' => "50", + ], + 'footer_text' => [ + 'type' => "RichTextEditor", + 'rows' => "6", + 'cols' => "50", + ], + 'confirm_title' => [ + 'type' => "Text", + ], + 'confirm_text' => [ + 'type' => "RichTextEditor", + 'rows' => "6", + 'cols' => "50", + ], + 'confirm_footer_text' => [ + 'type' => "RichTextEditor", + 'rows' => "6", + 'cols' => "50", + ], + 'confirm_email_text' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "50", + ], + 'confirm_from_name' => [ + 'type' => "Text", + ], + 'thankyou_title' => [ + 'type' => "Text", + ], + 'thankyou_text' => [ + 'type' => "RichTextEditor", + 'rows' => "6", + 'cols' => "50", + ], + 'thankyou_footer_text' => [ + 'type' => "RichTextEditor", + 'rows' => "6", + 'cols' => "50", + ], + 'pay_later_text' => [ + 'type' => "RichTextEditor", + ], + 'pay_later_receipt' => [ + 'type' => "Text", + ], + 'initial_amount_label' => [ + 'type' => "Text", + ], + 'initial_amount_help_text' => [ + 'type' => "Text", + ], + 'waitlist_text' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "60", + ], + 'approval_req_text' => [ + 'type' => "TextArea", + 'rows' => "4", + 'cols' => "60", + ], + 'template_title' => [ + 'type' => "Text", + ], + ], + ]; + } + return $result; + } + +} diff --git a/CRM/Core/Lock.php b/CRM/Core/Lock.php index da1366b4243a..894b913ab2d6 100644 --- a/CRM/Core/Lock.php +++ b/CRM/Core/Lock.php @@ -111,7 +111,8 @@ public static function createCivimailLock($name) { */ public function __construct($name, $timeout = NULL, $serverWideLock = FALSE) { $config = CRM_Core_Config::singleton(); - $dsnArray = DB::parseDSN($config->dsn); + $dsn = CRM_Utils_SQL::autoSwitchDSN($config->dsn); + $dsnArray = DB::parseDSN($dsn); $database = $dsnArray['database']; $domainID = CRM_Core_Config::domainID(); if ($serverWideLock) { diff --git a/CRM/Core/OptionGroup.php b/CRM/Core/OptionGroup.php index 89018c1a21cf..727f2b22141b 100644 --- a/CRM/Core/OptionGroup.php +++ b/CRM/Core/OptionGroup.php @@ -106,7 +106,12 @@ public static function &values( $orderBy = 'weight' ) { $cache = CRM_Utils_Cache::singleton(); - $cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName, $orderBy); + if (in_array($name, self::$_domainIDGroups)) { + $cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName, $orderBy, CRM_Core_Config::domainID()); + } + else { + $cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName, $orderBy); + } if (!$fresh) { // Fetch from static var @@ -186,8 +191,7 @@ protected static function flushValues($name, $flip, $grouping, $localize, $condi * @return string */ protected static function createCacheKey($id) { - $cacheKey = "CRM_OG_" . preg_replace('/[^a-zA-Z0-9]/', '', $id) . '_' . md5(serialize(func_get_args())); - return $cacheKey; + return "CRM_OG_" . preg_replace('/[^a-zA-Z0-9]/', '', $id) . '_' . md5(serialize(func_get_args())); } /** diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index b312c8e8d931..94bdfd88ec35 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1131,7 +1131,7 @@ public function getBillingAddressFieldsMetadata($billingLocationID = NULL) { '' => ts('- select -'), ] + CRM_Core_PseudoConstant::country(), 'is_required' => TRUE, - 'extra' => ['class' => 'required'], + 'extra' => ['class' => 'required crm-form-select2 crm-select2'], ]; return $metadata; } diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index 83697bd338fa..06e3049cf4e9 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -35,61 +35,121 @@ public function __construct($inputData) { * @return bool|void */ public function main($component = 'contribute') { + try { + //we only get invoice num as a key player from payment gateway response. + //for ARB we get x_subscription_id and x_subscription_paynum + $x_subscription_id = $this->retrieve('x_subscription_id', 'String'); + $ids = $objects = $input = []; - //we only get invoice num as a key player from payment gateway response. - //for ARB we get x_subscription_id and x_subscription_paynum - $x_subscription_id = $this->retrieve('x_subscription_id', 'String'); - $ids = $objects = $input = []; + if ($x_subscription_id) { + // Presence of the id means it is approved. + $input['component'] = $component; - if ($x_subscription_id) { - // Presence of the id means it is approved. - $input['component'] = $component; + // load post vars in $input + $this->getInput($input, $ids); - // load post vars in $input - $this->getInput($input, $ids); + // load post ids in $ids + $this->getIDs($ids, $input); - // load post ids in $ids - $this->getIDs($ids, $input); + // Attempt to get payment processor ID from URL + if (!empty($this->_inputParameters['processor_id'])) { + $paymentProcessorID = $this->_inputParameters['processor_id']; + } + else { + // This is an unreliable method as there could be more than one instance. + // Recommended approach is to use the civicrm/payment/ipn/xx url where xx is the payment + // processor id & the handleNotification function (which should call the completetransaction api & by-pass this + // entirely). The only thing the IPN class should really do is extract data from the request, validate it + // & call completetransaction or call fail? (which may not exist yet). + Civi::log()->warning('Unreliable method used to get payment_processor_id for AuthNet IPN - this will cause problems if you have more than one instance'); + $paymentProcessorTypeID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', + 'AuthNet', 'id', 'name' + ); + $paymentProcessorID = (int) civicrm_api3('PaymentProcessor', 'getvalue', [ + 'is_test' => 0, + 'options' => ['limit' => 1], + 'payment_processor_type_id' => $paymentProcessorTypeID, + 'return' => 'id', + ]); + } - // Attempt to get payment processor ID from URL - if (!empty($this->_inputParameters['processor_id'])) { - $paymentProcessorID = $this->_inputParameters['processor_id']; - } - else { - // This is an unreliable method as there could be more than one instance. - // Recommended approach is to use the civicrm/payment/ipn/xx url where xx is the payment - // processor id & the handleNotification function (which should call the completetransaction api & by-pass this - // entirely). The only thing the IPN class should really do is extract data from the request, validate it - // & call completetransaction or call fail? (which may not exist yet). - Civi::log()->warning('Unreliable method used to get payment_processor_id for AuthNet IPN - this will cause problems if you have more than one instance'); - $paymentProcessorTypeID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', - 'AuthNet', 'id', 'name' - ); - $paymentProcessorID = (int) civicrm_api3('PaymentProcessor', 'getvalue', [ - 'is_test' => 0, - 'options' => ['limit' => 1], - 'payment_processor_type_id' => $paymentProcessorTypeID, - 'return' => 'id', - ]); - } + // Check if the contribution exists + // make sure contribution exists and is valid + $contribution = new CRM_Contribute_BAO_Contribution(); + $contribution->id = $ids['contribution']; + if (!$contribution->find(TRUE)) { + throw new CRM_Core_Exception('Failure: Could not find contribution record for ' . (int) $contribution->id, NULL, ['context' => "Could not find contribution record: {$contribution->id} in IPN request: " . print_r($input, TRUE)]); + } - if (!$this->validateData($input, $ids, $objects, TRUE, $paymentProcessorID)) { - return FALSE; - } - if (!empty($ids['paymentProcessor']) && $objects['contributionRecur']->payment_processor_id != $ids['paymentProcessor']) { - Civi::log()->warning('Payment Processor does not match the recurring processor id.', ['civi.tag' => 'deprecated']); - } + // make sure contact exists and is valid + // use the contact id from the contribution record as the id in the IPN may not be valid anymore. + $contact = new CRM_Contact_BAO_Contact(); + $contact->id = $contribution->contact_id; + $contact->find(TRUE); + if ($contact->id != $ids['contact']) { + // If the ids do not match then it is possible the contact id in the IPN has been merged into another contact which is why we use the contact_id from the contribution + CRM_Core_Error::debug_log_message("Contact ID in IPN {$ids['contact']} not found but contact_id found in contribution {$contribution->contact_id} used instead"); + echo "WARNING: Could not find contact record: {$ids['contact']}

"; + $ids['contact'] = $contribution->contact_id; + } + + if (!empty($ids['contributionRecur'])) { + $contributionRecur = new CRM_Contribute_BAO_ContributionRecur(); + $contributionRecur->id = $ids['contributionRecur']; + if (!$contributionRecur->find(TRUE)) { + CRM_Core_Error::debug_log_message("Could not find contribution recur record: {$ids['ContributionRecur']} in IPN request: " . print_r($input, TRUE)); + echo "Failure: Could not find contribution recur record: {$ids['ContributionRecur']}

"; + return FALSE; + } + } - if ($component == 'contribute' && $ids['contributionRecur']) { - // check if first contribution is completed, else complete first contribution - $first = TRUE; - if ($objects['contribution']->contribution_status_id == 1) { - $first = FALSE; + $objects['contact'] = &$contact; + $objects['contribution'] = &$contribution; + + // CRM-19478: handle oddity when p=null is set in place of contribution page ID, + if (!empty($ids['contributionPage']) && !is_numeric($ids['contributionPage'])) { + // We don't need to worry if about removing contribution page id as it will be set later in + // CRM_Contribute_BAO_Contribution::loadRelatedObjects(..) using $objects['contribution']->contribution_page_id + unset($ids['contributionPage']); + } + + $this->loadObjects($input, $ids, $objects, TRUE, $paymentProcessorID); + + if (!empty($ids['paymentProcessor']) && $objects['contributionRecur']->payment_processor_id != $ids['paymentProcessor']) { + Civi::log()->warning('Payment Processor does not match the recurring processor id.', ['civi.tag' => 'deprecated']); + } + + if ($component == 'contribute' && $ids['contributionRecur']) { + // check if first contribution is completed, else complete first contribution + $first = TRUE; + if ($objects['contribution']->contribution_status_id == 1) { + $first = FALSE; + //load new contribution object if required. + // create a contribution and then get it processed + $contribution = new CRM_Contribute_BAO_Contribution(); + $contribution->contact_id = $ids['contact']; + $contribution->financial_type_id = $objects['contributionType']->id; + $contribution->contribution_page_id = $ids['contributionPage']; + $contribution->contribution_recur_id = $ids['contributionRecur']; + $contribution->receive_date = $input['receive_date']; + $contribution->currency = $objects['contribution']->currency; + $contribution->amount_level = $objects['contribution']->amount_level; + $contribution->address_id = $objects['contribution']->address_id; + $contribution->campaign_id = $objects['contribution']->campaign_id; + $contribution->_relatedObjects = $objects['contribution']->_relatedObjects; + + $objects['contribution'] = &$contribution; + } + $input['payment_processor_id'] = $paymentProcessorID; + return $this->recur($input, $ids, $objects, $first); } - return $this->recur($input, $ids, $objects, $first); } + return TRUE; + } + catch (CRM_Core_Exception $e) { + Civi::log()->debug($e->getMessage()); + echo 'Invalid or missing data'; } - return TRUE; } /** @@ -99,41 +159,21 @@ public function main($component = 'contribute') { * @param $first * * @return bool + * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ public function recur($input, $ids, $objects, $first) { - $this->_isRecurring = TRUE; $recur = &$objects['contributionRecur']; - $paymentProcessorObject = $objects['contribution']->_relatedObjects['paymentProcessor']['object']; // do a subscription check if ($recur->processor_id != $input['subscription_id']) { - CRM_Core_Error::debug_log_message('Unrecognized subscription.'); - echo 'Failure: Unrecognized subscription

'; - return FALSE; + throw new CRM_Core_Exception('Unrecognized subscription.'); } $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); $now = date('YmdHis'); - //load new contribution object if required. - if (!$first) { - // create a contribution and then get it processed - $contribution = new CRM_Contribute_BAO_Contribution(); - $contribution->contact_id = $ids['contact']; - $contribution->financial_type_id = $objects['contributionType']->id; - $contribution->contribution_page_id = $ids['contributionPage']; - $contribution->contribution_recur_id = $ids['contributionRecur']; - $contribution->receive_date = $input['receive_date']; - $contribution->currency = $objects['contribution']->currency; - $contribution->payment_instrument_id = $objects['contribution']->payment_instrument_id; - $contribution->amount_level = $objects['contribution']->amount_level; - $contribution->address_id = $objects['contribution']->address_id; - $contribution->campaign_id = $objects['contribution']->campaign_id; - $contribution->_relatedObjects = $objects['contribution']->_relatedObjects; - - $objects['contribution'] = &$contribution; - } $objects['contribution']->invoice_id = md5(uniqid(rand(), TRUE)); $objects['contribution']->total_amount = $input['amount']; $objects['contribution']->trxn_id = $input['trxn_id']; @@ -182,7 +222,11 @@ public function recur($input, $ids, $objects, $first) { return TRUE; } - $this->completeTransaction($input, $ids, $objects); + CRM_Contribute_BAO_Contribution::completeOrder($input, [ + 'related_contact' => $ids['related_contact'] ?? NULL, + 'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL, + 'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL, + ], ['contribution' => $objects['contribution']]); // Only Authorize.net does this so it is on the a.net class. If there is a need for other processors // to do this we should make it available via the api, e.g as a parameter, changing the nuance diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 930baec01633..e1fa68af31b6 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -92,9 +92,7 @@ public function validateData($input, &$ids, &$objects, $required = TRUE, $paymen $contribution = new CRM_Contribute_BAO_Contribution(); $contribution->id = $ids['contribution']; if (!$contribution->find(TRUE)) { - CRM_Core_Error::debug_log_message("Could not find contribution record: {$contribution->id} in IPN request: " . print_r($input, TRUE)); - echo "Failure: Could not find contribution record for {$contribution->id}

"; - return FALSE; + throw new CRM_Core_Exception('Failure: Could not find contribution record for ' . (int) $contribution->id, NULL, ['context' => "Could not find contribution record: {$contribution->id} in IPN request: " . print_r($input, TRUE)]); } // make sure contact exists and is valid @@ -119,9 +117,6 @@ public function validateData($input, &$ids, &$objects, $required = TRUE, $paymen } } - $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date); - $contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date); - $objects['contact'] = &$contact; $objects['contribution'] = &$contribution; @@ -148,51 +143,16 @@ public function validateData($input, &$ids, &$objects, $required = TRUE, $paymen * @param array $objects * @param bool $required * @param int $paymentProcessorID - * @param array $error_handling * * @return bool|array + * @throws \CRM_Core_Exception */ - public function loadObjects($input, &$ids, &$objects, $required, $paymentProcessorID, $error_handling = NULL) { - if (empty($error_handling)) { - // default options are that we log an error & echo it out - // note that we should refactor this error handling into error code @ some point - // but for now setting up enough separation so we can do unit tests - $error_handling = [ - 'log_error' => 1, - 'echo_error' => 1, - ]; - } + public function loadObjects($input, &$ids, &$objects, $required, $paymentProcessorID) { + $contribution = &$objects['contribution']; $ids['paymentProcessor'] = $paymentProcessorID; - if (is_a($objects['contribution'], 'CRM_Contribute_BAO_Contribution')) { - $contribution = &$objects['contribution']; - } - else { - //legacy support - functions are 'used' to be able to pass in a DAO - $contribution = new CRM_Contribute_BAO_Contribution(); - $contribution->id = $ids['contribution'] ?? NULL; - $contribution->find(TRUE); - $objects['contribution'] = &$contribution; - } - try { - $success = $contribution->loadRelatedObjects($input, $ids); - if ($required && empty($contribution->_relatedObjects['paymentProcessor'])) { - throw new CRM_Core_Exception("Could not find payment processor for contribution record: " . $contribution->id); - } - } - catch (Exception $e) { - $success = FALSE; - if (!empty($error_handling['log_error'])) { - CRM_Core_Error::debug_log_message($e->getMessage()); - } - if (!empty($error_handling['echo_error'])) { - echo $e->getMessage(); - } - if (!empty($error_handling['return_error'])) { - return [ - 'is_error' => 1, - 'error_message' => ($e->getMessage()), - ]; - } + $success = $contribution->loadRelatedObjects($input, $ids); + if ($required && empty($contribution->_relatedObjects['paymentProcessor'])) { + throw new CRM_Core_Exception("Could not find payment processor for contribution record: " . $contribution->id); } $objects = array_merge($objects, $contribution->_relatedObjects); return $success; @@ -235,17 +195,15 @@ public function failed(&$objects, $transaction = NULL, $input = []) { CRM_Contribute_BAO_ContributionRecur::copyCustomValues($objects['contributionRecur']->id, $contribution->id); } - if (empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) { - if (!empty($memberships)) { - foreach ($memberships as $membership) { - // @fixme Should we cancel only Pending memberships? per cancelled() - $this->cancelMembership($membership, $membership->status_id, FALSE); - } + if (!empty($memberships)) { + foreach ($memberships as $membership) { + // @fixme Should we cancel only Pending memberships? per cancelled() + $this->cancelMembership($membership, $membership->status_id, FALSE); } + } - if ($participant) { - $this->cancelParticipant($participant->id); - } + if ($participant) { + $this->cancelParticipant($participant->id); } if ($transaction) { @@ -305,9 +263,6 @@ public function cancelled(&$objects, $transaction = NULL, $input = []) { 'flip' => 1, ]); $contribution->contribution_status_id = $contributionStatuses['Cancelled']; - $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date); - $contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date); - $contribution->thankyou_date = CRM_Utils_Date::isoToMysql($contribution->thankyou_date); $contribution->cancel_date = self::$_now; $contribution->cancel_reason = $input['reasonCode'] ?? NULL; $contribution->save(); @@ -324,19 +279,18 @@ public function cancelled(&$objects, $transaction = NULL, $input = []) { CRM_Contribute_BAO_ContributionRecur::copyCustomValues($objects['contributionRecur']->id, $contribution->id); } - if (empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) { - if (!empty($memberships)) { - foreach ($memberships as $membership) { - if ($membership) { - $this->cancelMembership($membership, $membership->status_id); - } + if (!empty($memberships)) { + foreach ($memberships as $membership) { + if ($membership) { + $this->cancelMembership($membership, $membership->status_id); } } + } - if ($participant) { - $this->cancelParticipant($participant->id); - } + if ($participant) { + $this->cancelParticipant($participant->id); } + if ($transaction) { $transaction->commit(); } @@ -467,8 +421,13 @@ private function cancelMembership($membership, $membershipStatusID, $onlyCancelP * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function completeTransaction(&$input, &$ids, &$objects) { - CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects); + public function completeTransaction($input, $ids, $objects) { + CRM_Core_Error::deprecatedFunctionWarning('Use Payment.create api'); + CRM_Contribute_BAO_Contribution::completeOrder($input, [ + 'related_contact' => $ids['related_contact'] ?? NULL, + 'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL, + 'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL, + ], $objects); } /** diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index b6948ddbd47b..c9e35fae4297 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -53,8 +53,6 @@ public function __construct($inputData) { public function retrieve($name, $type, $abort = TRUE) { $value = CRM_Utils_Type::validate(CRM_Utils_Array::value($name, $this->_inputParameters), $type, FALSE); if ($abort && $value === NULL) { - Civi::log()->debug("PayPalIPN: Could not find an entry for $name"); - echo "Failure: Missing Parameter

" . CRM_Utils_Type::escape($name, 'String'); throw new CRM_Core_Exception("PayPalIPN: Could not find an entry for $name"); } return $value; @@ -98,14 +96,6 @@ public function recur($input, $ids, $objects, $first) { $now = date('YmdHis'); - // fix dates that already exist - $dates = ['create', 'start', 'end', 'cancel', 'modified']; - foreach ($dates as $date) { - $name = "{$date}_date"; - if ($recur->$name) { - $recur->$name = CRM_Utils_Date::isoToMysql($recur->$name); - } - } $sendNotification = FALSE; $subscriptionPaymentStatus = NULL; // set transaction type @@ -216,9 +206,11 @@ public function recur($input, $ids, $objects, $first) { return; } - $this->single($input, $ids, $objects, - TRUE, $first - ); + $this->single($input, [ + 'related_contact' => $ids['related_contact'] ?? NULL, + 'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL, + 'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL, + ], $objects, TRUE); } /** @@ -226,25 +218,19 @@ public function recur($input, $ids, $objects, $first) { * @param array $ids * @param array $objects * @param bool $recur - * @param bool $first * * @return void * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public function single($input, $ids, $objects, $recur = FALSE, $first = FALSE) { + public function single($input, $ids, $objects, $recur = FALSE) { $contribution = &$objects['contribution']; // make sure the invoice is valid and matches what we have in the contribution record - if ((!$recur) || ($recur && $first)) { - if ($contribution->invoice_id != $input['invoice']) { - Civi::log()->debug('PayPalIPN: Invoice values dont match between database and IPN request. (ID: ' . $contribution->id . ').'); - echo "Failure: Invoice values dont match between database and IPN request

"; - return; - } - } - else { - $contribution->invoice_id = md5(uniqid(rand(), TRUE)); + if ($contribution->invoice_id != $input['invoice']) { + Civi::log()->debug('PayPalIPN: Invoice values dont match between database and IPN request. (ID: ' . $contribution->id . ').'); + echo "Failure: Invoice values dont match between database and IPN request

"; + return; } if (!$recur) { @@ -258,24 +244,6 @@ public function single($input, $ids, $objects, $recur = FALSE, $first = FALSE) { $contribution->total_amount = $input['amount']; } - $status = $input['paymentStatus']; - if ($status === 'Denied' || $status === 'Failed' || $status === 'Voided') { - $this->failed($objects); - return; - } - if ($status === 'Pending') { - Civi::log()->debug('Returning since contribution status is Pending'); - return; - } - elseif ($status === 'Refunded' || $status === 'Reversed') { - $this->cancelled($objects); - return; - } - elseif ($status !== 'Completed') { - Civi::log()->debug('Returning since contribution status is not handled'); - return; - } - // check if contribution is already completed, if so we ignore this ipn $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); if ($contribution->contribution_status_id == $completedStatusId) { @@ -284,7 +252,7 @@ public function single($input, $ids, $objects, $recur = FALSE, $first = FALSE) { return; } - $this->completeTransaction($input, $ids, $objects); + CRM_Contribute_BAO_Contribution::completeOrder($input, $ids, $objects); } /** @@ -294,84 +262,113 @@ public function single($input, $ids, $objects, $recur = FALSE, $first = FALSE) { * @throws \CiviCRM_API3_Exception */ public function main() { - $objects = $ids = $input = []; - $component = $this->retrieve('module', 'String'); - $input['component'] = $component; + try { + $objects = $ids = $input = []; + $component = $this->retrieve('module', 'String'); + $input['component'] = $component; - $ids['contact'] = $this->retrieve('contactID', 'Integer', TRUE); - $contributionID = $ids['contribution'] = $this->retrieve('contributionID', 'Integer', TRUE); - $membershipID = $this->retrieve('membershipID', 'Integer', FALSE); - $contributionRecurID = $this->retrieve('contributionRecurID', 'Integer', FALSE); + $ids['contact'] = $this->retrieve('contactID', 'Integer', TRUE); + $contributionID = $ids['contribution'] = $this->retrieve('contributionID', 'Integer', TRUE); + $membershipID = $this->retrieve('membershipID', 'Integer', FALSE); + $contributionRecurID = $this->retrieve('contributionRecurID', 'Integer', FALSE); - $this->getInput($input); + $this->getInput($input); - if ($component == 'event') { - $ids['event'] = $this->retrieve('eventID', 'Integer', TRUE); - $ids['participant'] = $this->retrieve('participantID', 'Integer', TRUE); - } - else { - // get the optional ids - $ids['membership'] = $membershipID; - $ids['contributionRecur'] = $contributionRecurID; - $ids['contributionPage'] = $this->retrieve('contributionPageID', 'Integer', FALSE); - $ids['related_contact'] = $this->retrieve('relatedContactID', 'Integer', FALSE); - $ids['onbehalf_dupe_alert'] = $this->retrieve('onBehalfDupeAlert', 'Integer', FALSE); - } + if ($component == 'event') { + $ids['event'] = $this->retrieve('eventID', 'Integer', TRUE); + $ids['participant'] = $this->retrieve('participantID', 'Integer', TRUE); + } + else { + // get the optional ids + $ids['membership'] = $membershipID; + $ids['contributionRecur'] = $contributionRecurID; + $ids['contributionPage'] = $this->retrieve('contributionPageID', 'Integer', FALSE); + $ids['related_contact'] = $this->retrieve('relatedContactID', 'Integer', FALSE); + $ids['onbehalf_dupe_alert'] = $this->retrieve('onBehalfDupeAlert', 'Integer', FALSE); + } - $paymentProcessorID = $this->getPayPalPaymentProcessorID($input, $ids); + $paymentProcessorID = $this->getPayPalPaymentProcessorID($input, $ids); - Civi::log()->debug('PayPalIPN: Received (ContactID: ' . $ids['contact'] . '; trxn_id: ' . $input['trxn_id'] . ').'); + Civi::log()->debug('PayPalIPN: Received (ContactID: ' . $ids['contact'] . '; trxn_id: ' . $input['trxn_id'] . ').'); - // Debugging related to possible missing membership linkage - if ($contributionRecurID && $this->retrieve('membershipID', 'Integer', FALSE)) { - $templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution($contributionRecurID); - $membershipPayment = civicrm_api3('MembershipPayment', 'get', [ - 'contribution_id' => $templateContribution['id'], - 'membership_id' => $membershipID, - ]); - $lineItems = civicrm_api3('LineItem', 'get', [ - 'contribution_id' => $templateContribution['id'], - 'entity_id' => $membershipID, - 'entity_table' => 'civicrm_membership', - ]); - Civi::log()->debug('PayPalIPN: Received payment for membership ' . (int) $membershipID - . '. Original contribution was ' . (int) $contributionID . '. The template for this contribution is ' - . $templateContribution['id'] . ' it is linked to ' . $membershipPayment['count'] - . 'payments for this membership. It has ' . $lineItems['count'] . ' line items linked to this membership.' - . ' it is expected the original contribution will be linked by both entities to the membership.' - ); - if (empty($membershipPayment['count']) && empty($lineItems['count'])) { - Civi::log()->debug('PayPalIPN: Will attempt to compensate'); - $input['membership_id'] = $this->retrieve('membershipID', 'Integer', FALSE); - } - if ($contributionRecurID) { - $recurLinks = civicrm_api3('ContributionRecur', 'get', [ + // Debugging related to possible missing membership linkage + if ($contributionRecurID && $this->retrieve('membershipID', 'Integer', FALSE)) { + $templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution($contributionRecurID); + $membershipPayment = civicrm_api3('MembershipPayment', 'get', [ + 'contribution_id' => $templateContribution['id'], 'membership_id' => $membershipID, - 'contribution_recur_id' => $contributionRecurID, ]); - Civi::log()->debug('PayPalIPN: Membership should be linked to contribution recur record ' . $contributionRecurID - . ' ' . $recurLinks['count'] . 'links found' + $lineItems = civicrm_api3('LineItem', 'get', [ + 'contribution_id' => $templateContribution['id'], + 'entity_id' => $membershipID, + 'entity_table' => 'civicrm_membership', + ]); + Civi::log()->debug('PayPalIPN: Received payment for membership ' . (int) $membershipID + . '. Original contribution was ' . (int) $contributionID . '. The template for this contribution is ' + . $templateContribution['id'] . ' it is linked to ' . $membershipPayment['count'] + . 'payments for this membership. It has ' . $lineItems['count'] . ' line items linked to this membership.' + . ' it is expected the original contribution will be linked by both entities to the membership.' ); + if (empty($membershipPayment['count']) && empty($lineItems['count'])) { + Civi::log()->debug('PayPalIPN: Will attempt to compensate'); + $input['membership_id'] = $this->retrieve('membershipID', 'Integer', FALSE); + } + if ($contributionRecurID) { + $recurLinks = civicrm_api3('ContributionRecur', 'get', [ + 'membership_id' => $membershipID, + 'contribution_recur_id' => $contributionRecurID, + ]); + Civi::log()->debug('PayPalIPN: Membership should be linked to contribution recur record ' . $contributionRecurID + . ' ' . $recurLinks['count'] . 'links found' + ); + } + } + if (!$this->validateData($input, $ids, $objects, TRUE, $paymentProcessorID)) { + return; } - } - if (!$this->validateData($input, $ids, $objects, TRUE, $paymentProcessorID)) { - return; - } - self::$_paymentProcessor = &$objects['paymentProcessor']; - if ($component == 'contribute') { - if ($ids['contributionRecur']) { - // check if first contribution is completed, else complete first contribution - $first = TRUE; - $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); - if ($objects['contribution']->contribution_status_id == $completedStatusId) { - $first = FALSE; + $input['payment_processor_id'] = $paymentProcessorID; + + self::$_paymentProcessor = &$objects['paymentProcessor']; + if ($component == 'contribute') { + if ($ids['contributionRecur']) { + // check if first contribution is completed, else complete first contribution + $first = TRUE; + $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); + if ($objects['contribution']->contribution_status_id == $completedStatusId) { + $first = FALSE; + } + $this->recur($input, $ids, $objects, $first); + return; } - $this->recur($input, $ids, $objects, $first); + } + $status = $input['paymentStatus']; + if ($status === 'Denied' || $status === 'Failed' || $status === 'Voided') { + $this->failed($objects); + return; + } + if ($status === 'Pending') { + Civi::log()->debug('Returning since contribution status is Pending'); return; } + if ($status === 'Refunded' || $status === 'Reversed') { + $this->cancelled($objects); + return; + } + if ($status !== 'Completed') { + Civi::log()->debug('Returning since contribution status is not handled'); + return; + } + $this->single($input, [ + 'related_contact' => $ids['related_contact'] ?? NULL, + 'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL, + 'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL, + ], $objects); + } + catch (CRM_Core_Exception $e) { + Civi::log()->debug($e->getMessage()); + echo 'Invalid or missing data'; } - $this->single($input, $ids, $objects); } /** diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index be3f794b11ef..e5300b48f726 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -45,6 +45,25 @@ public function __construct($mode, &$paymentProcessor) { $this->_paymentProcessor = $paymentProcessor; } + /** + * @var GuzzleHttp\Client + */ + protected $guzzleClient; + + /** + * @return \GuzzleHttp\Client + */ + public function getGuzzleClient(): \GuzzleHttp\Client { + return $this->guzzleClient ?? new \GuzzleHttp\Client(); + } + + /** + * @param \GuzzleHttp\Client $guzzleClient + */ + public function setGuzzleClient(\GuzzleHttp\Client $guzzleClient) { + $this->guzzleClient = $guzzleClient; + } + /** * Helper function to check which payment processor type is being used. * @@ -160,12 +179,22 @@ protected function addPaypalExpressCode(&$form) { $form->_expressButtonName = $form->getButtonName('upload', 'express'); } $form->assign('expressButtonName', $form->_expressButtonName); - $form->add( - 'image', - $form->_expressButtonName, - $this->_paymentProcessor['url_button'], - ['class' => 'crm-form-submit'] - ); + $form->add('xbutton', $form->_expressButtonName, ts('Pay using PayPal'), [ + 'type' => 'submit', + 'formnovalidate' => 'formnovalidate', + 'class' => 'crm-form-submit', + ]); + CRM_Core_Resources::singleton()->addStyle(' + button#' . $form->_expressButtonName . '{ + background-image: url(' . $this->_paymentProcessor['url_button'] . '); + color: transparent; + background-repeat: no-repeat; + background-color: transparent; + background-position: center; + min-width: 150px; + min-height: 50px; + border: none; + '); } } @@ -961,6 +990,9 @@ public function doTransferCheckout(&$params, $component = 'contribute') { $sub = empty($params['is_recur']) ? 'cgi-bin/webscr' : 'subscriptions'; $paypalURL = "{$url}{$sub}?$uri"; + // Allow each CMS to do a pre-flight check before redirecting to PayPal. + CRM_Core_Config::singleton()->userSystem->prePostRedirect(); + CRM_Utils_System::redirect($paypalURL); } @@ -996,35 +1028,19 @@ public function invokeAPI($args) { throw new PaymentProcessorException('curl functions NOT available.'); } - //setting the curl parameters. - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_VERBOSE, 0); - - //turning off the server and peer verification(TrustManager Concept). - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, Civi::settings()->get('verifySSL')); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, Civi::settings()->get('verifySSL') ? 2 : 0); - - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_POST, 1); - - //setting the nvpreq as POST FIELD to curl - curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); + $response = (string) $this->getGuzzleClient()->post($url, [ + 'body' => $nvpreq, + 'curl' => [ + CURLOPT_RETURNTRANSFER => TRUE, + CURLOPT_SSL_VERIFYPEER => Civi::settings()->get('verifySSL'), + ], + ])->getBody(); - //getting response from server - $response = curl_exec($ch); - - //converting NVPResponse to an Associative Array $result = self::deformat($response); - if (curl_errno($ch)) { - throw new PaymentProcessorException(ts('Network error') . ' ' . curl_error($ch) . curl_errno($ch), curl_errno($ch)); - } - curl_close($ch); - - $outcome = strtolower(CRM_Utils_Array::value('ack', $result)); + $outcome = strtolower($result['ack'] ?? ''); - if ($outcome != 'success' && $outcome != 'successwithwarning') { + if ($outcome !== 'success' && $outcome !== 'successwithwarning') { throw new PaymentProcessorException("{$result['l_shortmessage0']} {$result['l_longmessage0']}"); } @@ -1108,7 +1124,6 @@ protected function isPaypalExpress($params) { if ($this->isPayPalType($this::PAYPAL_EXPRESS)) { return TRUE; } - // This would occur postProcess. if (!empty($params['token'])) { return TRUE; @@ -1122,6 +1137,7 @@ protected function isPaypalExpress($params) { $possibleExpressFields = [ '_qf_Register_upload_express_x', '_qf_Payment_upload_express_x', + '_qf_Main_upload_express', ]; if (array_intersect_key($params, array_fill_keys($possibleExpressFields, 1))) { return TRUE; diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index e5c58d3de7ec..2866c9bdd6b3 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -174,15 +174,6 @@ public function recur($input, $ids, $objects, $first) { $now = date('YmdHis'); - // fix dates that already exist - $dates = ['create', 'start', 'end', 'cancel', 'modified']; - foreach ($dates as $date) { - $name = "{$date}_date"; - if ($recur->$name) { - $recur->$name = CRM_Utils_Date::isoToMysql($recur->$name); - } - } - $sendNotification = FALSE; $subscriptionPaymentStatus = NULL; //List of Transaction Type @@ -321,7 +312,7 @@ public function recur($input, $ids, $objects, $first) { * * @return void */ - public function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE) { + public function single($input, $ids, $objects, $recur = FALSE, $first = FALSE) { $contribution = &$objects['contribution']; // make sure the invoice is valid and matches what we have in the contribution record @@ -373,7 +364,11 @@ public function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE return; } - $this->completeTransaction($input, $ids, $objects); + CRM_Contribute_BAO_Contribution::completeOrder($input, [ + 'related_contact' => $ids['related_contact'] ?? NULL, + 'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL, + 'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL, + ], $objects); } /** @@ -412,77 +407,85 @@ public function getPayPalPaymentProcessorID() { public function main() { CRM_Core_Error::debug_var('GET', $_GET, TRUE, TRUE); CRM_Core_Error::debug_var('POST', $_POST, TRUE, TRUE); - if ($this->_isPaymentExpress) { - $this->handlePaymentExpress(); - return; - } - $objects = $ids = $input = []; - $this->_component = $input['component'] = self::getValue('m'); - $input['invoice'] = self::getValue('i', TRUE); - // get the contribution and contact ids from the GET params - $ids['contact'] = self::getValue('c', TRUE); - $ids['contribution'] = self::getValue('b', TRUE); - - $this->getInput($input); - - if ($this->_component == 'event') { - $ids['event'] = self::getValue('e', TRUE); - $ids['participant'] = self::getValue('p', TRUE); - $ids['contributionRecur'] = self::getValue('r', FALSE); - } - else { - // get the optional ids - //@ how can this not be broken retrieving from GET as we are dealing with a POST request? - // copy & paste? Note the retrieve function now uses data from _REQUEST so this will be included - $ids['membership'] = self::retrieve('membershipID', 'Integer', 'GET', FALSE); - $ids['contributionRecur'] = self::getValue('r', FALSE); - $ids['contributionPage'] = self::getValue('p', FALSE); - $ids['related_contact'] = self::retrieve('relatedContactID', 'Integer', 'GET', FALSE); - $ids['onbehalf_dupe_alert'] = self::retrieve('onBehalfDupeAlert', 'Integer', 'GET', FALSE); - } + try { + if ($this->_isPaymentExpress) { + $this->handlePaymentExpress(); + return; + } + $objects = $ids = $input = []; + $this->_component = $input['component'] = self::getValue('m'); + $input['invoice'] = self::getValue('i', TRUE); + // get the contribution and contact ids from the GET params + $ids['contact'] = self::getValue('c', TRUE); + $ids['contribution'] = self::getValue('b', TRUE); + + $this->getInput($input); + + if ($this->_component == 'event') { + $ids['event'] = self::getValue('e', TRUE); + $ids['participant'] = self::getValue('p', TRUE); + $ids['contributionRecur'] = self::getValue('r', FALSE); + } + else { + // get the optional ids + //@ how can this not be broken retrieving from GET as we are dealing with a POST request? + // copy & paste? Note the retrieve function now uses data from _REQUEST so this will be included + $ids['membership'] = self::retrieve('membershipID', 'Integer', 'GET', FALSE); + $ids['contributionRecur'] = self::getValue('r', FALSE); + $ids['contributionPage'] = self::getValue('p', FALSE); + $ids['related_contact'] = self::retrieve('relatedContactID', 'Integer', 'GET', FALSE); + $ids['onbehalf_dupe_alert'] = self::retrieve('onBehalfDupeAlert', 'Integer', 'GET', FALSE); + } - if (!$ids['membership'] && $ids['contributionRecur']) { - $sql = " + if (!$ids['membership'] && $ids['contributionRecur']) { + $sql = " SELECT m.id FROM civicrm_membership m INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contribution_id = %1 WHERE m.contribution_recur_id = %2 LIMIT 1"; - $sqlParams = [ - 1 => [$ids['contribution'], 'Integer'], - 2 => [$ids['contributionRecur'], 'Integer'], - ]; - if ($membershipId = CRM_Core_DAO::singleValueQuery($sql, $sqlParams)) { - $ids['membership'] = $membershipId; + $sqlParams = [ + 1 => [$ids['contribution'], 'Integer'], + 2 => [$ids['contributionRecur'], 'Integer'], + ]; + if ($membershipId = CRM_Core_DAO::singleValueQuery($sql, $sqlParams)) { + $ids['membership'] = $membershipId; + } } - } - $paymentProcessorID = CRM_Utils_Array::value('processor_id', $this->_inputParameters); - if (!$paymentProcessorID) { - $paymentProcessorID = self::getPayPalPaymentProcessorID(); - } + $paymentProcessorID = CRM_Utils_Array::value('processor_id', $this->_inputParameters); + if (!$paymentProcessorID) { + $paymentProcessorID = self::getPayPalPaymentProcessorID(); + } - if (!$this->validateData($input, $ids, $objects, TRUE, $paymentProcessorID)) { - return; - } + if (!$this->validateData($input, $ids, $objects, TRUE, $paymentProcessorID)) { + return; + } - self::$_paymentProcessor = &$objects['paymentProcessor']; - //?? how on earth would we not have component be one of these? - // they are the only valid settings & this IPN file can't even be called without one of them - // grepping for this class doesn't find other paths to call this class - if ($this->_component == 'contribute' || $this->_component == 'event') { - if ($ids['contributionRecur']) { - // check if first contribution is completed, else complete first contribution - $first = TRUE; - $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); - if ($objects['contribution']->contribution_status_id == $completedStatusId) { - $first = FALSE; + $input['payment_processor_id'] = $paymentProcessorID; + + self::$_paymentProcessor = &$objects['paymentProcessor']; + //?? how on earth would we not have component be one of these? + // they are the only valid settings & this IPN file can't even be called without one of them + // grepping for this class doesn't find other paths to call this class + if ($this->_component == 'contribute' || $this->_component == 'event') { + if ($ids['contributionRecur']) { + // check if first contribution is completed, else complete first contribution + $first = TRUE; + $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); + if ($objects['contribution']->contribution_status_id == $completedStatusId) { + $first = FALSE; + } + $this->recur($input, $ids, $objects, $first); + return; } - $this->recur($input, $ids, $objects, $first); - return; } + $this->single($input, $ids, $objects, FALSE, FALSE); + } + catch (CRM_Core_Exception $e) { + Civi::log()->debug($e->getMessage()); + echo 'Invalid or missing data'; } - $this->single($input, $ids, $objects, FALSE, FALSE); } /** diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 2c71a406defa..899440812e6b 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -119,9 +119,17 @@ public static function check($permissions, $contactId = NULL) { } else { // This is an individual permission - $granted = CRM_Core_Config::singleton()->userPermissionClass->check($permission, $userId); - // Call the permission_check hook to permit dynamic escalation (CRM-19256) - CRM_Utils_Hook::permission_check($permission, $granted, $contactId); + $impliedPermissions = self::getImpliedPermissionsFor($permission); + $impliedPermissions[] = $permission; + foreach ($impliedPermissions as $permissionOption) { + $granted = CRM_Core_Config::singleton()->userPermissionClass->check($permissionOption, $userId); + // Call the permission_check hook to permit dynamic escalation (CRM-19256) + CRM_Utils_Hook::permission_check($permissionOption, $granted, $contactId); + if ($granted) { + break; + } + } + if ( !$granted && !($tempPerm && $tempPerm->check($permission)) @@ -893,11 +901,53 @@ public static function getCorePermissions() { $prefix . ts('send SMS'), ts('Send an SMS'), ], + 'administer CiviCRM system' => [ + 'label' => $prefix . ts('administer CiviCRM System'), + 'description' => ts('Perform all system administration tasks in CiviCRM'), + ], + 'administer CiviCRM data' => [ + 'label' => $prefix . ts('administer CiviCRM Data'), + 'description' => ts('Permit altering all restricted data options'), + ], ]; - + foreach (self::getImpliedPermissions() as $name => $includes) { + foreach ($includes as $permission) { + $permissions[$name][] = $permissions[$permission]; + } + } return $permissions; } + /** + * Get permissions implied by 'superset' permissions. + * + * @return array + */ + public static function getImpliedPermissions() { + return [ + 'administer CiviCRM' => ['administer CiviCRM system', 'administer CiviCRM data'], + 'administer CiviCRM data' => ['edit message templates', 'administer dedupe rules'], + 'administer CiviCRM system' => ['edit system workflow message templates'], + ]; + } + + /** + * Get any super-permissions that imply the given permission. + * + * @param string $permission + * + * @return array + */ + public static function getImpliedPermissionsFor(string $permission) { + $return = []; + foreach (self::getImpliedPermissions() as $superPermission => $components) { + if (in_array($permission, $components, TRUE)) { + $return[$superPermission] = $superPermission; + } + } + return $return; + } + /** * For each entity provides an array of permissions required for each action * diff --git a/CRM/Core/PrevNextCache/Sql.php b/CRM/Core/PrevNextCache/Sql.php index 7f8696732fed..85cf78b139ef 100644 --- a/CRM/Core/PrevNextCache/Sql.php +++ b/CRM/Core/PrevNextCache/Sql.php @@ -277,7 +277,7 @@ public function cleanup() { AND c.created_date < date_sub( NOW( ), INTERVAL %2 day ) "; $params = [ - 1 => [CRM_Core_BAO_Cache::cleanKey('CiviCRM Search PrevNextCache'), 'String'], + 1 => [CRM_Utils_Cache::cleanKey('CiviCRM Search PrevNextCache'), 'String'], 2 => [self::cacheDays, 'Integer'], ]; CRM_Core_DAO::executeQuery($sql, $params); diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index 758db214acba..c1f5af9e77f3 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -857,7 +857,7 @@ public static function group($groupType = NULL, $excludeHidden = TRUE) { * @param bool $excludeHidden * @return array */ - public static function nestedGroup($checkPermissions = TRUE, $groupType = NULL, $excludeHidden = TRUE) { + public static function nestedGroup(bool $checkPermissions = TRUE, $groupType = NULL, bool $excludeHidden = TRUE) { $groups = $checkPermissions ? self::group($groupType, $excludeHidden) : self::allGroup($groupType, $excludeHidden); return CRM_Contact_BAO_Group::getGroupsHierarchy($groups, NULL, '  ', TRUE); } diff --git a/CRM/Core/Region.php b/CRM/Core/Region.php index 06cece6bc9e7..c7eab5c58418 100644 --- a/CRM/Core/Region.php +++ b/CRM/Core/Region.php @@ -3,8 +3,7 @@ /** * Maintain a set of markup/templates to inject inside various regions */ -class CRM_Core_Region { - static private $_instances = NULL; +class CRM_Core_Region implements CRM_Core_Resources_CollectionInterface, CRM_Core_Resources_CollectionAdderInterface { /** * Obtain the content for a given region. @@ -15,12 +14,14 @@ class CRM_Core_Region { * @return CRM_Core_Region */ public static function &instance($name, $autocreate = TRUE) { - if ($autocreate && !isset(self::$_instances[$name])) { - self::$_instances[$name] = new CRM_Core_Region($name); + if ($autocreate && !isset(Civi::$statics[__CLASS__][$name])) { + Civi::$statics[__CLASS__][$name] = new CRM_Core_Region($name); } - return self::$_instances[$name]; + return Civi::$statics[__CLASS__][$name]; } + use CRM_Core_Resources_CollectionTrait; + /** * Symbolic name of this region * @@ -28,28 +29,13 @@ public static function &instance($name, $autocreate = TRUE) { */ public $_name; - /** - * List of snippets to inject within region. - * - * e.g. $this->_snippets[3]['type'] = 'template'; - * - * @var array - */ - public $_snippets; - - /** - * Whether the snippets array has been sorted - * - * @var bool - */ - public $_isSorted; - /** * @param string $name */ public function __construct($name) { $this->_name = $name; - $this->_snippets = []; + $this->types = ['markup', 'template', 'callback', 'scriptFile', 'scriptUrl', 'script', 'jquery', 'settings', 'style', 'styleFile', 'styleUrl']; + $this->defaults['region'] = $name; // Placeholder which represents any of the default content generated by the main Smarty template $this->add([ @@ -58,92 +44,6 @@ public function __construct($name) { 'markup' => '', 'weight' => 0, ]); - $this->_isSorted = TRUE; - } - - /** - * Add a snippet of content to a region. - * - * ``` - * CRM_Core_Region::instance('page-header')->add(array( - * 'markup' => '

Hello!
', - * )); - * CRM_Core_Region::instance('page-header')->add(array( - * 'script' => 'alert("Hello");', - * )); - * CRM_Core_Region::instance('page-header')->add(array( - * 'template' => 'CRM/Myextension/Extra.tpl', - * )); - * CRM_Core_Region::instance('page-header')->add(array( - * 'callback' => 'myextension_callback_function', - * )); - * ``` - * - * Note: This function does not perform any extra encoding of markup, script code, or etc. If - * you're passing in user-data, you must clean it yourself. - * - * @param array $snippet - * Array; keys:. - * - type: string (auto-detected for markup, template, callback, script, scriptUrl, jquery, style, styleUrl) - * - name: string, optional - * - weight: int, optional; default=1 - * - disabled: int, optional; default=0 - * - markup: string, HTML; required (for type==markup) - * - template: string, path; required (for type==template) - * - callback: mixed; required (for type==callback) - * - arguments: array, optional (for type==callback) - * - script: string, Javascript code - * - scriptUrl: string, URL of a Javascript file - * - jquery: string, Javascript code which runs inside a jQuery(function($){...}); block - * - style: string, CSS code - * - styleUrl: string, URL of a CSS file - * - * @return array - */ - public function add($snippet) { - static $types = ['markup', 'template', 'callback', 'scriptUrl', 'script', 'jquery', 'style', 'styleUrl']; - $defaults = [ - 'region' => $this->_name, - 'weight' => 1, - 'disabled' => FALSE, - ]; - $snippet += $defaults; - if (!isset($snippet['type'])) { - foreach ($types as $type) { - // auto-detect - if (isset($snippet[$type])) { - $snippet['type'] = $type; - break; - } - } - } - if (!isset($snippet['name'])) { - $snippet['name'] = count($this->_snippets); - } - - $this->_snippets[$snippet['name']] = $snippet; - $this->_isSorted = FALSE; - return $snippet; - } - - /** - * @param string $name - * @param $snippet - */ - public function update($name, $snippet) { - $this->_snippets[$name] = array_merge($this->_snippets[$name], $snippet); - $this->_isSorted = FALSE; - } - - /** - * Get snippet. - * - * @param string $name - * - * @return mixed - */ - public function get($name) { - return !empty($this->_snippets[$name]) ? $this->_snippets[$name] : NULL; } /** @@ -157,23 +57,17 @@ public function get($name) { */ public function render($default, $allowCmsOverride = TRUE) { // $default is just another part of the region - if (is_array($this->_snippets['default'])) { - $this->_snippets['default']['markup'] = $default; + if (is_array($this->snippets['default'])) { + $this->snippets['default']['markup'] = $default; } - // We hand as much of the work off to the CMS as possible - $cms = CRM_Core_Config::singleton()->userSystem; - if (!$this->_isSorted) { - uasort($this->_snippets, ['CRM_Core_Region', '_cmpSnippet']); - $this->_isSorted = TRUE; - } + $this->sort(); + $cms = CRM_Core_Config::singleton()->userSystem; $smarty = CRM_Core_Smarty::singleton(); $html = ''; - foreach ($this->_snippets as $snippet) { - if ($snippet['disabled']) { - continue; - } + + $renderSnippet = function($snippet) use (&$html, $smarty, $cms, $allowCmsOverride, &$renderSnippet) { switch ($snippet['type']) { case 'markup': $html .= $snippet['markup']; @@ -198,14 +92,30 @@ public function render($default, $allowCmsOverride = TRUE) { break; case 'jquery': - $snippet['script'] = sprintf("CRM.\$(function(\$) {\n%s\n});", $snippet['jquery']); - // no break - continue processing as script + $renderSnippet([ + 'type' => 'script', + 'script' => sprintf("CRM.\$(function(\$) {\n%s\n});", $snippet['jquery']), + ]); + break; + + case 'scriptFile': + foreach ($snippet['scriptFileUrls'] as $url) { + $html .= $renderSnippet(['type' => 'scriptUrl', 'scriptUrl' => $url] + $snippet); + } + break; + case 'script': if (!$allowCmsOverride || !$cms->addScript($snippet['script'], $this->_name)) { $html .= sprintf("\n", $snippet['script']); } break; + case 'styleFile': + foreach ($snippet['styleFileUrls'] as $url) { + $html .= $renderSnippet(['type' => 'styleUrl', 'styleUrl' => $url] + $snippet); + } + break; + case 'styleUrl': if (!$allowCmsOverride || !$cms->addStyleUrl($snippet['styleUrl'], $this->_name)) { $html .= sprintf("\n", $snippet['styleUrl']); @@ -218,35 +128,26 @@ public function render($default, $allowCmsOverride = TRUE) { } break; + case 'settings': + $settingsData = json_encode($this->getSettings(), JSON_UNESCAPED_SLASHES); + $js = "(function(vars) { + if (window.CRM) CRM.$.extend(true, CRM, vars); else window.CRM = vars; + })($settingsData)"; + $html .= sprintf("\n", $js); + break; + default: throw new CRM_Core_Exception(ts('Snippet type %1 is unrecognized', [1 => $snippet['type']])); } - } - return $html; - } + }; - /** - * @param $a - * @param $b - * - * @return int - */ - public static function _cmpSnippet($a, $b) { - if ($a['weight'] < $b['weight']) { - return -1; - } - if ($a['weight'] > $b['weight']) { - return 1; - } - // fallback to name sort; don't really want to do this, but it makes results more stable - if ($a['name'] < $b['name']) { - return -1; - } - if ($a['name'] > $b['name']) { - return 1; + foreach ($this->snippets as $snippet) { + if (empty($snippet['disabled'])) { + $renderSnippet($snippet); + } } - return 0; + return $html; } } diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index 0fdc57cf21de..77467b61203e 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -24,10 +24,12 @@ * @package CRM * @copyright CiviCRM LLC https://civicrm.org/licensing */ -class CRM_Core_Resources { +class CRM_Core_Resources implements CRM_Core_Resources_CollectionAdderInterface { const DEFAULT_WEIGHT = 0; const DEFAULT_REGION = 'page-footer'; + use CRM_Core_Resources_CollectionAdderTrait; + /** * We don't have a container or dependency-injection, so use singleton instead * @@ -46,18 +48,13 @@ class CRM_Core_Resources { private $strings = NULL; /** - * Settings in free-form data tree. + * Any bundles that have been added. * - * @var array - */ - protected $settings = []; - - /** - * Setting factories. + * Format is ($bundleName => bool). * - * @var callable[] + * @var array */ - protected $settingsFactories = []; + protected $addedBundles = []; /** * Added core resources. @@ -68,15 +65,6 @@ class CRM_Core_Resources { */ protected $addedCoreResources = []; - /** - * Added core styles. - * - * Format is ($regionName => bool). - * - * @var array - */ - protected $addedCoreStyles = []; - /** * Added settings. * @@ -135,13 +123,13 @@ public static function singleton(CRM_Core_Resources $instance = NULL) { * * @param CRM_Extension_Mapper $extMapper * Map extension names to their base path or URLs. - * @param CRM_Utils_Cache_Interface $cache + * @param CRM_Core_Resources_Strings $strings * JS-localization cache. * @param string|null $cacheCodeKey Random code to append to resource URLs; changing the code forces clients to reload resources */ - public function __construct($extMapper, $cache, $cacheCodeKey = NULL) { + public function __construct($extMapper, $strings, $cacheCodeKey = NULL) { $this->extMapper = $extMapper; - $this->strings = new CRM_Core_Resources_Strings($cache); + $this->strings = $strings; $this->cacheCodeKey = $cacheCodeKey; if ($cacheCodeKey !== NULL) { $this->cacheCode = Civi::settings()->get($cacheCodeKey); @@ -154,329 +142,105 @@ public function __construct($extMapper, $cache, $cacheCodeKey = NULL) { } /** - * Export permission data to the client to enable smarter GUIs. - * - * Note: Application security stems from the server's enforcement - * of the security logic (e.g. in the API permissions). There's no way - * the client can use this info to make the app more secure; however, - * it can produce a better-tuned (non-broken) UI. + * Add an item to the collection. * - * @param array $permNames - * List of permission names to check/export. - * @return CRM_Core_Resources + * @param array $snippet + * @return array + * The full/computed snippet (with defaults applied). + * @see CRM_Core_Resources_CollectionInterface::add() */ - public function addPermissions($permNames) { - $permNames = (array) $permNames; - $perms = []; - foreach ($permNames as $permName) { - $perms[$permName] = CRM_Core_Permission::check($permName); + public function add($snippet) { + if (!isset($snippet['region'])) { + $snippet['region'] = self::DEFAULT_REGION; } - return $this->addSetting([ - 'permissions' => $perms, - ]); - } - - /** - * Add a JavaScript file to the current page using \n", $js); - } + $this->addedBundles[$bundle->name] = TRUE; - /** - * Add translated string to the js CRM object. - * It can then be retrived from the client-side ts() function - * Variable substitutions can happen from client-side - * - * Note: this function rarely needs to be called directly and is mostly for internal use. - * See CRM_Core_Resources::addScriptFile which automatically adds translated strings from js files - * - * Simple example: - * // From php: - * CRM_Core_Resources::singleton()->addString('Hello'); - * // The string is now available to javascript code i.e. - * ts('Hello'); - * - * Example with client-side substitutions: - * // From php: - * CRM_Core_Resources::singleton()->addString('Your %1 has been %2'); - * // ts() in javascript works the same as in php, for example: - * ts('Your %1 has been %2', {1: objectName, 2: actionTaken}); - * - * NOTE: This function does not work with server-side substitutions - * (as this might result in collisions and unwanted variable injections) - * Instead, use code like: - * CRM_Core_Resources::singleton()->addSetting(array('myNamespace' => array('myString' => ts('Your %1 has been %2', array(subs))))); - * And from javascript access it at CRM.myNamespace.myString - * - * @param string|array $text - * @param string|null $domain - * @return CRM_Core_Resources - */ - public function addString($text, $domain = 'civicrm') { - foreach ((array) $text as $str) { - $translated = ts($str, [ - 'domain' => ($domain == 'civicrm') ? NULL : [$domain, NULL], - 'raw' => TRUE, - ]); - - // We only need to push this string to client if the translation - // is actually different from the original - if ($translated != $str) { - $bucket = $domain == 'civicrm' ? 'strings' : 'strings::' . $domain; - $this->addSetting([ - $bucket => [$str => $translated], - ]); + // Ensure that every asset has a region. + $bundle->filter(function($snippet) { + if (empty($snippet['region'])) { + $snippet['region'] = isset($snippet['settings']) + ? $this->getSettingRegion()->_name + : self::DEFAULT_REGION; } - } - return $this; - } + return $snippet; + }); - /** - * Add a CSS file to the current page using . - * - * @param string $ext - * extension name; use 'civicrm' for core. - * @param string $file - * file path -- relative to the extension base dir. - * @param int $weight - * relative weight within a given region. - * @param string $region - * location within the file; 'html-header', 'page-header', 'page-footer'. - * @return CRM_Core_Resources - */ - public function addStyleFile($ext, $file, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) { - /** @var Civi\Core\Themes $theme */ - $theme = Civi::service('themes'); - foreach ($theme->resolveUrls($theme->getActiveThemeKey(), $ext, $file) as $url) { - $this->addStyleUrl($url, $weight, $region); + $byRegion = CRM_Utils_Array::index(['region', 'name'], $bundle->getAll()); + foreach ($byRegion as $regionName => $snippets) { + CRM_Core_Region::instance($regionName)->merge($snippets); } return $this; } /** - * Add a CSS file to the current page using . - * - * @param string $url - * @param int $weight - * relative weight within a given region. - * @param string $region - * location within the file; 'html-header', 'page-header', 'page-footer'. - * @return CRM_Core_Resources - */ - public function addStyleUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) { - CRM_Core_Region::instance($region)->add([ - 'name' => $url, - 'type' => 'styleUrl', - 'styleUrl' => $url, - 'weight' => $weight, - 'region' => $region, - ]); - return $this; - } - - /** - * Add a CSS content to the current page using \n\n\n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n
Organization or Program Name Here
\n\n \n \n \n \n \n \n
Month and Year
\n
 
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\"Replace\n
 
\n
\n
 
\n
\n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
Headline Here
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\"\"
\n
 
Your Heading Here
 
\n

{contact.email_greeting},

\n

Replace with your text and images, and remember to link the facebook and twitter links in the footer to your pages. Have fun!

\n
Read More
 
\n
\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\"\"
\n
 
Your Heading Here
 
\n

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna

\n
Read More
 
\n
\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\"\"
\n
 
\n

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna

\n
\n
\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\"\"
\n
 
\n

Remember to link the facebook and twitter links below to your pages!

\n
Read More
\n
\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n \n \n \n \n \n
 Unsubscribe | Subscribe | Opt out
 {domain.address}
\n \n\n \n \n \n \n \n \n \n \n \n
\n \n  \n \n  
\n
 
\n
\n
\n\n\n\n',1,NULL,NULL,1,0,0,NULL),(67,'Sample Responsive Design Newsletter - Two Column Template','Sample Responsive Design Newsletter - Two Column','','\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n
Organization or Program Name Here
\n\n \n \n \n \n \n \n
Month Year
\n
 
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n\n \n
\n \n \n \n \n \n \n \n \n \n \n
\"Replace
\n
 
\n
\n\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
Hero Story Heading
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n\n \n\n\n\n \n \n
\n
\"\"
\n
 
Subheading Here
 
Replace with your text and images, and remember to link the facebook and twitter links in the footer to your pages. Have fun!
 
\n
\n
\n
Section Heading Here
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\"\"
\n \n\n \n \n \n \n \n \n
 
\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Heading Here
 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna
Read More
\n
\n
 
\n
\n
\n \n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
 
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\"\"
\n \n\n \n \n \n \n \n \n
 
\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Heading Here
 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna
Read More
\n
\n
 
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
 
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\"\"
\n \n\n \n \n \n \n \n \n
 
\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Heading Here
 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna
Read More
\n
\n
 
\n
\n
\n \n\n\n\n\n\n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
 
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\"\"
\n \n\n \n \n \n \n \n \n
 
\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Heading Here
 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna
Read More
\n
\n
 
\n

Remember to link the facebook and twitter links below to your pages!

\n
\n
\n
\n \n\n \n\n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n \n \n \n \n \n
 Unsubscribe | Subscribe | Opt out
 {domain.address}
\n \n \n \n \n \n \n \n \n \n \n
\n  \n \n  
\n
 
 
\n
\n
\n \n \n\n',1,NULL,NULL,1,0,0,NULL); +INSERT INTO `civicrm_msg_template` (`id`, `msg_title`, `msg_subject`, `msg_text`, `msg_html`, `is_active`, `workflow_id`, `workflow_name`, `is_default`, `is_reserved`, `is_sms`, `pdf_format_id`) VALUES (1,'Cases - Send Copy of an Activity','{if $idHash}[case #{$idHash}]{/if} {$activitySubject}\n','===========================================================\n{ts}Activity Summary{/ts} - {$activityTypeName}\n===========================================================\n{if $isCaseActivity}\n{ts}Your Case Role(s){/ts} : {$contact.role}\n{if $manageCaseURL}\n{ts}Manage Case{/ts} : {$manageCaseURL}\n{/if}\n{/if}\n\n{if $editActURL}\n{ts}Edit activity{/ts} : {$editActURL}\n{/if}\n{if $viewActURL}\n{ts}View activity{/ts} : {$viewActURL}\n{/if}\n\n{foreach from=$activity.fields item=field}\n{if $field.type eq \'Date\'}\n{$field.label}{if $field.category}({$field.category}){/if} : {$field.value|crmDate:$config->dateformatDatetime}\n{else}\n{$field.label}{if $field.category}({$field.category}){/if} : {$field.value}\n{/if}\n{/foreach}\n\n{foreach from=$activity.customGroups key=customGroupName item=customGroup}\n==========================================================\n{$customGroupName}\n==========================================================\n{foreach from=$customGroup item=field}\n{if $field.type eq \'Date\'}\n{$field.label} : {$field.value|crmDate:$config->dateformatDatetime}\n{else}\n{$field.label} : {$field.value}\n{/if}\n{/foreach}\n\n{/foreach}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n \n \n \n \n {if $isCaseActivity}\n \n \n \n \n {if $manageCaseURL}\n \n \n \n {/if}\n {/if}\n {if $editActURL}\n \n \n \n {/if}\n {if $viewActURL}\n \n \n \n {/if}\n {foreach from=$activity.fields item=field}\n \n \n \n \n {/foreach}\n\n {foreach from=$activity.customGroups key=customGroupName item=customGroup}\n \n \n \n {foreach from=$customGroup item=field}\n \n \n \n \n {/foreach}\n {/foreach}\n
\n {ts}Activity Summary{/ts} - {$activityTypeName}\n
\n {ts}Your Case Role(s){/ts}\n \n {$contact.role}\n
\n {ts}Manage Case{/ts}\n
\n {ts}Edit activity{/ts}\n
\n {ts}View activity{/ts}\n
\n {$field.label}{if $field.category}({$field.category}){/if}\n \n {if $field.type eq \'Date\'}\n {$field.value|crmDate:$config->dateformatDatetime}\n {else}\n {$field.value}\n {/if}\n
\n {$customGroupName}\n
\n {$field.label}\n \n {if $field.type eq \'Date\'}\n {$field.value|crmDate:$config->dateformatDatetime}\n {else}\n {$field.value}\n {/if}\n
\n
\n
\n\n\n\n',1,820,'case_activity',1,0,0,NULL),(2,'Cases - Send Copy of an Activity','{if $idHash}[case #{$idHash}]{/if} {$activitySubject}\n','===========================================================\n{ts}Activity Summary{/ts} - {$activityTypeName}\n===========================================================\n{if $isCaseActivity}\n{ts}Your Case Role(s){/ts} : {$contact.role}\n{if $manageCaseURL}\n{ts}Manage Case{/ts} : {$manageCaseURL}\n{/if}\n{/if}\n\n{if $editActURL}\n{ts}Edit activity{/ts} : {$editActURL}\n{/if}\n{if $viewActURL}\n{ts}View activity{/ts} : {$viewActURL}\n{/if}\n\n{foreach from=$activity.fields item=field}\n{if $field.type eq \'Date\'}\n{$field.label}{if $field.category}({$field.category}){/if} : {$field.value|crmDate:$config->dateformatDatetime}\n{else}\n{$field.label}{if $field.category}({$field.category}){/if} : {$field.value}\n{/if}\n{/foreach}\n\n{foreach from=$activity.customGroups key=customGroupName item=customGroup}\n==========================================================\n{$customGroupName}\n==========================================================\n{foreach from=$customGroup item=field}\n{if $field.type eq \'Date\'}\n{$field.label} : {$field.value|crmDate:$config->dateformatDatetime}\n{else}\n{$field.label} : {$field.value}\n{/if}\n{/foreach}\n\n{/foreach}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n \n \n \n \n {if $isCaseActivity}\n \n \n \n \n {if $manageCaseURL}\n \n \n \n {/if}\n {/if}\n {if $editActURL}\n \n \n \n {/if}\n {if $viewActURL}\n \n \n \n {/if}\n {foreach from=$activity.fields item=field}\n \n \n \n \n {/foreach}\n\n {foreach from=$activity.customGroups key=customGroupName item=customGroup}\n \n \n \n {foreach from=$customGroup item=field}\n \n \n \n \n {/foreach}\n {/foreach}\n
\n {ts}Activity Summary{/ts} - {$activityTypeName}\n
\n {ts}Your Case Role(s){/ts}\n \n {$contact.role}\n
\n {ts}Manage Case{/ts}\n
\n {ts}Edit activity{/ts}\n
\n {ts}View activity{/ts}\n
\n {$field.label}{if $field.category}({$field.category}){/if}\n \n {if $field.type eq \'Date\'}\n {$field.value|crmDate:$config->dateformatDatetime}\n {else}\n {$field.value}\n {/if}\n
\n {$customGroupName}\n
\n {$field.label}\n \n {if $field.type eq \'Date\'}\n {$field.value|crmDate:$config->dateformatDatetime}\n {else}\n {$field.value}\n {/if}\n
\n
\n
\n\n\n\n',1,820,'case_activity',0,1,0,NULL),(3,'Contributions - Duplicate Organization Alert','{ts}CiviContribute Alert: Possible Duplicate Contact Record{/ts} - {contact.display_name}\n','{ts}A contribution / membership signup was made on behalf of the organization listed below.{/ts}\n{ts}The information provided matched multiple existing database records based on the configured Duplicate Matching Rules for your site.{/ts}\n\n{ts}Organization Name{/ts}: {$onBehalfName}\n{ts}Organization Email{/ts}: {$onBehalfEmail}\n{ts}Organization Contact ID{/ts}: {$onBehalfID}\n\n{ts}If you think this may be a duplicate contact which should be merged with an existing record - Go to \"Contacts >> Find and Merge Duplicate Contacts\". Use the strict rule for Organizations to find the potential duplicates and merge them if appropriate.{/ts}\n\n{if $receiptMessage}\n###########################################################\n{ts}Copy of Contribution Receipt{/ts}\n\n###########################################################\n{$receiptMessage}\n\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n \n \n \n {if $receiptMessage}\n \n \n \n {/if}\n
\n

{ts}A contribution / membership signup was made on behalf of the organization listed below.{/ts}

\n

{ts}The information provided matched multiple existing database records based on the configured Duplicate Matching Rules for your site.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts}Organization Name{/ts}\n \n {$onBehalfName}\n
\n {ts}Organization Email{/ts}\n \n {$onBehalfEmail}\n
\n {ts}Organization Contact ID{/ts}\n \n {$onBehalfID}\n
\n
\n

{ts}If you think this may be a duplicate contact which should be merged with an existing record - Go to \"Contacts >> Find and Merge Duplicate Contacts\". Use the strict rule for Organizations to find the potential duplicates and merge them if appropriate.{/ts}

\n
\n \n \n \n \n \n \n \n
\n {ts}Copy of Contribution Receipt{/ts}\n
\n {* FIXME: the below is most probably not HTML-ised *}\n {$receiptMessage}\n
\n
\n
\n\n\n\n',1,821,'contribution_dupalert',1,0,0,NULL),(4,'Contributions - Duplicate Organization Alert','{ts}CiviContribute Alert: Possible Duplicate Contact Record{/ts} - {contact.display_name}\n','{ts}A contribution / membership signup was made on behalf of the organization listed below.{/ts}\n{ts}The information provided matched multiple existing database records based on the configured Duplicate Matching Rules for your site.{/ts}\n\n{ts}Organization Name{/ts}: {$onBehalfName}\n{ts}Organization Email{/ts}: {$onBehalfEmail}\n{ts}Organization Contact ID{/ts}: {$onBehalfID}\n\n{ts}If you think this may be a duplicate contact which should be merged with an existing record - Go to \"Contacts >> Find and Merge Duplicate Contacts\". Use the strict rule for Organizations to find the potential duplicates and merge them if appropriate.{/ts}\n\n{if $receiptMessage}\n###########################################################\n{ts}Copy of Contribution Receipt{/ts}\n\n###########################################################\n{$receiptMessage}\n\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n \n \n \n {if $receiptMessage}\n \n \n \n {/if}\n
\n

{ts}A contribution / membership signup was made on behalf of the organization listed below.{/ts}

\n

{ts}The information provided matched multiple existing database records based on the configured Duplicate Matching Rules for your site.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts}Organization Name{/ts}\n \n {$onBehalfName}\n
\n {ts}Organization Email{/ts}\n \n {$onBehalfEmail}\n
\n {ts}Organization Contact ID{/ts}\n \n {$onBehalfID}\n
\n
\n

{ts}If you think this may be a duplicate contact which should be merged with an existing record - Go to \"Contacts >> Find and Merge Duplicate Contacts\". Use the strict rule for Organizations to find the potential duplicates and merge them if appropriate.{/ts}

\n
\n \n \n \n \n \n \n \n
\n {ts}Copy of Contribution Receipt{/ts}\n
\n {* FIXME: the below is most probably not HTML-ised *}\n {$receiptMessage}\n
\n
\n
\n\n\n\n',1,821,'contribution_dupalert',0,1,0,NULL),(5,'Contributions - Receipt (off-line)','{ts}Contribution Receipt{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{if $formValues.receipt_text}\n{$formValues.receipt_text}\n{else}{ts}Below you will find a receipt for this contribution.{/ts}{/if}\n\n===========================================================\n{ts}Contribution Information{/ts}\n\n===========================================================\n{ts}Contributor{/ts}: {contact.display_name}\n{ts}Financial Type{/ts}: {$formValues.contributionType_name}\n{if $lineItem}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{if $getTaxDetails}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{/if}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {if $getTaxDetails} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate} {$ts_taxAmount|string_format:\"%10s\"} {/if} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney:$currency|string_format:\"%10s\"} {if $getTaxDetails}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $getTaxDetails && $dataArray}\n{ts}Amount before Tax{/ts} : {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0 || $value != \'\'}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}% : {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm} : {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n\n{if isset($totalTaxAmount) && $totalTaxAmount !== \'null\'}\n{ts}Total Tax Amount{/ts} : {$totalTaxAmount|crmMoney:$currency}\n{/if}\n{ts}Total Amount{/ts} : {$formValues.total_amount|crmMoney:$currency}\n{if $receive_date}\n{ts}Date Received{/ts}: {$receive_date|truncate:10:\'\'|crmDate}\n{/if}\n{if $receipt_date}\n{ts}Receipt Date{/ts}: {$receipt_date|truncate:10:\'\'|crmDate}\n{/if}\n{if $formValues.paidBy and !$formValues.hidden_CreditCard}\n{ts}Paid By{/ts}: {$formValues.paidBy}\n{if $formValues.check_number}\n{ts}Check Number{/ts}: {$formValues.check_number}\n{/if}\n{/if}\n{if $formValues.trxn_id}\n{ts}Transaction ID{/ts}: {$formValues.trxn_id}\n{/if}\n\n{if $ccContribution}\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{if $customGroup}\n{foreach from=$customGroup item=value key=customName}\n===========================================================\n{$customName}\n===========================================================\n{foreach from=$value item=v key=n}\n{$n}: {$v}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $softCreditTypes and $softCredits}\n{foreach from=$softCreditTypes item=softCreditType key=n}\n===========================================================\n{$softCreditType}\n===========================================================\n{foreach from=$softCredits.$n item=value key=label}\n{$label}: {$value}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $formValues.product_name}\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$formValues.product_name}\n{if $formValues.product_option}\n{ts}Option{/ts}: {$formValues.product_option}\n{/if}\n{if $formValues.product_sku}\n{ts}SKU{/ts}: {$formValues.product_sku}\n{/if}\n{if $fulfilled_date}\n{ts}Sent{/ts}: {$fulfilled_date|crmDate}\n{/if}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $formValues.receipt_text}\n

{$formValues.receipt_text|htmlize}

\n {else}\n

{ts}Below you will find a receipt for this contribution.{/ts}

\n {/if}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n {if $lineItem and !$is_quick_config}\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n {/if}\n {if $getTaxDetails && $dataArray}\n \n \n \n \n\n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0 || $value != \'\'}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n {/if}\n\n {if isset($totalTaxAmount) && $totalTaxAmount !== \'null\'}\n \n \n \n \n {/if}\n\n \n \n \n \n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $receipt_date}\n \n \n \n \n {/if}\n\n {if $formValues.paidBy and !$formValues.hidden_CreditCard}\n \n \n \n \n {if $formValues.check_number}\n \n \n \n \n {/if}\n {/if}\n\n {if $formValues.trxn_id}\n \n \n \n \n {/if}\n\n {if $ccContribution}\n \n \n \n \n \n \n \n \n \n \n \n \n {/if}\n\n {if $softCreditTypes and $softCredits}\n {foreach from=$softCreditTypes item=softCreditType key=n}\n \n \n \n {foreach from=$softCredits.$n item=value key=label}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n {if $customGroup}\n {foreach from=$customGroup item=value key=customName}\n \n \n \n {foreach from=$value item=v key=n}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n {if $formValues.product_name}\n \n \n \n \n \n \n {if $formValues.product_option}\n \n \n \n \n {/if}\n {if $formValues.product_sku}\n \n \n \n \n {/if}\n {if $fulfilled_date}\n \n \n \n \n {/if}\n {/if}\n\n
\n {ts}Contribution Information{/ts}\n
\n {ts}Contributor Name{/ts}\n \n {contact.display_name}\n
\n {ts}Financial Type{/ts}\n \n {$formValues.contributionType_name}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n {if $getTaxDetails}\n \n \n \n {/if}\n \n \n {foreach from=$value item=line}\n \n \n \n \n {if $getTaxDetails}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n {/if}\n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Subtotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.qty}\n \n {$line.unit_price|crmMoney:$currency}\n \n {$line.unit_price*$line.qty|crmMoney:$currency}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney:$currency}\n \n {$line.line_total+$line.tax_amount|crmMoney:$currency}\n
\n
\n {ts} Amount before Tax : {/ts}\n \n {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Total Amount{/ts}\n \n {$formValues.total_amount|crmMoney:$currency}\n
\n {ts}Date Received{/ts}\n \n {$receive_date|truncate:10:\'\'|crmDate}\n
\n {ts}Receipt Date{/ts}\n \n {$receipt_date|truncate:10:\'\'|crmDate}\n
\n {ts}Paid By{/ts}\n \n {$formValues.paidBy}\n
\n {ts}Check Number{/ts}\n \n {$formValues.check_number}\n
\n {ts}Transaction ID{/ts}\n \n {$formValues.trxn_id}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
\n {$softCreditType}\n
\n {$label}\n \n {$value}\n
\n {$customName}\n
\n {$n}\n \n {$v}\n
\n {ts}Premium Information{/ts}\n
\n {$formValues.product_name}\n
\n {ts}Option{/ts}\n \n {$formValues.product_option}\n
\n {ts}SKU{/ts}\n \n {$formValues.product_sku}\n
\n {ts}Sent{/ts}\n \n {$fulfilled_date|truncate:10:\'\'|crmDate}\n
\n
\n
\n\n\n\n',1,822,'contribution_offline_receipt',1,0,0,NULL),(6,'Contributions - Receipt (off-line)','{ts}Contribution Receipt{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{if $formValues.receipt_text}\n{$formValues.receipt_text}\n{else}{ts}Below you will find a receipt for this contribution.{/ts}{/if}\n\n===========================================================\n{ts}Contribution Information{/ts}\n\n===========================================================\n{ts}Contributor{/ts}: {contact.display_name}\n{ts}Financial Type{/ts}: {$formValues.contributionType_name}\n{if $lineItem}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{if $getTaxDetails}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{/if}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {if $getTaxDetails} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate} {$ts_taxAmount|string_format:\"%10s\"} {/if} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney:$currency|string_format:\"%10s\"} {if $getTaxDetails}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $getTaxDetails && $dataArray}\n{ts}Amount before Tax{/ts} : {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0 || $value != \'\'}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}% : {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm} : {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n\n{if isset($totalTaxAmount) && $totalTaxAmount !== \'null\'}\n{ts}Total Tax Amount{/ts} : {$totalTaxAmount|crmMoney:$currency}\n{/if}\n{ts}Total Amount{/ts} : {$formValues.total_amount|crmMoney:$currency}\n{if $receive_date}\n{ts}Date Received{/ts}: {$receive_date|truncate:10:\'\'|crmDate}\n{/if}\n{if $receipt_date}\n{ts}Receipt Date{/ts}: {$receipt_date|truncate:10:\'\'|crmDate}\n{/if}\n{if $formValues.paidBy and !$formValues.hidden_CreditCard}\n{ts}Paid By{/ts}: {$formValues.paidBy}\n{if $formValues.check_number}\n{ts}Check Number{/ts}: {$formValues.check_number}\n{/if}\n{/if}\n{if $formValues.trxn_id}\n{ts}Transaction ID{/ts}: {$formValues.trxn_id}\n{/if}\n\n{if $ccContribution}\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{if $customGroup}\n{foreach from=$customGroup item=value key=customName}\n===========================================================\n{$customName}\n===========================================================\n{foreach from=$value item=v key=n}\n{$n}: {$v}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $softCreditTypes and $softCredits}\n{foreach from=$softCreditTypes item=softCreditType key=n}\n===========================================================\n{$softCreditType}\n===========================================================\n{foreach from=$softCredits.$n item=value key=label}\n{$label}: {$value}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $formValues.product_name}\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$formValues.product_name}\n{if $formValues.product_option}\n{ts}Option{/ts}: {$formValues.product_option}\n{/if}\n{if $formValues.product_sku}\n{ts}SKU{/ts}: {$formValues.product_sku}\n{/if}\n{if $fulfilled_date}\n{ts}Sent{/ts}: {$fulfilled_date|crmDate}\n{/if}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $formValues.receipt_text}\n

{$formValues.receipt_text|htmlize}

\n {else}\n

{ts}Below you will find a receipt for this contribution.{/ts}

\n {/if}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n {if $lineItem and !$is_quick_config}\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n {/if}\n {if $getTaxDetails && $dataArray}\n \n \n \n \n\n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0 || $value != \'\'}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n {/if}\n\n {if isset($totalTaxAmount) && $totalTaxAmount !== \'null\'}\n \n \n \n \n {/if}\n\n \n \n \n \n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $receipt_date}\n \n \n \n \n {/if}\n\n {if $formValues.paidBy and !$formValues.hidden_CreditCard}\n \n \n \n \n {if $formValues.check_number}\n \n \n \n \n {/if}\n {/if}\n\n {if $formValues.trxn_id}\n \n \n \n \n {/if}\n\n {if $ccContribution}\n \n \n \n \n \n \n \n \n \n \n \n \n {/if}\n\n {if $softCreditTypes and $softCredits}\n {foreach from=$softCreditTypes item=softCreditType key=n}\n \n \n \n {foreach from=$softCredits.$n item=value key=label}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n {if $customGroup}\n {foreach from=$customGroup item=value key=customName}\n \n \n \n {foreach from=$value item=v key=n}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n {if $formValues.product_name}\n \n \n \n \n \n \n {if $formValues.product_option}\n \n \n \n \n {/if}\n {if $formValues.product_sku}\n \n \n \n \n {/if}\n {if $fulfilled_date}\n \n \n \n \n {/if}\n {/if}\n\n
\n {ts}Contribution Information{/ts}\n
\n {ts}Contributor Name{/ts}\n \n {contact.display_name}\n
\n {ts}Financial Type{/ts}\n \n {$formValues.contributionType_name}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n {if $getTaxDetails}\n \n \n \n {/if}\n \n \n {foreach from=$value item=line}\n \n \n \n \n {if $getTaxDetails}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n {/if}\n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Subtotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.qty}\n \n {$line.unit_price|crmMoney:$currency}\n \n {$line.unit_price*$line.qty|crmMoney:$currency}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney:$currency}\n \n {$line.line_total+$line.tax_amount|crmMoney:$currency}\n
\n
\n {ts} Amount before Tax : {/ts}\n \n {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Total Amount{/ts}\n \n {$formValues.total_amount|crmMoney:$currency}\n
\n {ts}Date Received{/ts}\n \n {$receive_date|truncate:10:\'\'|crmDate}\n
\n {ts}Receipt Date{/ts}\n \n {$receipt_date|truncate:10:\'\'|crmDate}\n
\n {ts}Paid By{/ts}\n \n {$formValues.paidBy}\n
\n {ts}Check Number{/ts}\n \n {$formValues.check_number}\n
\n {ts}Transaction ID{/ts}\n \n {$formValues.trxn_id}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
\n {$softCreditType}\n
\n {$label}\n \n {$value}\n
\n {$customName}\n
\n {$n}\n \n {$v}\n
\n {ts}Premium Information{/ts}\n
\n {$formValues.product_name}\n
\n {ts}Option{/ts}\n \n {$formValues.product_option}\n
\n {ts}SKU{/ts}\n \n {$formValues.product_sku}\n
\n {ts}Sent{/ts}\n \n {$fulfilled_date|truncate:10:\'\'|crmDate}\n
\n
\n
\n\n\n\n',1,822,'contribution_offline_receipt',0,1,0,NULL),(7,'Contributions - Receipt (on-line)','{if $is_pay_later}{ts}Invoice{/ts}{else}{ts}Receipt{/ts}{/if} - {$title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{/if}\n\n{if $amount}\n===========================================================\n{ts}Contribution Information{/ts}\n\n===========================================================\n{if $lineItem and $priceSetID and !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{/if}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate} {$ts_taxAmount|string_format:\"%10s\"} {/if} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney:$currency|string_format:\"%10s\"} {if $dataArray}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Total Amount{/ts}: {$amount|crmMoney:$currency}\n{else}\n{ts}Amount{/ts}: {$amount|crmMoney:$currency} {if $amount_level } - {$amount_level} {/if}\n{/if}\n{/if}\n{if $receive_date}\n\n{ts}Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $is_monetary and $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n{/if}\n\n{if $is_recur}\n{ts}This is a recurring contribution.{/ts}\n\n{if $cancelSubscriptionUrl}\n{ts}You can cancel future contributions at:{/ts}\n\n{$cancelSubscriptionUrl}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n{ts}You can update billing details for this recurring contribution at:{/ts}\n\n{$updateSubscriptionBillingUrl}\n\n{/if}\n\n{if $updateSubscriptionUrl}\n{ts}You can update recurring contribution amount or change the number of installments for this recurring contribution at:{/ts}\n\n{$updateSubscriptionUrl}\n\n{/if}\n{/if}\n\n{if $honor_block_is_active}\n===========================================================\n{$soft_credit_type}\n===========================================================\n{foreach from=$honoreeProfile item=value key=label}\n{$label}: {$value}\n{/foreach}\n{elseif $softCreditTypes and $softCredits}\n{foreach from=$softCreditTypes item=softCreditType key=n}\n===========================================================\n{$softCreditType}\n===========================================================\n{foreach from=$softCredits.$n item=value key=label}\n{$label}: {$value}\n{/foreach}\n{/foreach}\n{/if}\n{if $pcpBlock}\n===========================================================\n{ts}Personal Campaign Page{/ts}\n\n===========================================================\n{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n\n{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if}\n\n{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if}\n\n{/if}\n{if $onBehalfProfile}\n===========================================================\n{ts}On Behalf Of{/ts}\n\n===========================================================\n{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n{$onBehalfName}: {$onBehalfValue}\n{/foreach}\n{/if}\n\n{if $billingName}\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n{elseif $email}\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$email}\n{/if} {* End billingName or Email*}\n{if $credit_card_type}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n\n{if $selectPremium }\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$product_name}\n{if $option}\n{ts}Option{/ts}: {$option}\n{/if}\n{if $sku}\n{ts}SKU{/ts}: {$sku}\n{/if}\n{if $start_date}\n{ts}Start Date{/ts}: {$start_date|crmDate}\n{/if}\n{if $end_date}\n{ts}End Date{/ts}: {$end_date|crmDate}\n{/if}\n{if $contact_email OR $contact_phone}\n\n{ts}For information about this premium, contact:{/ts}\n\n{if $contact_email}\n {$contact_email}\n{/if}\n{if $contact_phone}\n {$contact_phone}\n{/if}\n{/if}\n{if $is_deductible AND $price}\n\n{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if}\n{/if}\n\n{if $customPre}\n===========================================================\n{$customPre_grouptitle}\n\n===========================================================\n{foreach from=$customPre item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n\n\n{if $customPost}\n===========================================================\n{$customPost_grouptitle}\n\n===========================================================\n{foreach from=$customPost item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $receipt_text}\n

{$receipt_text|htmlize}

\n {/if}\n\n {if $is_pay_later}\n

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *}\n {/if}\n\n
\n \n\n {if $amount}\n\n\n \n \n \n\n {if $lineItem and $priceSetID and !$is_quick_config}\n\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n {if $dataArray}\n \n \n \n \n\n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n\n {/if}\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n \n \n \n \n\n {else}\n\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n \n \n \n \n\n {/if}\n\n {/if}\n\n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $is_monetary and $trxn_id}\n \n \n \n \n {/if}\n\n {if $is_recur}\n \n \n \n {if $updateSubscriptionBillingUrl}\n \n \n \n {/if}\n {if $updateSubscriptionUrl}\n \n \n \n {/if}\n {/if}\n\n {if $honor_block_is_active}\n \n \n \n {foreach from=$honoreeProfile item=value key=label}\n \n \n \n \n {/foreach}\n {elseif $softCreditTypes and $softCredits}\n {foreach from=$softCreditTypes item=softCreditType key=n}\n \n \n \n {foreach from=$softCredits.$n item=value key=label}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n {if $pcpBlock}\n \n \n \n \n \n \n \n {if $pcp_roll_nickname}\n \n \n \n \n {/if}\n {if $pcp_personal_note}\n \n \n \n \n {/if}\n {/if}\n\n {if $onBehalfProfile}\n \n \n \n {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n \n \n \n \n {/foreach}\n {/if}\n\n {if $isShare}\n \n \n \n {/if}\n\n {if $billingName}\n \n \n \n \n \n \n {elseif $email}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n {/if}\n\n {if $selectPremium}\n \n \n \n \n \n \n {if $option}\n \n \n \n \n {/if}\n {if $sku}\n \n \n \n \n {/if}\n {if $start_date}\n \n \n \n \n {/if}\n {if $end_date}\n \n \n \n \n {/if}\n {if $contact_email OR $contact_phone}\n \n \n \n {/if}\n {if $is_deductible AND $price}\n \n \n \n {/if}\n {/if}\n\n {if $customPre}\n \n \n \n {foreach from=$customPre item=customValue key=customName}\n {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $customPost}\n \n \n \n {foreach from=$customPost item=customValue key=customName}\n {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n
\n {ts}Contribution Information{/ts}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n {if $dataArray}\n \n \n \n {/if}\n \n \n {foreach from=$value item=line}\n \n \n \n \n {if $getTaxDetails}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n {/if}\n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Subtotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.qty}\n \n {$line.unit_price|crmMoney:$currency}\n \n {$line.unit_price*$line.qty|crmMoney:$currency}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney:$currency}\n \n {$line.line_total+$line.tax_amount|crmMoney:$currency}\n
\n
\n {ts} Amount before Tax : {/ts}\n \n {$amount-$totalTaxAmount|crmMoney:$currency}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {ts}Total Tax{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Total Amount{/ts}\n \n {$amount|crmMoney:$currency}\n
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Amount{/ts}\n \n {$amount|crmMoney:$currency} {if $amount_level} - {$amount_level}{/if}\n
\n {ts}Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}This is a recurring contribution.{/ts}\n {if $cancelSubscriptionUrl}\n {ts 1=$cancelSubscriptionUrl}You can cancel future contributions by visiting this web page.{/ts}\n {/if}\n
\n {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by visiting this web page.{/ts}\n
\n {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page.{/ts}\n
\n {$soft_credit_type}\n
\n {$label}\n \n {$value}\n
\n {$softCreditType}\n
\n {$label}\n \n {$value}\n
\n {ts}Personal Campaign Page{/ts}\n
\n {ts}Display In Honor Roll{/ts}\n \n {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n
\n {ts}Nickname{/ts}\n \n {$pcp_roll_nickname}\n
\n {ts}Personal Note{/ts}\n \n {$pcp_personal_note}\n
\n {$onBehalfProfile_grouptitle}\n
\n {$onBehalfName}\n \n {$onBehalfValue}\n
\n {capture assign=contributionUrl}{crmURL p=\'civicrm/contribute/transact\' q=\"reset=1&id=`$contributionPageId`\" a=true fe=1 h=1}{/capture}\n {include file=\"CRM/common/SocialNetwork.tpl\" emailMode=true url=$contributionUrl title=$title pageURL=$contributionUrl}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}
\n {$email}\n
\n {ts}Registered Email{/ts}\n
\n {$email}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}
\n
\n {ts}Premium Information{/ts}\n
\n {$product_name}\n
\n {ts}Option{/ts}\n \n {$option}\n
\n {ts}SKU{/ts}\n \n {$sku}\n
\n {ts}Start Date{/ts}\n \n {$start_date|crmDate}\n
\n {ts}End Date{/ts}\n \n {$end_date|crmDate}\n
\n

{ts}For information about this premium, contact:{/ts}

\n {if $contact_email}\n

{$contact_email}

\n {/if}\n {if $contact_phone}\n

{$contact_phone}

\n {/if}\n
\n

{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

\n
\n {$customPre_grouptitle}\n
\n {$customName}\n \n {$customValue}\n
\n {$customPost_grouptitle}\n
\n {$customName}\n \n {$customValue}\n
\n
\n\n\n\n',1,823,'contribution_online_receipt',1,0,0,NULL),(8,'Contributions - Receipt (on-line)','{if $is_pay_later}{ts}Invoice{/ts}{else}{ts}Receipt{/ts}{/if} - {$title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{/if}\n\n{if $amount}\n===========================================================\n{ts}Contribution Information{/ts}\n\n===========================================================\n{if $lineItem and $priceSetID and !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{/if}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate} {$ts_taxAmount|string_format:\"%10s\"} {/if} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney:$currency|string_format:\"%10s\"} {if $dataArray}{$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Total Amount{/ts}: {$amount|crmMoney:$currency}\n{else}\n{ts}Amount{/ts}: {$amount|crmMoney:$currency} {if $amount_level } - {$amount_level} {/if}\n{/if}\n{/if}\n{if $receive_date}\n\n{ts}Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $is_monetary and $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n{/if}\n\n{if $is_recur}\n{ts}This is a recurring contribution.{/ts}\n\n{if $cancelSubscriptionUrl}\n{ts}You can cancel future contributions at:{/ts}\n\n{$cancelSubscriptionUrl}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n{ts}You can update billing details for this recurring contribution at:{/ts}\n\n{$updateSubscriptionBillingUrl}\n\n{/if}\n\n{if $updateSubscriptionUrl}\n{ts}You can update recurring contribution amount or change the number of installments for this recurring contribution at:{/ts}\n\n{$updateSubscriptionUrl}\n\n{/if}\n{/if}\n\n{if $honor_block_is_active}\n===========================================================\n{$soft_credit_type}\n===========================================================\n{foreach from=$honoreeProfile item=value key=label}\n{$label}: {$value}\n{/foreach}\n{elseif $softCreditTypes and $softCredits}\n{foreach from=$softCreditTypes item=softCreditType key=n}\n===========================================================\n{$softCreditType}\n===========================================================\n{foreach from=$softCredits.$n item=value key=label}\n{$label}: {$value}\n{/foreach}\n{/foreach}\n{/if}\n{if $pcpBlock}\n===========================================================\n{ts}Personal Campaign Page{/ts}\n\n===========================================================\n{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n\n{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if}\n\n{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if}\n\n{/if}\n{if $onBehalfProfile}\n===========================================================\n{ts}On Behalf Of{/ts}\n\n===========================================================\n{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n{$onBehalfName}: {$onBehalfValue}\n{/foreach}\n{/if}\n\n{if $billingName}\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n{elseif $email}\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$email}\n{/if} {* End billingName or Email*}\n{if $credit_card_type}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n\n{if $selectPremium }\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$product_name}\n{if $option}\n{ts}Option{/ts}: {$option}\n{/if}\n{if $sku}\n{ts}SKU{/ts}: {$sku}\n{/if}\n{if $start_date}\n{ts}Start Date{/ts}: {$start_date|crmDate}\n{/if}\n{if $end_date}\n{ts}End Date{/ts}: {$end_date|crmDate}\n{/if}\n{if $contact_email OR $contact_phone}\n\n{ts}For information about this premium, contact:{/ts}\n\n{if $contact_email}\n {$contact_email}\n{/if}\n{if $contact_phone}\n {$contact_phone}\n{/if}\n{/if}\n{if $is_deductible AND $price}\n\n{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if}\n{/if}\n\n{if $customPre}\n===========================================================\n{$customPre_grouptitle}\n\n===========================================================\n{foreach from=$customPre item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n\n\n{if $customPost}\n===========================================================\n{$customPost_grouptitle}\n\n===========================================================\n{foreach from=$customPost item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $receipt_text}\n

{$receipt_text|htmlize}

\n {/if}\n\n {if $is_pay_later}\n

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *}\n {/if}\n\n
\n \n\n {if $amount}\n\n\n \n \n \n\n {if $lineItem and $priceSetID and !$is_quick_config}\n\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n {if $dataArray}\n \n \n \n \n\n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n\n {/if}\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n \n \n \n \n\n {else}\n\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n \n \n \n \n\n {/if}\n\n {/if}\n\n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $is_monetary and $trxn_id}\n \n \n \n \n {/if}\n\n {if $is_recur}\n \n \n \n {if $updateSubscriptionBillingUrl}\n \n \n \n {/if}\n {if $updateSubscriptionUrl}\n \n \n \n {/if}\n {/if}\n\n {if $honor_block_is_active}\n \n \n \n {foreach from=$honoreeProfile item=value key=label}\n \n \n \n \n {/foreach}\n {elseif $softCreditTypes and $softCredits}\n {foreach from=$softCreditTypes item=softCreditType key=n}\n \n \n \n {foreach from=$softCredits.$n item=value key=label}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n {if $pcpBlock}\n \n \n \n \n \n \n \n {if $pcp_roll_nickname}\n \n \n \n \n {/if}\n {if $pcp_personal_note}\n \n \n \n \n {/if}\n {/if}\n\n {if $onBehalfProfile}\n \n \n \n {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n \n \n \n \n {/foreach}\n {/if}\n\n {if $isShare}\n \n \n \n {/if}\n\n {if $billingName}\n \n \n \n \n \n \n {elseif $email}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n {/if}\n\n {if $selectPremium}\n \n \n \n \n \n \n {if $option}\n \n \n \n \n {/if}\n {if $sku}\n \n \n \n \n {/if}\n {if $start_date}\n \n \n \n \n {/if}\n {if $end_date}\n \n \n \n \n {/if}\n {if $contact_email OR $contact_phone}\n \n \n \n {/if}\n {if $is_deductible AND $price}\n \n \n \n {/if}\n {/if}\n\n {if $customPre}\n \n \n \n {foreach from=$customPre item=customValue key=customName}\n {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $customPost}\n \n \n \n {foreach from=$customPost item=customValue key=customName}\n {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n
\n {ts}Contribution Information{/ts}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n {if $dataArray}\n \n \n \n {/if}\n \n \n {foreach from=$value item=line}\n \n \n \n \n {if $getTaxDetails}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n {/if}\n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Subtotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.qty}\n \n {$line.unit_price|crmMoney:$currency}\n \n {$line.unit_price*$line.qty|crmMoney:$currency}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney:$currency}\n \n {$line.line_total+$line.tax_amount|crmMoney:$currency}\n
\n
\n {ts} Amount before Tax : {/ts}\n \n {$amount-$totalTaxAmount|crmMoney:$currency}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {ts}Total Tax{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Total Amount{/ts}\n \n {$amount|crmMoney:$currency}\n
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Amount{/ts}\n \n {$amount|crmMoney:$currency} {if $amount_level} - {$amount_level}{/if}\n
\n {ts}Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}This is a recurring contribution.{/ts}\n {if $cancelSubscriptionUrl}\n {ts 1=$cancelSubscriptionUrl}You can cancel future contributions by visiting this web page.{/ts}\n {/if}\n
\n {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by visiting this web page.{/ts}\n
\n {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page.{/ts}\n
\n {$soft_credit_type}\n
\n {$label}\n \n {$value}\n
\n {$softCreditType}\n
\n {$label}\n \n {$value}\n
\n {ts}Personal Campaign Page{/ts}\n
\n {ts}Display In Honor Roll{/ts}\n \n {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n
\n {ts}Nickname{/ts}\n \n {$pcp_roll_nickname}\n
\n {ts}Personal Note{/ts}\n \n {$pcp_personal_note}\n
\n {$onBehalfProfile_grouptitle}\n
\n {$onBehalfName}\n \n {$onBehalfValue}\n
\n {capture assign=contributionUrl}{crmURL p=\'civicrm/contribute/transact\' q=\"reset=1&id=`$contributionPageId`\" a=true fe=1 h=1}{/capture}\n {include file=\"CRM/common/SocialNetwork.tpl\" emailMode=true url=$contributionUrl title=$title pageURL=$contributionUrl}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}
\n {$email}\n
\n {ts}Registered Email{/ts}\n
\n {$email}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}
\n
\n {ts}Premium Information{/ts}\n
\n {$product_name}\n
\n {ts}Option{/ts}\n \n {$option}\n
\n {ts}SKU{/ts}\n \n {$sku}\n
\n {ts}Start Date{/ts}\n \n {$start_date|crmDate}\n
\n {ts}End Date{/ts}\n \n {$end_date|crmDate}\n
\n

{ts}For information about this premium, contact:{/ts}

\n {if $contact_email}\n

{$contact_email}

\n {/if}\n {if $contact_phone}\n

{$contact_phone}

\n {/if}\n
\n

{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

\n
\n {$customPre_grouptitle}\n
\n {$customName}\n \n {$customValue}\n
\n {$customPost_grouptitle}\n
\n {$customName}\n \n {$customValue}\n
\n
\n\n\n\n',1,823,'contribution_online_receipt',0,1,0,NULL),(9,'Contributions - Invoice','{if $title}\n {if $component}\n {if $component == \'event\'}\n {ts 1=$title}Event Registration Invoice: %1{/ts}\n {else}\n {ts 1=$title}Contribution Invoice: %1{/ts}\n {/if}\n {/if}\n{else}\n {ts}Invoice{/ts}\n{/if}\n - {contact.display_name}\n','{ts}Contribution Invoice{/ts}\n','\n\n \n \n \n \n \n
\n {if $config->empoweredBy}\n \n \n \n \n
\n {/if}\n \n \n \n \n \n \n \n {if $organization_name}\n \n {else}\n \n {/if}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{ts}INVOICE{/ts}{ts}Invoice Date:{/ts}{$domain_organization}
{$display_name} ({$organization_name}){$display_name}{$invoice_date}\n \n {if $domain_street_address }{$domain_street_address}{/if}\n {if $domain_supplemental_address_1 }{$domain_supplemental_address_1}{/if}\n \n
{$street_address} {$supplemental_address_1}{ts}Invoice Number:{/ts}\n \n {if $domain_supplemental_address_2 }{$domain_supplemental_address_2}{/if}\n {if $domain_state }{$domain_state}{/if}\n \n
{$supplemental_address_2} {$stateProvinceAbbreviation}{$invoice_number}\n \n {if $domain_city}{$domain_city}{/if}\n {if $domain_postal_code }{$domain_postal_code}{/if}\n \n
{$city} {$postal_code}{ts}Reference:{/ts}{if $domain_country}{$domain_country}{/if}
{$country}{$source}{if $domain_email}{$domain_email}{/if}
{if $domain_phone}{$domain_phone}{/if}
\n\n \n \n \n \n \n \n \n \n {foreach from=$lineItem item=value key=priceset name=taxpricevalue}\n {if $smarty.foreach.taxpricevalue.index eq 0}\n {else}\n {/if}\n \n \n \n \n {if $value.tax_amount != \'\'}\n \n {else}\n \n {/if}\n \n \n {/foreach}\n \n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n \n {if $priceset}\n \n \n {elseif $priceset == 0}\n \n \n \n {/if}\n {/foreach}\n \n \n \n \n \n {if $amountDue != 0}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/if}\n


\n \n \n \n {if $contribution_status_id == $pendingStatusId && $is_pay_later == 1}\n \n \n \n \n {/if}\n
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{$taxTerm}{ts 1=$defaultCurrency}Amount %1{/ts}
\n {if $value.html_type eq \'Text\'}\n {$value.label}\n {else}\n {$value.field_title} - {$value.label}\n {/if}\n {if $value.description}\n
{$value.description|truncate:30:\"...\"}
\n {/if}\n
\n
{$value.qty}{$value.unit_price|crmMoney:$currency}{$value.tax_rate}%{ts 1=$taxTerm}-{/ts}{$value.subTotal|crmMoney:$currency}
{ts}Sub Total{/ts}{$subTotal|crmMoney:$currency}
{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{$value|crmMoney:$currency} {ts 1=$taxTerm}TOTAL %1{/ts}{$value|crmMoney:$currency}
{ts 1=$defaultCurrency}TOTAL %1{/ts}{$amount|crmMoney:$currency}
\n {if $contribution_status_id == $refundedStatusId}\n {ts}Amount Credited{/ts}\n {else}\n {ts}Amount Paid{/ts}\n {/if}\n \n {$amountPaid|crmMoney:$currency}

{ts}AMOUNT DUE:{/ts}{$amountDue|crmMoney:$currency}
{ts 1=$dueDate}DUE DATE: %1{/ts}
\n \n \n \n\n {if $contribution_status_id == $pendingStatusId && $is_pay_later == 1}\n \n \n \n \n
\n\n \n \n \n \n \n
{ts}PAYMENT ADVICE{/ts}

{ts}To:{/ts}
\n {$domain_organization}
\n {$domain_street_address} {$domain_supplemental_address_1}
\n {$domain_supplemental_address_2} {$domain_state}
\n {$domain_city} {$domain_postal_code}
\n {$domain_country}
\n {$domain_email}
\n {$domain_phone}
\n


{$notes}\n
\n \n \n \n \n \n \n \n \n \n \n {if $is_pay_later == 1}\n \n \n \n \n {else}\n \n \n \n \n {/if}\n \n \n \n \n \n \n \n
{ts}Customer:{/ts}{$display_name}
{ts}Invoice Number:{/ts}{$invoice_number}

{ts}Amount Due:{/ts}{$amount|crmMoney:$currency}
{ts}Amount Due:{/ts}{$amountDue|crmMoney:$currency}
{ts}Due Date:{/ts}{$dueDate}

\n {/if}\n\n {if $contribution_status_id == $refundedStatusId || $contribution_status_id == $cancelledStatusId}\n {if $config->empoweredBy}\n \n \n \n \n
\n {/if}\n\n
\n \n \n \n \n \n \n \n {if $organization_name}\n \n {else}\n \n {/if}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{ts}CREDIT NOTE{/ts}{ts}Date:{/ts}{$domain_organization}
{$display_name} ({$organization_name}){$display_name}{$invoice_date}\n \n {if $domain_street_address }{$domain_street_address}{/if}\n {if $domain_supplemental_address_1 }{$domain_supplemental_address_1}{/if}\n \n
{$street_address} {$supplemental_address_1}{ts}Credit Note Number:{/ts}\n \n {if $domain_supplemental_address_2 }{$domain_supplemental_address_2}{/if}\n {if $domain_state }{$domain_state}{/if}\n \n
{$supplemental_address_2} {$stateProvinceAbbreviation}{$creditnote_id}\n \n {if $domain_city}{$domain_city}{/if}\n {if $domain_postal_code }{$domain_postal_code}{/if}\n \n
{$city} {$postal_code}{ts}Reference:{/ts}\n \n {if $domain_country}{$domain_country}{/if}\n \n
{$source}\n \n {if $domain_email}{$domain_email}{/if}\n \n
\n \n {if $domain_phone}{$domain_phone}{/if}\n \n
\n\n \n \n \n \n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n \n \n \n {foreach from=$lineItem item=value key=priceset name=pricevalue}\n {if $smarty.foreach.pricevalue.index eq 0}\n \n {else}\n \n {/if}\n \n \n \n \n {if $value.tax_amount != \'\'}\n \n {else}\n \n {/if}\n \n \n {/foreach}\n \n \n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n \n {if $priceset}\n \n \n {elseif $priceset == 0}\n \n \n \n {/if}\n {/foreach}\n \n \n \n \n \n \n \n \n \n {if $is_pay_later == 0}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/if}\n


\n \n \n \n \n \n \n \n
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{$taxTerm}{ts 1=$defaultCurrency}Amount %1{/ts}


\n \n {if $value.html_type eq \'Text\'}\n {$value.label}\n {else}\n {$value.field_title} - {$value.label}\n {/if}\n {if $value.description}\n
{$value.description|truncate:30:\"...\"}
\n {/if}\n
\n
{$value.qty}{$value.unit_price|crmMoney:$currency}{$value.tax_rate}%{ts 1=$taxTerm}No %1{/ts}{$value.subTotal|crmMoney:$currency}

{ts}Sub Total{/ts}{$subTotal|crmMoney:$currency}
{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{$value|crmMoney:$currency} {ts 1=$taxTerm}TOTAL NO %1{/ts}{$value|crmMoney:$currency}

{ts 1=$defaultCurrency}TOTAL %1{/ts}{$amount|crmMoney:$currency}
{ts}LESS Credit to invoice(s){/ts}{$amount|crmMoney:$currency}

{ts}REMAINING CREDIT{/ts}{$amountDue|crmMoney:$currency}
\n
\n\n \n \n \n \n
\n\n \n \n \n \n \n
{ts}CREDIT ADVICE{/ts}

{ts}Please do not pay on this advice. Deduct the amount of this Credit Note from your next payment to us{/ts}

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{ts}Customer:{/ts}{$display_name}
{ts}Credit Note#:{/ts}{$creditnote_id}

{ts}Credit Amount:{/ts}{$amount|crmMoney:$currency}
\n
\n {/if}\n
\n\n \n \n\n',1,824,'contribution_invoice_receipt',1,0,0,NULL),(10,'Contributions - Invoice','{if $title}\n {if $component}\n {if $component == \'event\'}\n {ts 1=$title}Event Registration Invoice: %1{/ts}\n {else}\n {ts 1=$title}Contribution Invoice: %1{/ts}\n {/if}\n {/if}\n{else}\n {ts}Invoice{/ts}\n{/if}\n - {contact.display_name}\n','{ts}Contribution Invoice{/ts}\n','\n\n \n \n \n \n \n
\n {if $config->empoweredBy}\n \n \n \n \n
\n {/if}\n \n \n \n \n \n \n \n {if $organization_name}\n \n {else}\n \n {/if}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{ts}INVOICE{/ts}{ts}Invoice Date:{/ts}{$domain_organization}
{$display_name} ({$organization_name}){$display_name}{$invoice_date}\n \n {if $domain_street_address }{$domain_street_address}{/if}\n {if $domain_supplemental_address_1 }{$domain_supplemental_address_1}{/if}\n \n
{$street_address} {$supplemental_address_1}{ts}Invoice Number:{/ts}\n \n {if $domain_supplemental_address_2 }{$domain_supplemental_address_2}{/if}\n {if $domain_state }{$domain_state}{/if}\n \n
{$supplemental_address_2} {$stateProvinceAbbreviation}{$invoice_number}\n \n {if $domain_city}{$domain_city}{/if}\n {if $domain_postal_code }{$domain_postal_code}{/if}\n \n
{$city} {$postal_code}{ts}Reference:{/ts}{if $domain_country}{$domain_country}{/if}
{$country}{$source}{if $domain_email}{$domain_email}{/if}
{if $domain_phone}{$domain_phone}{/if}
\n\n \n \n \n \n \n \n \n \n {foreach from=$lineItem item=value key=priceset name=taxpricevalue}\n {if $smarty.foreach.taxpricevalue.index eq 0}\n {else}\n {/if}\n \n \n \n \n {if $value.tax_amount != \'\'}\n \n {else}\n \n {/if}\n \n \n {/foreach}\n \n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n \n {if $priceset}\n \n \n {elseif $priceset == 0}\n \n \n \n {/if}\n {/foreach}\n \n \n \n \n \n {if $amountDue != 0}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/if}\n


\n \n \n \n {if $contribution_status_id == $pendingStatusId && $is_pay_later == 1}\n \n \n \n \n {/if}\n
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{$taxTerm}{ts 1=$defaultCurrency}Amount %1{/ts}
\n {if $value.html_type eq \'Text\'}\n {$value.label}\n {else}\n {$value.field_title} - {$value.label}\n {/if}\n {if $value.description}\n
{$value.description|truncate:30:\"...\"}
\n {/if}\n
\n
{$value.qty}{$value.unit_price|crmMoney:$currency}{$value.tax_rate}%{ts 1=$taxTerm}-{/ts}{$value.subTotal|crmMoney:$currency}
{ts}Sub Total{/ts}{$subTotal|crmMoney:$currency}
{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{$value|crmMoney:$currency} {ts 1=$taxTerm}TOTAL %1{/ts}{$value|crmMoney:$currency}
{ts 1=$defaultCurrency}TOTAL %1{/ts}{$amount|crmMoney:$currency}
\n {if $contribution_status_id == $refundedStatusId}\n {ts}Amount Credited{/ts}\n {else}\n {ts}Amount Paid{/ts}\n {/if}\n \n {$amountPaid|crmMoney:$currency}

{ts}AMOUNT DUE:{/ts}{$amountDue|crmMoney:$currency}
{ts 1=$dueDate}DUE DATE: %1{/ts}
\n
\n\n {if $contribution_status_id == $pendingStatusId && $is_pay_later == 1}\n \n \n \n \n
\n\n \n \n \n {else} - + {/if} {if $values.attachment} diff --git a/templates/CRM/Admin/Form/MailSettings.tpl b/templates/CRM/Admin/Form/MailSettings.tpl index 361ffe09e187..d003ef89f9ba 100644 --- a/templates/CRM/Admin/Form/MailSettings.tpl +++ b/templates/CRM/Admin/Form/MailSettings.tpl @@ -9,62 +9,73 @@ *} {* this template is used for adding/editing email settings. *}
-
{include file="CRM/common/formButtons.tpl" location="top"}
-{if $action eq 8} -
+
{include file="CRM/common/formButtons.tpl" location="top"}
+ {if $action eq 8} +
{icon icon="fa-info-circle"}{/icon} - {ts}WARNING: Deleting this option will result in the loss of mail settings data.{/ts} {ts}Do you want to continue?{/ts} -
+ {ts}WARNING: Deleting this option will result in the loss of mail settings data.{/ts} {ts}Do you want to continue?{/ts} +
{include file="CRM/common/formButtons.tpl" location="top"}
-{else} + {else}
{ts}PAYMENT ADVICE{/ts}

{ts}To:{/ts}
\n {$domain_organization}
\n {$domain_street_address} {$domain_supplemental_address_1}
\n {$domain_supplemental_address_2} {$domain_state}
\n {$domain_city} {$domain_postal_code}
\n {$domain_country}
\n {$domain_email}
\n {$domain_phone}
\n


{$notes}\n
\n \n \n \n \n \n \n \n \n \n \n {if $is_pay_later == 1}\n \n \n \n \n {else}\n \n \n \n \n {/if}\n \n \n \n \n \n \n \n
{ts}Customer:{/ts}{$display_name}
{ts}Invoice Number:{/ts}{$invoice_number}

{ts}Amount Due:{/ts}{$amount|crmMoney:$currency}
{ts}Amount Due:{/ts}{$amountDue|crmMoney:$currency}
{ts}Due Date:{/ts}{$dueDate}

\n {/if}\n\n {if $contribution_status_id == $refundedStatusId || $contribution_status_id == $cancelledStatusId}\n {if $config->empoweredBy}\n \n \n \n \n
\n {/if}\n\n
\n \n \n \n \n \n \n \n {if $organization_name}\n \n {else}\n \n {/if}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{ts}CREDIT NOTE{/ts}{ts}Date:{/ts}{$domain_organization}
{$display_name} ({$organization_name}){$display_name}{$invoice_date}\n \n {if $domain_street_address }{$domain_street_address}{/if}\n {if $domain_supplemental_address_1 }{$domain_supplemental_address_1}{/if}\n \n
{$street_address} {$supplemental_address_1}{ts}Credit Note Number:{/ts}\n \n {if $domain_supplemental_address_2 }{$domain_supplemental_address_2}{/if}\n {if $domain_state }{$domain_state}{/if}\n \n
{$supplemental_address_2} {$stateProvinceAbbreviation}{$creditnote_id}\n \n {if $domain_city}{$domain_city}{/if}\n {if $domain_postal_code }{$domain_postal_code}{/if}\n \n
{$city} {$postal_code}{ts}Reference:{/ts}\n \n {if $domain_country}{$domain_country}{/if}\n \n
{$source}\n \n {if $domain_email}{$domain_email}{/if}\n \n
\n \n {if $domain_phone}{$domain_phone}{/if}\n \n
\n\n \n \n \n \n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n \n \n \n {foreach from=$lineItem item=value key=priceset name=pricevalue}\n {if $smarty.foreach.pricevalue.index eq 0}\n \n {else}\n \n {/if}\n \n \n \n \n {if $value.tax_amount != \'\'}\n \n {else}\n \n {/if}\n \n \n {/foreach}\n \n \n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n \n {if $priceset}\n \n \n {elseif $priceset == 0}\n \n \n \n {/if}\n {/foreach}\n \n \n \n \n \n \n \n \n \n {if $is_pay_later == 0}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/if}\n


\n \n \n \n \n \n \n \n
{ts}Description{/ts}{ts}Quantity{/ts}{ts}Unit Price{/ts}{$taxTerm}{ts 1=$defaultCurrency}Amount %1{/ts}


\n \n {if $value.html_type eq \'Text\'}\n {$value.label}\n {else}\n {$value.field_title} - {$value.label}\n {/if}\n {if $value.description}\n
{$value.description|truncate:30:\"...\"}
\n {/if}\n
\n
{$value.qty}{$value.unit_price|crmMoney:$currency}{$value.tax_rate}%{ts 1=$taxTerm}No %1{/ts}{$value.subTotal|crmMoney:$currency}

{ts}Sub Total{/ts}{$subTotal|crmMoney:$currency}
{ts 1=$taxTerm 2=$priceset}TOTAL %1 %2%{/ts}{$value|crmMoney:$currency} {ts 1=$taxTerm}TOTAL NO %1{/ts}{$value|crmMoney:$currency}

{ts 1=$defaultCurrency}TOTAL %1{/ts}{$amount|crmMoney:$currency}
{ts}LESS Credit to invoice(s){/ts}{$amount|crmMoney:$currency}

{ts}REMAINING CREDIT{/ts}{$amountDue|crmMoney:$currency}
\n
\n\n \n \n \n \n
\n\n \n \n \n \n \n
{ts}CREDIT ADVICE{/ts}

{ts}Please do not pay on this advice. Deduct the amount of this Credit Note from your next payment to us{/ts}

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{ts}Customer:{/ts}{$display_name}
{ts}Credit Note#:{/ts}{$creditnote_id}

{ts}Credit Amount:{/ts}{$amount|crmMoney:$currency}
\n
\n {/if}\n
\n\n \n \n\n',1,824,'contribution_invoice_receipt',0,1,0,NULL),(11,'Contributions - Recurring Start and End Notification','{ts}Recurring Contribution Notification{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{if $recur_txnType eq \'START\'}\n{if $auto_renew_membership}\n{ts}Thanks for your auto renew membership sign-up.{/ts}\n\n\n{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This membership will be automatically renewed every %1 %2(s).{/ts}\n\n{if $cancelSubscriptionUrl}\n{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n\n{/if}\n{else}\n{ts}Thanks for your recurring contribution sign-up.{/ts}\n\n\n{ts 1=$recur_frequency_interval 2=$recur_frequency_unit 3=$recur_installments}This recurring contribution will be automatically processed every %1 %2(s){/ts}{if $recur_installments } {ts 1=$recur_installments} for a total of %1 installment(s){/ts}{/if}.\n\n{ts}Start Date{/ts}: {$recur_start_date|crmDate}\n\n{if $cancelSubscriptionUrl}\n{ts 1=$cancelSubscriptionUrl}You can cancel the recurring contribution option by visiting this web page.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by visiting this web page.{/ts}\n\n{/if}\n\n{if $updateSubscriptionUrl}\n{ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page.{/ts}\n\n{/if}\n{/if}\n\n{elseif $recur_txnType eq \'END\'}\n{if $auto_renew_membership}\n{ts}Your auto renew membership sign-up has ended and your membership will not be automatically renewed.{/ts}\n\n\n{else}\n{ts}Your recurring contribution term has ended.{/ts}\n\n\n{ts 1=$recur_installments}You have successfully completed %1 recurring contributions. Thank you.{/ts}\n\n\n==================================================\n{ts 1=$recur_installments}Interval of Subscription for %1 installment(s){/ts}\n\n==================================================\n{ts}Start Date{/ts}: {$recur_start_date|crmDate}\n\n{ts}End Date{/ts}: {$recur_end_date|crmDate}\n\n{/if}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n\n \n \n \n\n {if $recur_txnType eq \'START\'}\n {if $auto_renew_membership}\n \n \n \n {if $cancelSubscriptionUrl}\n \n \n \n {/if}\n {if $updateSubscriptionBillingUrl}\n \n \n \n {/if}\n {else}\n \n \n \n {if $cancelSubscriptionUrl}\n \n \n \n {/if}\n {if $updateSubscriptionBillingUrl}\n \n \n \n {/if}\n {if $updateSubscriptionUrl}\n \n \n \n {/if}\n {/if}\n\n {elseif $recur_txnType eq \'END\'}\n\n {if $auto_renew_membership}\n \n \n \n {else}\n \n \n \n \n \n \n\n {/if}\n {/if}\n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n
 
\n

{ts}Thanks for your auto renew membership sign-up.{/ts}

\n

{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This membership will be automatically renewed every %1 %2(s). {/ts}

\n
\n {ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page.{/ts}\n
\n {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n
\n

{ts}Thanks for your recurring contribution sign-up.{/ts}

\n

{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This recurring contribution will be automatically processed every %1 %2(s){/ts}{if $recur_installments }{ts 1=$recur_installments} for a total of %1 installment(s){/ts}{/if}.

\n

{ts}Start Date{/ts}: {$recur_start_date|crmDate}

\n
\n {ts 1=$cancelSubscriptionUrl} You can cancel the recurring contribution option by visiting this web page.{/ts}\n
\n {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by visiting this web page.{/ts}\n
\n {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments details for this recurring contribution by visiting this web page.{/ts}\n
\n

{ts}Your auto renew membership sign-up has ended and your membership will not be automatically renewed.{/ts}

\n
\n

{ts}Your recurring contribution term has ended.{/ts}

\n

{ts 1=$recur_installments}You have successfully completed %1 recurring contributions. Thank you.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts 1=$recur_installments}Interval of Subscription for %1 installment(s){/ts}\n
\n {ts}Start Date{/ts}\n \n {$recur_start_date|crmDate}\n
\n {ts}End Date{/ts}\n \n {$recur_end_date|crmDate}\n
\n
\n
\n\n\n\n',1,825,'contribution_recurring_notify',1,0,0,NULL),(12,'Contributions - Recurring Start and End Notification','{ts}Recurring Contribution Notification{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{if $recur_txnType eq \'START\'}\n{if $auto_renew_membership}\n{ts}Thanks for your auto renew membership sign-up.{/ts}\n\n\n{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This membership will be automatically renewed every %1 %2(s).{/ts}\n\n{if $cancelSubscriptionUrl}\n{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n\n{/if}\n{else}\n{ts}Thanks for your recurring contribution sign-up.{/ts}\n\n\n{ts 1=$recur_frequency_interval 2=$recur_frequency_unit 3=$recur_installments}This recurring contribution will be automatically processed every %1 %2(s){/ts}{if $recur_installments } {ts 1=$recur_installments} for a total of %1 installment(s){/ts}{/if}.\n\n{ts}Start Date{/ts}: {$recur_start_date|crmDate}\n\n{if $cancelSubscriptionUrl}\n{ts 1=$cancelSubscriptionUrl}You can cancel the recurring contribution option by visiting this web page.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by visiting this web page.{/ts}\n\n{/if}\n\n{if $updateSubscriptionUrl}\n{ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page.{/ts}\n\n{/if}\n{/if}\n\n{elseif $recur_txnType eq \'END\'}\n{if $auto_renew_membership}\n{ts}Your auto renew membership sign-up has ended and your membership will not be automatically renewed.{/ts}\n\n\n{else}\n{ts}Your recurring contribution term has ended.{/ts}\n\n\n{ts 1=$recur_installments}You have successfully completed %1 recurring contributions. Thank you.{/ts}\n\n\n==================================================\n{ts 1=$recur_installments}Interval of Subscription for %1 installment(s){/ts}\n\n==================================================\n{ts}Start Date{/ts}: {$recur_start_date|crmDate}\n\n{ts}End Date{/ts}: {$recur_end_date|crmDate}\n\n{/if}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n\n \n \n \n\n {if $recur_txnType eq \'START\'}\n {if $auto_renew_membership}\n \n \n \n {if $cancelSubscriptionUrl}\n \n \n \n {/if}\n {if $updateSubscriptionBillingUrl}\n \n \n \n {/if}\n {else}\n \n \n \n {if $cancelSubscriptionUrl}\n \n \n \n {/if}\n {if $updateSubscriptionBillingUrl}\n \n \n \n {/if}\n {if $updateSubscriptionUrl}\n \n \n \n {/if}\n {/if}\n\n {elseif $recur_txnType eq \'END\'}\n\n {if $auto_renew_membership}\n \n \n \n {else}\n \n \n \n \n \n \n\n {/if}\n {/if}\n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n
 
\n

{ts}Thanks for your auto renew membership sign-up.{/ts}

\n

{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This membership will be automatically renewed every %1 %2(s). {/ts}

\n
\n {ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page.{/ts}\n
\n {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n
\n

{ts}Thanks for your recurring contribution sign-up.{/ts}

\n

{ts 1=$recur_frequency_interval 2=$recur_frequency_unit}This recurring contribution will be automatically processed every %1 %2(s){/ts}{if $recur_installments }{ts 1=$recur_installments} for a total of %1 installment(s){/ts}{/if}.

\n

{ts}Start Date{/ts}: {$recur_start_date|crmDate}

\n
\n {ts 1=$cancelSubscriptionUrl} You can cancel the recurring contribution option by visiting this web page.{/ts}\n
\n {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by visiting this web page.{/ts}\n
\n {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments details for this recurring contribution by visiting this web page.{/ts}\n
\n

{ts}Your auto renew membership sign-up has ended and your membership will not be automatically renewed.{/ts}

\n
\n

{ts}Your recurring contribution term has ended.{/ts}

\n

{ts 1=$recur_installments}You have successfully completed %1 recurring contributions. Thank you.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts 1=$recur_installments}Interval of Subscription for %1 installment(s){/ts}\n
\n {ts}Start Date{/ts}\n \n {$recur_start_date|crmDate}\n
\n {ts}End Date{/ts}\n \n {$recur_end_date|crmDate}\n
\n
\n
\n\n\n\n',1,825,'contribution_recurring_notify',0,1,0,NULL),(13,'Contributions - Recurring Cancellation Notification','{ts}Recurring Contribution Cancellation Notification{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Your recurring contribution of %1, every %2 %3 has been cancelled as requested.{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Your recurring contribution of %1, every %2 %3 has been cancelled as requested.{/ts}

\n
\n
\n\n\n\n',1,826,'contribution_recurring_cancelled',1,0,0,NULL),(14,'Contributions - Recurring Cancellation Notification','{ts}Recurring Contribution Cancellation Notification{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Your recurring contribution of %1, every %2 %3 has been cancelled as requested.{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Your recurring contribution of %1, every %2 %3 has been cancelled as requested.{/ts}

\n
\n
\n\n\n\n',1,826,'contribution_recurring_cancelled',0,1,0,NULL),(15,'Contributions - Recurring Billing Updates','{ts}Recurring Contribution Billing Updates{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Billing details for your recurring contribution of %1, every %2 %3 have been updated.{/ts}\n\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n\n\n{ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Billing details for your recurring contribution of %1, every %2 %3 have been updated.{/ts}

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}
\n {$email}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}
\n
\n {ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}\n
\n
\n\n\n\n',1,827,'contribution_recurring_billing',1,0,0,NULL),(16,'Contributions - Recurring Billing Updates','{ts}Recurring Contribution Billing Updates{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Billing details for your recurring contribution of %1, every %2 %3 have been updated.{/ts}\n\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n\n\n{ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Billing details for your recurring contribution of %1, every %2 %3 have been updated.{/ts}

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}
\n {$email}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}
\n
\n {ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}\n
\n
\n\n\n\n',1,827,'contribution_recurring_billing',0,1,0,NULL),(17,'Contributions - Recurring Updates','{ts}Recurring Contribution Update Notification{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts}Your recurring contribution has been updated as requested:{/ts}\n\n{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Recurring contribution is for %1, every %2 %3(s){/ts}\n{if $installments}{ts 1=$installments} for %1 installments.{/ts}{/if}\n\n{ts 1=$receipt_from_email}If you have questions please contact us at %1.{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}Your recurring contribution has been updated as requested:{/ts}\n

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Recurring contribution is for %1, every %2 %3(s){/ts}{if $installments}{ts 1=$installments} for %1 installments{/ts}{/if}.

\n\n

{ts 1=$receipt_from_email}If you have questions please contact us at %1.{/ts}

\n
\n
\n\n\n\n',1,828,'contribution_recurring_edit',1,0,0,NULL),(18,'Contributions - Recurring Updates','{ts}Recurring Contribution Update Notification{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts}Your recurring contribution has been updated as requested:{/ts}\n\n{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Recurring contribution is for %1, every %2 %3(s){/ts}\n{if $installments}{ts 1=$installments} for %1 installments.{/ts}{/if}\n\n{ts 1=$receipt_from_email}If you have questions please contact us at %1.{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}Your recurring contribution has been updated as requested:{/ts}\n

{ts 1=$amount 2=$recur_frequency_interval 3=$recur_frequency_unit}Recurring contribution is for %1, every %2 %3(s){/ts}{if $installments}{ts 1=$installments} for %1 installments{/ts}{/if}.

\n\n

{ts 1=$receipt_from_email}If you have questions please contact us at %1.{/ts}

\n
\n
\n\n\n\n',1,828,'contribution_recurring_edit',0,1,0,NULL),(19,'Personal Campaign Pages - Admin Notification','{ts}Personal Campaign Page Notification{/ts} - {contact.display_name}\n','===========================================================\n{ts}Personal Campaign Page Notification{/ts}\n\n===========================================================\n{ts}Action{/ts}: {if $mode EQ \'Update\'}{ts}Updated personal campaign page{/ts}{else}{ts}New personal campaign page{/ts}{/if}\n{ts}Personal Campaign Page Title{/ts}: {$pcpTitle}\n{ts}Current Status{/ts}: {$pcpStatus}\n{capture assign=pcpURL}{crmURL p=\"civicrm/pcp/info\" q=\"reset=1&id=`$pcpId`\" h=0 a=1}{/capture}\n{ts}View Page{/ts}:\n>> {$pcpURL}\n\n{ts}Supporter{/ts}: {$supporterName}\n>> {$supporterUrl}\n\n{ts}Linked to Contribution Page{/ts}: {$contribPageTitle}\n>> {$contribPageUrl}\n\n{ts}Manage Personal Campaign Pages{/ts}:\n>> {$managePCPUrl}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n{capture assign=pcpURL }{crmURL p=\"civicrm/pcp/info\" q=\"reset=1&id=`$pcpId`\" h=0 a=1}{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n
\n {ts}Personal Campaign Page Notification{/ts}\n
\n {ts}Action{/ts}:\n \n {if $mode EQ \'Update\'}\n {ts}Updated personal campaign page{/ts}\n {else}\n {ts}New personal campaign page{/ts}\n {/if}\n
\n {ts}Personal Campaign Page Title{/ts}\n \n {$pcpTitle}\n
\n {ts}Current Status{/ts}\n \n {$pcpStatus}\n
\n {ts}View Page{/ts}\n
\n {ts}Supporter{/ts}\n \n {$supporterName}\n
\n {ts}Linked to Contribution Page{/ts}\n \n {$contribPageTitle}\n
\n {ts}Manage Personal Campaign Pages{/ts}\n
\n
\n
\n\n\n\n',1,829,'pcp_notify',1,0,0,NULL),(20,'Personal Campaign Pages - Admin Notification','{ts}Personal Campaign Page Notification{/ts} - {contact.display_name}\n','===========================================================\n{ts}Personal Campaign Page Notification{/ts}\n\n===========================================================\n{ts}Action{/ts}: {if $mode EQ \'Update\'}{ts}Updated personal campaign page{/ts}{else}{ts}New personal campaign page{/ts}{/if}\n{ts}Personal Campaign Page Title{/ts}: {$pcpTitle}\n{ts}Current Status{/ts}: {$pcpStatus}\n{capture assign=pcpURL}{crmURL p=\"civicrm/pcp/info\" q=\"reset=1&id=`$pcpId`\" h=0 a=1}{/capture}\n{ts}View Page{/ts}:\n>> {$pcpURL}\n\n{ts}Supporter{/ts}: {$supporterName}\n>> {$supporterUrl}\n\n{ts}Linked to Contribution Page{/ts}: {$contribPageTitle}\n>> {$contribPageUrl}\n\n{ts}Manage Personal Campaign Pages{/ts}:\n>> {$managePCPUrl}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n{capture assign=pcpURL }{crmURL p=\"civicrm/pcp/info\" q=\"reset=1&id=`$pcpId`\" h=0 a=1}{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n
\n {ts}Personal Campaign Page Notification{/ts}\n
\n {ts}Action{/ts}:\n \n {if $mode EQ \'Update\'}\n {ts}Updated personal campaign page{/ts}\n {else}\n {ts}New personal campaign page{/ts}\n {/if}\n
\n {ts}Personal Campaign Page Title{/ts}\n \n {$pcpTitle}\n
\n {ts}Current Status{/ts}\n \n {$pcpStatus}\n
\n {ts}View Page{/ts}\n
\n {ts}Supporter{/ts}\n \n {$supporterName}\n
\n {ts}Linked to Contribution Page{/ts}\n \n {$contribPageTitle}\n
\n {ts}Manage Personal Campaign Pages{/ts}\n
\n
\n
\n\n\n\n',1,829,'pcp_notify',0,1,0,NULL),(21,'Personal Campaign Pages - Supporter Status Change Notification','{ts 1=$contribPageTitle}Your Personal Campaign Page for %1{/ts} - {contact.display_name}\n','{if $pcpStatus eq \'Approved\'}\n============================\n{ts}Your Personal Campaign Page{/ts}\n\n============================\n\n{ts}Your personal campaign page has been approved and is now live.{/ts}\n\n{ts}Whenever you want to preview, update or promote your page{/ts}:\n1. {ts}Login to your account at{/ts}:\n{$loginUrl}\n\n2. {ts}Click or paste this link into your browser to go to your page{/ts}:\n{$pcpInfoURL}\n\n{ts}When you view your campaign page WHILE LOGGED IN, the page includes links to edit your page, tell friends, and update your contact info.{/ts}\n\n{if $isTellFriendEnabled}\n\n{ts}After logging in, you can use this form to promote your fundraising page{/ts}:\n{$pcpTellFriendURL}\n\n{/if}\n\n{if $pcpNotifyEmailAddress}\n{ts}Questions? Send email to{/ts}:\n{$pcpNotifyEmailAddress}\n{/if}\n\n{* Rejected message *}\n{elseif $pcpStatus eq \'Not Approved\'}\n============================\n{ts}Your Personal Campaign Page{/ts}\n\n============================\n\n{ts}Your personal campaign page has been reviewed. There were some issues with the content which prevented us from approving the page. We are sorry for any inconvenience.{/ts}\n\n{if $pcpNotifyEmailAddress}\n\n{ts}Please contact our site administrator for more information{/ts}:\n{$pcpNotifyEmailAddress}\n{/if}\n\n{/if}\n','\n\n\n \n \n\n\n\n
\n \n\n \n \n \n\n \n\n \n \n \n\n
\n\n

{ts}Your Personal Campaign Page{/ts}

\n\n {if $pcpStatus eq \'Approved\'}\n\n

{ts}Your personal campaign page has been approved and is now live.{/ts}

\n

{ts}Whenever you want to preview, update or promote your page{/ts}:

\n
    \n
  1. {ts}Login to your account{/ts}
  2. \n
  3. {ts}Go to your page{/ts}
  4. \n
\n

{ts}When you view your campaign page WHILE LOGGED IN, the page includes links to edit your page, tell friends, and update your contact info.{/ts}

\n\n {if $isTellFriendEnabled}\n

{ts}After logging in, you can use this form to promote your fundraising page{/ts}

\n {/if}\n\n {if $pcpNotifyEmailAddress}\n

{ts}Questions? Send email to{/ts}: {$pcpNotifyEmailAddress}

\n {/if}\n\n {elseif $pcpStatus eq \'Not Approved\'}\n\n

{ts}Your personal campaign page has been reviewed. There were some issues with the content which prevented us from approving the page. We are sorry for any inconvenience.{/ts}

\n {if $pcpNotifyEmailAddress}\n

{ts}Please contact our site administrator for more information{/ts}: {$pcpNotifyEmailAddress}

\n {/if}\n\n {/if}\n\n
\n
\n\n\n\n',1,830,'pcp_status_change',1,0,0,NULL),(22,'Personal Campaign Pages - Supporter Status Change Notification','{ts 1=$contribPageTitle}Your Personal Campaign Page for %1{/ts} - {contact.display_name}\n','{if $pcpStatus eq \'Approved\'}\n============================\n{ts}Your Personal Campaign Page{/ts}\n\n============================\n\n{ts}Your personal campaign page has been approved and is now live.{/ts}\n\n{ts}Whenever you want to preview, update or promote your page{/ts}:\n1. {ts}Login to your account at{/ts}:\n{$loginUrl}\n\n2. {ts}Click or paste this link into your browser to go to your page{/ts}:\n{$pcpInfoURL}\n\n{ts}When you view your campaign page WHILE LOGGED IN, the page includes links to edit your page, tell friends, and update your contact info.{/ts}\n\n{if $isTellFriendEnabled}\n\n{ts}After logging in, you can use this form to promote your fundraising page{/ts}:\n{$pcpTellFriendURL}\n\n{/if}\n\n{if $pcpNotifyEmailAddress}\n{ts}Questions? Send email to{/ts}:\n{$pcpNotifyEmailAddress}\n{/if}\n\n{* Rejected message *}\n{elseif $pcpStatus eq \'Not Approved\'}\n============================\n{ts}Your Personal Campaign Page{/ts}\n\n============================\n\n{ts}Your personal campaign page has been reviewed. There were some issues with the content which prevented us from approving the page. We are sorry for any inconvenience.{/ts}\n\n{if $pcpNotifyEmailAddress}\n\n{ts}Please contact our site administrator for more information{/ts}:\n{$pcpNotifyEmailAddress}\n{/if}\n\n{/if}\n','\n\n\n \n \n\n\n\n
\n \n\n \n \n \n\n \n\n \n \n \n\n
\n\n

{ts}Your Personal Campaign Page{/ts}

\n\n {if $pcpStatus eq \'Approved\'}\n\n

{ts}Your personal campaign page has been approved and is now live.{/ts}

\n

{ts}Whenever you want to preview, update or promote your page{/ts}:

\n
    \n
  1. {ts}Login to your account{/ts}
  2. \n
  3. {ts}Go to your page{/ts}
  4. \n
\n

{ts}When you view your campaign page WHILE LOGGED IN, the page includes links to edit your page, tell friends, and update your contact info.{/ts}

\n\n {if $isTellFriendEnabled}\n

{ts}After logging in, you can use this form to promote your fundraising page{/ts}

\n {/if}\n\n {if $pcpNotifyEmailAddress}\n

{ts}Questions? Send email to{/ts}: {$pcpNotifyEmailAddress}

\n {/if}\n\n {elseif $pcpStatus eq \'Not Approved\'}\n\n

{ts}Your personal campaign page has been reviewed. There were some issues with the content which prevented us from approving the page. We are sorry for any inconvenience.{/ts}

\n {if $pcpNotifyEmailAddress}\n

{ts}Please contact our site administrator for more information{/ts}: {$pcpNotifyEmailAddress}

\n {/if}\n\n {/if}\n\n
\n
\n\n\n\n',1,830,'pcp_status_change',0,1,0,NULL),(23,'Personal Campaign Pages - Supporter Welcome','{ts 1=$contribPageTitle}Your Personal Campaign Page for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=\"$contribPageTitle\"}Thanks for creating a personal campaign page in support of %1.{/ts}\n\n{if $pcpStatus eq \'Approved\'}\n====================\n{ts}Promoting Your Page{/ts}\n\n====================\n{if $isTellFriendEnabled}\n\n{ts}You can begin your fundraising efforts using our \"Tell a Friend\" form{/ts}:\n\n1. {ts}Login to your account at{/ts}:\n{$loginUrl}\n\n2. {ts}Click or paste this link into your browser and follow the prompts{/ts}:\n{$pcpTellFriendURL}\n{else}\n\n{ts}Send email to family, friends and colleagues with a personal message about this campaign.{/ts}\n{ts}Include this link to your fundraising page in your emails{/ts}:\n{$pcpInfoURL}\n{/if}\n\n===================\n{ts}Managing Your Page{/ts}\n\n===================\n{ts}Whenever you want to preview, update or promote your page{/ts}:\n1. {ts}Login to your account at{/ts}:\n{$loginUrl}\n\n2. {ts}Click or paste this link into your browser to go to your page{/ts}:\n{$pcpInfoURL}\n\n{ts}When you view your campaign page WHILE LOGGED IN, the page includes links to edit your page, tell friends, and update your contact info.{/ts}\n\n\n{elseif $pcpStatus EQ \'Waiting Review\'}\n{ts}Your page requires administrator review before you can begin your fundraising efforts.{/ts}\n\n\n{ts}A notification email has been sent to the site administrator, and you will receive another notification from them as soon as the review process is complete.{/ts}\n\n\n{ts}You can still preview your page prior to approval{/ts}:\n1. {ts}Login to your account at{/ts}:\n{$loginUrl}\n\n2. {ts}Click or paste this link into your browser{/ts}:\n{$pcpInfoURL}\n\n{/if}\n{if $pcpNotifyEmailAddress}\n{ts}Questions? Send email to{/ts}:\n{$pcpNotifyEmailAddress}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n\n {if $pcpStatus eq \'Approved\'}\n\n \n \n \n\n {elseif $pcpStatus EQ \'Waiting Review\'}\n\n \n \n \n\n {/if}\n\n {if $pcpNotifyEmailAddress}\n \n \n \n {/if}\n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=\"$contribPageTitle\"}Thanks for creating a personal campaign page in support of %1.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts}Promoting Your Page{/ts}\n
\n {if $isTellFriendEnabled}\n

{ts}You can begin your fundraising efforts using our \"Tell a Friend\" form{/ts}:

\n
    \n
  1. {ts}Login to your account{/ts}
  2. \n
  3. {ts}Click this link and follow the prompts{/ts}
  4. \n
\n {else}\n

{ts}Send email to family, friends and colleagues with a personal message about this campaign.{/ts} {ts}Include this link to your fundraising page in your emails{/ts}: {$pcpInfoURL}

\n {/if}\n
\n {ts}Managing Your Page{/ts}\n
\n

{ts}Whenever you want to preview, update or promote your page{/ts}:

\n
    \n
  1. {ts}Login to your account{/ts}
  2. \n
  3. {ts}Go to your page{/ts}
  4. \n
\n

{ts}When you view your campaign page WHILE LOGGED IN, the page includes links to edit your page, tell friends, and update your contact info.{/ts}

\n
\n
\n

{ts}Your page requires administrator review before you can begin your fundraising efforts.{/ts}

\n

{ts}A notification email has been sent to the site administrator, and you will receive another notification from them as soon as the review process is complete.{/ts}

\n

{ts}You can still preview your page prior to approval{/ts}:

\n
    \n
  1. {ts}Login to your account{/ts}
  2. \n
  3. {ts}Click this link{/ts}
  4. \n
\n
\n

{ts}Questions? Send email to{/ts}: {$pcpNotifyEmailAddress}

\n
\n
\n\n\n\n',1,831,'pcp_supporter_notify',1,0,0,NULL),(24,'Personal Campaign Pages - Supporter Welcome','{ts 1=$contribPageTitle}Your Personal Campaign Page for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=\"$contribPageTitle\"}Thanks for creating a personal campaign page in support of %1.{/ts}\n\n{if $pcpStatus eq \'Approved\'}\n====================\n{ts}Promoting Your Page{/ts}\n\n====================\n{if $isTellFriendEnabled}\n\n{ts}You can begin your fundraising efforts using our \"Tell a Friend\" form{/ts}:\n\n1. {ts}Login to your account at{/ts}:\n{$loginUrl}\n\n2. {ts}Click or paste this link into your browser and follow the prompts{/ts}:\n{$pcpTellFriendURL}\n{else}\n\n{ts}Send email to family, friends and colleagues with a personal message about this campaign.{/ts}\n{ts}Include this link to your fundraising page in your emails{/ts}:\n{$pcpInfoURL}\n{/if}\n\n===================\n{ts}Managing Your Page{/ts}\n\n===================\n{ts}Whenever you want to preview, update or promote your page{/ts}:\n1. {ts}Login to your account at{/ts}:\n{$loginUrl}\n\n2. {ts}Click or paste this link into your browser to go to your page{/ts}:\n{$pcpInfoURL}\n\n{ts}When you view your campaign page WHILE LOGGED IN, the page includes links to edit your page, tell friends, and update your contact info.{/ts}\n\n\n{elseif $pcpStatus EQ \'Waiting Review\'}\n{ts}Your page requires administrator review before you can begin your fundraising efforts.{/ts}\n\n\n{ts}A notification email has been sent to the site administrator, and you will receive another notification from them as soon as the review process is complete.{/ts}\n\n\n{ts}You can still preview your page prior to approval{/ts}:\n1. {ts}Login to your account at{/ts}:\n{$loginUrl}\n\n2. {ts}Click or paste this link into your browser{/ts}:\n{$pcpInfoURL}\n\n{/if}\n{if $pcpNotifyEmailAddress}\n{ts}Questions? Send email to{/ts}:\n{$pcpNotifyEmailAddress}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n\n {if $pcpStatus eq \'Approved\'}\n\n \n \n \n\n {elseif $pcpStatus EQ \'Waiting Review\'}\n\n \n \n \n\n {/if}\n\n {if $pcpNotifyEmailAddress}\n \n \n \n {/if}\n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=\"$contribPageTitle\"}Thanks for creating a personal campaign page in support of %1.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts}Promoting Your Page{/ts}\n
\n {if $isTellFriendEnabled}\n

{ts}You can begin your fundraising efforts using our \"Tell a Friend\" form{/ts}:

\n
    \n
  1. {ts}Login to your account{/ts}
  2. \n
  3. {ts}Click this link and follow the prompts{/ts}
  4. \n
\n {else}\n

{ts}Send email to family, friends and colleagues with a personal message about this campaign.{/ts} {ts}Include this link to your fundraising page in your emails{/ts}: {$pcpInfoURL}

\n {/if}\n
\n {ts}Managing Your Page{/ts}\n
\n

{ts}Whenever you want to preview, update or promote your page{/ts}:

\n
    \n
  1. {ts}Login to your account{/ts}
  2. \n
  3. {ts}Go to your page{/ts}
  4. \n
\n

{ts}When you view your campaign page WHILE LOGGED IN, the page includes links to edit your page, tell friends, and update your contact info.{/ts}

\n
\n
\n

{ts}Your page requires administrator review before you can begin your fundraising efforts.{/ts}

\n

{ts}A notification email has been sent to the site administrator, and you will receive another notification from them as soon as the review process is complete.{/ts}

\n

{ts}You can still preview your page prior to approval{/ts}:

\n
    \n
  1. {ts}Login to your account{/ts}
  2. \n
  3. {ts}Click this link{/ts}
  4. \n
\n
\n

{ts}Questions? Send email to{/ts}: {$pcpNotifyEmailAddress}

\n
\n
\n\n\n\n',1,831,'pcp_supporter_notify',0,1,0,NULL),(25,'Personal Campaign Pages - Owner Notification','{ts}Someone has just donated to your personal campaign page{/ts} - {contact.display_name}\n','===========================================================\n{ts}Personal Campaign Page Owner Notification{/ts}\n\n===========================================================\n{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts}You have received a donation at your personal page{/ts}: {$page_title}\n>> {$pcpInfoURL}\n\n{ts}Your fundraising total has been updated.{/ts}\n{ts}The donor\'s information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts}\n{if $is_honor_roll_enabled}\n {ts}The donor\'s name has been added to your honor roll unless they asked not to be included.{/ts}\n{/if}\n\n{ts}Received{/ts}: {$receive_date|crmDate}\n\n{ts}Amount{/ts}: {$total_amount|crmMoney:$currency}\n\n{ts}Name{/ts}: {$donors_display_name}\n\n{ts}Email{/ts}: {$donors_email}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}You have received a donation at your personal page{/ts}: {$page_title}

\n

{ts}Your fundraising total has been updated.{/ts}
\n {ts}The donor\'s information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts}
\n {if $is_honor_roll_enabled}\n {ts}The donor\'s name has been added to your honor roll unless they asked not to be included.{/ts}
\n {/if}\n

\n \n \n \n \n \n
{ts}Received{/ts}: {$receive_date|crmDate}
{ts}Amount{/ts}: {$total_amount|crmMoney:$currency}
{ts}Name{/ts}: {$donors_display_name}
{ts}Email{/ts}: {$donors_email}
\n\n\n',1,832,'pcp_owner_notify',1,0,0,NULL),(26,'Personal Campaign Pages - Owner Notification','{ts}Someone has just donated to your personal campaign page{/ts} - {contact.display_name}\n','===========================================================\n{ts}Personal Campaign Page Owner Notification{/ts}\n\n===========================================================\n{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts}You have received a donation at your personal page{/ts}: {$page_title}\n>> {$pcpInfoURL}\n\n{ts}Your fundraising total has been updated.{/ts}\n{ts}The donor\'s information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts}\n{if $is_honor_roll_enabled}\n {ts}The donor\'s name has been added to your honor roll unless they asked not to be included.{/ts}\n{/if}\n\n{ts}Received{/ts}: {$receive_date|crmDate}\n\n{ts}Amount{/ts}: {$total_amount|crmMoney:$currency}\n\n{ts}Name{/ts}: {$donors_display_name}\n\n{ts}Email{/ts}: {$donors_email}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}You have received a donation at your personal page{/ts}: {$page_title}

\n

{ts}Your fundraising total has been updated.{/ts}
\n {ts}The donor\'s information is listed below. You can choose to contact them and convey your thanks if you wish.{/ts}
\n {if $is_honor_roll_enabled}\n {ts}The donor\'s name has been added to your honor roll unless they asked not to be included.{/ts}
\n {/if}\n

\n \n \n \n \n \n
{ts}Received{/ts}: {$receive_date|crmDate}
{ts}Amount{/ts}: {$total_amount|crmMoney:$currency}
{ts}Name{/ts}: {$donors_display_name}
{ts}Email{/ts}: {$donors_email}
\n\n\n',1,832,'pcp_owner_notify',0,1,0,NULL),(27,'Additional Payment Receipt or Refund Notification','{if $isRefund}{ts}Refund Notification{/ts}{else}{ts}Payment Receipt{/ts}{/if}{if $component eq \'event\'} - {$event.title}{/if} - {contact.display_name}\n','{if $emailGreeting}{$emailGreeting},\n{/if}\n\n{if $isRefund}\n{ts}A refund has been issued based on changes in your registration selections.{/ts}\n{else}\n{ts}Below you will find a receipt for this payment.{/ts}\n{/if}\n{if $paymentsComplete}\n{ts}Thank you for completing this payment.{/ts}\n{/if}\n\n{if $isRefund}\n===============================================================================\n\n{ts}Refund Details{/ts}\n\n===============================================================================\n{ts}This Refund Amount{/ts}: {$refundAmount|crmMoney}\n------------------------------------------------------------------------------------\n\n{else}\n===============================================================================\n\n{ts}Payment Details{/ts}\n\n===============================================================================\n{ts}This Payment Amount{/ts}: {$paymentAmount|crmMoney}\n------------------------------------------------------------------------------------\n{/if}\n{if $receive_date}\n{ts}Transaction Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n{/if}\n{if $paidBy}\n{ts}Paid By{/ts}: {$paidBy}\n{/if}\n{if $checkNumber}\n{ts}Check Number{/ts}: {$checkNumber}\n{/if}\n\n===============================================================================\n\n{ts}Contribution Details{/ts}\n\n===============================================================================\n{ts}Total Fee{/ts}: {$totalAmount|crmMoney}\n{ts}Total Paid{/ts}: {$totalPaid|crmMoney}\n{ts}Balance Owed{/ts}: {$amountOwed|crmMoney} {* This will be zero after final payment. *}\n\n\n{if $billingName || $address}\n\n===============================================================================\n\n{ts}Billing Name and Address{/ts}\n\n===============================================================================\n\n{$billingName}\n{$address}\n{/if}\n\n{if $credit_card_number}\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===============================================================================\n\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{if $component eq \'event\'}\n===============================================================================\n\n{ts}Event Information and Location{/ts}\n\n===============================================================================\n\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{if $event.participant_role}\n{ts}Participant Role{/ts}: {$event.participant_role}\n{/if}\n\n{if $isShowLocation}\n{$location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $location.phone.1.phone || $location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n{/foreach}\n{foreach from=$location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n{capture assign=emptyBlockStyle }style=\"padding: 10px; border-bottom: 1px solid #999;background-color: #f7f7f7;\"{/capture}\n{capture assign=emptyBlockValueStyle }style=\"padding: 10px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $isRefund}\n

{ts}A refund has been issued based on changes in your registration selections.{/ts}

\n {else}\n

{ts}Below you will find a receipt for this payment.{/ts}

\n {if $paymentsComplete}\n

{ts}Thank you for completing this contribution.{/ts}

\n {/if}\n {/if}\n
\n \n {if $isRefund}\n \n \n \n \n \n \n \n {else}\n \n \n \n \n \n \n \n {/if}\n {if $receive_date}\n \n \n \n \n {/if}\n {if $trxn_id}\n \n \n \n \n {/if}\n {if $paidBy}\n \n \n \n \n {/if}\n {if $checkNumber}\n \n \n \n \n {/if}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n {* This will be zero after final payment. *}\n \n
{ts}Refund Details{/ts}
\n {ts}This Refund Amount{/ts}\n \n {$refundAmount|crmMoney}\n
{ts}Payment Details{/ts}
\n {ts}This Payment Amount{/ts}\n \n {$paymentAmount|crmMoney}\n
\n {ts}Transaction Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}Paid By{/ts}\n \n {$paidBy}\n
\n {ts}Check Number{/ts}\n \n {$checkNumber}\n
{ts}Contribution Details{/ts}
\n {ts}Total Fee{/ts}\n \n {$totalAmount|crmMoney}\n
\n {ts}Total Paid{/ts}\n \n {$totalPaid|crmMoney}\n
\n {ts}Balance Owed{/ts}\n \n {$amountOwed|crmMoney}\n
\n\n
\n \n {if $billingName || $address}\n \n \n \n \n \n \n {/if}\n {if $credit_card_number}\n \n \n \n \n \n \n {/if}\n {if $component eq \'event\'}\n \n \n \n \n \n \n\n {if $event.participant_role}\n \n \n \n \n {/if}\n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $location.phone.1.phone || $location.email.1.email}\n \n \n \n {foreach from=$location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if} {*phone block close*}\n {/if}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires:{/ts} {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}\n \n {$event.participant_role}\n
\n {$location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}\n {$phone.phone_type_display}\n {else}\n {ts}Phone{/ts}\n {/if}\n \n {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n
\n
\n\n \n\n',1,833,'payment_or_refund_notification',1,0,0,NULL),(28,'Additional Payment Receipt or Refund Notification','{if $isRefund}{ts}Refund Notification{/ts}{else}{ts}Payment Receipt{/ts}{/if}{if $component eq \'event\'} - {$event.title}{/if} - {contact.display_name}\n','{if $emailGreeting}{$emailGreeting},\n{/if}\n\n{if $isRefund}\n{ts}A refund has been issued based on changes in your registration selections.{/ts}\n{else}\n{ts}Below you will find a receipt for this payment.{/ts}\n{/if}\n{if $paymentsComplete}\n{ts}Thank you for completing this payment.{/ts}\n{/if}\n\n{if $isRefund}\n===============================================================================\n\n{ts}Refund Details{/ts}\n\n===============================================================================\n{ts}This Refund Amount{/ts}: {$refundAmount|crmMoney}\n------------------------------------------------------------------------------------\n\n{else}\n===============================================================================\n\n{ts}Payment Details{/ts}\n\n===============================================================================\n{ts}This Payment Amount{/ts}: {$paymentAmount|crmMoney}\n------------------------------------------------------------------------------------\n{/if}\n{if $receive_date}\n{ts}Transaction Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n{/if}\n{if $paidBy}\n{ts}Paid By{/ts}: {$paidBy}\n{/if}\n{if $checkNumber}\n{ts}Check Number{/ts}: {$checkNumber}\n{/if}\n\n===============================================================================\n\n{ts}Contribution Details{/ts}\n\n===============================================================================\n{ts}Total Fee{/ts}: {$totalAmount|crmMoney}\n{ts}Total Paid{/ts}: {$totalPaid|crmMoney}\n{ts}Balance Owed{/ts}: {$amountOwed|crmMoney} {* This will be zero after final payment. *}\n\n\n{if $billingName || $address}\n\n===============================================================================\n\n{ts}Billing Name and Address{/ts}\n\n===============================================================================\n\n{$billingName}\n{$address}\n{/if}\n\n{if $credit_card_number}\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===============================================================================\n\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{if $component eq \'event\'}\n===============================================================================\n\n{ts}Event Information and Location{/ts}\n\n===============================================================================\n\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{if $event.participant_role}\n{ts}Participant Role{/ts}: {$event.participant_role}\n{/if}\n\n{if $isShowLocation}\n{$location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $location.phone.1.phone || $location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n{/foreach}\n{foreach from=$location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n{capture assign=emptyBlockStyle }style=\"padding: 10px; border-bottom: 1px solid #999;background-color: #f7f7f7;\"{/capture}\n{capture assign=emptyBlockValueStyle }style=\"padding: 10px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $isRefund}\n

{ts}A refund has been issued based on changes in your registration selections.{/ts}

\n {else}\n

{ts}Below you will find a receipt for this payment.{/ts}

\n {if $paymentsComplete}\n

{ts}Thank you for completing this contribution.{/ts}

\n {/if}\n {/if}\n
\n \n {if $isRefund}\n \n \n \n \n \n \n \n {else}\n \n \n \n \n \n \n \n {/if}\n {if $receive_date}\n \n \n \n \n {/if}\n {if $trxn_id}\n \n \n \n \n {/if}\n {if $paidBy}\n \n \n \n \n {/if}\n {if $checkNumber}\n \n \n \n \n {/if}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n {* This will be zero after final payment. *}\n \n
{ts}Refund Details{/ts}
\n {ts}This Refund Amount{/ts}\n \n {$refundAmount|crmMoney}\n
{ts}Payment Details{/ts}
\n {ts}This Payment Amount{/ts}\n \n {$paymentAmount|crmMoney}\n
\n {ts}Transaction Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}Paid By{/ts}\n \n {$paidBy}\n
\n {ts}Check Number{/ts}\n \n {$checkNumber}\n
{ts}Contribution Details{/ts}
\n {ts}Total Fee{/ts}\n \n {$totalAmount|crmMoney}\n
\n {ts}Total Paid{/ts}\n \n {$totalPaid|crmMoney}\n
\n {ts}Balance Owed{/ts}\n \n {$amountOwed|crmMoney}\n
\n\n
\n \n {if $billingName || $address}\n \n \n \n \n \n \n {/if}\n {if $credit_card_number}\n \n \n \n \n \n \n {/if}\n {if $component eq \'event\'}\n \n \n \n \n \n \n\n {if $event.participant_role}\n \n \n \n \n {/if}\n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $location.phone.1.phone || $location.email.1.email}\n \n \n \n {foreach from=$location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if} {*phone block close*}\n {/if}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires:{/ts} {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}\n \n {$event.participant_role}\n
\n {$location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}\n {$phone.phone_type_display}\n {else}\n {ts}Phone{/ts}\n {/if}\n \n {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n
\n
\n\n \n\n',1,833,'payment_or_refund_notification',0,1,0,NULL),(29,'Events - Registration Confirmation and Receipt (off-line)','{ts}Event Confirmation{/ts} - {$event.title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}\n{$event.confirm_email_text}\n{/if}\n\n{if $isOnWaitlist}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}You have been added to the WAIT LIST for this event.{/ts}\n\n{if $isPrimary}\n{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}\n\n{/if}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{elseif $isRequireApproval}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Your registration has been submitted.{/ts}\n\n{if $isPrimary}\n{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}\n\n{/if}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{elseif $is_pay_later}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$pay_later_receipt}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{/if}\n\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Event Information and Location{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{if $event.participant_role neq \'Attendee\' and $defaultRole}\n{ts}Participant Role{/ts}: {$event.participant_role}\n{/if}\n\n{if $isShowLocation}\n{$location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $location.phone.1.phone || $location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n{/foreach}\n{foreach from=$location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $event.is_public}\n{capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n{ts}Download iCalendar File:{/ts} {$icalFeed}\n{/if}\n\n{if $email}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Registered Email{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$email}\n{/if}\n{if $event.is_monetary} {* This section for Paid events only.*}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$event.fee_label}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{if $lineItem}{foreach from=$lineItem item=value key=priceset}\n\n{if $value neq \'skip\'}\n{if $isPrimary}\n{if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}\n{ts 1=$priceset+1}Participant %1{/ts}\n{/if}\n{/if}\n---------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{/if}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{capture assign=ts_participant_total}{if $pricesetFieldsCount }{ts}Total Participants{/ts}{/if}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {/if} {$ts_total|string_format:\"%10s\"} {$ts_participant_total|string_format:\"%10s\"}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{foreach from=$value item=line}\n{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney|string_format:\"%10s\"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {$ts_participant_count|string_format:\"%10s\"}\n{/foreach}\n{/if}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n{/if}\n\n{if $amount && !$lineItem}\n{foreach from=$amount item=amnt key=level}{$amnt.amount|crmMoney} {$amnt.label}\n{/foreach}\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n{if $isPrimary}\n\n{if $balanceAmount}{ts}Total Paid{/ts}{else}{ts}Total Amount{/ts}{/if}: {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if}\n\n{if $balanceAmount}\n{ts}Balance{/ts}: {$balanceAmount|crmMoney}\n{/if}\n\n{if $pricesetFieldsCount }\n {assign var=\"count\" value= 0}\n {foreach from=$lineItem item=pcount}\n {assign var=\"lineItemCount\" value=0}\n {if $pcount neq \'skip\'}\n {foreach from=$pcount item=p_count}\n {assign var=\"lineItemCount\" value=$lineItemCount+$p_count.participant_count}\n {/foreach}\n {if $lineItemCount < 1 }\n {assign var=\"lineItemCount\" value=1}\n {/if}\n {assign var=\"count\" value=$count+$lineItemCount}\n {/if}\n {/foreach}\n\n{ts}Total Participants{/ts}: {$count}\n{/if}\n\n{if $is_pay_later }\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$pay_later_receipt}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$register_date|crmDate}\n{/if}\n{if $receive_date}\n{ts}Transaction Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $financialTypeName}\n{ts}Financial Type{/ts}: {$financialTypeName}\n{/if}\n{if $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n{/if}\n{if $paidBy}\n{ts}Paid By{/ts}: {$paidBy}\n{/if}\n{if $checkNumber}\n{ts}Check Number{/ts}: {$checkNumber}\n{/if}\n{if $billingName}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Billing Name and Address{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$billingName}\n{$address}\n{/if}\n\n{if $credit_card_type}\n===========================================================\n{ts}Credit Card Information{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{/if}\n{/if} {* End of conditional section for Paid events *}\n\n{if $customPre}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customPre_grouptitle}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$customPre item=value key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n{$customName}: {$value}\n{/if}\n{/foreach}\n{/if}\n\n{if $customPost}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customPost_grouptitle}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$customPost item=value key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n{$customName}: {$value}\n{/if}\n{/foreach}\n{/if}\n{if $customProfile}\n\n{foreach from=$customProfile item=value key=customName}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts 1=$customName+1}Participant Information - Participant %1{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$value item=val key=field}\n{if $field eq \'additionalCustomPre\' or $field eq \'additionalCustomPost\' }\n{if $field eq \'additionalCustomPre\' }\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{$additionalCustomPre_grouptitle}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{else}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{$additionalCustomPost_grouptitle}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{/if}\n{foreach from=$val item=v key=f}\n{$f}: {$v}\n{/foreach}\n{/if}\n{/foreach}\n{/foreach}\n{/if}\n{if $customGroup}\n{foreach from=$customGroup item=value key=customName}\n=========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customName}\n=========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$value item=v key=n}\n{$n}: {$v}\n{/foreach}\n{/foreach}\n{/if}\n\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}\n

{$event.confirm_email_text|htmlize}

\n {/if}\n\n {if $isOnWaitlist}\n

{ts}You have been added to the WAIT LIST for this event.{/ts}

\n {if $isPrimary}\n

{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}

\n {/if}\n {elseif $isRequireApproval}\n

{ts}Your registration has been submitted.{/ts}

\n {if $isPrimary}\n

{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}

\n {/if}\n {elseif $is_pay_later}\n

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *}\n {/if}\n\n
\n \n \n \n \n \n \n \n\n {if $event.participant_role neq \'Attendee\' and $defaultRole}\n \n \n \n \n {/if}\n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $location.phone.1.phone || $location.email.1.email}\n \n \n \n {foreach from=$location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $event.is_public}\n \n \n \n {/if}\n\n {if $email}\n \n \n \n \n \n \n {/if}\n\n\n {if $event.is_monetary}\n\n \n \n \n\n {if $lineItem}\n {foreach from=$lineItem item=value key=priceset}\n {if $value neq \'skip\'}\n {if $isPrimary}\n {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}\n \n \n \n {/if}\n {/if}\n \n \n \n {/if}\n {/foreach}\n {if $dataArray}\n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n {/if}\n {/if}\n\n {if $amount && !$lineItem}\n {foreach from=$amount item=amnt key=level}\n \n \n \n {/foreach}\n {/if}\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n {if $isPrimary}\n \n \n \n \n {if $balanceAmount}\n \n \n \n \n {/if}\n {if $pricesetFieldsCount }\n \n \n \n \n {/if}\n {if $is_pay_later}\n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $financialTypeName}\n \n \n \n \n {/if}\n\n {if $trxn_id}\n \n \n \n \n {/if}\n\n {if $paidBy}\n \n \n \n \n {/if}\n\n {if $checkNumber}\n \n \n \n \n {/if}\n\n {if $billingName}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n {/if}\n\n {/if}\n\n {/if} {* End of conditional section for Paid events *}\n\n {if $customPre}\n \n \n \n {foreach from=$customPre item=value key=customName}\n {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $customPost}\n \n \n \n {foreach from=$customPost item=value key=customName}\n {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $customProfile}\n {foreach from=$customProfile item=value key=customName}\n \n \n \n {foreach from=$value item=val key=field}\n {if $field eq \'additionalCustomPre\' or $field eq \'additionalCustomPost\'}\n \n \n \n {foreach from=$val item=v key=f}\n \n \n \n \n {/foreach}\n {/if}\n {/foreach}\n {/foreach}\n {/if}\n\n {if $customGroup}\n {foreach from=$customGroup item=value key=customName}\n \n \n \n {foreach from=$value item=v key=n}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}\n \n {$event.participant_role}\n
\n {$location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}\n {$phone.phone_type_display}\n {else}\n {ts}Phone{/ts}\n {/if}\n \n {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n {ts}Download iCalendar File{/ts}\n
\n {ts}Registered Email{/ts}\n
\n {$email}\n
\n {$event.fee_label}\n
\n {ts 1=$priceset+1}Participant %1{/ts}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n {if $dataArray}\n \n \n \n {/if}\n \n {if $pricesetFieldsCount }{/if}\n \n {foreach from=$value item=line}\n \n \n \n \n {if $dataArray}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n {/if}\n \n {if $pricesetFieldsCount }\n \n {/if}\n \n {/foreach}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.qty}\n \n {$line.unit_price|crmMoney}\n \n {$line.unit_price*$line.qty|crmMoney}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney}\n \n {$line.line_total+$line.tax_amount|crmMoney}\n \n {$line.participant_count}\n
\n
\n {ts}Amount Before Tax:{/ts}\n \n {$totalAmount-$totalTaxAmount|crmMoney}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {$amnt.amount|crmMoney} {$amnt.label}\n
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {if $balanceAmount}\n {ts}Total Paid{/ts}\n {else}\n {ts}Total Amount{/ts}\n {/if}\n \n {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if}\n
\n {ts}Balance{/ts}\n \n {$balanceAmount|crmMoney}\n
\n {ts}Total Participants{/ts}\n {assign var=\"count\" value= 0}\n {foreach from=$lineItem item=pcount}\n {assign var=\"lineItemCount\" value=0}\n {if $pcount neq \'skip\'}\n {foreach from=$pcount item=p_count}\n {assign var=\"lineItemCount\" value=$lineItemCount+$p_count.participant_count}\n {/foreach}\n {if $lineItemCount < 1 }\n assign var=\"lineItemCount\" value=1}\n {/if}\n {assign var=\"count\" value=$count+$lineItemCount}\n {/if}\n {/foreach}\n {$count}\n
\n {$pay_later_receipt}\n
\n {ts}Registration Date{/ts}\n \n {$register_date|crmDate}\n
\n {ts}Transaction Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Financial Type{/ts}\n \n {$financialTypeName}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}Paid By{/ts}\n \n {$paidBy}\n
\n {ts}Check Number{/ts}\n \n {$checkNumber}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
\n {$customPre_grouptitle}\n
\n {$customName}\n \n {$value}\n
\n {$customPost_grouptitle}\n
\n {$customName}\n \n {$value}\n
\n {ts 1=$customName+1}Participant Information - Participant %1{/ts}\n
\n {if $field eq \'additionalCustomPre\'}\n {$additionalCustomPre_grouptitle}\n {else}\n {$additionalCustomPost_grouptitle}\n {/if}\n
\n {$f}\n \n {$v}\n
\n {$customName}\n
\n {$n}\n \n {$v}\n
\n
\n
\n\n\n\n',1,834,'event_offline_receipt',1,0,0,NULL),(30,'Events - Registration Confirmation and Receipt (off-line)','{ts}Event Confirmation{/ts} - {$event.title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}\n{$event.confirm_email_text}\n{/if}\n\n{if $isOnWaitlist}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}You have been added to the WAIT LIST for this event.{/ts}\n\n{if $isPrimary}\n{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}\n\n{/if}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{elseif $isRequireApproval}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Your registration has been submitted.{/ts}\n\n{if $isPrimary}\n{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}\n\n{/if}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{elseif $is_pay_later}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$pay_later_receipt}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{/if}\n\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Event Information and Location{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{if $event.participant_role neq \'Attendee\' and $defaultRole}\n{ts}Participant Role{/ts}: {$event.participant_role}\n{/if}\n\n{if $isShowLocation}\n{$location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $location.phone.1.phone || $location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n{/foreach}\n{foreach from=$location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $event.is_public}\n{capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n{ts}Download iCalendar File:{/ts} {$icalFeed}\n{/if}\n\n{if $email}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Registered Email{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$email}\n{/if}\n{if $event.is_monetary} {* This section for Paid events only.*}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$event.fee_label}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{if $lineItem}{foreach from=$lineItem item=value key=priceset}\n\n{if $value neq \'skip\'}\n{if $isPrimary}\n{if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}\n{ts 1=$priceset+1}Participant %1{/ts}\n{/if}\n{/if}\n---------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{/if}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{capture assign=ts_participant_total}{if $pricesetFieldsCount }{ts}Total Participants{/ts}{/if}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {/if} {$ts_total|string_format:\"%10s\"} {$ts_participant_total|string_format:\"%10s\"}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{foreach from=$value item=line}\n{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney|string_format:\"%10s\"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {$ts_participant_count|string_format:\"%10s\"}\n{/foreach}\n{/if}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n{/if}\n\n{if $amount && !$lineItem}\n{foreach from=$amount item=amnt key=level}{$amnt.amount|crmMoney} {$amnt.label}\n{/foreach}\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n{if $isPrimary}\n\n{if $balanceAmount}{ts}Total Paid{/ts}{else}{ts}Total Amount{/ts}{/if}: {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if}\n\n{if $balanceAmount}\n{ts}Balance{/ts}: {$balanceAmount|crmMoney}\n{/if}\n\n{if $pricesetFieldsCount }\n {assign var=\"count\" value= 0}\n {foreach from=$lineItem item=pcount}\n {assign var=\"lineItemCount\" value=0}\n {if $pcount neq \'skip\'}\n {foreach from=$pcount item=p_count}\n {assign var=\"lineItemCount\" value=$lineItemCount+$p_count.participant_count}\n {/foreach}\n {if $lineItemCount < 1 }\n {assign var=\"lineItemCount\" value=1}\n {/if}\n {assign var=\"count\" value=$count+$lineItemCount}\n {/if}\n {/foreach}\n\n{ts}Total Participants{/ts}: {$count}\n{/if}\n\n{if $is_pay_later }\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$pay_later_receipt}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$register_date|crmDate}\n{/if}\n{if $receive_date}\n{ts}Transaction Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $financialTypeName}\n{ts}Financial Type{/ts}: {$financialTypeName}\n{/if}\n{if $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n{/if}\n{if $paidBy}\n{ts}Paid By{/ts}: {$paidBy}\n{/if}\n{if $checkNumber}\n{ts}Check Number{/ts}: {$checkNumber}\n{/if}\n{if $billingName}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Billing Name and Address{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$billingName}\n{$address}\n{/if}\n\n{if $credit_card_type}\n===========================================================\n{ts}Credit Card Information{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{/if}\n{/if} {* End of conditional section for Paid events *}\n\n{if $customPre}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customPre_grouptitle}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$customPre item=value key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n{$customName}: {$value}\n{/if}\n{/foreach}\n{/if}\n\n{if $customPost}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customPost_grouptitle}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$customPost item=value key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n{$customName}: {$value}\n{/if}\n{/foreach}\n{/if}\n{if $customProfile}\n\n{foreach from=$customProfile item=value key=customName}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts 1=$customName+1}Participant Information - Participant %1{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$value item=val key=field}\n{if $field eq \'additionalCustomPre\' or $field eq \'additionalCustomPost\' }\n{if $field eq \'additionalCustomPre\' }\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{$additionalCustomPre_grouptitle}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{else}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{$additionalCustomPost_grouptitle}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{/if}\n{foreach from=$val item=v key=f}\n{$f}: {$v}\n{/foreach}\n{/if}\n{/foreach}\n{/foreach}\n{/if}\n{if $customGroup}\n{foreach from=$customGroup item=value key=customName}\n=========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customName}\n=========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$value item=v key=n}\n{$n}: {$v}\n{/foreach}\n{/foreach}\n{/if}\n\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}\n

{$event.confirm_email_text|htmlize}

\n {/if}\n\n {if $isOnWaitlist}\n

{ts}You have been added to the WAIT LIST for this event.{/ts}

\n {if $isPrimary}\n

{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}

\n {/if}\n {elseif $isRequireApproval}\n

{ts}Your registration has been submitted.{/ts}

\n {if $isPrimary}\n

{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}

\n {/if}\n {elseif $is_pay_later}\n

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *}\n {/if}\n\n
\n \n \n \n \n \n \n \n\n {if $event.participant_role neq \'Attendee\' and $defaultRole}\n \n \n \n \n {/if}\n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $location.phone.1.phone || $location.email.1.email}\n \n \n \n {foreach from=$location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $event.is_public}\n \n \n \n {/if}\n\n {if $email}\n \n \n \n \n \n \n {/if}\n\n\n {if $event.is_monetary}\n\n \n \n \n\n {if $lineItem}\n {foreach from=$lineItem item=value key=priceset}\n {if $value neq \'skip\'}\n {if $isPrimary}\n {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}\n \n \n \n {/if}\n {/if}\n \n \n \n {/if}\n {/foreach}\n {if $dataArray}\n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n {/if}\n {/if}\n\n {if $amount && !$lineItem}\n {foreach from=$amount item=amnt key=level}\n \n \n \n {/foreach}\n {/if}\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n {if $isPrimary}\n \n \n \n \n {if $balanceAmount}\n \n \n \n \n {/if}\n {if $pricesetFieldsCount }\n \n \n \n \n {/if}\n {if $is_pay_later}\n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $financialTypeName}\n \n \n \n \n {/if}\n\n {if $trxn_id}\n \n \n \n \n {/if}\n\n {if $paidBy}\n \n \n \n \n {/if}\n\n {if $checkNumber}\n \n \n \n \n {/if}\n\n {if $billingName}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n {/if}\n\n {/if}\n\n {/if} {* End of conditional section for Paid events *}\n\n {if $customPre}\n \n \n \n {foreach from=$customPre item=value key=customName}\n {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $customPost}\n \n \n \n {foreach from=$customPost item=value key=customName}\n {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $customProfile}\n {foreach from=$customProfile item=value key=customName}\n \n \n \n {foreach from=$value item=val key=field}\n {if $field eq \'additionalCustomPre\' or $field eq \'additionalCustomPost\'}\n \n \n \n {foreach from=$val item=v key=f}\n \n \n \n \n {/foreach}\n {/if}\n {/foreach}\n {/foreach}\n {/if}\n\n {if $customGroup}\n {foreach from=$customGroup item=value key=customName}\n \n \n \n {foreach from=$value item=v key=n}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}\n \n {$event.participant_role}\n
\n {$location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}\n {$phone.phone_type_display}\n {else}\n {ts}Phone{/ts}\n {/if}\n \n {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n {ts}Download iCalendar File{/ts}\n
\n {ts}Registered Email{/ts}\n
\n {$email}\n
\n {$event.fee_label}\n
\n {ts 1=$priceset+1}Participant %1{/ts}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n {if $dataArray}\n \n \n \n {/if}\n \n {if $pricesetFieldsCount }{/if}\n \n {foreach from=$value item=line}\n \n \n \n \n {if $dataArray}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n {/if}\n \n {if $pricesetFieldsCount }\n \n {/if}\n \n {/foreach}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.qty}\n \n {$line.unit_price|crmMoney}\n \n {$line.unit_price*$line.qty|crmMoney}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney}\n \n {$line.line_total+$line.tax_amount|crmMoney}\n \n {$line.participant_count}\n
\n
\n {ts}Amount Before Tax:{/ts}\n \n {$totalAmount-$totalTaxAmount|crmMoney}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {$amnt.amount|crmMoney} {$amnt.label}\n
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {if $balanceAmount}\n {ts}Total Paid{/ts}\n {else}\n {ts}Total Amount{/ts}\n {/if}\n \n {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if}\n
\n {ts}Balance{/ts}\n \n {$balanceAmount|crmMoney}\n
\n {ts}Total Participants{/ts}\n {assign var=\"count\" value= 0}\n {foreach from=$lineItem item=pcount}\n {assign var=\"lineItemCount\" value=0}\n {if $pcount neq \'skip\'}\n {foreach from=$pcount item=p_count}\n {assign var=\"lineItemCount\" value=$lineItemCount+$p_count.participant_count}\n {/foreach}\n {if $lineItemCount < 1 }\n assign var=\"lineItemCount\" value=1}\n {/if}\n {assign var=\"count\" value=$count+$lineItemCount}\n {/if}\n {/foreach}\n {$count}\n
\n {$pay_later_receipt}\n
\n {ts}Registration Date{/ts}\n \n {$register_date|crmDate}\n
\n {ts}Transaction Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Financial Type{/ts}\n \n {$financialTypeName}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}Paid By{/ts}\n \n {$paidBy}\n
\n {ts}Check Number{/ts}\n \n {$checkNumber}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
\n {$customPre_grouptitle}\n
\n {$customName}\n \n {$value}\n
\n {$customPost_grouptitle}\n
\n {$customName}\n \n {$value}\n
\n {ts 1=$customName+1}Participant Information - Participant %1{/ts}\n
\n {if $field eq \'additionalCustomPre\'}\n {$additionalCustomPre_grouptitle}\n {else}\n {$additionalCustomPost_grouptitle}\n {/if}\n
\n {$f}\n \n {$v}\n
\n {$customName}\n
\n {$n}\n \n {$v}\n
\n
\n
\n\n\n\n',1,834,'event_offline_receipt',0,1,0,NULL),(31,'Events - Registration Confirmation and Receipt (on-line)','{if $isOnWaitlist}{ts}Wait List Confirmation{/ts}{elseif $isRequireApproval}{ts}Registration Request Confirmation{/ts}{else}{ts}Registration Confirmation{/ts}{/if} - {$event.event_title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}\n{$event.confirm_email_text}\n\n{else}\n {ts}Thank you for your registration.{/ts}\n {if $participant_status}{ts 1=$participant_status}This is a confirmation that your registration has been received and your status has been updated to %1.{/ts}\n {else}{if $isOnWaitlist}{ts}This is a confirmation that your registration has been received and your status has been updated to waitlisted.{/ts}{else}{ts}This is a confirmation that your registration has been received and your status has been updated to registered.{/ts}{/if}\n {/if}\n{/if}\n\n{if $isOnWaitlist}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}You have been added to the WAIT LIST for this event.{/ts}\n\n{if $isPrimary}\n{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}\n{/if}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{elseif $isRequireApproval}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Your registration has been submitted.{/ts}\n\n{if $isPrimary}\n{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}\n\n{/if}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$pay_later_receipt}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{/if}\n\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Event Information and Location{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$event.event_title}\n{$event.event_start_date|date_format:\"%A\"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:\"%A\"} {$event.event_end_date|crmDate}{/if}{/if}\n{if $conference_sessions}\n\n\n{ts}Your schedule:{/ts}\n{assign var=\'group_by_day\' value=\'NA\'}\n{foreach from=$conference_sessions item=session}\n{if $session.start_date|date_format:\"%Y/%m/%d\" != $group_by_day|date_format:\"%Y/%m/%d\"}\n{assign var=\'group_by_day\' value=$session.start_date}\n\n{$group_by_day|date_format:\"%m/%d/%Y\"}\n\n\n{/if}\n{$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}\n{if $session.location} {$session.location}{/if}\n{/foreach}\n{/if}\n\n{if $event.participant_role neq \'Attendee\' and $defaultRole}\n{ts}Participant Role{/ts}: {$event.participant_role}\n{/if}\n\n{if $isShowLocation}\n{$location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $location.phone.1.phone || $location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n{/foreach}\n{foreach from=$location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $event.is_public}\n{capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n{ts}Download iCalendar File:{/ts} {$icalFeed}\n{/if}\n\n{if $payer.name}\nYou were registered by: {$payer.name}\n{/if}\n{if $event.is_monetary and not $isRequireApproval} {* This section for Paid events only.*}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$event.fee_label}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{if $lineItem}{foreach from=$lineItem item=value key=priceset}\n\n{if $value neq \'skip\'}\n{if $isPrimary}\n{if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}\n{ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info}\n\n{/if}\n{/if}\n-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if}\n\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{/if}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{if $pricesetFieldsCount }{capture assign=ts_participant_total}{ts}Total Participants{/ts}{/capture}{/if}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {/if} {$ts_total|string_format:\"%10s\"} {$ts_participant_total|string_format:\"%10s\"}\n-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if}\n\n{foreach from=$value item=line}\n{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney:$currency|string_format:\"%10s\"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"}{$ts_participant_count|string_format:\"%10s\"}\n{/foreach}\n----------------------------------------------------------------------------------------------------------------\n{if $individual}{ts}Participant Total{/ts} {$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:\"%29s\"} {$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:\"%33s\"} {$individual.$priceset.totalAmtWithTax|crmMoney:$currency|string_format:\"%12s\"}{/if}\n{/if}\n{\"\"|string_format:\"%120s\"}\n{/foreach}\n{\"\"|string_format:\"%120s\"}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n{/if}\n\n{if $amounts && !$lineItem}\n{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label}\n{/foreach}\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n{if $isPrimary }\n\n{ts}Total Amount{/ts}: {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if}\n\n{if $pricesetFieldsCount }\n {assign var=\"count\" value= 0}\n {foreach from=$lineItem item=pcount}\n {assign var=\"lineItemCount\" value=0}\n {if $pcount neq \'skip\'}\n {foreach from=$pcount item=p_count}\n {assign var=\"lineItemCount\" value=$lineItemCount+$p_count.participant_count}\n {/foreach}\n {if $lineItemCount < 1 }\n {assign var=\"lineItemCount\" value=1}\n {/if}\n {assign var=\"count\" value=$count+$lineItemCount}\n {/if}\n {/foreach}\n\n{ts}Total Participants{/ts}: {$count}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$register_date|crmDate}\n{/if}\n{if $receive_date}\n{ts}Transaction Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $financialTypeName}\n{ts}Financial Type{/ts}: {$financialTypeName}\n{/if}\n{if $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n{/if}\n{if $paidBy}\n{ts}Paid By{/ts}: {$paidBy}\n{/if}\n{if $checkNumber}\n{ts}Check Number{/ts}: {$checkNumber}\n{/if}\n{if $billingName}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Billing Name and Address{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$billingName}\n{$address}\n{/if}\n\n{if $credit_card_type}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Credit Card Information{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{/if}\n{/if} {* End of conditional section for Paid events *}\n\n{if $customPre}\n{foreach from=$customPre item=customPr key=i}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customPre_grouptitle.$i}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$customPr item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $customPost}\n{foreach from=$customPost item=customPos key=j}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customPost_grouptitle.$j}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$customPos item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/foreach}\n{/if}\n{if $customProfile}\n\n{foreach from=$customProfile.profile item=eachParticipant key=participantID}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts 1=$participantID+2}Participant Information - Participant %1{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$eachParticipant item=eachProfile key=pid}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{$customProfile.title.$pid}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{foreach from=$eachProfile item=val key=field}\n{foreach from=$val item=v key=f}\n{$field}: {$v}\n{/foreach}\n{/foreach}\n{/foreach}\n{/foreach}\n{/if}\n{if $customGroup}\n{foreach from=$customGroup item=value key=customName}\n=========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customName}\n=========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$value item=v key=n}\n{$n}: {$v}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $event.allow_selfcancelxfer }\n{ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n{ts}Transfer or cancel your registration:{/ts} {$selfService}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n{capture assign=tdfirstStyle}style=\"width: 180px; padding-bottom: 15px;\"{/capture}\n{capture assign=tdStyle}style=\"width: 100px;\"{/capture}\n{capture assign=participantTotal}style=\"margin: 0.5em 0 0.5em;padding: 0.5em;background-color: #999999;font-weight: bold;color: #FAFAFA;border-radius: 2px;\"{/capture}\n\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n \n {/if}\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}\n

{$event.confirm_email_text|htmlize}

\n\n {else}\n

{ts}Thank you for your registration.{/ts}\n {if $participant_status}{ts 1=$participant_status}This is a confirmation that your registration has been received and your status has been updated to %1.{/ts}\n {else}{if $isOnWaitlist}{ts}This is a confirmation that your registration has been received and your status has been updated to waitlisted.{/ts}{else}{ts}This is a confirmation that your registration has been received and your status has been updated to registered.{/ts}{/if}{/if}

\n\n {/if}\n\n

\n {if $isOnWaitlist}\n

{ts}You have been added to the WAIT LIST for this event.{/ts}

\n {if $isPrimary}\n

{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}

\n {/if}\n {elseif $isRequireApproval}\n

{ts}Your registration has been submitted.{/ts}

\n {if $isPrimary}\n

{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}

\n {/if}\n {elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant}\n

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *}\n {/if}\n\n
\n \n \n \n \n \n \n \n\n\n {if $conference_sessions}\n \n \n \n \n \n \n {/if}\n\n {if $event.participant_role neq \'Attendee\' and $defaultRole}\n \n \n \n \n {/if}\n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $location.phone.1.phone || $location.email.1.email}\n \n \n \n {foreach from=$location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $event.is_public}\n \n \n \n {/if}\n\n {if $event.is_share}\n \n \n \n {/if}\n {if $payer.name}\n \n \n \n \n \n \n {/if}\n {if $event.is_monetary and not $isRequireApproval}\n\n \n \n \n\n {if $lineItem}\n {foreach from=$lineItem item=value key=priceset}\n {if $value neq \'skip\'}\n {if $isPrimary}\n {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}\n \n \n \n {/if}\n {/if}\n \n \n \n {/if}\n {/foreach}\n {if $dataArray}\n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n {/if}\n {/if}\n\n {if $amounts && !$lineItem}\n {foreach from=$amounts item=amnt key=level}\n \n \n \n {/foreach}\n {/if}\n\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n {if $isPrimary}\n \n \n \n \n {if $pricesetFieldsCount }\n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $financialTypeName}\n \n \n \n \n {/if}\n\n {if $trxn_id}\n \n \n \n \n {/if}\n\n {if $paidBy}\n \n \n \n \n {/if}\n\n {if $checkNumber}\n \n \n \n \n {/if}\n\n {if $billingName}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n {/if}\n\n {/if}\n\n {/if} {* End of conditional section for Paid events *}\n\n\n{if $customPre}\n{foreach from=$customPre item=customPr key=i}\n \n {foreach from=$customPr item=customValue key=customName}\n {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n{/foreach}\n{/if}\n\n{if $customPost}\n{foreach from=$customPost item=customPos key=j}\n \n {foreach from=$customPos item=customValue key=customName}\n {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n \n \n \n \n{/if}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $customProfile}\n{foreach from=$customProfile.profile item=eachParticipant key=participantID}\n \n {foreach from=$eachParticipant item=eachProfile key=pid}\n \n {foreach from=$eachProfile item=val key=field}\n {foreach from=$val item=v key=f}\n \n \n {/foreach}\n \n {/foreach}\n{/foreach}\n{/foreach}\n{/if}\n\n {if $customGroup}\n {foreach from=$customGroup item=value key=customName}\n \n \n \n {foreach from=$value item=v key=n}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|date_format:\"%A\"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:\"%A\"} {$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Your schedule:{/ts}\n
\n {assign var=\'group_by_day\' value=\'NA\'}\n {foreach from=$conference_sessions item=session}\n {if $session.start_date|date_format:\"%Y/%m/%d\" != $group_by_day|date_format:\"%Y/%m/%d\"}\n {assign var=\'group_by_day\' value=$session.start_date}\n {$group_by_day|date_format:\"%m/%d/%Y\"}
\n {/if}\n {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
\n {if $session.location}    {$session.location}
{/if}\n {/foreach}\n
\n {ts}Participant Role{/ts}\n \n {$event.participant_role}\n
\n {$location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}\n {$phone.phone_type_display}\n {else}\n {ts}Phone{/ts}\n {/if}\n \n {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n {ts}Download iCalendar File{/ts}\n
\n {capture assign=eventUrl}{crmURL p=\'civicrm/event/info\' q=\"id=`$event.id`&reset=1\" a=true fe=1 h=1}{/capture}\n {include file=\"CRM/common/SocialNetwork.tpl\" emailMode=true url=$eventUrl title=$event.title pageURL=$eventUrl}\n
\n {ts}You were registered by:{/ts}\n
\n {$payer.name}\n
\n {$event.fee_label}\n
\n {ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n {if $dataArray}\n \n \n \n {/if}\n \n {if $pricesetFieldsCount }{/if}\n \n {foreach from=$value item=line}\n \n \n \n \n {if $dataArray}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n {/if}\n \n {if $pricesetFieldsCount } {/if}\n \n {/foreach}\n {if $individual}\n \n \n \n \n \n \n {/if}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.qty}\n \n {$line.unit_price|crmMoney:$currency}\n \n {$line.unit_price*$line.qty|crmMoney}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney}\n \n {$line.line_total+$line.tax_amount|crmMoney:$currency}\n {$line.participant_count}
{ts}Participant Total{/ts}{$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney}{$individual.$priceset.totalTaxAmt|crmMoney}{$individual.$priceset.totalAmtWithTax|crmMoney}
\n
\n {ts} Amount Before Tax: {/ts}\n \n {$totalAmount-$totalTaxAmount|crmMoney}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {$amnt.amount|crmMoney:$currency} {$amnt.label}\n
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Total Amount{/ts}\n \n {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if}\n
\n {ts}Total Participants{/ts}\n {assign var=\"count\" value= 0}\n {foreach from=$lineItem item=pcount}\n {assign var=\"lineItemCount\" value=0}\n {if $pcount neq \'skip\'}\n {foreach from=$pcount item=p_count}\n {assign var=\"lineItemCount\" value=$lineItemCount+$p_count.participant_count}\n {/foreach}\n {if $lineItemCount < 1 }\n {assign var=\"lineItemCount\" value=1}\n {/if}\n {assign var=\"count\" value=$count+$lineItemCount}\n {/if}\n {/foreach}\n {$count}\n
\n {ts}Registration Date{/ts}\n \n {$register_date|crmDate}\n
\n {ts}Transaction Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Financial Type{/ts}\n \n {$financialTypeName}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}Paid By{/ts}\n \n {$paidBy}\n
\n {ts}Check Number{/ts}\n \n {$checkNumber}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
{$customPre_grouptitle.$i}
{$customName}{$customValue}
{$customPost_grouptitle.$j}
{$customName}{$customValue}
{ts 1=$participantID+2}Participant %1{/ts}
{$customProfile.title.$pid}
{$field}{$v}
\n {$customName}\n
\n {$n}\n \n {$v}\n
\n {if $event.allow_selfcancelxfer }\n
\n {ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n {ts}Click here to transfer or cancel your registration.{/ts}\n
\n
\n\n\n\n',1,835,'event_online_receipt',1,0,0,NULL),(32,'Events - Registration Confirmation and Receipt (on-line)','{if $isOnWaitlist}{ts}Wait List Confirmation{/ts}{elseif $isRequireApproval}{ts}Registration Request Confirmation{/ts}{else}{ts}Registration Confirmation{/ts}{/if} - {$event.event_title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}\n{$event.confirm_email_text}\n\n{else}\n {ts}Thank you for your registration.{/ts}\n {if $participant_status}{ts 1=$participant_status}This is a confirmation that your registration has been received and your status has been updated to %1.{/ts}\n {else}{if $isOnWaitlist}{ts}This is a confirmation that your registration has been received and your status has been updated to waitlisted.{/ts}{else}{ts}This is a confirmation that your registration has been received and your status has been updated to registered.{/ts}{/if}\n {/if}\n{/if}\n\n{if $isOnWaitlist}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}You have been added to the WAIT LIST for this event.{/ts}\n\n{if $isPrimary}\n{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}\n{/if}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{elseif $isRequireApproval}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Your registration has been submitted.{/ts}\n\n{if $isPrimary}\n{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}\n\n{/if}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$pay_later_receipt}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{/if}\n\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Event Information and Location{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$event.event_title}\n{$event.event_start_date|date_format:\"%A\"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:\"%A\"} {$event.event_end_date|crmDate}{/if}{/if}\n{if $conference_sessions}\n\n\n{ts}Your schedule:{/ts}\n{assign var=\'group_by_day\' value=\'NA\'}\n{foreach from=$conference_sessions item=session}\n{if $session.start_date|date_format:\"%Y/%m/%d\" != $group_by_day|date_format:\"%Y/%m/%d\"}\n{assign var=\'group_by_day\' value=$session.start_date}\n\n{$group_by_day|date_format:\"%m/%d/%Y\"}\n\n\n{/if}\n{$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}\n{if $session.location} {$session.location}{/if}\n{/foreach}\n{/if}\n\n{if $event.participant_role neq \'Attendee\' and $defaultRole}\n{ts}Participant Role{/ts}: {$event.participant_role}\n{/if}\n\n{if $isShowLocation}\n{$location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $location.phone.1.phone || $location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n{/foreach}\n{foreach from=$location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $event.is_public}\n{capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n{ts}Download iCalendar File:{/ts} {$icalFeed}\n{/if}\n\n{if $payer.name}\nYou were registered by: {$payer.name}\n{/if}\n{if $event.is_monetary and not $isRequireApproval} {* This section for Paid events only.*}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$event.fee_label}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{if $lineItem}{foreach from=$lineItem item=value key=priceset}\n\n{if $value neq \'skip\'}\n{if $isPrimary}\n{if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}\n{ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info}\n\n{/if}\n{/if}\n-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if}\n\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{/if}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{if $pricesetFieldsCount }{capture assign=ts_participant_total}{ts}Total Participants{/ts}{/capture}{/if}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {/if} {$ts_total|string_format:\"%10s\"} {$ts_participant_total|string_format:\"%10s\"}\n-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if}\n\n{foreach from=$value item=line}\n{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney:$currency|string_format:\"%10s\"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"}{$ts_participant_count|string_format:\"%10s\"}\n{/foreach}\n----------------------------------------------------------------------------------------------------------------\n{if $individual}{ts}Participant Total{/ts} {$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:\"%29s\"} {$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:\"%33s\"} {$individual.$priceset.totalAmtWithTax|crmMoney:$currency|string_format:\"%12s\"}{/if}\n{/if}\n{\"\"|string_format:\"%120s\"}\n{/foreach}\n{\"\"|string_format:\"%120s\"}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n{/if}\n\n{if $amounts && !$lineItem}\n{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label}\n{/foreach}\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n{if $isPrimary }\n\n{ts}Total Amount{/ts}: {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if}\n\n{if $pricesetFieldsCount }\n {assign var=\"count\" value= 0}\n {foreach from=$lineItem item=pcount}\n {assign var=\"lineItemCount\" value=0}\n {if $pcount neq \'skip\'}\n {foreach from=$pcount item=p_count}\n {assign var=\"lineItemCount\" value=$lineItemCount+$p_count.participant_count}\n {/foreach}\n {if $lineItemCount < 1 }\n {assign var=\"lineItemCount\" value=1}\n {/if}\n {assign var=\"count\" value=$count+$lineItemCount}\n {/if}\n {/foreach}\n\n{ts}Total Participants{/ts}: {$count}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$register_date|crmDate}\n{/if}\n{if $receive_date}\n{ts}Transaction Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $financialTypeName}\n{ts}Financial Type{/ts}: {$financialTypeName}\n{/if}\n{if $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n{/if}\n{if $paidBy}\n{ts}Paid By{/ts}: {$paidBy}\n{/if}\n{if $checkNumber}\n{ts}Check Number{/ts}: {$checkNumber}\n{/if}\n{if $billingName}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Billing Name and Address{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$billingName}\n{$address}\n{/if}\n\n{if $credit_card_type}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts}Credit Card Information{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{/if}\n{/if} {* End of conditional section for Paid events *}\n\n{if $customPre}\n{foreach from=$customPre item=customPr key=i}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customPre_grouptitle.$i}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$customPr item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $customPost}\n{foreach from=$customPost item=customPos key=j}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customPost_grouptitle.$j}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$customPos item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/foreach}\n{/if}\n{if $customProfile}\n\n{foreach from=$customProfile.profile item=eachParticipant key=participantID}\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{ts 1=$participantID+2}Participant Information - Participant %1{/ts}\n\n==========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$eachParticipant item=eachProfile key=pid}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{$customProfile.title.$pid}\n----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if}\n\n{foreach from=$eachProfile item=val key=field}\n{foreach from=$val item=v key=f}\n{$field}: {$v}\n{/foreach}\n{/foreach}\n{/foreach}\n{/foreach}\n{/if}\n{if $customGroup}\n{foreach from=$customGroup item=value key=customName}\n=========================================================={if $pricesetFieldsCount }===================={/if}\n\n{$customName}\n=========================================================={if $pricesetFieldsCount }===================={/if}\n\n{foreach from=$value item=v key=n}\n{$n}: {$v}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $event.allow_selfcancelxfer }\n{ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n{ts}Transfer or cancel your registration:{/ts} {$selfService}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n{capture assign=tdfirstStyle}style=\"width: 180px; padding-bottom: 15px;\"{/capture}\n{capture assign=tdStyle}style=\"width: 100px;\"{/capture}\n{capture assign=participantTotal}style=\"margin: 0.5em 0 0.5em;padding: 0.5em;background-color: #999999;font-weight: bold;color: #FAFAFA;border-radius: 2px;\"{/capture}\n\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n \n {/if}\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}\n

{$event.confirm_email_text|htmlize}

\n\n {else}\n

{ts}Thank you for your registration.{/ts}\n {if $participant_status}{ts 1=$participant_status}This is a confirmation that your registration has been received and your status has been updated to %1.{/ts}\n {else}{if $isOnWaitlist}{ts}This is a confirmation that your registration has been received and your status has been updated to waitlisted.{/ts}{else}{ts}This is a confirmation that your registration has been received and your status has been updated to registered.{/ts}{/if}{/if}

\n\n {/if}\n\n

\n {if $isOnWaitlist}\n

{ts}You have been added to the WAIT LIST for this event.{/ts}

\n {if $isPrimary}\n

{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}

\n {/if}\n {elseif $isRequireApproval}\n

{ts}Your registration has been submitted.{/ts}

\n {if $isPrimary}\n

{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}

\n {/if}\n {elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant}\n

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *}\n {/if}\n\n
\n \n \n \n \n \n \n \n\n\n {if $conference_sessions}\n \n \n \n \n \n \n {/if}\n\n {if $event.participant_role neq \'Attendee\' and $defaultRole}\n \n \n \n \n {/if}\n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $location.phone.1.phone || $location.email.1.email}\n \n \n \n {foreach from=$location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $event.is_public}\n \n \n \n {/if}\n\n {if $event.is_share}\n \n \n \n {/if}\n {if $payer.name}\n \n \n \n \n \n \n {/if}\n {if $event.is_monetary and not $isRequireApproval}\n\n \n \n \n\n {if $lineItem}\n {foreach from=$lineItem item=value key=priceset}\n {if $value neq \'skip\'}\n {if $isPrimary}\n {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}\n \n \n \n {/if}\n {/if}\n \n \n \n {/if}\n {/foreach}\n {if $dataArray}\n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n {/if}\n {/if}\n\n {if $amounts && !$lineItem}\n {foreach from=$amounts item=amnt key=level}\n \n \n \n {/foreach}\n {/if}\n\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n {if $isPrimary}\n \n \n \n \n {if $pricesetFieldsCount }\n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $financialTypeName}\n \n \n \n \n {/if}\n\n {if $trxn_id}\n \n \n \n \n {/if}\n\n {if $paidBy}\n \n \n \n \n {/if}\n\n {if $checkNumber}\n \n \n \n \n {/if}\n\n {if $billingName}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n {/if}\n\n {/if}\n\n {/if} {* End of conditional section for Paid events *}\n\n\n{if $customPre}\n{foreach from=$customPre item=customPr key=i}\n \n {foreach from=$customPr item=customValue key=customName}\n {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n{/foreach}\n{/if}\n\n{if $customPost}\n{foreach from=$customPost item=customPos key=j}\n \n {foreach from=$customPos item=customValue key=customName}\n {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n \n \n \n \n{/if}\n{/foreach}\n{/foreach}\n{/if}\n\n{if $customProfile}\n{foreach from=$customProfile.profile item=eachParticipant key=participantID}\n \n {foreach from=$eachParticipant item=eachProfile key=pid}\n \n {foreach from=$eachProfile item=val key=field}\n {foreach from=$val item=v key=f}\n \n \n {/foreach}\n \n {/foreach}\n{/foreach}\n{/foreach}\n{/if}\n\n {if $customGroup}\n {foreach from=$customGroup item=value key=customName}\n \n \n \n {foreach from=$value item=v key=n}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|date_format:\"%A\"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:\"%A\"} {$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Your schedule:{/ts}\n
\n {assign var=\'group_by_day\' value=\'NA\'}\n {foreach from=$conference_sessions item=session}\n {if $session.start_date|date_format:\"%Y/%m/%d\" != $group_by_day|date_format:\"%Y/%m/%d\"}\n {assign var=\'group_by_day\' value=$session.start_date}\n {$group_by_day|date_format:\"%m/%d/%Y\"}
\n {/if}\n {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
\n {if $session.location}    {$session.location}
{/if}\n {/foreach}\n
\n {ts}Participant Role{/ts}\n \n {$event.participant_role}\n
\n {$location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}\n {$phone.phone_type_display}\n {else}\n {ts}Phone{/ts}\n {/if}\n \n {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n {ts}Download iCalendar File{/ts}\n
\n {capture assign=eventUrl}{crmURL p=\'civicrm/event/info\' q=\"id=`$event.id`&reset=1\" a=true fe=1 h=1}{/capture}\n {include file=\"CRM/common/SocialNetwork.tpl\" emailMode=true url=$eventUrl title=$event.title pageURL=$eventUrl}\n
\n {ts}You were registered by:{/ts}\n
\n {$payer.name}\n
\n {$event.fee_label}\n
\n {ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n {if $dataArray}\n \n \n \n {/if}\n \n {if $pricesetFieldsCount }{/if}\n \n {foreach from=$value item=line}\n \n \n \n \n {if $dataArray}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n {/if}\n \n {if $pricesetFieldsCount } {/if}\n \n {/foreach}\n {if $individual}\n \n \n \n \n \n \n {/if}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.qty}\n \n {$line.unit_price|crmMoney:$currency}\n \n {$line.unit_price*$line.qty|crmMoney}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney}\n \n {$line.line_total+$line.tax_amount|crmMoney:$currency}\n {$line.participant_count}
{ts}Participant Total{/ts}{$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney}{$individual.$priceset.totalTaxAmt|crmMoney}{$individual.$priceset.totalAmtWithTax|crmMoney}
\n
\n {ts} Amount Before Tax: {/ts}\n \n {$totalAmount-$totalTaxAmount|crmMoney}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {$amnt.amount|crmMoney:$currency} {$amnt.label}\n
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Total Amount{/ts}\n \n {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if}\n
\n {ts}Total Participants{/ts}\n {assign var=\"count\" value= 0}\n {foreach from=$lineItem item=pcount}\n {assign var=\"lineItemCount\" value=0}\n {if $pcount neq \'skip\'}\n {foreach from=$pcount item=p_count}\n {assign var=\"lineItemCount\" value=$lineItemCount+$p_count.participant_count}\n {/foreach}\n {if $lineItemCount < 1 }\n {assign var=\"lineItemCount\" value=1}\n {/if}\n {assign var=\"count\" value=$count+$lineItemCount}\n {/if}\n {/foreach}\n {$count}\n
\n {ts}Registration Date{/ts}\n \n {$register_date|crmDate}\n
\n {ts}Transaction Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Financial Type{/ts}\n \n {$financialTypeName}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}Paid By{/ts}\n \n {$paidBy}\n
\n {ts}Check Number{/ts}\n \n {$checkNumber}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
{$customPre_grouptitle.$i}
{$customName}{$customValue}
{$customPost_grouptitle.$j}
{$customName}{$customValue}
{ts 1=$participantID+2}Participant %1{/ts}
{$customProfile.title.$pid}
{$field}{$v}
\n {$customName}\n
\n {$n}\n \n {$v}\n
\n {if $event.allow_selfcancelxfer }\n
\n {ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n {ts}Click here to transfer or cancel your registration.{/ts}\n
\n
\n\n\n\n',1,835,'event_online_receipt',0,1,0,NULL),(33,'Events - Receipt only','Receipt for {if $events_in_cart} Event Registration{/if} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{if $is_pay_later}\n This is being sent to you as an acknowledgement that you have registered one or more members for the following workshop, event or purchase. Please note, however, that the status of your payment is pending, and the registration for this event will not be completed until your payment is received.\n{else}\n This is being sent to you as a {if $is_refund}confirmation of refund{else}receipt of payment made{/if} for the following workshop, event registration or purchase.\n{/if}\n\n{if $is_pay_later}\n {$pay_later_receipt}\n{/if}\n\n Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if}\n Here\'s a summary of your transaction placed on {$transaction_date|date_format:\"%D %I:%M %p %Z\"}:\n\n{if $billing_name}\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billing_name}\n\n{$billing_street_address}\n\n{$billing_city}, {$billing_state} {$billing_postal_code}\n\n{$email}\n{/if}\n\n{if $source}\n{$source}\n{/if}\n\n\n{foreach from=$line_items item=line_item}\n{$line_item.event->title} ({$line_item.event->start_date|date_format:\"%D\"})\n{if $line_item.event->is_show_location}\n {$line_item.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n{$line_item.event->start_date|date_format:\"%D %I:%M %p\"} - {$line_item.event->end_date|date_format:\"%I:%M %p\"}\n\n Quantity: {$line_item.num_participants}\n\n{if $line_item.num_participants > 0}\n {foreach from=$line_item.participants item=participant}\n {$participant.display_name}\n {/foreach}\n{/if}\n{if $line_item.num_waiting_participants > 0}\n Waitlisted:\n {foreach from=$line_item.waiting_participants item=participant}\n {$participant.display_name}\n {/foreach}\n{/if}\nCost: {$line_item.cost|crmMoney:$currency|string_format:\"%10s\"}\nTotal For This Event: {$line_item.amount|crmMoney:$currency|string_format:\"%10s\"}\n\n{/foreach}\n\n{if $discounts}\nSubtotal: {$sub_total|crmMoney:$currency|string_format:\"%10s\"}\n--------------------------------------\nDiscounts\n{foreach from=$discounts key=myId item=i}\n {$i.title}: -{$i.amount|crmMoney:$currency|string_format:\"%10s\"}\n{/foreach}\n{/if}\n======================================\nTotal: {$total|crmMoney:$currency|string_format:\"%10s\"}\n\n{if $credit_card_type}\n===========================================================\n{ts}Payment Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date.M}/{$credit_card_exp_date.Y}\n{/if}\n\n If you have questions about the status of your registration or purchase please feel free to contact us.\n','\n\n \n \n \n \n \n {capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n {capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n {capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $is_pay_later}\n

\n This is being sent to you as an acknowledgement that you have registered one or more members for the following workshop, event or purchase. Please note, however, that the status of your payment is pending, and the registration for this event will not be completed until your payment is received.\n

\n {else}\n

\n This is being sent to you as a {if $is_refund}confirmation of refund{else}receipt of payment made{/if} for the following workshop, event registration or purchase.\n

\n {/if}\n\n {if $is_pay_later}\n

{$pay_later_receipt}

\n {/if}\n\n

Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if}\n Here\'s a summary of your transaction placed on {$transaction_date|date_format:\"%D %I:%M %p %Z\"}:

\n\n{if $billing_name}\n \n \n \n \n \n \n \n
\n {ts}Billing Name and Address{/ts}\n
\n {$billing_name}
\n {$billing_street_address}
\n {$billing_city}, {$billing_state} {$billing_postal_code}
\n
\n {$email}\n
\n{/if}\n{if $credit_card_type}\n

 

\n \n \n \n \n \n \n \n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date.M}/{$credit_card_exp_date.Y}\n
\n{/if}\n{if $source}\n

 

\n {$source}\n{/if}\n

 

\n \n \n \n{if $line_items}\n \n \n{/if}\n \n \n \n \n \n {foreach from=$line_items item=line_item}\n \n \n \n \n \n \n {/foreach}\n \n \n {if $discounts}\n \n \n \n \n \n \n {foreach from=$discounts key=myId item=i}\n \n \n \n \n \n \n {/foreach}\n {/if}\n \n{if $line_items}\n \n \n{/if}\n \n \n \n \n
\n Event\n \n Participants\n \n Price\n \n Total\n
\n {$line_item.event->title} ({$line_item.event->start_date|date_format:\"%D\"})
\n {if $line_item.event->is_show_location}\n {$line_item.location.address.1.display|nl2br}\n {/if}{*End of isShowLocation condition*}

\n {$line_item.event->start_date|date_format:\"%D %I:%M %p\"} - {$line_item.event->end_date|date_format:\"%I:%M %p\"}\n
\n {$line_item.num_participants}\n {if $line_item.num_participants > 0}\n
\n {foreach from=$line_item.participants item=participant}\n {$participant.display_name}
\n {/foreach}\n
\n {/if}\n {if $line_item.num_waiting_participants > 0}\n Waitlisted:
\n
\n {foreach from=$line_item.waiting_participants item=participant}\n {$participant.display_name}
\n {/foreach}\n
\n {/if}\n
\n {$line_item.cost|crmMoney:$currency|string_format:\"%10s\"}\n \n  {$line_item.amount|crmMoney:$currency|string_format:\"%10s\"}\n
\n \n \n Subtotal:\n \n  {$sub_total|crmMoney:$currency|string_format:\"%10s\"}\n
\n {$i.title}\n \n \n \n -{$i.amount}\n
\n \n \n Total:\n \n  {$total|crmMoney:$currency|string_format:\"%10s\"}\n
\n\n If you have questions about the status of your registration or purchase please feel free to contact us.\n \n\n',1,836,'event_registration_receipt',1,0,0,NULL),(34,'Events - Receipt only','Receipt for {if $events_in_cart} Event Registration{/if} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{if $is_pay_later}\n This is being sent to you as an acknowledgement that you have registered one or more members for the following workshop, event or purchase. Please note, however, that the status of your payment is pending, and the registration for this event will not be completed until your payment is received.\n{else}\n This is being sent to you as a {if $is_refund}confirmation of refund{else}receipt of payment made{/if} for the following workshop, event registration or purchase.\n{/if}\n\n{if $is_pay_later}\n {$pay_later_receipt}\n{/if}\n\n Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if}\n Here\'s a summary of your transaction placed on {$transaction_date|date_format:\"%D %I:%M %p %Z\"}:\n\n{if $billing_name}\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billing_name}\n\n{$billing_street_address}\n\n{$billing_city}, {$billing_state} {$billing_postal_code}\n\n{$email}\n{/if}\n\n{if $source}\n{$source}\n{/if}\n\n\n{foreach from=$line_items item=line_item}\n{$line_item.event->title} ({$line_item.event->start_date|date_format:\"%D\"})\n{if $line_item.event->is_show_location}\n {$line_item.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n{$line_item.event->start_date|date_format:\"%D %I:%M %p\"} - {$line_item.event->end_date|date_format:\"%I:%M %p\"}\n\n Quantity: {$line_item.num_participants}\n\n{if $line_item.num_participants > 0}\n {foreach from=$line_item.participants item=participant}\n {$participant.display_name}\n {/foreach}\n{/if}\n{if $line_item.num_waiting_participants > 0}\n Waitlisted:\n {foreach from=$line_item.waiting_participants item=participant}\n {$participant.display_name}\n {/foreach}\n{/if}\nCost: {$line_item.cost|crmMoney:$currency|string_format:\"%10s\"}\nTotal For This Event: {$line_item.amount|crmMoney:$currency|string_format:\"%10s\"}\n\n{/foreach}\n\n{if $discounts}\nSubtotal: {$sub_total|crmMoney:$currency|string_format:\"%10s\"}\n--------------------------------------\nDiscounts\n{foreach from=$discounts key=myId item=i}\n {$i.title}: -{$i.amount|crmMoney:$currency|string_format:\"%10s\"}\n{/foreach}\n{/if}\n======================================\nTotal: {$total|crmMoney:$currency|string_format:\"%10s\"}\n\n{if $credit_card_type}\n===========================================================\n{ts}Payment Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date.M}/{$credit_card_exp_date.Y}\n{/if}\n\n If you have questions about the status of your registration or purchase please feel free to contact us.\n','\n\n \n \n \n \n \n {capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n {capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n {capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $is_pay_later}\n

\n This is being sent to you as an acknowledgement that you have registered one or more members for the following workshop, event or purchase. Please note, however, that the status of your payment is pending, and the registration for this event will not be completed until your payment is received.\n

\n {else}\n

\n This is being sent to you as a {if $is_refund}confirmation of refund{else}receipt of payment made{/if} for the following workshop, event registration or purchase.\n

\n {/if}\n\n {if $is_pay_later}\n

{$pay_later_receipt}

\n {/if}\n\n

Your order number is #{$transaction_id}. {if $line_items && !$is_refund} Information about the workshops will be sent separately to each participant.{/if}\n Here\'s a summary of your transaction placed on {$transaction_date|date_format:\"%D %I:%M %p %Z\"}:

\n\n{if $billing_name}\n \n \n \n \n \n \n \n
\n {ts}Billing Name and Address{/ts}\n
\n {$billing_name}
\n {$billing_street_address}
\n {$billing_city}, {$billing_state} {$billing_postal_code}
\n
\n {$email}\n
\n{/if}\n{if $credit_card_type}\n

 

\n \n \n \n \n \n \n \n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date.M}/{$credit_card_exp_date.Y}\n
\n{/if}\n{if $source}\n

 

\n {$source}\n{/if}\n

 

\n \n \n \n{if $line_items}\n \n \n{/if}\n \n \n \n \n \n {foreach from=$line_items item=line_item}\n \n \n \n \n \n \n {/foreach}\n \n \n {if $discounts}\n \n \n \n \n \n \n {foreach from=$discounts key=myId item=i}\n \n \n \n \n \n \n {/foreach}\n {/if}\n \n{if $line_items}\n \n \n{/if}\n \n \n \n \n
\n Event\n \n Participants\n \n Price\n \n Total\n
\n {$line_item.event->title} ({$line_item.event->start_date|date_format:\"%D\"})
\n {if $line_item.event->is_show_location}\n {$line_item.location.address.1.display|nl2br}\n {/if}{*End of isShowLocation condition*}

\n {$line_item.event->start_date|date_format:\"%D %I:%M %p\"} - {$line_item.event->end_date|date_format:\"%I:%M %p\"}\n
\n {$line_item.num_participants}\n {if $line_item.num_participants > 0}\n
\n {foreach from=$line_item.participants item=participant}\n {$participant.display_name}
\n {/foreach}\n
\n {/if}\n {if $line_item.num_waiting_participants > 0}\n Waitlisted:
\n
\n {foreach from=$line_item.waiting_participants item=participant}\n {$participant.display_name}
\n {/foreach}\n
\n {/if}\n
\n {$line_item.cost|crmMoney:$currency|string_format:\"%10s\"}\n \n  {$line_item.amount|crmMoney:$currency|string_format:\"%10s\"}\n
\n \n \n Subtotal:\n \n  {$sub_total|crmMoney:$currency|string_format:\"%10s\"}\n
\n {$i.title}\n \n \n \n -{$i.amount}\n
\n \n \n Total:\n \n  {$total|crmMoney:$currency|string_format:\"%10s\"}\n
\n\n If you have questions about the status of your registration or purchase please feel free to contact us.\n \n\n',1,836,'event_registration_receipt',0,1,0,NULL),(35,'Events - Registration Cancellation Notice','{ts 1=$event.event_title}Event Registration Cancelled for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts}Your Event Registration has been cancelled.{/ts}\n\n\n===========================================================\n{ts}Event Information and Location{/ts}\n\n===========================================================\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{ts}Participant Role{/ts}: {$participant.role}\n\n{if $isShowLocation}\n{$event.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $event.location.phone.1.phone || $event.location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$event.location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if}\n{/foreach}\n{foreach from=$event.location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $contact.email}\n\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$contact.email}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$participant.register_date|crmDate}\n{/if}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}Your Event Registration has been cancelled.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $event.location.phone.1.phone || $event.location.email.1.email}\n \n \n \n {foreach from=$event.location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$event.location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $contact.email}\n \n \n \n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}:\n \n {$participant.role}\n
\n {$event.location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}\n \n {$phone.phone}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {ts}Registered Email{/ts}\n
\n {$contact.email}\n
\n {ts}Registration Date{/ts}\n \n {$participant.register_date|crmDate}\n
\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

\n
\n
\n\n\n\n',1,837,'participant_cancelled',1,0,0,NULL),(36,'Events - Registration Cancellation Notice','{ts 1=$event.event_title}Event Registration Cancelled for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts}Your Event Registration has been cancelled.{/ts}\n\n\n===========================================================\n{ts}Event Information and Location{/ts}\n\n===========================================================\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{ts}Participant Role{/ts}: {$participant.role}\n\n{if $isShowLocation}\n{$event.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $event.location.phone.1.phone || $event.location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$event.location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if}\n{/foreach}\n{foreach from=$event.location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $contact.email}\n\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$contact.email}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$participant.register_date|crmDate}\n{/if}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}Your Event Registration has been cancelled.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $event.location.phone.1.phone || $event.location.email.1.email}\n \n \n \n {foreach from=$event.location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$event.location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $contact.email}\n \n \n \n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}:\n \n {$participant.role}\n
\n {$event.location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}\n \n {$phone.phone}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {ts}Registered Email{/ts}\n
\n {$contact.email}\n
\n {ts}Registration Date{/ts}\n \n {$participant.register_date|crmDate}\n
\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

\n
\n
\n\n\n\n',1,837,'participant_cancelled',0,1,0,NULL),(37,'Events - Registration Confirmation Invite','{ts 1=$event.event_title}Confirm your registration for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts}This is an invitation to complete your registration that was initially waitlisted.{/ts}\n\n{if !$isAdditional and $participant.id}\n\n===========================================================\n{ts}Confirm Your Registration{/ts}\n\n===========================================================\n{capture assign=confirmUrl}{crmURL p=\'civicrm/event/confirm\' q=\"reset=1&participantId=`$participant.id`&cs=`$checksumValue`\" a=true h=0 fe=1}{/capture}\nClick this link to go to a web page where you can confirm your registration online:\n{$confirmUrl}\n{/if}\n{if $event.allow_selfcancelxfer }\n{ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n{ts}Transfer or cancel your registration:{/ts} {$selfService}\n{/if}\n===========================================================\n{ts}Event Information and Location{/ts}\n\n===========================================================\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n{if $conference_sessions}\n\n\n{ts}Your schedule:{/ts}\n{assign var=\'group_by_day\' value=\'NA\'}\n{foreach from=$conference_sessions item=session}\n{if $session.start_date|date_format:\"%Y/%m/%d\" != $group_by_day|date_format:\"%Y/%m/%d\"}\n{assign var=\'group_by_day\' value=$session.start_date}\n\n{$group_by_day|date_format:\"%m/%d/%Y\"}\n\n\n{/if}\n{$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}\n{if $session.location} {$session.location}{/if}\n{/foreach}\n{/if}\n\n\n{ts}Participant Role{/ts}: {$participant.role}\n\n{if $isShowLocation}\n{$event.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $event.location.phone.1.phone || $event.location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$event.location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if}\n{/foreach}\n{foreach from=$event.location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $event.is_public}\n{capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n{ts}Download iCalendar File:{/ts} {$icalFeed}\n{/if}\n\n{if $contact.email}\n\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$contact.email}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$participant.register_date|crmDate}\n{/if}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n \n \n \n\n \n\n \n \n \n {if !$isAdditional and $participant.id}\n \n \n \n \n \n \n {/if}\n {if $event.allow_selfcancelxfer }\n {ts}This event allows for{/ts}\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n {ts}self service cancel or transfer{/ts}\n {/if}\n\n \n \n \n {if $event.allow_selfcancelxfer }\n \n \n \n {/if}\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}This is an invitation to complete your registration that was initially waitlisted.{/ts}

\n
\n {ts}Confirm Your Registration{/ts}\n
\n {capture assign=confirmUrl}{crmURL p=\'civicrm/event/confirm\' q=\"reset=1&participantId=`$participant.id`&cs=`$checksumValue`\" a=true h=0 fe=1}{/capture}\n {ts}Click here to confirm and complete your registration{/ts}\n
\n \n \n \n \n \n \n \n {if $conference_sessions}\n \n \n \n \n \n \n {/if}\n \n \n \n \n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $event.location.phone.1.phone || $event.location.email.1.email}\n \n \n \n {foreach from=$event.location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$event.location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $event.is_public}\n \n \n \n {/if}\n\n {if $contact.email}\n \n \n \n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Your schedule:{/ts}\n
\n {assign var=\'group_by_day\' value=\'NA\'}\n {foreach from=$conference_sessions item=session}\n {if $session.start_date|date_format:\"%Y/%m/%d\" != $group_by_day|date_format:\"%Y/%m/%d\"}\n {assign var=\'group_by_day\' value=$session.start_date}\n {$group_by_day|date_format:\"%m/%d/%Y\"}
\n {/if}\n {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
\n {if $session.location}    {$session.location}
{/if}\n {/foreach}\n
\n {ts}Participant Role{/ts}:\n \n {$participant.role}\n
\n {$event.location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}\n \n {$phone.phone}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n {ts}Download iCalendar File{/ts}\n
\n {ts}Registered Email{/ts}\n
\n {$contact.email}\n
\n {ts}Registration Date{/ts}\n \n {$participant.register_date|crmDate}\n
\n
\n {ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n {ts}Click here to transfer or cancel your registration.{/ts}\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

\n
\n
\n\n\n\n',1,838,'participant_confirm',1,0,0,NULL),(38,'Events - Registration Confirmation Invite','{ts 1=$event.event_title}Confirm your registration for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts}This is an invitation to complete your registration that was initially waitlisted.{/ts}\n\n{if !$isAdditional and $participant.id}\n\n===========================================================\n{ts}Confirm Your Registration{/ts}\n\n===========================================================\n{capture assign=confirmUrl}{crmURL p=\'civicrm/event/confirm\' q=\"reset=1&participantId=`$participant.id`&cs=`$checksumValue`\" a=true h=0 fe=1}{/capture}\nClick this link to go to a web page where you can confirm your registration online:\n{$confirmUrl}\n{/if}\n{if $event.allow_selfcancelxfer }\n{ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n{ts}Transfer or cancel your registration:{/ts} {$selfService}\n{/if}\n===========================================================\n{ts}Event Information and Location{/ts}\n\n===========================================================\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n{if $conference_sessions}\n\n\n{ts}Your schedule:{/ts}\n{assign var=\'group_by_day\' value=\'NA\'}\n{foreach from=$conference_sessions item=session}\n{if $session.start_date|date_format:\"%Y/%m/%d\" != $group_by_day|date_format:\"%Y/%m/%d\"}\n{assign var=\'group_by_day\' value=$session.start_date}\n\n{$group_by_day|date_format:\"%m/%d/%Y\"}\n\n\n{/if}\n{$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}\n{if $session.location} {$session.location}{/if}\n{/foreach}\n{/if}\n\n\n{ts}Participant Role{/ts}: {$participant.role}\n\n{if $isShowLocation}\n{$event.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $event.location.phone.1.phone || $event.location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$event.location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if}\n{/foreach}\n{foreach from=$event.location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $event.is_public}\n{capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n{ts}Download iCalendar File:{/ts} {$icalFeed}\n{/if}\n\n{if $contact.email}\n\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$contact.email}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$participant.register_date|crmDate}\n{/if}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n \n \n \n\n \n\n \n \n \n {if !$isAdditional and $participant.id}\n \n \n \n \n \n \n {/if}\n {if $event.allow_selfcancelxfer }\n {ts}This event allows for{/ts}\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n {ts}self service cancel or transfer{/ts}\n {/if}\n\n \n \n \n {if $event.allow_selfcancelxfer }\n \n \n \n {/if}\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}This is an invitation to complete your registration that was initially waitlisted.{/ts}

\n
\n {ts}Confirm Your Registration{/ts}\n
\n {capture assign=confirmUrl}{crmURL p=\'civicrm/event/confirm\' q=\"reset=1&participantId=`$participant.id`&cs=`$checksumValue`\" a=true h=0 fe=1}{/capture}\n {ts}Click here to confirm and complete your registration{/ts}\n
\n \n \n \n \n \n \n \n {if $conference_sessions}\n \n \n \n \n \n \n {/if}\n \n \n \n \n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $event.location.phone.1.phone || $event.location.email.1.email}\n \n \n \n {foreach from=$event.location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$event.location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $event.is_public}\n \n \n \n {/if}\n\n {if $contact.email}\n \n \n \n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Your schedule:{/ts}\n
\n {assign var=\'group_by_day\' value=\'NA\'}\n {foreach from=$conference_sessions item=session}\n {if $session.start_date|date_format:\"%Y/%m/%d\" != $group_by_day|date_format:\"%Y/%m/%d\"}\n {assign var=\'group_by_day\' value=$session.start_date}\n {$group_by_day|date_format:\"%m/%d/%Y\"}
\n {/if}\n {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
\n {if $session.location}    {$session.location}
{/if}\n {/foreach}\n
\n {ts}Participant Role{/ts}:\n \n {$participant.role}\n
\n {$event.location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}\n \n {$phone.phone}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {capture assign=icalFeed}{crmURL p=\'civicrm/event/ical\' q=\"reset=1&id=`$event.id`\" h=0 a=1 fe=1}{/capture}\n {ts}Download iCalendar File{/ts}\n
\n {ts}Registered Email{/ts}\n
\n {$contact.email}\n
\n {ts}Registration Date{/ts}\n \n {$participant.register_date|crmDate}\n
\n
\n {ts 1=$selfcancelxfer_time 2=$selfservice_preposition}You may transfer your registration to another participant or cancel your registration up to %1 hours %2 the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
\n {capture assign=selfService}{crmURL p=\'civicrm/event/selfsvcupdate\' q=\"reset=1&pid=`$participant.id`&{contact.checksum}\" h=0 a=1 fe=1}{/capture}\n {ts}Click here to transfer or cancel your registration.{/ts}\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

\n
\n
\n\n\n\n',1,838,'participant_confirm',0,1,0,NULL),(39,'Events - Pending Registration Expiration Notice','{ts 1=$event.event_title}Event registration has expired for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$event.event_title}Your pending event registration for %1 has expired\nbecause you did not confirm your registration.{/ts}\n\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor want to inquire about reinstating your registration for this event.{/ts}\n\n===========================================================\n{ts}Event Information and Location{/ts}\n\n===========================================================\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{ts}Participant Role{/ts}: {$participant.role}\n\n{if $isShowLocation}\n{$event.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $event.location.phone.1.phone || $event.location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$event.location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if}\n{/foreach}\n{foreach from=$event.location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $contact.email}\n\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$contact.email}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$participant.register_date|crmDate}\n{/if}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$event.event_title}Your pending event registration for %1 has expired\nbecause you did not confirm your registration.{/ts}

\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor want to inquire about reinstating your registration for this event.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $event.location.phone.1.phone || $event.location.email.1.email}\n \n \n \n {foreach from=$event.location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$event.location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $contact.email}\n \n \n \n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}:\n \n {$participant.role}\n
\n {$event.location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}\n \n {$phone.phone}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {ts}Registered Email{/ts}\n
\n {$contact.email}\n
\n {ts}Registration Date{/ts}\n \n {$participant.register_date|crmDate}\n
\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

\n
\n
\n\n\n\n',1,839,'participant_expired',1,0,0,NULL),(40,'Events - Pending Registration Expiration Notice','{ts 1=$event.event_title}Event registration has expired for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$event.event_title}Your pending event registration for %1 has expired\nbecause you did not confirm your registration.{/ts}\n\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor want to inquire about reinstating your registration for this event.{/ts}\n\n===========================================================\n{ts}Event Information and Location{/ts}\n\n===========================================================\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{ts}Participant Role{/ts}: {$participant.role}\n\n{if $isShowLocation}\n{$event.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $event.location.phone.1.phone || $event.location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$event.location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if}\n{/foreach}\n{foreach from=$event.location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $contact.email}\n\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$contact.email}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$participant.register_date|crmDate}\n{/if}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$event.event_title}Your pending event registration for %1 has expired\nbecause you did not confirm your registration.{/ts}

\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor want to inquire about reinstating your registration for this event.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $event.location.phone.1.phone || $event.location.email.1.email}\n \n \n \n {foreach from=$event.location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$event.location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $contact.email}\n \n \n \n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}:\n \n {$participant.role}\n
\n {$event.location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}\n \n {$phone.phone}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {ts}Registered Email{/ts}\n
\n {$contact.email}\n
\n {ts}Registration Date{/ts}\n \n {$participant.register_date|crmDate}\n
\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

\n
\n
\n\n\n\n',1,839,'participant_expired',0,1,0,NULL),(41,'Events - Registration Transferred Notice','{ts 1=$event.event_title}Event Registration Transferred for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$to_participant}Your Event Registration has been transferred to %1.{/ts}\n\n===========================================================\n{ts}Event Information and Location{/ts}\n\n===========================================================\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{ts}Participant Role{/ts}: {$participant.role}\n\n{if $isShowLocation}\n{$event.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $event.location.phone.1.phone || $event.location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$event.location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if}\n{/foreach}\n{foreach from=$event.location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $contact.email}\n\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$contact.email}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$participant.register_date|crmDate}\n{/if}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$to_participant}Your Event Registration has been Transferred to %1.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $event.location.phone.1.phone || $event.location.email.1.email}\n \n \n \n {foreach from=$event.location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$event.location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $contact.email}\n \n \n \n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}:\n \n {$participant.role}\n
\n {$event.location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}\n \n {$phone.phone}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {ts}Registered Email{/ts}\n
\n {$contact.email}\n
\n {ts}Registration Date{/ts}\n \n {$participant.register_date|crmDate}\n
\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

\n
\n
\n\n\n\n',1,840,'participant_transferred',1,0,0,NULL),(42,'Events - Registration Transferred Notice','{ts 1=$event.event_title}Event Registration Transferred for %1{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$to_participant}Your Event Registration has been transferred to %1.{/ts}\n\n===========================================================\n{ts}Event Information and Location{/ts}\n\n===========================================================\n{$event.event_title}\n{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n\n{ts}Participant Role{/ts}: {$participant.role}\n\n{if $isShowLocation}\n{$event.location.address.1.display|strip_tags:false}\n{/if}{*End of isShowLocation condition*}\n\n{if $event.location.phone.1.phone || $event.location.email.1.email}\n\n{ts}Event Contacts:{/ts}\n{foreach from=$event.location.phone item=phone}\n{if $phone.phone}\n\n{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if}\n{/foreach}\n{foreach from=$event.location.email item=eventEmail}\n{if $eventEmail.email}\n\n{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach}\n{/if}\n\n{if $contact.email}\n\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$contact.email}\n{/if}\n\n{if $register_date}\n{ts}Registration Date{/ts}: {$participant.register_date|crmDate}\n{/if}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$to_participant}Your Event Registration has been Transferred to %1.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n\n {if $isShowLocation}\n \n \n \n {/if}\n\n {if $event.location.phone.1.phone || $event.location.email.1.email}\n \n \n \n {foreach from=$event.location.phone item=phone}\n {if $phone.phone}\n \n \n \n \n {/if}\n {/foreach}\n {foreach from=$event.location.email item=eventEmail}\n {if $eventEmail.email}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $contact.email}\n \n \n \n \n \n \n {/if}\n\n {if $register_date}\n \n \n \n \n {/if}\n\n
\n {ts}Event Information and Location{/ts}\n
\n {$event.event_title}
\n {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:\"%Y%m%d\" == $event.event_start_date|date_format:\"%Y%m%d\"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}\n
\n {ts}Participant Role{/ts}:\n \n {$participant.role}\n
\n {$event.location.address.1.display|nl2br}\n
\n {ts}Event Contacts:{/ts}\n
\n {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}\n \n {$phone.phone}\n
\n {ts}Email{/ts}\n \n {$eventEmail.email}\n
\n {ts}Registered Email{/ts}\n
\n {$contact.email}\n
\n {ts}Registration Date{/ts}\n \n {$participant.register_date|crmDate}\n
\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

\n
\n
\n\n\n\n',1,840,'participant_transferred',0,1,0,NULL),(43,'Tell-a-Friend Email','{ts 1=$senderContactName 2=$title}%1 wants you to know about %2{/ts}\n','{$senderMessage}\n\n{if $generalLink}{ts}For more information, visit:{/ts}\n>> {$generalLink}\n\n{/if}\n{if $contribute}{ts}To make a contribution, go to:{/ts}\n>> {$pageURL}\n\n{/if}\n{if $event}{ts}To find out more about this event, go to:{/ts}\n>> {$pageURL}\n{/if}\n\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n

{$senderMessage}

\n {if $generalLink}\n

{ts}More information{/ts}

\n {/if}\n {if $contribute}\n

{ts}Make a contribution{/ts}

\n {/if}\n {if $event}\n

{ts}Find out more about this event{/ts}

\n {/if}\n
\n
\n\n\n\n',1,841,'friend',1,0,0,NULL),(44,'Tell-a-Friend Email','{ts 1=$senderContactName 2=$title}%1 wants you to know about %2{/ts}\n','{$senderMessage}\n\n{if $generalLink}{ts}For more information, visit:{/ts}\n>> {$generalLink}\n\n{/if}\n{if $contribute}{ts}To make a contribution, go to:{/ts}\n>> {$pageURL}\n\n{/if}\n{if $event}{ts}To find out more about this event, go to:{/ts}\n>> {$pageURL}\n{/if}\n\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n

{$senderMessage}

\n {if $generalLink}\n

{ts}More information{/ts}

\n {/if}\n {if $contribute}\n

{ts}Make a contribution{/ts}

\n {/if}\n {if $event}\n

{ts}Find out more about this event{/ts}

\n {/if}\n
\n
\n\n\n\n',1,841,'friend',0,1,0,NULL),(45,'Memberships - Signup and Renewal Receipts (off-line)','{if $receiptType EQ \'membership signup\'}\n{ts}Membership Confirmation and Receipt{/ts}\n{elseif $receiptType EQ \'membership renewal\'}\n{ts}Membership Renewal Confirmation and Receipt{/ts}\n{/if} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{if $formValues.receipt_text_signup}\n{$formValues.receipt_text_signup}\n{elseif $formValues.receipt_text_renewal}\n{$formValues.receipt_text_renewal}\n{else}{ts}Thank you for this contribution.{/ts}{/if}\n\n{if !$lineItem}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{/if}\n{if ! $cancelled}\n{if !$lineItem}\n{ts}Membership Start Date{/ts}: {$mem_start_date}\n{ts}Membership End Date{/ts}: {$mem_end_date}\n{/if}\n\n{if $formValues.total_amount OR $formValues.total_amount eq 0 }\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if $formValues.contributionType_name}\n{ts}Financial Type{/ts}: {$formValues.contributionType_name}\n{/if}\n{if $lineItem}\n{foreach from=$lineItem item=value key=priceset}\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_total}{ts}Fee{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{/if}\n{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture}\n{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_total|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"} {/if} {$ts_start_date|string_format:\"%20s\"} {$ts_end_date|string_format:\"%20s\"}\n--------------------------------------------------------------------------------------------------\n\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.line_total|crmMoney|string_format:\"%10s\"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {/if} {$line.start_date|string_format:\"%20s\"} {$line.end_date|string_format:\"%20s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset}\n{$taxTerm} {$priceset|string_format:\"%.2f\"} %: {$value|crmMoney:$currency}\n{elseif $priceset == 0}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n--------------------------------------------------------------------------------------------------\n{/if}\n\n{if isset($totalTaxAmount)}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Amount{/ts}: {$formValues.total_amount|crmMoney}\n{if $receive_date}\n{ts}Date Received{/ts}: {$receive_date|truncate:10:\'\'|crmDate}\n{/if}\n{if $formValues.paidBy}\n{ts}Paid By{/ts}: {$formValues.paidBy}\n{if $formValues.check_number}\n{ts}Check Number{/ts}: {$formValues.check_number}\n{/if}\n{/if}\n{/if}\n{/if}\n\n{if $isPrimary }\n{if $billingName}\n\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n{/if}\n\n{if $credit_card_type}\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{/if}\n\n{if $customValues}\n===========================================================\n{ts}Membership Options{/ts}\n\n===========================================================\n{foreach from=$customValues item=value key=customName}\n {$customName} : {$value}\n{/foreach}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n {if $isPrimary}\n \n \n \n {/if}\n\n {if $customValues}\n \n \n \n {/if}\n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $formValues.receipt_text_signup}\n

{$formValues.receipt_text_signup|htmlize}

\n {elseif $formValues.receipt_text_renewal}\n

{$formValues.receipt_text_renewal|htmlize}

\n {else}\n

{ts}Thank you for this contribution.{/ts}

\n {/if}\n
\n \n {if !$lineItem}\n \n \n \n \n \n \n \n {/if}\n {if ! $cancelled}\n {if !$lineItem}\n \n \n \n \n \n \n \n \n {/if}\n {if $formValues.total_amount OR $formValues.total_amount eq 0 }\n \n \n \n {if $formValues.contributionType_name}\n \n \n \n \n {/if}\n\n {if $lineItem}\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n {if $dataArray}\n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset}\n \n \n {elseif $priceset == 0}\n \n \n {/if}\n \n {/foreach}\n {/if}\n {/if}\n {if isset($totalTaxAmount)}\n \n \n \n \n {/if}\n \n \n \n \n {if $receive_date}\n \n \n \n \n {/if}\n {if $formValues.paidBy}\n \n \n \n \n {if $formValues.check_number}\n \n \n \n \n {/if}\n {/if}\n {/if}\n {/if}\n
\n {ts}Membership Information{/ts}\n
\n {ts}Membership Type{/ts}\n \n {$membership_name}\n
\n {ts}Membership Start Date{/ts}\n \n {$mem_start_date}\n
\n {ts}Membership End Date{/ts}\n \n {$mem_end_date}\n
\n {ts}Membership Fee{/ts}\n
\n {ts}Financial Type{/ts}\n \n {$formValues.contributionType_name}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n {if $dataArray}\n \n \n \n \n {/if}\n \n \n \n {foreach from=$value item=line}\n \n \n \n {if $dataArray}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n \n {/if}\n \n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Fee{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Membership Start Date{/ts}{ts}Membership End Date{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.line_total|crmMoney}\n \n {$line.unit_price*$line.qty|crmMoney}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney}\n \n {$line.line_total+$line.tax_amount|crmMoney}\n \n {$line.start_date}\n \n {$line.end_date}\n
\n
\n {ts}Amount Before Tax:{/ts}\n \n {$formValues.total_amount-$totalTaxAmount|crmMoney}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Amount{/ts}\n \n {$formValues.total_amount|crmMoney}\n
\n {ts}Date Received{/ts}\n \n {$receive_date|truncate:10:\'\'|crmDate}\n
\n {ts}Paid By{/ts}\n \n {$formValues.paidBy}\n
\n {ts}Check Number{/ts}\n \n {$formValues.check_number}\n
\n
\n \n\n {if $billingName}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n \n \n \n \n {/if}\n\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}\n
\n {ts}Expires{/ts}\n \n {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
\n
\n \n \n \n \n {foreach from=$customValues item=value key=customName}\n \n \n \n \n {/foreach}\n
\n {ts}Membership Options{/ts}\n
\n {$customName}\n \n {$value}\n
\n
\n
\n\n\n\n',1,842,'membership_offline_receipt',1,0,0,NULL),(46,'Memberships - Signup and Renewal Receipts (off-line)','{if $receiptType EQ \'membership signup\'}\n{ts}Membership Confirmation and Receipt{/ts}\n{elseif $receiptType EQ \'membership renewal\'}\n{ts}Membership Renewal Confirmation and Receipt{/ts}\n{/if} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{if $formValues.receipt_text_signup}\n{$formValues.receipt_text_signup}\n{elseif $formValues.receipt_text_renewal}\n{$formValues.receipt_text_renewal}\n{else}{ts}Thank you for this contribution.{/ts}{/if}\n\n{if !$lineItem}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{/if}\n{if ! $cancelled}\n{if !$lineItem}\n{ts}Membership Start Date{/ts}: {$mem_start_date}\n{ts}Membership End Date{/ts}: {$mem_end_date}\n{/if}\n\n{if $formValues.total_amount OR $formValues.total_amount eq 0 }\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if $formValues.contributionType_name}\n{ts}Financial Type{/ts}: {$formValues.contributionType_name}\n{/if}\n{if $lineItem}\n{foreach from=$lineItem item=value key=priceset}\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_total}{ts}Fee{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{/if}\n{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture}\n{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_total|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"} {/if} {$ts_start_date|string_format:\"%20s\"} {$ts_end_date|string_format:\"%20s\"}\n--------------------------------------------------------------------------------------------------\n\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.line_total|crmMoney|string_format:\"%10s\"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {/if} {$line.start_date|string_format:\"%20s\"} {$line.end_date|string_format:\"%20s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$formValues.total_amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset}\n{$taxTerm} {$priceset|string_format:\"%.2f\"} %: {$value|crmMoney:$currency}\n{elseif $priceset == 0}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n--------------------------------------------------------------------------------------------------\n{/if}\n\n{if isset($totalTaxAmount)}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Amount{/ts}: {$formValues.total_amount|crmMoney}\n{if $receive_date}\n{ts}Date Received{/ts}: {$receive_date|truncate:10:\'\'|crmDate}\n{/if}\n{if $formValues.paidBy}\n{ts}Paid By{/ts}: {$formValues.paidBy}\n{if $formValues.check_number}\n{ts}Check Number{/ts}: {$formValues.check_number}\n{/if}\n{/if}\n{/if}\n{/if}\n\n{if $isPrimary }\n{if $billingName}\n\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n{/if}\n\n{if $credit_card_type}\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n{/if}\n\n{if $customValues}\n===========================================================\n{ts}Membership Options{/ts}\n\n===========================================================\n{foreach from=$customValues item=value key=customName}\n {$customName} : {$value}\n{/foreach}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n {if $isPrimary}\n \n \n \n {/if}\n\n {if $customValues}\n \n \n \n {/if}\n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $formValues.receipt_text_signup}\n

{$formValues.receipt_text_signup|htmlize}

\n {elseif $formValues.receipt_text_renewal}\n

{$formValues.receipt_text_renewal|htmlize}

\n {else}\n

{ts}Thank you for this contribution.{/ts}

\n {/if}\n
\n \n {if !$lineItem}\n \n \n \n \n \n \n \n {/if}\n {if ! $cancelled}\n {if !$lineItem}\n \n \n \n \n \n \n \n \n {/if}\n {if $formValues.total_amount OR $formValues.total_amount eq 0 }\n \n \n \n {if $formValues.contributionType_name}\n \n \n \n \n {/if}\n\n {if $lineItem}\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n {if $dataArray}\n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset}\n \n \n {elseif $priceset == 0}\n \n \n {/if}\n \n {/foreach}\n {/if}\n {/if}\n {if isset($totalTaxAmount)}\n \n \n \n \n {/if}\n \n \n \n \n {if $receive_date}\n \n \n \n \n {/if}\n {if $formValues.paidBy}\n \n \n \n \n {if $formValues.check_number}\n \n \n \n \n {/if}\n {/if}\n {/if}\n {/if}\n
\n {ts}Membership Information{/ts}\n
\n {ts}Membership Type{/ts}\n \n {$membership_name}\n
\n {ts}Membership Start Date{/ts}\n \n {$mem_start_date}\n
\n {ts}Membership End Date{/ts}\n \n {$mem_end_date}\n
\n {ts}Membership Fee{/ts}\n
\n {ts}Financial Type{/ts}\n \n {$formValues.contributionType_name}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n {if $dataArray}\n \n \n \n \n {/if}\n \n \n \n {foreach from=$value item=line}\n \n \n \n {if $dataArray}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n \n {/if}\n \n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Fee{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Membership Start Date{/ts}{ts}Membership End Date{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.line_total|crmMoney}\n \n {$line.unit_price*$line.qty|crmMoney}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney}\n \n {$line.line_total+$line.tax_amount|crmMoney}\n \n {$line.start_date}\n \n {$line.end_date}\n
\n
\n {ts}Amount Before Tax:{/ts}\n \n {$formValues.total_amount-$totalTaxAmount|crmMoney}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Amount{/ts}\n \n {$formValues.total_amount|crmMoney}\n
\n {ts}Date Received{/ts}\n \n {$receive_date|truncate:10:\'\'|crmDate}\n
\n {ts}Paid By{/ts}\n \n {$formValues.paidBy}\n
\n {ts}Check Number{/ts}\n \n {$formValues.check_number}\n
\n
\n \n\n {if $billingName}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n \n \n \n \n {/if}\n\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}\n
\n {ts}Expires{/ts}\n \n {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n
\n
\n \n \n \n \n {foreach from=$customValues item=value key=customName}\n \n \n \n \n {/foreach}\n
\n {ts}Membership Options{/ts}\n
\n {$customName}\n \n {$value}\n
\n
\n
\n\n\n\n',1,842,'membership_offline_receipt',0,1,0,NULL),(47,'Memberships - Receipt (on-line)','{if $is_pay_later}{ts}Invoice{/ts}{else}{ts}Receipt{/ts}{/if} - {$title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{/if}\n\n{if $membership_assign && !$useForMember}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n{/if}\n{if $amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if !$useForMember && $membership_amount && $is_quick_config}\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{if $amount && !$is_separate_payment }\n{ts}Contribution Amount{/ts}: {$amount|crmMoney}\n-------------------------------------------\n{ts}Total{/ts}: {$amount+$membership_amount|crmMoney}\n{/if}\n{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{$line.description|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney|string_format:\"%10s\"} {$line.line_total|crmMoney|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n\n{ts}Total Amount{/ts}: {$amount|crmMoney}\n{else}\n{if $useForMember && $lineItem && !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_total}{ts}Fee{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{/if}\n{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture}\n{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_total|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"} {/if} {$ts_start_date|string_format:\"%20s\"} {$ts_end_date|string_format:\"%20s\"}\n--------------------------------------------------------------------------------------------------\n\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.line_total|crmMoney|string_format:\"%10s\"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {/if} {$line.start_date|string_format:\"%20s\"} {$line.end_date|string_format:\"%20s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n--------------------------------------------------------------------------------------------------\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Amount{/ts}: {$amount|crmMoney} {if $amount_level } - {$amount_level} {/if}\n{/if}\n{elseif $membership_amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{/if}\n\n{if $receive_date}\n\n{ts}Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $is_monetary and $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n\n{/if}\n{if $membership_trx_id}\n{ts}Membership Transaction #{/ts}: {$membership_trx_id}\n\n{/if}\n{if $is_recur}\n{ts}This membership will be renewed automatically.{/ts}\n{if $cancelSubscriptionUrl}\n\n{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page: %1.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n{/if}\n{/if}\n\n{if $honor_block_is_active }\n===========================================================\n{$soft_credit_type}\n===========================================================\n{foreach from=$honoreeProfile item=value key=label}\n{$label}: {$value}\n{/foreach}\n\n{/if}\n{if $pcpBlock}\n===========================================================\n{ts}Personal Campaign Page{/ts}\n\n===========================================================\n{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n\n{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if}\n\n{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if}\n\n{/if}\n{if $onBehalfProfile}\n===========================================================\n{ts}On Behalf Of{/ts}\n\n===========================================================\n{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n{$onBehalfName}: {$onBehalfValue}\n{/foreach}\n{/if}\n\n{if $billingName}\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n{elseif $email}\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$email}\n{/if} {* End billingName or email *}\n{if $credit_card_type}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n\n{if $selectPremium }\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$product_name}\n{if $option}\n{ts}Option{/ts}: {$option}\n{/if}\n{if $sku}\n{ts}SKU{/ts}: {$sku}\n{/if}\n{if $start_date}\n{ts}Start Date{/ts}: {$start_date|crmDate}\n{/if}\n{if $end_date}\n{ts}End Date{/ts}: {$end_date|crmDate}\n{/if}\n{if $contact_email OR $contact_phone}\n\n{ts}For information about this premium, contact:{/ts}\n\n{if $contact_email}\n {$contact_email}\n{/if}\n{if $contact_phone}\n {$contact_phone}\n{/if}\n{/if}\n{if $is_deductible AND $price}\n\n{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if}\n{/if}\n\n{if $customPre}\n===========================================================\n{$customPre_grouptitle}\n\n===========================================================\n{foreach from=$customPre item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n\n\n{if $customPost}\n===========================================================\n{$customPost_grouptitle}\n\n===========================================================\n{foreach from=$customPost item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $receipt_text}\n

{$receipt_text|htmlize}

\n {/if}\n\n {if $is_pay_later}\n

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *}\n {/if}\n\n
\n \n\n {if $membership_assign && !$useForMember}\n \n \n \n \n \n \n \n {if $mem_start_date}\n \n \n \n \n {/if}\n {if $mem_end_date}\n \n \n \n \n {/if}\n {/if}\n\n\n {if $amount}\n \n \n \n\n {if !$useForMember and $membership_amount and $is_quick_config}\n\n \n \n \n \n {if $amount && !$is_separate_payment }\n \n \n \n \n \n \n \n \n {/if}\n\n {elseif !$useForMember && $lineItem and $priceSetID and !$is_quick_config}\n\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n \n \n \n \n\n {else}\n {if $useForMember && $lineItem and !$is_quick_config}\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n {if $dataArray}\n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n {/if}\n {/if}\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n \n \n \n \n\n {/if}\n\n\n {elseif $membership_amount}\n\n\n \n \n \n \n \n \n \n\n\n {/if}\n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $is_monetary and $trxn_id}\n \n \n \n \n {/if}\n\n {if $membership_trx_id}\n \n \n \n \n {/if}\n {if $is_recur}\n \n \n \n {if $updateSubscriptionBillingUrl}\n \n \n \n {/if}\n {/if}\n\n {if $honor_block_is_active}\n \n \n \n {foreach from=$honoreeProfile item=value key=label}\n \n \n \n \n {/foreach}\n {/if}\n\n {if $pcpBlock}\n \n \n \n \n \n \n \n {if $pcp_roll_nickname}\n \n \n \n \n {/if}\n {if $pcp_personal_note}\n \n \n \n \n {/if}\n {/if}\n\n {if $onBehalfProfile}\n \n \n \n {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n \n \n \n \n {/foreach}\n {/if}\n\n {if $billingName}\n \n \n \n \n \n \n {elseif $email}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n {/if}\n\n {if $selectPremium}\n \n \n \n \n \n \n {if $option}\n \n \n \n \n {/if}\n {if $sku}\n \n \n \n \n {/if}\n {if $start_date}\n \n \n \n \n {/if}\n {if $end_date}\n \n \n \n \n {/if}\n {if $contact_email OR $contact_phone}\n \n \n \n {/if}\n {if $is_deductible AND $price}\n \n \n \n {/if}\n {/if}\n\n {if $customPre}\n \n \n \n {foreach from=$customPre item=customValue key=customName}\n {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $customPost}\n \n \n \n {foreach from=$customPost item=customValue key=customName}\n {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n
\n {ts}Membership Information{/ts}\n
\n {ts}Membership Type{/ts}\n \n {$membership_name}\n
\n {ts}Membership Start Date{/ts}\n \n {$mem_start_date|crmDate}\n
\n {ts}Membership End Date{/ts}\n \n {$mem_end_date|crmDate}\n
\n {ts}Membership Fee{/ts}\n
\n {ts 1=$membership_name}%1 Membership{/ts}\n \n {$membership_amount|crmMoney}\n
\n {ts}Contribution Amount{/ts}\n \n {$amount|crmMoney}\n
\n {ts}Total{/ts}\n \n {$amount+$membership_amount|crmMoney}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n \n \n {foreach from=$value item=line}\n \n \n \n \n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Total{/ts}
\n {$line.description|truncate:30:\"...\"}\n \n {$line.qty}\n \n {$line.unit_price|crmMoney}\n \n {$line.line_total|crmMoney}\n
\n
\n {ts}Total Amount{/ts}\n \n {$amount|crmMoney}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n {if $dataArray}\n \n \n \n \n {/if}\n \n \n \n {foreach from=$value item=line}\n \n \n \n {if $dataArray}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n \n {/if}\n \n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Fee{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Membership Start Date{/ts}{ts}Membership End Date{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.line_total|crmMoney}\n \n {$line.unit_price*$line.qty|crmMoney}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney}\n \n {$line.line_total+$line.tax_amount|crmMoney}\n \n {$line.start_date}\n \n {$line.end_date}\n
\n
\n {ts}Amount Before Tax:{/ts}\n \n {$amount-$totalTaxAmount|crmMoney}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}NO{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Amount{/ts}\n \n {$amount|crmMoney} {if $amount_level} - {$amount_level}{/if}\n
\n {ts}Membership Fee{/ts}\n
\n {ts 1=$membership_name}%1 Membership{/ts}\n \n {$membership_amount|crmMoney}\n
\n {ts}Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}Membership Transaction #{/ts}\n \n {$membership_trx_id}\n
\n {ts}This membership will be renewed automatically.{/ts}\n {if $cancelSubscriptionUrl}\n {ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page.{/ts}\n {/if}\n
\n {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n
\n {$soft_credit_type}\n
\n {$label}\n \n {$value}\n
\n {ts}Personal Campaign Page{/ts}\n
\n {ts}Display In Honor Roll{/ts}\n \n {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n
\n {ts}Nickname{/ts}\n \n {$pcp_roll_nickname}\n
\n {ts}Personal Note{/ts}\n \n {$pcp_personal_note}\n
\n {$onBehalfProfile_grouptitle}\n
\n {$onBehalfName}\n \n {$onBehalfValue}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}
\n {$email}\n
\n {ts}Registered Email{/ts}\n
\n {$email}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}
\n
\n {ts}Premium Information{/ts}\n
\n {$product_name}\n
\n {ts}Option{/ts}\n \n {$option}\n
\n {ts}SKU{/ts}\n \n {$sku}\n
\n {ts}Start Date{/ts}\n \n {$start_date|crmDate}\n
\n {ts}End Date{/ts}\n \n {$end_date|crmDate}\n
\n

{ts}For information about this premium, contact:{/ts}

\n {if $contact_email}\n

{$contact_email}

\n {/if}\n {if $contact_phone}\n

{$contact_phone}

\n {/if}\n
\n

{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

\n
\n {$customPre_grouptitle}\n
\n {$customName}\n \n {$customValue}\n
\n {$customPost_grouptitle}\n
\n {$customName}\n \n {$customValue}\n
\n
\n\n\n\n',1,843,'membership_online_receipt',1,0,0,NULL),(48,'Memberships - Receipt (on-line)','{if $is_pay_later}{ts}Invoice{/ts}{else}{ts}Receipt{/ts}{/if} - {$title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n{if $receipt_text}\n{$receipt_text}\n{/if}\n{if $is_pay_later}\n\n===========================================================\n{$pay_later_receipt}\n===========================================================\n{/if}\n\n{if $membership_assign && !$useForMember}\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Type{/ts}: {$membership_name}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n{/if}\n{if $amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{if !$useForMember && $membership_amount && $is_quick_config}\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{if $amount && !$is_separate_payment }\n{ts}Contribution Amount{/ts}: {$amount|crmMoney}\n-------------------------------------------\n{ts}Total{/ts}: {$amount+$membership_amount|crmMoney}\n{/if}\n{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n---------------------------------------------------------\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_qty}{ts}Qty{/ts}{/capture}\n{capture assign=ts_each}{ts}Each{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_qty|string_format:\"%5s\"} {$ts_each|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"}\n----------------------------------------------------------\n{foreach from=$value item=line}\n{$line.description|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.qty|string_format:\"%5s\"} {$line.unit_price|crmMoney|string_format:\"%10s\"} {$line.line_total|crmMoney|string_format:\"%10s\"}\n{/foreach}\n{/foreach}\n\n{ts}Total Amount{/ts}: {$amount|crmMoney}\n{else}\n{if $useForMember && $lineItem && !$is_quick_config}\n{foreach from=$lineItem item=value key=priceset}\n{capture assign=ts_item}{ts}Item{/ts}{/capture}\n{capture assign=ts_total}{ts}Fee{/ts}{/capture}\n{if $dataArray}\n{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture}\n{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture}\n{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture}\n{capture assign=ts_total}{ts}Total{/ts}{/capture}\n{/if}\n{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture}\n{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture}\n{$ts_item|string_format:\"%-30s\"} {$ts_total|string_format:\"%10s\"} {if $dataArray} {$ts_subtotal|string_format:\"%10s\"} {$ts_taxRate|string_format:\"%10s\"} {$ts_taxAmount|string_format:\"%10s\"} {$ts_total|string_format:\"%10s\"} {/if} {$ts_start_date|string_format:\"%20s\"} {$ts_end_date|string_format:\"%20s\"}\n--------------------------------------------------------------------------------------------------\n\n{foreach from=$value item=line}\n{capture assign=ts_item}{if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:\"...\"|string_format:\"%-30s\"} {$line.line_total|crmMoney|string_format:\"%10s\"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:\"%10s\"} {if $line.tax_rate != \"\" || $line.tax_amount != \"\"} {$line.tax_rate|string_format:\"%.2f\"} % {$line.tax_amount|crmMoney:$currency|string_format:\"%10s\"} {else} {/if} {$line.line_total+$line.tax_amount|crmMoney|string_format:\"%10s\"} {/if} {$line.start_date|string_format:\"%20s\"} {$line.end_date|string_format:\"%20s\"}\n{/foreach}\n{/foreach}\n\n{if $dataArray}\n{ts}Amount before Tax{/ts}: {$amount-$totalTaxAmount|crmMoney:$currency}\n\n{foreach from=$dataArray item=value key=priceset}\n{if $priceset || $priceset == 0}\n{$taxTerm} {$priceset|string_format:\"%.2f\"}%: {$value|crmMoney:$currency}\n{else}\n{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency}\n{/if}\n{/foreach}\n{/if}\n--------------------------------------------------------------------------------------------------\n{/if}\n\n{if $totalTaxAmount}\n{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency}\n{/if}\n\n{ts}Amount{/ts}: {$amount|crmMoney} {if $amount_level } - {$amount_level} {/if}\n{/if}\n{elseif $membership_amount}\n===========================================================\n{ts}Membership Fee{/ts}\n\n===========================================================\n{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney}\n{/if}\n\n{if $receive_date}\n\n{ts}Date{/ts}: {$receive_date|crmDate}\n{/if}\n{if $is_monetary and $trxn_id}\n{ts}Transaction #{/ts}: {$trxn_id}\n\n{/if}\n{if $membership_trx_id}\n{ts}Membership Transaction #{/ts}: {$membership_trx_id}\n\n{/if}\n{if $is_recur}\n{ts}This membership will be renewed automatically.{/ts}\n{if $cancelSubscriptionUrl}\n\n{ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page: %1.{/ts}\n\n{/if}\n\n{if $updateSubscriptionBillingUrl}\n\n{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n{/if}\n{/if}\n\n{if $honor_block_is_active }\n===========================================================\n{$soft_credit_type}\n===========================================================\n{foreach from=$honoreeProfile item=value key=label}\n{$label}: {$value}\n{/foreach}\n\n{/if}\n{if $pcpBlock}\n===========================================================\n{ts}Personal Campaign Page{/ts}\n\n===========================================================\n{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n\n{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if}\n\n{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if}\n\n{/if}\n{if $onBehalfProfile}\n===========================================================\n{ts}On Behalf Of{/ts}\n\n===========================================================\n{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n{$onBehalfName}: {$onBehalfValue}\n{/foreach}\n{/if}\n\n{if $billingName}\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n{elseif $email}\n===========================================================\n{ts}Registered Email{/ts}\n\n===========================================================\n{$email}\n{/if} {* End billingName or email *}\n{if $credit_card_type}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n{/if}\n\n{if $selectPremium }\n===========================================================\n{ts}Premium Information{/ts}\n\n===========================================================\n{$product_name}\n{if $option}\n{ts}Option{/ts}: {$option}\n{/if}\n{if $sku}\n{ts}SKU{/ts}: {$sku}\n{/if}\n{if $start_date}\n{ts}Start Date{/ts}: {$start_date|crmDate}\n{/if}\n{if $end_date}\n{ts}End Date{/ts}: {$end_date|crmDate}\n{/if}\n{if $contact_email OR $contact_phone}\n\n{ts}For information about this premium, contact:{/ts}\n\n{if $contact_email}\n {$contact_email}\n{/if}\n{if $contact_phone}\n {$contact_phone}\n{/if}\n{/if}\n{if $is_deductible AND $price}\n\n{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if}\n{/if}\n\n{if $customPre}\n===========================================================\n{$customPre_grouptitle}\n\n===========================================================\n{foreach from=$customPre item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n\n\n{if $customPost}\n===========================================================\n{$customPost_grouptitle}\n\n===========================================================\n{foreach from=$customPost item=customValue key=customName}\n{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}\n {$customName}: {$customValue}\n{/if}\n{/foreach}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n {if $receipt_text}\n

{$receipt_text|htmlize}

\n {/if}\n\n {if $is_pay_later}\n

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *}\n {/if}\n\n
\n \n\n {if $membership_assign && !$useForMember}\n \n \n \n \n \n \n \n {if $mem_start_date}\n \n \n \n \n {/if}\n {if $mem_end_date}\n \n \n \n \n {/if}\n {/if}\n\n\n {if $amount}\n \n \n \n\n {if !$useForMember and $membership_amount and $is_quick_config}\n\n \n \n \n \n {if $amount && !$is_separate_payment }\n \n \n \n \n \n \n \n \n {/if}\n\n {elseif !$useForMember && $lineItem and $priceSetID and !$is_quick_config}\n\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n \n \n \n \n\n {else}\n {if $useForMember && $lineItem and !$is_quick_config}\n {foreach from=$lineItem item=value key=priceset}\n \n \n \n {/foreach}\n {if $dataArray}\n \n \n \n \n {foreach from=$dataArray item=value key=priceset}\n \n {if $priceset || $priceset == 0}\n \n \n {else}\n \n \n {/if}\n \n {/foreach}\n {/if}\n {/if}\n {if $totalTaxAmount}\n \n \n \n \n {/if}\n \n \n \n \n\n {/if}\n\n\n {elseif $membership_amount}\n\n\n \n \n \n \n \n \n \n\n\n {/if}\n\n {if $receive_date}\n \n \n \n \n {/if}\n\n {if $is_monetary and $trxn_id}\n \n \n \n \n {/if}\n\n {if $membership_trx_id}\n \n \n \n \n {/if}\n {if $is_recur}\n \n \n \n {if $updateSubscriptionBillingUrl}\n \n \n \n {/if}\n {/if}\n\n {if $honor_block_is_active}\n \n \n \n {foreach from=$honoreeProfile item=value key=label}\n \n \n \n \n {/foreach}\n {/if}\n\n {if $pcpBlock}\n \n \n \n \n \n \n \n {if $pcp_roll_nickname}\n \n \n \n \n {/if}\n {if $pcp_personal_note}\n \n \n \n \n {/if}\n {/if}\n\n {if $onBehalfProfile}\n \n \n \n {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName}\n \n \n \n \n {/foreach}\n {/if}\n\n {if $billingName}\n \n \n \n \n \n \n {elseif $email}\n \n \n \n \n \n \n {/if}\n\n {if $credit_card_type}\n \n \n \n \n \n \n {/if}\n\n {if $selectPremium}\n \n \n \n \n \n \n {if $option}\n \n \n \n \n {/if}\n {if $sku}\n \n \n \n \n {/if}\n {if $start_date}\n \n \n \n \n {/if}\n {if $end_date}\n \n \n \n \n {/if}\n {if $contact_email OR $contact_phone}\n \n \n \n {/if}\n {if $is_deductible AND $price}\n \n \n \n {/if}\n {/if}\n\n {if $customPre}\n \n \n \n {foreach from=$customPre item=customValue key=customName}\n {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n {if $customPost}\n \n \n \n {foreach from=$customPost item=customValue key=customName}\n {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields}\n \n \n \n \n {/if}\n {/foreach}\n {/if}\n\n
\n {ts}Membership Information{/ts}\n
\n {ts}Membership Type{/ts}\n \n {$membership_name}\n
\n {ts}Membership Start Date{/ts}\n \n {$mem_start_date|crmDate}\n
\n {ts}Membership End Date{/ts}\n \n {$mem_end_date|crmDate}\n
\n {ts}Membership Fee{/ts}\n
\n {ts 1=$membership_name}%1 Membership{/ts}\n \n {$membership_amount|crmMoney}\n
\n {ts}Contribution Amount{/ts}\n \n {$amount|crmMoney}\n
\n {ts}Total{/ts}\n \n {$amount+$membership_amount|crmMoney}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n \n \n \n {foreach from=$value item=line}\n \n \n \n \n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Total{/ts}
\n {$line.description|truncate:30:\"...\"}\n \n {$line.qty}\n \n {$line.unit_price|crmMoney}\n \n {$line.line_total|crmMoney}\n
\n
\n {ts}Total Amount{/ts}\n \n {$amount|crmMoney}\n
\n {* FIXME: style this table so that it looks like the text version (justification, etc.) *}\n \n \n \n {if $dataArray}\n \n \n \n \n {/if}\n \n \n \n {foreach from=$value item=line}\n \n \n \n {if $dataArray}\n \n {if $line.tax_rate != \"\" || $line.tax_amount != \"\"}\n \n \n {else}\n \n \n {/if}\n \n {/if}\n \n \n \n {/foreach}\n
{ts}Item{/ts}{ts}Fee{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Membership Start Date{/ts}{ts}Membership End Date{/ts}
\n {if $line.html_type eq \'Text\'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:\"...\"}
{/if}\n
\n {$line.line_total|crmMoney}\n \n {$line.unit_price*$line.qty|crmMoney}\n \n {$line.tax_rate|string_format:\"%.2f\"}%\n \n {$line.tax_amount|crmMoney}\n \n {$line.line_total+$line.tax_amount|crmMoney}\n \n {$line.start_date}\n \n {$line.end_date}\n
\n
\n {ts}Amount Before Tax:{/ts}\n \n {$amount-$totalTaxAmount|crmMoney}\n
 {$taxTerm} {$priceset|string_format:\"%.2f\"}% {$value|crmMoney:$currency} {ts}NO{/ts} {$taxTerm} {$value|crmMoney:$currency}
\n {ts}Total Tax Amount{/ts}\n \n {$totalTaxAmount|crmMoney:$currency}\n
\n {ts}Amount{/ts}\n \n {$amount|crmMoney} {if $amount_level} - {$amount_level}{/if}\n
\n {ts}Membership Fee{/ts}\n
\n {ts 1=$membership_name}%1 Membership{/ts}\n \n {$membership_amount|crmMoney}\n
\n {ts}Date{/ts}\n \n {$receive_date|crmDate}\n
\n {ts}Transaction #{/ts}\n \n {$trxn_id}\n
\n {ts}Membership Transaction #{/ts}\n \n {$membership_trx_id}\n
\n {ts}This membership will be renewed automatically.{/ts}\n {if $cancelSubscriptionUrl}\n {ts 1=$cancelSubscriptionUrl}You can cancel the auto-renewal option by visiting this web page.{/ts}\n {/if}\n
\n {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts}\n
\n {$soft_credit_type}\n
\n {$label}\n \n {$value}\n
\n {ts}Personal Campaign Page{/ts}\n
\n {ts}Display In Honor Roll{/ts}\n \n {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}\n
\n {ts}Nickname{/ts}\n \n {$pcp_roll_nickname}\n
\n {ts}Personal Note{/ts}\n \n {$pcp_personal_note}\n
\n {$onBehalfProfile_grouptitle}\n
\n {$onBehalfName}\n \n {$onBehalfValue}\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}
\n {$email}\n
\n {ts}Registered Email{/ts}\n
\n {$email}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}
\n
\n {ts}Premium Information{/ts}\n
\n {$product_name}\n
\n {ts}Option{/ts}\n \n {$option}\n
\n {ts}SKU{/ts}\n \n {$sku}\n
\n {ts}Start Date{/ts}\n \n {$start_date|crmDate}\n
\n {ts}End Date{/ts}\n \n {$end_date|crmDate}\n
\n

{ts}For information about this premium, contact:{/ts}

\n {if $contact_email}\n

{$contact_email}

\n {/if}\n {if $contact_phone}\n

{$contact_phone}

\n {/if}\n
\n

{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

\n
\n {$customPre_grouptitle}\n
\n {$customName}\n \n {$customValue}\n
\n {$customPost_grouptitle}\n
\n {$customName}\n \n {$customValue}\n
\n
\n\n\n\n',1,843,'membership_online_receipt',0,1,0,NULL),(49,'Memberships - Auto-renew Cancellation Notification','{ts}Autorenew Membership Cancellation Notification{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$membershipType}The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.{/ts}\n\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Status{/ts}: {$membership_status}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$membershipType}The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.{/ts}

\n\n
\n \n\n \n \n \n \n \n \n \n {if $mem_start_date}\n \n \n \n \n {/if}\n {if $mem_end_date}\n \n \n \n \n {/if}\n\n
\n {ts}Membership Information{/ts}\n
\n {ts}Membership Status{/ts}\n \n {$membership_status}\n
\n {ts}Membership Start Date{/ts}\n \n {$mem_start_date|crmDate}\n
\n {ts}Membership End Date{/ts}\n \n {$mem_end_date|crmDate}\n
\n
\n\n\n\n',1,844,'membership_autorenew_cancelled',1,0,0,NULL),(50,'Memberships - Auto-renew Cancellation Notification','{ts}Autorenew Membership Cancellation Notification{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$membershipType}The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.{/ts}\n\n===========================================================\n{ts}Membership Information{/ts}\n\n===========================================================\n{ts}Membership Status{/ts}: {$membership_status}\n{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate}\n{/if}\n{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate}\n{/if}\n\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$membershipType}The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.{/ts}

\n\n
\n \n\n \n \n \n \n \n \n \n {if $mem_start_date}\n \n \n \n \n {/if}\n {if $mem_end_date}\n \n \n \n \n {/if}\n\n
\n {ts}Membership Information{/ts}\n
\n {ts}Membership Status{/ts}\n \n {$membership_status}\n
\n {ts}Membership Start Date{/ts}\n \n {$mem_start_date|crmDate}\n
\n {ts}Membership End Date{/ts}\n \n {$mem_end_date|crmDate}\n
\n
\n\n\n\n',1,844,'membership_autorenew_cancelled',0,1,0,NULL),(51,'Memberships - Auto-renew Billing Updates','{ts}Membership Autorenewal Billing Updates{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$membershipType}Billing details for your automatically renewed %1 membership have been updated.{/ts}\n\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n\n\n{ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$membershipType}Billing details for your automatically renewed %1 membership have been updated.{/ts}

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}
\n {$email}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}
\n
\n {ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}\n
\n
\n\n\n\n',1,845,'membership_autorenew_billing',1,0,0,NULL),(52,'Memberships - Auto-renew Billing Updates','{ts}Membership Autorenewal Billing Updates{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$membershipType}Billing details for your automatically renewed %1 membership have been updated.{/ts}\n\n===========================================================\n{ts}Billing Name and Address{/ts}\n\n===========================================================\n{$billingName}\n{$address}\n\n{$email}\n\n===========================================================\n{ts}Credit Card Information{/ts}\n\n===========================================================\n{$credit_card_type}\n{$credit_card_number}\n{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}\n\n\n{ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$membershipType}Billing details for your automatically renewed %1 membership have been updated.{/ts}

\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n
\n {ts}Billing Name and Address{/ts}\n
\n {$billingName}
\n {$address|nl2br}
\n {$email}\n
\n {ts}Credit Card Information{/ts}\n
\n {$credit_card_type}
\n {$credit_card_number}
\n {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:\'\'|crmDate}
\n
\n {ts 1=$receipt_from_email}If you have questions please contact us at %1{/ts}\n
\n
\n\n\n\n',1,845,'membership_autorenew_billing',0,1,0,NULL),(53,'Test-drive - Receipt Header','[TEST]\n','***********************************************************\n\n{ts}Test-drive Email / Receipt{/ts}\n\n{ts}This is a test-drive email. No live financial transaction has occurred.{/ts}\n\n***********************************************************\n','
\n \n \n \n \n
\n

{ts}Test-drive Email / Receipt{/ts}

\n

{ts}This is a test-drive email. No live financial transaction has occurred.{/ts}

\n
\n
\n',1,846,'test_preview',1,0,0,NULL),(54,'Test-drive - Receipt Header','[TEST]\n','***********************************************************\n\n{ts}Test-drive Email / Receipt{/ts}\n\n{ts}This is a test-drive email. No live financial transaction has occurred.{/ts}\n\n***********************************************************\n','
\n \n \n \n \n
\n

{ts}Test-drive Email / Receipt{/ts}

\n

{ts}This is a test-drive email. No live financial transaction has occurred.{/ts}

\n
\n
\n',1,846,'test_preview',0,1,0,NULL),(55,'Pledges - Acknowledgement','{ts}Thank you for your Pledge{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n{ts}Thank you for your generous pledge.{/ts}\n\n===========================================================\n{ts}Pledge Information{/ts}\n\n===========================================================\n{ts}Pledge Received{/ts}: {$create_date|truncate:10:\'\'|crmDate}\n{ts}Total Pledge Amount{/ts}: {$total_pledge_amount|crmMoney:$currency}\n\n===========================================================\n{ts}Payment Schedule{/ts}\n\n===========================================================\n{ts 1=$scheduled_amount|crmMoney:$currency 2=$frequency_interval 3=$frequency_unit 4=$installments}%1 every %2 %3 for %4 installments.{/ts}\n\n{if $frequency_day}\n\n{ts 1=$frequency_day 2=$frequency_unit}Payments are due on day %1 of the %2.{/ts}\n{/if}\n\n{if $payments}\n{assign var=\"count\" value=\"1\"}\n{foreach from=$payments item=payment}\n\n{ts 1=$count}Payment %1{/ts}: {$payment.amount|crmMoney:$currency} {if $payment.status eq 1}{ts}paid{/ts} {$payment.receive_date|truncate:10:\'\'|crmDate}{else}{ts}due{/ts} {$payment.due_date|truncate:10:\'\'|crmDate}{/if}\n{assign var=\"count\" value=`$count+1`}\n{/foreach}\n{/if}\n\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor need to modify your payment schedule.{/ts}\n\n{if $customGroup}\n{foreach from=$customGroup item=value key=customName}\n===========================================================\n{$customName}\n===========================================================\n{foreach from=$value item=v key=n}\n{$n}: {$v}\n{/foreach}\n{/foreach}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}Thank you for your generous pledge.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n {if $payments}\n {assign var=\"count\" value=\"1\"}\n {foreach from=$payments item=payment}\n \n \n \n \n {assign var=\"count\" value=`$count+1`}\n {/foreach}\n {/if}\n\n \n \n \n\n {if $customGroup}\n {foreach from=$customGroup item=value key=customName}\n \n \n \n {foreach from=$value item=v key=n}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n
\n {ts}Pledge Information{/ts}\n
\n {ts}Pledge Received{/ts}\n \n {$create_date|truncate:10:\'\'|crmDate}\n
\n {ts}Total Pledge Amount{/ts}\n \n {$total_pledge_amount|crmMoney:$currency}\n
\n {ts}Payment Schedule{/ts}\n
\n

{ts 1=$scheduled_amount|crmMoney:$currency 2=$frequency_interval 3=$frequency_unit 4=$installments}%1 every %2 %3 for %4 installments.{/ts}

\n\n {if $frequency_day}\n

{ts 1=$frequency_day 2=$frequency_unit}Payments are due on day %1 of the %2.{/ts}

\n {/if}\n
\n {ts 1=$count}Payment %1{/ts}\n \n {$payment.amount|crmMoney:$currency} {if $payment.status eq 1}{ts}paid{/ts} {$payment.receive_date|truncate:10:\'\'|crmDate}{else}{ts}due{/ts} {$payment.due_date|truncate:10:\'\'|crmDate}{/if}\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor need to modify your payment schedule.{/ts}

\n
\n {$customName}\n
\n {$n}\n \n {$v}\n
\n
\n
\n\n\n\n',1,847,'pledge_acknowledge',1,0,0,NULL),(56,'Pledges - Acknowledgement','{ts}Thank you for your Pledge{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n{ts}Thank you for your generous pledge.{/ts}\n\n===========================================================\n{ts}Pledge Information{/ts}\n\n===========================================================\n{ts}Pledge Received{/ts}: {$create_date|truncate:10:\'\'|crmDate}\n{ts}Total Pledge Amount{/ts}: {$total_pledge_amount|crmMoney:$currency}\n\n===========================================================\n{ts}Payment Schedule{/ts}\n\n===========================================================\n{ts 1=$scheduled_amount|crmMoney:$currency 2=$frequency_interval 3=$frequency_unit 4=$installments}%1 every %2 %3 for %4 installments.{/ts}\n\n{if $frequency_day}\n\n{ts 1=$frequency_day 2=$frequency_unit}Payments are due on day %1 of the %2.{/ts}\n{/if}\n\n{if $payments}\n{assign var=\"count\" value=\"1\"}\n{foreach from=$payments item=payment}\n\n{ts 1=$count}Payment %1{/ts}: {$payment.amount|crmMoney:$currency} {if $payment.status eq 1}{ts}paid{/ts} {$payment.receive_date|truncate:10:\'\'|crmDate}{else}{ts}due{/ts} {$payment.due_date|truncate:10:\'\'|crmDate}{/if}\n{assign var=\"count\" value=`$count+1`}\n{/foreach}\n{/if}\n\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor need to modify your payment schedule.{/ts}\n\n{if $customGroup}\n{foreach from=$customGroup item=value key=customName}\n===========================================================\n{$customName}\n===========================================================\n{foreach from=$value item=v key=n}\n{$n}: {$v}\n{/foreach}\n{/foreach}\n{/if}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts}Thank you for your generous pledge.{/ts}

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n {if $payments}\n {assign var=\"count\" value=\"1\"}\n {foreach from=$payments item=payment}\n \n \n \n \n {assign var=\"count\" value=`$count+1`}\n {/foreach}\n {/if}\n\n \n \n \n\n {if $customGroup}\n {foreach from=$customGroup item=value key=customName}\n \n \n \n {foreach from=$value item=v key=n}\n \n \n \n \n {/foreach}\n {/foreach}\n {/if}\n\n
\n {ts}Pledge Information{/ts}\n
\n {ts}Pledge Received{/ts}\n \n {$create_date|truncate:10:\'\'|crmDate}\n
\n {ts}Total Pledge Amount{/ts}\n \n {$total_pledge_amount|crmMoney:$currency}\n
\n {ts}Payment Schedule{/ts}\n
\n

{ts 1=$scheduled_amount|crmMoney:$currency 2=$frequency_interval 3=$frequency_unit 4=$installments}%1 every %2 %3 for %4 installments.{/ts}

\n\n {if $frequency_day}\n

{ts 1=$frequency_day 2=$frequency_unit}Payments are due on day %1 of the %2.{/ts}

\n {/if}\n
\n {ts 1=$count}Payment %1{/ts}\n \n {$payment.amount|crmMoney:$currency} {if $payment.status eq 1}{ts}paid{/ts} {$payment.receive_date|truncate:10:\'\'|crmDate}{else}{ts}due{/ts} {$payment.due_date|truncate:10:\'\'|crmDate}{/if}\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor need to modify your payment schedule.{/ts}

\n
\n {$customName}\n
\n {$n}\n \n {$v}\n
\n
\n
\n\n\n\n',1,847,'pledge_acknowledge',0,1,0,NULL),(57,'Pledges - Payment Reminder','{ts}Pledge Payment Reminder{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$next_payment|truncate:10:\'\'|crmDate}This is a reminder that the next payment on your pledge is due on %1.{/ts}\n\n===========================================================\n{ts}Payment Due{/ts}\n\n===========================================================\n{ts}Amount Due{/ts}: {$amount_due|crmMoney:$currency}\n{ts}Due Date{/ts}: {$scheduled_payment_date|truncate:10:\'\'|crmDate}\n\n{if $contribution_page_id}\n{capture assign=contributionUrl}{crmURL p=\'civicrm/contribute/transact\' q=\"reset=1&id=`$contribution_page_id`&cid=`$contact.contact_id`&pledgeId=`$pledge_id`&cs=`$checksumValue`\" a=true h=0}{/capture}\nClick this link to go to a web page where you can make your payment online:\n{$contributionUrl}\n{else}\n{ts}Please mail your payment to{/ts}:\n{$domain.address}\n{/if}\n\n===========================================================\n{ts}Pledge Information{/ts}\n\n===========================================================\n{ts}Pledge Received{/ts}: {$create_date|truncate:10:\'\'|crmDate}\n{ts}Total Pledge Amount{/ts}: {$amount|crmMoney:$currency}\n{ts}Total Paid{/ts}: {$amount_paid|crmMoney:$currency}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor need to modify your payment schedule.{/ts}\n\n\n{ts}Thank your for your generous support.{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$next_payment|truncate:10:\'\'|crmDate}This is a reminder that the next payment on your pledge is due on %1.{/ts}

\n
\n \n \n \n \n \n \n \n \n
\n {ts}Payment Due{/ts}\n
\n {ts}Amount Due{/ts}\n \n {$amount_due|crmMoney:$currency}\n
\n
\n {if $contribution_page_id}\n {capture assign=contributionUrl}{crmURL p=\'civicrm/contribute/transact\' q=\"reset=1&id=`$contribution_page_id`&cid=`$contact.contact_id`&pledgeId=`$pledge_id`&cs=`$checksumValue`\" a=true h=0}{/capture}\n

{ts}Go to a web page where you can make your payment online{/ts}

\n {else}\n

{ts}Please mail your payment to{/ts}: {$domain.address}

\n {/if}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts}Pledge Information{/ts}\n
\n {ts}Pledge Received{/ts}\n \n {$create_date|truncate:10:\'\'|crmDate}\n
\n {ts}Total Pledge Amount{/ts}\n \n {$amount|crmMoney:$currency}\n
\n {ts}Total Paid{/ts}\n \n {$amount_paid|crmMoney:$currency}\n
\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor need to modify your payment schedule.{/ts}

\n

{ts}Thank your for your generous support.{/ts}

\n
\n
\n\n\n\n',1,848,'pledge_reminder',1,0,0,NULL),(58,'Pledges - Payment Reminder','{ts}Pledge Payment Reminder{/ts} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\n{ts 1=$next_payment|truncate:10:\'\'|crmDate}This is a reminder that the next payment on your pledge is due on %1.{/ts}\n\n===========================================================\n{ts}Payment Due{/ts}\n\n===========================================================\n{ts}Amount Due{/ts}: {$amount_due|crmMoney:$currency}\n{ts}Due Date{/ts}: {$scheduled_payment_date|truncate:10:\'\'|crmDate}\n\n{if $contribution_page_id}\n{capture assign=contributionUrl}{crmURL p=\'civicrm/contribute/transact\' q=\"reset=1&id=`$contribution_page_id`&cid=`$contact.contact_id`&pledgeId=`$pledge_id`&cs=`$checksumValue`\" a=true h=0}{/capture}\nClick this link to go to a web page where you can make your payment online:\n{$contributionUrl}\n{else}\n{ts}Please mail your payment to{/ts}:\n{$domain.address}\n{/if}\n\n===========================================================\n{ts}Pledge Information{/ts}\n\n===========================================================\n{ts}Pledge Received{/ts}: {$create_date|truncate:10:\'\'|crmDate}\n{ts}Total Pledge Amount{/ts}: {$amount|crmMoney:$currency}\n{ts}Total Paid{/ts}: {$amount_paid|crmMoney:$currency}\n\n{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor need to modify your payment schedule.{/ts}\n\n\n{ts}Thank your for your generous support.{/ts}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n
\n {assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n

{ts 1=$next_payment|truncate:10:\'\'|crmDate}This is a reminder that the next payment on your pledge is due on %1.{/ts}

\n
\n \n \n \n \n \n \n \n \n
\n {ts}Payment Due{/ts}\n
\n {ts}Amount Due{/ts}\n \n {$amount_due|crmMoney:$currency}\n
\n
\n {if $contribution_page_id}\n {capture assign=contributionUrl}{crmURL p=\'civicrm/contribute/transact\' q=\"reset=1&id=`$contribution_page_id`&cid=`$contact.contact_id`&pledgeId=`$pledge_id`&cs=`$checksumValue`\" a=true h=0}{/capture}\n

{ts}Go to a web page where you can make your payment online{/ts}

\n {else}\n

{ts}Please mail your payment to{/ts}: {$domain.address}

\n {/if}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n {ts}Pledge Information{/ts}\n
\n {ts}Pledge Received{/ts}\n \n {$create_date|truncate:10:\'\'|crmDate}\n
\n {ts}Total Pledge Amount{/ts}\n \n {$amount|crmMoney:$currency}\n
\n {ts}Total Paid{/ts}\n \n {$amount_paid|crmMoney:$currency}\n
\n
\n

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions\nor need to modify your payment schedule.{/ts}

\n

{ts}Thank your for your generous support.{/ts}

\n
\n
\n\n\n\n',1,848,'pledge_reminder',0,1,0,NULL),(59,'Profiles - Admin Notification','{$grouptitle} {ts 1=$displayName}Submitted by %1{/ts} - {contact.display_name}\n','{ts}Submitted For:{/ts} {$displayName}\n{ts}Date:{/ts} {$currentDate}\n{ts}Contact Summary:{/ts} {$contactLink}\n\n===========================================================\n{$grouptitle}\n\n===========================================================\n{foreach from=$values item=value key=valueName}\n{$valueName}: {$value}\n{/foreach}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n {foreach from=$values item=value key=valueName}\n \n \n \n \n {/foreach}\n
\n {ts}Submitted For{/ts}\n \n {$displayName}\n
\n {ts}Date{/ts}\n \n {$currentDate}\n
\n {ts}Contact Summary{/ts}\n \n {$contactLink}\n
\n {$grouptitle}\n
\n {$valueName}\n \n {$value}\n
\n
\n
\n\n\n\n',1,849,'uf_notify',1,0,0,NULL),(60,'Profiles - Admin Notification','{$grouptitle} {ts 1=$displayName}Submitted by %1{/ts} - {contact.display_name}\n','{ts}Submitted For:{/ts} {$displayName}\n{ts}Date:{/ts} {$currentDate}\n{ts}Contact Summary:{/ts} {$contactLink}\n\n===========================================================\n{$grouptitle}\n\n===========================================================\n{foreach from=$values item=value key=valueName}\n{$valueName}: {$value}\n{/foreach}\n','\n\n\n \n \n\n\n\n{capture assign=headerStyle}colspan=\"2\" style=\"text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;\"{/capture}\n{capture assign=labelStyle }style=\"padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;\"{/capture}\n{capture assign=valueStyle }style=\"padding: 4px; border-bottom: 1px solid #999;\"{/capture}\n\n
\n \n\n \n \n \n\n \n\n \n \n \n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n {foreach from=$values item=value key=valueName}\n \n \n \n \n {/foreach}\n
\n {ts}Submitted For{/ts}\n \n {$displayName}\n
\n {ts}Date{/ts}\n \n {$currentDate}\n
\n {ts}Contact Summary{/ts}\n \n {$contactLink}\n
\n {$grouptitle}\n
\n {$valueName}\n \n {$value}\n
\n
\n
\n\n\n\n',1,849,'uf_notify',0,1,0,NULL),(61,'Petition - signature added','Thank you for signing {$petition.title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\nThank you for signing {$petition.title}.\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n

Thank you for signing {$petition.title}.

\n\n{include file=\"CRM/Campaign/Page/Petition/SocialNetwork.tpl\" petition_id=$survey_id noscript=true emailMode=true}\n',1,850,'petition_sign',1,0,0,NULL),(62,'Petition - signature added','Thank you for signing {$petition.title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\nThank you for signing {$petition.title}.\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n

Thank you for signing {$petition.title}.

\n\n{include file=\"CRM/Campaign/Page/Petition/SocialNetwork.tpl\" petition_id=$survey_id noscript=true emailMode=true}\n',1,850,'petition_sign',0,1,0,NULL),(63,'Petition - need verification','Confirmation of signature needed for {$petition.title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\nThank you for signing {$petition.title}.\n\nIn order to complete your signature, we must confirm your e-mail.\nPlease do so by visiting the following email confirmation web page:\n\n{$petition.confirmUrlPlainText}\n\nIf you did not sign this petition, please ignore this message.\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n

Thank you for signing {$petition.title}.

\n\n

In order to complete your signature, we must confirm your e-mail.\n
\nPlease do so by visiting the following web page by clicking\non the link below or pasting the link into your browser.\n

\nEmail confirmation page: {$petition.confirmUrl}

\n\n

If you did not sign this petition, please ignore this message.

\n',1,851,'petition_confirmation_needed',1,0,0,NULL),(64,'Petition - need verification','Confirmation of signature needed for {$petition.title} - {contact.display_name}\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}{$greeting},{/if}\n\nThank you for signing {$petition.title}.\n\nIn order to complete your signature, we must confirm your e-mail.\nPlease do so by visiting the following email confirmation web page:\n\n{$petition.confirmUrlPlainText}\n\nIf you did not sign this petition, please ignore this message.\n','{assign var=\"greeting\" value=\"{contact.email_greeting}\"}{if $greeting}

{$greeting},

{/if}\n\n

Thank you for signing {$petition.title}.

\n\n

In order to complete your signature, we must confirm your e-mail.\n
\nPlease do so by visiting the following web page by clicking\non the link below or pasting the link into your browser.\n

\nEmail confirmation page: {$petition.confirmUrl}

\n\n

If you did not sign this petition, please ignore this message.

\n',1,851,'petition_confirmation_needed',0,1,0,NULL),(65,'Sample CiviMail Newsletter Template','Sample CiviMail Newsletter','','\n\n\n \n \n\n\n\n\n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \"Replace\n    \n Your Newsletter Title\n
\n
\n \n \n \n \n \n
\n \n Greetings {contact.display_name},\n

\n This is a sample template designed to help you get started creating and sending your own CiviMail messages. This template uses an HTML layout that is generally compatible with the wide variety of email clients that your recipients might be using (e.g. Gmail, Outlook, Yahoo, etc.).\n

You can select this \"Sample CiviMail Newsletter Template\" from the \"Use Template\" drop-down in Step 3 of creating a mailing, and customize it to your needs. Then check the \"Save as New Template\" box on the bottom the page to save your customized version for use in future mailings.\n

The logo you use must be uploaded to your server. Copy and paste the URL path to the logo into the <img src= tag in the HTML at the top. Click \"Source\" or the Image button if you are using the text editor.\n

\n Edit the color of the links and headers using the color button or by editing the HTML.\n

\n Your newsletter message and donation appeal can go here. Click the link button to create links - remember to use a fully qualified URL starting with http:// in all your links!\n

\n To use CiviMail:\n \n Sincerely,\n

\n Your Team\n

\n
\n
\n
\n \n \n \n \n \n \n \n \n
News and Events
\n \n Featured Events
\n Fundraising Dinner
\n Training Meeting
\n Board of Directors Annual Meeting
\n\n

\n Community Events
\n Bake Sale
\n Charity Auction
\n Art Exhibit
\n\n

\n Important Dates
\n Tuesday August 27
\n Wednesday September 8
\n Thursday September 29
\n Saturday October 1
\n Sunday October 20
\n
\n
\n
\n \n \n \n \n
\n \n Helpful Tips\n

\n Tokens
\n Click \"Insert Tokens\" to dynamically insert names, addresses, and other contact data of your recipients.\n

\n Plain Text Version
\n Some people refuse HTML emails altogether. We recommend sending a plain-text version of your important communications to accommodate them. Luckily, CiviCRM accommodates for this! Just click \"Plain Text\" and copy and paste in some text. Line breaks (carriage returns) and fully qualified URLs like http://www.example.com are all you get, no HTML here!\n

\n Play by the Rules
\n The address of the sender is required by the Can Spam Act law. This is an available token called domain.address. An unsubscribe or opt-out link is also required. There are several available tokens for this. {action.optOutUrl} creates a link for recipients to click if they want to opt out of receiving emails from your organization. {action.unsubscribeUrl} creates a link to unsubscribe from the specific mailing list used to send this message. Click on \"Insert Tokens\" to find these and look for tokens named \"Domain\" or \"Unsubscribe\". This sample template includes both required tokens at the bottom of the message. You can also configure a default Mailing Footer containing these tokens.\n

\n Composing Offline
\n If you prefer to compose an HTML email offline in your own text editor, you can upload this HTML content into CiviMail or simply click \"Source\" and then copy and paste the HTML in.\n

\n Images
\n Most email clients these days (Outlook, Gmail, etc) block image loading by default. This is to protect their users from annoying or harmful email. Not much we can do about this, so encourage recipients to add you to their contacts or \"whitelist\". Also use images sparingly, do not rely on images to convey vital information, and always use HTML \"alt\" tags which describe the image content.\n
\n
\n \n
\n Click here to unsubscribe from this mailing list.

\n Our mailing address is:
\n {domain.address}\n
\n\n\n\n',1,NULL,NULL,1,0,0,NULL),(66,'Sample Responsive Design Newsletter - Single Column Template','Sample Responsive Design Newsletter - Single Column','','\n\n \n \n\n \n\n\n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n
Organization or Program Name Here
\n\n \n \n \n \n \n \n
Month and Year
\n
 
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\"Replace\n
 
\n
\n
 
\n
\n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
Headline Here
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\"\"
\n
 
Your Heading Here
 
\n

{contact.email_greeting},

\n

Replace with your text and images, and remember to link the facebook and twitter links in the footer to your pages. Have fun!

\n
Read More
 
\n
\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\"\"
\n
 
Your Heading Here
 
\n

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna

\n
Read More
 
\n
\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\"\"
\n
 
\n

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna

\n
\n
\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\"\"
\n
 
\n

Remember to link the facebook and twitter links below to your pages!

\n
Read More
\n
\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n \n \n \n \n \n
 Unsubscribe | Subscribe | Opt out
 {domain.address}
\n \n\n \n \n \n \n \n \n \n \n \n
\n \n  \n \n  
\n
 
\n
\n
\n\n\n\n',1,NULL,NULL,1,0,0,NULL),(67,'Sample Responsive Design Newsletter - Two Column Template','Sample Responsive Design Newsletter - Two Column','','\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n
Organization or Program Name Here
\n\n \n \n \n \n \n \n
Month Year
\n
 
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n\n \n
\n \n \n \n \n \n \n \n \n \n \n
\"Replace
\n
 
\n
\n\n
\n
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
Hero Story Heading
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n\n \n\n\n\n \n \n
\n
\"\"
\n
 
Subheading Here
 
Replace with your text and images, and remember to link the facebook and twitter links in the footer to your pages. Have fun!
 
\n
\n
\n
Section Heading Here
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\"\"
\n \n\n \n \n \n \n \n \n
 
\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Heading Here
 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna
Read More
\n
\n
 
\n
\n
\n \n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
 
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\"\"
\n \n\n \n \n \n \n \n \n
 
\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Heading Here
 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna
Read More
\n
\n
 
\n
\n
\n \n\n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
 
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\"\"
\n \n\n \n \n \n \n \n \n
 
\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Heading Here
 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna
Read More
\n
\n
 
\n
\n
\n \n\n\n\n\n\n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
 
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\"\"
\n \n\n \n \n \n \n \n \n
 
\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Heading Here
 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna
Read More
\n
\n
 
\n

Remember to link the facebook and twitter links below to your pages!

\n
\n
\n
\n \n\n \n\n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 
\n \n \n \n \n \n \n \n \n \n \n \n
 Unsubscribe | Subscribe | Opt out
 {domain.address}
\n \n \n \n \n \n \n \n \n \n \n
\n  \n \n  
\n
 
 
\n
\n
\n \n \n\n',1,NULL,NULL,1,0,0,NULL); /*!40000 ALTER TABLE `civicrm_msg_template` ENABLE KEYS */; UNLOCK TABLES; @@ -987,7 +987,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_note` WRITE; /*!40000 ALTER TABLE `civicrm_note` DISABLE KEYS */; -INSERT INTO `civicrm_note` (`id`, `entity_table`, `entity_id`, `note`, `contact_id`, `modified_date`, `subject`, `privacy`) VALUES (1,'civicrm_contact',28,'Send newsletter for April 2005',1,'2019-09-02 00:41:40',NULL,'0'),(2,'civicrm_contact',107,'Arrange collection of funds from members',1,'2019-09-09 01:52:24',NULL,'0'),(3,'civicrm_contact',55,'Arrange for cricket match with Sunil Gavaskar',1,'2020-03-17 05:55:57',NULL,'0'),(4,'civicrm_contact',127,'Arrange for cricket match with Sunil Gavaskar',1,'2020-01-06 16:42:05',NULL,'0'),(5,'civicrm_contact',11,'Get the registration done for NGO status',1,'2020-03-14 21:36:20',NULL,'0'),(6,'civicrm_contact',31,'Arrange for cricket match with Sunil Gavaskar',1,'2020-01-15 12:34:59',NULL,'0'),(7,'civicrm_contact',9,'Get the registration done for NGO status',1,'2020-04-04 16:34:03',NULL,'0'),(8,'civicrm_contact',156,'Organize the Terry Fox run',1,'2020-06-11 17:14:32',NULL,'0'),(9,'civicrm_contact',184,'Organize the Terry Fox run',1,'2019-08-28 14:26:46',NULL,'0'),(10,'civicrm_contact',145,'Connect for presentation',1,'2020-04-11 06:37:49',NULL,'0'),(11,'civicrm_contact',142,'Get the registration done for NGO status',1,'2019-12-25 10:02:53',NULL,'0'),(12,'civicrm_contact',171,'Send reminder for annual dinner',1,'2020-01-31 09:23:45',NULL,'0'),(13,'civicrm_contact',134,'Connect for presentation',1,'2019-08-12 07:42:08',NULL,'0'),(14,'civicrm_contact',111,'Arrange collection of funds from members',1,'2020-06-17 02:20:44',NULL,'0'),(15,'civicrm_contact',50,'Arrange for cricket match with Sunil Gavaskar',1,'2020-06-25 17:58:48',NULL,'0'),(16,'civicrm_contact',122,'Contact the Commissioner of Charities',1,'2020-02-03 07:57:20',NULL,'0'),(17,'civicrm_contact',118,'Contact the Commissioner of Charities',1,'2020-07-15 08:44:29',NULL,'0'),(18,'civicrm_contact',71,'Get the registration done for NGO status',1,'2019-12-13 18:51:30',NULL,'0'),(19,'civicrm_contact',131,'Chart out route map for next 10k run',1,'2020-02-17 08:34:21',NULL,'0'),(20,'civicrm_contact',71,'Send newsletter for April 2005',1,'2019-08-13 01:44:38',NULL,'0'); +INSERT INTO `civicrm_note` (`id`, `entity_table`, `entity_id`, `note`, `contact_id`, `modified_date`, `subject`, `privacy`) VALUES (1,'civicrm_contact',7,'Get the registration done for NGO status',1,'2020-03-12 17:03:58',NULL,'0'),(2,'civicrm_contact',194,'Get the registration done for NGO status',1,'2020-08-25 10:25:28',NULL,'0'),(3,'civicrm_contact',200,'Arrange for cricket match with Sunil Gavaskar',1,'2020-07-06 19:35:48',NULL,'0'),(4,'civicrm_contact',35,'Reminder screening of \"Black\" on next Friday',1,'2019-10-25 22:06:42',NULL,'0'),(5,'civicrm_contact',29,'Arrange collection of funds from members',1,'2019-10-29 00:26:00',NULL,'0'),(6,'civicrm_contact',143,'Arrange collection of funds from members',1,'2020-03-27 16:19:15',NULL,'0'),(7,'civicrm_contact',192,'Contact the Commissioner of Charities',1,'2020-01-22 18:28:44',NULL,'0'),(8,'civicrm_contact',67,'Arrange for cricket match with Sunil Gavaskar',1,'2020-02-16 19:33:23',NULL,'0'),(9,'civicrm_contact',38,'Send reminder for annual dinner',1,'2020-06-07 14:57:32',NULL,'0'),(10,'civicrm_contact',8,'Organize the Terry Fox run',1,'2020-09-04 13:04:38',NULL,'0'),(11,'civicrm_contact',42,'Connect for presentation',1,'2020-08-28 16:22:01',NULL,'0'),(12,'civicrm_contact',111,'Reminder screening of \"Black\" on next Friday',1,'2020-03-11 12:07:52',NULL,'0'),(13,'civicrm_contact',126,'Reminder screening of \"Black\" on next Friday',1,'2020-04-25 22:44:11',NULL,'0'),(14,'civicrm_contact',33,'Chart out route map for next 10k run',1,'2020-09-07 08:01:31',NULL,'0'),(15,'civicrm_contact',109,'Get the registration done for NGO status',1,'2019-12-13 11:23:16',NULL,'0'),(16,'civicrm_contact',161,'Organize the Terry Fox run',1,'2020-08-18 21:00:33',NULL,'0'),(17,'civicrm_contact',39,'Send newsletter for April 2005',1,'2019-10-20 13:01:58',NULL,'0'),(18,'civicrm_contact',55,'Send reminder for annual dinner',1,'2019-10-24 15:32:23',NULL,'0'),(19,'civicrm_contact',73,'Invite members for the Steve Prefontaine 10k dream run',1,'2019-11-04 22:23:17',NULL,'0'),(20,'civicrm_contact',137,'Chart out route map for next 10k run',1,'2019-11-11 00:37:00',NULL,'0'); /*!40000 ALTER TABLE `civicrm_note` ENABLE KEYS */; UNLOCK TABLES; @@ -1026,7 +1026,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_participant` WRITE; /*!40000 ALTER TABLE `civicrm_participant` DISABLE KEYS */; -INSERT INTO `civicrm_participant` (`id`, `contact_id`, `event_id`, `status_id`, `role_id`, `register_date`, `source`, `fee_level`, `is_test`, `is_pay_later`, `fee_amount`, `registered_by_id`, `discount_id`, `fee_currency`, `campaign_id`, `discount_amount`, `cart_id`, `must_wait`, `transferred_to_contact_id`) VALUES (1,140,1,1,'1','2009-01-21 00:00:00','Check','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(2,167,2,2,'2','2008-05-07 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(3,95,3,3,'3','2008-05-05 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(4,103,1,4,'4','2008-10-21 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(5,73,2,1,'1','2008-01-10 00:00:00','Check','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(6,155,3,2,'2','2008-03-05 00:00:00','Direct Transfer','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(7,170,1,3,'3','2009-07-21 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(8,56,2,4,'4','2009-03-07 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(9,68,3,1,'1','2008-02-05 00:00:00','Direct Transfer','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(10,172,1,2,'2','2008-02-01 00:00:00','Check','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(11,133,2,3,'3','2009-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(12,31,3,4,'4','2009-03-06 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(13,57,1,1,'2','2008-06-04 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(14,111,2,2,'3','2008-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(15,8,3,4,'1','2008-07-04 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(16,109,1,4,'2','2009-01-21 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(17,195,2,2,'3','2008-01-10 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(18,162,3,3,'1','2009-03-05 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(19,5,1,2,'1','2008-10-21 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(20,94,2,4,'1','2009-01-10 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(21,41,3,1,'4','2008-03-25 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(22,54,1,2,'3','2009-10-21 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(23,102,2,4,'1','2008-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(24,24,3,3,'1','2008-03-11 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(25,180,3,2,'2','2008-04-05 00:00:00','Direct Transfer','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(26,21,1,1,'1','2009-01-21 00:00:00','Check','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(27,19,2,2,'2','2008-05-07 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(28,175,3,3,'3','2009-12-12 00:00:00','Direct Transfer','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(29,30,1,4,'4','2009-12-13 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(30,114,2,1,'1','2009-12-14 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(31,6,3,2,'2','2009-12-15 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(32,44,1,3,'3','2009-07-21 00:00:00','Check','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(33,129,2,4,'4','2009-03-07 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(34,60,3,1,'1','2009-12-15 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(35,165,1,2,'2','2009-12-13 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(36,120,2,3,'3','2009-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(37,49,3,4,'4','2009-03-06 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(38,23,1,1,'2','2009-12-13 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(39,18,2,2,'3','2008-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(40,200,3,4,'1','2009-12-14 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(41,99,1,4,'2','2009-01-21 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(42,196,2,2,'3','2009-12-15 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(43,130,3,3,'1','2009-03-05 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(44,90,1,2,'1','2009-12-13 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(45,98,2,4,'1','2009-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(46,70,3,1,'4','2009-12-13 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(47,194,1,2,'3','2009-10-21 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(48,105,2,4,'1','2009-12-10 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(49,110,3,3,'1','2009-03-11 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(50,106,3,2,'2','2009-04-05 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL); +INSERT INTO `civicrm_participant` (`id`, `contact_id`, `event_id`, `status_id`, `role_id`, `register_date`, `source`, `fee_level`, `is_test`, `is_pay_later`, `fee_amount`, `registered_by_id`, `discount_id`, `fee_currency`, `campaign_id`, `discount_amount`, `cart_id`, `must_wait`, `transferred_to_contact_id`) VALUES (1,43,1,1,'1','2009-01-21 00:00:00','Check','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(2,37,2,2,'2','2008-05-07 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(3,90,3,3,'3','2008-05-05 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(4,28,1,4,'4','2008-10-21 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(5,123,2,1,'1','2008-01-10 00:00:00','Check','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(6,172,3,2,'2','2008-03-05 00:00:00','Direct Transfer','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(7,120,1,3,'3','2009-07-21 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(8,25,2,4,'4','2009-03-07 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(9,20,3,1,'1','2008-02-05 00:00:00','Direct Transfer','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(10,194,1,2,'2','2008-02-01 00:00:00','Check','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(11,88,2,3,'3','2009-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(12,198,3,4,'4','2009-03-06 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(13,44,1,1,'2','2008-06-04 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(14,147,2,2,'3','2008-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(15,79,3,4,'1','2008-07-04 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(16,162,1,4,'2','2009-01-21 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(17,71,2,2,'3','2008-01-10 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(18,40,3,3,'1','2009-03-05 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(19,99,1,2,'1','2008-10-21 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(20,110,2,4,'1','2009-01-10 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(21,55,3,1,'4','2008-03-25 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(22,38,1,2,'3','2009-10-21 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(23,150,2,4,'1','2008-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(24,127,3,3,'1','2008-03-11 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(25,63,3,2,'2','2008-04-05 00:00:00','Direct Transfer','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(26,56,1,1,'1','2009-01-21 00:00:00','Check','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(27,190,2,2,'2','2008-05-07 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(28,166,3,3,'3','2009-12-12 00:00:00','Direct Transfer','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(29,155,1,4,'4','2009-12-13 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(30,47,2,1,'1','2009-12-14 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(31,102,3,2,'2','2009-12-15 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(32,48,1,3,'3','2009-07-21 00:00:00','Check','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(33,153,2,4,'4','2009-03-07 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(34,104,3,1,'1','2009-12-15 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(35,70,1,2,'2','2009-12-13 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(36,61,2,3,'3','2009-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(37,178,3,4,'4','2009-03-06 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(38,199,1,1,'2','2009-12-13 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(39,160,2,2,'3','2008-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(40,197,3,4,'1','2009-12-14 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(41,8,1,4,'2','2009-01-21 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(42,156,2,2,'3','2009-12-15 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(43,192,3,3,'1','2009-03-05 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(44,125,1,2,'1','2009-12-13 00:00:00','Direct Transfer','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(45,52,2,4,'1','2009-01-10 00:00:00','Direct Transfer','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(46,163,3,1,'4','2009-12-13 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(47,187,1,2,'3','2009-10-21 00:00:00','Credit Card','Single',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(48,11,2,4,'1','2009-12-10 00:00:00','Credit Card','Soprano',0,0,50.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(49,18,3,3,'1','2009-03-11 00:00:00','Credit Card','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL),(50,135,3,2,'2','2009-04-05 00:00:00','Check','Tiny-tots (ages 5-8)',0,0,800.00,NULL,NULL,'USD',NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `civicrm_participant` ENABLE KEYS */; UNLOCK TABLES; @@ -1036,7 +1036,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_participant_payment` WRITE; /*!40000 ALTER TABLE `civicrm_participant_payment` DISABLE KEYS */; -INSERT INTO `civicrm_participant_payment` (`id`, `participant_id`, `contribution_id`) VALUES (1,19,45),(2,31,46),(3,15,47),(4,39,48),(5,27,49),(6,26,50),(7,38,51),(8,24,52),(9,29,53),(10,12,54),(11,21,55),(12,32,56),(13,37,57),(14,22,58),(15,8,59),(16,13,60),(17,34,61),(18,9,62),(19,46,63),(20,5,64),(21,44,65),(22,20,66),(23,3,67),(24,45,68),(25,41,69),(26,23,70),(27,4,71),(28,48,72),(29,50,73),(30,16,74),(31,49,75),(32,14,76),(33,30,77),(34,36,78),(35,33,79),(36,43,80),(37,11,81),(38,1,82),(39,6,83),(40,18,84),(41,35,85),(42,2,86),(43,7,87),(44,10,88),(45,28,89),(46,25,90),(47,47,91),(48,17,92),(49,42,93),(50,40,94); +INSERT INTO `civicrm_participant_payment` (`id`, `participant_id`, `contribution_id`) VALUES (1,41,45),(2,48,46),(3,49,47),(4,9,48),(5,8,49),(6,4,50),(7,2,51),(8,22,52),(9,18,53),(10,1,54),(11,13,55),(12,30,56),(13,32,57),(14,45,58),(15,21,59),(16,26,60),(17,36,61),(18,25,62),(19,35,63),(20,17,64),(21,15,65),(22,11,66),(23,3,67),(24,19,68),(25,31,69),(26,34,70),(27,20,71),(28,7,72),(29,5,73),(30,44,74),(31,24,75),(32,50,76),(33,14,77),(34,23,78),(35,33,79),(36,29,80),(37,42,81),(38,39,82),(39,16,83),(40,46,84),(41,28,85),(42,6,86),(43,37,87),(44,47,88),(45,27,89),(46,43,90),(47,10,91),(48,40,92),(49,12,93),(50,38,94); /*!40000 ALTER TABLE `civicrm_participant_payment` ENABLE KEYS */; UNLOCK TABLES; @@ -1065,7 +1065,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_payment_processor_type` WRITE; /*!40000 ALTER TABLE `civicrm_payment_processor_type` DISABLE KEYS */; -INSERT INTO `civicrm_payment_processor_type` (`id`, `name`, `title`, `description`, `is_active`, `is_default`, `user_name_label`, `password_label`, `signature_label`, `subject_label`, `class_name`, `url_site_default`, `url_api_default`, `url_recur_default`, `url_button_default`, `url_site_test_default`, `url_api_test_default`, `url_recur_test_default`, `url_button_test_default`, `billing_mode`, `is_recur`, `payment_type`, `payment_instrument_id`) VALUES (1,'PayPal_Standard','PayPal - Website Payments Standard',NULL,1,0,'Merchant Account Email',NULL,NULL,NULL,'Payment_PayPalImpl','https://www.paypal.com/',NULL,'https://www.paypal.com/',NULL,'https://www.sandbox.paypal.com/',NULL,'https://www.sandbox.paypal.com/',NULL,4,1,1,1),(2,'PayPal','PayPal - Website Payments Pro',NULL,1,0,'User Name','Password','Signature',NULL,'Payment_PayPalImpl','https://www.paypal.com/','https://api-3t.paypal.com/','https://www.paypal.com/','https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif','https://www.sandbox.paypal.com/','https://api-3t.sandbox.paypal.com/','https://www.sandbox.paypal.com/','https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif',3,1,1,1),(3,'PayPal_Express','PayPal - Express',NULL,1,0,'User Name','Password','Signature',NULL,'Payment_PayPalImpl','https://www.paypal.com/','https://api-3t.paypal.com/',NULL,'https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif','https://www.sandbox.paypal.com/','https://api-3t.sandbox.paypal.com/',NULL,'https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif',2,1,1,1),(4,'AuthNet','Authorize.Net',NULL,1,0,'API Login','Payment Key','MD5 Hash',NULL,'Payment_AuthorizeNet','https://secure2.authorize.net/gateway/transact.dll',NULL,'https://api2.authorize.net/xml/v1/request.api',NULL,'https://test.authorize.net/gateway/transact.dll',NULL,'https://apitest.authorize.net/xml/v1/request.api',NULL,1,1,1,1),(5,'PayJunction','PayJunction',NULL,0,0,'User Name','Password',NULL,NULL,'Payment_PayJunction','https://payjunction.com/quick_link',NULL,NULL,NULL,'https://www.payjunctionlabs.com/quick_link',NULL,NULL,NULL,1,1,1,1),(6,'eWAY','eWAY (Single Currency)',NULL,0,0,'Customer ID',NULL,NULL,NULL,'Payment_eWAY','https://www.eway.com.au/gateway_cvn/xmlpayment.asp',NULL,NULL,NULL,'https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp',NULL,NULL,NULL,1,0,1,1),(7,'Dummy','Dummy Payment Processor',NULL,1,1,'User Name',NULL,NULL,NULL,'Payment_Dummy',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,1,1,1),(8,'Elavon','Elavon Payment Processor','Elavon / Nova Virtual Merchant',0,0,'SSL Merchant ID ','SSL User ID','SSL PIN',NULL,'Payment_Elavon','https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do',NULL,NULL,NULL,'https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do',NULL,NULL,NULL,1,0,1,1),(9,'Realex','Realex Payment',NULL,0,0,'Merchant ID','Password',NULL,'Account','Payment_Realex','https://epage.payandshop.com/epage.cgi',NULL,NULL,NULL,'https://epage.payandshop.com/epage-remote.cgi',NULL,NULL,NULL,1,0,1,1),(10,'PayflowPro','PayflowPro',NULL,0,0,'Vendor ID','Password','Partner (merchant)','User','Payment_PayflowPro','https://Payflowpro.paypal.com',NULL,NULL,NULL,'https://pilot-Payflowpro.paypal.com',NULL,NULL,NULL,1,0,1,1),(11,'FirstData','FirstData (aka linkpoint)','FirstData (aka linkpoint)',0,0,'Store name','certificate path',NULL,NULL,'Payment_FirstData','https://secure.linkpt.net',NULL,NULL,NULL,'https://staging.linkpt.net',NULL,NULL,NULL,1,NULL,1,1); +INSERT INTO `civicrm_payment_processor_type` (`id`, `name`, `title`, `description`, `is_active`, `is_default`, `user_name_label`, `password_label`, `signature_label`, `subject_label`, `class_name`, `url_site_default`, `url_api_default`, `url_recur_default`, `url_button_default`, `url_site_test_default`, `url_api_test_default`, `url_recur_test_default`, `url_button_test_default`, `billing_mode`, `is_recur`, `payment_type`, `payment_instrument_id`) VALUES (1,'PayPal_Standard','PayPal - Website Payments Standard',NULL,1,0,'Merchant Account Email',NULL,NULL,NULL,'Payment_PayPalImpl','https://www.paypal.com/',NULL,'https://www.paypal.com/',NULL,'https://www.sandbox.paypal.com/',NULL,'https://www.sandbox.paypal.com/',NULL,4,1,1,1),(2,'PayPal','PayPal - Website Payments Pro',NULL,1,0,'User Name','Password','Signature',NULL,'Payment_PayPalImpl','https://www.paypal.com/','https://api-3t.paypal.com/','https://www.paypal.com/','https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif','https://www.sandbox.paypal.com/','https://api-3t.sandbox.paypal.com/','https://www.sandbox.paypal.com/','https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif',3,1,1,1),(3,'PayPal_Express','PayPal - Express',NULL,1,0,'User Name','Password','Signature',NULL,'Payment_PayPalImpl','https://www.paypal.com/','https://api-3t.paypal.com/',NULL,'https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif','https://www.sandbox.paypal.com/','https://api-3t.sandbox.paypal.com/',NULL,'https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif',2,1,1,1),(4,'AuthNet','Authorize.Net',NULL,1,0,'API Login','Payment Key','MD5 Hash',NULL,'Payment_AuthorizeNet','https://secure2.authorize.net/gateway/transact.dll',NULL,'https://api2.authorize.net/xml/v1/request.api',NULL,'https://test.authorize.net/gateway/transact.dll',NULL,'https://apitest.authorize.net/xml/v1/request.api',NULL,1,1,1,1),(5,'PayJunction','PayJunction',NULL,0,0,'User Name','Password',NULL,NULL,'Payment_PayJunction','https://payjunction.com/quick_link',NULL,NULL,NULL,'https://www.payjunctionlabs.com/quick_link',NULL,NULL,NULL,1,1,1,1),(6,'Dummy','Dummy Payment Processor',NULL,1,1,'User Name',NULL,NULL,NULL,'Payment_Dummy',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,1,1,1),(7,'Elavon','Elavon Payment Processor','Elavon / Nova Virtual Merchant',0,0,'SSL Merchant ID ','SSL User ID','SSL PIN',NULL,'Payment_Elavon','https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do',NULL,NULL,NULL,'https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do',NULL,NULL,NULL,1,0,1,1),(8,'Realex','Realex Payment',NULL,0,0,'Merchant ID','Password',NULL,'Account','Payment_Realex','https://epage.payandshop.com/epage.cgi',NULL,NULL,NULL,'https://epage.payandshop.com/epage-remote.cgi',NULL,NULL,NULL,1,0,1,1),(9,'PayflowPro','PayflowPro',NULL,0,0,'Vendor ID','Password','Partner (merchant)','User','Payment_PayflowPro','https://Payflowpro.paypal.com',NULL,NULL,NULL,'https://pilot-Payflowpro.paypal.com',NULL,NULL,NULL,1,0,1,1),(10,'FirstData','FirstData (aka linkpoint)','FirstData (aka linkpoint)',0,0,'Store name','certificate path',NULL,NULL,'Payment_FirstData','https://secure.linkpt.net',NULL,NULL,NULL,'https://staging.linkpt.net',NULL,NULL,NULL,1,NULL,1,1); /*!40000 ALTER TABLE `civicrm_payment_processor_type` ENABLE KEYS */; UNLOCK TABLES; @@ -1084,7 +1084,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_pcp` WRITE; /*!40000 ALTER TABLE `civicrm_pcp` DISABLE KEYS */; -INSERT INTO `civicrm_pcp` (`id`, `contact_id`, `status_id`, `title`, `intro_text`, `page_text`, `donate_link_text`, `page_id`, `page_type`, `pcp_block_id`, `is_thermometer`, `is_honor_roll`, `goal_amount`, `currency`, `is_active`, `is_notify`) VALUES (1,57,2,'My Personal Civi Fundraiser','I\'m on a mission to get all my friends and family to help support my favorite open-source civic sector CRM.','

Friends and family - please help build much needed infrastructure for the civic sector by supporting my personal campaign!

\r\n

You can learn more about CiviCRM here.

\r\n

Then click the Contribute Now button to go to our easy-to-use online contribution form.

','Contribute Now',1,'contribute',1,1,1,5000.00,'USD',1,1); +INSERT INTO `civicrm_pcp` (`id`, `contact_id`, `status_id`, `title`, `intro_text`, `page_text`, `donate_link_text`, `page_id`, `page_type`, `pcp_block_id`, `is_thermometer`, `is_honor_roll`, `goal_amount`, `currency`, `is_active`, `is_notify`) VALUES (1,118,2,'My Personal Civi Fundraiser','I\'m on a mission to get all my friends and family to help support my favorite open-source civic sector CRM.','

Friends and family - please help build much needed infrastructure for the civic sector by supporting my personal campaign!

\r\n

You can learn more about CiviCRM here.

\r\n

Then click the Contribute Now button to go to our easy-to-use online contribution form.

','Contribute Now',1,'contribute',1,1,1,5000.00,'USD',1,1); /*!40000 ALTER TABLE `civicrm_pcp` ENABLE KEYS */; UNLOCK TABLES; @@ -1104,7 +1104,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_phone` WRITE; /*!40000 ALTER TABLE `civicrm_phone` DISABLE KEYS */; -INSERT INTO `civicrm_phone` (`id`, `contact_id`, `location_type_id`, `is_primary`, `is_billing`, `mobile_provider_id`, `phone`, `phone_ext`, `phone_numeric`, `phone_type_id`) VALUES (1,24,1,1,0,NULL,'274-9635',NULL,'2749635',2),(2,17,1,1,0,NULL,'(229) 879-2778',NULL,'2298792778',1),(3,17,1,0,0,NULL,'799-7889',NULL,'7997889',2),(4,182,1,1,0,NULL,'(244) 685-2219',NULL,'2446852219',1),(5,182,1,0,0,NULL,'(865) 344-9781',NULL,'8653449781',2),(6,138,1,1,0,NULL,'402-4943',NULL,'4024943',2),(7,53,1,1,0,NULL,'204-2790',NULL,'2042790',2),(8,53,1,0,0,NULL,'766-4872',NULL,'7664872',2),(9,15,1,1,0,NULL,'(668) 853-1518',NULL,'6688531518',2),(10,83,1,1,0,NULL,'241-1379',NULL,'2411379',1),(11,120,1,1,0,NULL,'397-9037',NULL,'3979037',1),(12,120,1,0,0,NULL,'730-9455',NULL,'7309455',1),(13,193,1,1,0,NULL,'(676) 251-4852',NULL,'6762514852',2),(14,162,1,1,0,NULL,'521-3006',NULL,'5213006',2),(15,66,1,1,0,NULL,'530-6693',NULL,'5306693',2),(16,66,1,0,0,NULL,'731-4325',NULL,'7314325',1),(17,92,1,1,0,NULL,'(220) 590-9485',NULL,'2205909485',1),(18,92,1,0,0,NULL,'(203) 368-1646',NULL,'2033681646',1),(19,167,1,1,0,NULL,'(750) 209-2869',NULL,'7502092869',2),(20,167,1,0,0,NULL,'890-9055',NULL,'8909055',2),(21,190,1,1,0,NULL,'(652) 629-9114',NULL,'6526299114',1),(22,190,1,0,0,NULL,'(293) 584-8018',NULL,'2935848018',1),(23,184,1,1,0,NULL,'437-1558',NULL,'4371558',2),(24,67,1,1,0,NULL,'(424) 686-1017',NULL,'4246861017',1),(25,67,1,0,0,NULL,'716-5913',NULL,'7165913',1),(26,183,1,1,0,NULL,'(423) 421-9523',NULL,'4234219523',2),(27,175,1,1,0,NULL,'880-2156',NULL,'8802156',2),(28,129,1,1,0,NULL,'(488) 267-9425',NULL,'4882679425',1),(29,129,1,0,0,NULL,'859-5831',NULL,'8595831',2),(30,197,1,1,0,NULL,'(454) 513-8343',NULL,'4545138343',2),(31,197,1,0,0,NULL,'(553) 619-5071',NULL,'5536195071',2),(32,122,1,1,0,NULL,'718-4550',NULL,'7184550',1),(33,122,1,0,0,NULL,'289-9260',NULL,'2899260',1),(34,7,1,1,0,NULL,'(206) 479-5991',NULL,'2064795991',2),(35,7,1,0,0,NULL,'285-4636',NULL,'2854636',1),(36,154,1,1,0,NULL,'430-8301',NULL,'4308301',1),(37,154,1,0,0,NULL,'(435) 851-5287',NULL,'4358515287',2),(38,51,1,1,0,NULL,'304-7100',NULL,'3047100',2),(39,51,1,0,0,NULL,'238-5124',NULL,'2385124',2),(40,97,1,1,0,NULL,'(814) 212-3197',NULL,'8142123197',1),(41,111,1,1,0,NULL,'756-3086',NULL,'7563086',2),(42,111,1,0,0,NULL,'365-2538',NULL,'3652538',2),(43,143,1,1,0,NULL,'816-4755',NULL,'8164755',2),(44,77,1,1,0,NULL,'(235) 641-2496',NULL,'2356412496',1),(45,77,1,0,0,NULL,'713-4703',NULL,'7134703',1),(46,186,1,1,0,NULL,'474-5007',NULL,'4745007',2),(47,12,1,1,0,NULL,'617-7751',NULL,'6177751',1),(48,8,1,1,0,NULL,'(537) 372-7316',NULL,'5373727316',2),(49,84,1,1,0,NULL,'792-7270',NULL,'7927270',2),(50,84,1,0,0,NULL,'(801) 234-1538',NULL,'8012341538',2),(51,71,1,1,0,NULL,'392-6885',NULL,'3926885',2),(52,71,1,0,0,NULL,'288-3964',NULL,'2883964',2),(53,119,1,1,0,NULL,'446-4383',NULL,'4464383',2),(54,119,1,0,0,NULL,'(596) 657-2384',NULL,'5966572384',2),(55,161,1,1,0,NULL,'635-8492',NULL,'6358492',2),(56,60,1,1,0,NULL,'(691) 530-1922',NULL,'6915301922',1),(57,31,1,1,0,NULL,'(283) 732-1513',NULL,'2837321513',2),(58,55,1,1,0,NULL,'657-5967',NULL,'6575967',1),(59,55,1,0,0,NULL,'272-6026',NULL,'2726026',1),(60,64,1,1,0,NULL,'673-2317',NULL,'6732317',2),(61,64,1,0,0,NULL,'534-1878',NULL,'5341878',2),(62,41,1,1,0,NULL,'460-9430',NULL,'4609430',2),(63,30,1,1,0,NULL,'306-2031',NULL,'3062031',2),(64,2,1,1,0,NULL,'612-2909',NULL,'6122909',1),(65,2,1,0,0,NULL,'(737) 473-7543',NULL,'7374737543',2),(66,118,1,1,0,NULL,'755-9391',NULL,'7559391',1),(67,87,1,1,0,NULL,'(463) 596-6006',NULL,'4635966006',2),(68,87,1,0,0,NULL,'560-2341',NULL,'5602341',1),(69,23,1,1,0,NULL,'(408) 243-9215',NULL,'4082439215',1),(70,5,1,1,0,NULL,'(467) 735-2801',NULL,'4677352801',1),(71,5,1,0,0,NULL,'(585) 618-1985',NULL,'5856181985',2),(72,93,1,1,0,NULL,'774-6122',NULL,'7746122',2),(73,18,1,1,0,NULL,'(859) 599-7380',NULL,'8595997380',1),(74,176,1,1,0,NULL,'(352) 842-5208',NULL,'3528425208',2),(75,80,1,1,0,NULL,'(664) 231-4436',NULL,'6642314436',1),(76,80,1,0,0,NULL,'(274) 257-4985',NULL,'2742574985',1),(77,44,1,1,0,NULL,'881-5788',NULL,'8815788',2),(78,44,1,0,0,NULL,'(866) 667-8364',NULL,'8666678364',1),(79,52,1,1,0,NULL,'(611) 572-3049',NULL,'6115723049',2),(80,165,1,1,0,NULL,'228-4756',NULL,'2284756',1),(81,127,1,1,0,NULL,'555-6328',NULL,'5556328',1),(82,127,1,0,0,NULL,'(327) 478-4987',NULL,'3274784987',1),(83,172,1,1,0,NULL,'(487) 597-4192',NULL,'4875974192',2),(84,172,1,0,0,NULL,'372-7179',NULL,'3727179',1),(85,125,1,1,0,NULL,'216-1481',NULL,'2161481',1),(86,74,1,1,0,NULL,'(492) 296-6332',NULL,'4922966332',1),(87,74,1,0,0,NULL,'287-8009',NULL,'2878009',2),(88,47,1,1,0,NULL,'(425) 785-7087',NULL,'4257857087',2),(89,159,1,1,0,NULL,'(368) 300-4630',NULL,'3683004630',1),(90,102,1,1,0,NULL,'(443) 534-9192',NULL,'4435349192',1),(91,149,1,1,0,NULL,'(802) 411-1496',NULL,'8024111496',1),(92,192,1,1,0,NULL,'(297) 209-2106',NULL,'2972092106',2),(93,192,1,0,0,NULL,'(705) 606-6556',NULL,'7056066556',1),(94,134,1,1,0,NULL,'(632) 400-9500',NULL,'6324009500',1),(95,134,1,0,0,NULL,'(328) 557-6995',NULL,'3285576995',2),(96,100,1,1,0,NULL,'(629) 623-5518',NULL,'6296235518',2),(97,100,1,0,0,NULL,'(787) 824-4620',NULL,'7878244620',2),(98,34,1,1,0,NULL,'(576) 532-4124',NULL,'5765324124',1),(99,113,1,1,0,NULL,'208-4699',NULL,'2084699',1),(100,110,1,1,0,NULL,'(766) 397-6252',NULL,'7663976252',2),(101,110,1,0,0,NULL,'663-2594',NULL,'6632594',2),(102,191,1,1,0,NULL,'(711) 752-3110',NULL,'7117523110',2),(103,191,1,0,0,NULL,'455-8038',NULL,'4558038',2),(104,151,1,1,0,NULL,'496-3771',NULL,'4963771',1),(105,82,1,1,0,NULL,'(281) 214-6022',NULL,'2812146022',1),(106,82,1,0,0,NULL,'(652) 390-7860',NULL,'6523907860',2),(107,196,1,1,0,NULL,'533-5816',NULL,'5335816',1),(108,94,1,1,0,NULL,'(749) 574-5597',NULL,'7495745597',2),(109,188,1,1,0,NULL,'529-8632',NULL,'5298632',2),(110,195,1,1,0,NULL,'(395) 227-9037',NULL,'3952279037',1),(111,28,1,1,0,NULL,'718-8866',NULL,'7188866',2),(112,28,1,0,0,NULL,'814-1318',NULL,'8141318',2),(113,141,1,1,0,NULL,'(783) 818-5891',NULL,'7838185891',2),(114,141,1,0,0,NULL,'898-2730',NULL,'8982730',1),(115,112,1,1,0,NULL,'(558) 458-8429',NULL,'5584588429',2),(116,112,1,0,0,NULL,'(308) 797-1765',NULL,'3087971765',1),(117,152,1,1,0,NULL,'(373) 427-1144',NULL,'3734271144',2),(118,61,1,1,0,NULL,'374-7266',NULL,'3747266',2),(119,108,1,1,0,NULL,'661-5380',NULL,'6615380',1),(120,108,1,0,0,NULL,'(647) 666-4232',NULL,'6476664232',1),(121,54,1,1,0,NULL,'445-1977',NULL,'4451977',2),(122,54,1,0,0,NULL,'405-2942',NULL,'4052942',1),(123,155,1,1,0,NULL,'784-9465',NULL,'7849465',1),(124,103,1,1,0,NULL,'265-9328',NULL,'2659328',2),(125,63,1,1,0,NULL,'(735) 686-1024',NULL,'7356861024',1),(126,63,1,0,0,NULL,'(679) 205-2507',NULL,'6792052507',2),(127,68,1,1,0,NULL,'(214) 665-4847',NULL,'2146654847',1),(128,68,1,0,0,NULL,'256-3774',NULL,'2563774',1),(129,70,1,1,0,NULL,'429-1869',NULL,'4291869',1),(130,70,1,0,0,NULL,'219-2851',NULL,'2192851',1),(131,10,1,1,0,NULL,'716-2365',NULL,'7162365',1),(132,130,1,1,0,NULL,'600-7888',NULL,'6007888',2),(133,140,1,1,0,NULL,'267-9456',NULL,'2679456',1),(134,58,1,1,0,NULL,'(255) 537-6804',NULL,'2555376804',2),(135,58,1,0,0,NULL,'785-9517',NULL,'7859517',2),(136,48,1,1,0,NULL,'(369) 720-9933',NULL,'3697209933',1),(137,135,1,1,0,NULL,'577-3243',NULL,'5773243',2),(138,43,1,1,0,NULL,'(561) 878-3542',NULL,'5618783542',2),(139,20,1,1,0,NULL,'(240) 599-5126',NULL,'2405995126',2),(140,13,1,1,0,NULL,'(896) 730-2208',NULL,'8967302208',2),(141,13,1,0,0,NULL,'891-6610',NULL,'8916610',1),(142,194,1,1,0,NULL,'(582) 263-1870',NULL,'5822631870',2),(143,131,1,1,0,NULL,'209-4992',NULL,'2094992',2),(144,131,1,0,0,NULL,'(357) 393-9592',NULL,'3573939592',2),(145,75,1,1,0,NULL,'297-3631',NULL,'2973631',1),(146,75,1,0,0,NULL,'(735) 516-9375',NULL,'7355169375',1),(147,104,1,1,0,NULL,'(202) 624-1843',NULL,'2026241843',2),(148,153,1,1,0,NULL,'577-2814',NULL,'5772814',2),(149,153,1,0,0,NULL,'(672) 816-3429',NULL,'6728163429',2),(150,39,1,1,0,NULL,'(413) 541-3220',NULL,'4135413220',1),(151,189,1,1,0,NULL,'(562) 845-6038',NULL,'5628456038',2),(152,36,1,1,0,NULL,'359-6033',NULL,'3596033',1),(153,36,1,0,0,NULL,'(574) 836-8694',NULL,'5748368694',1),(154,171,1,1,0,NULL,'(631) 326-9216',NULL,'6313269216',2),(155,25,1,1,0,NULL,'(632) 417-4898',NULL,'6324174898',1),(156,180,1,1,0,NULL,'699-9692',NULL,'6999692',2),(157,158,1,1,0,NULL,'258-5034',NULL,'2585034',1),(158,NULL,1,0,0,NULL,'204 222-1000',NULL,'2042221000',1),(159,NULL,1,0,0,NULL,'204 223-1000',NULL,'2042231000',1),(160,NULL,1,0,0,NULL,'303 323-1000',NULL,'3033231000',1); +INSERT INTO `civicrm_phone` (`id`, `contact_id`, `location_type_id`, `is_primary`, `is_billing`, `mobile_provider_id`, `phone`, `phone_ext`, `phone_numeric`, `phone_type_id`) VALUES (1,79,1,1,0,NULL,'(523) 815-5146',NULL,'5238155146',2),(2,79,1,0,0,NULL,'721-6350',NULL,'7216350',2),(3,47,1,1,0,NULL,'889-3713',NULL,'8893713',2),(4,47,1,0,0,NULL,'562-6370',NULL,'5626370',2),(5,34,1,1,0,NULL,'790-2316',NULL,'7902316',1),(6,44,1,1,0,NULL,'503-8140',NULL,'5038140',1),(7,139,1,1,0,NULL,'(830) 472-1368',NULL,'8304721368',2),(8,126,1,1,0,NULL,'456-8960',NULL,'4568960',2),(9,17,1,1,0,NULL,'(685) 670-6506',NULL,'6856706506',1),(10,12,1,1,0,NULL,'(481) 832-1118',NULL,'4818321118',1),(11,12,1,0,0,NULL,'(773) 881-5266',NULL,'7738815266',1),(12,9,1,1,0,NULL,'(315) 699-7156',NULL,'3156997156',2),(13,9,1,0,0,NULL,'(463) 336-9961',NULL,'4633369961',2),(14,55,1,1,0,NULL,'694-8990',NULL,'6948990',1),(15,132,1,1,0,NULL,'(222) 396-9157',NULL,'2223969157',2),(16,91,1,1,0,NULL,'729-1012',NULL,'7291012',2),(17,65,1,1,0,NULL,'314-7104',NULL,'3147104',2),(18,65,1,0,0,NULL,'(370) 898-8405',NULL,'3708988405',1),(19,38,1,1,0,NULL,'(214) 622-6050',NULL,'2146226050',2),(20,38,1,0,0,NULL,'(851) 566-9796',NULL,'8515669796',1),(21,11,1,1,0,NULL,'202-9668',NULL,'2029668',2),(22,11,1,0,0,NULL,'(281) 705-5947',NULL,'2817055947',1),(23,201,1,1,0,NULL,'671-6560',NULL,'6716560',1),(24,181,1,1,0,NULL,'(450) 351-2143',NULL,'4503512143',1),(25,32,1,1,0,NULL,'673-7694',NULL,'6737694',1),(26,168,1,1,0,NULL,'(274) 337-7368',NULL,'2743377368',2),(27,164,1,1,0,NULL,'726-4472',NULL,'7264472',1),(28,92,1,1,0,NULL,'(700) 387-8405',NULL,'7003878405',2),(29,92,1,0,0,NULL,'(264) 351-7016',NULL,'2643517016',2),(30,94,1,1,0,NULL,'719-4685',NULL,'7194685',1),(31,94,1,0,0,NULL,'(216) 647-4858',NULL,'2166474858',1),(32,8,1,1,0,NULL,'274-7810',NULL,'2747810',2),(33,60,1,1,0,NULL,'(385) 587-1748',NULL,'3855871748',2),(34,60,1,0,0,NULL,'641-7208',NULL,'6417208',2),(35,133,1,1,0,NULL,'378-8835',NULL,'3788835',1),(36,133,1,0,0,NULL,'(586) 566-7162',NULL,'5865667162',2),(37,42,1,1,0,NULL,'(356) 308-4372',NULL,'3563084372',1),(38,154,1,1,0,NULL,'844-9406',NULL,'8449406',2),(39,154,1,0,0,NULL,'(245) 484-7252',NULL,'2454847252',1),(40,112,1,1,0,NULL,'415-9536',NULL,'4159536',2),(41,112,1,0,0,NULL,'(331) 311-6801',NULL,'3313116801',2),(42,162,1,1,0,NULL,'(385) 528-9111',NULL,'3855289111',1),(43,183,1,1,0,NULL,'(497) 530-9731',NULL,'4975309731',2),(44,31,1,1,0,NULL,'214-4224',NULL,'2144224',1),(45,184,1,1,0,NULL,'(338) 788-3106',NULL,'3387883106',1),(46,59,1,1,0,NULL,'269-8908',NULL,'2698908',2),(47,59,1,0,0,NULL,'(269) 787-4490',NULL,'2697874490',2),(48,46,1,1,0,NULL,'(587) 463-9165',NULL,'5874639165',1),(49,193,1,1,0,NULL,'881-3194',NULL,'8813194',2),(50,193,1,0,0,NULL,'473-4558',NULL,'4734558',1),(51,199,1,1,0,NULL,'(292) 359-9271',NULL,'2923599271',2),(52,199,1,0,0,NULL,'431-2634',NULL,'4312634',2),(53,86,1,1,0,NULL,'479-2381',NULL,'4792381',2),(54,182,1,1,0,NULL,'(795) 496-6724',NULL,'7954966724',2),(55,182,1,0,0,NULL,'207-3852',NULL,'2073852',2),(56,151,1,1,0,NULL,'307-4949',NULL,'3074949',2),(57,137,1,1,0,NULL,'519-9579',NULL,'5199579',2),(58,137,1,0,0,NULL,'377-3591',NULL,'3773591',1),(59,189,1,1,0,NULL,'(623) 488-2405',NULL,'6234882405',1),(60,189,1,0,0,NULL,'(461) 806-5134',NULL,'4618065134',2),(61,35,1,1,0,NULL,'837-8708',NULL,'8378708',1),(62,117,1,1,0,NULL,'(584) 883-7595',NULL,'5848837595',1),(63,176,1,1,0,NULL,'716-9883',NULL,'7169883',1),(64,185,1,1,0,NULL,'(312) 773-6857',NULL,'3127736857',1),(65,185,1,0,0,NULL,'614-9027',NULL,'6149027',1),(66,95,1,1,0,NULL,'649-6641',NULL,'6496641',1),(67,95,1,0,0,NULL,'425-1806',NULL,'4251806',1),(68,121,1,1,0,NULL,'(531) 572-1850',NULL,'5315721850',1),(69,121,1,0,0,NULL,'(263) 519-9625',NULL,'2635199625',1),(70,158,1,1,0,NULL,'239-8950',NULL,'2398950',1),(71,43,1,1,0,NULL,'(703) 617-1898',NULL,'7036171898',1),(72,43,1,0,0,NULL,'(899) 673-2608',NULL,'8996732608',1),(73,131,1,1,0,NULL,'(618) 337-1277',NULL,'6183371277',2),(74,97,1,1,0,NULL,'(895) 726-7800',NULL,'8957267800',1),(75,97,1,0,0,NULL,'649-5990',NULL,'6495990',2),(76,124,1,1,0,NULL,'(313) 267-4581',NULL,'3132674581',1),(77,124,1,0,0,NULL,'(654) 218-9583',NULL,'6542189583',1),(78,26,1,1,0,NULL,'(205) 879-4845',NULL,'2058794845',1),(79,26,1,0,0,NULL,'342-8026',NULL,'3428026',1),(80,10,1,1,0,NULL,'457-6673',NULL,'4576673',2),(81,10,1,0,0,NULL,'(498) 652-8931',NULL,'4986528931',1),(82,45,1,1,0,NULL,'469-9857',NULL,'4699857',2),(83,66,1,1,0,NULL,'(745) 470-7998',NULL,'7454707998',1),(84,66,1,0,0,NULL,'(602) 298-4166',NULL,'6022984166',1),(85,138,1,1,0,NULL,'(317) 607-4473',NULL,'3176074473',2),(86,138,1,0,0,NULL,'(395) 485-4462',NULL,'3954854462',2),(87,57,1,1,0,NULL,'619-5216',NULL,'6195216',2),(88,157,1,1,0,NULL,'(620) 882-3318',NULL,'6208823318',2),(89,159,1,1,0,NULL,'658-7722',NULL,'6587722',2),(90,159,1,0,0,NULL,'370-7965',NULL,'3707965',2),(91,145,1,1,0,NULL,'(542) 706-4403',NULL,'5427064403',1),(92,106,1,1,0,NULL,'475-5485',NULL,'4755485',2),(93,106,1,0,0,NULL,'(259) 729-3126',NULL,'2597293126',2),(94,113,1,1,0,NULL,'(566) 694-6898',NULL,'5666946898',1),(95,113,1,0,0,NULL,'(887) 227-7343',NULL,'8872277343',2),(96,29,1,1,0,NULL,'(757) 332-8803',NULL,'7573328803',1),(97,29,1,0,0,NULL,'408-1363',NULL,'4081363',1),(98,19,1,1,0,NULL,'(564) 389-3716',NULL,'5643893716',2),(99,19,1,0,0,NULL,'560-2969',NULL,'5602969',1),(100,105,1,1,0,NULL,'(368) 532-5416',NULL,'3685325416',2),(101,105,1,0,0,NULL,'449-2655',NULL,'4492655',2),(102,20,1,1,0,NULL,'(659) 283-2058',NULL,'6592832058',2),(103,25,1,1,0,NULL,'633-5898',NULL,'6335898',1),(104,25,1,0,0,NULL,'(475) 555-3494',NULL,'4755553494',2),(105,123,1,1,0,NULL,'(494) 215-1586',NULL,'4942151586',2),(106,150,1,1,0,NULL,'(607) 583-9806',NULL,'6075839806',2),(107,150,1,0,0,NULL,'(752) 453-9521',NULL,'7524539521',1),(108,96,1,1,0,NULL,'762-1999',NULL,'7621999',1),(109,96,1,0,0,NULL,'(310) 560-1322',NULL,'3105601322',2),(110,27,1,1,0,NULL,'(623) 531-9647',NULL,'6235319647',2),(111,27,1,0,0,NULL,'458-1481',NULL,'4581481',2),(112,6,1,1,0,NULL,'(416) 234-4200',NULL,'4162344200',1),(113,175,1,1,0,NULL,'(763) 611-3522',NULL,'7636113522',2),(114,84,1,1,0,NULL,'(412) 419-8273',NULL,'4124198273',1),(115,84,1,0,0,NULL,'595-5626',NULL,'5955626',2),(116,200,1,1,0,NULL,'818-6064',NULL,'8186064',2),(117,200,1,0,0,NULL,'266-1010',NULL,'2661010',2),(118,24,1,1,0,NULL,'526-7330',NULL,'5267330',2),(119,90,1,1,0,NULL,'535-7443',NULL,'5357443',2),(120,90,1,0,0,NULL,'714-1998',NULL,'7141998',1),(121,2,1,1,0,NULL,'(533) 521-1609',NULL,'5335211609',1),(122,128,1,1,0,NULL,'401-6629',NULL,'4016629',2),(123,128,1,0,0,NULL,'891-5074',NULL,'8915074',2),(124,143,1,1,0,NULL,'302-8885',NULL,'3028885',2),(125,143,1,0,0,NULL,'728-5679',NULL,'7285679',1),(126,4,1,1,0,NULL,'(228) 606-4974',NULL,'2286064974',2),(127,4,1,0,0,NULL,'599-3182',NULL,'5993182',2),(128,177,1,1,0,NULL,'(767) 211-9430',NULL,'7672119430',1),(129,72,1,1,0,NULL,'(831) 432-4586',NULL,'8314324586',1),(130,58,1,1,0,NULL,'(527) 652-8674',NULL,'5276528674',1),(131,54,1,1,0,NULL,'(653) 382-9078',NULL,'6533829078',1),(132,109,1,1,0,NULL,'577-5018',NULL,'5775018',2),(133,71,1,1,0,NULL,'514-1324',NULL,'5141324',1),(134,107,1,1,0,NULL,'(437) 709-6479',NULL,'4377096479',1),(135,83,1,1,0,NULL,'668-5429',NULL,'6685429',1),(136,85,1,1,0,NULL,'(794) 230-6483',NULL,'7942306483',2),(137,116,1,1,0,NULL,'(332) 668-9866',NULL,'3326689866',2),(138,5,1,1,0,NULL,'(682) 610-3879',NULL,'6826103879',2),(139,NULL,1,0,0,NULL,'204 222-1000',NULL,'2042221000',1),(140,NULL,1,0,0,NULL,'204 223-1000',NULL,'2042231000',1),(141,NULL,1,0,0,NULL,'303 323-1000',NULL,'3033231000',1); /*!40000 ALTER TABLE `civicrm_phone` ENABLE KEYS */; UNLOCK TABLES; @@ -1261,7 +1261,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_relationship` WRITE; /*!40000 ALTER TABLE `civicrm_relationship` DISABLE KEYS */; -INSERT INTO `civicrm_relationship` (`id`, `contact_id_a`, `contact_id_b`, `relationship_type_id`, `start_date`, `end_date`, `is_active`, `description`, `is_permission_a_b`, `is_permission_b_a`, `case_id`) VALUES (1,74,172,1,NULL,NULL,1,NULL,0,0,NULL),(2,47,172,1,NULL,NULL,1,NULL,0,0,NULL),(3,74,125,1,NULL,NULL,1,NULL,0,0,NULL),(4,47,125,1,NULL,NULL,1,NULL,0,0,NULL),(5,47,74,4,NULL,NULL,1,NULL,0,0,NULL),(6,125,11,8,NULL,NULL,1,NULL,0,0,NULL),(7,74,11,8,NULL,NULL,1,NULL,0,0,NULL),(8,47,11,8,NULL,NULL,1,NULL,0,0,NULL),(9,172,11,7,NULL,NULL,0,NULL,0,0,NULL),(10,125,172,2,NULL,NULL,0,NULL,0,0,NULL),(11,126,159,1,NULL,NULL,1,NULL,0,0,NULL),(12,9,159,1,NULL,NULL,1,NULL,0,0,NULL),(13,126,102,1,NULL,NULL,1,NULL,0,0,NULL),(14,9,102,1,NULL,NULL,1,NULL,0,0,NULL),(15,9,126,4,NULL,NULL,1,NULL,0,0,NULL),(16,102,128,8,NULL,NULL,1,NULL,0,0,NULL),(17,126,128,8,NULL,NULL,1,NULL,0,0,NULL),(18,9,128,8,NULL,NULL,1,NULL,0,0,NULL),(19,159,128,7,NULL,NULL,0,NULL,0,0,NULL),(20,102,159,2,NULL,NULL,0,NULL,0,0,NULL),(21,40,198,1,NULL,NULL,1,NULL,0,0,NULL),(22,85,198,1,NULL,NULL,1,NULL,0,0,NULL),(23,40,149,1,NULL,NULL,1,NULL,0,0,NULL),(24,85,149,1,NULL,NULL,1,NULL,0,0,NULL),(25,85,40,4,NULL,NULL,1,NULL,0,0,NULL),(26,149,38,8,NULL,NULL,1,NULL,0,0,NULL),(27,40,38,8,NULL,NULL,1,NULL,0,0,NULL),(28,85,38,8,NULL,NULL,1,NULL,0,0,NULL),(29,198,38,7,NULL,NULL,1,NULL,0,0,NULL),(30,149,198,2,NULL,NULL,1,NULL,0,0,NULL),(31,134,192,1,NULL,NULL,1,NULL,0,0,NULL),(32,100,192,1,NULL,NULL,1,NULL,0,0,NULL),(33,134,170,1,NULL,NULL,1,NULL,0,0,NULL),(34,100,170,1,NULL,NULL,1,NULL,0,0,NULL),(35,100,134,4,NULL,NULL,1,NULL,0,0,NULL),(36,170,136,8,NULL,NULL,1,NULL,0,0,NULL),(37,134,136,8,NULL,NULL,1,NULL,0,0,NULL),(38,100,136,8,NULL,NULL,1,NULL,0,0,NULL),(39,192,136,7,NULL,NULL,0,NULL,0,0,NULL),(40,170,192,2,NULL,NULL,0,NULL,0,0,NULL),(41,59,34,1,NULL,NULL,1,NULL,0,0,NULL),(42,110,34,1,NULL,NULL,1,NULL,0,0,NULL),(43,59,113,1,NULL,NULL,1,NULL,0,0,NULL),(44,110,113,1,NULL,NULL,1,NULL,0,0,NULL),(45,110,59,4,NULL,NULL,1,NULL,0,0,NULL),(46,113,32,8,NULL,NULL,1,NULL,0,0,NULL),(47,59,32,8,NULL,NULL,1,NULL,0,0,NULL),(48,110,32,8,NULL,NULL,1,NULL,0,0,NULL),(49,34,32,7,NULL,NULL,1,NULL,0,0,NULL),(50,113,34,2,NULL,NULL,1,NULL,0,0,NULL),(51,147,191,1,NULL,NULL,1,NULL,0,0,NULL),(52,151,191,1,NULL,NULL,1,NULL,0,0,NULL),(53,147,160,1,NULL,NULL,1,NULL,0,0,NULL),(54,151,160,1,NULL,NULL,1,NULL,0,0,NULL),(55,151,147,4,NULL,NULL,1,NULL,0,0,NULL),(56,160,27,8,NULL,NULL,1,NULL,0,0,NULL),(57,147,27,8,NULL,NULL,1,NULL,0,0,NULL),(58,151,27,8,NULL,NULL,1,NULL,0,0,NULL),(59,191,27,7,NULL,NULL,1,NULL,0,0,NULL),(60,160,191,2,NULL,NULL,1,NULL,0,0,NULL),(61,94,82,1,NULL,NULL,1,NULL,0,0,NULL),(62,188,82,1,NULL,NULL,1,NULL,0,0,NULL),(63,94,196,1,NULL,NULL,1,NULL,0,0,NULL),(64,188,196,1,NULL,NULL,1,NULL,0,0,NULL),(65,188,94,4,NULL,NULL,1,NULL,0,0,NULL),(66,196,116,8,NULL,NULL,1,NULL,0,0,NULL),(67,94,116,8,NULL,NULL,1,NULL,0,0,NULL),(68,188,116,8,NULL,NULL,1,NULL,0,0,NULL),(69,82,116,7,NULL,NULL,0,NULL,0,0,NULL),(70,196,82,2,NULL,NULL,0,NULL,0,0,NULL),(71,28,195,1,NULL,NULL,1,NULL,0,0,NULL),(72,133,195,1,NULL,NULL,1,NULL,0,0,NULL),(73,28,173,1,NULL,NULL,1,NULL,0,0,NULL),(74,133,173,1,NULL,NULL,1,NULL,0,0,NULL),(75,133,28,4,NULL,NULL,1,NULL,0,0,NULL),(76,173,106,8,NULL,NULL,1,NULL,0,0,NULL),(77,28,106,8,NULL,NULL,1,NULL,0,0,NULL),(78,133,106,8,NULL,NULL,1,NULL,0,0,NULL),(79,195,106,7,NULL,NULL,0,NULL,0,0,NULL),(80,173,195,2,NULL,NULL,0,NULL,0,0,NULL),(81,152,141,1,NULL,NULL,1,NULL,0,0,NULL),(82,61,141,1,NULL,NULL,1,NULL,0,0,NULL),(83,152,112,1,NULL,NULL,1,NULL,0,0,NULL),(84,61,112,1,NULL,NULL,1,NULL,0,0,NULL),(85,61,152,4,NULL,NULL,1,NULL,0,0,NULL),(86,112,22,8,NULL,NULL,1,NULL,0,0,NULL),(87,152,22,8,NULL,NULL,1,NULL,0,0,NULL),(88,61,22,8,NULL,NULL,1,NULL,0,0,NULL),(89,141,22,7,NULL,NULL,1,NULL,0,0,NULL),(90,112,141,2,NULL,NULL,1,NULL,0,0,NULL),(91,155,108,1,NULL,NULL,1,NULL,0,0,NULL),(92,29,108,1,NULL,NULL,1,NULL,0,0,NULL),(93,155,54,1,NULL,NULL,1,NULL,0,0,NULL),(94,29,54,1,NULL,NULL,1,NULL,0,0,NULL),(95,29,155,4,NULL,NULL,1,NULL,0,0,NULL),(96,54,115,8,NULL,NULL,1,NULL,0,0,NULL),(97,155,115,8,NULL,NULL,1,NULL,0,0,NULL),(98,29,115,8,NULL,NULL,1,NULL,0,0,NULL),(99,108,115,7,NULL,NULL,1,NULL,0,0,NULL),(100,54,108,2,NULL,NULL,1,NULL,0,0,NULL),(101,63,103,1,NULL,NULL,1,NULL,0,0,NULL),(102,95,103,1,NULL,NULL,1,NULL,0,0,NULL),(103,63,201,1,NULL,NULL,1,NULL,0,0,NULL),(104,95,201,1,NULL,NULL,1,NULL,0,0,NULL),(105,95,63,4,NULL,NULL,1,NULL,0,0,NULL),(106,201,35,8,NULL,NULL,1,NULL,0,0,NULL),(107,63,35,8,NULL,NULL,1,NULL,0,0,NULL),(108,95,35,8,NULL,NULL,1,NULL,0,0,NULL),(109,103,35,7,NULL,NULL,1,NULL,0,0,NULL),(110,201,103,2,NULL,NULL,1,NULL,0,0,NULL),(111,114,107,1,NULL,NULL,1,NULL,0,0,NULL),(112,70,107,1,NULL,NULL,1,NULL,0,0,NULL),(113,114,68,1,NULL,NULL,1,NULL,0,0,NULL),(114,70,68,1,NULL,NULL,1,NULL,0,0,NULL),(115,70,114,4,NULL,NULL,1,NULL,0,0,NULL),(116,68,177,8,NULL,NULL,1,NULL,0,0,NULL),(117,114,177,8,NULL,NULL,1,NULL,0,0,NULL),(118,70,177,8,NULL,NULL,1,NULL,0,0,NULL),(119,107,177,7,NULL,NULL,1,NULL,0,0,NULL),(120,68,107,2,NULL,NULL,1,NULL,0,0,NULL),(121,140,10,1,NULL,NULL,1,NULL,0,0,NULL),(122,58,10,1,NULL,NULL,1,NULL,0,0,NULL),(123,140,130,1,NULL,NULL,1,NULL,0,0,NULL),(124,58,130,1,NULL,NULL,1,NULL,0,0,NULL),(125,58,140,4,NULL,NULL,1,NULL,0,0,NULL),(126,130,150,8,NULL,NULL,1,NULL,0,0,NULL),(127,140,150,8,NULL,NULL,1,NULL,0,0,NULL),(128,58,150,8,NULL,NULL,1,NULL,0,0,NULL),(129,10,150,7,NULL,NULL,1,NULL,0,0,NULL),(130,130,10,2,NULL,NULL,1,NULL,0,0,NULL),(131,78,187,1,NULL,NULL,1,NULL,0,0,NULL),(132,181,187,1,NULL,NULL,1,NULL,0,0,NULL),(133,78,48,1,NULL,NULL,1,NULL,0,0,NULL),(134,181,48,1,NULL,NULL,1,NULL,0,0,NULL),(135,181,78,4,NULL,NULL,1,NULL,0,0,NULL),(136,48,72,8,NULL,NULL,1,NULL,0,0,NULL),(137,78,72,8,NULL,NULL,1,NULL,0,0,NULL),(138,181,72,8,NULL,NULL,1,NULL,0,0,NULL),(139,187,72,7,NULL,NULL,0,NULL,0,0,NULL),(140,48,187,2,NULL,NULL,0,NULL,0,0,NULL),(141,20,135,1,NULL,NULL,1,NULL,0,0,NULL),(142,13,135,1,NULL,NULL,1,NULL,0,0,NULL),(143,20,43,1,NULL,NULL,1,NULL,0,0,NULL),(144,13,43,1,NULL,NULL,1,NULL,0,0,NULL),(145,13,20,4,NULL,NULL,1,NULL,0,0,NULL),(146,43,21,8,NULL,NULL,1,NULL,0,0,NULL),(147,20,21,8,NULL,NULL,1,NULL,0,0,NULL),(148,13,21,8,NULL,NULL,1,NULL,0,0,NULL),(149,135,21,7,NULL,NULL,0,NULL,0,0,NULL),(150,43,135,2,NULL,NULL,0,NULL,0,0,NULL),(151,89,194,1,NULL,NULL,1,NULL,0,0,NULL),(152,75,194,1,NULL,NULL,1,NULL,0,0,NULL),(153,89,131,1,NULL,NULL,1,NULL,0,0,NULL),(154,75,131,1,NULL,NULL,1,NULL,0,0,NULL),(155,75,89,4,NULL,NULL,1,NULL,0,0,NULL),(156,131,19,8,NULL,NULL,1,NULL,0,0,NULL),(157,89,19,8,NULL,NULL,1,NULL,0,0,NULL),(158,75,19,8,NULL,NULL,1,NULL,0,0,NULL),(159,194,19,7,NULL,NULL,0,NULL,0,0,NULL),(160,131,194,2,NULL,NULL,0,NULL,0,0,NULL),(161,121,104,1,NULL,NULL,1,NULL,0,0,NULL),(162,39,104,1,NULL,NULL,1,NULL,0,0,NULL),(163,121,153,1,NULL,NULL,1,NULL,0,0,NULL),(164,39,153,1,NULL,NULL,1,NULL,0,0,NULL),(165,39,121,4,NULL,NULL,1,NULL,0,0,NULL),(166,153,168,8,NULL,NULL,1,NULL,0,0,NULL),(167,121,168,8,NULL,NULL,1,NULL,0,0,NULL),(168,39,168,8,NULL,NULL,1,NULL,0,0,NULL),(169,104,168,7,NULL,NULL,1,NULL,0,0,NULL),(170,153,104,2,NULL,NULL,1,NULL,0,0,NULL),(171,36,42,1,NULL,NULL,1,NULL,0,0,NULL),(172,26,42,1,NULL,NULL,1,NULL,0,0,NULL),(173,36,189,1,NULL,NULL,1,NULL,0,0,NULL),(174,26,189,1,NULL,NULL,1,NULL,0,0,NULL),(175,26,36,4,NULL,NULL,1,NULL,0,0,NULL),(176,189,101,8,NULL,NULL,1,NULL,0,0,NULL),(177,36,101,8,NULL,NULL,1,NULL,0,0,NULL),(178,26,101,8,NULL,NULL,1,NULL,0,0,NULL),(179,42,101,7,NULL,NULL,1,NULL,0,0,NULL),(180,189,42,2,NULL,NULL,1,NULL,0,0,NULL),(181,69,171,1,NULL,NULL,1,NULL,0,0,NULL),(182,109,171,1,NULL,NULL,1,NULL,0,0,NULL),(183,69,200,1,NULL,NULL,1,NULL,0,0,NULL),(184,109,200,1,NULL,NULL,1,NULL,0,0,NULL),(185,109,69,4,NULL,NULL,1,NULL,0,0,NULL),(186,200,98,8,NULL,NULL,1,NULL,0,0,NULL),(187,69,98,8,NULL,NULL,1,NULL,0,0,NULL),(188,109,98,8,NULL,NULL,1,NULL,0,0,NULL),(189,171,98,7,NULL,NULL,1,NULL,0,0,NULL),(190,200,171,2,NULL,NULL,1,NULL,0,0,NULL),(191,158,25,1,NULL,NULL,1,NULL,0,0,NULL),(192,4,25,1,NULL,NULL,1,NULL,0,0,NULL),(193,158,180,1,NULL,NULL,1,NULL,0,0,NULL),(194,4,180,1,NULL,NULL,1,NULL,0,0,NULL),(195,4,158,4,NULL,NULL,1,NULL,0,0,NULL),(196,180,163,8,NULL,NULL,1,NULL,0,0,NULL),(197,158,163,8,NULL,NULL,1,NULL,0,0,NULL),(198,4,163,8,NULL,NULL,1,NULL,0,0,NULL),(199,25,163,7,NULL,NULL,0,NULL,0,0,NULL),(200,180,25,2,NULL,NULL,0,NULL,0,0,NULL),(201,26,14,5,NULL,NULL,1,NULL,0,0,NULL),(202,36,37,5,NULL,NULL,1,NULL,0,0,NULL),(203,20,46,5,NULL,NULL,1,NULL,0,0,NULL),(204,89,50,5,NULL,NULL,1,NULL,0,0,NULL),(205,189,56,5,NULL,NULL,1,NULL,0,0,NULL),(206,29,62,5,NULL,NULL,1,NULL,0,0,NULL),(207,75,73,5,NULL,NULL,1,NULL,0,0,NULL),(208,197,86,5,NULL,NULL,1,NULL,0,0,NULL),(209,120,91,5,NULL,NULL,1,NULL,0,0,NULL),(210,151,105,5,NULL,NULL,1,NULL,0,0,NULL),(211,85,117,5,NULL,NULL,1,NULL,0,0,NULL),(212,34,137,5,NULL,NULL,1,NULL,0,0,NULL),(213,170,142,5,NULL,NULL,1,NULL,0,0,NULL),(214,18,144,5,NULL,NULL,1,NULL,0,0,NULL),(215,104,148,5,NULL,NULL,1,NULL,0,0,NULL),(216,57,157,5,NULL,NULL,1,NULL,0,0,NULL),(217,185,174,5,NULL,NULL,1,NULL,0,0,NULL),(218,186,178,5,NULL,NULL,1,NULL,0,0,NULL); +INSERT INTO `civicrm_relationship` (`id`, `contact_id_a`, `contact_id_b`, `relationship_type_id`, `start_date`, `end_date`, `is_active`, `description`, `is_permission_a_b`, `is_permission_b_a`, `case_id`) VALUES (1,76,40,1,NULL,NULL,1,NULL,0,0,NULL),(2,75,40,1,NULL,NULL,1,NULL,0,0,NULL),(3,76,158,1,NULL,NULL,1,NULL,0,0,NULL),(4,75,158,1,NULL,NULL,1,NULL,0,0,NULL),(5,75,76,4,NULL,NULL,1,NULL,0,0,NULL),(6,158,68,8,NULL,NULL,1,NULL,0,0,NULL),(7,76,68,8,NULL,NULL,1,NULL,0,0,NULL),(8,75,68,8,NULL,NULL,1,NULL,0,0,NULL),(9,40,68,7,NULL,NULL,1,NULL,0,0,NULL),(10,158,40,2,NULL,NULL,1,NULL,0,0,NULL),(11,97,43,1,NULL,NULL,1,NULL,0,0,NULL),(12,89,43,1,NULL,NULL,1,NULL,0,0,NULL),(13,97,131,1,NULL,NULL,1,NULL,0,0,NULL),(14,89,131,1,NULL,NULL,1,NULL,0,0,NULL),(15,89,97,4,NULL,NULL,1,NULL,0,0,NULL),(16,131,82,8,NULL,NULL,1,NULL,0,0,NULL),(17,97,82,8,NULL,NULL,1,NULL,0,0,NULL),(18,89,82,8,NULL,NULL,1,NULL,0,0,NULL),(19,43,82,7,NULL,NULL,1,NULL,0,0,NULL),(20,131,43,2,NULL,NULL,1,NULL,0,0,NULL),(21,10,124,1,NULL,NULL,1,NULL,0,0,NULL),(22,134,124,1,NULL,NULL,1,NULL,0,0,NULL),(23,10,26,1,NULL,NULL,1,NULL,0,0,NULL),(24,134,26,1,NULL,NULL,1,NULL,0,0,NULL),(25,134,10,4,NULL,NULL,1,NULL,0,0,NULL),(26,26,180,8,NULL,NULL,1,NULL,0,0,NULL),(27,10,180,8,NULL,NULL,1,NULL,0,0,NULL),(28,134,180,8,NULL,NULL,1,NULL,0,0,NULL),(29,124,180,7,NULL,NULL,1,NULL,0,0,NULL),(30,26,124,2,NULL,NULL,1,NULL,0,0,NULL),(31,178,45,1,NULL,NULL,1,NULL,0,0,NULL),(32,179,45,1,NULL,NULL,1,NULL,0,0,NULL),(33,178,22,1,NULL,NULL,1,NULL,0,0,NULL),(34,179,22,1,NULL,NULL,1,NULL,0,0,NULL),(35,179,178,4,NULL,NULL,1,NULL,0,0,NULL),(36,22,50,8,NULL,NULL,1,NULL,0,0,NULL),(37,178,50,8,NULL,NULL,1,NULL,0,0,NULL),(38,179,50,8,NULL,NULL,1,NULL,0,0,NULL),(39,45,50,7,NULL,NULL,1,NULL,0,0,NULL),(40,22,45,2,NULL,NULL,1,NULL,0,0,NULL),(41,57,66,1,NULL,NULL,1,NULL,0,0,NULL),(42,157,66,1,NULL,NULL,1,NULL,0,0,NULL),(43,57,138,1,NULL,NULL,1,NULL,0,0,NULL),(44,157,138,1,NULL,NULL,1,NULL,0,0,NULL),(45,157,57,4,NULL,NULL,1,NULL,0,0,NULL),(46,138,56,8,NULL,NULL,1,NULL,0,0,NULL),(47,57,56,8,NULL,NULL,1,NULL,0,0,NULL),(48,157,56,8,NULL,NULL,1,NULL,0,0,NULL),(49,66,56,7,NULL,NULL,0,NULL,0,0,NULL),(50,138,66,2,NULL,NULL,0,NULL,0,0,NULL),(51,159,142,1,NULL,NULL,1,NULL,0,0,NULL),(52,145,142,1,NULL,NULL,1,NULL,0,0,NULL),(53,159,196,1,NULL,NULL,1,NULL,0,0,NULL),(54,145,196,1,NULL,NULL,1,NULL,0,0,NULL),(55,145,159,4,NULL,NULL,1,NULL,0,0,NULL),(56,196,122,8,NULL,NULL,1,NULL,0,0,NULL),(57,159,122,8,NULL,NULL,1,NULL,0,0,NULL),(58,145,122,8,NULL,NULL,1,NULL,0,0,NULL),(59,142,122,7,NULL,NULL,1,NULL,0,0,NULL),(60,196,142,2,NULL,NULL,1,NULL,0,0,NULL),(61,30,163,1,NULL,NULL,1,NULL,0,0,NULL),(62,113,163,1,NULL,NULL,1,NULL,0,0,NULL),(63,30,106,1,NULL,NULL,1,NULL,0,0,NULL),(64,113,106,1,NULL,NULL,1,NULL,0,0,NULL),(65,113,30,4,NULL,NULL,1,NULL,0,0,NULL),(66,106,144,8,NULL,NULL,1,NULL,0,0,NULL),(67,30,144,8,NULL,NULL,1,NULL,0,0,NULL),(68,113,144,8,NULL,NULL,1,NULL,0,0,NULL),(69,163,144,7,NULL,NULL,1,NULL,0,0,NULL),(70,106,163,2,NULL,NULL,1,NULL,0,0,NULL),(71,19,67,1,NULL,NULL,1,NULL,0,0,NULL),(72,105,67,1,NULL,NULL,1,NULL,0,0,NULL),(73,19,29,1,NULL,NULL,1,NULL,0,0,NULL),(74,105,29,1,NULL,NULL,1,NULL,0,0,NULL),(75,105,19,4,NULL,NULL,1,NULL,0,0,NULL),(76,29,166,8,NULL,NULL,1,NULL,0,0,NULL),(77,19,166,8,NULL,NULL,1,NULL,0,0,NULL),(78,105,166,8,NULL,NULL,1,NULL,0,0,NULL),(79,67,166,7,NULL,NULL,1,NULL,0,0,NULL),(80,29,67,2,NULL,NULL,1,NULL,0,0,NULL),(81,25,63,1,NULL,NULL,1,NULL,0,0,NULL),(82,186,63,1,NULL,NULL,1,NULL,0,0,NULL),(83,25,20,1,NULL,NULL,1,NULL,0,0,NULL),(84,186,20,1,NULL,NULL,1,NULL,0,0,NULL),(85,186,25,4,NULL,NULL,1,NULL,0,0,NULL),(86,20,81,8,NULL,NULL,1,NULL,0,0,NULL),(87,25,81,8,NULL,NULL,1,NULL,0,0,NULL),(88,186,81,8,NULL,NULL,1,NULL,0,0,NULL),(89,63,81,7,NULL,NULL,0,NULL,0,0,NULL),(90,20,63,2,NULL,NULL,0,NULL,0,0,NULL),(91,136,48,1,NULL,NULL,1,NULL,0,0,NULL),(92,123,48,1,NULL,NULL,1,NULL,0,0,NULL),(93,136,52,1,NULL,NULL,1,NULL,0,0,NULL),(94,123,52,1,NULL,NULL,1,NULL,0,0,NULL),(95,123,136,4,NULL,NULL,1,NULL,0,0,NULL),(96,52,156,8,NULL,NULL,1,NULL,0,0,NULL),(97,136,156,8,NULL,NULL,1,NULL,0,0,NULL),(98,123,156,8,NULL,NULL,1,NULL,0,0,NULL),(99,48,156,7,NULL,NULL,1,NULL,0,0,NULL),(100,52,48,2,NULL,NULL,1,NULL,0,0,NULL),(101,96,150,1,NULL,NULL,1,NULL,0,0,NULL),(102,135,150,1,NULL,NULL,1,NULL,0,0,NULL),(103,96,153,1,NULL,NULL,1,NULL,0,0,NULL),(104,135,153,1,NULL,NULL,1,NULL,0,0,NULL),(105,135,96,4,NULL,NULL,1,NULL,0,0,NULL),(106,153,37,8,NULL,NULL,1,NULL,0,0,NULL),(107,96,37,8,NULL,NULL,1,NULL,0,0,NULL),(108,135,37,8,NULL,NULL,1,NULL,0,0,NULL),(109,150,37,7,NULL,NULL,1,NULL,0,0,NULL),(110,153,150,2,NULL,NULL,1,NULL,0,0,NULL),(111,175,27,1,NULL,NULL,1,NULL,0,0,NULL),(112,110,27,1,NULL,NULL,1,NULL,0,0,NULL),(113,175,6,1,NULL,NULL,1,NULL,0,0,NULL),(114,110,6,1,NULL,NULL,1,NULL,0,0,NULL),(115,110,175,4,NULL,NULL,1,NULL,0,0,NULL),(116,6,141,8,NULL,NULL,1,NULL,0,0,NULL),(117,175,141,8,NULL,NULL,1,NULL,0,0,NULL),(118,110,141,8,NULL,NULL,1,NULL,0,0,NULL),(119,27,141,7,NULL,NULL,1,NULL,0,0,NULL),(120,6,27,2,NULL,NULL,1,NULL,0,0,NULL),(121,24,84,1,NULL,NULL,1,NULL,0,0,NULL),(122,90,84,1,NULL,NULL,1,NULL,0,0,NULL),(123,24,200,1,NULL,NULL,1,NULL,0,0,NULL),(124,90,200,1,NULL,NULL,1,NULL,0,0,NULL),(125,90,24,4,NULL,NULL,1,NULL,0,0,NULL),(126,200,174,8,NULL,NULL,1,NULL,0,0,NULL),(127,24,174,8,NULL,NULL,1,NULL,0,0,NULL),(128,90,174,8,NULL,NULL,1,NULL,0,0,NULL),(129,84,174,7,NULL,NULL,1,NULL,0,0,NULL),(130,200,84,2,NULL,NULL,1,NULL,0,0,NULL),(131,2,120,1,NULL,NULL,1,NULL,0,0,NULL),(132,128,120,1,NULL,NULL,1,NULL,0,0,NULL),(133,2,3,1,NULL,NULL,1,NULL,0,0,NULL),(134,128,3,1,NULL,NULL,1,NULL,0,0,NULL),(135,128,2,4,NULL,NULL,1,NULL,0,0,NULL),(136,3,127,8,NULL,NULL,1,NULL,0,0,NULL),(137,2,127,8,NULL,NULL,1,NULL,0,0,NULL),(138,128,127,8,NULL,NULL,1,NULL,0,0,NULL),(139,120,127,7,NULL,NULL,0,NULL,0,0,NULL),(140,3,120,2,NULL,NULL,0,NULL,0,0,NULL),(141,143,146,1,NULL,NULL,1,NULL,0,0,NULL),(142,195,146,1,NULL,NULL,1,NULL,0,0,NULL),(143,143,18,1,NULL,NULL,1,NULL,0,0,NULL),(144,195,18,1,NULL,NULL,1,NULL,0,0,NULL),(145,195,143,4,NULL,NULL,1,NULL,0,0,NULL),(146,18,53,8,NULL,NULL,1,NULL,0,0,NULL),(147,143,53,8,NULL,NULL,1,NULL,0,0,NULL),(148,195,53,8,NULL,NULL,1,NULL,0,0,NULL),(149,146,53,7,NULL,NULL,0,NULL,0,0,NULL),(150,18,146,2,NULL,NULL,0,NULL,0,0,NULL),(151,72,4,1,NULL,NULL,1,NULL,0,0,NULL),(152,58,4,1,NULL,NULL,1,NULL,0,0,NULL),(153,72,177,1,NULL,NULL,1,NULL,0,0,NULL),(154,58,177,1,NULL,NULL,1,NULL,0,0,NULL),(155,58,72,4,NULL,NULL,1,NULL,0,0,NULL),(156,177,155,8,NULL,NULL,1,NULL,0,0,NULL),(157,72,155,8,NULL,NULL,1,NULL,0,0,NULL),(158,58,155,8,NULL,NULL,1,NULL,0,0,NULL),(159,4,155,7,NULL,NULL,0,NULL,0,0,NULL),(160,177,4,2,NULL,NULL,0,NULL,0,0,NULL),(161,148,54,1,NULL,NULL,1,NULL,0,0,NULL),(162,109,54,1,NULL,NULL,1,NULL,0,0,NULL),(163,148,98,1,NULL,NULL,1,NULL,0,0,NULL),(164,109,98,1,NULL,NULL,1,NULL,0,0,NULL),(165,109,148,4,NULL,NULL,1,NULL,0,0,NULL),(166,98,41,8,NULL,NULL,1,NULL,0,0,NULL),(167,148,41,8,NULL,NULL,1,NULL,0,0,NULL),(168,109,41,8,NULL,NULL,1,NULL,0,0,NULL),(169,54,41,7,NULL,NULL,1,NULL,0,0,NULL),(170,98,54,2,NULL,NULL,1,NULL,0,0,NULL),(171,71,69,1,NULL,NULL,1,NULL,0,0,NULL),(172,107,69,1,NULL,NULL,1,NULL,0,0,NULL),(173,71,188,1,NULL,NULL,1,NULL,0,0,NULL),(174,107,188,1,NULL,NULL,1,NULL,0,0,NULL),(175,107,71,4,NULL,NULL,1,NULL,0,0,NULL),(176,188,13,8,NULL,NULL,1,NULL,0,0,NULL),(177,71,13,8,NULL,NULL,1,NULL,0,0,NULL),(178,107,13,8,NULL,NULL,1,NULL,0,0,NULL),(179,69,13,7,NULL,NULL,0,NULL,0,0,NULL),(180,188,69,2,NULL,NULL,0,NULL,0,0,NULL),(181,80,83,1,NULL,NULL,1,NULL,0,0,NULL),(182,169,83,1,NULL,NULL,1,NULL,0,0,NULL),(183,80,85,1,NULL,NULL,1,NULL,0,0,NULL),(184,169,85,1,NULL,NULL,1,NULL,0,0,NULL),(185,169,80,4,NULL,NULL,1,NULL,0,0,NULL),(186,85,62,8,NULL,NULL,1,NULL,0,0,NULL),(187,80,62,8,NULL,NULL,1,NULL,0,0,NULL),(188,169,62,8,NULL,NULL,1,NULL,0,0,NULL),(189,83,62,7,NULL,NULL,1,NULL,0,0,NULL),(190,85,83,2,NULL,NULL,1,NULL,0,0,NULL),(191,5,116,1,NULL,NULL,1,NULL,0,0,NULL),(192,140,116,1,NULL,NULL,1,NULL,0,0,NULL),(193,5,115,1,NULL,NULL,1,NULL,0,0,NULL),(194,140,115,1,NULL,NULL,1,NULL,0,0,NULL),(195,140,5,4,NULL,NULL,1,NULL,0,0,NULL),(196,115,198,8,NULL,NULL,1,NULL,0,0,NULL),(197,5,198,8,NULL,NULL,1,NULL,0,0,NULL),(198,140,198,8,NULL,NULL,1,NULL,0,0,NULL),(199,116,198,7,NULL,NULL,1,NULL,0,0,NULL),(200,115,116,2,NULL,NULL,1,NULL,0,0,NULL),(201,4,15,5,NULL,NULL,1,NULL,0,0,NULL),(202,153,21,5,NULL,NULL,1,NULL,0,0,NULL),(203,52,23,5,NULL,NULL,1,NULL,0,0,NULL),(204,169,39,5,NULL,NULL,1,NULL,0,0,NULL),(205,110,70,5,NULL,NULL,1,NULL,0,0,NULL),(206,28,73,5,NULL,NULL,1,NULL,0,0,NULL),(207,54,74,5,NULL,NULL,1,NULL,0,0,NULL),(208,85,77,5,NULL,NULL,1,NULL,0,0,NULL),(209,87,93,5,NULL,NULL,1,NULL,0,0,NULL),(210,78,101,5,NULL,NULL,1,NULL,0,0,NULL),(211,24,102,5,NULL,NULL,1,NULL,0,0,NULL),(212,175,103,5,NULL,NULL,1,NULL,0,0,NULL),(213,111,129,5,NULL,NULL,1,NULL,0,0,NULL),(214,3,165,5,NULL,NULL,1,NULL,0,0,NULL),(215,12,167,5,NULL,NULL,1,NULL,0,0,NULL),(216,91,170,5,NULL,NULL,1,NULL,0,0,NULL),(217,147,172,5,NULL,NULL,1,NULL,0,0,NULL); /*!40000 ALTER TABLE `civicrm_relationship` ENABLE KEYS */; UNLOCK TABLES; @@ -1271,7 +1271,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_relationship_cache` WRITE; /*!40000 ALTER TABLE `civicrm_relationship_cache` DISABLE KEYS */; -INSERT INTO `civicrm_relationship_cache` (`id`, `relationship_id`, `relationship_type_id`, `orientation`, `near_contact_id`, `near_relation`, `far_contact_id`, `far_relation`, `is_active`, `start_date`, `end_date`) VALUES (1,1,1,'a_b',74,'Child of',172,'Parent of',1,NULL,NULL),(2,1,1,'b_a',172,'Parent of',74,'Child of',1,NULL,NULL),(3,2,1,'a_b',47,'Child of',172,'Parent of',1,NULL,NULL),(4,2,1,'b_a',172,'Parent of',47,'Child of',1,NULL,NULL),(5,3,1,'a_b',74,'Child of',125,'Parent of',1,NULL,NULL),(6,3,1,'b_a',125,'Parent of',74,'Child of',1,NULL,NULL),(7,4,1,'a_b',47,'Child of',125,'Parent of',1,NULL,NULL),(8,4,1,'b_a',125,'Parent of',47,'Child of',1,NULL,NULL),(9,5,4,'a_b',47,'Sibling of',74,'Sibling of',1,NULL,NULL),(10,5,4,'b_a',74,'Sibling of',47,'Sibling of',1,NULL,NULL),(11,6,8,'a_b',125,'Household Member of',11,'Household Member is',1,NULL,NULL),(12,6,8,'b_a',11,'Household Member is',125,'Household Member of',1,NULL,NULL),(13,7,8,'a_b',74,'Household Member of',11,'Household Member is',1,NULL,NULL),(14,7,8,'b_a',11,'Household Member is',74,'Household Member of',1,NULL,NULL),(15,8,8,'a_b',47,'Household Member of',11,'Household Member is',1,NULL,NULL),(16,8,8,'b_a',11,'Household Member is',47,'Household Member of',1,NULL,NULL),(17,9,7,'a_b',172,'Head of Household for',11,'Head of Household is',0,NULL,NULL),(18,9,7,'b_a',11,'Head of Household is',172,'Head of Household for',0,NULL,NULL),(19,10,2,'a_b',125,'Spouse of',172,'Spouse of',0,NULL,NULL),(20,10,2,'b_a',172,'Spouse of',125,'Spouse of',0,NULL,NULL),(21,11,1,'a_b',126,'Child of',159,'Parent of',1,NULL,NULL),(22,11,1,'b_a',159,'Parent of',126,'Child of',1,NULL,NULL),(23,12,1,'a_b',9,'Child of',159,'Parent of',1,NULL,NULL),(24,12,1,'b_a',159,'Parent of',9,'Child of',1,NULL,NULL),(25,13,1,'a_b',126,'Child of',102,'Parent of',1,NULL,NULL),(26,13,1,'b_a',102,'Parent of',126,'Child of',1,NULL,NULL),(27,14,1,'a_b',9,'Child of',102,'Parent of',1,NULL,NULL),(28,14,1,'b_a',102,'Parent of',9,'Child of',1,NULL,NULL),(29,15,4,'a_b',9,'Sibling of',126,'Sibling of',1,NULL,NULL),(30,15,4,'b_a',126,'Sibling of',9,'Sibling of',1,NULL,NULL),(31,16,8,'a_b',102,'Household Member of',128,'Household Member is',1,NULL,NULL),(32,16,8,'b_a',128,'Household Member is',102,'Household Member of',1,NULL,NULL),(33,17,8,'a_b',126,'Household Member of',128,'Household Member is',1,NULL,NULL),(34,17,8,'b_a',128,'Household Member is',126,'Household Member of',1,NULL,NULL),(35,18,8,'a_b',9,'Household Member of',128,'Household Member is',1,NULL,NULL),(36,18,8,'b_a',128,'Household Member is',9,'Household Member of',1,NULL,NULL),(37,19,7,'a_b',159,'Head of Household for',128,'Head of Household is',0,NULL,NULL),(38,19,7,'b_a',128,'Head of Household is',159,'Head of Household for',0,NULL,NULL),(39,20,2,'a_b',102,'Spouse of',159,'Spouse of',0,NULL,NULL),(40,20,2,'b_a',159,'Spouse of',102,'Spouse of',0,NULL,NULL),(41,21,1,'a_b',40,'Child of',198,'Parent of',1,NULL,NULL),(42,21,1,'b_a',198,'Parent of',40,'Child of',1,NULL,NULL),(43,22,1,'a_b',85,'Child of',198,'Parent of',1,NULL,NULL),(44,22,1,'b_a',198,'Parent of',85,'Child of',1,NULL,NULL),(45,23,1,'a_b',40,'Child of',149,'Parent of',1,NULL,NULL),(46,23,1,'b_a',149,'Parent of',40,'Child of',1,NULL,NULL),(47,24,1,'a_b',85,'Child of',149,'Parent of',1,NULL,NULL),(48,24,1,'b_a',149,'Parent of',85,'Child of',1,NULL,NULL),(49,25,4,'a_b',85,'Sibling of',40,'Sibling of',1,NULL,NULL),(50,25,4,'b_a',40,'Sibling of',85,'Sibling of',1,NULL,NULL),(51,26,8,'a_b',149,'Household Member of',38,'Household Member is',1,NULL,NULL),(52,26,8,'b_a',38,'Household Member is',149,'Household Member of',1,NULL,NULL),(53,27,8,'a_b',40,'Household Member of',38,'Household Member is',1,NULL,NULL),(54,27,8,'b_a',38,'Household Member is',40,'Household Member of',1,NULL,NULL),(55,28,8,'a_b',85,'Household Member of',38,'Household Member is',1,NULL,NULL),(56,28,8,'b_a',38,'Household Member is',85,'Household Member of',1,NULL,NULL),(57,29,7,'a_b',198,'Head of Household for',38,'Head of Household is',1,NULL,NULL),(58,29,7,'b_a',38,'Head of Household is',198,'Head of Household for',1,NULL,NULL),(59,30,2,'a_b',149,'Spouse of',198,'Spouse of',1,NULL,NULL),(60,30,2,'b_a',198,'Spouse of',149,'Spouse of',1,NULL,NULL),(61,31,1,'a_b',134,'Child of',192,'Parent of',1,NULL,NULL),(62,31,1,'b_a',192,'Parent of',134,'Child of',1,NULL,NULL),(63,32,1,'a_b',100,'Child of',192,'Parent of',1,NULL,NULL),(64,32,1,'b_a',192,'Parent of',100,'Child of',1,NULL,NULL),(65,33,1,'a_b',134,'Child of',170,'Parent of',1,NULL,NULL),(66,33,1,'b_a',170,'Parent of',134,'Child of',1,NULL,NULL),(67,34,1,'a_b',100,'Child of',170,'Parent of',1,NULL,NULL),(68,34,1,'b_a',170,'Parent of',100,'Child of',1,NULL,NULL),(69,35,4,'a_b',100,'Sibling of',134,'Sibling of',1,NULL,NULL),(70,35,4,'b_a',134,'Sibling of',100,'Sibling of',1,NULL,NULL),(71,36,8,'a_b',170,'Household Member of',136,'Household Member is',1,NULL,NULL),(72,36,8,'b_a',136,'Household Member is',170,'Household Member of',1,NULL,NULL),(73,37,8,'a_b',134,'Household Member of',136,'Household Member is',1,NULL,NULL),(74,37,8,'b_a',136,'Household Member is',134,'Household Member of',1,NULL,NULL),(75,38,8,'a_b',100,'Household Member of',136,'Household Member is',1,NULL,NULL),(76,38,8,'b_a',136,'Household Member is',100,'Household Member of',1,NULL,NULL),(77,39,7,'a_b',192,'Head of Household for',136,'Head of Household is',0,NULL,NULL),(78,39,7,'b_a',136,'Head of Household is',192,'Head of Household for',0,NULL,NULL),(79,40,2,'a_b',170,'Spouse of',192,'Spouse of',0,NULL,NULL),(80,40,2,'b_a',192,'Spouse of',170,'Spouse of',0,NULL,NULL),(81,41,1,'a_b',59,'Child of',34,'Parent of',1,NULL,NULL),(82,41,1,'b_a',34,'Parent of',59,'Child of',1,NULL,NULL),(83,42,1,'a_b',110,'Child of',34,'Parent of',1,NULL,NULL),(84,42,1,'b_a',34,'Parent of',110,'Child of',1,NULL,NULL),(85,43,1,'a_b',59,'Child of',113,'Parent of',1,NULL,NULL),(86,43,1,'b_a',113,'Parent of',59,'Child of',1,NULL,NULL),(87,44,1,'a_b',110,'Child of',113,'Parent of',1,NULL,NULL),(88,44,1,'b_a',113,'Parent of',110,'Child of',1,NULL,NULL),(89,45,4,'a_b',110,'Sibling of',59,'Sibling of',1,NULL,NULL),(90,45,4,'b_a',59,'Sibling of',110,'Sibling of',1,NULL,NULL),(91,46,8,'a_b',113,'Household Member of',32,'Household Member is',1,NULL,NULL),(92,46,8,'b_a',32,'Household Member is',113,'Household Member of',1,NULL,NULL),(93,47,8,'a_b',59,'Household Member of',32,'Household Member is',1,NULL,NULL),(94,47,8,'b_a',32,'Household Member is',59,'Household Member of',1,NULL,NULL),(95,48,8,'a_b',110,'Household Member of',32,'Household Member is',1,NULL,NULL),(96,48,8,'b_a',32,'Household Member is',110,'Household Member of',1,NULL,NULL),(97,49,7,'a_b',34,'Head of Household for',32,'Head of Household is',1,NULL,NULL),(98,49,7,'b_a',32,'Head of Household is',34,'Head of Household for',1,NULL,NULL),(99,50,2,'a_b',113,'Spouse of',34,'Spouse of',1,NULL,NULL),(100,50,2,'b_a',34,'Spouse of',113,'Spouse of',1,NULL,NULL),(101,51,1,'a_b',147,'Child of',191,'Parent of',1,NULL,NULL),(102,51,1,'b_a',191,'Parent of',147,'Child of',1,NULL,NULL),(103,52,1,'a_b',151,'Child of',191,'Parent of',1,NULL,NULL),(104,52,1,'b_a',191,'Parent of',151,'Child of',1,NULL,NULL),(105,53,1,'a_b',147,'Child of',160,'Parent of',1,NULL,NULL),(106,53,1,'b_a',160,'Parent of',147,'Child of',1,NULL,NULL),(107,54,1,'a_b',151,'Child of',160,'Parent of',1,NULL,NULL),(108,54,1,'b_a',160,'Parent of',151,'Child of',1,NULL,NULL),(109,55,4,'a_b',151,'Sibling of',147,'Sibling of',1,NULL,NULL),(110,55,4,'b_a',147,'Sibling of',151,'Sibling of',1,NULL,NULL),(111,56,8,'a_b',160,'Household Member of',27,'Household Member is',1,NULL,NULL),(112,56,8,'b_a',27,'Household Member is',160,'Household Member of',1,NULL,NULL),(113,57,8,'a_b',147,'Household Member of',27,'Household Member is',1,NULL,NULL),(114,57,8,'b_a',27,'Household Member is',147,'Household Member of',1,NULL,NULL),(115,58,8,'a_b',151,'Household Member of',27,'Household Member is',1,NULL,NULL),(116,58,8,'b_a',27,'Household Member is',151,'Household Member of',1,NULL,NULL),(117,59,7,'a_b',191,'Head of Household for',27,'Head of Household is',1,NULL,NULL),(118,59,7,'b_a',27,'Head of Household is',191,'Head of Household for',1,NULL,NULL),(119,60,2,'a_b',160,'Spouse of',191,'Spouse of',1,NULL,NULL),(120,60,2,'b_a',191,'Spouse of',160,'Spouse of',1,NULL,NULL),(121,61,1,'a_b',94,'Child of',82,'Parent of',1,NULL,NULL),(122,61,1,'b_a',82,'Parent of',94,'Child of',1,NULL,NULL),(123,62,1,'a_b',188,'Child of',82,'Parent of',1,NULL,NULL),(124,62,1,'b_a',82,'Parent of',188,'Child of',1,NULL,NULL),(125,63,1,'a_b',94,'Child of',196,'Parent of',1,NULL,NULL),(126,63,1,'b_a',196,'Parent of',94,'Child of',1,NULL,NULL),(127,64,1,'a_b',188,'Child of',196,'Parent of',1,NULL,NULL),(128,64,1,'b_a',196,'Parent of',188,'Child of',1,NULL,NULL),(129,65,4,'a_b',188,'Sibling of',94,'Sibling of',1,NULL,NULL),(130,65,4,'b_a',94,'Sibling of',188,'Sibling of',1,NULL,NULL),(131,66,8,'a_b',196,'Household Member of',116,'Household Member is',1,NULL,NULL),(132,66,8,'b_a',116,'Household Member is',196,'Household Member of',1,NULL,NULL),(133,67,8,'a_b',94,'Household Member of',116,'Household Member is',1,NULL,NULL),(134,67,8,'b_a',116,'Household Member is',94,'Household Member of',1,NULL,NULL),(135,68,8,'a_b',188,'Household Member of',116,'Household Member is',1,NULL,NULL),(136,68,8,'b_a',116,'Household Member is',188,'Household Member of',1,NULL,NULL),(137,69,7,'a_b',82,'Head of Household for',116,'Head of Household is',0,NULL,NULL),(138,69,7,'b_a',116,'Head of Household is',82,'Head of Household for',0,NULL,NULL),(139,70,2,'a_b',196,'Spouse of',82,'Spouse of',0,NULL,NULL),(140,70,2,'b_a',82,'Spouse of',196,'Spouse of',0,NULL,NULL),(141,71,1,'a_b',28,'Child of',195,'Parent of',1,NULL,NULL),(142,71,1,'b_a',195,'Parent of',28,'Child of',1,NULL,NULL),(143,72,1,'a_b',133,'Child of',195,'Parent of',1,NULL,NULL),(144,72,1,'b_a',195,'Parent of',133,'Child of',1,NULL,NULL),(145,73,1,'a_b',28,'Child of',173,'Parent of',1,NULL,NULL),(146,73,1,'b_a',173,'Parent of',28,'Child of',1,NULL,NULL),(147,74,1,'a_b',133,'Child of',173,'Parent of',1,NULL,NULL),(148,74,1,'b_a',173,'Parent of',133,'Child of',1,NULL,NULL),(149,75,4,'a_b',133,'Sibling of',28,'Sibling of',1,NULL,NULL),(150,75,4,'b_a',28,'Sibling of',133,'Sibling of',1,NULL,NULL),(151,76,8,'a_b',173,'Household Member of',106,'Household Member is',1,NULL,NULL),(152,76,8,'b_a',106,'Household Member is',173,'Household Member of',1,NULL,NULL),(153,77,8,'a_b',28,'Household Member of',106,'Household Member is',1,NULL,NULL),(154,77,8,'b_a',106,'Household Member is',28,'Household Member of',1,NULL,NULL),(155,78,8,'a_b',133,'Household Member of',106,'Household Member is',1,NULL,NULL),(156,78,8,'b_a',106,'Household Member is',133,'Household Member of',1,NULL,NULL),(157,79,7,'a_b',195,'Head of Household for',106,'Head of Household is',0,NULL,NULL),(158,79,7,'b_a',106,'Head of Household is',195,'Head of Household for',0,NULL,NULL),(159,80,2,'a_b',173,'Spouse of',195,'Spouse of',0,NULL,NULL),(160,80,2,'b_a',195,'Spouse of',173,'Spouse of',0,NULL,NULL),(161,81,1,'a_b',152,'Child of',141,'Parent of',1,NULL,NULL),(162,81,1,'b_a',141,'Parent of',152,'Child of',1,NULL,NULL),(163,82,1,'a_b',61,'Child of',141,'Parent of',1,NULL,NULL),(164,82,1,'b_a',141,'Parent of',61,'Child of',1,NULL,NULL),(165,83,1,'a_b',152,'Child of',112,'Parent of',1,NULL,NULL),(166,83,1,'b_a',112,'Parent of',152,'Child of',1,NULL,NULL),(167,84,1,'a_b',61,'Child of',112,'Parent of',1,NULL,NULL),(168,84,1,'b_a',112,'Parent of',61,'Child of',1,NULL,NULL),(169,85,4,'a_b',61,'Sibling of',152,'Sibling of',1,NULL,NULL),(170,85,4,'b_a',152,'Sibling of',61,'Sibling of',1,NULL,NULL),(171,86,8,'a_b',112,'Household Member of',22,'Household Member is',1,NULL,NULL),(172,86,8,'b_a',22,'Household Member is',112,'Household Member of',1,NULL,NULL),(173,87,8,'a_b',152,'Household Member of',22,'Household Member is',1,NULL,NULL),(174,87,8,'b_a',22,'Household Member is',152,'Household Member of',1,NULL,NULL),(175,88,8,'a_b',61,'Household Member of',22,'Household Member is',1,NULL,NULL),(176,88,8,'b_a',22,'Household Member is',61,'Household Member of',1,NULL,NULL),(177,89,7,'a_b',141,'Head of Household for',22,'Head of Household is',1,NULL,NULL),(178,89,7,'b_a',22,'Head of Household is',141,'Head of Household for',1,NULL,NULL),(179,90,2,'a_b',112,'Spouse of',141,'Spouse of',1,NULL,NULL),(180,90,2,'b_a',141,'Spouse of',112,'Spouse of',1,NULL,NULL),(181,91,1,'a_b',155,'Child of',108,'Parent of',1,NULL,NULL),(182,91,1,'b_a',108,'Parent of',155,'Child of',1,NULL,NULL),(183,92,1,'a_b',29,'Child of',108,'Parent of',1,NULL,NULL),(184,92,1,'b_a',108,'Parent of',29,'Child of',1,NULL,NULL),(185,93,1,'a_b',155,'Child of',54,'Parent of',1,NULL,NULL),(186,93,1,'b_a',54,'Parent of',155,'Child of',1,NULL,NULL),(187,94,1,'a_b',29,'Child of',54,'Parent of',1,NULL,NULL),(188,94,1,'b_a',54,'Parent of',29,'Child of',1,NULL,NULL),(189,95,4,'a_b',29,'Sibling of',155,'Sibling of',1,NULL,NULL),(190,95,4,'b_a',155,'Sibling of',29,'Sibling of',1,NULL,NULL),(191,96,8,'a_b',54,'Household Member of',115,'Household Member is',1,NULL,NULL),(192,96,8,'b_a',115,'Household Member is',54,'Household Member of',1,NULL,NULL),(193,97,8,'a_b',155,'Household Member of',115,'Household Member is',1,NULL,NULL),(194,97,8,'b_a',115,'Household Member is',155,'Household Member of',1,NULL,NULL),(195,98,8,'a_b',29,'Household Member of',115,'Household Member is',1,NULL,NULL),(196,98,8,'b_a',115,'Household Member is',29,'Household Member of',1,NULL,NULL),(197,99,7,'a_b',108,'Head of Household for',115,'Head of Household is',1,NULL,NULL),(198,99,7,'b_a',115,'Head of Household is',108,'Head of Household for',1,NULL,NULL),(199,100,2,'a_b',54,'Spouse of',108,'Spouse of',1,NULL,NULL),(200,100,2,'b_a',108,'Spouse of',54,'Spouse of',1,NULL,NULL),(201,101,1,'a_b',63,'Child of',103,'Parent of',1,NULL,NULL),(202,101,1,'b_a',103,'Parent of',63,'Child of',1,NULL,NULL),(203,102,1,'a_b',95,'Child of',103,'Parent of',1,NULL,NULL),(204,102,1,'b_a',103,'Parent of',95,'Child of',1,NULL,NULL),(205,103,1,'a_b',63,'Child of',201,'Parent of',1,NULL,NULL),(206,103,1,'b_a',201,'Parent of',63,'Child of',1,NULL,NULL),(207,104,1,'a_b',95,'Child of',201,'Parent of',1,NULL,NULL),(208,104,1,'b_a',201,'Parent of',95,'Child of',1,NULL,NULL),(209,105,4,'a_b',95,'Sibling of',63,'Sibling of',1,NULL,NULL),(210,105,4,'b_a',63,'Sibling of',95,'Sibling of',1,NULL,NULL),(211,106,8,'a_b',201,'Household Member of',35,'Household Member is',1,NULL,NULL),(212,106,8,'b_a',35,'Household Member is',201,'Household Member of',1,NULL,NULL),(213,107,8,'a_b',63,'Household Member of',35,'Household Member is',1,NULL,NULL),(214,107,8,'b_a',35,'Household Member is',63,'Household Member of',1,NULL,NULL),(215,108,8,'a_b',95,'Household Member of',35,'Household Member is',1,NULL,NULL),(216,108,8,'b_a',35,'Household Member is',95,'Household Member of',1,NULL,NULL),(217,109,7,'a_b',103,'Head of Household for',35,'Head of Household is',1,NULL,NULL),(218,109,7,'b_a',35,'Head of Household is',103,'Head of Household for',1,NULL,NULL),(219,110,2,'a_b',201,'Spouse of',103,'Spouse of',1,NULL,NULL),(220,110,2,'b_a',103,'Spouse of',201,'Spouse of',1,NULL,NULL),(221,111,1,'a_b',114,'Child of',107,'Parent of',1,NULL,NULL),(222,111,1,'b_a',107,'Parent of',114,'Child of',1,NULL,NULL),(223,112,1,'a_b',70,'Child of',107,'Parent of',1,NULL,NULL),(224,112,1,'b_a',107,'Parent of',70,'Child of',1,NULL,NULL),(225,113,1,'a_b',114,'Child of',68,'Parent of',1,NULL,NULL),(226,113,1,'b_a',68,'Parent of',114,'Child of',1,NULL,NULL),(227,114,1,'a_b',70,'Child of',68,'Parent of',1,NULL,NULL),(228,114,1,'b_a',68,'Parent of',70,'Child of',1,NULL,NULL),(229,115,4,'a_b',70,'Sibling of',114,'Sibling of',1,NULL,NULL),(230,115,4,'b_a',114,'Sibling of',70,'Sibling of',1,NULL,NULL),(231,116,8,'a_b',68,'Household Member of',177,'Household Member is',1,NULL,NULL),(232,116,8,'b_a',177,'Household Member is',68,'Household Member of',1,NULL,NULL),(233,117,8,'a_b',114,'Household Member of',177,'Household Member is',1,NULL,NULL),(234,117,8,'b_a',177,'Household Member is',114,'Household Member of',1,NULL,NULL),(235,118,8,'a_b',70,'Household Member of',177,'Household Member is',1,NULL,NULL),(236,118,8,'b_a',177,'Household Member is',70,'Household Member of',1,NULL,NULL),(237,119,7,'a_b',107,'Head of Household for',177,'Head of Household is',1,NULL,NULL),(238,119,7,'b_a',177,'Head of Household is',107,'Head of Household for',1,NULL,NULL),(239,120,2,'a_b',68,'Spouse of',107,'Spouse of',1,NULL,NULL),(240,120,2,'b_a',107,'Spouse of',68,'Spouse of',1,NULL,NULL),(241,121,1,'a_b',140,'Child of',10,'Parent of',1,NULL,NULL),(242,121,1,'b_a',10,'Parent of',140,'Child of',1,NULL,NULL),(243,122,1,'a_b',58,'Child of',10,'Parent of',1,NULL,NULL),(244,122,1,'b_a',10,'Parent of',58,'Child of',1,NULL,NULL),(245,123,1,'a_b',140,'Child of',130,'Parent of',1,NULL,NULL),(246,123,1,'b_a',130,'Parent of',140,'Child of',1,NULL,NULL),(247,124,1,'a_b',58,'Child of',130,'Parent of',1,NULL,NULL),(248,124,1,'b_a',130,'Parent of',58,'Child of',1,NULL,NULL),(249,125,4,'a_b',58,'Sibling of',140,'Sibling of',1,NULL,NULL),(250,125,4,'b_a',140,'Sibling of',58,'Sibling of',1,NULL,NULL),(251,126,8,'a_b',130,'Household Member of',150,'Household Member is',1,NULL,NULL),(252,126,8,'b_a',150,'Household Member is',130,'Household Member of',1,NULL,NULL),(253,127,8,'a_b',140,'Household Member of',150,'Household Member is',1,NULL,NULL),(254,127,8,'b_a',150,'Household Member is',140,'Household Member of',1,NULL,NULL),(255,128,8,'a_b',58,'Household Member of',150,'Household Member is',1,NULL,NULL),(256,128,8,'b_a',150,'Household Member is',58,'Household Member of',1,NULL,NULL),(257,129,7,'a_b',10,'Head of Household for',150,'Head of Household is',1,NULL,NULL),(258,129,7,'b_a',150,'Head of Household is',10,'Head of Household for',1,NULL,NULL),(259,130,2,'a_b',130,'Spouse of',10,'Spouse of',1,NULL,NULL),(260,130,2,'b_a',10,'Spouse of',130,'Spouse of',1,NULL,NULL),(261,131,1,'a_b',78,'Child of',187,'Parent of',1,NULL,NULL),(262,131,1,'b_a',187,'Parent of',78,'Child of',1,NULL,NULL),(263,132,1,'a_b',181,'Child of',187,'Parent of',1,NULL,NULL),(264,132,1,'b_a',187,'Parent of',181,'Child of',1,NULL,NULL),(265,133,1,'a_b',78,'Child of',48,'Parent of',1,NULL,NULL),(266,133,1,'b_a',48,'Parent of',78,'Child of',1,NULL,NULL),(267,134,1,'a_b',181,'Child of',48,'Parent of',1,NULL,NULL),(268,134,1,'b_a',48,'Parent of',181,'Child of',1,NULL,NULL),(269,135,4,'a_b',181,'Sibling of',78,'Sibling of',1,NULL,NULL),(270,135,4,'b_a',78,'Sibling of',181,'Sibling of',1,NULL,NULL),(271,136,8,'a_b',48,'Household Member of',72,'Household Member is',1,NULL,NULL),(272,136,8,'b_a',72,'Household Member is',48,'Household Member of',1,NULL,NULL),(273,137,8,'a_b',78,'Household Member of',72,'Household Member is',1,NULL,NULL),(274,137,8,'b_a',72,'Household Member is',78,'Household Member of',1,NULL,NULL),(275,138,8,'a_b',181,'Household Member of',72,'Household Member is',1,NULL,NULL),(276,138,8,'b_a',72,'Household Member is',181,'Household Member of',1,NULL,NULL),(277,139,7,'a_b',187,'Head of Household for',72,'Head of Household is',0,NULL,NULL),(278,139,7,'b_a',72,'Head of Household is',187,'Head of Household for',0,NULL,NULL),(279,140,2,'a_b',48,'Spouse of',187,'Spouse of',0,NULL,NULL),(280,140,2,'b_a',187,'Spouse of',48,'Spouse of',0,NULL,NULL),(281,141,1,'a_b',20,'Child of',135,'Parent of',1,NULL,NULL),(282,141,1,'b_a',135,'Parent of',20,'Child of',1,NULL,NULL),(283,142,1,'a_b',13,'Child of',135,'Parent of',1,NULL,NULL),(284,142,1,'b_a',135,'Parent of',13,'Child of',1,NULL,NULL),(285,143,1,'a_b',20,'Child of',43,'Parent of',1,NULL,NULL),(286,143,1,'b_a',43,'Parent of',20,'Child of',1,NULL,NULL),(287,144,1,'a_b',13,'Child of',43,'Parent of',1,NULL,NULL),(288,144,1,'b_a',43,'Parent of',13,'Child of',1,NULL,NULL),(289,145,4,'a_b',13,'Sibling of',20,'Sibling of',1,NULL,NULL),(290,145,4,'b_a',20,'Sibling of',13,'Sibling of',1,NULL,NULL),(291,146,8,'a_b',43,'Household Member of',21,'Household Member is',1,NULL,NULL),(292,146,8,'b_a',21,'Household Member is',43,'Household Member of',1,NULL,NULL),(293,147,8,'a_b',20,'Household Member of',21,'Household Member is',1,NULL,NULL),(294,147,8,'b_a',21,'Household Member is',20,'Household Member of',1,NULL,NULL),(295,148,8,'a_b',13,'Household Member of',21,'Household Member is',1,NULL,NULL),(296,148,8,'b_a',21,'Household Member is',13,'Household Member of',1,NULL,NULL),(297,149,7,'a_b',135,'Head of Household for',21,'Head of Household is',0,NULL,NULL),(298,149,7,'b_a',21,'Head of Household is',135,'Head of Household for',0,NULL,NULL),(299,150,2,'a_b',43,'Spouse of',135,'Spouse of',0,NULL,NULL),(300,150,2,'b_a',135,'Spouse of',43,'Spouse of',0,NULL,NULL),(301,151,1,'a_b',89,'Child of',194,'Parent of',1,NULL,NULL),(302,151,1,'b_a',194,'Parent of',89,'Child of',1,NULL,NULL),(303,152,1,'a_b',75,'Child of',194,'Parent of',1,NULL,NULL),(304,152,1,'b_a',194,'Parent of',75,'Child of',1,NULL,NULL),(305,153,1,'a_b',89,'Child of',131,'Parent of',1,NULL,NULL),(306,153,1,'b_a',131,'Parent of',89,'Child of',1,NULL,NULL),(307,154,1,'a_b',75,'Child of',131,'Parent of',1,NULL,NULL),(308,154,1,'b_a',131,'Parent of',75,'Child of',1,NULL,NULL),(309,155,4,'a_b',75,'Sibling of',89,'Sibling of',1,NULL,NULL),(310,155,4,'b_a',89,'Sibling of',75,'Sibling of',1,NULL,NULL),(311,156,8,'a_b',131,'Household Member of',19,'Household Member is',1,NULL,NULL),(312,156,8,'b_a',19,'Household Member is',131,'Household Member of',1,NULL,NULL),(313,157,8,'a_b',89,'Household Member of',19,'Household Member is',1,NULL,NULL),(314,157,8,'b_a',19,'Household Member is',89,'Household Member of',1,NULL,NULL),(315,158,8,'a_b',75,'Household Member of',19,'Household Member is',1,NULL,NULL),(316,158,8,'b_a',19,'Household Member is',75,'Household Member of',1,NULL,NULL),(317,159,7,'a_b',194,'Head of Household for',19,'Head of Household is',0,NULL,NULL),(318,159,7,'b_a',19,'Head of Household is',194,'Head of Household for',0,NULL,NULL),(319,160,2,'a_b',131,'Spouse of',194,'Spouse of',0,NULL,NULL),(320,160,2,'b_a',194,'Spouse of',131,'Spouse of',0,NULL,NULL),(321,161,1,'a_b',121,'Child of',104,'Parent of',1,NULL,NULL),(322,161,1,'b_a',104,'Parent of',121,'Child of',1,NULL,NULL),(323,162,1,'a_b',39,'Child of',104,'Parent of',1,NULL,NULL),(324,162,1,'b_a',104,'Parent of',39,'Child of',1,NULL,NULL),(325,163,1,'a_b',121,'Child of',153,'Parent of',1,NULL,NULL),(326,163,1,'b_a',153,'Parent of',121,'Child of',1,NULL,NULL),(327,164,1,'a_b',39,'Child of',153,'Parent of',1,NULL,NULL),(328,164,1,'b_a',153,'Parent of',39,'Child of',1,NULL,NULL),(329,165,4,'a_b',39,'Sibling of',121,'Sibling of',1,NULL,NULL),(330,165,4,'b_a',121,'Sibling of',39,'Sibling of',1,NULL,NULL),(331,166,8,'a_b',153,'Household Member of',168,'Household Member is',1,NULL,NULL),(332,166,8,'b_a',168,'Household Member is',153,'Household Member of',1,NULL,NULL),(333,167,8,'a_b',121,'Household Member of',168,'Household Member is',1,NULL,NULL),(334,167,8,'b_a',168,'Household Member is',121,'Household Member of',1,NULL,NULL),(335,168,8,'a_b',39,'Household Member of',168,'Household Member is',1,NULL,NULL),(336,168,8,'b_a',168,'Household Member is',39,'Household Member of',1,NULL,NULL),(337,169,7,'a_b',104,'Head of Household for',168,'Head of Household is',1,NULL,NULL),(338,169,7,'b_a',168,'Head of Household is',104,'Head of Household for',1,NULL,NULL),(339,170,2,'a_b',153,'Spouse of',104,'Spouse of',1,NULL,NULL),(340,170,2,'b_a',104,'Spouse of',153,'Spouse of',1,NULL,NULL),(341,171,1,'a_b',36,'Child of',42,'Parent of',1,NULL,NULL),(342,171,1,'b_a',42,'Parent of',36,'Child of',1,NULL,NULL),(343,172,1,'a_b',26,'Child of',42,'Parent of',1,NULL,NULL),(344,172,1,'b_a',42,'Parent of',26,'Child of',1,NULL,NULL),(345,173,1,'a_b',36,'Child of',189,'Parent of',1,NULL,NULL),(346,173,1,'b_a',189,'Parent of',36,'Child of',1,NULL,NULL),(347,174,1,'a_b',26,'Child of',189,'Parent of',1,NULL,NULL),(348,174,1,'b_a',189,'Parent of',26,'Child of',1,NULL,NULL),(349,175,4,'a_b',26,'Sibling of',36,'Sibling of',1,NULL,NULL),(350,175,4,'b_a',36,'Sibling of',26,'Sibling of',1,NULL,NULL),(351,176,8,'a_b',189,'Household Member of',101,'Household Member is',1,NULL,NULL),(352,176,8,'b_a',101,'Household Member is',189,'Household Member of',1,NULL,NULL),(353,177,8,'a_b',36,'Household Member of',101,'Household Member is',1,NULL,NULL),(354,177,8,'b_a',101,'Household Member is',36,'Household Member of',1,NULL,NULL),(355,178,8,'a_b',26,'Household Member of',101,'Household Member is',1,NULL,NULL),(356,178,8,'b_a',101,'Household Member is',26,'Household Member of',1,NULL,NULL),(357,179,7,'a_b',42,'Head of Household for',101,'Head of Household is',1,NULL,NULL),(358,179,7,'b_a',101,'Head of Household is',42,'Head of Household for',1,NULL,NULL),(359,180,2,'a_b',189,'Spouse of',42,'Spouse of',1,NULL,NULL),(360,180,2,'b_a',42,'Spouse of',189,'Spouse of',1,NULL,NULL),(361,181,1,'a_b',69,'Child of',171,'Parent of',1,NULL,NULL),(362,181,1,'b_a',171,'Parent of',69,'Child of',1,NULL,NULL),(363,182,1,'a_b',109,'Child of',171,'Parent of',1,NULL,NULL),(364,182,1,'b_a',171,'Parent of',109,'Child of',1,NULL,NULL),(365,183,1,'a_b',69,'Child of',200,'Parent of',1,NULL,NULL),(366,183,1,'b_a',200,'Parent of',69,'Child of',1,NULL,NULL),(367,184,1,'a_b',109,'Child of',200,'Parent of',1,NULL,NULL),(368,184,1,'b_a',200,'Parent of',109,'Child of',1,NULL,NULL),(369,185,4,'a_b',109,'Sibling of',69,'Sibling of',1,NULL,NULL),(370,185,4,'b_a',69,'Sibling of',109,'Sibling of',1,NULL,NULL),(371,186,8,'a_b',200,'Household Member of',98,'Household Member is',1,NULL,NULL),(372,186,8,'b_a',98,'Household Member is',200,'Household Member of',1,NULL,NULL),(373,187,8,'a_b',69,'Household Member of',98,'Household Member is',1,NULL,NULL),(374,187,8,'b_a',98,'Household Member is',69,'Household Member of',1,NULL,NULL),(375,188,8,'a_b',109,'Household Member of',98,'Household Member is',1,NULL,NULL),(376,188,8,'b_a',98,'Household Member is',109,'Household Member of',1,NULL,NULL),(377,189,7,'a_b',171,'Head of Household for',98,'Head of Household is',1,NULL,NULL),(378,189,7,'b_a',98,'Head of Household is',171,'Head of Household for',1,NULL,NULL),(379,190,2,'a_b',200,'Spouse of',171,'Spouse of',1,NULL,NULL),(380,190,2,'b_a',171,'Spouse of',200,'Spouse of',1,NULL,NULL),(381,191,1,'a_b',158,'Child of',25,'Parent of',1,NULL,NULL),(382,191,1,'b_a',25,'Parent of',158,'Child of',1,NULL,NULL),(383,192,1,'a_b',4,'Child of',25,'Parent of',1,NULL,NULL),(384,192,1,'b_a',25,'Parent of',4,'Child of',1,NULL,NULL),(385,193,1,'a_b',158,'Child of',180,'Parent of',1,NULL,NULL),(386,193,1,'b_a',180,'Parent of',158,'Child of',1,NULL,NULL),(387,194,1,'a_b',4,'Child of',180,'Parent of',1,NULL,NULL),(388,194,1,'b_a',180,'Parent of',4,'Child of',1,NULL,NULL),(389,195,4,'a_b',4,'Sibling of',158,'Sibling of',1,NULL,NULL),(390,195,4,'b_a',158,'Sibling of',4,'Sibling of',1,NULL,NULL),(391,196,8,'a_b',180,'Household Member of',163,'Household Member is',1,NULL,NULL),(392,196,8,'b_a',163,'Household Member is',180,'Household Member of',1,NULL,NULL),(393,197,8,'a_b',158,'Household Member of',163,'Household Member is',1,NULL,NULL),(394,197,8,'b_a',163,'Household Member is',158,'Household Member of',1,NULL,NULL),(395,198,8,'a_b',4,'Household Member of',163,'Household Member is',1,NULL,NULL),(396,198,8,'b_a',163,'Household Member is',4,'Household Member of',1,NULL,NULL),(397,199,7,'a_b',25,'Head of Household for',163,'Head of Household is',0,NULL,NULL),(398,199,7,'b_a',163,'Head of Household is',25,'Head of Household for',0,NULL,NULL),(399,200,2,'a_b',180,'Spouse of',25,'Spouse of',0,NULL,NULL),(400,200,2,'b_a',25,'Spouse of',180,'Spouse of',0,NULL,NULL),(401,201,5,'a_b',26,'Employee of',14,'Employer of',1,NULL,NULL),(402,201,5,'b_a',14,'Employer of',26,'Employee of',1,NULL,NULL),(403,202,5,'a_b',36,'Employee of',37,'Employer of',1,NULL,NULL),(404,202,5,'b_a',37,'Employer of',36,'Employee of',1,NULL,NULL),(405,203,5,'a_b',20,'Employee of',46,'Employer of',1,NULL,NULL),(406,203,5,'b_a',46,'Employer of',20,'Employee of',1,NULL,NULL),(407,204,5,'a_b',89,'Employee of',50,'Employer of',1,NULL,NULL),(408,204,5,'b_a',50,'Employer of',89,'Employee of',1,NULL,NULL),(409,205,5,'a_b',189,'Employee of',56,'Employer of',1,NULL,NULL),(410,205,5,'b_a',56,'Employer of',189,'Employee of',1,NULL,NULL),(411,206,5,'a_b',29,'Employee of',62,'Employer of',1,NULL,NULL),(412,206,5,'b_a',62,'Employer of',29,'Employee of',1,NULL,NULL),(413,207,5,'a_b',75,'Employee of',73,'Employer of',1,NULL,NULL),(414,207,5,'b_a',73,'Employer of',75,'Employee of',1,NULL,NULL),(415,208,5,'a_b',197,'Employee of',86,'Employer of',1,NULL,NULL),(416,208,5,'b_a',86,'Employer of',197,'Employee of',1,NULL,NULL),(417,209,5,'a_b',120,'Employee of',91,'Employer of',1,NULL,NULL),(418,209,5,'b_a',91,'Employer of',120,'Employee of',1,NULL,NULL),(419,210,5,'a_b',151,'Employee of',105,'Employer of',1,NULL,NULL),(420,210,5,'b_a',105,'Employer of',151,'Employee of',1,NULL,NULL),(421,211,5,'a_b',85,'Employee of',117,'Employer of',1,NULL,NULL),(422,211,5,'b_a',117,'Employer of',85,'Employee of',1,NULL,NULL),(423,212,5,'a_b',34,'Employee of',137,'Employer of',1,NULL,NULL),(424,212,5,'b_a',137,'Employer of',34,'Employee of',1,NULL,NULL),(425,213,5,'a_b',170,'Employee of',142,'Employer of',1,NULL,NULL),(426,213,5,'b_a',142,'Employer of',170,'Employee of',1,NULL,NULL),(427,214,5,'a_b',18,'Employee of',144,'Employer of',1,NULL,NULL),(428,214,5,'b_a',144,'Employer of',18,'Employee of',1,NULL,NULL),(429,215,5,'a_b',104,'Employee of',148,'Employer of',1,NULL,NULL),(430,215,5,'b_a',148,'Employer of',104,'Employee of',1,NULL,NULL),(431,216,5,'a_b',57,'Employee of',157,'Employer of',1,NULL,NULL),(432,216,5,'b_a',157,'Employer of',57,'Employee of',1,NULL,NULL),(433,217,5,'a_b',185,'Employee of',174,'Employer of',1,NULL,NULL),(434,217,5,'b_a',174,'Employer of',185,'Employee of',1,NULL,NULL),(435,218,5,'a_b',186,'Employee of',178,'Employer of',1,NULL,NULL),(436,218,5,'b_a',178,'Employer of',186,'Employee of',1,NULL,NULL); +INSERT INTO `civicrm_relationship_cache` (`id`, `relationship_id`, `relationship_type_id`, `orientation`, `near_contact_id`, `near_relation`, `far_contact_id`, `far_relation`, `is_active`, `start_date`, `end_date`) VALUES (1,1,1,'a_b',76,'Child of',40,'Parent of',1,NULL,NULL),(2,1,1,'b_a',40,'Parent of',76,'Child of',1,NULL,NULL),(3,2,1,'a_b',75,'Child of',40,'Parent of',1,NULL,NULL),(4,2,1,'b_a',40,'Parent of',75,'Child of',1,NULL,NULL),(5,3,1,'a_b',76,'Child of',158,'Parent of',1,NULL,NULL),(6,3,1,'b_a',158,'Parent of',76,'Child of',1,NULL,NULL),(7,4,1,'a_b',75,'Child of',158,'Parent of',1,NULL,NULL),(8,4,1,'b_a',158,'Parent of',75,'Child of',1,NULL,NULL),(9,5,4,'a_b',75,'Sibling of',76,'Sibling of',1,NULL,NULL),(10,5,4,'b_a',76,'Sibling of',75,'Sibling of',1,NULL,NULL),(11,6,8,'a_b',158,'Household Member of',68,'Household Member is',1,NULL,NULL),(12,6,8,'b_a',68,'Household Member is',158,'Household Member of',1,NULL,NULL),(13,7,8,'a_b',76,'Household Member of',68,'Household Member is',1,NULL,NULL),(14,7,8,'b_a',68,'Household Member is',76,'Household Member of',1,NULL,NULL),(15,8,8,'a_b',75,'Household Member of',68,'Household Member is',1,NULL,NULL),(16,8,8,'b_a',68,'Household Member is',75,'Household Member of',1,NULL,NULL),(17,9,7,'a_b',40,'Head of Household for',68,'Head of Household is',1,NULL,NULL),(18,9,7,'b_a',68,'Head of Household is',40,'Head of Household for',1,NULL,NULL),(19,10,2,'a_b',158,'Spouse of',40,'Spouse of',1,NULL,NULL),(20,10,2,'b_a',40,'Spouse of',158,'Spouse of',1,NULL,NULL),(21,11,1,'a_b',97,'Child of',43,'Parent of',1,NULL,NULL),(22,11,1,'b_a',43,'Parent of',97,'Child of',1,NULL,NULL),(23,12,1,'a_b',89,'Child of',43,'Parent of',1,NULL,NULL),(24,12,1,'b_a',43,'Parent of',89,'Child of',1,NULL,NULL),(25,13,1,'a_b',97,'Child of',131,'Parent of',1,NULL,NULL),(26,13,1,'b_a',131,'Parent of',97,'Child of',1,NULL,NULL),(27,14,1,'a_b',89,'Child of',131,'Parent of',1,NULL,NULL),(28,14,1,'b_a',131,'Parent of',89,'Child of',1,NULL,NULL),(29,15,4,'a_b',89,'Sibling of',97,'Sibling of',1,NULL,NULL),(30,15,4,'b_a',97,'Sibling of',89,'Sibling of',1,NULL,NULL),(31,16,8,'a_b',131,'Household Member of',82,'Household Member is',1,NULL,NULL),(32,16,8,'b_a',82,'Household Member is',131,'Household Member of',1,NULL,NULL),(33,17,8,'a_b',97,'Household Member of',82,'Household Member is',1,NULL,NULL),(34,17,8,'b_a',82,'Household Member is',97,'Household Member of',1,NULL,NULL),(35,18,8,'a_b',89,'Household Member of',82,'Household Member is',1,NULL,NULL),(36,18,8,'b_a',82,'Household Member is',89,'Household Member of',1,NULL,NULL),(37,19,7,'a_b',43,'Head of Household for',82,'Head of Household is',1,NULL,NULL),(38,19,7,'b_a',82,'Head of Household is',43,'Head of Household for',1,NULL,NULL),(39,20,2,'a_b',131,'Spouse of',43,'Spouse of',1,NULL,NULL),(40,20,2,'b_a',43,'Spouse of',131,'Spouse of',1,NULL,NULL),(41,21,1,'a_b',10,'Child of',124,'Parent of',1,NULL,NULL),(42,21,1,'b_a',124,'Parent of',10,'Child of',1,NULL,NULL),(43,22,1,'a_b',134,'Child of',124,'Parent of',1,NULL,NULL),(44,22,1,'b_a',124,'Parent of',134,'Child of',1,NULL,NULL),(45,23,1,'a_b',10,'Child of',26,'Parent of',1,NULL,NULL),(46,23,1,'b_a',26,'Parent of',10,'Child of',1,NULL,NULL),(47,24,1,'a_b',134,'Child of',26,'Parent of',1,NULL,NULL),(48,24,1,'b_a',26,'Parent of',134,'Child of',1,NULL,NULL),(49,25,4,'a_b',134,'Sibling of',10,'Sibling of',1,NULL,NULL),(50,25,4,'b_a',10,'Sibling of',134,'Sibling of',1,NULL,NULL),(51,26,8,'a_b',26,'Household Member of',180,'Household Member is',1,NULL,NULL),(52,26,8,'b_a',180,'Household Member is',26,'Household Member of',1,NULL,NULL),(53,27,8,'a_b',10,'Household Member of',180,'Household Member is',1,NULL,NULL),(54,27,8,'b_a',180,'Household Member is',10,'Household Member of',1,NULL,NULL),(55,28,8,'a_b',134,'Household Member of',180,'Household Member is',1,NULL,NULL),(56,28,8,'b_a',180,'Household Member is',134,'Household Member of',1,NULL,NULL),(57,29,7,'a_b',124,'Head of Household for',180,'Head of Household is',1,NULL,NULL),(58,29,7,'b_a',180,'Head of Household is',124,'Head of Household for',1,NULL,NULL),(59,30,2,'a_b',26,'Spouse of',124,'Spouse of',1,NULL,NULL),(60,30,2,'b_a',124,'Spouse of',26,'Spouse of',1,NULL,NULL),(61,31,1,'a_b',178,'Child of',45,'Parent of',1,NULL,NULL),(62,31,1,'b_a',45,'Parent of',178,'Child of',1,NULL,NULL),(63,32,1,'a_b',179,'Child of',45,'Parent of',1,NULL,NULL),(64,32,1,'b_a',45,'Parent of',179,'Child of',1,NULL,NULL),(65,33,1,'a_b',178,'Child of',22,'Parent of',1,NULL,NULL),(66,33,1,'b_a',22,'Parent of',178,'Child of',1,NULL,NULL),(67,34,1,'a_b',179,'Child of',22,'Parent of',1,NULL,NULL),(68,34,1,'b_a',22,'Parent of',179,'Child of',1,NULL,NULL),(69,35,4,'a_b',179,'Sibling of',178,'Sibling of',1,NULL,NULL),(70,35,4,'b_a',178,'Sibling of',179,'Sibling of',1,NULL,NULL),(71,36,8,'a_b',22,'Household Member of',50,'Household Member is',1,NULL,NULL),(72,36,8,'b_a',50,'Household Member is',22,'Household Member of',1,NULL,NULL),(73,37,8,'a_b',178,'Household Member of',50,'Household Member is',1,NULL,NULL),(74,37,8,'b_a',50,'Household Member is',178,'Household Member of',1,NULL,NULL),(75,38,8,'a_b',179,'Household Member of',50,'Household Member is',1,NULL,NULL),(76,38,8,'b_a',50,'Household Member is',179,'Household Member of',1,NULL,NULL),(77,39,7,'a_b',45,'Head of Household for',50,'Head of Household is',1,NULL,NULL),(78,39,7,'b_a',50,'Head of Household is',45,'Head of Household for',1,NULL,NULL),(79,40,2,'a_b',22,'Spouse of',45,'Spouse of',1,NULL,NULL),(80,40,2,'b_a',45,'Spouse of',22,'Spouse of',1,NULL,NULL),(81,41,1,'a_b',57,'Child of',66,'Parent of',1,NULL,NULL),(82,41,1,'b_a',66,'Parent of',57,'Child of',1,NULL,NULL),(83,42,1,'a_b',157,'Child of',66,'Parent of',1,NULL,NULL),(84,42,1,'b_a',66,'Parent of',157,'Child of',1,NULL,NULL),(85,43,1,'a_b',57,'Child of',138,'Parent of',1,NULL,NULL),(86,43,1,'b_a',138,'Parent of',57,'Child of',1,NULL,NULL),(87,44,1,'a_b',157,'Child of',138,'Parent of',1,NULL,NULL),(88,44,1,'b_a',138,'Parent of',157,'Child of',1,NULL,NULL),(89,45,4,'a_b',157,'Sibling of',57,'Sibling of',1,NULL,NULL),(90,45,4,'b_a',57,'Sibling of',157,'Sibling of',1,NULL,NULL),(91,46,8,'a_b',138,'Household Member of',56,'Household Member is',1,NULL,NULL),(92,46,8,'b_a',56,'Household Member is',138,'Household Member of',1,NULL,NULL),(93,47,8,'a_b',57,'Household Member of',56,'Household Member is',1,NULL,NULL),(94,47,8,'b_a',56,'Household Member is',57,'Household Member of',1,NULL,NULL),(95,48,8,'a_b',157,'Household Member of',56,'Household Member is',1,NULL,NULL),(96,48,8,'b_a',56,'Household Member is',157,'Household Member of',1,NULL,NULL),(97,49,7,'a_b',66,'Head of Household for',56,'Head of Household is',0,NULL,NULL),(98,49,7,'b_a',56,'Head of Household is',66,'Head of Household for',0,NULL,NULL),(99,50,2,'a_b',138,'Spouse of',66,'Spouse of',0,NULL,NULL),(100,50,2,'b_a',66,'Spouse of',138,'Spouse of',0,NULL,NULL),(101,51,1,'a_b',159,'Child of',142,'Parent of',1,NULL,NULL),(102,51,1,'b_a',142,'Parent of',159,'Child of',1,NULL,NULL),(103,52,1,'a_b',145,'Child of',142,'Parent of',1,NULL,NULL),(104,52,1,'b_a',142,'Parent of',145,'Child of',1,NULL,NULL),(105,53,1,'a_b',159,'Child of',196,'Parent of',1,NULL,NULL),(106,53,1,'b_a',196,'Parent of',159,'Child of',1,NULL,NULL),(107,54,1,'a_b',145,'Child of',196,'Parent of',1,NULL,NULL),(108,54,1,'b_a',196,'Parent of',145,'Child of',1,NULL,NULL),(109,55,4,'a_b',145,'Sibling of',159,'Sibling of',1,NULL,NULL),(110,55,4,'b_a',159,'Sibling of',145,'Sibling of',1,NULL,NULL),(111,56,8,'a_b',196,'Household Member of',122,'Household Member is',1,NULL,NULL),(112,56,8,'b_a',122,'Household Member is',196,'Household Member of',1,NULL,NULL),(113,57,8,'a_b',159,'Household Member of',122,'Household Member is',1,NULL,NULL),(114,57,8,'b_a',122,'Household Member is',159,'Household Member of',1,NULL,NULL),(115,58,8,'a_b',145,'Household Member of',122,'Household Member is',1,NULL,NULL),(116,58,8,'b_a',122,'Household Member is',145,'Household Member of',1,NULL,NULL),(117,59,7,'a_b',142,'Head of Household for',122,'Head of Household is',1,NULL,NULL),(118,59,7,'b_a',122,'Head of Household is',142,'Head of Household for',1,NULL,NULL),(119,60,2,'a_b',196,'Spouse of',142,'Spouse of',1,NULL,NULL),(120,60,2,'b_a',142,'Spouse of',196,'Spouse of',1,NULL,NULL),(121,61,1,'a_b',30,'Child of',163,'Parent of',1,NULL,NULL),(122,61,1,'b_a',163,'Parent of',30,'Child of',1,NULL,NULL),(123,62,1,'a_b',113,'Child of',163,'Parent of',1,NULL,NULL),(124,62,1,'b_a',163,'Parent of',113,'Child of',1,NULL,NULL),(125,63,1,'a_b',30,'Child of',106,'Parent of',1,NULL,NULL),(126,63,1,'b_a',106,'Parent of',30,'Child of',1,NULL,NULL),(127,64,1,'a_b',113,'Child of',106,'Parent of',1,NULL,NULL),(128,64,1,'b_a',106,'Parent of',113,'Child of',1,NULL,NULL),(129,65,4,'a_b',113,'Sibling of',30,'Sibling of',1,NULL,NULL),(130,65,4,'b_a',30,'Sibling of',113,'Sibling of',1,NULL,NULL),(131,66,8,'a_b',106,'Household Member of',144,'Household Member is',1,NULL,NULL),(132,66,8,'b_a',144,'Household Member is',106,'Household Member of',1,NULL,NULL),(133,67,8,'a_b',30,'Household Member of',144,'Household Member is',1,NULL,NULL),(134,67,8,'b_a',144,'Household Member is',30,'Household Member of',1,NULL,NULL),(135,68,8,'a_b',113,'Household Member of',144,'Household Member is',1,NULL,NULL),(136,68,8,'b_a',144,'Household Member is',113,'Household Member of',1,NULL,NULL),(137,69,7,'a_b',163,'Head of Household for',144,'Head of Household is',1,NULL,NULL),(138,69,7,'b_a',144,'Head of Household is',163,'Head of Household for',1,NULL,NULL),(139,70,2,'a_b',106,'Spouse of',163,'Spouse of',1,NULL,NULL),(140,70,2,'b_a',163,'Spouse of',106,'Spouse of',1,NULL,NULL),(141,71,1,'a_b',19,'Child of',67,'Parent of',1,NULL,NULL),(142,71,1,'b_a',67,'Parent of',19,'Child of',1,NULL,NULL),(143,72,1,'a_b',105,'Child of',67,'Parent of',1,NULL,NULL),(144,72,1,'b_a',67,'Parent of',105,'Child of',1,NULL,NULL),(145,73,1,'a_b',19,'Child of',29,'Parent of',1,NULL,NULL),(146,73,1,'b_a',29,'Parent of',19,'Child of',1,NULL,NULL),(147,74,1,'a_b',105,'Child of',29,'Parent of',1,NULL,NULL),(148,74,1,'b_a',29,'Parent of',105,'Child of',1,NULL,NULL),(149,75,4,'a_b',105,'Sibling of',19,'Sibling of',1,NULL,NULL),(150,75,4,'b_a',19,'Sibling of',105,'Sibling of',1,NULL,NULL),(151,76,8,'a_b',29,'Household Member of',166,'Household Member is',1,NULL,NULL),(152,76,8,'b_a',166,'Household Member is',29,'Household Member of',1,NULL,NULL),(153,77,8,'a_b',19,'Household Member of',166,'Household Member is',1,NULL,NULL),(154,77,8,'b_a',166,'Household Member is',19,'Household Member of',1,NULL,NULL),(155,78,8,'a_b',105,'Household Member of',166,'Household Member is',1,NULL,NULL),(156,78,8,'b_a',166,'Household Member is',105,'Household Member of',1,NULL,NULL),(157,79,7,'a_b',67,'Head of Household for',166,'Head of Household is',1,NULL,NULL),(158,79,7,'b_a',166,'Head of Household is',67,'Head of Household for',1,NULL,NULL),(159,80,2,'a_b',29,'Spouse of',67,'Spouse of',1,NULL,NULL),(160,80,2,'b_a',67,'Spouse of',29,'Spouse of',1,NULL,NULL),(161,81,1,'a_b',25,'Child of',63,'Parent of',1,NULL,NULL),(162,81,1,'b_a',63,'Parent of',25,'Child of',1,NULL,NULL),(163,82,1,'a_b',186,'Child of',63,'Parent of',1,NULL,NULL),(164,82,1,'b_a',63,'Parent of',186,'Child of',1,NULL,NULL),(165,83,1,'a_b',25,'Child of',20,'Parent of',1,NULL,NULL),(166,83,1,'b_a',20,'Parent of',25,'Child of',1,NULL,NULL),(167,84,1,'a_b',186,'Child of',20,'Parent of',1,NULL,NULL),(168,84,1,'b_a',20,'Parent of',186,'Child of',1,NULL,NULL),(169,85,4,'a_b',186,'Sibling of',25,'Sibling of',1,NULL,NULL),(170,85,4,'b_a',25,'Sibling of',186,'Sibling of',1,NULL,NULL),(171,86,8,'a_b',20,'Household Member of',81,'Household Member is',1,NULL,NULL),(172,86,8,'b_a',81,'Household Member is',20,'Household Member of',1,NULL,NULL),(173,87,8,'a_b',25,'Household Member of',81,'Household Member is',1,NULL,NULL),(174,87,8,'b_a',81,'Household Member is',25,'Household Member of',1,NULL,NULL),(175,88,8,'a_b',186,'Household Member of',81,'Household Member is',1,NULL,NULL),(176,88,8,'b_a',81,'Household Member is',186,'Household Member of',1,NULL,NULL),(177,89,7,'a_b',63,'Head of Household for',81,'Head of Household is',0,NULL,NULL),(178,89,7,'b_a',81,'Head of Household is',63,'Head of Household for',0,NULL,NULL),(179,90,2,'a_b',20,'Spouse of',63,'Spouse of',0,NULL,NULL),(180,90,2,'b_a',63,'Spouse of',20,'Spouse of',0,NULL,NULL),(181,91,1,'a_b',136,'Child of',48,'Parent of',1,NULL,NULL),(182,91,1,'b_a',48,'Parent of',136,'Child of',1,NULL,NULL),(183,92,1,'a_b',123,'Child of',48,'Parent of',1,NULL,NULL),(184,92,1,'b_a',48,'Parent of',123,'Child of',1,NULL,NULL),(185,93,1,'a_b',136,'Child of',52,'Parent of',1,NULL,NULL),(186,93,1,'b_a',52,'Parent of',136,'Child of',1,NULL,NULL),(187,94,1,'a_b',123,'Child of',52,'Parent of',1,NULL,NULL),(188,94,1,'b_a',52,'Parent of',123,'Child of',1,NULL,NULL),(189,95,4,'a_b',123,'Sibling of',136,'Sibling of',1,NULL,NULL),(190,95,4,'b_a',136,'Sibling of',123,'Sibling of',1,NULL,NULL),(191,96,8,'a_b',52,'Household Member of',156,'Household Member is',1,NULL,NULL),(192,96,8,'b_a',156,'Household Member is',52,'Household Member of',1,NULL,NULL),(193,97,8,'a_b',136,'Household Member of',156,'Household Member is',1,NULL,NULL),(194,97,8,'b_a',156,'Household Member is',136,'Household Member of',1,NULL,NULL),(195,98,8,'a_b',123,'Household Member of',156,'Household Member is',1,NULL,NULL),(196,98,8,'b_a',156,'Household Member is',123,'Household Member of',1,NULL,NULL),(197,99,7,'a_b',48,'Head of Household for',156,'Head of Household is',1,NULL,NULL),(198,99,7,'b_a',156,'Head of Household is',48,'Head of Household for',1,NULL,NULL),(199,100,2,'a_b',52,'Spouse of',48,'Spouse of',1,NULL,NULL),(200,100,2,'b_a',48,'Spouse of',52,'Spouse of',1,NULL,NULL),(201,101,1,'a_b',96,'Child of',150,'Parent of',1,NULL,NULL),(202,101,1,'b_a',150,'Parent of',96,'Child of',1,NULL,NULL),(203,102,1,'a_b',135,'Child of',150,'Parent of',1,NULL,NULL),(204,102,1,'b_a',150,'Parent of',135,'Child of',1,NULL,NULL),(205,103,1,'a_b',96,'Child of',153,'Parent of',1,NULL,NULL),(206,103,1,'b_a',153,'Parent of',96,'Child of',1,NULL,NULL),(207,104,1,'a_b',135,'Child of',153,'Parent of',1,NULL,NULL),(208,104,1,'b_a',153,'Parent of',135,'Child of',1,NULL,NULL),(209,105,4,'a_b',135,'Sibling of',96,'Sibling of',1,NULL,NULL),(210,105,4,'b_a',96,'Sibling of',135,'Sibling of',1,NULL,NULL),(211,106,8,'a_b',153,'Household Member of',37,'Household Member is',1,NULL,NULL),(212,106,8,'b_a',37,'Household Member is',153,'Household Member of',1,NULL,NULL),(213,107,8,'a_b',96,'Household Member of',37,'Household Member is',1,NULL,NULL),(214,107,8,'b_a',37,'Household Member is',96,'Household Member of',1,NULL,NULL),(215,108,8,'a_b',135,'Household Member of',37,'Household Member is',1,NULL,NULL),(216,108,8,'b_a',37,'Household Member is',135,'Household Member of',1,NULL,NULL),(217,109,7,'a_b',150,'Head of Household for',37,'Head of Household is',1,NULL,NULL),(218,109,7,'b_a',37,'Head of Household is',150,'Head of Household for',1,NULL,NULL),(219,110,2,'a_b',153,'Spouse of',150,'Spouse of',1,NULL,NULL),(220,110,2,'b_a',150,'Spouse of',153,'Spouse of',1,NULL,NULL),(221,111,1,'a_b',175,'Child of',27,'Parent of',1,NULL,NULL),(222,111,1,'b_a',27,'Parent of',175,'Child of',1,NULL,NULL),(223,112,1,'a_b',110,'Child of',27,'Parent of',1,NULL,NULL),(224,112,1,'b_a',27,'Parent of',110,'Child of',1,NULL,NULL),(225,113,1,'a_b',175,'Child of',6,'Parent of',1,NULL,NULL),(226,113,1,'b_a',6,'Parent of',175,'Child of',1,NULL,NULL),(227,114,1,'a_b',110,'Child of',6,'Parent of',1,NULL,NULL),(228,114,1,'b_a',6,'Parent of',110,'Child of',1,NULL,NULL),(229,115,4,'a_b',110,'Sibling of',175,'Sibling of',1,NULL,NULL),(230,115,4,'b_a',175,'Sibling of',110,'Sibling of',1,NULL,NULL),(231,116,8,'a_b',6,'Household Member of',141,'Household Member is',1,NULL,NULL),(232,116,8,'b_a',141,'Household Member is',6,'Household Member of',1,NULL,NULL),(233,117,8,'a_b',175,'Household Member of',141,'Household Member is',1,NULL,NULL),(234,117,8,'b_a',141,'Household Member is',175,'Household Member of',1,NULL,NULL),(235,118,8,'a_b',110,'Household Member of',141,'Household Member is',1,NULL,NULL),(236,118,8,'b_a',141,'Household Member is',110,'Household Member of',1,NULL,NULL),(237,119,7,'a_b',27,'Head of Household for',141,'Head of Household is',1,NULL,NULL),(238,119,7,'b_a',141,'Head of Household is',27,'Head of Household for',1,NULL,NULL),(239,120,2,'a_b',6,'Spouse of',27,'Spouse of',1,NULL,NULL),(240,120,2,'b_a',27,'Spouse of',6,'Spouse of',1,NULL,NULL),(241,121,1,'a_b',24,'Child of',84,'Parent of',1,NULL,NULL),(242,121,1,'b_a',84,'Parent of',24,'Child of',1,NULL,NULL),(243,122,1,'a_b',90,'Child of',84,'Parent of',1,NULL,NULL),(244,122,1,'b_a',84,'Parent of',90,'Child of',1,NULL,NULL),(245,123,1,'a_b',24,'Child of',200,'Parent of',1,NULL,NULL),(246,123,1,'b_a',200,'Parent of',24,'Child of',1,NULL,NULL),(247,124,1,'a_b',90,'Child of',200,'Parent of',1,NULL,NULL),(248,124,1,'b_a',200,'Parent of',90,'Child of',1,NULL,NULL),(249,125,4,'a_b',90,'Sibling of',24,'Sibling of',1,NULL,NULL),(250,125,4,'b_a',24,'Sibling of',90,'Sibling of',1,NULL,NULL),(251,126,8,'a_b',200,'Household Member of',174,'Household Member is',1,NULL,NULL),(252,126,8,'b_a',174,'Household Member is',200,'Household Member of',1,NULL,NULL),(253,127,8,'a_b',24,'Household Member of',174,'Household Member is',1,NULL,NULL),(254,127,8,'b_a',174,'Household Member is',24,'Household Member of',1,NULL,NULL),(255,128,8,'a_b',90,'Household Member of',174,'Household Member is',1,NULL,NULL),(256,128,8,'b_a',174,'Household Member is',90,'Household Member of',1,NULL,NULL),(257,129,7,'a_b',84,'Head of Household for',174,'Head of Household is',1,NULL,NULL),(258,129,7,'b_a',174,'Head of Household is',84,'Head of Household for',1,NULL,NULL),(259,130,2,'a_b',200,'Spouse of',84,'Spouse of',1,NULL,NULL),(260,130,2,'b_a',84,'Spouse of',200,'Spouse of',1,NULL,NULL),(261,131,1,'a_b',2,'Child of',120,'Parent of',1,NULL,NULL),(262,131,1,'b_a',120,'Parent of',2,'Child of',1,NULL,NULL),(263,132,1,'a_b',128,'Child of',120,'Parent of',1,NULL,NULL),(264,132,1,'b_a',120,'Parent of',128,'Child of',1,NULL,NULL),(265,133,1,'a_b',2,'Child of',3,'Parent of',1,NULL,NULL),(266,133,1,'b_a',3,'Parent of',2,'Child of',1,NULL,NULL),(267,134,1,'a_b',128,'Child of',3,'Parent of',1,NULL,NULL),(268,134,1,'b_a',3,'Parent of',128,'Child of',1,NULL,NULL),(269,135,4,'a_b',128,'Sibling of',2,'Sibling of',1,NULL,NULL),(270,135,4,'b_a',2,'Sibling of',128,'Sibling of',1,NULL,NULL),(271,136,8,'a_b',3,'Household Member of',127,'Household Member is',1,NULL,NULL),(272,136,8,'b_a',127,'Household Member is',3,'Household Member of',1,NULL,NULL),(273,137,8,'a_b',2,'Household Member of',127,'Household Member is',1,NULL,NULL),(274,137,8,'b_a',127,'Household Member is',2,'Household Member of',1,NULL,NULL),(275,138,8,'a_b',128,'Household Member of',127,'Household Member is',1,NULL,NULL),(276,138,8,'b_a',127,'Household Member is',128,'Household Member of',1,NULL,NULL),(277,139,7,'a_b',120,'Head of Household for',127,'Head of Household is',0,NULL,NULL),(278,139,7,'b_a',127,'Head of Household is',120,'Head of Household for',0,NULL,NULL),(279,140,2,'a_b',3,'Spouse of',120,'Spouse of',0,NULL,NULL),(280,140,2,'b_a',120,'Spouse of',3,'Spouse of',0,NULL,NULL),(281,141,1,'a_b',143,'Child of',146,'Parent of',1,NULL,NULL),(282,141,1,'b_a',146,'Parent of',143,'Child of',1,NULL,NULL),(283,142,1,'a_b',195,'Child of',146,'Parent of',1,NULL,NULL),(284,142,1,'b_a',146,'Parent of',195,'Child of',1,NULL,NULL),(285,143,1,'a_b',143,'Child of',18,'Parent of',1,NULL,NULL),(286,143,1,'b_a',18,'Parent of',143,'Child of',1,NULL,NULL),(287,144,1,'a_b',195,'Child of',18,'Parent of',1,NULL,NULL),(288,144,1,'b_a',18,'Parent of',195,'Child of',1,NULL,NULL),(289,145,4,'a_b',195,'Sibling of',143,'Sibling of',1,NULL,NULL),(290,145,4,'b_a',143,'Sibling of',195,'Sibling of',1,NULL,NULL),(291,146,8,'a_b',18,'Household Member of',53,'Household Member is',1,NULL,NULL),(292,146,8,'b_a',53,'Household Member is',18,'Household Member of',1,NULL,NULL),(293,147,8,'a_b',143,'Household Member of',53,'Household Member is',1,NULL,NULL),(294,147,8,'b_a',53,'Household Member is',143,'Household Member of',1,NULL,NULL),(295,148,8,'a_b',195,'Household Member of',53,'Household Member is',1,NULL,NULL),(296,148,8,'b_a',53,'Household Member is',195,'Household Member of',1,NULL,NULL),(297,149,7,'a_b',146,'Head of Household for',53,'Head of Household is',0,NULL,NULL),(298,149,7,'b_a',53,'Head of Household is',146,'Head of Household for',0,NULL,NULL),(299,150,2,'a_b',18,'Spouse of',146,'Spouse of',0,NULL,NULL),(300,150,2,'b_a',146,'Spouse of',18,'Spouse of',0,NULL,NULL),(301,151,1,'a_b',72,'Child of',4,'Parent of',1,NULL,NULL),(302,151,1,'b_a',4,'Parent of',72,'Child of',1,NULL,NULL),(303,152,1,'a_b',58,'Child of',4,'Parent of',1,NULL,NULL),(304,152,1,'b_a',4,'Parent of',58,'Child of',1,NULL,NULL),(305,153,1,'a_b',72,'Child of',177,'Parent of',1,NULL,NULL),(306,153,1,'b_a',177,'Parent of',72,'Child of',1,NULL,NULL),(307,154,1,'a_b',58,'Child of',177,'Parent of',1,NULL,NULL),(308,154,1,'b_a',177,'Parent of',58,'Child of',1,NULL,NULL),(309,155,4,'a_b',58,'Sibling of',72,'Sibling of',1,NULL,NULL),(310,155,4,'b_a',72,'Sibling of',58,'Sibling of',1,NULL,NULL),(311,156,8,'a_b',177,'Household Member of',155,'Household Member is',1,NULL,NULL),(312,156,8,'b_a',155,'Household Member is',177,'Household Member of',1,NULL,NULL),(313,157,8,'a_b',72,'Household Member of',155,'Household Member is',1,NULL,NULL),(314,157,8,'b_a',155,'Household Member is',72,'Household Member of',1,NULL,NULL),(315,158,8,'a_b',58,'Household Member of',155,'Household Member is',1,NULL,NULL),(316,158,8,'b_a',155,'Household Member is',58,'Household Member of',1,NULL,NULL),(317,159,7,'a_b',4,'Head of Household for',155,'Head of Household is',0,NULL,NULL),(318,159,7,'b_a',155,'Head of Household is',4,'Head of Household for',0,NULL,NULL),(319,160,2,'a_b',177,'Spouse of',4,'Spouse of',0,NULL,NULL),(320,160,2,'b_a',4,'Spouse of',177,'Spouse of',0,NULL,NULL),(321,161,1,'a_b',148,'Child of',54,'Parent of',1,NULL,NULL),(322,161,1,'b_a',54,'Parent of',148,'Child of',1,NULL,NULL),(323,162,1,'a_b',109,'Child of',54,'Parent of',1,NULL,NULL),(324,162,1,'b_a',54,'Parent of',109,'Child of',1,NULL,NULL),(325,163,1,'a_b',148,'Child of',98,'Parent of',1,NULL,NULL),(326,163,1,'b_a',98,'Parent of',148,'Child of',1,NULL,NULL),(327,164,1,'a_b',109,'Child of',98,'Parent of',1,NULL,NULL),(328,164,1,'b_a',98,'Parent of',109,'Child of',1,NULL,NULL),(329,165,4,'a_b',109,'Sibling of',148,'Sibling of',1,NULL,NULL),(330,165,4,'b_a',148,'Sibling of',109,'Sibling of',1,NULL,NULL),(331,166,8,'a_b',98,'Household Member of',41,'Household Member is',1,NULL,NULL),(332,166,8,'b_a',41,'Household Member is',98,'Household Member of',1,NULL,NULL),(333,167,8,'a_b',148,'Household Member of',41,'Household Member is',1,NULL,NULL),(334,167,8,'b_a',41,'Household Member is',148,'Household Member of',1,NULL,NULL),(335,168,8,'a_b',109,'Household Member of',41,'Household Member is',1,NULL,NULL),(336,168,8,'b_a',41,'Household Member is',109,'Household Member of',1,NULL,NULL),(337,169,7,'a_b',54,'Head of Household for',41,'Head of Household is',1,NULL,NULL),(338,169,7,'b_a',41,'Head of Household is',54,'Head of Household for',1,NULL,NULL),(339,170,2,'a_b',98,'Spouse of',54,'Spouse of',1,NULL,NULL),(340,170,2,'b_a',54,'Spouse of',98,'Spouse of',1,NULL,NULL),(341,171,1,'a_b',71,'Child of',69,'Parent of',1,NULL,NULL),(342,171,1,'b_a',69,'Parent of',71,'Child of',1,NULL,NULL),(343,172,1,'a_b',107,'Child of',69,'Parent of',1,NULL,NULL),(344,172,1,'b_a',69,'Parent of',107,'Child of',1,NULL,NULL),(345,173,1,'a_b',71,'Child of',188,'Parent of',1,NULL,NULL),(346,173,1,'b_a',188,'Parent of',71,'Child of',1,NULL,NULL),(347,174,1,'a_b',107,'Child of',188,'Parent of',1,NULL,NULL),(348,174,1,'b_a',188,'Parent of',107,'Child of',1,NULL,NULL),(349,175,4,'a_b',107,'Sibling of',71,'Sibling of',1,NULL,NULL),(350,175,4,'b_a',71,'Sibling of',107,'Sibling of',1,NULL,NULL),(351,176,8,'a_b',188,'Household Member of',13,'Household Member is',1,NULL,NULL),(352,176,8,'b_a',13,'Household Member is',188,'Household Member of',1,NULL,NULL),(353,177,8,'a_b',71,'Household Member of',13,'Household Member is',1,NULL,NULL),(354,177,8,'b_a',13,'Household Member is',71,'Household Member of',1,NULL,NULL),(355,178,8,'a_b',107,'Household Member of',13,'Household Member is',1,NULL,NULL),(356,178,8,'b_a',13,'Household Member is',107,'Household Member of',1,NULL,NULL),(357,179,7,'a_b',69,'Head of Household for',13,'Head of Household is',0,NULL,NULL),(358,179,7,'b_a',13,'Head of Household is',69,'Head of Household for',0,NULL,NULL),(359,180,2,'a_b',188,'Spouse of',69,'Spouse of',0,NULL,NULL),(360,180,2,'b_a',69,'Spouse of',188,'Spouse of',0,NULL,NULL),(361,181,1,'a_b',80,'Child of',83,'Parent of',1,NULL,NULL),(362,181,1,'b_a',83,'Parent of',80,'Child of',1,NULL,NULL),(363,182,1,'a_b',169,'Child of',83,'Parent of',1,NULL,NULL),(364,182,1,'b_a',83,'Parent of',169,'Child of',1,NULL,NULL),(365,183,1,'a_b',80,'Child of',85,'Parent of',1,NULL,NULL),(366,183,1,'b_a',85,'Parent of',80,'Child of',1,NULL,NULL),(367,184,1,'a_b',169,'Child of',85,'Parent of',1,NULL,NULL),(368,184,1,'b_a',85,'Parent of',169,'Child of',1,NULL,NULL),(369,185,4,'a_b',169,'Sibling of',80,'Sibling of',1,NULL,NULL),(370,185,4,'b_a',80,'Sibling of',169,'Sibling of',1,NULL,NULL),(371,186,8,'a_b',85,'Household Member of',62,'Household Member is',1,NULL,NULL),(372,186,8,'b_a',62,'Household Member is',85,'Household Member of',1,NULL,NULL),(373,187,8,'a_b',80,'Household Member of',62,'Household Member is',1,NULL,NULL),(374,187,8,'b_a',62,'Household Member is',80,'Household Member of',1,NULL,NULL),(375,188,8,'a_b',169,'Household Member of',62,'Household Member is',1,NULL,NULL),(376,188,8,'b_a',62,'Household Member is',169,'Household Member of',1,NULL,NULL),(377,189,7,'a_b',83,'Head of Household for',62,'Head of Household is',1,NULL,NULL),(378,189,7,'b_a',62,'Head of Household is',83,'Head of Household for',1,NULL,NULL),(379,190,2,'a_b',85,'Spouse of',83,'Spouse of',1,NULL,NULL),(380,190,2,'b_a',83,'Spouse of',85,'Spouse of',1,NULL,NULL),(381,191,1,'a_b',5,'Child of',116,'Parent of',1,NULL,NULL),(382,191,1,'b_a',116,'Parent of',5,'Child of',1,NULL,NULL),(383,192,1,'a_b',140,'Child of',116,'Parent of',1,NULL,NULL),(384,192,1,'b_a',116,'Parent of',140,'Child of',1,NULL,NULL),(385,193,1,'a_b',5,'Child of',115,'Parent of',1,NULL,NULL),(386,193,1,'b_a',115,'Parent of',5,'Child of',1,NULL,NULL),(387,194,1,'a_b',140,'Child of',115,'Parent of',1,NULL,NULL),(388,194,1,'b_a',115,'Parent of',140,'Child of',1,NULL,NULL),(389,195,4,'a_b',140,'Sibling of',5,'Sibling of',1,NULL,NULL),(390,195,4,'b_a',5,'Sibling of',140,'Sibling of',1,NULL,NULL),(391,196,8,'a_b',115,'Household Member of',198,'Household Member is',1,NULL,NULL),(392,196,8,'b_a',198,'Household Member is',115,'Household Member of',1,NULL,NULL),(393,197,8,'a_b',5,'Household Member of',198,'Household Member is',1,NULL,NULL),(394,197,8,'b_a',198,'Household Member is',5,'Household Member of',1,NULL,NULL),(395,198,8,'a_b',140,'Household Member of',198,'Household Member is',1,NULL,NULL),(396,198,8,'b_a',198,'Household Member is',140,'Household Member of',1,NULL,NULL),(397,199,7,'a_b',116,'Head of Household for',198,'Head of Household is',1,NULL,NULL),(398,199,7,'b_a',198,'Head of Household is',116,'Head of Household for',1,NULL,NULL),(399,200,2,'a_b',115,'Spouse of',116,'Spouse of',1,NULL,NULL),(400,200,2,'b_a',116,'Spouse of',115,'Spouse of',1,NULL,NULL),(401,201,5,'a_b',4,'Employee of',15,'Employer of',1,NULL,NULL),(402,201,5,'b_a',15,'Employer of',4,'Employee of',1,NULL,NULL),(403,202,5,'a_b',153,'Employee of',21,'Employer of',1,NULL,NULL),(404,202,5,'b_a',21,'Employer of',153,'Employee of',1,NULL,NULL),(405,203,5,'a_b',52,'Employee of',23,'Employer of',1,NULL,NULL),(406,203,5,'b_a',23,'Employer of',52,'Employee of',1,NULL,NULL),(407,204,5,'a_b',169,'Employee of',39,'Employer of',1,NULL,NULL),(408,204,5,'b_a',39,'Employer of',169,'Employee of',1,NULL,NULL),(409,205,5,'a_b',110,'Employee of',70,'Employer of',1,NULL,NULL),(410,205,5,'b_a',70,'Employer of',110,'Employee of',1,NULL,NULL),(411,206,5,'a_b',28,'Employee of',73,'Employer of',1,NULL,NULL),(412,206,5,'b_a',73,'Employer of',28,'Employee of',1,NULL,NULL),(413,207,5,'a_b',54,'Employee of',74,'Employer of',1,NULL,NULL),(414,207,5,'b_a',74,'Employer of',54,'Employee of',1,NULL,NULL),(415,208,5,'a_b',85,'Employee of',77,'Employer of',1,NULL,NULL),(416,208,5,'b_a',77,'Employer of',85,'Employee of',1,NULL,NULL),(417,209,5,'a_b',87,'Employee of',93,'Employer of',1,NULL,NULL),(418,209,5,'b_a',93,'Employer of',87,'Employee of',1,NULL,NULL),(419,210,5,'a_b',78,'Employee of',101,'Employer of',1,NULL,NULL),(420,210,5,'b_a',101,'Employer of',78,'Employee of',1,NULL,NULL),(421,211,5,'a_b',24,'Employee of',102,'Employer of',1,NULL,NULL),(422,211,5,'b_a',102,'Employer of',24,'Employee of',1,NULL,NULL),(423,212,5,'a_b',175,'Employee of',103,'Employer of',1,NULL,NULL),(424,212,5,'b_a',103,'Employer of',175,'Employee of',1,NULL,NULL),(425,213,5,'a_b',111,'Employee of',129,'Employer of',1,NULL,NULL),(426,213,5,'b_a',129,'Employer of',111,'Employee of',1,NULL,NULL),(427,214,5,'a_b',3,'Employee of',165,'Employer of',1,NULL,NULL),(428,214,5,'b_a',165,'Employer of',3,'Employee of',1,NULL,NULL),(429,215,5,'a_b',12,'Employee of',167,'Employer of',1,NULL,NULL),(430,215,5,'b_a',167,'Employer of',12,'Employee of',1,NULL,NULL),(431,216,5,'a_b',91,'Employee of',170,'Employer of',1,NULL,NULL),(432,216,5,'b_a',170,'Employer of',91,'Employee of',1,NULL,NULL),(433,217,5,'a_b',147,'Employee of',172,'Employer of',1,NULL,NULL),(434,217,5,'b_a',172,'Employer of',147,'Employee of',1,NULL,NULL); /*!40000 ALTER TABLE `civicrm_relationship_cache` ENABLE KEYS */; UNLOCK TABLES; @@ -1328,7 +1328,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_state_province` WRITE; /*!40000 ALTER TABLE `civicrm_state_province` DISABLE KEYS */; -INSERT INTO `civicrm_state_province` (`id`, `name`, `abbreviation`, `country_id`) VALUES (1000,'Alabama','AL',1228),(1001,'Alaska','AK',1228),(1002,'Arizona','AZ',1228),(1003,'Arkansas','AR',1228),(1004,'California','CA',1228),(1005,'Colorado','CO',1228),(1006,'Connecticut','CT',1228),(1007,'Delaware','DE',1228),(1008,'Florida','FL',1228),(1009,'Georgia','GA',1228),(1010,'Hawaii','HI',1228),(1011,'Idaho','ID',1228),(1012,'Illinois','IL',1228),(1013,'Indiana','IN',1228),(1014,'Iowa','IA',1228),(1015,'Kansas','KS',1228),(1016,'Kentucky','KY',1228),(1017,'Louisiana','LA',1228),(1018,'Maine','ME',1228),(1019,'Maryland','MD',1228),(1020,'Massachusetts','MA',1228),(1021,'Michigan','MI',1228),(1022,'Minnesota','MN',1228),(1023,'Mississippi','MS',1228),(1024,'Missouri','MO',1228),(1025,'Montana','MT',1228),(1026,'Nebraska','NE',1228),(1027,'Nevada','NV',1228),(1028,'New Hampshire','NH',1228),(1029,'New Jersey','NJ',1228),(1030,'New Mexico','NM',1228),(1031,'New York','NY',1228),(1032,'North Carolina','NC',1228),(1033,'North Dakota','ND',1228),(1034,'Ohio','OH',1228),(1035,'Oklahoma','OK',1228),(1036,'Oregon','OR',1228),(1037,'Pennsylvania','PA',1228),(1038,'Rhode Island','RI',1228),(1039,'South Carolina','SC',1228),(1040,'South Dakota','SD',1228),(1041,'Tennessee','TN',1228),(1042,'Texas','TX',1228),(1043,'Utah','UT',1228),(1044,'Vermont','VT',1228),(1045,'Virginia','VA',1228),(1046,'Washington','WA',1228),(1047,'West Virginia','WV',1228),(1048,'Wisconsin','WI',1228),(1049,'Wyoming','WY',1228),(1050,'District of Columbia','DC',1228),(1052,'American Samoa','AS',1228),(1053,'Guam','GU',1228),(1055,'Northern Mariana Islands','MP',1228),(1056,'Puerto Rico','PR',1228),(1057,'Virgin Islands','VI',1228),(1058,'United States Minor Outlying Islands','UM',1228),(1059,'Armed Forces Europe','AE',1228),(1060,'Armed Forces Americas','AA',1228),(1061,'Armed Forces Pacific','AP',1228),(1100,'Alberta','AB',1039),(1101,'British Columbia','BC',1039),(1102,'Manitoba','MB',1039),(1103,'New Brunswick','NB',1039),(1104,'Newfoundland and Labrador','NL',1039),(1105,'Northwest Territories','NT',1039),(1106,'Nova Scotia','NS',1039),(1107,'Nunavut','NU',1039),(1108,'Ontario','ON',1039),(1109,'Prince Edward Island','PE',1039),(1110,'Quebec','QC',1039),(1111,'Saskatchewan','SK',1039),(1112,'Yukon Territory','YT',1039),(1200,'Maharashtra','MM',1101),(1201,'Karnataka','KA',1101),(1202,'Andhra Pradesh','AP',1101),(1203,'Arunachal Pradesh','AR',1101),(1204,'Assam','AS',1101),(1205,'Bihar','BR',1101),(1206,'Chhattisgarh','CH',1101),(1207,'Goa','GA',1101),(1208,'Gujarat','GJ',1101),(1209,'Haryana','HR',1101),(1210,'Himachal Pradesh','HP',1101),(1211,'Jammu and Kashmir','JK',1101),(1212,'Jharkhand','JH',1101),(1213,'Kerala','KL',1101),(1214,'Madhya Pradesh','MP',1101),(1215,'Manipur','MN',1101),(1216,'Meghalaya','ML',1101),(1217,'Mizoram','MZ',1101),(1218,'Nagaland','NL',1101),(1219,'Orissa','OR',1101),(1220,'Punjab','PB',1101),(1221,'Rajasthan','RJ',1101),(1222,'Sikkim','SK',1101),(1223,'Tamil Nadu','TN',1101),(1224,'Tripura','TR',1101),(1225,'Uttarakhand','UT',1101),(1226,'Uttar Pradesh','UP',1101),(1227,'West Bengal','WB',1101),(1228,'Andaman and Nicobar Islands','AN',1101),(1229,'Dadra and Nagar Haveli','DN',1101),(1230,'Daman and Diu','DD',1101),(1231,'Delhi','DL',1101),(1232,'Lakshadweep','LD',1101),(1233,'Pondicherry','PY',1101),(1300,'mazowieckie','MZ',1172),(1301,'pomorskie','PM',1172),(1302,'dolnośląskie','DS',1172),(1303,'kujawsko-pomorskie','KP',1172),(1304,'lubelskie','LU',1172),(1305,'lubuskie','LB',1172),(1306,'łódzkie','LD',1172),(1307,'małopolskie','MA',1172),(1308,'opolskie','OP',1172),(1309,'podkarpackie','PK',1172),(1310,'podlaskie','PD',1172),(1311,'śląskie','SL',1172),(1312,'świętokrzyskie','SK',1172),(1313,'warmińsko-mazurskie','WN',1172),(1314,'wielkopolskie','WP',1172),(1315,'zachodniopomorskie','ZP',1172),(1500,'Abu Zaby','AZ',1225),(1501,'\'Ajman','AJ',1225),(1502,'Al Fujayrah','FU',1225),(1503,'Ash Shariqah','SH',1225),(1504,'Dubayy','DU',1225),(1505,'Ra\'s al Khaymah','RK',1225),(1506,'Dac Lac','33',1233),(1507,'Umm al Qaywayn','UQ',1225),(1508,'Badakhshan','BDS',1001),(1509,'Badghis','BDG',1001),(1510,'Baghlan','BGL',1001),(1511,'Balkh','BAL',1001),(1512,'Bamian','BAM',1001),(1513,'Farah','FRA',1001),(1514,'Faryab','FYB',1001),(1515,'Ghazni','GHA',1001),(1516,'Ghowr','GHO',1001),(1517,'Helmand','HEL',1001),(1518,'Herat','HER',1001),(1519,'Jowzjan','JOW',1001),(1520,'Kabul','KAB',1001),(1521,'Kandahar','KAN',1001),(1522,'Kapisa','KAP',1001),(1523,'Khowst','KHO',1001),(1524,'Konar','KNR',1001),(1525,'Kondoz','KDZ',1001),(1526,'Laghman','LAG',1001),(1527,'Lowgar','LOW',1001),(1528,'Nangrahar','NAN',1001),(1529,'Nimruz','NIM',1001),(1530,'Nurestan','NUR',1001),(1531,'Oruzgan','ORU',1001),(1532,'Paktia','PIA',1001),(1533,'Paktika','PKA',1001),(1534,'Parwan','PAR',1001),(1535,'Samangan','SAM',1001),(1536,'Sar-e Pol','SAR',1001),(1537,'Takhar','TAK',1001),(1538,'Wardak','WAR',1001),(1539,'Zabol','ZAB',1001),(1540,'Berat','BR',1002),(1541,'Bulqizë','BU',1002),(1542,'Delvinë','DL',1002),(1543,'Devoll','DV',1002),(1544,'Dibër','DI',1002),(1545,'Durrës','DR',1002),(1546,'Elbasan','EL',1002),(1547,'Fier','FR',1002),(1548,'Gramsh','GR',1002),(1549,'Gjirokastër','GJ',1002),(1550,'Has','HA',1002),(1551,'Kavajë','KA',1002),(1552,'Kolonjë','ER',1002),(1553,'Korçë','KO',1002),(1554,'Krujë','KR',1002),(1555,'Kuçovë','KC',1002),(1556,'Kukës','KU',1002),(1557,'Kurbin','KB',1002),(1558,'Lezhë','LE',1002),(1559,'Librazhd','LB',1002),(1560,'Lushnjë','LU',1002),(1561,'Malësi e Madhe','MM',1002),(1562,'Mallakastër','MK',1002),(1563,'Mat','MT',1002),(1564,'Mirditë','MR',1002),(1565,'Peqin','PQ',1002),(1566,'Përmet','PR',1002),(1567,'Pogradec','PG',1002),(1568,'Pukë','PU',1002),(1569,'Sarandë','SR',1002),(1570,'Skrapar','SK',1002),(1571,'Shkodër','SH',1002),(1572,'Tepelenë','TE',1002),(1573,'Tiranë','TR',1002),(1574,'Tropojë','TP',1002),(1575,'Vlorë','VL',1002),(1576,'Erevan','ER',1011),(1577,'Aragacotn','AG',1011),(1578,'Ararat','AR',1011),(1579,'Armavir','AV',1011),(1580,'Gegarkunik\'','GR',1011),(1581,'Kotayk\'','KT',1011),(1582,'Lory','LO',1011),(1583,'Sirak','SH',1011),(1584,'Syunik\'','SU',1011),(1585,'Tavus','TV',1011),(1586,'Vayoc Jor','VD',1011),(1587,'Bengo','BGO',1006),(1588,'Benguela','BGU',1006),(1589,'Bie','BIE',1006),(1590,'Cabinda','CAB',1006),(1591,'Cuando-Cubango','CCU',1006),(1592,'Cuanza Norte','CNO',1006),(1593,'Cuanza Sul','CUS',1006),(1594,'Cunene','CNN',1006),(1595,'Huambo','HUA',1006),(1596,'Huila','HUI',1006),(1597,'Luanda','LUA',1006),(1598,'Lunda Norte','LNO',1006),(1599,'Lunda Sul','LSU',1006),(1600,'Malange','MAL',1006),(1601,'Moxico','MOX',1006),(1602,'Namibe','NAM',1006),(1603,'Uige','UIG',1006),(1604,'Zaire','ZAI',1006),(1605,'Capital federal','C',1010),(1606,'Buenos Aires','B',1010),(1607,'Catamarca','K',1010),(1608,'Cordoba','X',1010),(1609,'Corrientes','W',1010),(1610,'Chaco','H',1010),(1611,'Chubut','U',1010),(1612,'Entre Rios','E',1010),(1613,'Formosa','P',1010),(1614,'Jujuy','Y',1010),(1615,'La Pampa','L',1010),(1616,'Mendoza','M',1010),(1617,'Misiones','N',1010),(1618,'Neuquen','Q',1010),(1619,'Rio Negro','R',1010),(1620,'Salta','A',1010),(1621,'San Juan','J',1010),(1622,'San Luis','D',1010),(1623,'Santa Cruz','Z',1010),(1624,'Santa Fe','S',1010),(1625,'Santiago del Estero','G',1010),(1626,'Tierra del Fuego','V',1010),(1627,'Tucuman','T',1010),(1628,'Burgenland','1',1014),(1629,'Kärnten','2',1014),(1630,'Niederösterreich','3',1014),(1631,'Oberösterreich','4',1014),(1632,'Salzburg','5',1014),(1633,'Steiermark','6',1014),(1634,'Tirol','7',1014),(1635,'Vorarlberg','8',1014),(1636,'Wien','9',1014),(1637,'Australian Antarctic Territory','AAT',1008),(1638,'Australian Capital Territory','ACT',1013),(1639,'Northern Territory','NT',1013),(1640,'New South Wales','NSW',1013),(1641,'Queensland','QLD',1013),(1642,'South Australia','SA',1013),(1643,'Tasmania','TAS',1013),(1644,'Victoria','VIC',1013),(1645,'Western Australia','WA',1013),(1646,'Naxcivan','NX',1015),(1647,'Ali Bayramli','AB',1015),(1648,'Baki','BA',1015),(1649,'Ganca','GA',1015),(1650,'Lankaran','LA',1015),(1651,'Mingacevir','MI',1015),(1652,'Naftalan','NA',1015),(1653,'Saki','SA',1015),(1654,'Sumqayit','SM',1015),(1655,'Susa','SS',1015),(1656,'Xankandi','XA',1015),(1657,'Yevlax','YE',1015),(1658,'Abseron','ABS',1015),(1659,'Agcabadi','AGC',1015),(1660,'Agdam','AGM',1015),(1661,'Agdas','AGS',1015),(1662,'Agstafa','AGA',1015),(1663,'Agsu','AGU',1015),(1664,'Astara','AST',1015),(1665,'Babak','BAB',1015),(1666,'Balakan','BAL',1015),(1667,'Barda','BAR',1015),(1668,'Beylagan','BEY',1015),(1669,'Bilasuvar','BIL',1015),(1670,'Cabrayll','CAB',1015),(1671,'Calilabad','CAL',1015),(1672,'Culfa','CUL',1015),(1673,'Daskasan','DAS',1015),(1674,'Davaci','DAV',1015),(1675,'Fuzuli','FUZ',1015),(1676,'Gadabay','GAD',1015),(1677,'Goranboy','GOR',1015),(1678,'Goycay','GOY',1015),(1679,'Haciqabul','HAC',1015),(1680,'Imisli','IMI',1015),(1681,'Ismayilli','ISM',1015),(1682,'Kalbacar','KAL',1015),(1683,'Kurdamir','KUR',1015),(1684,'Lacin','LAC',1015),(1685,'Lerik','LER',1015),(1686,'Masalli','MAS',1015),(1687,'Neftcala','NEF',1015),(1688,'Oguz','OGU',1015),(1689,'Ordubad','ORD',1015),(1690,'Qabala','QAB',1015),(1691,'Qax','QAX',1015),(1692,'Qazax','QAZ',1015),(1693,'Qobustan','QOB',1015),(1694,'Quba','QBA',1015),(1695,'Qubadli','QBI',1015),(1696,'Qusar','QUS',1015),(1697,'Saatli','SAT',1015),(1698,'Sabirabad','SAB',1015),(1699,'Sadarak','SAD',1015),(1700,'Sahbuz','SAH',1015),(1701,'Salyan','SAL',1015),(1702,'Samaxi','SMI',1015),(1703,'Samkir','SKR',1015),(1704,'Samux','SMX',1015),(1705,'Sarur','SAR',1015),(1706,'Siyazan','SIY',1015),(1707,'Tartar','TAR',1015),(1708,'Tovuz','TOV',1015),(1709,'Ucar','UCA',1015),(1710,'Xacmaz','XAC',1015),(1711,'Xanlar','XAN',1015),(1712,'Xizi','XIZ',1015),(1713,'Xocali','XCI',1015),(1714,'Xocavand','XVD',1015),(1715,'Yardimli','YAR',1015),(1716,'Zangilan','ZAN',1015),(1717,'Zaqatala','ZAQ',1015),(1718,'Zardab','ZAR',1015),(1719,'Federacija Bosna i Hercegovina','BIH',1026),(1720,'Republika Srpska','SRP',1026),(1721,'Bagerhat zila','05',1017),(1722,'Bandarban zila','01',1017),(1723,'Barguna zila','02',1017),(1724,'Barisal zila','06',1017),(1725,'Bhola zila','07',1017),(1726,'Bogra zila','03',1017),(1727,'Brahmanbaria zila','04',1017),(1728,'Chandpur zila','09',1017),(1729,'Chittagong zila','10',1017),(1730,'Chuadanga zila','12',1017),(1731,'Comilla zila','08',1017),(1732,'Cox\'s Bazar zila','11',1017),(1733,'Dhaka zila','13',1017),(1734,'Dinajpur zila','14',1017),(1735,'Faridpur zila','15',1017),(1736,'Feni zila','16',1017),(1737,'Gaibandha zila','19',1017),(1738,'Gazipur zila','18',1017),(1739,'Gopalganj zila','17',1017),(1740,'Habiganj zila','20',1017),(1741,'Jaipurhat zila','24',1017),(1742,'Jamalpur zila','21',1017),(1743,'Jessore zila','22',1017),(1744,'Jhalakati zila','25',1017),(1745,'Jhenaidah zila','23',1017),(1746,'Khagrachari zila','29',1017),(1747,'Khulna zila','27',1017),(1748,'Kishorganj zila','26',1017),(1749,'Kurigram zila','28',1017),(1750,'Kushtia zila','30',1017),(1751,'Lakshmipur zila','31',1017),(1752,'Lalmonirhat zila','32',1017),(1753,'Madaripur zila','36',1017),(1754,'Magura zila','37',1017),(1755,'Manikganj zila','33',1017),(1756,'Meherpur zila','39',1017),(1757,'Moulvibazar zila','38',1017),(1758,'Munshiganj zila','35',1017),(1759,'Mymensingh zila','34',1017),(1760,'Naogaon zila','48',1017),(1761,'Narail zila','43',1017),(1762,'Narayanganj zila','40',1017),(1763,'Narsingdi zila','42',1017),(1764,'Natore zila','44',1017),(1765,'Nawabganj zila','45',1017),(1766,'Netrakona zila','41',1017),(1767,'Nilphamari zila','46',1017),(1768,'Noakhali zila','47',1017),(1769,'Pabna zila','49',1017),(1770,'Panchagarh zila','52',1017),(1771,'Patuakhali zila','51',1017),(1772,'Pirojpur zila','50',1017),(1773,'Rajbari zila','53',1017),(1774,'Rajshahi zila','54',1017),(1775,'Rangamati zila','56',1017),(1776,'Rangpur zila','55',1017),(1777,'Satkhira zila','58',1017),(1778,'Shariatpur zila','62',1017),(1779,'Sherpur zila','57',1017),(1780,'Sirajganj zila','59',1017),(1781,'Sunamganj zila','61',1017),(1782,'Sylhet zila','60',1017),(1783,'Tangail zila','63',1017),(1784,'Thakurgaon zila','64',1017),(1785,'Antwerpen','VAN',1020),(1786,'Brabant Wallon','WBR',1020),(1787,'Hainaut','WHT',1020),(1788,'Liege','WLG',1020),(1789,'Limburg','VLI',1020),(1790,'Luxembourg','WLX',1020),(1791,'Namur','WNA',1020),(1792,'Oost-Vlaanderen','VOV',1020),(1793,'Vlaams-Brabant','VBR',1020),(1794,'West-Vlaanderen','VWV',1020),(1795,'Bale','BAL',1034),(1796,'Bam','BAM',1034),(1797,'Banwa','BAN',1034),(1798,'Bazega','BAZ',1034),(1799,'Bougouriba','BGR',1034),(1800,'Boulgou','BLG',1034),(1801,'Boulkiemde','BLK',1034),(1802,'Comoe','COM',1034),(1803,'Ganzourgou','GAN',1034),(1804,'Gnagna','GNA',1034),(1805,'Gourma','GOU',1034),(1806,'Houet','HOU',1034),(1807,'Ioba','IOB',1034),(1808,'Kadiogo','KAD',1034),(1809,'Kenedougou','KEN',1034),(1810,'Komondjari','KMD',1034),(1811,'Kompienga','KMP',1034),(1812,'Kossi','KOS',1034),(1813,'Koulpulogo','KOP',1034),(1814,'Kouritenga','KOT',1034),(1815,'Kourweogo','KOW',1034),(1816,'Leraba','LER',1034),(1817,'Loroum','LOR',1034),(1818,'Mouhoun','MOU',1034),(1819,'Nahouri','NAO',1034),(1820,'Namentenga','NAM',1034),(1821,'Nayala','NAY',1034),(1822,'Noumbiel','NOU',1034),(1823,'Oubritenga','OUB',1034),(1824,'Oudalan','OUD',1034),(1825,'Passore','PAS',1034),(1826,'Poni','PON',1034),(1827,'Sanguie','SNG',1034),(1828,'Sanmatenga','SMT',1034),(1829,'Seno','SEN',1034),(1830,'Siasili','SIS',1034),(1831,'Soum','SOM',1034),(1832,'Sourou','SOR',1034),(1833,'Tapoa','TAP',1034),(1834,'Tui','TUI',1034),(1835,'Yagha','YAG',1034),(1836,'Yatenga','YAT',1034),(1837,'Ziro','ZIR',1034),(1838,'Zondoma','ZON',1034),(1839,'Zoundweogo','ZOU',1034),(1840,'Blagoevgrad','01',1033),(1841,'Burgas','02',1033),(1842,'Dobrich','08',1033),(1843,'Gabrovo','07',1033),(1844,'Haskovo','26',1033),(1845,'Yambol','28',1033),(1846,'Kardzhali','09',1033),(1847,'Kyustendil','10',1033),(1848,'Lovech','11',1033),(1849,'Montana','12',1033),(1850,'Pazardzhik','13',1033),(1851,'Pernik','14',1033),(1852,'Pleven','15',1033),(1853,'Plovdiv','16',1033),(1854,'Razgrad','17',1033),(1855,'Ruse','18',1033),(1856,'Silistra','19',1033),(1857,'Sliven','20',1033),(1858,'Smolyan','21',1033),(1859,'Sofia','23',1033),(1860,'Stara Zagora','24',1033),(1861,'Shumen','27',1033),(1862,'Targovishte','25',1033),(1863,'Varna','03',1033),(1864,'Veliko Tarnovo','04',1033),(1865,'Vidin','05',1033),(1866,'Vratsa','06',1033),(1867,'Al Hadd','01',1016),(1868,'Al Manamah','03',1016),(1869,'Al Mintaqah al Gharbiyah','10',1016),(1870,'Al Mintagah al Wusta','07',1016),(1871,'Al Mintaqah ash Shamaliyah','05',1016),(1872,'Al Muharraq','02',1016),(1873,'Ar Rifa','09',1016),(1874,'Jidd Hafs','04',1016),(1875,'Madluat Jamad','12',1016),(1876,'Madluat Isa','08',1016),(1877,'Mintaqat Juzur tawar','11',1016),(1878,'Sitrah','06',1016),(1879,'Bubanza','BB',1036),(1880,'Bujumbura','BJ',1036),(1881,'Bururi','BR',1036),(1882,'Cankuzo','CA',1036),(1883,'Cibitoke','CI',1036),(1884,'Gitega','GI',1036),(1885,'Karuzi','KR',1036),(1886,'Kayanza','KY',1036),(1887,'Makamba','MA',1036),(1888,'Muramvya','MU',1036),(1889,'Mwaro','MW',1036),(1890,'Ngozi','NG',1036),(1891,'Rutana','RT',1036),(1892,'Ruyigi','RY',1036),(1893,'Alibori','AL',1022),(1894,'Atakora','AK',1022),(1895,'Atlantique','AQ',1022),(1896,'Borgou','BO',1022),(1897,'Collines','CO',1022),(1898,'Donga','DO',1022),(1899,'Kouffo','KO',1022),(1900,'Littoral','LI',1022),(1901,'Mono','MO',1022),(1902,'Oueme','OU',1022),(1903,'Plateau','PL',1022),(1904,'Zou','ZO',1022),(1905,'Belait','BE',1032),(1906,'Brunei-Muara','BM',1032),(1907,'Temburong','TE',1032),(1908,'Tutong','TU',1032),(1909,'Cochabamba','C',1025),(1910,'Chuquisaca','H',1025),(1911,'El Beni','B',1025),(1912,'La Paz','L',1025),(1913,'Oruro','O',1025),(1914,'Pando','N',1025),(1915,'Potosi','P',1025),(1916,'Tarija','T',1025),(1917,'Acre','AC',1029),(1918,'Alagoas','AL',1029),(1919,'Amazonas','AM',1029),(1920,'Amapa','AP',1029),(1921,'Bahia','BA',1029),(1922,'Ceara','CE',1029),(1923,'Distrito Federal','DF',1029),(1924,'Espirito Santo','ES',1029),(1926,'Goias','GO',1029),(1927,'Maranhao','MA',1029),(1928,'Minas Gerais','MG',1029),(1929,'Mato Grosso do Sul','MS',1029),(1930,'Mato Grosso','MT',1029),(1931,'Para','PA',1029),(1932,'Paraiba','PB',1029),(1933,'Pernambuco','PE',1029),(1934,'Piaui','PI',1029),(1935,'Parana','PR',1029),(1936,'Rio de Janeiro','RJ',1029),(1937,'Rio Grande do Norte','RN',1029),(1938,'Rondonia','RO',1029),(1939,'Roraima','RR',1029),(1940,'Rio Grande do Sul','RS',1029),(1941,'Santa Catarina','SC',1029),(1942,'Sergipe','SE',1029),(1943,'Sao Paulo','SP',1029),(1944,'Tocantins','TO',1029),(1945,'Acklins and Crooked Islands','AC',1212),(1946,'Bimini','BI',1212),(1947,'Cat Island','CI',1212),(1948,'Exuma','EX',1212),(1955,'Inagua','IN',1212),(1957,'Long Island','LI',1212),(1959,'Mayaguana','MG',1212),(1960,'New Providence','NP',1212),(1962,'Ragged Island','RI',1212),(1966,'Bumthang','33',1024),(1967,'Chhukha','12',1024),(1968,'Dagana','22',1024),(1969,'Gasa','GA',1024),(1970,'Ha','13',1024),(1971,'Lhuentse','44',1024),(1972,'Monggar','42',1024),(1973,'Paro','11',1024),(1974,'Pemagatshel','43',1024),(1975,'Punakha','23',1024),(1976,'Samdrup Jongkha','45',1024),(1977,'Samtee','14',1024),(1978,'Sarpang','31',1024),(1979,'Thimphu','15',1024),(1980,'Trashigang','41',1024),(1981,'Trashi Yangtse','TY',1024),(1982,'Trongsa','32',1024),(1983,'Tsirang','21',1024),(1984,'Wangdue Phodrang','24',1024),(1985,'Zhemgang','34',1024),(1986,'Central','CE',1027),(1987,'Ghanzi','GH',1027),(1988,'Kgalagadi','KG',1027),(1989,'Kgatleng','KL',1027),(1990,'Kweneng','KW',1027),(1991,'Ngamiland','NG',1027),(1992,'North-East','NE',1027),(1993,'North-West','NW',1027),(1994,'South-East','SE',1027),(1995,'Southern','SO',1027),(1996,'Brèsckaja voblasc\'','BR',1019),(1997,'Homel\'skaja voblasc\'','HO',1019),(1998,'Hrodzenskaja voblasc\'','HR',1019),(1999,'Mahilëuskaja voblasc\'','MA',1019),(2000,'Minskaja voblasc\'','MI',1019),(2001,'Vicebskaja voblasc\'','VI',1019),(2002,'Belize','BZ',1021),(2003,'Cayo','CY',1021),(2004,'Corozal','CZL',1021),(2005,'Orange Walk','OW',1021),(2006,'Stann Creek','SC',1021),(2007,'Toledo','TOL',1021),(2008,'Kinshasa','KN',1050),(2011,'Equateur','EQ',1050),(2014,'Kasai-Oriental','KE',1050),(2016,'Maniema','MA',1050),(2017,'Nord-Kivu','NK',1050),(2019,'Sud-Kivu','SK',1050),(2020,'Bangui','BGF',1042),(2021,'Bamingui-Bangoran','BB',1042),(2022,'Basse-Kotto','BK',1042),(2023,'Haute-Kotto','HK',1042),(2024,'Haut-Mbomou','HM',1042),(2025,'Kemo','KG',1042),(2026,'Lobaye','LB',1042),(2027,'Mambere-Kadei','HS',1042),(2028,'Mbomou','MB',1042),(2029,'Nana-Grebizi','KB',1042),(2030,'Nana-Mambere','NM',1042),(2031,'Ombella-Mpoko','MP',1042),(2032,'Ouaka','UK',1042),(2033,'Ouham','AC',1042),(2034,'Ouham-Pende','OP',1042),(2035,'Sangha-Mbaere','SE',1042),(2036,'Vakaga','VR',1042),(2037,'Brazzaville','BZV',1051),(2038,'Bouenza','11',1051),(2039,'Cuvette','8',1051),(2040,'Cuvette-Ouest','15',1051),(2041,'Kouilou','5',1051),(2042,'Lekoumou','2',1051),(2043,'Likouala','7',1051),(2044,'Niari','9',1051),(2045,'Plateaux','14',1051),(2046,'Pool','12',1051),(2047,'Sangha','13',1051),(2048,'Aargau','AG',1205),(2049,'Appenzell Innerrhoden','AI',1205),(2050,'Appenzell Ausserrhoden','AR',1205),(2051,'Bern','BE',1205),(2052,'Basel-Landschaft','BL',1205),(2053,'Basel-Stadt','BS',1205),(2054,'Fribourg','FR',1205),(2055,'Geneva','GE',1205),(2056,'Glarus','GL',1205),(2057,'Graubunden','GR',1205),(2058,'Jura','JU',1205),(2059,'Luzern','LU',1205),(2060,'Neuchatel','NE',1205),(2061,'Nidwalden','NW',1205),(2062,'Obwalden','OW',1205),(2063,'Sankt Gallen','SG',1205),(2064,'Schaffhausen','SH',1205),(2065,'Solothurn','SO',1205),(2066,'Schwyz','SZ',1205),(2067,'Thurgau','TG',1205),(2068,'Ticino','TI',1205),(2069,'Uri','UR',1205),(2070,'Vaud','VD',1205),(2071,'Valais','VS',1205),(2072,'Zug','ZG',1205),(2073,'Zurich','ZH',1205),(2074,'18 Montagnes','06',1054),(2075,'Agnebi','16',1054),(2076,'Bas-Sassandra','09',1054),(2077,'Denguele','10',1054),(2078,'Haut-Sassandra','02',1054),(2079,'Lacs','07',1054),(2080,'Lagunes','01',1054),(2081,'Marahoue','12',1054),(2082,'Moyen-Comoe','05',1054),(2083,'Nzi-Comoe','11',1054),(2084,'Savanes','03',1054),(2085,'Sud-Bandama','15',1054),(2086,'Sud-Comoe','13',1054),(2087,'Vallee du Bandama','04',1054),(2088,'Worodouqou','14',1054),(2089,'Zanzan','08',1054),(2090,'Aisen del General Carlos Ibanez del Campo','AI',1044),(2091,'Antofagasta','AN',1044),(2092,'Araucania','AR',1044),(2093,'Atacama','AT',1044),(2094,'Bio-Bio','BI',1044),(2095,'Coquimbo','CO',1044),(2096,'Libertador General Bernardo O\'Higgins','LI',1044),(2097,'Los Lagos','LL',1044),(2098,'Magallanes','MA',1044),(2099,'Maule','ML',1044),(2100,'Santiago Metropolitan','SM',1044),(2101,'Tarapaca','TA',1044),(2102,'Valparaiso','VS',1044),(2103,'Adamaoua','AD',1038),(2104,'Centre','CE',1038),(2105,'East','ES',1038),(2106,'Far North','EN',1038),(2107,'North','NO',1038),(2108,'South','SW',1038),(2109,'South-West','SW',1038),(2110,'West','OU',1038),(2111,'Beijing','11',1045),(2112,'Chongqing','50',1045),(2113,'Shanghai','31',1045),(2114,'Tianjin','12',1045),(2115,'Anhui','34',1045),(2116,'Fujian','35',1045),(2117,'Gansu','62',1045),(2118,'Guangdong','44',1045),(2119,'Guizhou','52',1045),(2120,'Hainan','46',1045),(2121,'Hebei','13',1045),(2122,'Heilongjiang','23',1045),(2123,'Henan','41',1045),(2124,'Hubei','42',1045),(2125,'Hunan','43',1045),(2126,'Jiangsu','32',1045),(2127,'Jiangxi','36',1045),(2128,'Jilin','22',1045),(2129,'Liaoning','21',1045),(2130,'Qinghai','63',1045),(2131,'Shaanxi','61',1045),(2132,'Shandong','37',1045),(2133,'Shanxi','14',1045),(2134,'Sichuan','51',1045),(2135,'Taiwan','71',1045),(2136,'Yunnan','53',1045),(2137,'Zhejiang','33',1045),(2138,'Guangxi','45',1045),(2139,'Neia Mongol (mn)','15',1045),(2140,'Xinjiang','65',1045),(2141,'Xizang','54',1045),(2142,'Hong Kong','91',1045),(2143,'Macau','92',1045),(2144,'Distrito Capital de Bogotá','DC',1048),(2145,'Amazonea','AMA',1048),(2146,'Antioquia','ANT',1048),(2147,'Arauca','ARA',1048),(2148,'Atlántico','ATL',1048),(2149,'Bolívar','BOL',1048),(2150,'Boyacá','BOY',1048),(2151,'Caldea','CAL',1048),(2152,'Caquetá','CAQ',1048),(2153,'Casanare','CAS',1048),(2154,'Cauca','CAU',1048),(2155,'Cesar','CES',1048),(2156,'Córdoba','COR',1048),(2157,'Cundinamarca','CUN',1048),(2158,'Chocó','CHO',1048),(2159,'Guainía','GUA',1048),(2160,'Guaviare','GUV',1048),(2161,'La Guajira','LAG',1048),(2162,'Magdalena','MAG',1048),(2163,'Meta','MET',1048),(2164,'Nariño','NAR',1048),(2165,'Norte de Santander','NSA',1048),(2166,'Putumayo','PUT',1048),(2167,'Quindio','QUI',1048),(2168,'Risaralda','RIS',1048),(2169,'San Andrés, Providencia y Santa Catalina','SAP',1048),(2170,'Santander','SAN',1048),(2171,'Sucre','SUC',1048),(2172,'Tolima','TOL',1048),(2173,'Valle del Cauca','VAC',1048),(2174,'Vaupés','VAU',1048),(2175,'Vichada','VID',1048),(2176,'Alajuela','A',1053),(2177,'Cartago','C',1053),(2178,'Guanacaste','G',1053),(2179,'Heredia','H',1053),(2180,'Limon','L',1053),(2181,'Puntarenas','P',1053),(2182,'San Jose','SJ',1053),(2183,'Camagey','09',1056),(2184,'Ciego de `vila','08',1056),(2185,'Cienfuegos','06',1056),(2186,'Ciudad de La Habana','03',1056),(2187,'Granma','12',1056),(2188,'Guantanamo','14',1056),(2189,'Holquin','11',1056),(2190,'La Habana','02',1056),(2191,'Las Tunas','10',1056),(2192,'Matanzas','04',1056),(2193,'Pinar del Rio','01',1056),(2194,'Sancti Spiritus','07',1056),(2195,'Santiago de Cuba','13',1056),(2196,'Villa Clara','05',1056),(2197,'Isla de la Juventud','99',1056),(2198,'Pinar del Roo','PR',1056),(2199,'Ciego de Avila','CA',1056),(2200,'Camagoey','CG',1056),(2201,'Holgun','HO',1056),(2202,'Sancti Spritus','SS',1056),(2203,'Municipio Especial Isla de la Juventud','IJ',1056),(2204,'Boa Vista','BV',1040),(2205,'Brava','BR',1040),(2206,'Calheta de Sao Miguel','CS',1040),(2207,'Fogo','FO',1040),(2208,'Maio','MA',1040),(2209,'Mosteiros','MO',1040),(2210,'Paul','PA',1040),(2211,'Porto Novo','PN',1040),(2212,'Praia','PR',1040),(2213,'Ribeira Grande','RG',1040),(2214,'Sal','SL',1040),(2215,'Sao Domingos','SD',1040),(2216,'Sao Filipe','SF',1040),(2217,'Sao Nicolau','SN',1040),(2218,'Sao Vicente','SV',1040),(2219,'Tarrafal','TA',1040),(2220,'Ammochostos Magusa','04',1057),(2221,'Keryneia','06',1057),(2222,'Larnaka','03',1057),(2223,'Lefkosia','01',1057),(2224,'Lemesos','02',1057),(2225,'Pafos','05',1057),(2226,'Jihočeský kraj','JC',1058),(2227,'Jihomoravský kraj','JM',1058),(2228,'Karlovarský kraj','KA',1058),(2229,'Královéhradecký kraj','KR',1058),(2230,'Liberecký kraj','LI',1058),(2231,'Moravskoslezský kraj','MO',1058),(2232,'Olomoucký kraj','OL',1058),(2233,'Pardubický kraj','PA',1058),(2234,'Plzeňský kraj','PL',1058),(2235,'Praha, hlavní město','PR',1058),(2236,'Středočeský kraj','ST',1058),(2237,'Ústecký kraj','US',1058),(2238,'Vysočina','VY',1058),(2239,'Zlínský kraj','ZL',1058),(2240,'Baden-Württemberg','BW',1082),(2241,'Bayern','BY',1082),(2242,'Bremen','HB',1082),(2243,'Hamburg','HH',1082),(2244,'Hessen','HE',1082),(2245,'Niedersachsen','NI',1082),(2246,'Nordrhein-Westfalen','NW',1082),(2247,'Rheinland-Pfalz','RP',1082),(2248,'Saarland','SL',1082),(2249,'Schleswig-Holstein','SH',1082),(2250,'Berlin','BE',1082),(2251,'Brandenburg','BB',1082),(2252,'Mecklenburg-Vorpommern','MV',1082),(2253,'Sachsen','SN',1082),(2254,'Sachsen-Anhalt','ST',1082),(2255,'Thüringen','TH',1082),(2256,'Ali Sabiah','AS',1060),(2257,'Dikhil','DI',1060),(2258,'Djibouti','DJ',1060),(2259,'Obock','OB',1060),(2260,'Tadjoura','TA',1060),(2261,'Frederiksberg','147',1059),(2262,'Copenhagen City','101',1059),(2263,'Copenhagen','015',1059),(2264,'Frederiksborg','020',1059),(2265,'Roskilde','025',1059),(2266,'Vestsjælland','030',1059),(2267,'Storstrøm','035',1059),(2268,'Bornholm','040',1059),(2269,'Fyn','042',1059),(2270,'South Jutland','050',1059),(2271,'Ribe','055',1059),(2272,'Vejle','060',1059),(2273,'Ringkjøbing','065',1059),(2274,'Århus','070',1059),(2275,'Viborg','076',1059),(2276,'North Jutland','080',1059),(2277,'Distrito Nacional (Santo Domingo)','01',1062),(2278,'Azua','02',1062),(2279,'Bahoruco','03',1062),(2280,'Barahona','04',1062),(2281,'Dajabón','05',1062),(2282,'Duarte','06',1062),(2283,'El Seybo [El Seibo]','08',1062),(2284,'Espaillat','09',1062),(2285,'Hato Mayor','30',1062),(2286,'Independencia','10',1062),(2287,'La Altagracia','11',1062),(2288,'La Estrelleta [Elias Pina]','07',1062),(2289,'La Romana','12',1062),(2290,'La Vega','13',1062),(2291,'Maroia Trinidad Sánchez','14',1062),(2292,'Monseñor Nouel','28',1062),(2293,'Monte Cristi','15',1062),(2294,'Monte Plata','29',1062),(2295,'Pedernales','16',1062),(2296,'Peravia','17',1062),(2297,'Puerto Plata','18',1062),(2298,'Salcedo','19',1062),(2299,'Samaná','20',1062),(2300,'San Cristóbal','21',1062),(2301,'San Pedro de Macorís','23',1062),(2302,'Sánchez Ramírez','24',1062),(2303,'Santiago','25',1062),(2304,'Santiago Rodríguez','26',1062),(2305,'Valverde','27',1062),(2306,'Adrar','01',1003),(2307,'Ain Defla','44',1003),(2308,'Ain Tmouchent','46',1003),(2309,'Alger','16',1003),(2310,'Annaba','23',1003),(2311,'Batna','05',1003),(2312,'Bechar','08',1003),(2313,'Bejaia','06',1003),(2314,'Biskra','07',1003),(2315,'Blida','09',1003),(2316,'Bordj Bou Arreridj','34',1003),(2317,'Bouira','10',1003),(2318,'Boumerdes','35',1003),(2319,'Chlef','02',1003),(2320,'Constantine','25',1003),(2321,'Djelfa','17',1003),(2322,'El Bayadh','32',1003),(2323,'El Oued','39',1003),(2324,'El Tarf','36',1003),(2325,'Ghardaia','47',1003),(2326,'Guelma','24',1003),(2327,'Illizi','33',1003),(2328,'Jijel','18',1003),(2329,'Khenchela','40',1003),(2330,'Laghouat','03',1003),(2331,'Mascara','29',1003),(2332,'Medea','26',1003),(2333,'Mila','43',1003),(2334,'Mostaganem','27',1003),(2335,'Msila','28',1003),(2336,'Naama','45',1003),(2337,'Oran','31',1003),(2338,'Ouargla','30',1003),(2339,'Oum el Bouaghi','04',1003),(2340,'Relizane','48',1003),(2341,'Saida','20',1003),(2342,'Setif','19',1003),(2343,'Sidi Bel Abbes','22',1003),(2344,'Skikda','21',1003),(2345,'Souk Ahras','41',1003),(2346,'Tamanghasset','11',1003),(2347,'Tebessa','12',1003),(2348,'Tiaret','14',1003),(2349,'Tindouf','37',1003),(2350,'Tipaza','42',1003),(2351,'Tissemsilt','38',1003),(2352,'Tizi Ouzou','15',1003),(2353,'Tlemcen','13',1003),(2354,'Azuay','A',1064),(2355,'Bolivar','B',1064),(2356,'Canar','F',1064),(2357,'Carchi','C',1064),(2358,'Cotopaxi','X',1064),(2359,'Chimborazo','H',1064),(2360,'El Oro','O',1064),(2361,'Esmeraldas','E',1064),(2362,'Galapagos','W',1064),(2363,'Guayas','G',1064),(2364,'Imbabura','I',1064),(2365,'Loja','L',1064),(2366,'Los Rios','R',1064),(2367,'Manabi','M',1064),(2368,'Morona-Santiago','S',1064),(2369,'Napo','N',1064),(2370,'Orellana','D',1064),(2371,'Pastaza','Y',1064),(2372,'Pichincha','P',1064),(2373,'Sucumbios','U',1064),(2374,'Tungurahua','T',1064),(2375,'Zamora-Chinchipe','Z',1064),(2376,'Harjumaa','37',1069),(2377,'Hiiumaa','39',1069),(2378,'Ida-Virumaa','44',1069),(2379,'Jõgevamaa','49',1069),(2380,'Järvamaa','51',1069),(2381,'Läänemaa','57',1069),(2382,'Lääne-Virumaa','59',1069),(2383,'Põlvamaa','65',1069),(2384,'Pärnumaa','67',1069),(2385,'Raplamaa','70',1069),(2386,'Saaremaa','74',1069),(2387,'Tartumaa','7B',1069),(2388,'Valgamaa','82',1069),(2389,'Viljandimaa','84',1069),(2390,'Võrumaa','86',1069),(2391,'Ad Daqahllyah','DK',1065),(2392,'Al Bahr al Ahmar','BA',1065),(2393,'Al Buhayrah','BH',1065),(2394,'Al Fayym','FYM',1065),(2395,'Al Gharbiyah','GH',1065),(2396,'Al Iskandarlyah','ALX',1065),(2397,'Al Isma illyah','IS',1065),(2398,'Al Jizah','GZ',1065),(2399,'Al Minuflyah','MNF',1065),(2400,'Al Minya','MN',1065),(2401,'Al Qahirah','C',1065),(2402,'Al Qalyublyah','KB',1065),(2403,'Al Wadi al Jadid','WAD',1065),(2404,'Ash Sharqiyah','SHR',1065),(2405,'As Suways','SUZ',1065),(2406,'Aswan','ASN',1065),(2407,'Asyut','AST',1065),(2408,'Bani Suwayf','BNS',1065),(2409,'Bur Sa\'id','PTS',1065),(2410,'Dumyat','DT',1065),(2411,'Janub Sina\'','JS',1065),(2412,'Kafr ash Shaykh','KFS',1065),(2413,'Matruh','MT',1065),(2414,'Qina','KN',1065),(2415,'Shamal Sina\'','SIN',1065),(2416,'Suhaj','SHG',1065),(2417,'Anseba','AN',1068),(2418,'Debub','DU',1068),(2419,'Debubawi Keyih Bahri [Debub-Keih-Bahri]','DK',1068),(2420,'Gash-Barka','GB',1068),(2421,'Maakel [Maekel]','MA',1068),(2422,'Semenawi Keyih Bahri [Semien-Keih-Bahri]','SK',1068),(2423,'Álava','VI',1198),(2424,'Albacete','AB',1198),(2425,'Alicante','A',1198),(2426,'Almería','AL',1198),(2427,'Asturias','O',1198),(2428,'Ávila','AV',1198),(2429,'Badajoz','BA',1198),(2430,'Baleares','PM',1198),(2431,'Barcelona','B',1198),(2432,'Burgos','BU',1198),(2433,'Cáceres','CC',1198),(2434,'Cádiz','CA',1198),(2435,'Cantabria','S',1198),(2436,'Castellón','CS',1198),(2437,'Ciudad Real','CR',1198),(2438,'Cuenca','CU',1198),(2439,'Girona [Gerona]','GE',1198),(2440,'Granada','GR',1198),(2441,'Guadalajara','GU',1198),(2442,'Guipúzcoa','SS',1198),(2443,'Huelva','H',1198),(2444,'Huesca','HU',1198),(2445,'Jaén','J',1198),(2446,'La Coruña','C',1198),(2447,'La Rioja','LO',1198),(2448,'Las Palmas','GC',1198),(2449,'León','LE',1198),(2450,'Lleida [Lérida]','L',1198),(2451,'Lugo','LU',1198),(2452,'Madrid','M',1198),(2453,'Málaga','MA',1198),(2454,'Murcia','MU',1198),(2455,'Navarra','NA',1198),(2456,'Ourense','OR',1198),(2457,'Palencia','P',1198),(2458,'Pontevedra','PO',1198),(2459,'Salamanca','SA',1198),(2460,'Santa Cruz de Tenerife','TF',1198),(2461,'Segovia','SG',1198),(2462,'Sevilla','SE',1198),(2463,'Soria','SO',1198),(2464,'Tarragona','T',1198),(2465,'Teruel','TE',1198),(2466,'Valencia','V',1198),(2467,'Valladolid','VA',1198),(2468,'Vizcaya','BI',1198),(2469,'Zamora','ZA',1198),(2470,'Zaragoza','Z',1198),(2471,'Ceuta','CE',1198),(2472,'Melilla','ML',1198),(2473,'Addis Ababa','AA',1070),(2474,'Dire Dawa','DD',1070),(2475,'Afar','AF',1070),(2476,'Amara','AM',1070),(2477,'Benshangul-Gumaz','BE',1070),(2478,'Gambela Peoples','GA',1070),(2479,'Harari People','HA',1070),(2480,'Oromia','OR',1070),(2481,'Somali','SO',1070),(2482,'Southern Nations, Nationalities and Peoples','SN',1070),(2483,'Tigrai','TI',1070),(2490,'Eastern','E',1074),(2491,'Northern','N',1074),(2492,'Western','W',1074),(2493,'Rotuma','R',1074),(2494,'Chuuk','TRK',1141),(2495,'Kosrae','KSA',1141),(2496,'Pohnpei','PNI',1141),(2497,'Yap','YAP',1141),(2498,'Ain','01',1076),(2499,'Aisne','02',1076),(2500,'Allier','03',1076),(2501,'Alpes-de-Haute-Provence','04',1076),(2502,'Alpes-Maritimes','06',1076),(2503,'Ardèche','07',1076),(2504,'Ardennes','08',1076),(2505,'Ariège','09',1076),(2506,'Aube','10',1076),(2507,'Aude','11',1076),(2508,'Aveyron','12',1076),(2509,'Bas-Rhin','67',1076),(2510,'Bouches-du-Rhône','13',1076),(2511,'Calvados','14',1076),(2512,'Cantal','15',1076),(2513,'Charente','16',1076),(2514,'Charente-Maritime','17',1076),(2515,'Cher','18',1076),(2516,'Corrèze','19',1076),(2517,'Corse-du-Sud','20A',1076),(2518,'Côte-d\'Or','21',1076),(2519,'Côtes-d\'Armor','22',1076),(2520,'Creuse','23',1076),(2521,'Deux-Sèvres','79',1076),(2522,'Dordogne','24',1076),(2523,'Doubs','25',1076),(2524,'Drôme','26',1076),(2525,'Essonne','91',1076),(2526,'Eure','27',1076),(2527,'Eure-et-Loir','28',1076),(2528,'Finistère','29',1076),(2529,'Gard','30',1076),(2530,'Gers','32',1076),(2531,'Gironde','33',1076),(2532,'Haut-Rhin','68',1076),(2533,'Haute-Corse','20B',1076),(2534,'Haute-Garonne','31',1076),(2535,'Haute-Loire','43',1076),(2536,'Haute-Saône','70',1076),(2537,'Haute-Savoie','74',1076),(2538,'Haute-Vienne','87',1076),(2539,'Hautes-Alpes','05',1076),(2540,'Hautes-Pyrénées','65',1076),(2541,'Hauts-de-Seine','92',1076),(2542,'Hérault','34',1076),(2543,'Indre','36',1076),(2544,'Ille-et-Vilaine','35',1076),(2545,'Indre-et-Loire','37',1076),(2546,'Isère','38',1076),(2547,'Landes','40',1076),(2548,'Loir-et-Cher','41',1076),(2549,'Loire','42',1076),(2550,'Loire-Atlantique','44',1076),(2551,'Loiret','45',1076),(2552,'Lot','46',1076),(2553,'Lot-et-Garonne','47',1076),(2554,'Lozère','48',1076),(2555,'Maine-et-Loire','49',1076),(2556,'Manche','50',1076),(2557,'Marne','51',1076),(2558,'Mayenne','53',1076),(2559,'Meurthe-et-Moselle','54',1076),(2560,'Meuse','55',1076),(2561,'Morbihan','56',1076),(2562,'Moselle','57',1076),(2563,'Nièvre','58',1076),(2564,'Nord','59',1076),(2565,'Oise','60',1076),(2566,'Orne','61',1076),(2567,'Paris','75',1076),(2568,'Pas-de-Calais','62',1076),(2569,'Puy-de-Dôme','63',1076),(2570,'Pyrénées-Atlantiques','64',1076),(2571,'Pyrénées-Orientales','66',1076),(2572,'Rhône','69',1076),(2573,'Saône-et-Loire','71',1076),(2574,'Sarthe','72',1076),(2575,'Savoie','73',1076),(2576,'Seine-et-Marne','77',1076),(2577,'Seine-Maritime','76',1076),(2578,'Seine-Saint-Denis','93',1076),(2579,'Somme','80',1076),(2580,'Tarn','81',1076),(2581,'Tarn-et-Garonne','82',1076),(2582,'Val d\'Oise','95',1076),(2583,'Territoire de Belfort','90',1076),(2584,'Val-de-Marne','94',1076),(2585,'Var','83',1076),(2586,'Vaucluse','84',1076),(2587,'Vendée','85',1076),(2588,'Vienne','86',1076),(2589,'Vosges','88',1076),(2590,'Yonne','89',1076),(2591,'Yvelines','78',1076),(2592,'Aberdeen City','ABE',1226),(2593,'Aberdeenshire','ABD',1226),(2594,'Angus','ANS',1226),(2595,'Co Antrim','ANT',1226),(2597,'Argyll and Bute','AGB',1226),(2598,'Co Armagh','ARM',1226),(2606,'Bedfordshire','BDF',1226),(2612,'Gwent','BGW',1226),(2620,'Bristol, City of','BST',1226),(2622,'Buckinghamshire','BKM',1226),(2626,'Cambridgeshire','CAM',1226),(2634,'Cheshire','CHS',1226),(2635,'Clackmannanshire','CLK',1226),(2639,'Cornwall','CON',1226),(2643,'Cumbria','CMA',1226),(2647,'Derbyshire','DBY',1226),(2648,'Co Londonderry','DRY',1226),(2649,'Devon','DEV',1226),(2651,'Dorset','DOR',1226),(2652,'Co Down','DOW',1226),(2654,'Dumfries and Galloway','DGY',1226),(2655,'Dundee City','DND',1226),(2657,'County Durham','DUR',1226),(2659,'East Ayrshire','EAY',1226),(2660,'East Dunbartonshire','EDU',1226),(2661,'East Lothian','ELN',1226),(2662,'East Renfrewshire','ERW',1226),(2663,'East Riding of Yorkshire','ERY',1226),(2664,'East Sussex','ESX',1226),(2665,'Edinburgh, City of','EDH',1226),(2666,'Na h-Eileanan Siar','ELS',1226),(2668,'Essex','ESS',1226),(2669,'Falkirk','FAL',1226),(2670,'Co Fermanagh','FER',1226),(2671,'Fife','FIF',1226),(2674,'Glasgow City','GLG',1226),(2675,'Gloucestershire','GLS',1226),(2678,'Gwynedd','GWN',1226),(2682,'Hampshire','HAM',1226),(2687,'Herefordshire','HEF',1226),(2688,'Hertfordshire','HRT',1226),(2689,'Highland','HED',1226),(2692,'Inverclyde','IVC',1226),(2694,'Isle of Wight','IOW',1226),(2699,'Kent','KEN',1226),(2705,'Lancashire','LAN',1226),(2709,'Leicestershire','LEC',1226),(2712,'Lincolnshire','LIN',1226),(2723,'Midlothian','MLN',1226),(2726,'Moray','MRY',1226),(2734,'Norfolk','NFK',1226),(2735,'North Ayrshire','NAY',1226),(2738,'North Lanarkshire','NLK',1226),(2742,'North Yorkshire','NYK',1226),(2743,'Northamptonshire','NTH',1226),(2744,'Northumberland','NBL',1226),(2746,'Nottinghamshire','NTT',1226),(2747,'Oldham','OLD',1226),(2748,'Omagh','OMH',1226),(2749,'Orkney Islands','ORR',1226),(2750,'Oxfordshire','OXF',1226),(2752,'Perth and Kinross','PKN',1226),(2757,'Powys','POW',1226),(2761,'Renfrewshire','RFW',1226),(2766,'Rutland','RUT',1226),(2770,'Scottish Borders','SCB',1226),(2773,'Shetland Islands','ZET',1226),(2774,'Shropshire','SHR',1226),(2777,'Somerset','SOM',1226),(2778,'South Ayrshire','SAY',1226),(2779,'South Gloucestershire','SGC',1226),(2780,'South Lanarkshire','SLK',1226),(2785,'Staffordshire','STS',1226),(2786,'Stirling','STG',1226),(2791,'Suffolk','SFK',1226),(2793,'Surrey','SRY',1226),(2804,'Mid Glamorgan','VGL',1226),(2811,'Warwickshire','WAR',1226),(2813,'West Dunbartonshire','WDU',1226),(2814,'West Lothian','WLN',1226),(2815,'West Sussex','WSX',1226),(2818,'Wiltshire','WIL',1226),(2823,'Worcestershire','WOR',1226),(2826,'Ashanti','AH',1083),(2827,'Brong-Ahafo','BA',1083),(2828,'Greater Accra','AA',1083),(2829,'Upper East','UE',1083),(2830,'Upper West','UW',1083),(2831,'Volta','TV',1083),(2832,'Banjul','B',1213),(2833,'Lower River','L',1213),(2834,'MacCarthy Island','M',1213),(2835,'North Bank','N',1213),(2836,'Upper River','U',1213),(2837,'Beyla','BE',1091),(2838,'Boffa','BF',1091),(2839,'Boke','BK',1091),(2840,'Coyah','CO',1091),(2841,'Dabola','DB',1091),(2842,'Dalaba','DL',1091),(2843,'Dinguiraye','DI',1091),(2844,'Dubreka','DU',1091),(2845,'Faranah','FA',1091),(2846,'Forecariah','FO',1091),(2847,'Fria','FR',1091),(2848,'Gaoual','GA',1091),(2849,'Guekedou','GU',1091),(2850,'Kankan','KA',1091),(2851,'Kerouane','KE',1091),(2852,'Kindia','KD',1091),(2853,'Kissidougou','KS',1091),(2854,'Koubia','KB',1091),(2855,'Koundara','KN',1091),(2856,'Kouroussa','KO',1091),(2857,'Labe','LA',1091),(2858,'Lelouma','LE',1091),(2859,'Lola','LO',1091),(2860,'Macenta','MC',1091),(2861,'Mali','ML',1091),(2862,'Mamou','MM',1091),(2863,'Mandiana','MD',1091),(2864,'Nzerekore','NZ',1091),(2865,'Pita','PI',1091),(2866,'Siguiri','SI',1091),(2867,'Telimele','TE',1091),(2868,'Tougue','TO',1091),(2869,'Yomou','YO',1091),(2870,'Region Continental','C',1067),(2871,'Region Insular','I',1067),(2872,'Annobon','AN',1067),(2873,'Bioko Norte','BN',1067),(2874,'Bioko Sur','BS',1067),(2875,'Centro Sur','CS',1067),(2876,'Kie-Ntem','KN',1067),(2877,'Litoral','LI',1067),(2878,'Wele-Nzas','WN',1067),(2879,'Achaïa','13',1085),(2880,'Aitolia-Akarnania','01',1085),(2881,'Argolis','11',1085),(2882,'Arkadia','12',1085),(2883,'Arta','31',1085),(2884,'Attiki','A1',1085),(2885,'Chalkidiki','64',1085),(2886,'Chania','94',1085),(2887,'Chios','85',1085),(2888,'Dodekanisos','81',1085),(2889,'Drama','52',1085),(2890,'Evros','71',1085),(2891,'Evrytania','05',1085),(2892,'Evvoia','04',1085),(2893,'Florina','63',1085),(2894,'Fokis','07',1085),(2895,'Fthiotis','06',1085),(2896,'Grevena','51',1085),(2897,'Ileia','14',1085),(2898,'Imathia','53',1085),(2899,'Ioannina','33',1085),(2900,'Irakleion','91',1085),(2901,'Karditsa','41',1085),(2902,'Kastoria','56',1085),(2903,'Kavalla','55',1085),(2904,'Kefallinia','23',1085),(2905,'Kerkyra','22',1085),(2906,'Kilkis','57',1085),(2907,'Korinthia','15',1085),(2908,'Kozani','58',1085),(2909,'Kyklades','82',1085),(2910,'Lakonia','16',1085),(2911,'Larisa','42',1085),(2912,'Lasithion','92',1085),(2913,'Lefkas','24',1085),(2914,'Lesvos','83',1085),(2915,'Magnisia','43',1085),(2916,'Messinia','17',1085),(2917,'Pella','59',1085),(2918,'Preveza','34',1085),(2919,'Rethymnon','93',1085),(2920,'Rodopi','73',1085),(2921,'Samos','84',1085),(2922,'Serrai','62',1085),(2923,'Thesprotia','32',1085),(2924,'Thessaloniki','54',1085),(2925,'Trikala','44',1085),(2926,'Voiotia','03',1085),(2927,'Xanthi','72',1085),(2928,'Zakynthos','21',1085),(2929,'Agio Oros','69',1085),(2930,'Alta Verapaz','AV',1090),(2931,'Baja Verapaz','BV',1090),(2932,'Chimaltenango','CM',1090),(2933,'Chiquimula','CQ',1090),(2934,'El Progreso','PR',1090),(2935,'Escuintla','ES',1090),(2936,'Guatemala','GU',1090),(2937,'Huehuetenango','HU',1090),(2938,'Izabal','IZ',1090),(2939,'Jalapa','JA',1090),(2940,'Jutiapa','JU',1090),(2941,'Peten','PE',1090),(2942,'Quetzaltenango','QZ',1090),(2943,'Quiche','QC',1090),(2944,'Retalhuleu','RE',1090),(2945,'Sacatepequez','SA',1090),(2946,'San Marcos','SM',1090),(2947,'Santa Rosa','SR',1090),(2948,'Sololá','SO',1090),(2949,'Suchitepequez','SU',1090),(2950,'Totonicapan','TO',1090),(2951,'Zacapa','ZA',1090),(2952,'Bissau','BS',1092),(2953,'Bafata','BA',1092),(2954,'Biombo','BM',1092),(2955,'Bolama','BL',1092),(2956,'Cacheu','CA',1092),(2957,'Gabu','GA',1092),(2958,'Oio','OI',1092),(2959,'Quloara','QU',1092),(2960,'Tombali S','TO',1092),(2961,'Barima-Waini','BA',1093),(2962,'Cuyuni-Mazaruni','CU',1093),(2963,'Demerara-Mahaica','DE',1093),(2964,'East Berbice-Corentyne','EB',1093),(2965,'Essequibo Islands-West Demerara','ES',1093),(2966,'Mahaica-Berbice','MA',1093),(2967,'Pomeroon-Supenaam','PM',1093),(2968,'Potaro-Siparuni','PT',1093),(2969,'Upper Demerara-Berbice','UD',1093),(2970,'Upper Takutu-Upper Essequibo','UT',1093),(2971,'Atlantida','AT',1097),(2972,'Colon','CL',1097),(2973,'Comayagua','CM',1097),(2974,'Copan','CP',1097),(2975,'Cortes','CR',1097),(2976,'Choluteca','CH',1097),(2977,'El Paraiso','EP',1097),(2978,'Francisco Morazan','FM',1097),(2979,'Gracias a Dios','GD',1097),(2980,'Intibuca','IN',1097),(2981,'Islas de la Bahia','IB',1097),(2982,'Lempira','LE',1097),(2983,'Ocotepeque','OC',1097),(2984,'Olancho','OL',1097),(2985,'Santa Barbara','SB',1097),(2986,'Valle','VA',1097),(2987,'Yoro','YO',1097),(2988,'Bjelovarsko-bilogorska zupanija','07',1055),(2989,'Brodsko-posavska zupanija','12',1055),(2990,'Dubrovacko-neretvanska zupanija','19',1055),(2991,'Istarska zupanija','18',1055),(2992,'Karlovacka zupanija','04',1055),(2993,'Koprivnickco-krizevacka zupanija','06',1055),(2994,'Krapinako-zagorska zupanija','02',1055),(2995,'Licko-senjska zupanija','09',1055),(2996,'Medimurska zupanija','20',1055),(2997,'Osjecko-baranjska zupanija','14',1055),(2998,'Pozesko-slavonska zupanija','11',1055),(2999,'Primorsko-goranska zupanija','08',1055),(3000,'Sisacko-moelavacka Iupanija','03',1055),(3001,'Splitako-dalmatinska zupanija','17',1055),(3002,'Sibenako-kninska zupanija','15',1055),(3003,'Varaidinska zupanija','05',1055),(3004,'VirovitiEko-podravska zupanija','10',1055),(3005,'VuRovarako-srijemska zupanija','16',1055),(3006,'Zadaraka','13',1055),(3007,'Zagrebacka zupanija','01',1055),(3008,'Grande-Anse','GA',1094),(3009,'Nord-Est','NE',1094),(3010,'Nord-Ouest','NO',1094),(3011,'Ouest','OU',1094),(3012,'Sud','SD',1094),(3013,'Sud-Est','SE',1094),(3014,'Budapest','BU',1099),(3015,'Bács-Kiskun','BK',1099),(3016,'Baranya','BA',1099),(3017,'Békés','BE',1099),(3018,'Borsod-Abaúj-Zemplén','BZ',1099),(3019,'Csongrád','CS',1099),(3020,'Fejér','FE',1099),(3021,'Győr-Moson-Sopron','GS',1099),(3022,'Hajdu-Bihar','HB',1099),(3023,'Heves','HE',1099),(3024,'Jász-Nagykun-Szolnok','JN',1099),(3025,'Komárom-Esztergom','KE',1099),(3026,'Nográd','NO',1099),(3027,'Pest','PE',1099),(3028,'Somogy','SO',1099),(3029,'Szabolcs-Szatmár-Bereg','SZ',1099),(3030,'Tolna','TO',1099),(3031,'Vas','VA',1099),(3032,'Veszprém','VE',1099),(3033,'Zala','ZA',1099),(3034,'Békéscsaba','BC',1099),(3035,'Debrecen','DE',1099),(3036,'Dunaújváros','DU',1099),(3037,'Eger','EG',1099),(3038,'Győr','GY',1099),(3039,'Hódmezővásárhely','HV',1099),(3040,'Kaposvár','KV',1099),(3041,'Kecskemét','KM',1099),(3042,'Miskolc','MI',1099),(3043,'Nagykanizsa','NK',1099),(3044,'Nyiregyháza','NY',1099),(3045,'Pécs','PS',1099),(3046,'Salgótarján','ST',1099),(3047,'Sopron','SN',1099),(3048,'Szeged','SD',1099),(3049,'Székesfehérvár','SF',1099),(3050,'Szekszárd','SS',1099),(3051,'Szolnok','SK',1099),(3052,'Szombathely','SH',1099),(3053,'Tatabánya','TB',1099),(3054,'Zalaegerszeg','ZE',1099),(3055,'Bali','BA',1102),(3056,'Kepulauan Bangka Belitung','BB',1102),(3057,'Banten','BT',1102),(3058,'Bengkulu','BE',1102),(3059,'Gorontalo','GO',1102),(3060,'Papua Barat','PB',1102),(3061,'Jambi','JA',1102),(3062,'Jawa Barat','JB',1102),(3063,'Jawa Tengah','JT',1102),(3064,'Jawa Timur','JI',1102),(3065,'Kalimantan Barat','KB',1102),(3066,'Kalimantan Timur','KI',1102),(3067,'Kalimantan Selatan','KS',1102),(3068,'Kepulauan Riau','KR',1102),(3069,'Lampung','LA',1102),(3070,'Maluku','MA',1102),(3071,'Maluku Utara','MU',1102),(3072,'Nusa Tenggara Barat','NB',1102),(3073,'Nusa Tenggara Timur','NT',1102),(3074,'Papua','PA',1102),(3075,'Riau','RI',1102),(3076,'Sulawesi Selatan','SN',1102),(3077,'Sulawesi Tengah','ST',1102),(3078,'Sulawesi Tenggara','SG',1102),(3079,'Sulawesi Utara','SA',1102),(3080,'Sumatra Barat','SB',1102),(3081,'Sumatra Selatan','SS',1102),(3082,'Sumatera Utara','SU',1102),(3083,'DKI Jakarta','JK',1102),(3084,'Aceh','AC',1102),(3085,'DI Yogyakarta','YO',1102),(3086,'Cork','C',1105),(3087,'Clare','CE',1105),(3088,'Cavan','CN',1105),(3089,'Carlow','CW',1105),(3090,'Dublin','D',1105),(3091,'Donegal','DL',1105),(3092,'Galway','G',1105),(3093,'Kildare','KE',1105),(3094,'Kilkenny','KK',1105),(3095,'Kerry','KY',1105),(3096,'Longford','LD',1105),(3097,'Louth','LH',1105),(3098,'Limerick','LK',1105),(3099,'Leitrim','LM',1105),(3100,'Laois','LS',1105),(3101,'Meath','MH',1105),(3102,'Monaghan','MN',1105),(3103,'Mayo','MO',1105),(3104,'Offaly','OY',1105),(3105,'Roscommon','RN',1105),(3106,'Sligo','SO',1105),(3107,'Tipperary','TA',1105),(3108,'Waterford','WD',1105),(3109,'Westmeath','WH',1105),(3110,'Wicklow','WW',1105),(3111,'Wexford','WX',1105),(3112,'HaDarom','D',1106),(3113,'HaMerkaz','M',1106),(3114,'HaZafon','Z',1106),(3115,'Haifa','HA',1106),(3116,'Tel-Aviv','TA',1106),(3117,'Jerusalem','JM',1106),(3118,'Al Anbar','AN',1104),(3119,'Al Ba,rah','BA',1104),(3120,'Al Muthanna','MU',1104),(3121,'Al Qadisiyah','QA',1104),(3122,'An Najef','NA',1104),(3123,'Arbil','AR',1104),(3124,'As Sulaymaniyah','SW',1104),(3125,'At Ta\'mim','TS',1104),(3126,'Babil','BB',1104),(3127,'Baghdad','BG',1104),(3128,'Dahuk','DA',1104),(3129,'Dhi Qar','DQ',1104),(3130,'Diyala','DI',1104),(3131,'Karbala\'','KA',1104),(3132,'Maysan','MA',1104),(3133,'Ninawa','NI',1104),(3134,'Salah ad Din','SD',1104),(3135,'Wasit','WA',1104),(3136,'Ardabil','03',1103),(3137,'Azarbayjan-e Gharbi','02',1103),(3138,'Azarbayjan-e Sharqi','01',1103),(3139,'Bushehr','06',1103),(3140,'Chahar Mahall va Bakhtiari','08',1103),(3141,'Esfahan','04',1103),(3142,'Fars','14',1103),(3143,'Gilan','19',1103),(3144,'Golestan','27',1103),(3145,'Hamadan','24',1103),(3146,'Hormozgan','23',1103),(3147,'Iiam','05',1103),(3148,'Kerman','15',1103),(3149,'Kermanshah','17',1103),(3150,'Khorasan','09',1103),(3151,'Khuzestan','10',1103),(3152,'Kohjiluyeh va Buyer Ahmad','18',1103),(3153,'Kordestan','16',1103),(3154,'Lorestan','20',1103),(3155,'Markazi','22',1103),(3156,'Mazandaran','21',1103),(3157,'Qazvin','28',1103),(3158,'Qom','26',1103),(3159,'Semnan','12',1103),(3160,'Sistan va Baluchestan','13',1103),(3161,'Tehran','07',1103),(3162,'Yazd','25',1103),(3163,'Zanjan','11',1103),(3164,'Austurland','7',1100),(3165,'Hofuoborgarsvaeoi utan Reykjavikur','1',1100),(3166,'Norourland eystra','6',1100),(3167,'Norourland vestra','5',1100),(3168,'Reykjavik','0',1100),(3169,'Suourland','8',1100),(3170,'Suournes','2',1100),(3171,'Vestfirolr','4',1100),(3172,'Vesturland','3',1100),(3173,'Agrigento','AG',1107),(3174,'Alessandria','AL',1107),(3175,'Ancona','AN',1107),(3176,'Aosta','AO',1107),(3177,'Arezzo','AR',1107),(3178,'Ascoli Piceno','AP',1107),(3179,'Asti','AT',1107),(3180,'Avellino','AV',1107),(3181,'Bari','BA',1107),(3182,'Belluno','BL',1107),(3183,'Benevento','BN',1107),(3184,'Bergamo','BG',1107),(3185,'Biella','BI',1107),(3186,'Bologna','BO',1107),(3187,'Bolzano','BZ',1107),(3188,'Brescia','BS',1107),(3189,'Brindisi','BR',1107),(3190,'Cagliari','CA',1107),(3191,'Caltanissetta','CL',1107),(3192,'Campobasso','CB',1107),(3193,'Caserta','CE',1107),(3194,'Catania','CT',1107),(3195,'Catanzaro','CZ',1107),(3196,'Chieti','CH',1107),(3197,'Como','CO',1107),(3198,'Cosenza','CS',1107),(3199,'Cremona','CR',1107),(3200,'Crotone','KR',1107),(3201,'Cuneo','CN',1107),(3202,'Enna','EN',1107),(3203,'Ferrara','FE',1107),(3204,'Firenze','FI',1107),(3205,'Foggia','FG',1107),(3206,'Forlì-Cesena','FC',1107),(3207,'Frosinone','FR',1107),(3208,'Genova','GE',1107),(3209,'Gorizia','GO',1107),(3210,'Grosseto','GR',1107),(3211,'Imperia','IM',1107),(3212,'Isernia','IS',1107),(3213,'L\'Aquila','AQ',1107),(3214,'La Spezia','SP',1107),(3215,'Latina','LT',1107),(3216,'Lecce','LE',1107),(3217,'Lecco','LC',1107),(3218,'Livorno','LI',1107),(3219,'Lodi','LO',1107),(3220,'Lucca','LU',1107),(3221,'Macerata','MC',1107),(3222,'Mantova','MN',1107),(3223,'Massa-Carrara','MS',1107),(3224,'Matera','MT',1107),(3225,'Messina','ME',1107),(3226,'Milano','MI',1107),(3227,'Modena','MO',1107),(3228,'Napoli','NA',1107),(3229,'Novara','NO',1107),(3230,'Nuoro','NU',1107),(3231,'Oristano','OR',1107),(3232,'Padova','PD',1107),(3233,'Palermo','PA',1107),(3234,'Parma','PR',1107),(3235,'Pavia','PV',1107),(3236,'Perugia','PG',1107),(3237,'Pesaro e Urbino','PU',1107),(3238,'Pescara','PE',1107),(3239,'Piacenza','PC',1107),(3240,'Pisa','PI',1107),(3241,'Pistoia','PT',1107),(3242,'Pordenone','PN',1107),(3243,'Potenza','PZ',1107),(3244,'Prato','PO',1107),(3245,'Ragusa','RG',1107),(3246,'Ravenna','RA',1107),(3247,'Reggio Calabria','RC',1107),(3248,'Reggio Emilia','RE',1107),(3249,'Rieti','RI',1107),(3250,'Rimini','RN',1107),(3251,'Roma','RM',1107),(3252,'Rovigo','RO',1107),(3253,'Salerno','SA',1107),(3254,'Sassari','SS',1107),(3255,'Savona','SV',1107),(3256,'Siena','SI',1107),(3257,'Siracusa','SR',1107),(3258,'Sondrio','SO',1107),(3259,'Taranto','TA',1107),(3260,'Teramo','TE',1107),(3261,'Terni','TR',1107),(3262,'Torino','TO',1107),(3263,'Trapani','TP',1107),(3264,'Trento','TN',1107),(3265,'Treviso','TV',1107),(3266,'Trieste','TS',1107),(3267,'Udine','UD',1107),(3268,'Varese','VA',1107),(3269,'Venezia','VE',1107),(3270,'Verbano-Cusio-Ossola','VB',1107),(3271,'Vercelli','VC',1107),(3272,'Verona','VR',1107),(3273,'Vibo Valentia','VV',1107),(3274,'Vicenza','VI',1107),(3275,'Viterbo','VT',1107),(3276,'Aichi','23',1109),(3277,'Akita','05',1109),(3278,'Aomori','02',1109),(3279,'Chiba','12',1109),(3280,'Ehime','38',1109),(3281,'Fukui','18',1109),(3282,'Fukuoka','40',1109),(3283,'Fukusima','07',1109),(3284,'Gifu','21',1109),(3285,'Gunma','10',1109),(3286,'Hiroshima','34',1109),(3287,'Hokkaido','01',1109),(3288,'Hyogo','28',1109),(3289,'Ibaraki','08',1109),(3290,'Ishikawa','17',1109),(3291,'Iwate','03',1109),(3292,'Kagawa','37',1109),(3293,'Kagoshima','46',1109),(3294,'Kanagawa','14',1109),(3295,'Kochi','39',1109),(3296,'Kumamoto','43',1109),(3297,'Kyoto','26',1109),(3298,'Mie','24',1109),(3299,'Miyagi','04',1109),(3300,'Miyazaki','45',1109),(3301,'Nagano','20',1109),(3302,'Nagasaki','42',1109),(3303,'Nara','29',1109),(3304,'Niigata','15',1109),(3305,'Oita','44',1109),(3306,'Okayama','33',1109),(3307,'Okinawa','47',1109),(3308,'Osaka','27',1109),(3309,'Saga','41',1109),(3310,'Saitama','11',1109),(3311,'Shiga','25',1109),(3312,'Shimane','32',1109),(3313,'Shizuoka','22',1109),(3314,'Tochigi','09',1109),(3315,'Tokushima','36',1109),(3316,'Tokyo','13',1109),(3317,'Tottori','31',1109),(3318,'Toyama','16',1109),(3319,'Wakayama','30',1109),(3320,'Yamagata','06',1109),(3321,'Yamaguchi','35',1109),(3322,'Yamanashi','19',1109),(3323,'Clarendon','CN',1108),(3324,'Hanover','HR',1108),(3325,'Kingston','KN',1108),(3326,'Portland','PD',1108),(3327,'Saint Andrew','AW',1108),(3328,'Saint Ann','AN',1108),(3329,'Saint Catherine','CE',1108),(3330,'Saint Elizabeth','EH',1108),(3331,'Saint James','JS',1108),(3332,'Saint Mary','MY',1108),(3333,'Saint Thomas','TS',1108),(3334,'Trelawny','TY',1108),(3335,'Westmoreland','WD',1108),(3336,'Ajln','AJ',1110),(3337,'Al \'Aqaba','AQ',1110),(3338,'Al Balqa\'','BA',1110),(3339,'Al Karak','KA',1110),(3340,'Al Mafraq','MA',1110),(3341,'Amman','AM',1110),(3342,'At Tafilah','AT',1110),(3343,'Az Zarga','AZ',1110),(3344,'Irbid','JR',1110),(3345,'Jarash','JA',1110),(3346,'Ma\'an','MN',1110),(3347,'Madaba','MD',1110),(3353,'Bishkek','GB',1117),(3354,'Batken','B',1117),(3355,'Chu','C',1117),(3356,'Jalal-Abad','J',1117),(3357,'Naryn','N',1117),(3358,'Osh','O',1117),(3359,'Talas','T',1117),(3360,'Ysyk-Kol','Y',1117),(3361,'Krong Kaeb','23',1037),(3362,'Krong Pailin','24',1037),(3363,'Xrong Preah Sihanouk','18',1037),(3364,'Phnom Penh','12',1037),(3365,'Baat Dambang','2',1037),(3366,'Banteay Mean Chey','1',1037),(3367,'Rampong Chaam','3',1037),(3368,'Kampong Chhnang','4',1037),(3369,'Kampong Spueu','5',1037),(3370,'Kampong Thum','6',1037),(3371,'Kampot','7',1037),(3372,'Kandaal','8',1037),(3373,'Kach Kong','9',1037),(3374,'Krachoh','10',1037),(3375,'Mondol Kiri','11',1037),(3376,'Otdar Mean Chey','22',1037),(3377,'Pousaat','15',1037),(3378,'Preah Vihear','13',1037),(3379,'Prey Veaeng','14',1037),(3380,'Rotanak Kiri','16',1037),(3381,'Siem Reab','17',1037),(3382,'Stueng Traeng','19',1037),(3383,'Svaay Rieng','20',1037),(3384,'Taakaev','21',1037),(3385,'Gilbert Islands','G',1113),(3386,'Line Islands','L',1113),(3387,'Phoenix Islands','P',1113),(3388,'Anjouan Ndzouani','A',1049),(3389,'Grande Comore Ngazidja','G',1049),(3390,'Moheli Moili','M',1049),(3391,'Kaesong-si','KAE',1114),(3392,'Nampo-si','NAM',1114),(3393,'Pyongyang-ai','PYO',1114),(3394,'Chagang-do','CHA',1114),(3395,'Hamgyongbuk-do','HAB',1114),(3396,'Hamgyongnam-do','HAN',1114),(3397,'Hwanghaebuk-do','HWB',1114),(3398,'Hwanghaenam-do','HWN',1114),(3399,'Kangwon-do','KAN',1114),(3400,'Pyonganbuk-do','PYB',1114),(3401,'Pyongannam-do','PYN',1114),(3402,'Yanggang-do','YAN',1114),(3403,'Najin Sonbong-si','NAJ',1114),(3404,'Seoul Teugbyeolsi','11',1115),(3405,'Busan Gwang\'yeogsi','26',1115),(3406,'Daegu Gwang\'yeogsi','27',1115),(3407,'Daejeon Gwang\'yeogsi','30',1115),(3408,'Gwangju Gwang\'yeogsi','29',1115),(3409,'Incheon Gwang\'yeogsi','28',1115),(3410,'Ulsan Gwang\'yeogsi','31',1115),(3411,'Chungcheongbugdo','43',1115),(3412,'Chungcheongnamdo','44',1115),(3413,'Gang\'weondo','42',1115),(3414,'Gyeonggido','41',1115),(3415,'Gyeongsangbugdo','47',1115),(3416,'Gyeongsangnamdo','48',1115),(3417,'Jejudo','49',1115),(3418,'Jeonrabugdo','45',1115),(3419,'Jeonranamdo','46',1115),(3420,'Al Ahmadi','AH',1116),(3421,'Al Farwanlyah','FA',1116),(3422,'Al Jahrah','JA',1116),(3423,'Al Kuwayt','KU',1116),(3424,'Hawalli','HA',1116),(3425,'Almaty','ALA',1111),(3426,'Astana','AST',1111),(3427,'Almaty oblysy','ALM',1111),(3428,'Aqmola oblysy','AKM',1111),(3429,'Aqtobe oblysy','AKT',1111),(3430,'Atyrau oblyfiy','ATY',1111),(3431,'Batys Quzaqstan oblysy','ZAP',1111),(3432,'Mangghystau oblysy','MAN',1111),(3433,'Ongtustik Quzaqstan oblysy','YUZ',1111),(3434,'Pavlodar oblysy','PAV',1111),(3435,'Qaraghandy oblysy','KAR',1111),(3436,'Qostanay oblysy','KUS',1111),(3437,'Qyzylorda oblysy','KZY',1111),(3438,'Shyghys Quzaqstan oblysy','VOS',1111),(3439,'Soltustik Quzaqstan oblysy','SEV',1111),(3440,'Zhambyl oblysy Zhambylskaya oblast\'','ZHA',1111),(3441,'Vientiane','VT',1118),(3442,'Attapu','AT',1118),(3443,'Bokeo','BK',1118),(3444,'Bolikhamxai','BL',1118),(3445,'Champasak','CH',1118),(3446,'Houaphan','HO',1118),(3447,'Khammouan','KH',1118),(3448,'Louang Namtha','LM',1118),(3449,'Louangphabang','LP',1118),(3450,'Oudomxai','OU',1118),(3451,'Phongsali','PH',1118),(3452,'Salavan','SL',1118),(3453,'Savannakhet','SV',1118),(3454,'Xaignabouli','XA',1118),(3455,'Xiasomboun','XN',1118),(3456,'Xekong','XE',1118),(3457,'Xiangkhoang','XI',1118),(3458,'Beirut','BA',1120),(3459,'Beqaa','BI',1120),(3460,'Mount Lebanon','JL',1120),(3461,'North Lebanon','AS',1120),(3462,'South Lebanon','JA',1120),(3463,'Nabatieh','NA',1120),(3464,'Ampara','52',1199),(3465,'Anuradhapura','71',1199),(3466,'Badulla','81',1199),(3467,'Batticaloa','51',1199),(3468,'Colombo','11',1199),(3469,'Galle','31',1199),(3470,'Gampaha','12',1199),(3471,'Hambantota','33',1199),(3472,'Jaffna','41',1199),(3473,'Kalutara','13',1199),(3474,'Kandy','21',1199),(3475,'Kegalla','92',1199),(3476,'Kilinochchi','42',1199),(3477,'Kurunegala','61',1199),(3478,'Mannar','43',1199),(3479,'Matale','22',1199),(3480,'Matara','32',1199),(3481,'Monaragala','82',1199),(3482,'Mullaittivu','45',1199),(3483,'Nuwara Eliya','23',1199),(3484,'Polonnaruwa','72',1199),(3485,'Puttalum','62',1199),(3486,'Ratnapura','91',1199),(3487,'Trincomalee','53',1199),(3488,'VavunLya','44',1199),(3489,'Bomi','BM',1122),(3490,'Bong','BG',1122),(3491,'Grand Basaa','GB',1122),(3492,'Grand Cape Mount','CM',1122),(3493,'Grand Gedeh','GG',1122),(3494,'Grand Kru','GK',1122),(3495,'Lofa','LO',1122),(3496,'Margibi','MG',1122),(3497,'Maryland','MY',1122),(3498,'Montserrado','MO',1122),(3499,'Nimba','NI',1122),(3500,'Rivercess','RI',1122),(3501,'Sinoe','SI',1122),(3502,'Berea','D',1121),(3503,'Butha-Buthe','B',1121),(3504,'Leribe','C',1121),(3505,'Mafeteng','E',1121),(3506,'Maseru','A',1121),(3507,'Mohale\'s Hoek','F',1121),(3508,'Mokhotlong','J',1121),(3509,'Qacha\'s Nek','H',1121),(3510,'Quthing','G',1121),(3511,'Thaba-Tseka','K',1121),(3512,'Alytaus Apskritis','AL',1125),(3513,'Kauno Apskritis','KU',1125),(3514,'Klaipėdos Apskritis','KL',1125),(3515,'Marijampolės Apskritis','MR',1125),(3516,'Panevėžio Apskritis','PN',1125),(3517,'Šiaulių Apskritis','SA',1125),(3518,'Tauragės Apskritis','TA',1125),(3519,'Telšių Apskritis','TE',1125),(3520,'Utenos Apskritis','UT',1125),(3521,'Vilniaus Apskritis','VL',1125),(3522,'Diekirch','D',1126),(3523,'GreveNmacher','G',1126),(3550,'Daugavpils','DGV',1119),(3551,'Jelgava','JEL',1119),(3552,'Jūrmala','JUR',1119),(3553,'Liepāja','LPX',1119),(3554,'Rēzekne','REZ',1119),(3555,'Rīga','RIX',1119),(3556,'Ventspils','VEN',1119),(3557,'Ajdābiyā','AJ',1123),(3558,'Al Buţnān','BU',1123),(3559,'Al Hizām al Akhdar','HZ',1123),(3560,'Al Jabal al Akhdar','JA',1123),(3561,'Al Jifārah','JI',1123),(3562,'Al Jufrah','JU',1123),(3563,'Al Kufrah','KF',1123),(3564,'Al Marj','MJ',1123),(3565,'Al Marqab','MB',1123),(3566,'Al Qaţrūn','QT',1123),(3567,'Al Qubbah','QB',1123),(3568,'Al Wāhah','WA',1123),(3569,'An Nuqaţ al Khams','NQ',1123),(3570,'Ash Shāţi\'','SH',1123),(3571,'Az Zāwiyah','ZA',1123),(3572,'Banghāzī','BA',1123),(3573,'Banī Walīd','BW',1123),(3574,'Darnah','DR',1123),(3575,'Ghadāmis','GD',1123),(3576,'Gharyān','GR',1123),(3577,'Ghāt','GT',1123),(3578,'Jaghbūb','JB',1123),(3579,'Mişrātah','MI',1123),(3580,'Mizdah','MZ',1123),(3581,'Murzuq','MQ',1123),(3582,'Nālūt','NL',1123),(3583,'Sabhā','SB',1123),(3584,'Şabrātah Şurmān','SS',1123),(3585,'Surt','SR',1123),(3586,'Tājūrā\' wa an Nawāhī al Arbāh','TN',1123),(3587,'Ţarābulus','TB',1123),(3588,'Tarhūnah-Masallātah','TM',1123),(3589,'Wādī al hayāt','WD',1123),(3590,'Yafran-Jādū','YJ',1123),(3591,'Agadir','AGD',1146),(3592,'Aït Baha','BAH',1146),(3593,'Aït Melloul','MEL',1146),(3594,'Al Haouz','HAO',1146),(3595,'Al Hoceïma','HOC',1146),(3596,'Assa-Zag','ASZ',1146),(3597,'Azilal','AZI',1146),(3598,'Beni Mellal','BEM',1146),(3599,'Ben Sllmane','BES',1146),(3600,'Berkane','BER',1146),(3601,'Boujdour','BOD',1146),(3602,'Boulemane','BOM',1146),(3603,'Casablanca [Dar el Beïda]','CAS',1146),(3604,'Chefchaouene','CHE',1146),(3605,'Chichaoua','CHI',1146),(3606,'El Hajeb','HAJ',1146),(3607,'El Jadida','JDI',1146),(3608,'Errachidia','ERR',1146),(3609,'Essaouira','ESI',1146),(3610,'Es Smara','ESM',1146),(3611,'Fès','FES',1146),(3612,'Figuig','FIG',1146),(3613,'Guelmim','GUE',1146),(3614,'Ifrane','IFR',1146),(3615,'Jerada','JRA',1146),(3616,'Kelaat Sraghna','KES',1146),(3617,'Kénitra','KEN',1146),(3618,'Khemisaet','KHE',1146),(3619,'Khenifra','KHN',1146),(3620,'Khouribga','KHO',1146),(3621,'Laâyoune (EH)','LAA',1146),(3622,'Larache','LAP',1146),(3623,'Marrakech','MAR',1146),(3624,'Meknsès','MEK',1146),(3625,'Nador','NAD',1146),(3626,'Ouarzazate','OUA',1146),(3627,'Oued ed Dahab (EH)','OUD',1146),(3628,'Oujda','OUJ',1146),(3629,'Rabat-Salé','RBA',1146),(3630,'Safi','SAF',1146),(3631,'Sefrou','SEF',1146),(3632,'Settat','SET',1146),(3633,'Sidl Kacem','SIK',1146),(3634,'Tanger','TNG',1146),(3635,'Tan-Tan','TNT',1146),(3636,'Taounate','TAO',1146),(3637,'Taroudannt','TAR',1146),(3638,'Tata','TAT',1146),(3639,'Taza','TAZ',1146),(3640,'Tétouan','TET',1146),(3641,'Tiznit','TIZ',1146),(3642,'Gagauzia, Unitate Teritoriala Autonoma','GA',1142),(3643,'Chisinau','CU',1142),(3644,'Stinga Nistrului, unitatea teritoriala din','SN',1142),(3645,'Balti','BA',1142),(3646,'Cahul','CA',1142),(3647,'Edinet','ED',1142),(3648,'Lapusna','LA',1142),(3649,'Orhei','OR',1142),(3650,'Soroca','SO',1142),(3651,'Taraclia','TA',1142),(3652,'Tighina [Bender]','TI',1142),(3653,'Ungheni','UN',1142),(3654,'Antananarivo','T',1129),(3655,'Antsiranana','D',1129),(3656,'Fianarantsoa','F',1129),(3657,'Mahajanga','M',1129),(3658,'Toamasina','A',1129),(3659,'Toliara','U',1129),(3660,'Ailinglapalap','ALL',1135),(3661,'Ailuk','ALK',1135),(3662,'Arno','ARN',1135),(3663,'Aur','AUR',1135),(3664,'Ebon','EBO',1135),(3665,'Eniwetok','ENI',1135),(3666,'Jaluit','JAL',1135),(3667,'Kili','KIL',1135),(3668,'Kwajalein','KWA',1135),(3669,'Lae','LAE',1135),(3670,'Lib','LIB',1135),(3671,'Likiep','LIK',1135),(3672,'Majuro','MAJ',1135),(3673,'Maloelap','MAL',1135),(3674,'Mejit','MEJ',1135),(3675,'Mili','MIL',1135),(3676,'Namorik','NMK',1135),(3677,'Namu','NMU',1135),(3678,'Rongelap','RON',1135),(3679,'Ujae','UJA',1135),(3680,'Ujelang','UJL',1135),(3681,'Utirik','UTI',1135),(3682,'Wotho','WTN',1135),(3683,'Wotje','WTJ',1135),(3684,'Bamako','BK0',1133),(3685,'Gao','7',1133),(3686,'Kayes','1',1133),(3687,'Kidal','8',1133),(3688,'Xoulikoro','2',1133),(3689,'Mopti','5',1133),(3690,'S69ou','4',1133),(3691,'Sikasso','3',1133),(3692,'Tombouctou','6',1133),(3693,'Ayeyarwady','07',1035),(3694,'Bago','02',1035),(3695,'Magway','03',1035),(3696,'Mandalay','04',1035),(3697,'Sagaing','01',1035),(3698,'Tanintharyi','05',1035),(3699,'Yangon','06',1035),(3700,'Chin','14',1035),(3701,'Kachin','11',1035),(3702,'Kayah','12',1035),(3703,'Kayin','13',1035),(3704,'Mon','15',1035),(3705,'Rakhine','16',1035),(3706,'Shan','17',1035),(3707,'Ulaanbaatar','1',1144),(3708,'Arhangay','073',1144),(3709,'Bayanhongor','069',1144),(3710,'Bayan-Olgiy','071',1144),(3711,'Bulgan','067',1144),(3712,'Darhan uul','037',1144),(3713,'Dornod','061',1144),(3714,'Dornogov,','063',1144),(3715,'DundgovL','059',1144),(3716,'Dzavhan','057',1144),(3717,'Govi-Altay','065',1144),(3718,'Govi-Smber','064',1144),(3719,'Hentiy','039',1144),(3720,'Hovd','043',1144),(3721,'Hovsgol','041',1144),(3722,'Omnogovi','053',1144),(3723,'Orhon','035',1144),(3724,'Ovorhangay','055',1144),(3725,'Selenge','049',1144),(3726,'Shbaatar','051',1144),(3727,'Tov','047',1144),(3728,'Uvs','046',1144),(3729,'Nouakchott','NKC',1137),(3730,'Assaba','03',1137),(3731,'Brakna','05',1137),(3732,'Dakhlet Nouadhibou','08',1137),(3733,'Gorgol','04',1137),(3734,'Guidimaka','10',1137),(3735,'Hodh ech Chargui','01',1137),(3736,'Hodh el Charbi','02',1137),(3737,'Inchiri','12',1137),(3738,'Tagant','09',1137),(3739,'Tiris Zemmour','11',1137),(3740,'Trarza','06',1137),(3741,'Beau Bassin-Rose Hill','BR',1138),(3742,'Curepipe','CU',1138),(3743,'Port Louis','PU',1138),(3744,'Quatre Bornes','QB',1138),(3745,'Vacosa-Phoenix','VP',1138),(3746,'Black River','BL',1138),(3747,'Flacq','FL',1138),(3748,'Grand Port','GP',1138),(3749,'Moka','MO',1138),(3750,'Pamplemousses','PA',1138),(3751,'Plaines Wilhems','PW',1138),(3752,'Riviere du Rempart','RP',1138),(3753,'Savanne','SA',1138),(3754,'Agalega Islands','AG',1138),(3755,'Cargados Carajos Shoals','CC',1138),(3756,'Rodrigues Island','RO',1138),(3757,'Male','MLE',1132),(3758,'Alif','02',1132),(3759,'Baa','20',1132),(3760,'Dhaalu','17',1132),(3761,'Faafu','14',1132),(3762,'Gaaf Alif','27',1132),(3763,'Gaefu Dhaalu','28',1132),(3764,'Gnaviyani','29',1132),(3765,'Haa Alif','07',1132),(3766,'Haa Dhaalu','23',1132),(3767,'Kaafu','26',1132),(3768,'Laamu','05',1132),(3769,'Lhaviyani','03',1132),(3770,'Meemu','12',1132),(3771,'Noonu','25',1132),(3772,'Raa','13',1132),(3773,'Seenu','01',1132),(3774,'Shaviyani','24',1132),(3775,'Thaa','08',1132),(3776,'Vaavu','04',1132),(3777,'Balaka','BA',1130),(3778,'Blantyre','BL',1130),(3779,'Chikwawa','CK',1130),(3780,'Chiradzulu','CR',1130),(3781,'Chitipa','CT',1130),(3782,'Dedza','DE',1130),(3783,'Dowa','DO',1130),(3784,'Karonga','KR',1130),(3785,'Kasungu','KS',1130),(3786,'Likoma Island','LK',1130),(3787,'Lilongwe','LI',1130),(3788,'Machinga','MH',1130),(3789,'Mangochi','MG',1130),(3790,'Mchinji','MC',1130),(3791,'Mulanje','MU',1130),(3792,'Mwanza','MW',1130),(3793,'Mzimba','MZ',1130),(3794,'Nkhata Bay','NB',1130),(3795,'Nkhotakota','NK',1130),(3796,'Nsanje','NS',1130),(3797,'Ntcheu','NU',1130),(3798,'Ntchisi','NI',1130),(3799,'Phalomba','PH',1130),(3800,'Rumphi','RU',1130),(3801,'Salima','SA',1130),(3802,'Thyolo','TH',1130),(3803,'Zomba','ZO',1130),(3804,'Aguascalientes','AGU',1140),(3805,'Baja California','BCN',1140),(3806,'Baja California Sur','BCS',1140),(3807,'Campeche','CAM',1140),(3808,'Coahuila','COA',1140),(3809,'Colima','COL',1140),(3810,'Chiapas','CHP',1140),(3811,'Chihuahua','CHH',1140),(3812,'Durango','DUR',1140),(3813,'Guanajuato','GUA',1140),(3814,'Guerrero','GRO',1140),(3815,'Hidalgo','HID',1140),(3816,'Jalisco','JAL',1140),(3817,'Mexico','MEX',1140),(3818,'Michoacin','MIC',1140),(3819,'Morelos','MOR',1140),(3820,'Nayarit','NAY',1140),(3821,'Nuevo Leon','NLE',1140),(3822,'Oaxaca','OAX',1140),(3823,'Puebla','PUE',1140),(3824,'Queretaro','QUE',1140),(3825,'Quintana Roo','ROO',1140),(3826,'San Luis Potosi','SLP',1140),(3827,'Sinaloa','SIN',1140),(3828,'Sonora','SON',1140),(3829,'Tabasco','TAB',1140),(3830,'Tamaulipas','TAM',1140),(3831,'Tlaxcala','TLA',1140),(3832,'Veracruz','VER',1140),(3833,'Yucatan','YUC',1140),(3834,'Zacatecas','ZAC',1140),(3835,'Wilayah Persekutuan Kuala Lumpur','14',1131),(3836,'Wilayah Persekutuan Labuan','15',1131),(3837,'Wilayah Persekutuan Putrajaya','16',1131),(3838,'Johor','01',1131),(3839,'Kedah','02',1131),(3840,'Kelantan','03',1131),(3841,'Melaka','04',1131),(3842,'Negeri Sembilan','05',1131),(3843,'Pahang','06',1131),(3844,'Perak','08',1131),(3845,'Perlis','09',1131),(3846,'Pulau Pinang','07',1131),(3847,'Sabah','12',1131),(3848,'Sarawak','13',1131),(3849,'Selangor','10',1131),(3850,'Terengganu','11',1131),(3851,'Maputo','MPM',1147),(3852,'Cabo Delgado','P',1147),(3853,'Gaza','G',1147),(3854,'Inhambane','I',1147),(3855,'Manica','B',1147),(3856,'Numpula','N',1147),(3857,'Niaaea','A',1147),(3858,'Sofala','S',1147),(3859,'Tete','T',1147),(3860,'Zambezia','Q',1147),(3861,'Caprivi','CA',1148),(3862,'Erongo','ER',1148),(3863,'Hardap','HA',1148),(3864,'Karas','KA',1148),(3865,'Khomas','KH',1148),(3866,'Kunene','KU',1148),(3867,'Ohangwena','OW',1148),(3868,'Okavango','OK',1148),(3869,'Omaheke','OH',1148),(3870,'Omusati','OS',1148),(3871,'Oshana','ON',1148),(3872,'Oshikoto','OT',1148),(3873,'Otjozondjupa','OD',1148),(3874,'Niamey','8',1156),(3875,'Agadez','1',1156),(3876,'Diffa','2',1156),(3877,'Dosso','3',1156),(3878,'Maradi','4',1156),(3879,'Tahoua','S',1156),(3880,'Tillaberi','6',1156),(3881,'Zinder','7',1156),(3882,'Abuja Federal Capital Territory','FC',1157),(3883,'Abia','AB',1157),(3884,'Adamawa','AD',1157),(3885,'Akwa Ibom','AK',1157),(3886,'Anambra','AN',1157),(3887,'Bauchi','BA',1157),(3888,'Bayelsa','BY',1157),(3889,'Benue','BE',1157),(3890,'Borno','BO',1157),(3891,'Cross River','CR',1157),(3892,'Delta','DE',1157),(3893,'Ebonyi','EB',1157),(3894,'Edo','ED',1157),(3895,'Ekiti','EK',1157),(3896,'Enugu','EN',1157),(3897,'Gombe','GO',1157),(3898,'Imo','IM',1157),(3899,'Jigawa','JI',1157),(3900,'Kaduna','KD',1157),(3901,'Kano','KN',1157),(3902,'Katsina','KT',1157),(3903,'Kebbi','KE',1157),(3904,'Kogi','KO',1157),(3905,'Kwara','KW',1157),(3906,'Lagos','LA',1157),(3907,'Nassarawa','NA',1157),(3908,'Niger','NI',1157),(3909,'Ogun','OG',1157),(3910,'Ondo','ON',1157),(3911,'Osun','OS',1157),(3912,'Oyo','OY',1157),(3913,'Rivers','RI',1157),(3914,'Sokoto','SO',1157),(3915,'Taraba','TA',1157),(3916,'Yobe','YO',1157),(3917,'Zamfara','ZA',1157),(3918,'Boaco','BO',1155),(3919,'Carazo','CA',1155),(3920,'Chinandega','CI',1155),(3921,'Chontales','CO',1155),(3922,'Esteli','ES',1155),(3923,'Jinotega','JI',1155),(3924,'Leon','LE',1155),(3925,'Madriz','MD',1155),(3926,'Managua','MN',1155),(3927,'Masaya','MS',1155),(3928,'Matagalpa','MT',1155),(3929,'Nueva Segovia','NS',1155),(3930,'Rio San Juan','SJ',1155),(3931,'Rivas','RI',1155),(3932,'Atlantico Norte','AN',1155),(3933,'Atlantico Sur','AS',1155),(3934,'Drente','DR',1152),(3935,'Flevoland','FL',1152),(3936,'Friesland','FR',1152),(3937,'Gelderland','GL',1152),(3938,'Groningen','GR',1152),(3939,'Noord-Brabant','NB',1152),(3940,'Noord-Holland','NH',1152),(3941,'Overijssel','OV',1152),(3942,'Utrecht','UT',1152),(3943,'Zuid-Holland','ZH',1152),(3944,'Zeeland','ZL',1152),(3945,'Akershus','02',1161),(3946,'Aust-Agder','09',1161),(3947,'Buskerud','06',1161),(3948,'Finnmark','20',1161),(3949,'Hedmark','04',1161),(3950,'Hordaland','12',1161),(3951,'Møre og Romsdal','15',1161),(3952,'Nordland','18',1161),(3953,'Nord-Trøndelag','17',1161),(3954,'Oppland','05',1161),(3955,'Oslo','03',1161),(3956,'Rogaland','11',1161),(3957,'Sogn og Fjordane','14',1161),(3958,'Sør-Trøndelag','16',1161),(3959,'Telemark','06',1161),(3960,'Troms','19',1161),(3961,'Vest-Agder','10',1161),(3962,'Vestfold','07',1161),(3963,'Østfold','01',1161),(3964,'Jan Mayen','22',1161),(3965,'Svalbard','21',1161),(3966,'Auckland','AUK',1154),(3967,'Bay of Plenty','BOP',1154),(3968,'Canterbury','CAN',1154),(3969,'Gisborne','GIS',1154),(3970,'Hawkes Bay','HKB',1154),(3971,'Manawatu-Wanganui','MWT',1154),(3972,'Marlborough','MBH',1154),(3973,'Nelson','NSN',1154),(3974,'Northland','NTL',1154),(3975,'Otago','OTA',1154),(3976,'Southland','STL',1154),(3977,'Taranaki','TKI',1154),(3978,'Tasman','TAS',1154),(3979,'Waikato','WKO',1154),(3980,'Wellington','WGN',1154),(3981,'West Coast','WTC',1154),(3982,'Ad Dakhillyah','DA',1162),(3983,'Al Batinah','BA',1162),(3984,'Al Janblyah','JA',1162),(3985,'Al Wusta','WU',1162),(3986,'Ash Sharqlyah','SH',1162),(3987,'Az Zahirah','ZA',1162),(3988,'Masqat','MA',1162),(3989,'Musandam','MU',1162),(3990,'Bocas del Toro','1',1166),(3991,'Cocle','2',1166),(3992,'Chiriqui','4',1166),(3993,'Darien','5',1166),(3994,'Herrera','6',1166),(3995,'Loa Santoa','7',1166),(3996,'Panama','8',1166),(3997,'Veraguas','9',1166),(3998,'Comarca de San Blas','Q',1166),(3999,'El Callao','CAL',1169),(4000,'Ancash','ANC',1169),(4001,'Apurimac','APU',1169),(4002,'Arequipa','ARE',1169),(4003,'Ayacucho','AYA',1169),(4004,'Cajamarca','CAJ',1169),(4005,'Cuzco','CUS',1169),(4006,'Huancavelica','HUV',1169),(4007,'Huanuco','HUC',1169),(4008,'Ica','ICA',1169),(4009,'Junin','JUN',1169),(4010,'La Libertad','LAL',1169),(4011,'Lambayeque','LAM',1169),(4012,'Lima','LIM',1169),(4013,'Loreto','LOR',1169),(4014,'Madre de Dios','MDD',1169),(4015,'Moquegua','MOQ',1169),(4016,'Pasco','PAS',1169),(4017,'Piura','PIU',1169),(4018,'Puno','PUN',1169),(4019,'San Martin','SAM',1169),(4020,'Tacna','TAC',1169),(4021,'Tumbes','TUM',1169),(4022,'Ucayali','UCA',1169),(4023,'National Capital District (Port Moresby)','NCD',1167),(4024,'Chimbu','CPK',1167),(4025,'Eastern Highlands','EHG',1167),(4026,'East New Britain','EBR',1167),(4027,'East Sepik','ESW',1167),(4028,'Enga','EPW',1167),(4029,'Gulf','GPK',1167),(4030,'Madang','MPM',1167),(4031,'Manus','MRL',1167),(4032,'Milne Bay','MBA',1167),(4033,'Morobe','MPL',1167),(4034,'New Ireland','NIK',1167),(4035,'North Solomons','NSA',1167),(4036,'Santaun','SAN',1167),(4037,'Southern Highlands','SHM',1167),(4038,'Western Highlands','WHM',1167),(4039,'West New Britain','WBK',1167),(4040,'Abra','ABR',1170),(4041,'Agusan del Norte','AGN',1170),(4042,'Agusan del Sur','AGS',1170),(4043,'Aklan','AKL',1170),(4044,'Albay','ALB',1170),(4045,'Antique','ANT',1170),(4046,'Apayao','APA',1170),(4047,'Aurora','AUR',1170),(4048,'Basilan','BAS',1170),(4049,'Bataan','BAN',1170),(4050,'Batanes','BTN',1170),(4051,'Batangas','BTG',1170),(4052,'Benguet','BEN',1170),(4053,'Biliran','BIL',1170),(4054,'Bohol','BOH',1170),(4055,'Bukidnon','BUK',1170),(4056,'Bulacan','BUL',1170),(4057,'Cagayan','CAG',1170),(4058,'Camarines Norte','CAN',1170),(4059,'Camarines Sur','CAS',1170),(4060,'Camiguin','CAM',1170),(4061,'Capiz','CAP',1170),(4062,'Catanduanes','CAT',1170),(4063,'Cavite','CAV',1170),(4064,'Cebu','CEB',1170),(4065,'Compostela Valley','COM',1170),(4066,'Davao','DAV',1170),(4067,'Davao del Sur','DAS',1170),(4068,'Davao Oriental','DAO',1170),(4069,'Eastern Samar','EAS',1170),(4070,'Guimaras','GUI',1170),(4071,'Ifugao','IFU',1170),(4072,'Ilocos Norte','ILN',1170),(4073,'Ilocos Sur','ILS',1170),(4074,'Iloilo','ILI',1170),(4075,'Isabela','ISA',1170),(4076,'Kalinga-Apayso','KAL',1170),(4077,'Laguna','LAG',1170),(4078,'Lanao del Norte','LAN',1170),(4079,'Lanao del Sur','LAS',1170),(4080,'La Union','LUN',1170),(4081,'Leyte','LEY',1170),(4082,'Maguindanao','MAG',1170),(4083,'Marinduque','MAD',1170),(4084,'Masbate','MAS',1170),(4085,'Mindoro Occidental','MDC',1170),(4086,'Mindoro Oriental','MDR',1170),(4087,'Misamis Occidental','MSC',1170),(4088,'Misamis Oriental','MSR',1170),(4089,'Mountain Province','MOU',1170),(4090,'Negroe Occidental','NEC',1170),(4091,'Negros Oriental','NER',1170),(4092,'North Cotabato','NCO',1170),(4093,'Northern Samar','NSA',1170),(4094,'Nueva Ecija','NUE',1170),(4095,'Nueva Vizcaya','NUV',1170),(4096,'Palawan','PLW',1170),(4097,'Pampanga','PAM',1170),(4098,'Pangasinan','PAN',1170),(4099,'Quezon','QUE',1170),(4100,'Quirino','QUI',1170),(4101,'Rizal','RIZ',1170),(4102,'Romblon','ROM',1170),(4103,'Sarangani','SAR',1170),(4104,'Siquijor','SIG',1170),(4105,'Sorsogon','SOR',1170),(4106,'South Cotabato','SCO',1170),(4107,'Southern Leyte','SLE',1170),(4108,'Sultan Kudarat','SUK',1170),(4109,'Sulu','SLU',1170),(4110,'Surigao del Norte','SUN',1170),(4111,'Surigao del Sur','SUR',1170),(4112,'Tarlac','TAR',1170),(4113,'Tawi-Tawi','TAW',1170),(4114,'Western Samar','WSA',1170),(4115,'Zambales','ZMB',1170),(4116,'Zamboanga del Norte','ZAN',1170),(4117,'Zamboanga del Sur','ZAS',1170),(4118,'Zamboanga Sibiguey','ZSI',1170),(4119,'Islamabad Federal Capital Area','IS',1163),(4120,'Baluchistan','BA',1163),(4121,'Khyber Pakhtun Khawa','NW',1163),(4122,'Sindh','SD',1163),(4123,'Federally Administered Tribal Areas','TA',1163),(4124,'Azad Kashmir','JK',1163),(4125,'Gilgit-Baltistan','NA',1163),(4126,'Aveiro','01',1173),(4127,'Beja','02',1173),(4128,'Braga','03',1173),(4129,'Bragança','04',1173),(4130,'Castelo Branco','05',1173),(4131,'Coimbra','06',1173),(4132,'Évora','07',1173),(4133,'Faro','08',1173),(4134,'Guarda','09',1173),(4135,'Leiria','10',1173),(4136,'Lisboa','11',1173),(4137,'Portalegre','12',1173),(4138,'Porto','13',1173),(4139,'Santarém','14',1173),(4140,'Setúbal','15',1173),(4141,'Viana do Castelo','16',1173),(4142,'Vila Real','17',1173),(4143,'Viseu','18',1173),(4144,'Região Autónoma dos Açores','20',1173),(4145,'Região Autónoma da Madeira','30',1173),(4146,'Asuncion','ASU',1168),(4147,'Alto Paraguay','16',1168),(4148,'Alto Parana','10',1168),(4149,'Amambay','13',1168),(4150,'Boqueron','19',1168),(4151,'Caeguazu','5',1168),(4152,'Caazapl','6',1168),(4153,'Canindeyu','14',1168),(4154,'Concepcion','1',1168),(4155,'Cordillera','3',1168),(4156,'Guaira','4',1168),(4157,'Itapua','7',1168),(4158,'Miaiones','8',1168),(4159,'Neembucu','12',1168),(4160,'Paraguari','9',1168),(4161,'Presidente Hayes','15',1168),(4162,'San Pedro','2',1168),(4163,'Ad Dawhah','DA',1175),(4164,'Al Ghuwayriyah','GH',1175),(4165,'Al Jumayliyah','JU',1175),(4166,'Al Khawr','KH',1175),(4167,'Al Wakrah','WA',1175),(4168,'Ar Rayyan','RA',1175),(4169,'Jariyan al Batnah','JB',1175),(4170,'Madinat ash Shamal','MS',1175),(4171,'Umm Salal','US',1175),(4172,'Bucuresti','B',1176),(4173,'Alba','AB',1176),(4174,'Arad','AR',1176),(4175,'Argeș','AG',1176),(4176,'Bacău','BC',1176),(4177,'Bihor','BH',1176),(4178,'Bistrița-Năsăud','BN',1176),(4179,'Botoșani','BT',1176),(4180,'Brașov','BV',1176),(4181,'Brăila','BR',1176),(4182,'Buzău','BZ',1176),(4183,'Caraș-Severin','CS',1176),(4184,'Călărași','CL',1176),(4185,'Cluj','CJ',1176),(4186,'Constanța','CT',1176),(4187,'Covasna','CV',1176),(4188,'Dâmbovița','DB',1176),(4189,'Dolj','DJ',1176),(4190,'Galați','GL',1176),(4191,'Giurgiu','GR',1176),(4192,'Gorj','GJ',1176),(4193,'Harghita','HR',1176),(4194,'Hunedoara','HD',1176),(4195,'Ialomița','IL',1176),(4196,'Iași','IS',1176),(4197,'Ilfov','IF',1176),(4198,'Maramureș','MM',1176),(4199,'Mehedinți','MH',1176),(4200,'Mureș','MS',1176),(4201,'Neamț','NT',1176),(4202,'Olt','OT',1176),(4203,'Prahova','PH',1176),(4204,'Satu Mare','SM',1176),(4205,'Sălaj','SJ',1176),(4206,'Sibiu','SB',1176),(4207,'Suceava','SV',1176),(4208,'Teleorman','TR',1176),(4209,'Timiș','TM',1176),(4210,'Tulcea','TL',1176),(4211,'Vaslui','VS',1176),(4212,'Vâlcea','VL',1176),(4213,'Vrancea','VN',1176),(4214,'Adygeya, Respublika','AD',1177),(4215,'Altay, Respublika','AL',1177),(4216,'Bashkortostan, Respublika','BA',1177),(4217,'Buryatiya, Respublika','BU',1177),(4218,'Chechenskaya Respublika','CE',1177),(4219,'Chuvashskaya Respublika','CU',1177),(4220,'Dagestan, Respublika','DA',1177),(4221,'Ingushskaya Respublika','IN',1177),(4222,'Kabardino-Balkarskaya','KB',1177),(4223,'Kalmykiya, Respublika','KL',1177),(4224,'Karachayevo-Cherkesskaya Respublika','KC',1177),(4225,'Kareliya, Respublika','KR',1177),(4226,'Khakasiya, Respublika','KK',1177),(4227,'Komi, Respublika','KO',1177),(4228,'Mariy El, Respublika','ME',1177),(4229,'Mordoviya, Respublika','MO',1177),(4230,'Sakha, Respublika [Yakutiya]','SA',1177),(4231,'Severnaya Osetiya, Respublika','SE',1177),(4232,'Tatarstan, Respublika','TA',1177),(4233,'Tyva, Respublika [Tuva]','TY',1177),(4234,'Udmurtskaya Respublika','UD',1177),(4235,'Altayskiy kray','ALT',1177),(4236,'Khabarovskiy kray','KHA',1177),(4237,'Krasnodarskiy kray','KDA',1177),(4238,'Krasnoyarskiy kray','KYA',1177),(4239,'Primorskiy kray','PRI',1177),(4240,'Stavropol\'skiy kray','STA',1177),(4241,'Amurskaya oblast\'','AMU',1177),(4242,'Arkhangel\'skaya oblast\'','ARK',1177),(4243,'Astrakhanskaya oblast\'','AST',1177),(4244,'Belgorodskaya oblast\'','BEL',1177),(4245,'Bryanskaya oblast\'','BRY',1177),(4246,'Chelyabinskaya oblast\'','CHE',1177),(4247,'Zabaykalsky Krai\'','ZSK',1177),(4248,'Irkutskaya oblast\'','IRK',1177),(4249,'Ivanovskaya oblast\'','IVA',1177),(4250,'Kaliningradskaya oblast\'','KGD',1177),(4251,'Kaluzhskaya oblast\'','KLU',1177),(4252,'Kamchatka Krai\'','KAM',1177),(4253,'Kemerovskaya oblast\'','KEM',1177),(4254,'Kirovskaya oblast\'','KIR',1177),(4255,'Kostromskaya oblast\'','KOS',1177),(4256,'Kurganskaya oblast\'','KGN',1177),(4257,'Kurskaya oblast\'','KRS',1177),(4258,'Leningradskaya oblast\'','LEN',1177),(4259,'Lipetskaya oblast\'','LIP',1177),(4260,'Magadanskaya oblast\'','MAG',1177),(4261,'Moskovskaya oblast\'','MOS',1177),(4262,'Murmanskaya oblast\'','MUR',1177),(4263,'Nizhegorodskaya oblast\'','NIZ',1177),(4264,'Novgorodskaya oblast\'','NGR',1177),(4265,'Novosibirskaya oblast\'','NVS',1177),(4266,'Omskaya oblast\'','OMS',1177),(4267,'Orenburgskaya oblast\'','ORE',1177),(4268,'Orlovskaya oblast\'','ORL',1177),(4269,'Penzenskaya oblast\'','PNZ',1177),(4270,'Perm krai\'','PEK',1177),(4271,'Pskovskaya oblast\'','PSK',1177),(4272,'Rostovskaya oblast\'','ROS',1177),(4273,'Ryazanskaya oblast\'','RYA',1177),(4274,'Sakhalinskaya oblast\'','SAK',1177),(4275,'Samarskaya oblast\'','SAM',1177),(4276,'Saratovskaya oblast\'','SAR',1177),(4277,'Smolenskaya oblast\'','SMO',1177),(4278,'Sverdlovskaya oblast\'','SVE',1177),(4279,'Tambovskaya oblast\'','TAM',1177),(4280,'Tomskaya oblast\'','TOM',1177),(4281,'Tul\'skaya oblast\'','TUL',1177),(4282,'Tverskaya oblast\'','TVE',1177),(4283,'Tyumenskaya oblast\'','TYU',1177),(4284,'Ul\'yanovskaya oblast\'','ULY',1177),(4285,'Vladimirskaya oblast\'','VLA',1177),(4286,'Volgogradskaya oblast\'','VGG',1177),(4287,'Vologodskaya oblast\'','VLG',1177),(4288,'Voronezhskaya oblast\'','VOR',1177),(4289,'Yaroslavskaya oblast\'','YAR',1177),(4290,'Moskva','MOW',1177),(4291,'Sankt-Peterburg','SPE',1177),(4292,'Yevreyskaya avtonomnaya oblast\'','YEV',1177),(4294,'Chukotskiy avtonomnyy okrug','CHU',1177),(4296,'Khanty-Mansiyskiy avtonomnyy okrug','KHM',1177),(4299,'Nenetskiy avtonomnyy okrug','NEN',1177),(4302,'Yamalo-Nenetskiy avtonomnyy okrug','YAN',1177),(4303,'Butare','C',1178),(4304,'Byumba','I',1178),(4305,'Cyangugu','E',1178),(4306,'Gikongoro','D',1178),(4307,'Gisenyi','G',1178),(4308,'Gitarama','B',1178),(4309,'Kibungo','J',1178),(4310,'Kibuye','F',1178),(4311,'Kigali-Rural Kigali y\' Icyaro','K',1178),(4312,'Kigali-Ville Kigali Ngari','L',1178),(4313,'Mutara','M',1178),(4314,'Ruhengeri','H',1178),(4315,'Al Bahah','11',1187),(4316,'Al Hudud Ash Shamaliyah','08',1187),(4317,'Al Jawf','12',1187),(4318,'Al Madinah','03',1187),(4319,'Al Qasim','05',1187),(4320,'Ar Riyad','01',1187),(4321,'Asir','14',1187),(4322,'Ha\'il','06',1187),(4323,'Jlzan','09',1187),(4324,'Makkah','02',1187),(4325,'Najran','10',1187),(4326,'Tabuk','07',1187),(4327,'Capital Territory (Honiara)','CT',1194),(4328,'Guadalcanal','GU',1194),(4329,'Isabel','IS',1194),(4330,'Makira','MK',1194),(4331,'Malaita','ML',1194),(4332,'Temotu','TE',1194),(4333,'A\'ali an Nil','23',1200),(4334,'Al Bah al Ahmar','26',1200),(4335,'Al Buhayrat','18',1200),(4336,'Al Jazirah','07',1200),(4337,'Al Khartum','03',1200),(4338,'Al Qadarif','06',1200),(4339,'Al Wahdah','22',1200),(4340,'An Nil','04',1200),(4341,'An Nil al Abyaq','08',1200),(4342,'An Nil al Azraq','24',1200),(4343,'Ash Shamallyah','01',1200),(4344,'Bahr al Jabal','17',1200),(4345,'Gharb al Istiwa\'iyah','16',1200),(4346,'Gharb Ba~r al Ghazal','14',1200),(4347,'Gharb Darfur','12',1200),(4348,'Gharb Kurdufan','10',1200),(4349,'Janub Darfur','11',1200),(4350,'Janub Rurdufan','13',1200),(4351,'Jnqall','20',1200),(4352,'Kassala','05',1200),(4353,'Shamal Batr al Ghazal','15',1200),(4354,'Shamal Darfur','02',1200),(4355,'Shamal Kurdufan','09',1200),(4356,'Sharq al Istiwa\'iyah','19',1200),(4357,'Sinnar','25',1200),(4358,'Warab','21',1200),(4359,'Blekinge län','K',1204),(4360,'Dalarnas län','W',1204),(4361,'Gotlands län','I',1204),(4362,'Gävleborgs län','X',1204),(4363,'Hallands län','N',1204),(4364,'Jämtlands län','Z',1204),(4365,'Jönkopings län','F',1204),(4366,'Kalmar län','H',1204),(4367,'Kronobergs län','G',1204),(4368,'Norrbottens län','BD',1204),(4369,'Skåne län','M',1204),(4370,'Stockholms län','AB',1204),(4371,'Södermanlands län','D',1204),(4372,'Uppsala län','C',1204),(4373,'Värmlands län','S',1204),(4374,'Västerbottens län','AC',1204),(4375,'Västernorrlands län','Y',1204),(4376,'Västmanlands län','U',1204),(4377,'Västra Götalands län','Q',1204),(4378,'Örebro län','T',1204),(4379,'Östergötlands län','E',1204),(4380,'Saint Helena','SH',1180),(4381,'Ascension','AC',1180),(4382,'Tristan da Cunha','TA',1180),(4383,'Ajdovščina','001',1193),(4384,'Beltinci','002',1193),(4385,'Benedikt','148',1193),(4386,'Bistrica ob Sotli','149',1193),(4387,'Bled','003',1193),(4388,'Bloke','150',1193),(4389,'Bohinj','004',1193),(4390,'Borovnica','005',1193),(4391,'Bovec','006',1193),(4392,'Braslovče','151',1193),(4393,'Brda','007',1193),(4394,'Brezovica','008',1193),(4395,'Brežice','009',1193),(4396,'Cankova','152',1193),(4397,'Celje','011',1193),(4398,'Cerklje na Gorenjskem','012',1193),(4399,'Cerknica','013',1193),(4400,'Cerkno','014',1193),(4401,'Cerkvenjak','153',1193),(4402,'Črenšovci','015',1193),(4403,'Črna na Koroškem','016',1193),(4404,'Črnomelj','017',1193),(4405,'Destrnik','018',1193),(4406,'Divača','019',1193),(4407,'Dobje','154',1193),(4408,'Dobrepolje','020',1193),(4409,'Dobrna','155',1193),(4410,'Dobrova-Polhov Gradec','021',1193),(4411,'Dobrovnik','156',1193),(4412,'Dol pri Ljubljani','022',1193),(4413,'Dolenjske Toplice','157',1193),(4414,'Domžale','023',1193),(4415,'Dornava','024',1193),(4416,'Dravograd','025',1193),(4417,'Duplek','026',1193),(4418,'Gorenja vas-Poljane','027',1193),(4419,'Gorišnica','028',1193),(4420,'Gornja Radgona','029',1193),(4421,'Gornji Grad','030',1193),(4422,'Gornji Petrovci','031',1193),(4423,'Grad','158',1193),(4424,'Grosuplje','032',1193),(4425,'Hajdina','159',1193),(4426,'Hoče-Slivnica','160',1193),(4427,'Hodoš','161',1193),(4428,'Horjul','162',1193),(4429,'Hrastnik','034',1193),(4430,'Hrpelje-Kozina','035',1193),(4431,'Idrija','036',1193),(4432,'Ig','037',1193),(4433,'Ilirska Bistrica','038',1193),(4434,'Ivančna Gorica','039',1193),(4435,'Izola','040',1193),(4436,'Jesenice','041',1193),(4437,'Jezersko','163',1193),(4438,'Juršinci','042',1193),(4439,'Kamnik','043',1193),(4440,'Kanal','044',1193),(4441,'Kidričevo','045',1193),(4442,'Kobarid','046',1193),(4443,'Kobilje','047',1193),(4444,'Kočevje','048',1193),(4445,'Komen','049',1193),(4446,'Komenda','164',1193),(4447,'Koper','050',1193),(4448,'Kostel','165',1193),(4449,'Kozje','051',1193),(4450,'Kranj','052',1193),(4451,'Kranjska Gora','053',1193),(4452,'Križevci','166',1193),(4453,'Krško','054',1193),(4454,'Kungota','055',1193),(4455,'Kuzma','056',1193),(4456,'Laško','057',1193),(4457,'Lenart','058',1193),(4458,'Lendava','059',1193),(4459,'Litija','060',1193),(4460,'Ljubljana','061',1193),(4461,'Ljubno','062',1193),(4462,'Ljutomer','063',1193),(4463,'Logatec','064',1193),(4464,'Loška dolina','065',1193),(4465,'Loški Potok','066',1193),(4466,'Lovrenc na Pohorju','167',1193),(4467,'Luče','067',1193),(4468,'Lukovica','068',1193),(4469,'Majšperk','069',1193),(4470,'Maribor','070',1193),(4471,'Markovci','168',1193),(4472,'Medvode','071',1193),(4473,'Mengeš','072',1193),(4474,'Metlika','073',1193),(4475,'Mežica','074',1193),(4476,'Miklavž na Dravskem polju','169',1193),(4477,'Miren-Kostanjevica','075',1193),(4478,'Mirna Peč','170',1193),(4479,'Mislinja','076',1193),(4480,'Moravče','077',1193),(4481,'Moravske Toplice','078',1193),(4482,'Mozirje','079',1193),(4483,'Murska Sobota','080',1193),(4484,'Muta','081',1193),(4485,'Naklo','082',1193),(4486,'Nazarje','083',1193),(4487,'Nova Gorica','084',1193),(4488,'Novo mesto','085',1193),(4489,'Sveta Ana','181',1193),(4490,'Sveti Andraž v Slovenskih goricah','182',1193),(4491,'Sveti Jurij','116',1193),(4492,'Šalovci','033',1193),(4493,'Šempeter-Vrtojba','183',1193),(4494,'Šenčur','117',1193),(4495,'Šentilj','118',1193),(4496,'Šentjernej','119',1193),(4497,'Šentjur','120',1193),(4498,'Škocjan','121',1193),(4499,'Škofja Loka','122',1193),(4500,'Škofljica','123',1193),(4501,'Šmarje pri Jelšah','124',1193),(4502,'Šmartno ob Paki','125',1193),(4503,'Šmartno pri Litiji','194',1193),(4504,'Šoštanj','126',1193),(4505,'Štore','127',1193),(4506,'Tabor','184',1193),(4507,'Tišina','010',1193),(4508,'Tolmin','128',1193),(4509,'Trbovlje','129',1193),(4510,'Trebnje','130',1193),(4511,'Trnovska vas','185',1193),(4512,'Tržič','131',1193),(4513,'Trzin','186',1193),(4514,'Turnišče','132',1193),(4515,'Velenje','133',1193),(4516,'Velika Polana','187',1193),(4517,'Velike Lašče','134',1193),(4518,'Veržej','188',1193),(4519,'Videm','135',1193),(4520,'Vipava','136',1193),(4521,'Vitanje','137',1193),(4522,'Vojnik','138',1193),(4523,'Vransko','189',1193),(4524,'Vrhnika','140',1193),(4525,'Vuzenica','141',1193),(4526,'Zagorje ob Savi','142',1193),(4527,'Zavrč','143',1193),(4528,'Zreče','144',1193),(4529,'Žalec','190',1193),(4530,'Železniki','146',1193),(4531,'Žetale','191',1193),(4532,'Žiri','147',1193),(4533,'Žirovnica','192',1193),(4534,'Žužemberk','193',1193),(4535,'Banskobystrický kraj','BC',1192),(4536,'Bratislavský kraj','BL',1192),(4537,'Košický kraj','KI',1192),(4538,'Nitriansky kraj','NJ',1192),(4539,'Prešovský kraj','PV',1192),(4540,'Trenčiansky kraj','TC',1192),(4541,'Trnavský kraj','TA',1192),(4542,'Žilinský kraj','ZI',1192),(4543,'Western Area (Freetown)','W',1190),(4544,'Dakar','DK',1188),(4545,'Diourbel','DB',1188),(4546,'Fatick','FK',1188),(4547,'Kaolack','KL',1188),(4548,'Kolda','KD',1188),(4549,'Louga','LG',1188),(4550,'Matam','MT',1188),(4551,'Saint-Louis','SL',1188),(4552,'Tambacounda','TC',1188),(4553,'Thies','TH',1188),(4554,'Ziguinchor','ZG',1188),(4555,'Awdal','AW',1195),(4556,'Bakool','BK',1195),(4557,'Banaadir','BN',1195),(4558,'Bay','BY',1195),(4559,'Galguduud','GA',1195),(4560,'Gedo','GE',1195),(4561,'Hiirsan','HI',1195),(4562,'Jubbada Dhexe','JD',1195),(4563,'Jubbada Hoose','JH',1195),(4564,'Mudug','MU',1195),(4565,'Nugaal','NU',1195),(4566,'Saneag','SA',1195),(4567,'Shabeellaha Dhexe','SD',1195),(4568,'Shabeellaha Hoose','SH',1195),(4569,'Sool','SO',1195),(4570,'Togdheer','TO',1195),(4571,'Woqooyi Galbeed','WO',1195),(4572,'Brokopondo','BR',1201),(4573,'Commewijne','CM',1201),(4574,'Coronie','CR',1201),(4575,'Marowijne','MA',1201),(4576,'Nickerie','NI',1201),(4577,'Paramaribo','PM',1201),(4578,'Saramacca','SA',1201),(4579,'Sipaliwini','SI',1201),(4580,'Wanica','WA',1201),(4581,'Principe','P',1207),(4582,'Sao Tome','S',1207),(4583,'Ahuachapan','AH',1066),(4584,'Cabanas','CA',1066),(4585,'Cuscatlan','CU',1066),(4586,'Chalatenango','CH',1066),(4587,'Morazan','MO',1066),(4588,'San Miguel','SM',1066),(4589,'San Salvador','SS',1066),(4590,'Santa Ana','SA',1066),(4591,'San Vicente','SV',1066),(4592,'Sonsonate','SO',1066),(4593,'Usulutan','US',1066),(4594,'Al Hasakah','HA',1206),(4595,'Al Ladhiqiyah','LA',1206),(4596,'Al Qunaytirah','QU',1206),(4597,'Ar Raqqah','RA',1206),(4598,'As Suwayda\'','SU',1206),(4599,'Dar\'a','DR',1206),(4600,'Dayr az Zawr','DY',1206),(4601,'Dimashq','DI',1206),(4602,'Halab','HL',1206),(4603,'Hamah','HM',1206),(4604,'Jim\'','HI',1206),(4605,'Idlib','ID',1206),(4606,'Rif Dimashq','RD',1206),(4607,'Tarts','TA',1206),(4608,'Hhohho','HH',1203),(4609,'Lubombo','LU',1203),(4610,'Manzini','MA',1203),(4611,'Shiselweni','SH',1203),(4612,'Batha','BA',1043),(4613,'Biltine','BI',1043),(4614,'Borkou-Ennedi-Tibesti','BET',1043),(4615,'Chari-Baguirmi','CB',1043),(4616,'Guera','GR',1043),(4617,'Kanem','KA',1043),(4618,'Lac','LC',1043),(4619,'Logone-Occidental','LO',1043),(4620,'Logone-Oriental','LR',1043),(4621,'Mayo-Kebbi','MK',1043),(4622,'Moyen-Chari','MC',1043),(4623,'Ouaddai','OD',1043),(4624,'Salamat','SA',1043),(4625,'Tandjile','TA',1043),(4626,'Kara','K',1214),(4627,'Maritime (Region)','M',1214),(4628,'Savannes','S',1214),(4629,'Krung Thep Maha Nakhon Bangkok','10',1211),(4630,'Phatthaya','S',1211),(4631,'Amnat Charoen','37',1211),(4632,'Ang Thong','15',1211),(4633,'Buri Ram','31',1211),(4634,'Chachoengsao','24',1211),(4635,'Chai Nat','18',1211),(4636,'Chaiyaphum','36',1211),(4637,'Chanthaburi','22',1211),(4638,'Chiang Mai','50',1211),(4639,'Chiang Rai','57',1211),(4640,'Chon Buri','20',1211),(4641,'Chumphon','86',1211),(4642,'Kalasin','46',1211),(4643,'Kamphasng Phet','62',1211),(4644,'Kanchanaburi','71',1211),(4645,'Khon Kaen','40',1211),(4646,'Krabi','81',1211),(4647,'Lampang','52',1211),(4648,'Lamphun','51',1211),(4649,'Loei','42',1211),(4650,'Lop Buri','16',1211),(4651,'Mae Hong Son','58',1211),(4652,'Maha Sarakham','44',1211),(4653,'Mukdahan','49',1211),(4654,'Nakhon Nayok','26',1211),(4655,'Nakhon Pathom','73',1211),(4656,'Nakhon Phanom','48',1211),(4657,'Nakhon Ratchasima','30',1211),(4658,'Nakhon Sawan','60',1211),(4659,'Nakhon Si Thammarat','80',1211),(4660,'Nan','55',1211),(4661,'Narathiwat','96',1211),(4662,'Nong Bua Lam Phu','39',1211),(4663,'Nong Khai','43',1211),(4664,'Nonthaburi','12',1211),(4665,'Pathum Thani','13',1211),(4666,'Pattani','94',1211),(4667,'Phangnga','82',1211),(4668,'Phatthalung','93',1211),(4669,'Phayao','56',1211),(4670,'Phetchabun','67',1211),(4671,'Phetchaburi','76',1211),(4672,'Phichit','66',1211),(4673,'Phitsanulok','65',1211),(4674,'Phrae','54',1211),(4675,'Phra Nakhon Si Ayutthaya','14',1211),(4676,'Phuket','83',1211),(4677,'Prachin Buri','25',1211),(4678,'Prachuap Khiri Khan','77',1211),(4679,'Ranong','85',1211),(4680,'Ratchaburi','70',1211),(4681,'Rayong','21',1211),(4682,'Roi Et','45',1211),(4683,'Sa Kaeo','27',1211),(4684,'Sakon Nakhon','47',1211),(4685,'Samut Prakan','11',1211),(4686,'Samut Sakhon','74',1211),(4687,'Samut Songkhram','75',1211),(4688,'Saraburi','19',1211),(4689,'Satun','91',1211),(4690,'Sing Buri','17',1211),(4691,'Si Sa Ket','33',1211),(4692,'Songkhla','90',1211),(4693,'Sukhothai','64',1211),(4694,'Suphan Buri','72',1211),(4695,'Surat Thani','84',1211),(4696,'Surin','32',1211),(4697,'Tak','63',1211),(4698,'Trang','92',1211),(4699,'Trat','23',1211),(4700,'Ubon Ratchathani','34',1211),(4701,'Udon Thani','41',1211),(4702,'Uthai Thani','61',1211),(4703,'Uttaradit','53',1211),(4704,'Yala','95',1211),(4705,'Yasothon','35',1211),(4706,'Sughd','SU',1209),(4707,'Khatlon','KT',1209),(4708,'Gorno-Badakhshan','GB',1209),(4709,'Ahal','A',1220),(4710,'Balkan','B',1220),(4711,'Dasoguz','D',1220),(4712,'Lebap','L',1220),(4713,'Mary','M',1220),(4714,'Béja','31',1218),(4715,'Ben Arous','13',1218),(4716,'Bizerte','23',1218),(4717,'Gabès','81',1218),(4718,'Gafsa','71',1218),(4719,'Jendouba','32',1218),(4720,'Kairouan','41',1218),(4721,'Rasserine','42',1218),(4722,'Kebili','73',1218),(4723,'L\'Ariana','12',1218),(4724,'Le Ref','33',1218),(4725,'Mahdia','53',1218),(4726,'La Manouba','14',1218),(4727,'Medenine','82',1218),(4728,'Moneatir','52',1218),(4729,'Naboul','21',1218),(4730,'Sfax','61',1218),(4731,'Sidi Bouxid','43',1218),(4732,'Siliana','34',1218),(4733,'Sousse','51',1218),(4734,'Tataouine','83',1218),(4735,'Tozeur','72',1218),(4736,'Tunis','11',1218),(4737,'Zaghouan','22',1218),(4738,'Adana','01',1219),(4739,'Ad yaman','02',1219),(4740,'Afyon','03',1219),(4741,'Ag r','04',1219),(4742,'Aksaray','68',1219),(4743,'Amasya','05',1219),(4744,'Ankara','06',1219),(4745,'Antalya','07',1219),(4746,'Ardahan','75',1219),(4747,'Artvin','08',1219),(4748,'Aydin','09',1219),(4749,'Bal kesir','10',1219),(4750,'Bartin','74',1219),(4751,'Batman','72',1219),(4752,'Bayburt','69',1219),(4753,'Bilecik','11',1219),(4754,'Bingol','12',1219),(4755,'Bitlis','13',1219),(4756,'Bolu','14',1219),(4757,'Burdur','15',1219),(4758,'Bursa','16',1219),(4759,'Canakkale','17',1219),(4760,'Cankir','18',1219),(4761,'Corum','19',1219),(4762,'Denizli','20',1219),(4763,'Diyarbakir','21',1219),(4764,'Duzce','81',1219),(4765,'Edirne','22',1219),(4766,'Elazig','23',1219),(4767,'Erzincan','24',1219),(4768,'Erzurum','25',1219),(4769,'Eskis\'ehir','26',1219),(4770,'Gaziantep','27',1219),(4771,'Giresun','28',1219),(4772,'Gms\'hane','29',1219),(4773,'Hakkari','30',1219),(4774,'Hatay','31',1219),(4775,'Igidir','76',1219),(4776,'Isparta','32',1219),(4777,'Icel','33',1219),(4778,'Istanbul','34',1219),(4779,'Izmir','35',1219),(4780,'Kahramanmaras','46',1219),(4781,'Karabk','78',1219),(4782,'Karaman','70',1219),(4783,'Kars','36',1219),(4784,'Kastamonu','37',1219),(4785,'Kayseri','38',1219),(4786,'Kirikkale','71',1219),(4787,'Kirklareli','39',1219),(4788,'Kirs\'ehir','40',1219),(4789,'Kilis','79',1219),(4790,'Kocaeli','41',1219),(4791,'Konya','42',1219),(4792,'Ktahya','43',1219),(4793,'Malatya','44',1219),(4794,'Manisa','45',1219),(4795,'Mardin','47',1219),(4796,'Mugila','48',1219),(4797,'Mus','49',1219),(4798,'Nevs\'ehir','50',1219),(4799,'Nigide','51',1219),(4800,'Ordu','52',1219),(4801,'Osmaniye','80',1219),(4802,'Rize','53',1219),(4803,'Sakarya','54',1219),(4804,'Samsun','55',1219),(4805,'Siirt','56',1219),(4806,'Sinop','57',1219),(4807,'Sivas','58',1219),(4808,'S\'anliurfa','63',1219),(4809,'S\'rnak','73',1219),(4810,'Tekirdag','59',1219),(4811,'Tokat','60',1219),(4812,'Trabzon','61',1219),(4813,'Tunceli','62',1219),(4814,'Us\'ak','64',1219),(4815,'Van','65',1219),(4816,'Yalova','77',1219),(4817,'Yozgat','66',1219),(4818,'Zonguldak','67',1219),(4819,'Couva-Tabaquite-Talparo','CTT',1217),(4820,'Diego Martin','DMN',1217),(4821,'Eastern Tobago','ETO',1217),(4822,'Penal-Debe','PED',1217),(4823,'Princes Town','PRT',1217),(4824,'Rio Claro-Mayaro','RCM',1217),(4825,'Sangre Grande','SGE',1217),(4826,'San Juan-Laventille','SJL',1217),(4827,'Siparia','SIP',1217),(4828,'Tunapuna-Piarco','TUP',1217),(4829,'Western Tobago','WTO',1217),(4830,'Arima','ARI',1217),(4831,'Chaguanas','CHA',1217),(4832,'Point Fortin','PTF',1217),(4833,'Port of Spain','POS',1217),(4834,'San Fernando','SFO',1217),(4835,'Aileu','AL',1063),(4836,'Ainaro','AN',1063),(4837,'Bacucau','BA',1063),(4838,'Bobonaro','BO',1063),(4839,'Cova Lima','CO',1063),(4840,'Dili','DI',1063),(4841,'Ermera','ER',1063),(4842,'Laulem','LA',1063),(4843,'Liquica','LI',1063),(4844,'Manatuto','MT',1063),(4845,'Manafahi','MF',1063),(4846,'Oecussi','OE',1063),(4847,'Viqueque','VI',1063),(4848,'Changhua County','CHA',1208),(4849,'Chiayi County','CYQ',1208),(4850,'Hsinchu County','HSQ',1208),(4851,'Hualien County','HUA',1208),(4852,'Ilan County','ILA',1208),(4853,'Kaohsiung County','KHQ',1208),(4854,'Miaoli County','MIA',1208),(4855,'Nantou County','NAN',1208),(4856,'Penghu County','PEN',1208),(4857,'Pingtung County','PIF',1208),(4858,'Taichung County','TXQ',1208),(4859,'Tainan County','TNQ',1208),(4860,'Taipei County','TPQ',1208),(4861,'Taitung County','TTT',1208),(4862,'Taoyuan County','TAO',1208),(4863,'Yunlin County','YUN',1208),(4864,'Keelung City','KEE',1208),(4865,'Arusha','01',1210),(4866,'Dar-es-Salaam','02',1210),(4867,'Dodoma','03',1210),(4868,'Iringa','04',1210),(4869,'Kagera','05',1210),(4870,'Kaskazini Pemba','06',1210),(4871,'Kaskazini Unguja','07',1210),(4872,'Xigoma','08',1210),(4873,'Kilimanjaro','09',1210),(4874,'Rusini Pemba','10',1210),(4875,'Kusini Unguja','11',1210),(4876,'Lindi','12',1210),(4877,'Manyara','26',1210),(4878,'Mara','13',1210),(4879,'Mbeya','14',1210),(4880,'Mjini Magharibi','15',1210),(4881,'Morogoro','16',1210),(4882,'Mtwara','17',1210),(4883,'Pwani','19',1210),(4884,'Rukwa','20',1210),(4885,'Ruvuma','21',1210),(4886,'Shinyanga','22',1210),(4887,'Singida','23',1210),(4888,'Tabora','24',1210),(4889,'Tanga','25',1210),(4890,'Cherkas\'ka Oblast\'','71',1224),(4891,'Chernihivs\'ka Oblast\'','74',1224),(4892,'Chernivets\'ka Oblast\'','77',1224),(4893,'Dnipropetrovs\'ka Oblast\'','12',1224),(4894,'Donets\'ka Oblast\'','14',1224),(4895,'Ivano-Frankivs\'ka Oblast\'','26',1224),(4896,'Kharkivs\'ka Oblast\'','63',1224),(4897,'Khersons\'ka Oblast\'','65',1224),(4898,'Khmel\'nyts\'ka Oblast\'','68',1224),(4899,'Kirovohrads\'ka Oblast\'','35',1224),(4900,'Kyivs\'ka Oblast\'','32',1224),(4901,'Luhans\'ka Oblast\'','09',1224),(4902,'L\'vivs\'ka Oblast\'','46',1224),(4903,'Mykolaivs\'ka Oblast\'','48',1224),(4904,'Odes \'ka Oblast\'','51',1224),(4905,'Poltavs\'ka Oblast\'','53',1224),(4906,'Rivnens\'ka Oblast\'','56',1224),(4907,'Sums \'ka Oblast\'','59',1224),(4908,'Ternopil\'s\'ka Oblast\'','61',1224),(4909,'Vinnyts\'ka Oblast\'','05',1224),(4910,'Volyos\'ka Oblast\'','07',1224),(4911,'Zakarpats\'ka Oblast\'','21',1224),(4912,'Zaporiz\'ka Oblast\'','23',1224),(4913,'Zhytomyrs\'ka Oblast\'','18',1224),(4914,'Respublika Krym','43',1224),(4915,'Kyiv','30',1224),(4916,'Sevastopol','40',1224),(4917,'Adjumani','301',1223),(4918,'Apac','302',1223),(4919,'Arua','303',1223),(4920,'Bugiri','201',1223),(4921,'Bundibugyo','401',1223),(4922,'Bushenyi','402',1223),(4923,'Busia','202',1223),(4924,'Gulu','304',1223),(4925,'Hoima','403',1223),(4926,'Iganga','203',1223),(4927,'Jinja','204',1223),(4928,'Kabale','404',1223),(4929,'Kabarole','405',1223),(4930,'Kaberamaido','213',1223),(4931,'Kalangala','101',1223),(4932,'Kampala','102',1223),(4933,'Kamuli','205',1223),(4934,'Kamwenge','413',1223),(4935,'Kanungu','414',1223),(4936,'Kapchorwa','206',1223),(4937,'Kasese','406',1223),(4938,'Katakwi','207',1223),(4939,'Kayunga','112',1223),(4940,'Kibaale','407',1223),(4941,'Kiboga','103',1223),(4942,'Kisoro','408',1223),(4943,'Kitgum','305',1223),(4944,'Kotido','306',1223),(4945,'Kumi','208',1223),(4946,'Kyenjojo','415',1223),(4947,'Lira','307',1223),(4948,'Luwero','104',1223),(4949,'Masaka','105',1223),(4950,'Masindi','409',1223),(4951,'Mayuge','214',1223),(4952,'Mbale','209',1223),(4953,'Mbarara','410',1223),(4954,'Moroto','308',1223),(4955,'Moyo','309',1223),(4956,'Mpigi','106',1223),(4957,'Mubende','107',1223),(4958,'Mukono','108',1223),(4959,'Nakapiripirit','311',1223),(4960,'Nakasongola','109',1223),(4961,'Nebbi','310',1223),(4962,'Ntungamo','411',1223),(4963,'Pader','312',1223),(4964,'Pallisa','210',1223),(4965,'Rakai','110',1223),(4966,'Rukungiri','412',1223),(4967,'Sembabule','111',1223),(4968,'Sironko','215',1223),(4969,'Soroti','211',1223),(4970,'Tororo','212',1223),(4971,'Wakiso','113',1223),(4972,'Yumbe','313',1223),(4973,'Baker Island','81',1227),(4974,'Howland Island','84',1227),(4975,'Jarvis Island','86',1227),(4976,'Johnston Atoll','67',1227),(4977,'Kingman Reef','89',1227),(4978,'Midway Islands','71',1227),(4979,'Navassa Island','76',1227),(4980,'Palmyra Atoll','95',1227),(4981,'Wake Island','79',1227),(4982,'Artigsa','AR',1229),(4983,'Canelones','CA',1229),(4984,'Cerro Largo','CL',1229),(4985,'Colonia','CO',1229),(4986,'Durazno','DU',1229),(4987,'Flores','FS',1229),(4988,'Lavalleja','LA',1229),(4989,'Maldonado','MA',1229),(4990,'Montevideo','MO',1229),(4991,'Paysandu','PA',1229),(4992,'Rivera','RV',1229),(4993,'Rocha','RO',1229),(4994,'Salto','SA',1229),(4995,'Soriano','SO',1229),(4996,'Tacuarembo','TA',1229),(4997,'Treinta y Tres','TT',1229),(4998,'Toshkent (city)','TK',1230),(4999,'Qoraqalpogiston Respublikasi','QR',1230),(5000,'Andijon','AN',1230),(5001,'Buxoro','BU',1230),(5002,'Farg\'ona','FA',1230),(5003,'Jizzax','JI',1230),(5004,'Khorazm','KH',1230),(5005,'Namangan','NG',1230),(5006,'Navoiy','NW',1230),(5007,'Qashqadaryo','QA',1230),(5008,'Samarqand','SA',1230),(5009,'Sirdaryo','SI',1230),(5010,'Surxondaryo','SU',1230),(5011,'Toshkent','TO',1230),(5012,'Xorazm','XO',1230),(5013,'Distrito Federal','A',1232),(5014,'Anzoategui','B',1232),(5015,'Apure','C',1232),(5016,'Aragua','D',1232),(5017,'Barinas','E',1232),(5018,'Carabobo','G',1232),(5019,'Cojedes','H',1232),(5020,'Falcon','I',1232),(5021,'Guarico','J',1232),(5022,'Lara','K',1232),(5023,'Merida','L',1232),(5024,'Miranda','M',1232),(5025,'Monagas','N',1232),(5026,'Nueva Esparta','O',1232),(5027,'Portuguesa','P',1232),(5028,'Tachira','S',1232),(5029,'Trujillo','T',1232),(5030,'Vargas','X',1232),(5031,'Yaracuy','U',1232),(5032,'Zulia','V',1232),(5033,'Delta Amacuro','Y',1232),(5034,'Dependencias Federales','W',1232),(5035,'An Giang','44',1233),(5036,'Ba Ria - Vung Tau','43',1233),(5037,'Bac Can','53',1233),(5038,'Bac Giang','54',1233),(5039,'Bac Lieu','55',1233),(5040,'Bac Ninh','56',1233),(5041,'Ben Tre','50',1233),(5042,'Binh Dinh','31',1233),(5043,'Binh Duong','57',1233),(5044,'Binh Phuoc','58',1233),(5045,'Binh Thuan','40',1233),(5046,'Ca Mau','59',1233),(5047,'Can Tho','48',1233),(5048,'Cao Bang','04',1233),(5049,'Da Nang, thanh pho','60',1233),(5050,'Dong Nai','39',1233),(5051,'Dong Thap','45',1233),(5052,'Gia Lai','30',1233),(5053,'Ha Giang','03',1233),(5054,'Ha Nam','63',1233),(5055,'Ha Noi, thu do','64',1233),(5056,'Ha Tay','15',1233),(5057,'Ha Tinh','23',1233),(5058,'Hai Duong','61',1233),(5059,'Hai Phong, thanh pho','62',1233),(5060,'Hoa Binh','14',1233),(5061,'Ho Chi Minh, thanh pho [Sai Gon]','65',1233),(5062,'Hung Yen','66',1233),(5063,'Khanh Hoa','34',1233),(5064,'Kien Giang','47',1233),(5065,'Kon Tum','28',1233),(5066,'Lai Chau','01',1233),(5067,'Lam Dong','35',1233),(5068,'Lang Son','09',1233),(5069,'Lao Cai','02',1233),(5070,'Long An','41',1233),(5071,'Nam Dinh','67',1233),(5072,'Nghe An','22',1233),(5073,'Ninh Binh','18',1233),(5074,'Ninh Thuan','36',1233),(5075,'Phu Tho','68',1233),(5076,'Phu Yen','32',1233),(5077,'Quang Binh','24',1233),(5078,'Quang Nam','27',1233),(5079,'Quang Ngai','29',1233),(5080,'Quang Ninh','13',1233),(5081,'Quang Tri','25',1233),(5082,'Soc Trang','52',1233),(5083,'Son La','05',1233),(5084,'Tay Ninh','37',1233),(5085,'Thai Binh','20',1233),(5086,'Thai Nguyen','69',1233),(5087,'Thanh Hoa','21',1233),(5088,'Thua Thien-Hue','26',1233),(5089,'Tien Giang','46',1233),(5090,'Tra Vinh','51',1233),(5091,'Tuyen Quang','07',1233),(5092,'Vinh Long','49',1233),(5093,'Vinh Phuc','70',1233),(5094,'Yen Bai','06',1233),(5095,'Malampa','MAP',1231),(5096,'Penama','PAM',1231),(5097,'Sanma','SAM',1231),(5098,'Shefa','SEE',1231),(5099,'Tafea','TAE',1231),(5100,'Torba','TOB',1231),(5101,'A\'ana','AA',1185),(5102,'Aiga-i-le-Tai','AL',1185),(5103,'Atua','AT',1185),(5104,'Fa\'aaaleleaga','FA',1185),(5105,'Gaga\'emauga','GE',1185),(5106,'Gagaifomauga','GI',1185),(5107,'Palauli','PA',1185),(5108,'Satupa\'itea','SA',1185),(5109,'Tuamasaga','TU',1185),(5110,'Va\'a-o-Fonoti','VF',1185),(5111,'Vaisigano','VS',1185),(5112,'Crna Gora','CG',1243),(5113,'Srbija','SR',1242),(5114,'Kosovo-Metohija','KM',1242),(5115,'Vojvodina','VO',1242),(5116,'Abyan','AB',1237),(5117,'Adan','AD',1237),(5118,'Ad Dali','DA',1237),(5119,'Al Bayda\'','BA',1237),(5120,'Al Hudaydah','MU',1237),(5121,'Al Mahrah','MR',1237),(5122,'Al Mahwit','MW',1237),(5123,'Amran','AM',1237),(5124,'Dhamar','DH',1237),(5125,'Hadramawt','HD',1237),(5126,'Hajjah','HJ',1237),(5127,'Ibb','IB',1237),(5128,'Lahij','LA',1237),(5129,'Ma\'rib','MA',1237),(5130,'Sa\'dah','SD',1237),(5131,'San\'a\'','SN',1237),(5132,'Shabwah','SH',1237),(5133,'Ta\'izz','TA',1237),(5134,'Eastern Cape','EC',1196),(5135,'Free State','FS',1196),(5136,'Gauteng','GT',1196),(5137,'Kwazulu-Natal','NL',1196),(5138,'Mpumalanga','MP',1196),(5139,'Northern Cape','NC',1196),(5140,'Limpopo','NP',1196),(5141,'Western Cape','WC',1196),(5142,'Copperbelt','08',1239),(5143,'Luapula','04',1239),(5144,'Lusaka','09',1239),(5145,'North-Western','06',1239),(5146,'Bulawayo','BU',1240),(5147,'Harare','HA',1240),(5148,'Manicaland','MA',1240),(5149,'Mashonaland Central','MC',1240),(5150,'Mashonaland East','ME',1240),(5151,'Mashonaland West','MW',1240),(5152,'Masvingo','MV',1240),(5153,'Matabeleland North','MN',1240),(5154,'Matabeleland South','MS',1240),(5155,'Midlands','MI',1240),(5156,'South Karelia','SK',1075),(5157,'South Ostrobothnia','SO',1075),(5158,'Etelä-Savo','ES',1075),(5159,'Häme','HH',1075),(5160,'Itä-Uusimaa','IU',1075),(5161,'Kainuu','KA',1075),(5162,'Central Ostrobothnia','CO',1075),(5163,'Central Finland','CF',1075),(5164,'Kymenlaakso','KY',1075),(5165,'Lapland','LA',1075),(5166,'Tampere Region','TR',1075),(5167,'Ostrobothnia','OB',1075),(5168,'North Karelia','NK',1075),(5169,'Northern Ostrobothnia','NO',1075),(5170,'Northern Savo','NS',1075),(5171,'Päijät-Häme','PH',1075),(5172,'Satakunta','SK',1075),(5173,'Uusimaa','UM',1075),(5174,'South-West Finland','SW',1075),(5175,'Åland','AL',1075),(5176,'Limburg','LI',1152),(5177,'Central and Western','CW',1098),(5178,'Eastern','EA',1098),(5179,'Southern','SO',1098),(5180,'Wan Chai','WC',1098),(5181,'Kowloon City','KC',1098),(5182,'Kwun Tong','KU',1098),(5183,'Sham Shui Po','SS',1098),(5184,'Wong Tai Sin','WT',1098),(5185,'Yau Tsim Mong','YT',1098),(5186,'Islands','IS',1098),(5187,'Kwai Tsing','KI',1098),(5188,'North','NO',1098),(5189,'Sai Kung','SK',1098),(5190,'Sha Tin','ST',1098),(5191,'Tai Po','TP',1098),(5192,'Tsuen Wan','TW',1098),(5193,'Tuen Mun','TM',1098),(5194,'Yuen Long','YL',1098),(5195,'Manchester','MR',1108),(5196,'Al Manāmah (Al ‘Āşimah)','13',1016),(5197,'Al Janūbīyah','14',1016),(5199,'Al Wusţá','16',1016),(5200,'Ash Shamālīyah','17',1016),(5201,'Jenin','_A',1165),(5202,'Tubas','_B',1165),(5203,'Tulkarm','_C',1165),(5204,'Nablus','_D',1165),(5205,'Qalqilya','_E',1165),(5206,'Salfit','_F',1165),(5207,'Ramallah and Al-Bireh','_G',1165),(5208,'Jericho','_H',1165),(5209,'Jerusalem','_I',1165),(5210,'Bethlehem','_J',1165),(5211,'Hebron','_K',1165),(5212,'North Gaza','_L',1165),(5213,'Gaza','_M',1165),(5214,'Deir el-Balah','_N',1165),(5215,'Khan Yunis','_O',1165),(5216,'Rafah','_P',1165),(5217,'Brussels','BRU',1020),(5218,'Distrito Federal','DIF',1140),(5219,'Taichung City','TXG',1208),(5220,'Kaohsiung City','KHH',1208),(5221,'Taipei City','TPE',1208),(5222,'Chiayi City','CYI',1208),(5223,'Hsinchu City','HSZ',1208),(5224,'Tainan City','TNN',1208),(9000,'North West','NW',1196),(9986,'Tyne and Wear','TWR',1226),(9988,'Greater Manchester','GTM',1226),(9989,'Co Tyrone','TYR',1226),(9990,'West Yorkshire','WYK',1226),(9991,'South Yorkshire','SYK',1226),(9992,'Merseyside','MSY',1226),(9993,'Berkshire','BRK',1226),(9994,'West Midlands','WMD',1226),(9998,'West Glamorgan','WGM',1226),(9999,'London','LON',1226),(10000,'Carbonia-Iglesias','CI',1107),(10001,'Olbia-Tempio','OT',1107),(10002,'Medio Campidano','VS',1107),(10003,'Ogliastra','OG',1107),(10009,'Jura','39',1076),(10010,'Barletta-Andria-Trani','Bar',1107),(10011,'Fermo','Fer',1107),(10012,'Monza e Brianza','Mon',1107),(10013,'Clwyd','CWD',1226),(10014,'Dyfed','DFD',1226),(10015,'South Glamorgan','SGM',1226),(10016,'Artibonite','AR',1094),(10017,'Centre','CE',1094),(10018,'Nippes','NI',1094),(10019,'Nord','ND',1094),(10020,'La Rioja','F',1010),(10021,'Andorra la Vella','07',1005),(10022,'Canillo','02',1005),(10023,'Encamp','03',1005),(10024,'Escaldes-Engordany','08',1005),(10025,'La Massana','04',1005),(10026,'Ordino','05',1005),(10027,'Sant Julia de Loria','06',1005),(10028,'Abaco Islands','AB',1212),(10029,'Andros Island','AN',1212),(10030,'Berry Islands','BR',1212),(10031,'Eleuthera','EL',1212),(10032,'Grand Bahama','GB',1212),(10033,'Rum Cay','RC',1212),(10034,'San Salvador Island','SS',1212),(10035,'Kongo central','01',1050),(10036,'Kwango','02',1050),(10037,'Kwilu','03',1050),(10038,'Mai-Ndombe','04',1050),(10039,'Kasai','05',1050),(10040,'Lulua','06',1050),(10041,'Lomami','07',1050),(10042,'Sankuru','08',1050),(10043,'Ituri','09',1050),(10044,'Haut-Uele','10',1050),(10045,'Tshopo','11',1050),(10046,'Bas-Uele','12',1050),(10047,'Nord-Ubangi','13',1050),(10048,'Mongala','14',1050),(10049,'Sud-Ubangi','15',1050),(10050,'Tshuapa','16',1050),(10051,'Haut-Lomami','17',1050),(10052,'Lualaba','18',1050),(10053,'Haut-Katanga','19',1050),(10054,'Tanganyika','20',1050),(10055,'Toledo','TO',1198),(10056,'Córdoba','CO',1198),(10057,'Metropolitan Manila','MNL',1170),(10058,'La Paz','LP',1097),(10059,'Yinchuan','YN',1045),(10060,'Shizuishan','SZ',1045),(10061,'Wuzhong','WZ',1045),(10062,'Guyuan','GY',1045),(10063,'Zhongwei','ZW',1045),(10064,'Luxembourg','L',1126),(10065,'Aizkraukles novads','002',1119),(10066,'Jaunjelgavas novads','038',1119),(10067,'Pļaviņu novads','072',1119),(10068,'Kokneses novads','046',1119),(10069,'Neretas novads','065',1119),(10070,'Skrīveru novads','092',1119),(10071,'Alūksnes novads','007',1119),(10072,'Apes novads','009',1119),(10073,'Balvu novads','015',1119),(10074,'Viļakas novads','108',1119),(10075,'Baltinavas novads','014',1119),(10076,'Rugāju novads','082',1119),(10077,'Bauskas novads','016',1119),(10078,'Iecavas novads','034',1119),(10079,'Rundāles novads','083',1119),(10080,'Vecumnieku novads','105',1119),(10081,'Cēsu novads','022',1119),(10082,'Līgatnes novads','055',1119),(10083,'Amatas novads','008',1119),(10084,'Jaunpiebalgas novads','039',1119),(10085,'Priekuļu novads','075',1119),(10086,'Pārgaujas novads','070',1119),(10087,'Raunas novads','076',1119),(10088,'Vecpiebalgas novads','104',1119),(10089,'Daugavpils novads','025',1119),(10090,'Ilūkstes novads','036',1119),(10091,'Dobeles novads','026',1119),(10092,'Auces novads','010',1119),(10093,'Tērvetes novads','098',1119),(10094,'Gulbenes novads','033',1119),(10095,'Jelgavas novads','041',1119),(10096,'Ozolnieku novads','069',1119),(10097,'Jēkabpils novads','042',1119),(10098,'Aknīstes novads','004',1119),(10099,'Viesītes novads','107',1119),(10100,'Krustpils novads','049',1119),(10101,'Salas novads','085',1119),(10102,'Krāslavas novads','047',1119),(10103,'Dagdas novads','024',1119),(10104,'Aglonas novads','001',1119),(10105,'Kuldīgas novads','050',1119),(10106,'Skrundas novads','093',1119),(10107,'Alsungas novads','006',1119),(10108,'Aizputes novads','003',1119),(10109,'Durbes novads','028',1119),(10110,'Grobiņas novads','032',1119),(10111,'Pāvilostas novads','071',1119),(10112,'Priekules novads','074',1119),(10113,'Nīcas novads','066',1119),(10114,'Rucavas novads','081',1119),(10115,'Vaiņodes novads','100',1119),(10116,'Limbažu novads','054',1119),(10117,'Alojas novads','005',1119),(10118,'Salacgrīvas novads','086',1119),(10119,'Ludzas novads','058',1119),(10120,'Kārsavas novads','044',1119),(10121,'Zilupes novads','110',1119),(10122,'Ciblas novads','023',1119),(10123,'Madonas novads','059',1119),(10124,'Cesvaines novads','021',1119),(10125,'Lubānas novads','057',1119),(10126,'Varakļānu novads','102',1119),(10127,'Ērgļu novads','030',1119),(10128,'Ogres novads','067',1119),(10129,'Ikšķiles novads','035',1119),(10130,'Ķeguma novads','051',1119),(10131,'Lielvārdes novads','053',1119),(10132,'Preiļu novads','073',1119),(10133,'Līvānu novads','056',1119),(10134,'Riebiņu novads','078',1119),(10135,'Vārkavas novads','103',1119),(10136,'Rēzeknes novads','077',1119),(10137,'Viļānu novads','109',1119),(10138,'Baldones novads','013',1119),(10139,'Ķekavas novads','052',1119),(10140,'Olaines novads','068',1119),(10141,'Salaspils novads','087',1119),(10142,'Saulkrastu novads','089',1119),(10143,'Siguldas novads','091',1119),(10144,'Inčukalna novads','037',1119),(10145,'Ādažu novads','011',1119),(10146,'Babītes novads','012',1119),(10147,'Carnikavas novads','020',1119),(10148,'Garkalnes novads','031',1119),(10149,'Krimuldas novads','048',1119),(10150,'Mālpils novads','061',1119),(10151,'Mārupes novads','062',1119),(10152,'Ropažu novads','080',1119),(10153,'Sējas novads','090',1119),(10154,'Stopiņu novads','095',1119),(10155,'Saldus novads','088',1119),(10156,'Brocēnu novads','018',1119),(10157,'Talsu novads','097',1119),(10158,'Dundagas novads','027',1119),(10159,'Mērsraga novads','063',1119),(10160,'Rojas novads','079',1119),(10161,'Tukuma novads','099',1119),(10162,'Kandavas novads','043',1119),(10163,'Engures novads','029',1119),(10164,'Jaunpils novads','040',1119),(10165,'Valkas novads','101',1119),(10166,'Smiltenes novads','094',1119),(10167,'Strenču novads','096',1119),(10168,'Kocēnu novads','045',1119),(10169,'Mazsalacas novads','060',1119),(10170,'Rūjienas novads','084',1119),(10171,'Beverīnas novads','017',1119),(10172,'Burtnieku novads','019',1119),(10173,'Naukšēnu novads','064',1119),(10174,'Ventspils novads','106',1119),(10175,'Jēkabpils','JKB',1119),(10176,'Valmiera','VMR',1119),(10177,'Florida','FL',1229),(10178,'Rio Negro','RN',1229),(10179,'San Jose','SJ',1229),(10180,'Plateau','PL',1157),(10181,'Pieria','61',1085),(10182,'Los Rios','LR',1044),(10183,'Arica y Parinacota','AP',1044),(10184,'Amazonas','AMA',1169),(10185,'Kalimantan Tengah','KT',1102),(10186,'Sulawesi Barat','SR',1102),(10187,'Kalimantan Utara','KU',1102),(10188,'Ankaran','86',1193),(10189,'Apače','87',1193),(10190,'Cirkulane','88',1193),(10191,'Gorje','89',1193),(10192,'Kostanjevica na Krki','90',1193),(10193,'Log-Dragomer','91',1193),(10194,'Makole','92',1193),(10195,'Mirna','93',1193),(10196,'Mokronog-Trebelno','94',1193),(10197,'Odranci','95',1193),(10198,'Oplotnica','96',1193),(10199,'Ormož','97',1193),(10200,'Osilnica','98',1193),(10201,'Pesnica','99',1193),(10202,'Piran','100',1193),(10203,'Pivka','101',1193),(10204,'Podčetrtek','102',1193),(10205,'Podlehnik','103',1193),(10206,'Podvelka','104',1193),(10207,'Poljčane','105',1193),(10208,'Polzela','106',1193),(10209,'Postojna','107',1193),(10210,'Prebold','108',1193),(10211,'Preddvor','109',1193),(10212,'Prevalje','110',1193),(10213,'Ptuj','111',1193),(10214,'Puconci','112',1193),(10215,'Rače-Fram','113',1193),(10216,'Radeče','114',1193),(10217,'Radenci','115',1193),(10218,'Radlje ob Dravi','139',1193),(10219,'Radovljica','145',1193),(10220,'Ravne na Koroškem','171',1193),(10221,'Razkrižje','172',1193),(10222,'Rečica ob Savinji','173',1193),(10223,'Renče-Vogrsko','174',1193),(10224,'Ribnica','175',1193),(10225,'Ribnica na Pohorju','176',1193),(10226,'Rogaška Slatina','177',1193),(10227,'Rogašovci','178',1193),(10228,'Rogatec','179',1193),(10229,'Ruše','180',1193),(10230,'Selnica ob Dravi','195',1193),(10231,'Semič','196',1193),(10232,'Šentrupert','197',1193),(10233,'Sevnica','198',1193),(10234,'Sežana','199',1193),(10235,'Slovenj Gradec','200',1193),(10236,'Slovenska Bistrica','201',1193),(10237,'Slovenske Konjice','202',1193),(10238,'Šmarješke Toplice','203',1193),(10239,'Sodražica','204',1193),(10240,'Solčava','205',1193),(10241,'Središče ob Dravi','206',1193),(10242,'Starše','207',1193),(10243,'Straža','208',1193),(10244,'Sveta Trojica v Slovenskih goricah','209',1193),(10245,'Sveti Jurij v Slovenskih goricah','210',1193),(10246,'Sveti Tomaž','211',1193),(10247,'Vodice','212',1193),(10248,'Abkhazia','AB',1081),(10249,'Adjara','AJ',1081),(10250,'Tbilisi','TB',1081),(10251,'Guria','GU',1081),(10252,'Imereti','IM',1081),(10253,'Kakheti','KA',1081),(10254,'Kvemo Kartli','KK',1081),(10255,'Mtskheta-Mtianeti','MM',1081),(10256,'Racha-Lechkhumi and Kvemo Svaneti','RL',1081),(10257,'Samegrelo-Zemo Svaneti','SZ',1081),(10258,'Samtskhe-Javakheti','SJ',1081),(10259,'Shida Kartli','SK',1081),(10260,'Central','C',1074),(10261,'Punjab','PB',1163),(10262,'La Libertad','LI',1066),(10263,'La Paz','PA',1066),(10264,'La Union','UN',1066),(10265,'Littoral','LT',1038),(10266,'Nord-Ouest','NW',1038),(10267,'Telangana','TG',1101),(10268,'Ash Sharqiyah','04',1187),(10269,'Guadeloupe','GP',1076),(10270,'Martinique','MQ',1076),(10271,'Guyane','GF',1076),(10272,'La Réunion','RE',1076),(10273,'Mayotte','YT',1076),(10274,'Baringo','01',1112),(10275,'Bomet','02',1112),(10276,'Bungoma','03',1112),(10277,'Busia','04',1112),(10278,'Elgeyo/Marakwet','05',1112),(10279,'Embu','06',1112),(10280,'Garissa','07',1112),(10281,'Homa Bay','08',1112),(10282,'Isiolo','09',1112),(10283,'Kajiado','10',1112),(10284,'Kakamega','11',1112),(10285,'Kericho','12',1112),(10286,'Kiambu','13',1112),(10287,'Kilifi','14',1112),(10288,'Kirinyaga','15',1112),(10289,'Kisii','16',1112),(10290,'Kisumu','17',1112),(10291,'Kitui','18',1112),(10292,'Kwale','19',1112),(10293,'Laikipia','20',1112),(10294,'Lamu','21',1112),(10295,'Machakos','22',1112),(10296,'Makueni','23',1112),(10297,'Mandera','24',1112),(10298,'Marsabit','25',1112),(10299,'Meru','26',1112),(10300,'Migori','27',1112),(10301,'Mombasa','28',1112),(10302,'Murang\'a','29',1112),(10303,'Nairobi City','30',1112),(10304,'Nakuru','31',1112),(10305,'Nandi','32',1112),(10306,'Narok','33',1112),(10307,'Nyamira','34',1112),(10308,'Nyandarua','35',1112),(10309,'Nyeri','36',1112),(10310,'Samburu','37',1112),(10311,'Siaya','38',1112),(10312,'Taita/Taveta','39',1112),(10313,'Tana River','40',1112),(10314,'Tharaka-Nithi','41',1112),(10315,'Trans Nzoia','42',1112),(10316,'Turkana','43',1112),(10317,'Uasin Gishu','44',1112),(10318,'Vihiga','45',1112),(10319,'Wajir','46',1112),(10320,'West Pokot','47',1112),(10321,'Chandigarh','CH',1101),(10322,'Central','CP',1083),(10323,'Eastern','EP',1083),(10324,'Northern','NP',1083),(10325,'Western','WP',1083),(10326,'Saint Kitts','K',1181),(10327,'Nevis','N',1181),(10328,'Eastern','E',1190),(10329,'Northern','N',1190),(10330,'Southern','S',1190),(10331,'Dushanbe','DU',1209),(10332,'Nohiyahoi Tobei Jumhurí','RA',1209),(10333,'Wallis-et-Futuna','WF',1076),(10334,'Nouvelle-Calédonie','NC',1076),(10335,'Haute-Marne','52',1076),(10336,'Saint George','03',1009),(10337,'Saint John','04',1009),(10338,'Saint Mary','05',1009),(10339,'Saint Paul','06',1009),(10340,'Saint Peter','07',1009),(10341,'Saint Philip','08',1009),(10342,'Barbuda','10',1009),(10343,'Redonda','11',1009),(10344,'Christ Church','01',1018),(10345,'Saint Andrew','02',1018),(10346,'Saint George','03',1018),(10347,'Saint James','04',1018),(10348,'Saint John','05',1018),(10349,'Saint Joseph','06',1018),(10350,'Saint Lucy','07',1018),(10351,'Saint Michael','08',1018),(10352,'Saint Peter','09',1018),(10353,'Saint Philip','10',1018),(10354,'Saint Thomas','11',1018),(10355,'Estuaire','01',1080),(10356,'Haut-Ogooué','02',1080),(10357,'Moyen-Ogooué','03',1080),(10358,'Ngounié','04',1080),(10359,'Nyanga','05',1080),(10360,'Ogooué-Ivindo','06',1080),(10361,'Ogooué-Lolo','07',1080),(10362,'Ogooué-Maritime','08',1080),(10363,'Woleu-Ntem','09',1080),(10364,'Monmouthshire','MON',1226); +INSERT INTO `civicrm_state_province` (`id`, `name`, `abbreviation`, `country_id`) VALUES (1000,'Alabama','AL',1228),(1001,'Alaska','AK',1228),(1002,'Arizona','AZ',1228),(1003,'Arkansas','AR',1228),(1004,'California','CA',1228),(1005,'Colorado','CO',1228),(1006,'Connecticut','CT',1228),(1007,'Delaware','DE',1228),(1008,'Florida','FL',1228),(1009,'Georgia','GA',1228),(1010,'Hawaii','HI',1228),(1011,'Idaho','ID',1228),(1012,'Illinois','IL',1228),(1013,'Indiana','IN',1228),(1014,'Iowa','IA',1228),(1015,'Kansas','KS',1228),(1016,'Kentucky','KY',1228),(1017,'Louisiana','LA',1228),(1018,'Maine','ME',1228),(1019,'Maryland','MD',1228),(1020,'Massachusetts','MA',1228),(1021,'Michigan','MI',1228),(1022,'Minnesota','MN',1228),(1023,'Mississippi','MS',1228),(1024,'Missouri','MO',1228),(1025,'Montana','MT',1228),(1026,'Nebraska','NE',1228),(1027,'Nevada','NV',1228),(1028,'New Hampshire','NH',1228),(1029,'New Jersey','NJ',1228),(1030,'New Mexico','NM',1228),(1031,'New York','NY',1228),(1032,'North Carolina','NC',1228),(1033,'North Dakota','ND',1228),(1034,'Ohio','OH',1228),(1035,'Oklahoma','OK',1228),(1036,'Oregon','OR',1228),(1037,'Pennsylvania','PA',1228),(1038,'Rhode Island','RI',1228),(1039,'South Carolina','SC',1228),(1040,'South Dakota','SD',1228),(1041,'Tennessee','TN',1228),(1042,'Texas','TX',1228),(1043,'Utah','UT',1228),(1044,'Vermont','VT',1228),(1045,'Virginia','VA',1228),(1046,'Washington','WA',1228),(1047,'West Virginia','WV',1228),(1048,'Wisconsin','WI',1228),(1049,'Wyoming','WY',1228),(1050,'District of Columbia','DC',1228),(1052,'American Samoa','AS',1228),(1053,'Guam','GU',1228),(1055,'Northern Mariana Islands','MP',1228),(1056,'Puerto Rico','PR',1228),(1057,'Virgin Islands','VI',1228),(1058,'United States Minor Outlying Islands','UM',1228),(1059,'Armed Forces Europe','AE',1228),(1060,'Armed Forces Americas','AA',1228),(1061,'Armed Forces Pacific','AP',1228),(1100,'Alberta','AB',1039),(1101,'British Columbia','BC',1039),(1102,'Manitoba','MB',1039),(1103,'New Brunswick','NB',1039),(1104,'Newfoundland and Labrador','NL',1039),(1105,'Northwest Territories','NT',1039),(1106,'Nova Scotia','NS',1039),(1107,'Nunavut','NU',1039),(1108,'Ontario','ON',1039),(1109,'Prince Edward Island','PE',1039),(1110,'Quebec','QC',1039),(1111,'Saskatchewan','SK',1039),(1112,'Yukon Territory','YT',1039),(1200,'Maharashtra','MM',1101),(1201,'Karnataka','KA',1101),(1202,'Andhra Pradesh','AP',1101),(1203,'Arunachal Pradesh','AR',1101),(1204,'Assam','AS',1101),(1205,'Bihar','BR',1101),(1206,'Chhattisgarh','CH',1101),(1207,'Goa','GA',1101),(1208,'Gujarat','GJ',1101),(1209,'Haryana','HR',1101),(1210,'Himachal Pradesh','HP',1101),(1211,'Jammu and Kashmir','JK',1101),(1212,'Jharkhand','JH',1101),(1213,'Kerala','KL',1101),(1214,'Madhya Pradesh','MP',1101),(1215,'Manipur','MN',1101),(1216,'Meghalaya','ML',1101),(1217,'Mizoram','MZ',1101),(1218,'Nagaland','NL',1101),(1219,'Orissa','OR',1101),(1220,'Punjab','PB',1101),(1221,'Rajasthan','RJ',1101),(1222,'Sikkim','SK',1101),(1223,'Tamil Nadu','TN',1101),(1224,'Tripura','TR',1101),(1225,'Uttarakhand','UT',1101),(1226,'Uttar Pradesh','UP',1101),(1227,'West Bengal','WB',1101),(1228,'Andaman and Nicobar Islands','AN',1101),(1229,'Dadra and Nagar Haveli','DN',1101),(1230,'Daman and Diu','DD',1101),(1231,'Delhi','DL',1101),(1232,'Lakshadweep','LD',1101),(1233,'Pondicherry','PY',1101),(1300,'mazowieckie','MZ',1172),(1301,'pomorskie','PM',1172),(1302,'dolnośląskie','DS',1172),(1303,'kujawsko-pomorskie','KP',1172),(1304,'lubelskie','LU',1172),(1305,'lubuskie','LB',1172),(1306,'łódzkie','LD',1172),(1307,'małopolskie','MA',1172),(1308,'opolskie','OP',1172),(1309,'podkarpackie','PK',1172),(1310,'podlaskie','PD',1172),(1311,'śląskie','SL',1172),(1312,'świętokrzyskie','SK',1172),(1313,'warmińsko-mazurskie','WN',1172),(1314,'wielkopolskie','WP',1172),(1315,'zachodniopomorskie','ZP',1172),(1500,'Abu Zaby','AZ',1225),(1501,'\'Ajman','AJ',1225),(1502,'Al Fujayrah','FU',1225),(1503,'Ash Shariqah','SH',1225),(1504,'Dubayy','DU',1225),(1505,'Ra\'s al Khaymah','RK',1225),(1506,'Dac Lac','33',1233),(1507,'Umm al Qaywayn','UQ',1225),(1508,'Badakhshan','BDS',1001),(1509,'Badghis','BDG',1001),(1510,'Baghlan','BGL',1001),(1511,'Balkh','BAL',1001),(1512,'Bamian','BAM',1001),(1513,'Farah','FRA',1001),(1514,'Faryab','FYB',1001),(1515,'Ghazni','GHA',1001),(1516,'Ghowr','GHO',1001),(1517,'Helmand','HEL',1001),(1518,'Herat','HER',1001),(1519,'Jowzjan','JOW',1001),(1520,'Kabul','KAB',1001),(1521,'Kandahar','KAN',1001),(1522,'Kapisa','KAP',1001),(1523,'Khowst','KHO',1001),(1524,'Konar','KNR',1001),(1525,'Kondoz','KDZ',1001),(1526,'Laghman','LAG',1001),(1527,'Lowgar','LOW',1001),(1528,'Nangrahar','NAN',1001),(1529,'Nimruz','NIM',1001),(1530,'Nurestan','NUR',1001),(1531,'Oruzgan','ORU',1001),(1532,'Paktia','PIA',1001),(1533,'Paktika','PKA',1001),(1534,'Parwan','PAR',1001),(1535,'Samangan','SAM',1001),(1536,'Sar-e Pol','SAR',1001),(1537,'Takhar','TAK',1001),(1538,'Wardak','WAR',1001),(1539,'Zabol','ZAB',1001),(1540,'Berat','BR',1002),(1541,'Bulqizë','BU',1002),(1542,'Delvinë','DL',1002),(1543,'Devoll','DV',1002),(1544,'Dibër','DI',1002),(1545,'Durrës','DR',1002),(1546,'Elbasan','EL',1002),(1547,'Fier','FR',1002),(1548,'Gramsh','GR',1002),(1549,'Gjirokastër','GJ',1002),(1550,'Has','HA',1002),(1551,'Kavajë','KA',1002),(1552,'Kolonjë','ER',1002),(1553,'Korçë','KO',1002),(1554,'Krujë','KR',1002),(1555,'Kuçovë','KC',1002),(1556,'Kukës','KU',1002),(1557,'Kurbin','KB',1002),(1558,'Lezhë','LE',1002),(1559,'Librazhd','LB',1002),(1560,'Lushnjë','LU',1002),(1561,'Malësi e Madhe','MM',1002),(1562,'Mallakastër','MK',1002),(1563,'Mat','MT',1002),(1564,'Mirditë','MR',1002),(1565,'Peqin','PQ',1002),(1566,'Përmet','PR',1002),(1567,'Pogradec','PG',1002),(1568,'Pukë','PU',1002),(1569,'Sarandë','SR',1002),(1570,'Skrapar','SK',1002),(1571,'Shkodër','SH',1002),(1572,'Tepelenë','TE',1002),(1573,'Tiranë','TR',1002),(1574,'Tropojë','TP',1002),(1575,'Vlorë','VL',1002),(1576,'Erevan','ER',1011),(1577,'Aragacotn','AG',1011),(1578,'Ararat','AR',1011),(1579,'Armavir','AV',1011),(1580,'Gegarkunik\'','GR',1011),(1581,'Kotayk\'','KT',1011),(1582,'Lory','LO',1011),(1583,'Sirak','SH',1011),(1584,'Syunik\'','SU',1011),(1585,'Tavus','TV',1011),(1586,'Vayoc Jor','VD',1011),(1587,'Bengo','BGO',1006),(1588,'Benguela','BGU',1006),(1589,'Bie','BIE',1006),(1590,'Cabinda','CAB',1006),(1591,'Cuando-Cubango','CCU',1006),(1592,'Cuanza Norte','CNO',1006),(1593,'Cuanza Sul','CUS',1006),(1594,'Cunene','CNN',1006),(1595,'Huambo','HUA',1006),(1596,'Huila','HUI',1006),(1597,'Luanda','LUA',1006),(1598,'Lunda Norte','LNO',1006),(1599,'Lunda Sul','LSU',1006),(1600,'Malange','MAL',1006),(1601,'Moxico','MOX',1006),(1602,'Namibe','NAM',1006),(1603,'Uige','UIG',1006),(1604,'Zaire','ZAI',1006),(1605,'Capital federal','C',1010),(1606,'Buenos Aires','B',1010),(1607,'Catamarca','K',1010),(1608,'Cordoba','X',1010),(1609,'Corrientes','W',1010),(1610,'Chaco','H',1010),(1611,'Chubut','U',1010),(1612,'Entre Rios','E',1010),(1613,'Formosa','P',1010),(1614,'Jujuy','Y',1010),(1615,'La Pampa','L',1010),(1616,'Mendoza','M',1010),(1617,'Misiones','N',1010),(1618,'Neuquen','Q',1010),(1619,'Rio Negro','R',1010),(1620,'Salta','A',1010),(1621,'San Juan','J',1010),(1622,'San Luis','D',1010),(1623,'Santa Cruz','Z',1010),(1624,'Santa Fe','S',1010),(1625,'Santiago del Estero','G',1010),(1626,'Tierra del Fuego','V',1010),(1627,'Tucuman','T',1010),(1628,'Burgenland','1',1014),(1629,'Kärnten','2',1014),(1630,'Niederösterreich','3',1014),(1631,'Oberösterreich','4',1014),(1632,'Salzburg','5',1014),(1633,'Steiermark','6',1014),(1634,'Tirol','7',1014),(1635,'Vorarlberg','8',1014),(1636,'Wien','9',1014),(1637,'Australian Antarctic Territory','AAT',1008),(1638,'Australian Capital Territory','ACT',1013),(1639,'Northern Territory','NT',1013),(1640,'New South Wales','NSW',1013),(1641,'Queensland','QLD',1013),(1642,'South Australia','SA',1013),(1643,'Tasmania','TAS',1013),(1644,'Victoria','VIC',1013),(1645,'Western Australia','WA',1013),(1646,'Naxcivan','NX',1015),(1647,'Ali Bayramli','AB',1015),(1648,'Baki','BA',1015),(1649,'Ganca','GA',1015),(1650,'Lankaran','LA',1015),(1651,'Mingacevir','MI',1015),(1652,'Naftalan','NA',1015),(1653,'Saki','SA',1015),(1654,'Sumqayit','SM',1015),(1655,'Susa','SS',1015),(1656,'Xankandi','XA',1015),(1657,'Yevlax','YE',1015),(1658,'Abseron','ABS',1015),(1659,'Agcabadi','AGC',1015),(1660,'Agdam','AGM',1015),(1661,'Agdas','AGS',1015),(1662,'Agstafa','AGA',1015),(1663,'Agsu','AGU',1015),(1664,'Astara','AST',1015),(1665,'Babak','BAB',1015),(1666,'Balakan','BAL',1015),(1667,'Barda','BAR',1015),(1668,'Beylagan','BEY',1015),(1669,'Bilasuvar','BIL',1015),(1670,'Cabrayll','CAB',1015),(1671,'Calilabad','CAL',1015),(1672,'Culfa','CUL',1015),(1673,'Daskasan','DAS',1015),(1674,'Davaci','DAV',1015),(1675,'Fuzuli','FUZ',1015),(1676,'Gadabay','GAD',1015),(1677,'Goranboy','GOR',1015),(1678,'Goycay','GOY',1015),(1679,'Haciqabul','HAC',1015),(1680,'Imisli','IMI',1015),(1681,'Ismayilli','ISM',1015),(1682,'Kalbacar','KAL',1015),(1683,'Kurdamir','KUR',1015),(1684,'Lacin','LAC',1015),(1685,'Lerik','LER',1015),(1686,'Masalli','MAS',1015),(1687,'Neftcala','NEF',1015),(1688,'Oguz','OGU',1015),(1689,'Ordubad','ORD',1015),(1690,'Qabala','QAB',1015),(1691,'Qax','QAX',1015),(1692,'Qazax','QAZ',1015),(1693,'Qobustan','QOB',1015),(1694,'Quba','QBA',1015),(1695,'Qubadli','QBI',1015),(1696,'Qusar','QUS',1015),(1697,'Saatli','SAT',1015),(1698,'Sabirabad','SAB',1015),(1699,'Sadarak','SAD',1015),(1700,'Sahbuz','SAH',1015),(1701,'Salyan','SAL',1015),(1702,'Samaxi','SMI',1015),(1703,'Samkir','SKR',1015),(1704,'Samux','SMX',1015),(1705,'Sarur','SAR',1015),(1706,'Siyazan','SIY',1015),(1707,'Tartar','TAR',1015),(1708,'Tovuz','TOV',1015),(1709,'Ucar','UCA',1015),(1710,'Xacmaz','XAC',1015),(1711,'Xanlar','XAN',1015),(1712,'Xizi','XIZ',1015),(1713,'Xocali','XCI',1015),(1714,'Xocavand','XVD',1015),(1715,'Yardimli','YAR',1015),(1716,'Zangilan','ZAN',1015),(1717,'Zaqatala','ZAQ',1015),(1718,'Zardab','ZAR',1015),(1719,'Federacija Bosna i Hercegovina','BIH',1026),(1720,'Republika Srpska','SRP',1026),(1721,'Bagerhat zila','05',1017),(1722,'Bandarban zila','01',1017),(1723,'Barguna zila','02',1017),(1724,'Barisal zila','06',1017),(1725,'Bhola zila','07',1017),(1726,'Bogra zila','03',1017),(1727,'Brahmanbaria zila','04',1017),(1728,'Chandpur zila','09',1017),(1729,'Chittagong zila','10',1017),(1730,'Chuadanga zila','12',1017),(1731,'Comilla zila','08',1017),(1732,'Cox\'s Bazar zila','11',1017),(1733,'Dhaka zila','13',1017),(1734,'Dinajpur zila','14',1017),(1735,'Faridpur zila','15',1017),(1736,'Feni zila','16',1017),(1737,'Gaibandha zila','19',1017),(1738,'Gazipur zila','18',1017),(1739,'Gopalganj zila','17',1017),(1740,'Habiganj zila','20',1017),(1741,'Jaipurhat zila','24',1017),(1742,'Jamalpur zila','21',1017),(1743,'Jessore zila','22',1017),(1744,'Jhalakati zila','25',1017),(1745,'Jhenaidah zila','23',1017),(1746,'Khagrachari zila','29',1017),(1747,'Khulna zila','27',1017),(1748,'Kishorganj zila','26',1017),(1749,'Kurigram zila','28',1017),(1750,'Kushtia zila','30',1017),(1751,'Lakshmipur zila','31',1017),(1752,'Lalmonirhat zila','32',1017),(1753,'Madaripur zila','36',1017),(1754,'Magura zila','37',1017),(1755,'Manikganj zila','33',1017),(1756,'Meherpur zila','39',1017),(1757,'Moulvibazar zila','38',1017),(1758,'Munshiganj zila','35',1017),(1759,'Mymensingh zila','34',1017),(1760,'Naogaon zila','48',1017),(1761,'Narail zila','43',1017),(1762,'Narayanganj zila','40',1017),(1763,'Narsingdi zila','42',1017),(1764,'Natore zila','44',1017),(1765,'Nawabganj zila','45',1017),(1766,'Netrakona zila','41',1017),(1767,'Nilphamari zila','46',1017),(1768,'Noakhali zila','47',1017),(1769,'Pabna zila','49',1017),(1770,'Panchagarh zila','52',1017),(1771,'Patuakhali zila','51',1017),(1772,'Pirojpur zila','50',1017),(1773,'Rajbari zila','53',1017),(1774,'Rajshahi zila','54',1017),(1775,'Rangamati zila','56',1017),(1776,'Rangpur zila','55',1017),(1777,'Satkhira zila','58',1017),(1778,'Shariatpur zila','62',1017),(1779,'Sherpur zila','57',1017),(1780,'Sirajganj zila','59',1017),(1781,'Sunamganj zila','61',1017),(1782,'Sylhet zila','60',1017),(1783,'Tangail zila','63',1017),(1784,'Thakurgaon zila','64',1017),(1785,'Antwerpen','VAN',1020),(1786,'Brabant Wallon','WBR',1020),(1787,'Hainaut','WHT',1020),(1788,'Liege','WLG',1020),(1789,'Limburg','VLI',1020),(1790,'Luxembourg','WLX',1020),(1791,'Namur','WNA',1020),(1792,'Oost-Vlaanderen','VOV',1020),(1793,'Vlaams-Brabant','VBR',1020),(1794,'West-Vlaanderen','VWV',1020),(1795,'Bale','BAL',1034),(1796,'Bam','BAM',1034),(1797,'Banwa','BAN',1034),(1798,'Bazega','BAZ',1034),(1799,'Bougouriba','BGR',1034),(1800,'Boulgou','BLG',1034),(1801,'Boulkiemde','BLK',1034),(1802,'Comoe','COM',1034),(1803,'Ganzourgou','GAN',1034),(1804,'Gnagna','GNA',1034),(1805,'Gourma','GOU',1034),(1806,'Houet','HOU',1034),(1807,'Ioba','IOB',1034),(1808,'Kadiogo','KAD',1034),(1809,'Kenedougou','KEN',1034),(1810,'Komondjari','KMD',1034),(1811,'Kompienga','KMP',1034),(1812,'Kossi','KOS',1034),(1813,'Koulpulogo','KOP',1034),(1814,'Kouritenga','KOT',1034),(1815,'Kourweogo','KOW',1034),(1816,'Leraba','LER',1034),(1817,'Loroum','LOR',1034),(1818,'Mouhoun','MOU',1034),(1819,'Nahouri','NAO',1034),(1820,'Namentenga','NAM',1034),(1821,'Nayala','NAY',1034),(1822,'Noumbiel','NOU',1034),(1823,'Oubritenga','OUB',1034),(1824,'Oudalan','OUD',1034),(1825,'Passore','PAS',1034),(1826,'Poni','PON',1034),(1827,'Sanguie','SNG',1034),(1828,'Sanmatenga','SMT',1034),(1829,'Seno','SEN',1034),(1830,'Siasili','SIS',1034),(1831,'Soum','SOM',1034),(1832,'Sourou','SOR',1034),(1833,'Tapoa','TAP',1034),(1834,'Tui','TUI',1034),(1835,'Yagha','YAG',1034),(1836,'Yatenga','YAT',1034),(1837,'Ziro','ZIR',1034),(1838,'Zondoma','ZON',1034),(1839,'Zoundweogo','ZOU',1034),(1840,'Blagoevgrad','01',1033),(1841,'Burgas','02',1033),(1842,'Dobrich','08',1033),(1843,'Gabrovo','07',1033),(1844,'Haskovo','26',1033),(1845,'Yambol','28',1033),(1846,'Kardzhali','09',1033),(1847,'Kyustendil','10',1033),(1848,'Lovech','11',1033),(1849,'Montana','12',1033),(1850,'Pazardzhik','13',1033),(1851,'Pernik','14',1033),(1852,'Pleven','15',1033),(1853,'Plovdiv','16',1033),(1854,'Razgrad','17',1033),(1855,'Ruse','18',1033),(1856,'Silistra','19',1033),(1857,'Sliven','20',1033),(1858,'Smolyan','21',1033),(1859,'Sofia','23',1033),(1860,'Stara Zagora','24',1033),(1861,'Shumen','27',1033),(1862,'Targovishte','25',1033),(1863,'Varna','03',1033),(1864,'Veliko Tarnovo','04',1033),(1865,'Vidin','05',1033),(1866,'Vratsa','06',1033),(1867,'Al Hadd','01',1016),(1868,'Al Manamah','03',1016),(1869,'Al Mintaqah al Gharbiyah','10',1016),(1870,'Al Mintagah al Wusta','07',1016),(1871,'Al Mintaqah ash Shamaliyah','05',1016),(1872,'Al Muharraq','02',1016),(1873,'Ar Rifa','09',1016),(1874,'Jidd Hafs','04',1016),(1875,'Madluat Jamad','12',1016),(1876,'Madluat Isa','08',1016),(1877,'Mintaqat Juzur tawar','11',1016),(1878,'Sitrah','06',1016),(1879,'Bubanza','BB',1036),(1880,'Bujumbura','BJ',1036),(1881,'Bururi','BR',1036),(1882,'Cankuzo','CA',1036),(1883,'Cibitoke','CI',1036),(1884,'Gitega','GI',1036),(1885,'Karuzi','KR',1036),(1886,'Kayanza','KY',1036),(1887,'Makamba','MA',1036),(1888,'Muramvya','MU',1036),(1889,'Mwaro','MW',1036),(1890,'Ngozi','NG',1036),(1891,'Rutana','RT',1036),(1892,'Ruyigi','RY',1036),(1893,'Alibori','AL',1022),(1894,'Atakora','AK',1022),(1895,'Atlantique','AQ',1022),(1896,'Borgou','BO',1022),(1897,'Collines','CO',1022),(1898,'Donga','DO',1022),(1899,'Kouffo','KO',1022),(1900,'Littoral','LI',1022),(1901,'Mono','MO',1022),(1902,'Oueme','OU',1022),(1903,'Plateau','PL',1022),(1904,'Zou','ZO',1022),(1905,'Belait','BE',1032),(1906,'Brunei-Muara','BM',1032),(1907,'Temburong','TE',1032),(1908,'Tutong','TU',1032),(1909,'Cochabamba','C',1025),(1910,'Chuquisaca','H',1025),(1911,'El Beni','B',1025),(1912,'La Paz','L',1025),(1913,'Oruro','O',1025),(1914,'Pando','N',1025),(1915,'Potosi','P',1025),(1916,'Tarija','T',1025),(1917,'Acre','AC',1029),(1918,'Alagoas','AL',1029),(1919,'Amazonas','AM',1029),(1920,'Amapa','AP',1029),(1921,'Bahia','BA',1029),(1922,'Ceara','CE',1029),(1923,'Distrito Federal','DF',1029),(1924,'Espirito Santo','ES',1029),(1926,'Goias','GO',1029),(1927,'Maranhao','MA',1029),(1928,'Minas Gerais','MG',1029),(1929,'Mato Grosso do Sul','MS',1029),(1930,'Mato Grosso','MT',1029),(1931,'Para','PA',1029),(1932,'Paraiba','PB',1029),(1933,'Pernambuco','PE',1029),(1934,'Piaui','PI',1029),(1935,'Parana','PR',1029),(1936,'Rio de Janeiro','RJ',1029),(1937,'Rio Grande do Norte','RN',1029),(1938,'Rondonia','RO',1029),(1939,'Roraima','RR',1029),(1940,'Rio Grande do Sul','RS',1029),(1941,'Santa Catarina','SC',1029),(1942,'Sergipe','SE',1029),(1943,'Sao Paulo','SP',1029),(1944,'Tocantins','TO',1029),(1945,'Acklins and Crooked Islands','AC',1212),(1946,'Bimini','BI',1212),(1947,'Cat Island','CI',1212),(1948,'Exuma','EX',1212),(1955,'Inagua','IN',1212),(1957,'Long Island','LI',1212),(1959,'Mayaguana','MG',1212),(1960,'New Providence','NP',1212),(1962,'Ragged Island','RI',1212),(1966,'Bumthang','33',1024),(1967,'Chhukha','12',1024),(1968,'Dagana','22',1024),(1969,'Gasa','GA',1024),(1970,'Ha','13',1024),(1971,'Lhuentse','44',1024),(1972,'Monggar','42',1024),(1973,'Paro','11',1024),(1974,'Pemagatshel','43',1024),(1975,'Punakha','23',1024),(1976,'Samdrup Jongkha','45',1024),(1977,'Samtee','14',1024),(1978,'Sarpang','31',1024),(1979,'Thimphu','15',1024),(1980,'Trashigang','41',1024),(1981,'Trashi Yangtse','TY',1024),(1982,'Trongsa','32',1024),(1983,'Tsirang','21',1024),(1984,'Wangdue Phodrang','24',1024),(1985,'Zhemgang','34',1024),(1986,'Central','CE',1027),(1987,'Ghanzi','GH',1027),(1988,'Kgalagadi','KG',1027),(1989,'Kgatleng','KL',1027),(1990,'Kweneng','KW',1027),(1991,'Ngamiland','NG',1027),(1992,'North-East','NE',1027),(1993,'North-West','NW',1027),(1994,'South-East','SE',1027),(1995,'Southern','SO',1027),(1996,'Brèsckaja voblasc\'','BR',1019),(1997,'Homel\'skaja voblasc\'','HO',1019),(1998,'Hrodzenskaja voblasc\'','HR',1019),(1999,'Mahilëuskaja voblasc\'','MA',1019),(2000,'Minskaja voblasc\'','MI',1019),(2001,'Vicebskaja voblasc\'','VI',1019),(2002,'Belize','BZ',1021),(2003,'Cayo','CY',1021),(2004,'Corozal','CZL',1021),(2005,'Orange Walk','OW',1021),(2006,'Stann Creek','SC',1021),(2007,'Toledo','TOL',1021),(2008,'Kinshasa','KN',1050),(2011,'Equateur','EQ',1050),(2014,'Kasai-Oriental','KE',1050),(2016,'Maniema','MA',1050),(2017,'Nord-Kivu','NK',1050),(2019,'Sud-Kivu','SK',1050),(2020,'Bangui','BGF',1042),(2021,'Bamingui-Bangoran','BB',1042),(2022,'Basse-Kotto','BK',1042),(2023,'Haute-Kotto','HK',1042),(2024,'Haut-Mbomou','HM',1042),(2025,'Kemo','KG',1042),(2026,'Lobaye','LB',1042),(2027,'Mambere-Kadei','HS',1042),(2028,'Mbomou','MB',1042),(2029,'Nana-Grebizi','KB',1042),(2030,'Nana-Mambere','NM',1042),(2031,'Ombella-Mpoko','MP',1042),(2032,'Ouaka','UK',1042),(2033,'Ouham','AC',1042),(2034,'Ouham-Pende','OP',1042),(2035,'Sangha-Mbaere','SE',1042),(2036,'Vakaga','VR',1042),(2037,'Brazzaville','BZV',1051),(2038,'Bouenza','11',1051),(2039,'Cuvette','8',1051),(2040,'Cuvette-Ouest','15',1051),(2041,'Kouilou','5',1051),(2042,'Lekoumou','2',1051),(2043,'Likouala','7',1051),(2044,'Niari','9',1051),(2045,'Plateaux','14',1051),(2046,'Pool','12',1051),(2047,'Sangha','13',1051),(2048,'Aargau','AG',1205),(2049,'Appenzell Innerrhoden','AI',1205),(2050,'Appenzell Ausserrhoden','AR',1205),(2051,'Bern','BE',1205),(2052,'Basel-Landschaft','BL',1205),(2053,'Basel-Stadt','BS',1205),(2054,'Fribourg','FR',1205),(2055,'Geneva','GE',1205),(2056,'Glarus','GL',1205),(2057,'Graubunden','GR',1205),(2058,'Jura','JU',1205),(2059,'Luzern','LU',1205),(2060,'Neuchatel','NE',1205),(2061,'Nidwalden','NW',1205),(2062,'Obwalden','OW',1205),(2063,'Sankt Gallen','SG',1205),(2064,'Schaffhausen','SH',1205),(2065,'Solothurn','SO',1205),(2066,'Schwyz','SZ',1205),(2067,'Thurgau','TG',1205),(2068,'Ticino','TI',1205),(2069,'Uri','UR',1205),(2070,'Vaud','VD',1205),(2071,'Valais','VS',1205),(2072,'Zug','ZG',1205),(2073,'Zurich','ZH',1205),(2074,'18 Montagnes','06',1054),(2075,'Agnebi','16',1054),(2076,'Bas-Sassandra','09',1054),(2077,'Denguele','10',1054),(2078,'Haut-Sassandra','02',1054),(2079,'Lacs','07',1054),(2080,'Lagunes','01',1054),(2081,'Marahoue','12',1054),(2082,'Moyen-Comoe','05',1054),(2083,'Nzi-Comoe','11',1054),(2084,'Savanes','03',1054),(2085,'Sud-Bandama','15',1054),(2086,'Sud-Comoe','13',1054),(2087,'Vallee du Bandama','04',1054),(2088,'Worodouqou','14',1054),(2089,'Zanzan','08',1054),(2090,'Aisen del General Carlos Ibanez del Campo','AI',1044),(2091,'Antofagasta','AN',1044),(2092,'Araucania','AR',1044),(2093,'Atacama','AT',1044),(2094,'Bio-Bio','BI',1044),(2095,'Coquimbo','CO',1044),(2096,'Libertador General Bernardo O\'Higgins','LI',1044),(2097,'Los Lagos','LL',1044),(2098,'Magallanes','MA',1044),(2099,'Maule','ML',1044),(2100,'Santiago Metropolitan','SM',1044),(2101,'Tarapaca','TA',1044),(2102,'Valparaiso','VS',1044),(2103,'Adamaoua','AD',1038),(2104,'Centre','CE',1038),(2105,'East','ES',1038),(2106,'Far North','EN',1038),(2107,'North','NO',1038),(2108,'South','SW',1038),(2109,'South-West','SW',1038),(2110,'West','OU',1038),(2111,'Beijing','11',1045),(2112,'Chongqing','50',1045),(2113,'Shanghai','31',1045),(2114,'Tianjin','12',1045),(2115,'Anhui','34',1045),(2116,'Fujian','35',1045),(2117,'Gansu','62',1045),(2118,'Guangdong','44',1045),(2119,'Guizhou','52',1045),(2120,'Hainan','46',1045),(2121,'Hebei','13',1045),(2122,'Heilongjiang','23',1045),(2123,'Henan','41',1045),(2124,'Hubei','42',1045),(2125,'Hunan','43',1045),(2126,'Jiangsu','32',1045),(2127,'Jiangxi','36',1045),(2128,'Jilin','22',1045),(2129,'Liaoning','21',1045),(2130,'Qinghai','63',1045),(2131,'Shaanxi','61',1045),(2132,'Shandong','37',1045),(2133,'Shanxi','14',1045),(2134,'Sichuan','51',1045),(2135,'Taiwan','71',1045),(2136,'Yunnan','53',1045),(2137,'Zhejiang','33',1045),(2138,'Guangxi','45',1045),(2139,'Neia Mongol (mn)','15',1045),(2140,'Xinjiang','65',1045),(2141,'Xizang','54',1045),(2142,'Hong Kong','91',1045),(2143,'Macau','92',1045),(2144,'Distrito Capital de Bogotá','DC',1048),(2145,'Amazonea','AMA',1048),(2146,'Antioquia','ANT',1048),(2147,'Arauca','ARA',1048),(2148,'Atlántico','ATL',1048),(2149,'Bolívar','BOL',1048),(2150,'Boyacá','BOY',1048),(2151,'Caldea','CAL',1048),(2152,'Caquetá','CAQ',1048),(2153,'Casanare','CAS',1048),(2154,'Cauca','CAU',1048),(2155,'Cesar','CES',1048),(2156,'Córdoba','COR',1048),(2157,'Cundinamarca','CUN',1048),(2158,'Chocó','CHO',1048),(2159,'Guainía','GUA',1048),(2160,'Guaviare','GUV',1048),(2161,'La Guajira','LAG',1048),(2162,'Magdalena','MAG',1048),(2163,'Meta','MET',1048),(2164,'Nariño','NAR',1048),(2165,'Norte de Santander','NSA',1048),(2166,'Putumayo','PUT',1048),(2167,'Quindio','QUI',1048),(2168,'Risaralda','RIS',1048),(2169,'San Andrés, Providencia y Santa Catalina','SAP',1048),(2170,'Santander','SAN',1048),(2171,'Sucre','SUC',1048),(2172,'Tolima','TOL',1048),(2173,'Valle del Cauca','VAC',1048),(2174,'Vaupés','VAU',1048),(2175,'Vichada','VID',1048),(2176,'Alajuela','A',1053),(2177,'Cartago','C',1053),(2178,'Guanacaste','G',1053),(2179,'Heredia','H',1053),(2180,'Limon','L',1053),(2181,'Puntarenas','P',1053),(2182,'San Jose','SJ',1053),(2183,'Camagey','09',1056),(2184,'Ciego de `vila','08',1056),(2185,'Cienfuegos','06',1056),(2186,'Ciudad de La Habana','03',1056),(2187,'Granma','12',1056),(2188,'Guantanamo','14',1056),(2189,'Holquin','11',1056),(2190,'La Habana','02',1056),(2191,'Las Tunas','10',1056),(2192,'Matanzas','04',1056),(2193,'Pinar del Rio','01',1056),(2194,'Sancti Spiritus','07',1056),(2195,'Santiago de Cuba','13',1056),(2196,'Villa Clara','05',1056),(2197,'Isla de la Juventud','99',1056),(2198,'Pinar del Roo','PR',1056),(2199,'Ciego de Avila','CA',1056),(2200,'Camagoey','CG',1056),(2201,'Holgun','HO',1056),(2202,'Sancti Spritus','SS',1056),(2203,'Municipio Especial Isla de la Juventud','IJ',1056),(2204,'Boa Vista','BV',1040),(2205,'Brava','BR',1040),(2206,'Calheta de Sao Miguel','CS',1040),(2207,'Fogo','FO',1040),(2208,'Maio','MA',1040),(2209,'Mosteiros','MO',1040),(2210,'Paul','PA',1040),(2211,'Porto Novo','PN',1040),(2212,'Praia','PR',1040),(2213,'Ribeira Grande','RG',1040),(2214,'Sal','SL',1040),(2215,'Sao Domingos','SD',1040),(2216,'Sao Filipe','SF',1040),(2217,'Sao Nicolau','SN',1040),(2218,'Sao Vicente','SV',1040),(2219,'Tarrafal','TA',1040),(2220,'Ammochostos Magusa','04',1057),(2221,'Keryneia','06',1057),(2222,'Larnaka','03',1057),(2223,'Lefkosia','01',1057),(2224,'Lemesos','02',1057),(2225,'Pafos','05',1057),(2226,'Jihočeský kraj','JC',1058),(2227,'Jihomoravský kraj','JM',1058),(2228,'Karlovarský kraj','KA',1058),(2229,'Královéhradecký kraj','KR',1058),(2230,'Liberecký kraj','LI',1058),(2231,'Moravskoslezský kraj','MO',1058),(2232,'Olomoucký kraj','OL',1058),(2233,'Pardubický kraj','PA',1058),(2234,'Plzeňský kraj','PL',1058),(2235,'Praha, hlavní město','PR',1058),(2236,'Středočeský kraj','ST',1058),(2237,'Ústecký kraj','US',1058),(2238,'Vysočina','VY',1058),(2239,'Zlínský kraj','ZL',1058),(2240,'Baden-Württemberg','BW',1082),(2241,'Bayern','BY',1082),(2242,'Bremen','HB',1082),(2243,'Hamburg','HH',1082),(2244,'Hessen','HE',1082),(2245,'Niedersachsen','NI',1082),(2246,'Nordrhein-Westfalen','NW',1082),(2247,'Rheinland-Pfalz','RP',1082),(2248,'Saarland','SL',1082),(2249,'Schleswig-Holstein','SH',1082),(2250,'Berlin','BE',1082),(2251,'Brandenburg','BB',1082),(2252,'Mecklenburg-Vorpommern','MV',1082),(2253,'Sachsen','SN',1082),(2254,'Sachsen-Anhalt','ST',1082),(2255,'Thüringen','TH',1082),(2256,'Ali Sabiah','AS',1060),(2257,'Dikhil','DI',1060),(2258,'Djibouti','DJ',1060),(2259,'Obock','OB',1060),(2260,'Tadjoura','TA',1060),(2261,'Frederiksberg','147',1059),(2262,'Copenhagen City','101',1059),(2263,'Copenhagen','015',1059),(2264,'Frederiksborg','020',1059),(2265,'Roskilde','025',1059),(2266,'Vestsjælland','030',1059),(2267,'Storstrøm','035',1059),(2268,'Bornholm','040',1059),(2269,'Fyn','042',1059),(2270,'South Jutland','050',1059),(2271,'Ribe','055',1059),(2272,'Vejle','060',1059),(2273,'Ringkjøbing','065',1059),(2274,'Århus','070',1059),(2275,'Viborg','076',1059),(2276,'North Jutland','080',1059),(2277,'Distrito Nacional (Santo Domingo)','01',1062),(2278,'Azua','02',1062),(2279,'Bahoruco','03',1062),(2280,'Barahona','04',1062),(2281,'Dajabón','05',1062),(2282,'Duarte','06',1062),(2283,'El Seybo [El Seibo]','08',1062),(2284,'Espaillat','09',1062),(2285,'Hato Mayor','30',1062),(2286,'Independencia','10',1062),(2287,'La Altagracia','11',1062),(2288,'La Estrelleta [Elias Pina]','07',1062),(2289,'La Romana','12',1062),(2290,'La Vega','13',1062),(2291,'Maroia Trinidad Sánchez','14',1062),(2292,'Monseñor Nouel','28',1062),(2293,'Monte Cristi','15',1062),(2294,'Monte Plata','29',1062),(2295,'Pedernales','16',1062),(2296,'Peravia','17',1062),(2297,'Puerto Plata','18',1062),(2298,'Salcedo','19',1062),(2299,'Samaná','20',1062),(2300,'San Cristóbal','21',1062),(2301,'San Pedro de Macorís','23',1062),(2302,'Sánchez Ramírez','24',1062),(2303,'Santiago','25',1062),(2304,'Santiago Rodríguez','26',1062),(2305,'Valverde','27',1062),(2306,'Adrar','01',1003),(2307,'Ain Defla','44',1003),(2308,'Ain Tmouchent','46',1003),(2309,'Alger','16',1003),(2310,'Annaba','23',1003),(2311,'Batna','05',1003),(2312,'Bechar','08',1003),(2313,'Bejaia','06',1003),(2314,'Biskra','07',1003),(2315,'Blida','09',1003),(2316,'Bordj Bou Arreridj','34',1003),(2317,'Bouira','10',1003),(2318,'Boumerdes','35',1003),(2319,'Chlef','02',1003),(2320,'Constantine','25',1003),(2321,'Djelfa','17',1003),(2322,'El Bayadh','32',1003),(2323,'El Oued','39',1003),(2324,'El Tarf','36',1003),(2325,'Ghardaia','47',1003),(2326,'Guelma','24',1003),(2327,'Illizi','33',1003),(2328,'Jijel','18',1003),(2329,'Khenchela','40',1003),(2330,'Laghouat','03',1003),(2331,'Mascara','29',1003),(2332,'Medea','26',1003),(2333,'Mila','43',1003),(2334,'Mostaganem','27',1003),(2335,'Msila','28',1003),(2336,'Naama','45',1003),(2337,'Oran','31',1003),(2338,'Ouargla','30',1003),(2339,'Oum el Bouaghi','04',1003),(2340,'Relizane','48',1003),(2341,'Saida','20',1003),(2342,'Setif','19',1003),(2343,'Sidi Bel Abbes','22',1003),(2344,'Skikda','21',1003),(2345,'Souk Ahras','41',1003),(2346,'Tamanghasset','11',1003),(2347,'Tebessa','12',1003),(2348,'Tiaret','14',1003),(2349,'Tindouf','37',1003),(2350,'Tipaza','42',1003),(2351,'Tissemsilt','38',1003),(2352,'Tizi Ouzou','15',1003),(2353,'Tlemcen','13',1003),(2354,'Azuay','A',1064),(2355,'Bolivar','B',1064),(2356,'Canar','F',1064),(2357,'Carchi','C',1064),(2358,'Cotopaxi','X',1064),(2359,'Chimborazo','H',1064),(2360,'El Oro','O',1064),(2361,'Esmeraldas','E',1064),(2362,'Galapagos','W',1064),(2363,'Guayas','G',1064),(2364,'Imbabura','I',1064),(2365,'Loja','L',1064),(2366,'Los Rios','R',1064),(2367,'Manabi','M',1064),(2368,'Morona-Santiago','S',1064),(2369,'Napo','N',1064),(2370,'Orellana','D',1064),(2371,'Pastaza','Y',1064),(2372,'Pichincha','P',1064),(2373,'Sucumbios','U',1064),(2374,'Tungurahua','T',1064),(2375,'Zamora-Chinchipe','Z',1064),(2376,'Harjumaa','37',1069),(2377,'Hiiumaa','39',1069),(2378,'Ida-Virumaa','44',1069),(2379,'Jõgevamaa','49',1069),(2380,'Järvamaa','51',1069),(2381,'Läänemaa','57',1069),(2382,'Lääne-Virumaa','59',1069),(2383,'Põlvamaa','65',1069),(2384,'Pärnumaa','67',1069),(2385,'Raplamaa','70',1069),(2386,'Saaremaa','74',1069),(2387,'Tartumaa','7B',1069),(2388,'Valgamaa','82',1069),(2389,'Viljandimaa','84',1069),(2390,'Võrumaa','86',1069),(2391,'Ad Daqahllyah','DK',1065),(2392,'Al Bahr al Ahmar','BA',1065),(2393,'Al Buhayrah','BH',1065),(2394,'Al Fayym','FYM',1065),(2395,'Al Gharbiyah','GH',1065),(2396,'Al Iskandarlyah','ALX',1065),(2397,'Al Isma illyah','IS',1065),(2398,'Al Jizah','GZ',1065),(2399,'Al Minuflyah','MNF',1065),(2400,'Al Minya','MN',1065),(2401,'Al Qahirah','C',1065),(2402,'Al Qalyublyah','KB',1065),(2403,'Al Wadi al Jadid','WAD',1065),(2404,'Ash Sharqiyah','SHR',1065),(2405,'As Suways','SUZ',1065),(2406,'Aswan','ASN',1065),(2407,'Asyut','AST',1065),(2408,'Bani Suwayf','BNS',1065),(2409,'Bur Sa\'id','PTS',1065),(2410,'Dumyat','DT',1065),(2411,'Janub Sina\'','JS',1065),(2412,'Kafr ash Shaykh','KFS',1065),(2413,'Matruh','MT',1065),(2414,'Qina','KN',1065),(2415,'Shamal Sina\'','SIN',1065),(2416,'Suhaj','SHG',1065),(2417,'Anseba','AN',1068),(2418,'Debub','DU',1068),(2419,'Debubawi Keyih Bahri [Debub-Keih-Bahri]','DK',1068),(2420,'Gash-Barka','GB',1068),(2421,'Maakel [Maekel]','MA',1068),(2422,'Semenawi Keyih Bahri [Semien-Keih-Bahri]','SK',1068),(2423,'Álava','VI',1198),(2424,'Albacete','AB',1198),(2425,'Alicante','A',1198),(2426,'Almería','AL',1198),(2427,'Asturias','O',1198),(2428,'Ávila','AV',1198),(2429,'Badajoz','BA',1198),(2430,'Baleares','PM',1198),(2431,'Barcelona','B',1198),(2432,'Burgos','BU',1198),(2433,'Cáceres','CC',1198),(2434,'Cádiz','CA',1198),(2435,'Cantabria','S',1198),(2436,'Castellón','CS',1198),(2437,'Ciudad Real','CR',1198),(2438,'Cuenca','CU',1198),(2439,'Girona [Gerona]','GE',1198),(2440,'Granada','GR',1198),(2441,'Guadalajara','GU',1198),(2442,'Guipúzcoa','SS',1198),(2443,'Huelva','H',1198),(2444,'Huesca','HU',1198),(2445,'Jaén','J',1198),(2446,'La Coruña','C',1198),(2447,'La Rioja','LO',1198),(2448,'Las Palmas','GC',1198),(2449,'León','LE',1198),(2450,'Lleida [Lérida]','L',1198),(2451,'Lugo','LU',1198),(2452,'Madrid','M',1198),(2453,'Málaga','MA',1198),(2454,'Murcia','MU',1198),(2455,'Navarra','NA',1198),(2456,'Ourense','OR',1198),(2457,'Palencia','P',1198),(2458,'Pontevedra','PO',1198),(2459,'Salamanca','SA',1198),(2460,'Santa Cruz de Tenerife','TF',1198),(2461,'Segovia','SG',1198),(2462,'Sevilla','SE',1198),(2463,'Soria','SO',1198),(2464,'Tarragona','T',1198),(2465,'Teruel','TE',1198),(2466,'Valencia','V',1198),(2467,'Valladolid','VA',1198),(2468,'Vizcaya','BI',1198),(2469,'Zamora','ZA',1198),(2470,'Zaragoza','Z',1198),(2471,'Ceuta','CE',1198),(2472,'Melilla','ML',1198),(2473,'Addis Ababa','AA',1070),(2474,'Dire Dawa','DD',1070),(2475,'Afar','AF',1070),(2476,'Amara','AM',1070),(2477,'Benshangul-Gumaz','BE',1070),(2478,'Gambela Peoples','GA',1070),(2479,'Harari People','HA',1070),(2480,'Oromia','OR',1070),(2481,'Somali','SO',1070),(2482,'Southern Nations, Nationalities and Peoples','SN',1070),(2483,'Tigrai','TI',1070),(2490,'Eastern','E',1074),(2491,'Northern','N',1074),(2492,'Western','W',1074),(2493,'Rotuma','R',1074),(2494,'Chuuk','TRK',1141),(2495,'Kosrae','KSA',1141),(2496,'Pohnpei','PNI',1141),(2497,'Yap','YAP',1141),(2498,'Ain','01',1076),(2499,'Aisne','02',1076),(2500,'Allier','03',1076),(2501,'Alpes-de-Haute-Provence','04',1076),(2502,'Alpes-Maritimes','06',1076),(2503,'Ardèche','07',1076),(2504,'Ardennes','08',1076),(2505,'Ariège','09',1076),(2506,'Aube','10',1076),(2507,'Aude','11',1076),(2508,'Aveyron','12',1076),(2509,'Bas-Rhin','67',1076),(2510,'Bouches-du-Rhône','13',1076),(2511,'Calvados','14',1076),(2512,'Cantal','15',1076),(2513,'Charente','16',1076),(2514,'Charente-Maritime','17',1076),(2515,'Cher','18',1076),(2516,'Corrèze','19',1076),(2517,'Corse-du-Sud','20A',1076),(2518,'Côte-d\'Or','21',1076),(2519,'Côtes-d\'Armor','22',1076),(2520,'Creuse','23',1076),(2521,'Deux-Sèvres','79',1076),(2522,'Dordogne','24',1076),(2523,'Doubs','25',1076),(2524,'Drôme','26',1076),(2525,'Essonne','91',1076),(2526,'Eure','27',1076),(2527,'Eure-et-Loir','28',1076),(2528,'Finistère','29',1076),(2529,'Gard','30',1076),(2530,'Gers','32',1076),(2531,'Gironde','33',1076),(2532,'Haut-Rhin','68',1076),(2533,'Haute-Corse','20B',1076),(2534,'Haute-Garonne','31',1076),(2535,'Haute-Loire','43',1076),(2536,'Haute-Saône','70',1076),(2537,'Haute-Savoie','74',1076),(2538,'Haute-Vienne','87',1076),(2539,'Hautes-Alpes','05',1076),(2540,'Hautes-Pyrénées','65',1076),(2541,'Hauts-de-Seine','92',1076),(2542,'Hérault','34',1076),(2543,'Indre','36',1076),(2544,'Ille-et-Vilaine','35',1076),(2545,'Indre-et-Loire','37',1076),(2546,'Isère','38',1076),(2547,'Landes','40',1076),(2548,'Loir-et-Cher','41',1076),(2549,'Loire','42',1076),(2550,'Loire-Atlantique','44',1076),(2551,'Loiret','45',1076),(2552,'Lot','46',1076),(2553,'Lot-et-Garonne','47',1076),(2554,'Lozère','48',1076),(2555,'Maine-et-Loire','49',1076),(2556,'Manche','50',1076),(2557,'Marne','51',1076),(2558,'Mayenne','53',1076),(2559,'Meurthe-et-Moselle','54',1076),(2560,'Meuse','55',1076),(2561,'Morbihan','56',1076),(2562,'Moselle','57',1076),(2563,'Nièvre','58',1076),(2564,'Nord','59',1076),(2565,'Oise','60',1076),(2566,'Orne','61',1076),(2567,'Paris','75',1076),(2568,'Pas-de-Calais','62',1076),(2569,'Puy-de-Dôme','63',1076),(2570,'Pyrénées-Atlantiques','64',1076),(2571,'Pyrénées-Orientales','66',1076),(2572,'Rhône','69',1076),(2573,'Saône-et-Loire','71',1076),(2574,'Sarthe','72',1076),(2575,'Savoie','73',1076),(2576,'Seine-et-Marne','77',1076),(2577,'Seine-Maritime','76',1076),(2578,'Seine-Saint-Denis','93',1076),(2579,'Somme','80',1076),(2580,'Tarn','81',1076),(2581,'Tarn-et-Garonne','82',1076),(2582,'Val d\'Oise','95',1076),(2583,'Territoire de Belfort','90',1076),(2584,'Val-de-Marne','94',1076),(2585,'Var','83',1076),(2586,'Vaucluse','84',1076),(2587,'Vendée','85',1076),(2588,'Vienne','86',1076),(2589,'Vosges','88',1076),(2590,'Yonne','89',1076),(2591,'Yvelines','78',1076),(2592,'Aberdeen City','ABE',1226),(2593,'Aberdeenshire','ABD',1226),(2594,'Angus','ANS',1226),(2595,'Co Antrim','ANT',1226),(2597,'Argyll and Bute','AGB',1226),(2598,'Co Armagh','ARM',1226),(2606,'Bedfordshire','BDF',1226),(2612,'Blaenau Gwent','BGW',1226),(2620,'Bristol, City of','BST',1226),(2622,'Buckinghamshire','BKM',1226),(2626,'Cambridgeshire','CAM',1226),(2634,'Cheshire','CHS',1226),(2635,'Clackmannanshire','CLK',1226),(2639,'Cornwall','CON',1226),(2643,'Cumbria','CMA',1226),(2647,'Derbyshire','DBY',1226),(2648,'Co Londonderry','DRY',1226),(2649,'Devon','DEV',1226),(2651,'Dorset','DOR',1226),(2652,'Co Down','DOW',1226),(2654,'Dumfries and Galloway','DGY',1226),(2655,'Dundee City','DND',1226),(2657,'County Durham','DUR',1226),(2659,'East Ayrshire','EAY',1226),(2660,'East Dunbartonshire','EDU',1226),(2661,'East Lothian','ELN',1226),(2662,'East Renfrewshire','ERW',1226),(2663,'East Riding of Yorkshire','ERY',1226),(2664,'East Sussex','ESX',1226),(2665,'Edinburgh, City of','EDH',1226),(2666,'Na h-Eileanan Siar','ELS',1226),(2668,'Essex','ESS',1226),(2669,'Falkirk','FAL',1226),(2670,'Co Fermanagh','FER',1226),(2671,'Fife','FIF',1226),(2674,'Glasgow City','GLG',1226),(2675,'Gloucestershire','GLS',1226),(2678,'Gwynedd','GWN',1226),(2682,'Hampshire','HAM',1226),(2687,'Herefordshire','HEF',1226),(2688,'Hertfordshire','HRT',1226),(2689,'Highland','HED',1226),(2692,'Inverclyde','IVC',1226),(2694,'Isle of Wight','IOW',1226),(2699,'Kent','KEN',1226),(2705,'Lancashire','LAN',1226),(2709,'Leicestershire','LEC',1226),(2712,'Lincolnshire','LIN',1226),(2723,'Midlothian','MLN',1226),(2726,'Moray','MRY',1226),(2734,'Norfolk','NFK',1226),(2735,'North Ayrshire','NAY',1226),(2738,'North Lanarkshire','NLK',1226),(2742,'North Yorkshire','NYK',1226),(2743,'Northamptonshire','NTH',1226),(2744,'Northumberland','NBL',1226),(2746,'Nottinghamshire','NTT',1226),(2747,'Oldham','OLD',1226),(2748,'Omagh','OMH',1226),(2749,'Orkney Islands','ORR',1226),(2750,'Oxfordshire','OXF',1226),(2752,'Perth and Kinross','PKN',1226),(2757,'Powys','POW',1226),(2761,'Renfrewshire','RFW',1226),(2766,'Rutland','RUT',1226),(2770,'Scottish Borders','SCB',1226),(2773,'Shetland Islands','ZET',1226),(2774,'Shropshire','SHR',1226),(2777,'Somerset','SOM',1226),(2778,'South Ayrshire','SAY',1226),(2779,'South Gloucestershire','SGC',1226),(2780,'South Lanarkshire','SLK',1226),(2785,'Staffordshire','STS',1226),(2786,'Stirling','STG',1226),(2791,'Suffolk','SFK',1226),(2793,'Surrey','SRY',1226),(2804,'Vale of Glamorgan, The','VGL',1226),(2811,'Warwickshire','WAR',1226),(2813,'West Dunbartonshire','WDU',1226),(2814,'West Lothian','WLN',1226),(2815,'West Sussex','WSX',1226),(2818,'Wiltshire','WIL',1226),(2823,'Worcestershire','WOR',1226),(2826,'Ashanti','AH',1083),(2827,'Brong-Ahafo','BA',1083),(2828,'Greater Accra','AA',1083),(2829,'Upper East','UE',1083),(2830,'Upper West','UW',1083),(2831,'Volta','TV',1083),(2832,'Banjul','B',1213),(2833,'Lower River','L',1213),(2834,'MacCarthy Island','M',1213),(2835,'North Bank','N',1213),(2836,'Upper River','U',1213),(2837,'Beyla','BE',1091),(2838,'Boffa','BF',1091),(2839,'Boke','BK',1091),(2840,'Coyah','CO',1091),(2841,'Dabola','DB',1091),(2842,'Dalaba','DL',1091),(2843,'Dinguiraye','DI',1091),(2844,'Dubreka','DU',1091),(2845,'Faranah','FA',1091),(2846,'Forecariah','FO',1091),(2847,'Fria','FR',1091),(2848,'Gaoual','GA',1091),(2849,'Guekedou','GU',1091),(2850,'Kankan','KA',1091),(2851,'Kerouane','KE',1091),(2852,'Kindia','KD',1091),(2853,'Kissidougou','KS',1091),(2854,'Koubia','KB',1091),(2855,'Koundara','KN',1091),(2856,'Kouroussa','KO',1091),(2857,'Labe','LA',1091),(2858,'Lelouma','LE',1091),(2859,'Lola','LO',1091),(2860,'Macenta','MC',1091),(2861,'Mali','ML',1091),(2862,'Mamou','MM',1091),(2863,'Mandiana','MD',1091),(2864,'Nzerekore','NZ',1091),(2865,'Pita','PI',1091),(2866,'Siguiri','SI',1091),(2867,'Telimele','TE',1091),(2868,'Tougue','TO',1091),(2869,'Yomou','YO',1091),(2870,'Region Continental','C',1067),(2871,'Region Insular','I',1067),(2872,'Annobon','AN',1067),(2873,'Bioko Norte','BN',1067),(2874,'Bioko Sur','BS',1067),(2875,'Centro Sur','CS',1067),(2876,'Kie-Ntem','KN',1067),(2877,'Litoral','LI',1067),(2878,'Wele-Nzas','WN',1067),(2879,'Achaïa','13',1085),(2880,'Aitolia-Akarnania','01',1085),(2881,'Argolis','11',1085),(2882,'Arkadia','12',1085),(2883,'Arta','31',1085),(2884,'Attiki','A1',1085),(2885,'Chalkidiki','64',1085),(2886,'Chania','94',1085),(2887,'Chios','85',1085),(2888,'Dodekanisos','81',1085),(2889,'Drama','52',1085),(2890,'Evros','71',1085),(2891,'Evrytania','05',1085),(2892,'Evvoia','04',1085),(2893,'Florina','63',1085),(2894,'Fokis','07',1085),(2895,'Fthiotis','06',1085),(2896,'Grevena','51',1085),(2897,'Ileia','14',1085),(2898,'Imathia','53',1085),(2899,'Ioannina','33',1085),(2900,'Irakleion','91',1085),(2901,'Karditsa','41',1085),(2902,'Kastoria','56',1085),(2903,'Kavalla','55',1085),(2904,'Kefallinia','23',1085),(2905,'Kerkyra','22',1085),(2906,'Kilkis','57',1085),(2907,'Korinthia','15',1085),(2908,'Kozani','58',1085),(2909,'Kyklades','82',1085),(2910,'Lakonia','16',1085),(2911,'Larisa','42',1085),(2912,'Lasithion','92',1085),(2913,'Lefkas','24',1085),(2914,'Lesvos','83',1085),(2915,'Magnisia','43',1085),(2916,'Messinia','17',1085),(2917,'Pella','59',1085),(2918,'Preveza','34',1085),(2919,'Rethymnon','93',1085),(2920,'Rodopi','73',1085),(2921,'Samos','84',1085),(2922,'Serrai','62',1085),(2923,'Thesprotia','32',1085),(2924,'Thessaloniki','54',1085),(2925,'Trikala','44',1085),(2926,'Voiotia','03',1085),(2927,'Xanthi','72',1085),(2928,'Zakynthos','21',1085),(2929,'Agio Oros','69',1085),(2930,'Alta Verapaz','AV',1090),(2931,'Baja Verapaz','BV',1090),(2932,'Chimaltenango','CM',1090),(2933,'Chiquimula','CQ',1090),(2934,'El Progreso','PR',1090),(2935,'Escuintla','ES',1090),(2936,'Guatemala','GU',1090),(2937,'Huehuetenango','HU',1090),(2938,'Izabal','IZ',1090),(2939,'Jalapa','JA',1090),(2940,'Jutiapa','JU',1090),(2941,'Peten','PE',1090),(2942,'Quetzaltenango','QZ',1090),(2943,'Quiche','QC',1090),(2944,'Retalhuleu','RE',1090),(2945,'Sacatepequez','SA',1090),(2946,'San Marcos','SM',1090),(2947,'Santa Rosa','SR',1090),(2948,'Sololá','SO',1090),(2949,'Suchitepequez','SU',1090),(2950,'Totonicapan','TO',1090),(2951,'Zacapa','ZA',1090),(2952,'Bissau','BS',1092),(2953,'Bafata','BA',1092),(2954,'Biombo','BM',1092),(2955,'Bolama','BL',1092),(2956,'Cacheu','CA',1092),(2957,'Gabu','GA',1092),(2958,'Oio','OI',1092),(2959,'Quloara','QU',1092),(2960,'Tombali S','TO',1092),(2961,'Barima-Waini','BA',1093),(2962,'Cuyuni-Mazaruni','CU',1093),(2963,'Demerara-Mahaica','DE',1093),(2964,'East Berbice-Corentyne','EB',1093),(2965,'Essequibo Islands-West Demerara','ES',1093),(2966,'Mahaica-Berbice','MA',1093),(2967,'Pomeroon-Supenaam','PM',1093),(2968,'Potaro-Siparuni','PT',1093),(2969,'Upper Demerara-Berbice','UD',1093),(2970,'Upper Takutu-Upper Essequibo','UT',1093),(2971,'Atlantida','AT',1097),(2972,'Colon','CL',1097),(2973,'Comayagua','CM',1097),(2974,'Copan','CP',1097),(2975,'Cortes','CR',1097),(2976,'Choluteca','CH',1097),(2977,'El Paraiso','EP',1097),(2978,'Francisco Morazan','FM',1097),(2979,'Gracias a Dios','GD',1097),(2980,'Intibuca','IN',1097),(2981,'Islas de la Bahia','IB',1097),(2982,'Lempira','LE',1097),(2983,'Ocotepeque','OC',1097),(2984,'Olancho','OL',1097),(2985,'Santa Barbara','SB',1097),(2986,'Valle','VA',1097),(2987,'Yoro','YO',1097),(2988,'Bjelovarsko-bilogorska zupanija','07',1055),(2989,'Brodsko-posavska zupanija','12',1055),(2990,'Dubrovacko-neretvanska zupanija','19',1055),(2991,'Istarska zupanija','18',1055),(2992,'Karlovacka zupanija','04',1055),(2993,'Koprivnickco-krizevacka zupanija','06',1055),(2994,'Krapinako-zagorska zupanija','02',1055),(2995,'Licko-senjska zupanija','09',1055),(2996,'Medimurska zupanija','20',1055),(2997,'Osjecko-baranjska zupanija','14',1055),(2998,'Pozesko-slavonska zupanija','11',1055),(2999,'Primorsko-goranska zupanija','08',1055),(3000,'Sisacko-moelavacka Iupanija','03',1055),(3001,'Splitako-dalmatinska zupanija','17',1055),(3002,'Sibenako-kninska zupanija','15',1055),(3003,'Varaidinska zupanija','05',1055),(3004,'VirovitiEko-podravska zupanija','10',1055),(3005,'VuRovarako-srijemska zupanija','16',1055),(3006,'Zadaraka','13',1055),(3007,'Zagrebacka zupanija','01',1055),(3008,'Grande-Anse','GA',1094),(3009,'Nord-Est','NE',1094),(3010,'Nord-Ouest','NO',1094),(3011,'Ouest','OU',1094),(3012,'Sud','SD',1094),(3013,'Sud-Est','SE',1094),(3014,'Budapest','BU',1099),(3015,'Bács-Kiskun','BK',1099),(3016,'Baranya','BA',1099),(3017,'Békés','BE',1099),(3018,'Borsod-Abaúj-Zemplén','BZ',1099),(3019,'Csongrád','CS',1099),(3020,'Fejér','FE',1099),(3021,'Győr-Moson-Sopron','GS',1099),(3022,'Hajdu-Bihar','HB',1099),(3023,'Heves','HE',1099),(3024,'Jász-Nagykun-Szolnok','JN',1099),(3025,'Komárom-Esztergom','KE',1099),(3026,'Nográd','NO',1099),(3027,'Pest','PE',1099),(3028,'Somogy','SO',1099),(3029,'Szabolcs-Szatmár-Bereg','SZ',1099),(3030,'Tolna','TO',1099),(3031,'Vas','VA',1099),(3032,'Veszprém','VE',1099),(3033,'Zala','ZA',1099),(3034,'Békéscsaba','BC',1099),(3035,'Debrecen','DE',1099),(3036,'Dunaújváros','DU',1099),(3037,'Eger','EG',1099),(3038,'Győr','GY',1099),(3039,'Hódmezővásárhely','HV',1099),(3040,'Kaposvár','KV',1099),(3041,'Kecskemét','KM',1099),(3042,'Miskolc','MI',1099),(3043,'Nagykanizsa','NK',1099),(3044,'Nyiregyháza','NY',1099),(3045,'Pécs','PS',1099),(3046,'Salgótarján','ST',1099),(3047,'Sopron','SN',1099),(3048,'Szeged','SD',1099),(3049,'Székesfehérvár','SF',1099),(3050,'Szekszárd','SS',1099),(3051,'Szolnok','SK',1099),(3052,'Szombathely','SH',1099),(3053,'Tatabánya','TB',1099),(3054,'Zalaegerszeg','ZE',1099),(3055,'Bali','BA',1102),(3056,'Kepulauan Bangka Belitung','BB',1102),(3057,'Banten','BT',1102),(3058,'Bengkulu','BE',1102),(3059,'Gorontalo','GO',1102),(3060,'Papua Barat','PB',1102),(3061,'Jambi','JA',1102),(3062,'Jawa Barat','JB',1102),(3063,'Jawa Tengah','JT',1102),(3064,'Jawa Timur','JI',1102),(3065,'Kalimantan Barat','KB',1102),(3066,'Kalimantan Timur','KI',1102),(3067,'Kalimantan Selatan','KS',1102),(3068,'Kepulauan Riau','KR',1102),(3069,'Lampung','LA',1102),(3070,'Maluku','MA',1102),(3071,'Maluku Utara','MU',1102),(3072,'Nusa Tenggara Barat','NB',1102),(3073,'Nusa Tenggara Timur','NT',1102),(3074,'Papua','PA',1102),(3075,'Riau','RI',1102),(3076,'Sulawesi Selatan','SN',1102),(3077,'Sulawesi Tengah','ST',1102),(3078,'Sulawesi Tenggara','SG',1102),(3079,'Sulawesi Utara','SA',1102),(3080,'Sumatra Barat','SB',1102),(3081,'Sumatra Selatan','SS',1102),(3082,'Sumatera Utara','SU',1102),(3083,'DKI Jakarta','JK',1102),(3084,'Aceh','AC',1102),(3085,'DI Yogyakarta','YO',1102),(3086,'Cork','C',1105),(3087,'Clare','CE',1105),(3088,'Cavan','CN',1105),(3089,'Carlow','CW',1105),(3090,'Dublin','D',1105),(3091,'Donegal','DL',1105),(3092,'Galway','G',1105),(3093,'Kildare','KE',1105),(3094,'Kilkenny','KK',1105),(3095,'Kerry','KY',1105),(3096,'Longford','LD',1105),(3097,'Louth','LH',1105),(3098,'Limerick','LK',1105),(3099,'Leitrim','LM',1105),(3100,'Laois','LS',1105),(3101,'Meath','MH',1105),(3102,'Monaghan','MN',1105),(3103,'Mayo','MO',1105),(3104,'Offaly','OY',1105),(3105,'Roscommon','RN',1105),(3106,'Sligo','SO',1105),(3107,'Tipperary','TA',1105),(3108,'Waterford','WD',1105),(3109,'Westmeath','WH',1105),(3110,'Wicklow','WW',1105),(3111,'Wexford','WX',1105),(3112,'HaDarom','D',1106),(3113,'HaMerkaz','M',1106),(3114,'HaZafon','Z',1106),(3115,'Haifa','HA',1106),(3116,'Tel-Aviv','TA',1106),(3117,'Jerusalem','JM',1106),(3118,'Al Anbar','AN',1104),(3119,'Al Ba,rah','BA',1104),(3120,'Al Muthanna','MU',1104),(3121,'Al Qadisiyah','QA',1104),(3122,'An Najef','NA',1104),(3123,'Arbil','AR',1104),(3124,'As Sulaymaniyah','SW',1104),(3125,'At Ta\'mim','TS',1104),(3126,'Babil','BB',1104),(3127,'Baghdad','BG',1104),(3128,'Dahuk','DA',1104),(3129,'Dhi Qar','DQ',1104),(3130,'Diyala','DI',1104),(3131,'Karbala\'','KA',1104),(3132,'Maysan','MA',1104),(3133,'Ninawa','NI',1104),(3134,'Salah ad Din','SD',1104),(3135,'Wasit','WA',1104),(3136,'Ardabil','03',1103),(3137,'Azarbayjan-e Gharbi','02',1103),(3138,'Azarbayjan-e Sharqi','01',1103),(3139,'Bushehr','06',1103),(3140,'Chahar Mahall va Bakhtiari','08',1103),(3141,'Esfahan','04',1103),(3142,'Fars','14',1103),(3143,'Gilan','19',1103),(3144,'Golestan','27',1103),(3145,'Hamadan','24',1103),(3146,'Hormozgan','23',1103),(3147,'Iiam','05',1103),(3148,'Kerman','15',1103),(3149,'Kermanshah','17',1103),(3150,'Khorasan','09',1103),(3151,'Khuzestan','10',1103),(3152,'Kohjiluyeh va Buyer Ahmad','18',1103),(3153,'Kordestan','16',1103),(3154,'Lorestan','20',1103),(3155,'Markazi','22',1103),(3156,'Mazandaran','21',1103),(3157,'Qazvin','28',1103),(3158,'Qom','26',1103),(3159,'Semnan','12',1103),(3160,'Sistan va Baluchestan','13',1103),(3161,'Tehran','07',1103),(3162,'Yazd','25',1103),(3163,'Zanjan','11',1103),(3164,'Austurland','7',1100),(3165,'Hofuoborgarsvaeoi utan Reykjavikur','1',1100),(3166,'Norourland eystra','6',1100),(3167,'Norourland vestra','5',1100),(3168,'Reykjavik','0',1100),(3169,'Suourland','8',1100),(3170,'Suournes','2',1100),(3171,'Vestfirolr','4',1100),(3172,'Vesturland','3',1100),(3173,'Agrigento','AG',1107),(3174,'Alessandria','AL',1107),(3175,'Ancona','AN',1107),(3176,'Aosta','AO',1107),(3177,'Arezzo','AR',1107),(3178,'Ascoli Piceno','AP',1107),(3179,'Asti','AT',1107),(3180,'Avellino','AV',1107),(3181,'Bari','BA',1107),(3182,'Belluno','BL',1107),(3183,'Benevento','BN',1107),(3184,'Bergamo','BG',1107),(3185,'Biella','BI',1107),(3186,'Bologna','BO',1107),(3187,'Bolzano','BZ',1107),(3188,'Brescia','BS',1107),(3189,'Brindisi','BR',1107),(3190,'Cagliari','CA',1107),(3191,'Caltanissetta','CL',1107),(3192,'Campobasso','CB',1107),(3193,'Caserta','CE',1107),(3194,'Catania','CT',1107),(3195,'Catanzaro','CZ',1107),(3196,'Chieti','CH',1107),(3197,'Como','CO',1107),(3198,'Cosenza','CS',1107),(3199,'Cremona','CR',1107),(3200,'Crotone','KR',1107),(3201,'Cuneo','CN',1107),(3202,'Enna','EN',1107),(3203,'Ferrara','FE',1107),(3204,'Firenze','FI',1107),(3205,'Foggia','FG',1107),(3206,'Forlì-Cesena','FC',1107),(3207,'Frosinone','FR',1107),(3208,'Genova','GE',1107),(3209,'Gorizia','GO',1107),(3210,'Grosseto','GR',1107),(3211,'Imperia','IM',1107),(3212,'Isernia','IS',1107),(3213,'L\'Aquila','AQ',1107),(3214,'La Spezia','SP',1107),(3215,'Latina','LT',1107),(3216,'Lecce','LE',1107),(3217,'Lecco','LC',1107),(3218,'Livorno','LI',1107),(3219,'Lodi','LO',1107),(3220,'Lucca','LU',1107),(3221,'Macerata','MC',1107),(3222,'Mantova','MN',1107),(3223,'Massa-Carrara','MS',1107),(3224,'Matera','MT',1107),(3225,'Messina','ME',1107),(3226,'Milano','MI',1107),(3227,'Modena','MO',1107),(3228,'Napoli','NA',1107),(3229,'Novara','NO',1107),(3230,'Nuoro','NU',1107),(3231,'Oristano','OR',1107),(3232,'Padova','PD',1107),(3233,'Palermo','PA',1107),(3234,'Parma','PR',1107),(3235,'Pavia','PV',1107),(3236,'Perugia','PG',1107),(3237,'Pesaro e Urbino','PU',1107),(3238,'Pescara','PE',1107),(3239,'Piacenza','PC',1107),(3240,'Pisa','PI',1107),(3241,'Pistoia','PT',1107),(3242,'Pordenone','PN',1107),(3243,'Potenza','PZ',1107),(3244,'Prato','PO',1107),(3245,'Ragusa','RG',1107),(3246,'Ravenna','RA',1107),(3247,'Reggio Calabria','RC',1107),(3248,'Reggio Emilia','RE',1107),(3249,'Rieti','RI',1107),(3250,'Rimini','RN',1107),(3251,'Roma','RM',1107),(3252,'Rovigo','RO',1107),(3253,'Salerno','SA',1107),(3254,'Sassari','SS',1107),(3255,'Savona','SV',1107),(3256,'Siena','SI',1107),(3257,'Siracusa','SR',1107),(3258,'Sondrio','SO',1107),(3259,'Taranto','TA',1107),(3260,'Teramo','TE',1107),(3261,'Terni','TR',1107),(3262,'Torino','TO',1107),(3263,'Trapani','TP',1107),(3264,'Trento','TN',1107),(3265,'Treviso','TV',1107),(3266,'Trieste','TS',1107),(3267,'Udine','UD',1107),(3268,'Varese','VA',1107),(3269,'Venezia','VE',1107),(3270,'Verbano-Cusio-Ossola','VB',1107),(3271,'Vercelli','VC',1107),(3272,'Verona','VR',1107),(3273,'Vibo Valentia','VV',1107),(3274,'Vicenza','VI',1107),(3275,'Viterbo','VT',1107),(3276,'Aichi','23',1109),(3277,'Akita','05',1109),(3278,'Aomori','02',1109),(3279,'Chiba','12',1109),(3280,'Ehime','38',1109),(3281,'Fukui','18',1109),(3282,'Fukuoka','40',1109),(3283,'Fukusima','07',1109),(3284,'Gifu','21',1109),(3285,'Gunma','10',1109),(3286,'Hiroshima','34',1109),(3287,'Hokkaido','01',1109),(3288,'Hyogo','28',1109),(3289,'Ibaraki','08',1109),(3290,'Ishikawa','17',1109),(3291,'Iwate','03',1109),(3292,'Kagawa','37',1109),(3293,'Kagoshima','46',1109),(3294,'Kanagawa','14',1109),(3295,'Kochi','39',1109),(3296,'Kumamoto','43',1109),(3297,'Kyoto','26',1109),(3298,'Mie','24',1109),(3299,'Miyagi','04',1109),(3300,'Miyazaki','45',1109),(3301,'Nagano','20',1109),(3302,'Nagasaki','42',1109),(3303,'Nara','29',1109),(3304,'Niigata','15',1109),(3305,'Oita','44',1109),(3306,'Okayama','33',1109),(3307,'Okinawa','47',1109),(3308,'Osaka','27',1109),(3309,'Saga','41',1109),(3310,'Saitama','11',1109),(3311,'Shiga','25',1109),(3312,'Shimane','32',1109),(3313,'Shizuoka','22',1109),(3314,'Tochigi','09',1109),(3315,'Tokushima','36',1109),(3316,'Tokyo','13',1109),(3317,'Tottori','31',1109),(3318,'Toyama','16',1109),(3319,'Wakayama','30',1109),(3320,'Yamagata','06',1109),(3321,'Yamaguchi','35',1109),(3322,'Yamanashi','19',1109),(3323,'Clarendon','CN',1108),(3324,'Hanover','HR',1108),(3325,'Kingston','KN',1108),(3326,'Portland','PD',1108),(3327,'Saint Andrew','AW',1108),(3328,'Saint Ann','AN',1108),(3329,'Saint Catherine','CE',1108),(3330,'Saint Elizabeth','EH',1108),(3331,'Saint James','JS',1108),(3332,'Saint Mary','MY',1108),(3333,'Saint Thomas','TS',1108),(3334,'Trelawny','TY',1108),(3335,'Westmoreland','WD',1108),(3336,'Ajln','AJ',1110),(3337,'Al \'Aqaba','AQ',1110),(3338,'Al Balqa\'','BA',1110),(3339,'Al Karak','KA',1110),(3340,'Al Mafraq','MA',1110),(3341,'Amman','AM',1110),(3342,'At Tafilah','AT',1110),(3343,'Az Zarga','AZ',1110),(3344,'Irbid','JR',1110),(3345,'Jarash','JA',1110),(3346,'Ma\'an','MN',1110),(3347,'Madaba','MD',1110),(3353,'Bishkek','GB',1117),(3354,'Batken','B',1117),(3355,'Chu','C',1117),(3356,'Jalal-Abad','J',1117),(3357,'Naryn','N',1117),(3358,'Osh','O',1117),(3359,'Talas','T',1117),(3360,'Ysyk-Kol','Y',1117),(3361,'Krong Kaeb','23',1037),(3362,'Krong Pailin','24',1037),(3363,'Xrong Preah Sihanouk','18',1037),(3364,'Phnom Penh','12',1037),(3365,'Baat Dambang','2',1037),(3366,'Banteay Mean Chey','1',1037),(3367,'Rampong Chaam','3',1037),(3368,'Kampong Chhnang','4',1037),(3369,'Kampong Spueu','5',1037),(3370,'Kampong Thum','6',1037),(3371,'Kampot','7',1037),(3372,'Kandaal','8',1037),(3373,'Kach Kong','9',1037),(3374,'Krachoh','10',1037),(3375,'Mondol Kiri','11',1037),(3376,'Otdar Mean Chey','22',1037),(3377,'Pousaat','15',1037),(3378,'Preah Vihear','13',1037),(3379,'Prey Veaeng','14',1037),(3380,'Rotanak Kiri','16',1037),(3381,'Siem Reab','17',1037),(3382,'Stueng Traeng','19',1037),(3383,'Svaay Rieng','20',1037),(3384,'Taakaev','21',1037),(3385,'Gilbert Islands','G',1113),(3386,'Line Islands','L',1113),(3387,'Phoenix Islands','P',1113),(3388,'Anjouan Ndzouani','A',1049),(3389,'Grande Comore Ngazidja','G',1049),(3390,'Moheli Moili','M',1049),(3391,'Kaesong-si','KAE',1114),(3392,'Nampo-si','NAM',1114),(3393,'Pyongyang-ai','PYO',1114),(3394,'Chagang-do','CHA',1114),(3395,'Hamgyongbuk-do','HAB',1114),(3396,'Hamgyongnam-do','HAN',1114),(3397,'Hwanghaebuk-do','HWB',1114),(3398,'Hwanghaenam-do','HWN',1114),(3399,'Kangwon-do','KAN',1114),(3400,'Pyonganbuk-do','PYB',1114),(3401,'Pyongannam-do','PYN',1114),(3402,'Yanggang-do','YAN',1114),(3403,'Najin Sonbong-si','NAJ',1114),(3404,'Seoul Teugbyeolsi','11',1115),(3405,'Busan Gwang\'yeogsi','26',1115),(3406,'Daegu Gwang\'yeogsi','27',1115),(3407,'Daejeon Gwang\'yeogsi','30',1115),(3408,'Gwangju Gwang\'yeogsi','29',1115),(3409,'Incheon Gwang\'yeogsi','28',1115),(3410,'Ulsan Gwang\'yeogsi','31',1115),(3411,'Chungcheongbugdo','43',1115),(3412,'Chungcheongnamdo','44',1115),(3413,'Gang\'weondo','42',1115),(3414,'Gyeonggido','41',1115),(3415,'Gyeongsangbugdo','47',1115),(3416,'Gyeongsangnamdo','48',1115),(3417,'Jejudo','49',1115),(3418,'Jeonrabugdo','45',1115),(3419,'Jeonranamdo','46',1115),(3420,'Al Ahmadi','AH',1116),(3421,'Al Farwanlyah','FA',1116),(3422,'Al Jahrah','JA',1116),(3423,'Al Kuwayt','KU',1116),(3424,'Hawalli','HA',1116),(3425,'Almaty','ALA',1111),(3426,'Astana','AST',1111),(3427,'Almaty oblysy','ALM',1111),(3428,'Aqmola oblysy','AKM',1111),(3429,'Aqtobe oblysy','AKT',1111),(3430,'Atyrau oblyfiy','ATY',1111),(3431,'Batys Quzaqstan oblysy','ZAP',1111),(3432,'Mangghystau oblysy','MAN',1111),(3433,'Ongtustik Quzaqstan oblysy','YUZ',1111),(3434,'Pavlodar oblysy','PAV',1111),(3435,'Qaraghandy oblysy','KAR',1111),(3436,'Qostanay oblysy','KUS',1111),(3437,'Qyzylorda oblysy','KZY',1111),(3438,'Shyghys Quzaqstan oblysy','VOS',1111),(3439,'Soltustik Quzaqstan oblysy','SEV',1111),(3440,'Zhambyl oblysy Zhambylskaya oblast\'','ZHA',1111),(3441,'Vientiane','VT',1118),(3442,'Attapu','AT',1118),(3443,'Bokeo','BK',1118),(3444,'Bolikhamxai','BL',1118),(3445,'Champasak','CH',1118),(3446,'Houaphan','HO',1118),(3447,'Khammouan','KH',1118),(3448,'Louang Namtha','LM',1118),(3449,'Louangphabang','LP',1118),(3450,'Oudomxai','OU',1118),(3451,'Phongsali','PH',1118),(3452,'Salavan','SL',1118),(3453,'Savannakhet','SV',1118),(3454,'Xaignabouli','XA',1118),(3455,'Xiasomboun','XN',1118),(3456,'Xekong','XE',1118),(3457,'Xiangkhoang','XI',1118),(3458,'Beirut','BA',1120),(3459,'Beqaa','BI',1120),(3460,'Mount Lebanon','JL',1120),(3461,'North Lebanon','AS',1120),(3462,'South Lebanon','JA',1120),(3463,'Nabatieh','NA',1120),(3464,'Ampara','52',1199),(3465,'Anuradhapura','71',1199),(3466,'Badulla','81',1199),(3467,'Batticaloa','51',1199),(3468,'Colombo','11',1199),(3469,'Galle','31',1199),(3470,'Gampaha','12',1199),(3471,'Hambantota','33',1199),(3472,'Jaffna','41',1199),(3473,'Kalutara','13',1199),(3474,'Kandy','21',1199),(3475,'Kegalla','92',1199),(3476,'Kilinochchi','42',1199),(3477,'Kurunegala','61',1199),(3478,'Mannar','43',1199),(3479,'Matale','22',1199),(3480,'Matara','32',1199),(3481,'Monaragala','82',1199),(3482,'Mullaittivu','45',1199),(3483,'Nuwara Eliya','23',1199),(3484,'Polonnaruwa','72',1199),(3485,'Puttalum','62',1199),(3486,'Ratnapura','91',1199),(3487,'Trincomalee','53',1199),(3488,'VavunLya','44',1199),(3489,'Bomi','BM',1122),(3490,'Bong','BG',1122),(3491,'Grand Basaa','GB',1122),(3492,'Grand Cape Mount','CM',1122),(3493,'Grand Gedeh','GG',1122),(3494,'Grand Kru','GK',1122),(3495,'Lofa','LO',1122),(3496,'Margibi','MG',1122),(3497,'Maryland','MY',1122),(3498,'Montserrado','MO',1122),(3499,'Nimba','NI',1122),(3500,'Rivercess','RI',1122),(3501,'Sinoe','SI',1122),(3502,'Berea','D',1121),(3503,'Butha-Buthe','B',1121),(3504,'Leribe','C',1121),(3505,'Mafeteng','E',1121),(3506,'Maseru','A',1121),(3507,'Mohale\'s Hoek','F',1121),(3508,'Mokhotlong','J',1121),(3509,'Qacha\'s Nek','H',1121),(3510,'Quthing','G',1121),(3511,'Thaba-Tseka','K',1121),(3512,'Alytaus Apskritis','AL',1125),(3513,'Kauno Apskritis','KU',1125),(3514,'Klaipėdos Apskritis','KL',1125),(3515,'Marijampolės Apskritis','MR',1125),(3516,'Panevėžio Apskritis','PN',1125),(3517,'Šiaulių Apskritis','SA',1125),(3518,'Tauragės Apskritis','TA',1125),(3519,'Telšių Apskritis','TE',1125),(3520,'Utenos Apskritis','UT',1125),(3521,'Vilniaus Apskritis','VL',1125),(3522,'Diekirch','D',1126),(3523,'GreveNmacher','G',1126),(3550,'Daugavpils','DGV',1119),(3551,'Jelgava','JEL',1119),(3552,'Jūrmala','JUR',1119),(3553,'Liepāja','LPX',1119),(3554,'Rēzekne','REZ',1119),(3555,'Rīga','RIX',1119),(3556,'Ventspils','VEN',1119),(3557,'Ajdābiyā','AJ',1123),(3558,'Al Buţnān','BU',1123),(3559,'Al Hizām al Akhdar','HZ',1123),(3560,'Al Jabal al Akhdar','JA',1123),(3561,'Al Jifārah','JI',1123),(3562,'Al Jufrah','JU',1123),(3563,'Al Kufrah','KF',1123),(3564,'Al Marj','MJ',1123),(3565,'Al Marqab','MB',1123),(3566,'Al Qaţrūn','QT',1123),(3567,'Al Qubbah','QB',1123),(3568,'Al Wāhah','WA',1123),(3569,'An Nuqaţ al Khams','NQ',1123),(3570,'Ash Shāţi\'','SH',1123),(3571,'Az Zāwiyah','ZA',1123),(3572,'Banghāzī','BA',1123),(3573,'Banī Walīd','BW',1123),(3574,'Darnah','DR',1123),(3575,'Ghadāmis','GD',1123),(3576,'Gharyān','GR',1123),(3577,'Ghāt','GT',1123),(3578,'Jaghbūb','JB',1123),(3579,'Mişrātah','MI',1123),(3580,'Mizdah','MZ',1123),(3581,'Murzuq','MQ',1123),(3582,'Nālūt','NL',1123),(3583,'Sabhā','SB',1123),(3584,'Şabrātah Şurmān','SS',1123),(3585,'Surt','SR',1123),(3586,'Tājūrā\' wa an Nawāhī al Arbāh','TN',1123),(3587,'Ţarābulus','TB',1123),(3588,'Tarhūnah-Masallātah','TM',1123),(3589,'Wādī al hayāt','WD',1123),(3590,'Yafran-Jādū','YJ',1123),(3591,'Agadir','AGD',1146),(3592,'Aït Baha','BAH',1146),(3593,'Aït Melloul','MEL',1146),(3594,'Al Haouz','HAO',1146),(3595,'Al Hoceïma','HOC',1146),(3596,'Assa-Zag','ASZ',1146),(3597,'Azilal','AZI',1146),(3598,'Beni Mellal','BEM',1146),(3599,'Ben Sllmane','BES',1146),(3600,'Berkane','BER',1146),(3601,'Boujdour','BOD',1146),(3602,'Boulemane','BOM',1146),(3603,'Casablanca [Dar el Beïda]','CAS',1146),(3604,'Chefchaouene','CHE',1146),(3605,'Chichaoua','CHI',1146),(3606,'El Hajeb','HAJ',1146),(3607,'El Jadida','JDI',1146),(3608,'Errachidia','ERR',1146),(3609,'Essaouira','ESI',1146),(3610,'Es Smara','ESM',1146),(3611,'Fès','FES',1146),(3612,'Figuig','FIG',1146),(3613,'Guelmim','GUE',1146),(3614,'Ifrane','IFR',1146),(3615,'Jerada','JRA',1146),(3616,'Kelaat Sraghna','KES',1146),(3617,'Kénitra','KEN',1146),(3618,'Khemisaet','KHE',1146),(3619,'Khenifra','KHN',1146),(3620,'Khouribga','KHO',1146),(3621,'Laâyoune (EH)','LAA',1146),(3622,'Larache','LAP',1146),(3623,'Marrakech','MAR',1146),(3624,'Meknsès','MEK',1146),(3625,'Nador','NAD',1146),(3626,'Ouarzazate','OUA',1146),(3627,'Oued ed Dahab (EH)','OUD',1146),(3628,'Oujda','OUJ',1146),(3629,'Rabat-Salé','RBA',1146),(3630,'Safi','SAF',1146),(3631,'Sefrou','SEF',1146),(3632,'Settat','SET',1146),(3633,'Sidl Kacem','SIK',1146),(3634,'Tanger','TNG',1146),(3635,'Tan-Tan','TNT',1146),(3636,'Taounate','TAO',1146),(3637,'Taroudannt','TAR',1146),(3638,'Tata','TAT',1146),(3639,'Taza','TAZ',1146),(3640,'Tétouan','TET',1146),(3641,'Tiznit','TIZ',1146),(3642,'Gagauzia, Unitate Teritoriala Autonoma','GA',1142),(3643,'Chisinau','CU',1142),(3644,'Stinga Nistrului, unitatea teritoriala din','SN',1142),(3645,'Balti','BA',1142),(3646,'Cahul','CA',1142),(3647,'Edinet','ED',1142),(3648,'Lapusna','LA',1142),(3649,'Orhei','OR',1142),(3650,'Soroca','SO',1142),(3651,'Taraclia','TA',1142),(3652,'Tighina [Bender]','TI',1142),(3653,'Ungheni','UN',1142),(3654,'Antananarivo','T',1129),(3655,'Antsiranana','D',1129),(3656,'Fianarantsoa','F',1129),(3657,'Mahajanga','M',1129),(3658,'Toamasina','A',1129),(3659,'Toliara','U',1129),(3660,'Ailinglapalap','ALL',1135),(3661,'Ailuk','ALK',1135),(3662,'Arno','ARN',1135),(3663,'Aur','AUR',1135),(3664,'Ebon','EBO',1135),(3665,'Eniwetok','ENI',1135),(3666,'Jaluit','JAL',1135),(3667,'Kili','KIL',1135),(3668,'Kwajalein','KWA',1135),(3669,'Lae','LAE',1135),(3670,'Lib','LIB',1135),(3671,'Likiep','LIK',1135),(3672,'Majuro','MAJ',1135),(3673,'Maloelap','MAL',1135),(3674,'Mejit','MEJ',1135),(3675,'Mili','MIL',1135),(3676,'Namorik','NMK',1135),(3677,'Namu','NMU',1135),(3678,'Rongelap','RON',1135),(3679,'Ujae','UJA',1135),(3680,'Ujelang','UJL',1135),(3681,'Utirik','UTI',1135),(3682,'Wotho','WTN',1135),(3683,'Wotje','WTJ',1135),(3684,'Bamako','BK0',1133),(3685,'Gao','7',1133),(3686,'Kayes','1',1133),(3687,'Kidal','8',1133),(3688,'Xoulikoro','2',1133),(3689,'Mopti','5',1133),(3690,'S69ou','4',1133),(3691,'Sikasso','3',1133),(3692,'Tombouctou','6',1133),(3693,'Ayeyarwady','07',1035),(3694,'Bago','02',1035),(3695,'Magway','03',1035),(3696,'Mandalay','04',1035),(3697,'Sagaing','01',1035),(3698,'Tanintharyi','05',1035),(3699,'Yangon','06',1035),(3700,'Chin','14',1035),(3701,'Kachin','11',1035),(3702,'Kayah','12',1035),(3703,'Kayin','13',1035),(3704,'Mon','15',1035),(3705,'Rakhine','16',1035),(3706,'Shan','17',1035),(3707,'Ulaanbaatar','1',1144),(3708,'Arhangay','073',1144),(3709,'Bayanhongor','069',1144),(3710,'Bayan-Olgiy','071',1144),(3711,'Bulgan','067',1144),(3712,'Darhan uul','037',1144),(3713,'Dornod','061',1144),(3714,'Dornogov,','063',1144),(3715,'DundgovL','059',1144),(3716,'Dzavhan','057',1144),(3717,'Govi-Altay','065',1144),(3718,'Govi-Smber','064',1144),(3719,'Hentiy','039',1144),(3720,'Hovd','043',1144),(3721,'Hovsgol','041',1144),(3722,'Omnogovi','053',1144),(3723,'Orhon','035',1144),(3724,'Ovorhangay','055',1144),(3725,'Selenge','049',1144),(3726,'Shbaatar','051',1144),(3727,'Tov','047',1144),(3728,'Uvs','046',1144),(3729,'Nouakchott','NKC',1137),(3730,'Assaba','03',1137),(3731,'Brakna','05',1137),(3732,'Dakhlet Nouadhibou','08',1137),(3733,'Gorgol','04',1137),(3734,'Guidimaka','10',1137),(3735,'Hodh ech Chargui','01',1137),(3736,'Hodh el Charbi','02',1137),(3737,'Inchiri','12',1137),(3738,'Tagant','09',1137),(3739,'Tiris Zemmour','11',1137),(3740,'Trarza','06',1137),(3741,'Beau Bassin-Rose Hill','BR',1138),(3742,'Curepipe','CU',1138),(3743,'Port Louis','PU',1138),(3744,'Quatre Bornes','QB',1138),(3745,'Vacosa-Phoenix','VP',1138),(3746,'Black River','BL',1138),(3747,'Flacq','FL',1138),(3748,'Grand Port','GP',1138),(3749,'Moka','MO',1138),(3750,'Pamplemousses','PA',1138),(3751,'Plaines Wilhems','PW',1138),(3752,'Riviere du Rempart','RP',1138),(3753,'Savanne','SA',1138),(3754,'Agalega Islands','AG',1138),(3755,'Cargados Carajos Shoals','CC',1138),(3756,'Rodrigues Island','RO',1138),(3757,'Male','MLE',1132),(3758,'Alif','02',1132),(3759,'Baa','20',1132),(3760,'Dhaalu','17',1132),(3761,'Faafu','14',1132),(3762,'Gaaf Alif','27',1132),(3763,'Gaefu Dhaalu','28',1132),(3764,'Gnaviyani','29',1132),(3765,'Haa Alif','07',1132),(3766,'Haa Dhaalu','23',1132),(3767,'Kaafu','26',1132),(3768,'Laamu','05',1132),(3769,'Lhaviyani','03',1132),(3770,'Meemu','12',1132),(3771,'Noonu','25',1132),(3772,'Raa','13',1132),(3773,'Seenu','01',1132),(3774,'Shaviyani','24',1132),(3775,'Thaa','08',1132),(3776,'Vaavu','04',1132),(3777,'Balaka','BA',1130),(3778,'Blantyre','BL',1130),(3779,'Chikwawa','CK',1130),(3780,'Chiradzulu','CR',1130),(3781,'Chitipa','CT',1130),(3782,'Dedza','DE',1130),(3783,'Dowa','DO',1130),(3784,'Karonga','KR',1130),(3785,'Kasungu','KS',1130),(3786,'Likoma Island','LK',1130),(3787,'Lilongwe','LI',1130),(3788,'Machinga','MH',1130),(3789,'Mangochi','MG',1130),(3790,'Mchinji','MC',1130),(3791,'Mulanje','MU',1130),(3792,'Mwanza','MW',1130),(3793,'Mzimba','MZ',1130),(3794,'Nkhata Bay','NB',1130),(3795,'Nkhotakota','NK',1130),(3796,'Nsanje','NS',1130),(3797,'Ntcheu','NU',1130),(3798,'Ntchisi','NI',1130),(3799,'Phalomba','PH',1130),(3800,'Rumphi','RU',1130),(3801,'Salima','SA',1130),(3802,'Thyolo','TH',1130),(3803,'Zomba','ZO',1130),(3804,'Aguascalientes','AGU',1140),(3805,'Baja California','BCN',1140),(3806,'Baja California Sur','BCS',1140),(3807,'Campeche','CAM',1140),(3808,'Coahuila','COA',1140),(3809,'Colima','COL',1140),(3810,'Chiapas','CHP',1140),(3811,'Chihuahua','CHH',1140),(3812,'Durango','DUR',1140),(3813,'Guanajuato','GUA',1140),(3814,'Guerrero','GRO',1140),(3815,'Hidalgo','HID',1140),(3816,'Jalisco','JAL',1140),(3817,'Mexico','MEX',1140),(3818,'Michoacin','MIC',1140),(3819,'Morelos','MOR',1140),(3820,'Nayarit','NAY',1140),(3821,'Nuevo Leon','NLE',1140),(3822,'Oaxaca','OAX',1140),(3823,'Puebla','PUE',1140),(3824,'Queretaro','QUE',1140),(3825,'Quintana Roo','ROO',1140),(3826,'San Luis Potosi','SLP',1140),(3827,'Sinaloa','SIN',1140),(3828,'Sonora','SON',1140),(3829,'Tabasco','TAB',1140),(3830,'Tamaulipas','TAM',1140),(3831,'Tlaxcala','TLA',1140),(3832,'Veracruz','VER',1140),(3833,'Yucatan','YUC',1140),(3834,'Zacatecas','ZAC',1140),(3835,'Wilayah Persekutuan Kuala Lumpur','14',1131),(3836,'Wilayah Persekutuan Labuan','15',1131),(3837,'Wilayah Persekutuan Putrajaya','16',1131),(3838,'Johor','01',1131),(3839,'Kedah','02',1131),(3840,'Kelantan','03',1131),(3841,'Melaka','04',1131),(3842,'Negeri Sembilan','05',1131),(3843,'Pahang','06',1131),(3844,'Perak','08',1131),(3845,'Perlis','09',1131),(3846,'Pulau Pinang','07',1131),(3847,'Sabah','12',1131),(3848,'Sarawak','13',1131),(3849,'Selangor','10',1131),(3850,'Terengganu','11',1131),(3851,'Maputo','MPM',1147),(3852,'Cabo Delgado','P',1147),(3853,'Gaza','G',1147),(3854,'Inhambane','I',1147),(3855,'Manica','B',1147),(3856,'Numpula','N',1147),(3857,'Niaaea','A',1147),(3858,'Sofala','S',1147),(3859,'Tete','T',1147),(3860,'Zambezia','Q',1147),(3861,'Caprivi','CA',1148),(3862,'Erongo','ER',1148),(3863,'Hardap','HA',1148),(3864,'Karas','KA',1148),(3865,'Khomas','KH',1148),(3866,'Kunene','KU',1148),(3867,'Ohangwena','OW',1148),(3868,'Okavango','OK',1148),(3869,'Omaheke','OH',1148),(3870,'Omusati','OS',1148),(3871,'Oshana','ON',1148),(3872,'Oshikoto','OT',1148),(3873,'Otjozondjupa','OD',1148),(3874,'Niamey','8',1156),(3875,'Agadez','1',1156),(3876,'Diffa','2',1156),(3877,'Dosso','3',1156),(3878,'Maradi','4',1156),(3879,'Tahoua','S',1156),(3880,'Tillaberi','6',1156),(3881,'Zinder','7',1156),(3882,'Abuja Federal Capital Territory','FC',1157),(3883,'Abia','AB',1157),(3884,'Adamawa','AD',1157),(3885,'Akwa Ibom','AK',1157),(3886,'Anambra','AN',1157),(3887,'Bauchi','BA',1157),(3888,'Bayelsa','BY',1157),(3889,'Benue','BE',1157),(3890,'Borno','BO',1157),(3891,'Cross River','CR',1157),(3892,'Delta','DE',1157),(3893,'Ebonyi','EB',1157),(3894,'Edo','ED',1157),(3895,'Ekiti','EK',1157),(3896,'Enugu','EN',1157),(3897,'Gombe','GO',1157),(3898,'Imo','IM',1157),(3899,'Jigawa','JI',1157),(3900,'Kaduna','KD',1157),(3901,'Kano','KN',1157),(3902,'Katsina','KT',1157),(3903,'Kebbi','KE',1157),(3904,'Kogi','KO',1157),(3905,'Kwara','KW',1157),(3906,'Lagos','LA',1157),(3907,'Nassarawa','NA',1157),(3908,'Niger','NI',1157),(3909,'Ogun','OG',1157),(3910,'Ondo','ON',1157),(3911,'Osun','OS',1157),(3912,'Oyo','OY',1157),(3913,'Rivers','RI',1157),(3914,'Sokoto','SO',1157),(3915,'Taraba','TA',1157),(3916,'Yobe','YO',1157),(3917,'Zamfara','ZA',1157),(3918,'Boaco','BO',1155),(3919,'Carazo','CA',1155),(3920,'Chinandega','CI',1155),(3921,'Chontales','CO',1155),(3922,'Esteli','ES',1155),(3923,'Jinotega','JI',1155),(3924,'Leon','LE',1155),(3925,'Madriz','MD',1155),(3926,'Managua','MN',1155),(3927,'Masaya','MS',1155),(3928,'Matagalpa','MT',1155),(3929,'Nueva Segovia','NS',1155),(3930,'Rio San Juan','SJ',1155),(3931,'Rivas','RI',1155),(3932,'Atlantico Norte','AN',1155),(3933,'Atlantico Sur','AS',1155),(3934,'Drente','DR',1152),(3935,'Flevoland','FL',1152),(3936,'Friesland','FR',1152),(3937,'Gelderland','GL',1152),(3938,'Groningen','GR',1152),(3939,'Noord-Brabant','NB',1152),(3940,'Noord-Holland','NH',1152),(3941,'Overijssel','OV',1152),(3942,'Utrecht','UT',1152),(3943,'Zuid-Holland','ZH',1152),(3944,'Zeeland','ZL',1152),(3945,'Akershus','02',1161),(3946,'Aust-Agder','09',1161),(3947,'Buskerud','06',1161),(3948,'Finnmark','20',1161),(3949,'Hedmark','04',1161),(3950,'Hordaland','12',1161),(3951,'Møre og Romsdal','15',1161),(3952,'Nordland','18',1161),(3953,'Nord-Trøndelag','17',1161),(3954,'Oppland','05',1161),(3955,'Oslo','03',1161),(3956,'Rogaland','11',1161),(3957,'Sogn og Fjordane','14',1161),(3958,'Sør-Trøndelag','16',1161),(3959,'Telemark','06',1161),(3960,'Troms','19',1161),(3961,'Vest-Agder','10',1161),(3962,'Vestfold','07',1161),(3963,'Østfold','01',1161),(3964,'Jan Mayen','22',1161),(3965,'Svalbard','21',1161),(3966,'Auckland','AUK',1154),(3967,'Bay of Plenty','BOP',1154),(3968,'Canterbury','CAN',1154),(3969,'Gisborne','GIS',1154),(3970,'Hawkes Bay','HKB',1154),(3971,'Manawatu-Wanganui','MWT',1154),(3972,'Marlborough','MBH',1154),(3973,'Nelson','NSN',1154),(3974,'Northland','NTL',1154),(3975,'Otago','OTA',1154),(3976,'Southland','STL',1154),(3977,'Taranaki','TKI',1154),(3978,'Tasman','TAS',1154),(3979,'Waikato','WKO',1154),(3980,'Wellington','WGN',1154),(3981,'West Coast','WTC',1154),(3982,'Ad Dakhillyah','DA',1162),(3983,'Al Batinah','BA',1162),(3984,'Al Janblyah','JA',1162),(3985,'Al Wusta','WU',1162),(3986,'Ash Sharqlyah','SH',1162),(3987,'Az Zahirah','ZA',1162),(3988,'Masqat','MA',1162),(3989,'Musandam','MU',1162),(3990,'Bocas del Toro','1',1166),(3991,'Cocle','2',1166),(3992,'Chiriqui','4',1166),(3993,'Darien','5',1166),(3994,'Herrera','6',1166),(3995,'Loa Santoa','7',1166),(3996,'Panama','8',1166),(3997,'Veraguas','9',1166),(3998,'Comarca de San Blas','Q',1166),(3999,'El Callao','CAL',1169),(4000,'Ancash','ANC',1169),(4001,'Apurimac','APU',1169),(4002,'Arequipa','ARE',1169),(4003,'Ayacucho','AYA',1169),(4004,'Cajamarca','CAJ',1169),(4005,'Cuzco','CUS',1169),(4006,'Huancavelica','HUV',1169),(4007,'Huanuco','HUC',1169),(4008,'Ica','ICA',1169),(4009,'Junin','JUN',1169),(4010,'La Libertad','LAL',1169),(4011,'Lambayeque','LAM',1169),(4012,'Lima','LIM',1169),(4013,'Loreto','LOR',1169),(4014,'Madre de Dios','MDD',1169),(4015,'Moquegua','MOQ',1169),(4016,'Pasco','PAS',1169),(4017,'Piura','PIU',1169),(4018,'Puno','PUN',1169),(4019,'San Martin','SAM',1169),(4020,'Tacna','TAC',1169),(4021,'Tumbes','TUM',1169),(4022,'Ucayali','UCA',1169),(4023,'National Capital District (Port Moresby)','NCD',1167),(4024,'Chimbu','CPK',1167),(4025,'Eastern Highlands','EHG',1167),(4026,'East New Britain','EBR',1167),(4027,'East Sepik','ESW',1167),(4028,'Enga','EPW',1167),(4029,'Gulf','GPK',1167),(4030,'Madang','MPM',1167),(4031,'Manus','MRL',1167),(4032,'Milne Bay','MBA',1167),(4033,'Morobe','MPL',1167),(4034,'New Ireland','NIK',1167),(4035,'North Solomons','NSA',1167),(4036,'Santaun','SAN',1167),(4037,'Southern Highlands','SHM',1167),(4038,'Western Highlands','WHM',1167),(4039,'West New Britain','WBK',1167),(4040,'Abra','ABR',1170),(4041,'Agusan del Norte','AGN',1170),(4042,'Agusan del Sur','AGS',1170),(4043,'Aklan','AKL',1170),(4044,'Albay','ALB',1170),(4045,'Antique','ANT',1170),(4046,'Apayao','APA',1170),(4047,'Aurora','AUR',1170),(4048,'Basilan','BAS',1170),(4049,'Bataan','BAN',1170),(4050,'Batanes','BTN',1170),(4051,'Batangas','BTG',1170),(4052,'Benguet','BEN',1170),(4053,'Biliran','BIL',1170),(4054,'Bohol','BOH',1170),(4055,'Bukidnon','BUK',1170),(4056,'Bulacan','BUL',1170),(4057,'Cagayan','CAG',1170),(4058,'Camarines Norte','CAN',1170),(4059,'Camarines Sur','CAS',1170),(4060,'Camiguin','CAM',1170),(4061,'Capiz','CAP',1170),(4062,'Catanduanes','CAT',1170),(4063,'Cavite','CAV',1170),(4064,'Cebu','CEB',1170),(4065,'Compostela Valley','COM',1170),(4066,'Davao','DAV',1170),(4067,'Davao del Sur','DAS',1170),(4068,'Davao Oriental','DAO',1170),(4069,'Eastern Samar','EAS',1170),(4070,'Guimaras','GUI',1170),(4071,'Ifugao','IFU',1170),(4072,'Ilocos Norte','ILN',1170),(4073,'Ilocos Sur','ILS',1170),(4074,'Iloilo','ILI',1170),(4075,'Isabela','ISA',1170),(4076,'Kalinga-Apayso','KAL',1170),(4077,'Laguna','LAG',1170),(4078,'Lanao del Norte','LAN',1170),(4079,'Lanao del Sur','LAS',1170),(4080,'La Union','LUN',1170),(4081,'Leyte','LEY',1170),(4082,'Maguindanao','MAG',1170),(4083,'Marinduque','MAD',1170),(4084,'Masbate','MAS',1170),(4085,'Mindoro Occidental','MDC',1170),(4086,'Mindoro Oriental','MDR',1170),(4087,'Misamis Occidental','MSC',1170),(4088,'Misamis Oriental','MSR',1170),(4089,'Mountain Province','MOU',1170),(4090,'Negroe Occidental','NEC',1170),(4091,'Negros Oriental','NER',1170),(4092,'North Cotabato','NCO',1170),(4093,'Northern Samar','NSA',1170),(4094,'Nueva Ecija','NUE',1170),(4095,'Nueva Vizcaya','NUV',1170),(4096,'Palawan','PLW',1170),(4097,'Pampanga','PAM',1170),(4098,'Pangasinan','PAN',1170),(4099,'Quezon','QUE',1170),(4100,'Quirino','QUI',1170),(4101,'Rizal','RIZ',1170),(4102,'Romblon','ROM',1170),(4103,'Sarangani','SAR',1170),(4104,'Siquijor','SIG',1170),(4105,'Sorsogon','SOR',1170),(4106,'South Cotabato','SCO',1170),(4107,'Southern Leyte','SLE',1170),(4108,'Sultan Kudarat','SUK',1170),(4109,'Sulu','SLU',1170),(4110,'Surigao del Norte','SUN',1170),(4111,'Surigao del Sur','SUR',1170),(4112,'Tarlac','TAR',1170),(4113,'Tawi-Tawi','TAW',1170),(4114,'Western Samar','WSA',1170),(4115,'Zambales','ZMB',1170),(4116,'Zamboanga del Norte','ZAN',1170),(4117,'Zamboanga del Sur','ZAS',1170),(4118,'Zamboanga Sibiguey','ZSI',1170),(4119,'Islamabad Federal Capital Area','IS',1163),(4120,'Baluchistan','BA',1163),(4121,'Khyber Pakhtun Khawa','NW',1163),(4122,'Sindh','SD',1163),(4123,'Federally Administered Tribal Areas','TA',1163),(4124,'Azad Kashmir','JK',1163),(4125,'Gilgit-Baltistan','NA',1163),(4126,'Aveiro','01',1173),(4127,'Beja','02',1173),(4128,'Braga','03',1173),(4129,'Bragança','04',1173),(4130,'Castelo Branco','05',1173),(4131,'Coimbra','06',1173),(4132,'Évora','07',1173),(4133,'Faro','08',1173),(4134,'Guarda','09',1173),(4135,'Leiria','10',1173),(4136,'Lisboa','11',1173),(4137,'Portalegre','12',1173),(4138,'Porto','13',1173),(4139,'Santarém','14',1173),(4140,'Setúbal','15',1173),(4141,'Viana do Castelo','16',1173),(4142,'Vila Real','17',1173),(4143,'Viseu','18',1173),(4144,'Região Autónoma dos Açores','20',1173),(4145,'Região Autónoma da Madeira','30',1173),(4146,'Asuncion','ASU',1168),(4147,'Alto Paraguay','16',1168),(4148,'Alto Parana','10',1168),(4149,'Amambay','13',1168),(4150,'Boqueron','19',1168),(4151,'Caeguazu','5',1168),(4152,'Caazapl','6',1168),(4153,'Canindeyu','14',1168),(4154,'Concepcion','1',1168),(4155,'Cordillera','3',1168),(4156,'Guaira','4',1168),(4157,'Itapua','7',1168),(4158,'Miaiones','8',1168),(4159,'Neembucu','12',1168),(4160,'Paraguari','9',1168),(4161,'Presidente Hayes','15',1168),(4162,'San Pedro','2',1168),(4163,'Ad Dawhah','DA',1175),(4164,'Al Ghuwayriyah','GH',1175),(4165,'Al Jumayliyah','JU',1175),(4166,'Al Khawr','KH',1175),(4167,'Al Wakrah','WA',1175),(4168,'Ar Rayyan','RA',1175),(4169,'Jariyan al Batnah','JB',1175),(4170,'Madinat ash Shamal','MS',1175),(4171,'Umm Salal','US',1175),(4172,'Bucuresti','B',1176),(4173,'Alba','AB',1176),(4174,'Arad','AR',1176),(4175,'Argeș','AG',1176),(4176,'Bacău','BC',1176),(4177,'Bihor','BH',1176),(4178,'Bistrița-Năsăud','BN',1176),(4179,'Botoșani','BT',1176),(4180,'Brașov','BV',1176),(4181,'Brăila','BR',1176),(4182,'Buzău','BZ',1176),(4183,'Caraș-Severin','CS',1176),(4184,'Călărași','CL',1176),(4185,'Cluj','CJ',1176),(4186,'Constanța','CT',1176),(4187,'Covasna','CV',1176),(4188,'Dâmbovița','DB',1176),(4189,'Dolj','DJ',1176),(4190,'Galați','GL',1176),(4191,'Giurgiu','GR',1176),(4192,'Gorj','GJ',1176),(4193,'Harghita','HR',1176),(4194,'Hunedoara','HD',1176),(4195,'Ialomița','IL',1176),(4196,'Iași','IS',1176),(4197,'Ilfov','IF',1176),(4198,'Maramureș','MM',1176),(4199,'Mehedinți','MH',1176),(4200,'Mureș','MS',1176),(4201,'Neamț','NT',1176),(4202,'Olt','OT',1176),(4203,'Prahova','PH',1176),(4204,'Satu Mare','SM',1176),(4205,'Sălaj','SJ',1176),(4206,'Sibiu','SB',1176),(4207,'Suceava','SV',1176),(4208,'Teleorman','TR',1176),(4209,'Timiș','TM',1176),(4210,'Tulcea','TL',1176),(4211,'Vaslui','VS',1176),(4212,'Vâlcea','VL',1176),(4213,'Vrancea','VN',1176),(4214,'Adygeya, Respublika','AD',1177),(4215,'Altay, Respublika','AL',1177),(4216,'Bashkortostan, Respublika','BA',1177),(4217,'Buryatiya, Respublika','BU',1177),(4218,'Chechenskaya Respublika','CE',1177),(4219,'Chuvashskaya Respublika','CU',1177),(4220,'Dagestan, Respublika','DA',1177),(4221,'Ingushskaya Respublika','IN',1177),(4222,'Kabardino-Balkarskaya','KB',1177),(4223,'Kalmykiya, Respublika','KL',1177),(4224,'Karachayevo-Cherkesskaya Respublika','KC',1177),(4225,'Kareliya, Respublika','KR',1177),(4226,'Khakasiya, Respublika','KK',1177),(4227,'Komi, Respublika','KO',1177),(4228,'Mariy El, Respublika','ME',1177),(4229,'Mordoviya, Respublika','MO',1177),(4230,'Sakha, Respublika [Yakutiya]','SA',1177),(4231,'Severnaya Osetiya, Respublika','SE',1177),(4232,'Tatarstan, Respublika','TA',1177),(4233,'Tyva, Respublika [Tuva]','TY',1177),(4234,'Udmurtskaya Respublika','UD',1177),(4235,'Altayskiy kray','ALT',1177),(4236,'Khabarovskiy kray','KHA',1177),(4237,'Krasnodarskiy kray','KDA',1177),(4238,'Krasnoyarskiy kray','KYA',1177),(4239,'Primorskiy kray','PRI',1177),(4240,'Stavropol\'skiy kray','STA',1177),(4241,'Amurskaya oblast\'','AMU',1177),(4242,'Arkhangel\'skaya oblast\'','ARK',1177),(4243,'Astrakhanskaya oblast\'','AST',1177),(4244,'Belgorodskaya oblast\'','BEL',1177),(4245,'Bryanskaya oblast\'','BRY',1177),(4246,'Chelyabinskaya oblast\'','CHE',1177),(4247,'Zabaykalsky Krai\'','ZSK',1177),(4248,'Irkutskaya oblast\'','IRK',1177),(4249,'Ivanovskaya oblast\'','IVA',1177),(4250,'Kaliningradskaya oblast\'','KGD',1177),(4251,'Kaluzhskaya oblast\'','KLU',1177),(4252,'Kamchatka Krai\'','KAM',1177),(4253,'Kemerovskaya oblast\'','KEM',1177),(4254,'Kirovskaya oblast\'','KIR',1177),(4255,'Kostromskaya oblast\'','KOS',1177),(4256,'Kurganskaya oblast\'','KGN',1177),(4257,'Kurskaya oblast\'','KRS',1177),(4258,'Leningradskaya oblast\'','LEN',1177),(4259,'Lipetskaya oblast\'','LIP',1177),(4260,'Magadanskaya oblast\'','MAG',1177),(4261,'Moskovskaya oblast\'','MOS',1177),(4262,'Murmanskaya oblast\'','MUR',1177),(4263,'Nizhegorodskaya oblast\'','NIZ',1177),(4264,'Novgorodskaya oblast\'','NGR',1177),(4265,'Novosibirskaya oblast\'','NVS',1177),(4266,'Omskaya oblast\'','OMS',1177),(4267,'Orenburgskaya oblast\'','ORE',1177),(4268,'Orlovskaya oblast\'','ORL',1177),(4269,'Penzenskaya oblast\'','PNZ',1177),(4270,'Perm krai\'','PEK',1177),(4271,'Pskovskaya oblast\'','PSK',1177),(4272,'Rostovskaya oblast\'','ROS',1177),(4273,'Ryazanskaya oblast\'','RYA',1177),(4274,'Sakhalinskaya oblast\'','SAK',1177),(4275,'Samarskaya oblast\'','SAM',1177),(4276,'Saratovskaya oblast\'','SAR',1177),(4277,'Smolenskaya oblast\'','SMO',1177),(4278,'Sverdlovskaya oblast\'','SVE',1177),(4279,'Tambovskaya oblast\'','TAM',1177),(4280,'Tomskaya oblast\'','TOM',1177),(4281,'Tul\'skaya oblast\'','TUL',1177),(4282,'Tverskaya oblast\'','TVE',1177),(4283,'Tyumenskaya oblast\'','TYU',1177),(4284,'Ul\'yanovskaya oblast\'','ULY',1177),(4285,'Vladimirskaya oblast\'','VLA',1177),(4286,'Volgogradskaya oblast\'','VGG',1177),(4287,'Vologodskaya oblast\'','VLG',1177),(4288,'Voronezhskaya oblast\'','VOR',1177),(4289,'Yaroslavskaya oblast\'','YAR',1177),(4290,'Moskva','MOW',1177),(4291,'Sankt-Peterburg','SPE',1177),(4292,'Yevreyskaya avtonomnaya oblast\'','YEV',1177),(4294,'Chukotskiy avtonomnyy okrug','CHU',1177),(4296,'Khanty-Mansiyskiy avtonomnyy okrug','KHM',1177),(4299,'Nenetskiy avtonomnyy okrug','NEN',1177),(4302,'Yamalo-Nenetskiy avtonomnyy okrug','YAN',1177),(4303,'Butare','C',1178),(4304,'Byumba','I',1178),(4305,'Cyangugu','E',1178),(4306,'Gikongoro','D',1178),(4307,'Gisenyi','G',1178),(4308,'Gitarama','B',1178),(4309,'Kibungo','J',1178),(4310,'Kibuye','F',1178),(4311,'Kigali-Rural Kigali y\' Icyaro','K',1178),(4312,'Kigali-Ville Kigali Ngari','L',1178),(4313,'Mutara','M',1178),(4314,'Ruhengeri','H',1178),(4315,'Al Bahah','11',1187),(4316,'Al Hudud Ash Shamaliyah','08',1187),(4317,'Al Jawf','12',1187),(4318,'Al Madinah','03',1187),(4319,'Al Qasim','05',1187),(4320,'Ar Riyad','01',1187),(4321,'Asir','14',1187),(4322,'Ha\'il','06',1187),(4323,'Jlzan','09',1187),(4324,'Makkah','02',1187),(4325,'Najran','10',1187),(4326,'Tabuk','07',1187),(4327,'Capital Territory (Honiara)','CT',1194),(4328,'Guadalcanal','GU',1194),(4329,'Isabel','IS',1194),(4330,'Makira','MK',1194),(4331,'Malaita','ML',1194),(4332,'Temotu','TE',1194),(4333,'A\'ali an Nil','23',1200),(4334,'Al Bah al Ahmar','26',1200),(4335,'Al Buhayrat','18',1200),(4336,'Al Jazirah','07',1200),(4337,'Al Khartum','03',1200),(4338,'Al Qadarif','06',1200),(4339,'Al Wahdah','22',1200),(4340,'An Nil','04',1200),(4341,'An Nil al Abyaq','08',1200),(4342,'An Nil al Azraq','24',1200),(4343,'Ash Shamallyah','01',1200),(4344,'Bahr al Jabal','17',1200),(4345,'Gharb al Istiwa\'iyah','16',1200),(4346,'Gharb Ba~r al Ghazal','14',1200),(4347,'Gharb Darfur','12',1200),(4348,'Gharb Kurdufan','10',1200),(4349,'Janub Darfur','11',1200),(4350,'Janub Rurdufan','13',1200),(4351,'Jnqall','20',1200),(4352,'Kassala','05',1200),(4353,'Shamal Batr al Ghazal','15',1200),(4354,'Shamal Darfur','02',1200),(4355,'Shamal Kurdufan','09',1200),(4356,'Sharq al Istiwa\'iyah','19',1200),(4357,'Sinnar','25',1200),(4358,'Warab','21',1200),(4359,'Blekinge län','K',1204),(4360,'Dalarnas län','W',1204),(4361,'Gotlands län','I',1204),(4362,'Gävleborgs län','X',1204),(4363,'Hallands län','N',1204),(4364,'Jämtlands län','Z',1204),(4365,'Jönkopings län','F',1204),(4366,'Kalmar län','H',1204),(4367,'Kronobergs län','G',1204),(4368,'Norrbottens län','BD',1204),(4369,'Skåne län','M',1204),(4370,'Stockholms län','AB',1204),(4371,'Södermanlands län','D',1204),(4372,'Uppsala län','C',1204),(4373,'Värmlands län','S',1204),(4374,'Västerbottens län','AC',1204),(4375,'Västernorrlands län','Y',1204),(4376,'Västmanlands län','U',1204),(4377,'Västra Götalands län','Q',1204),(4378,'Örebro län','T',1204),(4379,'Östergötlands län','E',1204),(4380,'Saint Helena','SH',1180),(4381,'Ascension','AC',1180),(4382,'Tristan da Cunha','TA',1180),(4383,'Ajdovščina','001',1193),(4384,'Beltinci','002',1193),(4385,'Benedikt','148',1193),(4386,'Bistrica ob Sotli','149',1193),(4387,'Bled','003',1193),(4388,'Bloke','150',1193),(4389,'Bohinj','004',1193),(4390,'Borovnica','005',1193),(4391,'Bovec','006',1193),(4392,'Braslovče','151',1193),(4393,'Brda','007',1193),(4394,'Brezovica','008',1193),(4395,'Brežice','009',1193),(4396,'Cankova','152',1193),(4397,'Celje','011',1193),(4398,'Cerklje na Gorenjskem','012',1193),(4399,'Cerknica','013',1193),(4400,'Cerkno','014',1193),(4401,'Cerkvenjak','153',1193),(4402,'Črenšovci','015',1193),(4403,'Črna na Koroškem','016',1193),(4404,'Črnomelj','017',1193),(4405,'Destrnik','018',1193),(4406,'Divača','019',1193),(4407,'Dobje','154',1193),(4408,'Dobrepolje','020',1193),(4409,'Dobrna','155',1193),(4410,'Dobrova-Polhov Gradec','021',1193),(4411,'Dobrovnik','156',1193),(4412,'Dol pri Ljubljani','022',1193),(4413,'Dolenjske Toplice','157',1193),(4414,'Domžale','023',1193),(4415,'Dornava','024',1193),(4416,'Dravograd','025',1193),(4417,'Duplek','026',1193),(4418,'Gorenja vas-Poljane','027',1193),(4419,'Gorišnica','028',1193),(4420,'Gornja Radgona','029',1193),(4421,'Gornji Grad','030',1193),(4422,'Gornji Petrovci','031',1193),(4423,'Grad','158',1193),(4424,'Grosuplje','032',1193),(4425,'Hajdina','159',1193),(4426,'Hoče-Slivnica','160',1193),(4427,'Hodoš','161',1193),(4428,'Horjul','162',1193),(4429,'Hrastnik','034',1193),(4430,'Hrpelje-Kozina','035',1193),(4431,'Idrija','036',1193),(4432,'Ig','037',1193),(4433,'Ilirska Bistrica','038',1193),(4434,'Ivančna Gorica','039',1193),(4435,'Izola','040',1193),(4436,'Jesenice','041',1193),(4437,'Jezersko','163',1193),(4438,'Juršinci','042',1193),(4439,'Kamnik','043',1193),(4440,'Kanal','044',1193),(4441,'Kidričevo','045',1193),(4442,'Kobarid','046',1193),(4443,'Kobilje','047',1193),(4444,'Kočevje','048',1193),(4445,'Komen','049',1193),(4446,'Komenda','164',1193),(4447,'Koper','050',1193),(4448,'Kostel','165',1193),(4449,'Kozje','051',1193),(4450,'Kranj','052',1193),(4451,'Kranjska Gora','053',1193),(4452,'Križevci','166',1193),(4453,'Krško','054',1193),(4454,'Kungota','055',1193),(4455,'Kuzma','056',1193),(4456,'Laško','057',1193),(4457,'Lenart','058',1193),(4458,'Lendava','059',1193),(4459,'Litija','060',1193),(4460,'Ljubljana','061',1193),(4461,'Ljubno','062',1193),(4462,'Ljutomer','063',1193),(4463,'Logatec','064',1193),(4464,'Loška dolina','065',1193),(4465,'Loški Potok','066',1193),(4466,'Lovrenc na Pohorju','167',1193),(4467,'Luče','067',1193),(4468,'Lukovica','068',1193),(4469,'Majšperk','069',1193),(4470,'Maribor','070',1193),(4471,'Markovci','168',1193),(4472,'Medvode','071',1193),(4473,'Mengeš','072',1193),(4474,'Metlika','073',1193),(4475,'Mežica','074',1193),(4476,'Miklavž na Dravskem polju','169',1193),(4477,'Miren-Kostanjevica','075',1193),(4478,'Mirna Peč','170',1193),(4479,'Mislinja','076',1193),(4480,'Moravče','077',1193),(4481,'Moravske Toplice','078',1193),(4482,'Mozirje','079',1193),(4483,'Murska Sobota','080',1193),(4484,'Muta','081',1193),(4485,'Naklo','082',1193),(4486,'Nazarje','083',1193),(4487,'Nova Gorica','084',1193),(4488,'Novo mesto','085',1193),(4489,'Sveta Ana','181',1193),(4490,'Sveti Andraž v Slovenskih goricah','182',1193),(4491,'Sveti Jurij','116',1193),(4492,'Šalovci','033',1193),(4493,'Šempeter-Vrtojba','183',1193),(4494,'Šenčur','117',1193),(4495,'Šentilj','118',1193),(4496,'Šentjernej','119',1193),(4497,'Šentjur','120',1193),(4498,'Škocjan','121',1193),(4499,'Škofja Loka','122',1193),(4500,'Škofljica','123',1193),(4501,'Šmarje pri Jelšah','124',1193),(4502,'Šmartno ob Paki','125',1193),(4503,'Šmartno pri Litiji','194',1193),(4504,'Šoštanj','126',1193),(4505,'Štore','127',1193),(4506,'Tabor','184',1193),(4507,'Tišina','010',1193),(4508,'Tolmin','128',1193),(4509,'Trbovlje','129',1193),(4510,'Trebnje','130',1193),(4511,'Trnovska vas','185',1193),(4512,'Tržič','131',1193),(4513,'Trzin','186',1193),(4514,'Turnišče','132',1193),(4515,'Velenje','133',1193),(4516,'Velika Polana','187',1193),(4517,'Velike Lašče','134',1193),(4518,'Veržej','188',1193),(4519,'Videm','135',1193),(4520,'Vipava','136',1193),(4521,'Vitanje','137',1193),(4522,'Vojnik','138',1193),(4523,'Vransko','189',1193),(4524,'Vrhnika','140',1193),(4525,'Vuzenica','141',1193),(4526,'Zagorje ob Savi','142',1193),(4527,'Zavrč','143',1193),(4528,'Zreče','144',1193),(4529,'Žalec','190',1193),(4530,'Železniki','146',1193),(4531,'Žetale','191',1193),(4532,'Žiri','147',1193),(4533,'Žirovnica','192',1193),(4534,'Žužemberk','193',1193),(4535,'Banskobystrický kraj','BC',1192),(4536,'Bratislavský kraj','BL',1192),(4537,'Košický kraj','KI',1192),(4538,'Nitriansky kraj','NJ',1192),(4539,'Prešovský kraj','PV',1192),(4540,'Trenčiansky kraj','TC',1192),(4541,'Trnavský kraj','TA',1192),(4542,'Žilinský kraj','ZI',1192),(4543,'Western Area (Freetown)','W',1190),(4544,'Dakar','DK',1188),(4545,'Diourbel','DB',1188),(4546,'Fatick','FK',1188),(4547,'Kaolack','KL',1188),(4548,'Kolda','KD',1188),(4549,'Louga','LG',1188),(4550,'Matam','MT',1188),(4551,'Saint-Louis','SL',1188),(4552,'Tambacounda','TC',1188),(4553,'Thies','TH',1188),(4554,'Ziguinchor','ZG',1188),(4555,'Awdal','AW',1195),(4556,'Bakool','BK',1195),(4557,'Banaadir','BN',1195),(4558,'Bay','BY',1195),(4559,'Galguduud','GA',1195),(4560,'Gedo','GE',1195),(4561,'Hiirsan','HI',1195),(4562,'Jubbada Dhexe','JD',1195),(4563,'Jubbada Hoose','JH',1195),(4564,'Mudug','MU',1195),(4565,'Nugaal','NU',1195),(4566,'Saneag','SA',1195),(4567,'Shabeellaha Dhexe','SD',1195),(4568,'Shabeellaha Hoose','SH',1195),(4569,'Sool','SO',1195),(4570,'Togdheer','TO',1195),(4571,'Woqooyi Galbeed','WO',1195),(4572,'Brokopondo','BR',1201),(4573,'Commewijne','CM',1201),(4574,'Coronie','CR',1201),(4575,'Marowijne','MA',1201),(4576,'Nickerie','NI',1201),(4577,'Paramaribo','PM',1201),(4578,'Saramacca','SA',1201),(4579,'Sipaliwini','SI',1201),(4580,'Wanica','WA',1201),(4581,'Principe','P',1207),(4582,'Sao Tome','S',1207),(4583,'Ahuachapan','AH',1066),(4584,'Cabanas','CA',1066),(4585,'Cuscatlan','CU',1066),(4586,'Chalatenango','CH',1066),(4587,'Morazan','MO',1066),(4588,'San Miguel','SM',1066),(4589,'San Salvador','SS',1066),(4590,'Santa Ana','SA',1066),(4591,'San Vicente','SV',1066),(4592,'Sonsonate','SO',1066),(4593,'Usulutan','US',1066),(4594,'Al Hasakah','HA',1206),(4595,'Al Ladhiqiyah','LA',1206),(4596,'Al Qunaytirah','QU',1206),(4597,'Ar Raqqah','RA',1206),(4598,'As Suwayda\'','SU',1206),(4599,'Dar\'a','DR',1206),(4600,'Dayr az Zawr','DY',1206),(4601,'Dimashq','DI',1206),(4602,'Halab','HL',1206),(4603,'Hamah','HM',1206),(4604,'Jim\'','HI',1206),(4605,'Idlib','ID',1206),(4606,'Rif Dimashq','RD',1206),(4607,'Tarts','TA',1206),(4608,'Hhohho','HH',1203),(4609,'Lubombo','LU',1203),(4610,'Manzini','MA',1203),(4611,'Shiselweni','SH',1203),(4612,'Batha','BA',1043),(4613,'Biltine','BI',1043),(4614,'Borkou-Ennedi-Tibesti','BET',1043),(4615,'Chari-Baguirmi','CB',1043),(4616,'Guera','GR',1043),(4617,'Kanem','KA',1043),(4618,'Lac','LC',1043),(4619,'Logone-Occidental','LO',1043),(4620,'Logone-Oriental','LR',1043),(4621,'Mayo-Kebbi','MK',1043),(4622,'Moyen-Chari','MC',1043),(4623,'Ouaddai','OD',1043),(4624,'Salamat','SA',1043),(4625,'Tandjile','TA',1043),(4626,'Kara','K',1214),(4627,'Maritime (Region)','M',1214),(4628,'Savannes','S',1214),(4629,'Krung Thep Maha Nakhon Bangkok','10',1211),(4630,'Phatthaya','S',1211),(4631,'Amnat Charoen','37',1211),(4632,'Ang Thong','15',1211),(4633,'Buri Ram','31',1211),(4634,'Chachoengsao','24',1211),(4635,'Chai Nat','18',1211),(4636,'Chaiyaphum','36',1211),(4637,'Chanthaburi','22',1211),(4638,'Chiang Mai','50',1211),(4639,'Chiang Rai','57',1211),(4640,'Chon Buri','20',1211),(4641,'Chumphon','86',1211),(4642,'Kalasin','46',1211),(4643,'Kamphasng Phet','62',1211),(4644,'Kanchanaburi','71',1211),(4645,'Khon Kaen','40',1211),(4646,'Krabi','81',1211),(4647,'Lampang','52',1211),(4648,'Lamphun','51',1211),(4649,'Loei','42',1211),(4650,'Lop Buri','16',1211),(4651,'Mae Hong Son','58',1211),(4652,'Maha Sarakham','44',1211),(4653,'Mukdahan','49',1211),(4654,'Nakhon Nayok','26',1211),(4655,'Nakhon Pathom','73',1211),(4656,'Nakhon Phanom','48',1211),(4657,'Nakhon Ratchasima','30',1211),(4658,'Nakhon Sawan','60',1211),(4659,'Nakhon Si Thammarat','80',1211),(4660,'Nan','55',1211),(4661,'Narathiwat','96',1211),(4662,'Nong Bua Lam Phu','39',1211),(4663,'Nong Khai','43',1211),(4664,'Nonthaburi','12',1211),(4665,'Pathum Thani','13',1211),(4666,'Pattani','94',1211),(4667,'Phangnga','82',1211),(4668,'Phatthalung','93',1211),(4669,'Phayao','56',1211),(4670,'Phetchabun','67',1211),(4671,'Phetchaburi','76',1211),(4672,'Phichit','66',1211),(4673,'Phitsanulok','65',1211),(4674,'Phrae','54',1211),(4675,'Phra Nakhon Si Ayutthaya','14',1211),(4676,'Phuket','83',1211),(4677,'Prachin Buri','25',1211),(4678,'Prachuap Khiri Khan','77',1211),(4679,'Ranong','85',1211),(4680,'Ratchaburi','70',1211),(4681,'Rayong','21',1211),(4682,'Roi Et','45',1211),(4683,'Sa Kaeo','27',1211),(4684,'Sakon Nakhon','47',1211),(4685,'Samut Prakan','11',1211),(4686,'Samut Sakhon','74',1211),(4687,'Samut Songkhram','75',1211),(4688,'Saraburi','19',1211),(4689,'Satun','91',1211),(4690,'Sing Buri','17',1211),(4691,'Si Sa Ket','33',1211),(4692,'Songkhla','90',1211),(4693,'Sukhothai','64',1211),(4694,'Suphan Buri','72',1211),(4695,'Surat Thani','84',1211),(4696,'Surin','32',1211),(4697,'Tak','63',1211),(4698,'Trang','92',1211),(4699,'Trat','23',1211),(4700,'Ubon Ratchathani','34',1211),(4701,'Udon Thani','41',1211),(4702,'Uthai Thani','61',1211),(4703,'Uttaradit','53',1211),(4704,'Yala','95',1211),(4705,'Yasothon','35',1211),(4706,'Sughd','SU',1209),(4707,'Khatlon','KT',1209),(4708,'Gorno-Badakhshan','GB',1209),(4709,'Ahal','A',1220),(4710,'Balkan','B',1220),(4711,'Dasoguz','D',1220),(4712,'Lebap','L',1220),(4713,'Mary','M',1220),(4714,'Béja','31',1218),(4715,'Ben Arous','13',1218),(4716,'Bizerte','23',1218),(4717,'Gabès','81',1218),(4718,'Gafsa','71',1218),(4719,'Jendouba','32',1218),(4720,'Kairouan','41',1218),(4721,'Rasserine','42',1218),(4722,'Kebili','73',1218),(4723,'L\'Ariana','12',1218),(4724,'Le Ref','33',1218),(4725,'Mahdia','53',1218),(4726,'La Manouba','14',1218),(4727,'Medenine','82',1218),(4728,'Moneatir','52',1218),(4729,'Naboul','21',1218),(4730,'Sfax','61',1218),(4731,'Sidi Bouxid','43',1218),(4732,'Siliana','34',1218),(4733,'Sousse','51',1218),(4734,'Tataouine','83',1218),(4735,'Tozeur','72',1218),(4736,'Tunis','11',1218),(4737,'Zaghouan','22',1218),(4738,'Adana','01',1219),(4739,'Ad yaman','02',1219),(4740,'Afyon','03',1219),(4741,'Ag r','04',1219),(4742,'Aksaray','68',1219),(4743,'Amasya','05',1219),(4744,'Ankara','06',1219),(4745,'Antalya','07',1219),(4746,'Ardahan','75',1219),(4747,'Artvin','08',1219),(4748,'Aydin','09',1219),(4749,'Bal kesir','10',1219),(4750,'Bartin','74',1219),(4751,'Batman','72',1219),(4752,'Bayburt','69',1219),(4753,'Bilecik','11',1219),(4754,'Bingol','12',1219),(4755,'Bitlis','13',1219),(4756,'Bolu','14',1219),(4757,'Burdur','15',1219),(4758,'Bursa','16',1219),(4759,'Canakkale','17',1219),(4760,'Cankir','18',1219),(4761,'Corum','19',1219),(4762,'Denizli','20',1219),(4763,'Diyarbakir','21',1219),(4764,'Duzce','81',1219),(4765,'Edirne','22',1219),(4766,'Elazig','23',1219),(4767,'Erzincan','24',1219),(4768,'Erzurum','25',1219),(4769,'Eskis\'ehir','26',1219),(4770,'Gaziantep','27',1219),(4771,'Giresun','28',1219),(4772,'Gms\'hane','29',1219),(4773,'Hakkari','30',1219),(4774,'Hatay','31',1219),(4775,'Igidir','76',1219),(4776,'Isparta','32',1219),(4777,'Icel','33',1219),(4778,'Istanbul','34',1219),(4779,'Izmir','35',1219),(4780,'Kahramanmaras','46',1219),(4781,'Karabk','78',1219),(4782,'Karaman','70',1219),(4783,'Kars','36',1219),(4784,'Kastamonu','37',1219),(4785,'Kayseri','38',1219),(4786,'Kirikkale','71',1219),(4787,'Kirklareli','39',1219),(4788,'Kirs\'ehir','40',1219),(4789,'Kilis','79',1219),(4790,'Kocaeli','41',1219),(4791,'Konya','42',1219),(4792,'Ktahya','43',1219),(4793,'Malatya','44',1219),(4794,'Manisa','45',1219),(4795,'Mardin','47',1219),(4796,'Mugila','48',1219),(4797,'Mus','49',1219),(4798,'Nevs\'ehir','50',1219),(4799,'Nigide','51',1219),(4800,'Ordu','52',1219),(4801,'Osmaniye','80',1219),(4802,'Rize','53',1219),(4803,'Sakarya','54',1219),(4804,'Samsun','55',1219),(4805,'Siirt','56',1219),(4806,'Sinop','57',1219),(4807,'Sivas','58',1219),(4808,'S\'anliurfa','63',1219),(4809,'S\'rnak','73',1219),(4810,'Tekirdag','59',1219),(4811,'Tokat','60',1219),(4812,'Trabzon','61',1219),(4813,'Tunceli','62',1219),(4814,'Us\'ak','64',1219),(4815,'Van','65',1219),(4816,'Yalova','77',1219),(4817,'Yozgat','66',1219),(4818,'Zonguldak','67',1219),(4819,'Couva-Tabaquite-Talparo','CTT',1217),(4820,'Diego Martin','DMN',1217),(4821,'Eastern Tobago','ETO',1217),(4822,'Penal-Debe','PED',1217),(4823,'Princes Town','PRT',1217),(4824,'Rio Claro-Mayaro','RCM',1217),(4825,'Sangre Grande','SGE',1217),(4826,'San Juan-Laventille','SJL',1217),(4827,'Siparia','SIP',1217),(4828,'Tunapuna-Piarco','TUP',1217),(4829,'Western Tobago','WTO',1217),(4830,'Arima','ARI',1217),(4831,'Chaguanas','CHA',1217),(4832,'Point Fortin','PTF',1217),(4833,'Port of Spain','POS',1217),(4834,'San Fernando','SFO',1217),(4835,'Aileu','AL',1063),(4836,'Ainaro','AN',1063),(4837,'Bacucau','BA',1063),(4838,'Bobonaro','BO',1063),(4839,'Cova Lima','CO',1063),(4840,'Dili','DI',1063),(4841,'Ermera','ER',1063),(4842,'Laulem','LA',1063),(4843,'Liquica','LI',1063),(4844,'Manatuto','MT',1063),(4845,'Manafahi','MF',1063),(4846,'Oecussi','OE',1063),(4847,'Viqueque','VI',1063),(4848,'Changhua County','CHA',1208),(4849,'Chiayi County','CYQ',1208),(4850,'Hsinchu County','HSQ',1208),(4851,'Hualien County','HUA',1208),(4852,'Ilan County','ILA',1208),(4853,'Kaohsiung County','KHQ',1208),(4854,'Miaoli County','MIA',1208),(4855,'Nantou County','NAN',1208),(4856,'Penghu County','PEN',1208),(4857,'Pingtung County','PIF',1208),(4858,'Taichung County','TXQ',1208),(4859,'Tainan County','TNQ',1208),(4860,'Taipei County','TPQ',1208),(4861,'Taitung County','TTT',1208),(4862,'Taoyuan County','TAO',1208),(4863,'Yunlin County','YUN',1208),(4864,'Keelung City','KEE',1208),(4865,'Arusha','01',1210),(4866,'Dar-es-Salaam','02',1210),(4867,'Dodoma','03',1210),(4868,'Iringa','04',1210),(4869,'Kagera','05',1210),(4870,'Kaskazini Pemba','06',1210),(4871,'Kaskazini Unguja','07',1210),(4872,'Xigoma','08',1210),(4873,'Kilimanjaro','09',1210),(4874,'Rusini Pemba','10',1210),(4875,'Kusini Unguja','11',1210),(4876,'Lindi','12',1210),(4877,'Manyara','26',1210),(4878,'Mara','13',1210),(4879,'Mbeya','14',1210),(4880,'Mjini Magharibi','15',1210),(4881,'Morogoro','16',1210),(4882,'Mtwara','17',1210),(4883,'Pwani','19',1210),(4884,'Rukwa','20',1210),(4885,'Ruvuma','21',1210),(4886,'Shinyanga','22',1210),(4887,'Singida','23',1210),(4888,'Tabora','24',1210),(4889,'Tanga','25',1210),(4890,'Cherkas\'ka Oblast\'','71',1224),(4891,'Chernihivs\'ka Oblast\'','74',1224),(4892,'Chernivets\'ka Oblast\'','77',1224),(4893,'Dnipropetrovs\'ka Oblast\'','12',1224),(4894,'Donets\'ka Oblast\'','14',1224),(4895,'Ivano-Frankivs\'ka Oblast\'','26',1224),(4896,'Kharkivs\'ka Oblast\'','63',1224),(4897,'Khersons\'ka Oblast\'','65',1224),(4898,'Khmel\'nyts\'ka Oblast\'','68',1224),(4899,'Kirovohrads\'ka Oblast\'','35',1224),(4900,'Kyivs\'ka Oblast\'','32',1224),(4901,'Luhans\'ka Oblast\'','09',1224),(4902,'L\'vivs\'ka Oblast\'','46',1224),(4903,'Mykolaivs\'ka Oblast\'','48',1224),(4904,'Odes \'ka Oblast\'','51',1224),(4905,'Poltavs\'ka Oblast\'','53',1224),(4906,'Rivnens\'ka Oblast\'','56',1224),(4907,'Sums \'ka Oblast\'','59',1224),(4908,'Ternopil\'s\'ka Oblast\'','61',1224),(4909,'Vinnyts\'ka Oblast\'','05',1224),(4910,'Volyos\'ka Oblast\'','07',1224),(4911,'Zakarpats\'ka Oblast\'','21',1224),(4912,'Zaporiz\'ka Oblast\'','23',1224),(4913,'Zhytomyrs\'ka Oblast\'','18',1224),(4914,'Respublika Krym','43',1224),(4915,'Kyiv','30',1224),(4916,'Sevastopol','40',1224),(4917,'Adjumani','301',1223),(4918,'Apac','302',1223),(4919,'Arua','303',1223),(4920,'Bugiri','201',1223),(4921,'Bundibugyo','401',1223),(4922,'Bushenyi','402',1223),(4923,'Busia','202',1223),(4924,'Gulu','304',1223),(4925,'Hoima','403',1223),(4926,'Iganga','203',1223),(4927,'Jinja','204',1223),(4928,'Kabale','404',1223),(4929,'Kabarole','405',1223),(4930,'Kaberamaido','213',1223),(4931,'Kalangala','101',1223),(4932,'Kampala','102',1223),(4933,'Kamuli','205',1223),(4934,'Kamwenge','413',1223),(4935,'Kanungu','414',1223),(4936,'Kapchorwa','206',1223),(4937,'Kasese','406',1223),(4938,'Katakwi','207',1223),(4939,'Kayunga','112',1223),(4940,'Kibaale','407',1223),(4941,'Kiboga','103',1223),(4942,'Kisoro','408',1223),(4943,'Kitgum','305',1223),(4944,'Kotido','306',1223),(4945,'Kumi','208',1223),(4946,'Kyenjojo','415',1223),(4947,'Lira','307',1223),(4948,'Luwero','104',1223),(4949,'Masaka','105',1223),(4950,'Masindi','409',1223),(4951,'Mayuge','214',1223),(4952,'Mbale','209',1223),(4953,'Mbarara','410',1223),(4954,'Moroto','308',1223),(4955,'Moyo','309',1223),(4956,'Mpigi','106',1223),(4957,'Mubende','107',1223),(4958,'Mukono','108',1223),(4959,'Nakapiripirit','311',1223),(4960,'Nakasongola','109',1223),(4961,'Nebbi','310',1223),(4962,'Ntungamo','411',1223),(4963,'Pader','312',1223),(4964,'Pallisa','210',1223),(4965,'Rakai','110',1223),(4966,'Rukungiri','412',1223),(4967,'Sembabule','111',1223),(4968,'Sironko','215',1223),(4969,'Soroti','211',1223),(4970,'Tororo','212',1223),(4971,'Wakiso','113',1223),(4972,'Yumbe','313',1223),(4973,'Baker Island','81',1227),(4974,'Howland Island','84',1227),(4975,'Jarvis Island','86',1227),(4976,'Johnston Atoll','67',1227),(4977,'Kingman Reef','89',1227),(4978,'Midway Islands','71',1227),(4979,'Navassa Island','76',1227),(4980,'Palmyra Atoll','95',1227),(4981,'Wake Island','79',1227),(4982,'Artigsa','AR',1229),(4983,'Canelones','CA',1229),(4984,'Cerro Largo','CL',1229),(4985,'Colonia','CO',1229),(4986,'Durazno','DU',1229),(4987,'Flores','FS',1229),(4988,'Lavalleja','LA',1229),(4989,'Maldonado','MA',1229),(4990,'Montevideo','MO',1229),(4991,'Paysandu','PA',1229),(4992,'Rivera','RV',1229),(4993,'Rocha','RO',1229),(4994,'Salto','SA',1229),(4995,'Soriano','SO',1229),(4996,'Tacuarembo','TA',1229),(4997,'Treinta y Tres','TT',1229),(4998,'Toshkent (city)','TK',1230),(4999,'Qoraqalpogiston Respublikasi','QR',1230),(5000,'Andijon','AN',1230),(5001,'Buxoro','BU',1230),(5002,'Farg\'ona','FA',1230),(5003,'Jizzax','JI',1230),(5004,'Khorazm','KH',1230),(5005,'Namangan','NG',1230),(5006,'Navoiy','NW',1230),(5007,'Qashqadaryo','QA',1230),(5008,'Samarqand','SA',1230),(5009,'Sirdaryo','SI',1230),(5010,'Surxondaryo','SU',1230),(5011,'Toshkent','TO',1230),(5012,'Xorazm','XO',1230),(5013,'Distrito Federal','A',1232),(5014,'Anzoategui','B',1232),(5015,'Apure','C',1232),(5016,'Aragua','D',1232),(5017,'Barinas','E',1232),(5018,'Carabobo','G',1232),(5019,'Cojedes','H',1232),(5020,'Falcon','I',1232),(5021,'Guarico','J',1232),(5022,'Lara','K',1232),(5023,'Merida','L',1232),(5024,'Miranda','M',1232),(5025,'Monagas','N',1232),(5026,'Nueva Esparta','O',1232),(5027,'Portuguesa','P',1232),(5028,'Tachira','S',1232),(5029,'Trujillo','T',1232),(5030,'Vargas','X',1232),(5031,'Yaracuy','U',1232),(5032,'Zulia','V',1232),(5033,'Delta Amacuro','Y',1232),(5034,'Dependencias Federales','W',1232),(5035,'An Giang','44',1233),(5036,'Ba Ria - Vung Tau','43',1233),(5037,'Bac Can','53',1233),(5038,'Bac Giang','54',1233),(5039,'Bac Lieu','55',1233),(5040,'Bac Ninh','56',1233),(5041,'Ben Tre','50',1233),(5042,'Binh Dinh','31',1233),(5043,'Binh Duong','57',1233),(5044,'Binh Phuoc','58',1233),(5045,'Binh Thuan','40',1233),(5046,'Ca Mau','59',1233),(5047,'Can Tho','48',1233),(5048,'Cao Bang','04',1233),(5049,'Da Nang, thanh pho','60',1233),(5050,'Dong Nai','39',1233),(5051,'Dong Thap','45',1233),(5052,'Gia Lai','30',1233),(5053,'Ha Giang','03',1233),(5054,'Ha Nam','63',1233),(5055,'Ha Noi, thu do','64',1233),(5056,'Ha Tay','15',1233),(5057,'Ha Tinh','23',1233),(5058,'Hai Duong','61',1233),(5059,'Hai Phong, thanh pho','62',1233),(5060,'Hoa Binh','14',1233),(5061,'Ho Chi Minh, thanh pho [Sai Gon]','65',1233),(5062,'Hung Yen','66',1233),(5063,'Khanh Hoa','34',1233),(5064,'Kien Giang','47',1233),(5065,'Kon Tum','28',1233),(5066,'Lai Chau','01',1233),(5067,'Lam Dong','35',1233),(5068,'Lang Son','09',1233),(5069,'Lao Cai','02',1233),(5070,'Long An','41',1233),(5071,'Nam Dinh','67',1233),(5072,'Nghe An','22',1233),(5073,'Ninh Binh','18',1233),(5074,'Ninh Thuan','36',1233),(5075,'Phu Tho','68',1233),(5076,'Phu Yen','32',1233),(5077,'Quang Binh','24',1233),(5078,'Quang Nam','27',1233),(5079,'Quang Ngai','29',1233),(5080,'Quang Ninh','13',1233),(5081,'Quang Tri','25',1233),(5082,'Soc Trang','52',1233),(5083,'Son La','05',1233),(5084,'Tay Ninh','37',1233),(5085,'Thai Binh','20',1233),(5086,'Thai Nguyen','69',1233),(5087,'Thanh Hoa','21',1233),(5088,'Thua Thien-Hue','26',1233),(5089,'Tien Giang','46',1233),(5090,'Tra Vinh','51',1233),(5091,'Tuyen Quang','07',1233),(5092,'Vinh Long','49',1233),(5093,'Vinh Phuc','70',1233),(5094,'Yen Bai','06',1233),(5095,'Malampa','MAP',1231),(5096,'Penama','PAM',1231),(5097,'Sanma','SAM',1231),(5098,'Shefa','SEE',1231),(5099,'Tafea','TAE',1231),(5100,'Torba','TOB',1231),(5101,'A\'ana','AA',1185),(5102,'Aiga-i-le-Tai','AL',1185),(5103,'Atua','AT',1185),(5104,'Fa\'aaaleleaga','FA',1185),(5105,'Gaga\'emauga','GE',1185),(5106,'Gagaifomauga','GI',1185),(5107,'Palauli','PA',1185),(5108,'Satupa\'itea','SA',1185),(5109,'Tuamasaga','TU',1185),(5110,'Va\'a-o-Fonoti','VF',1185),(5111,'Vaisigano','VS',1185),(5112,'Crna Gora','CG',1243),(5113,'Srbija','SR',1242),(5114,'Kosovo-Metohija','KM',1242),(5115,'Vojvodina','VO',1242),(5116,'Abyan','AB',1237),(5117,'Adan','AD',1237),(5118,'Ad Dali','DA',1237),(5119,'Al Bayda\'','BA',1237),(5120,'Al Hudaydah','MU',1237),(5121,'Al Mahrah','MR',1237),(5122,'Al Mahwit','MW',1237),(5123,'Amran','AM',1237),(5124,'Dhamar','DH',1237),(5125,'Hadramawt','HD',1237),(5126,'Hajjah','HJ',1237),(5127,'Ibb','IB',1237),(5128,'Lahij','LA',1237),(5129,'Ma\'rib','MA',1237),(5130,'Sa\'dah','SD',1237),(5131,'San\'a\'','SN',1237),(5132,'Shabwah','SH',1237),(5133,'Ta\'izz','TA',1237),(5134,'Eastern Cape','EC',1196),(5135,'Free State','FS',1196),(5136,'Gauteng','GT',1196),(5137,'Kwazulu-Natal','NL',1196),(5138,'Mpumalanga','MP',1196),(5139,'Northern Cape','NC',1196),(5140,'Limpopo','NP',1196),(5141,'Western Cape','WC',1196),(5142,'Copperbelt','08',1239),(5143,'Luapula','04',1239),(5144,'Lusaka','09',1239),(5145,'North-Western','06',1239),(5146,'Bulawayo','BU',1240),(5147,'Harare','HA',1240),(5148,'Manicaland','MA',1240),(5149,'Mashonaland Central','MC',1240),(5150,'Mashonaland East','ME',1240),(5151,'Mashonaland West','MW',1240),(5152,'Masvingo','MV',1240),(5153,'Matabeleland North','MN',1240),(5154,'Matabeleland South','MS',1240),(5155,'Midlands','MI',1240),(5156,'South Karelia','SK',1075),(5157,'South Ostrobothnia','SO',1075),(5158,'Etelä-Savo','ES',1075),(5159,'Häme','HH',1075),(5160,'Itä-Uusimaa','IU',1075),(5161,'Kainuu','KA',1075),(5162,'Central Ostrobothnia','CO',1075),(5163,'Central Finland','CF',1075),(5164,'Kymenlaakso','KY',1075),(5165,'Lapland','LA',1075),(5166,'Tampere Region','TR',1075),(5167,'Ostrobothnia','OB',1075),(5168,'North Karelia','NK',1075),(5169,'Northern Ostrobothnia','NO',1075),(5170,'Northern Savo','NS',1075),(5171,'Päijät-Häme','PH',1075),(5172,'Satakunta','SK',1075),(5173,'Uusimaa','UM',1075),(5174,'South-West Finland','SW',1075),(5175,'Åland','AL',1075),(5176,'Limburg','LI',1152),(5177,'Central and Western','CW',1098),(5178,'Eastern','EA',1098),(5179,'Southern','SO',1098),(5180,'Wan Chai','WC',1098),(5181,'Kowloon City','KC',1098),(5182,'Kwun Tong','KU',1098),(5183,'Sham Shui Po','SS',1098),(5184,'Wong Tai Sin','WT',1098),(5185,'Yau Tsim Mong','YT',1098),(5186,'Islands','IS',1098),(5187,'Kwai Tsing','KI',1098),(5188,'North','NO',1098),(5189,'Sai Kung','SK',1098),(5190,'Sha Tin','ST',1098),(5191,'Tai Po','TP',1098),(5192,'Tsuen Wan','TW',1098),(5193,'Tuen Mun','TM',1098),(5194,'Yuen Long','YL',1098),(5195,'Manchester','MR',1108),(5196,'Al Manāmah (Al ‘Āşimah)','13',1016),(5197,'Al Janūbīyah','14',1016),(5199,'Al Wusţá','16',1016),(5200,'Ash Shamālīyah','17',1016),(5201,'Jenin','_A',1165),(5202,'Tubas','_B',1165),(5203,'Tulkarm','_C',1165),(5204,'Nablus','_D',1165),(5205,'Qalqilya','_E',1165),(5206,'Salfit','_F',1165),(5207,'Ramallah and Al-Bireh','_G',1165),(5208,'Jericho','_H',1165),(5209,'Jerusalem','_I',1165),(5210,'Bethlehem','_J',1165),(5211,'Hebron','_K',1165),(5212,'North Gaza','_L',1165),(5213,'Gaza','_M',1165),(5214,'Deir el-Balah','_N',1165),(5215,'Khan Yunis','_O',1165),(5216,'Rafah','_P',1165),(5217,'Brussels','BRU',1020),(5218,'Distrito Federal','DIF',1140),(5219,'Taichung City','TXG',1208),(5220,'Kaohsiung City','KHH',1208),(5221,'Taipei City','TPE',1208),(5222,'Chiayi City','CYI',1208),(5223,'Hsinchu City','HSZ',1208),(5224,'Tainan City','TNN',1208),(9000,'North West','NW',1196),(9986,'Tyne and Wear','TWR',1226),(9988,'Greater Manchester','GTM',1226),(9989,'Co Tyrone','TYR',1226),(9990,'West Yorkshire','WYK',1226),(9991,'South Yorkshire','SYK',1226),(9992,'Merseyside','MSY',1226),(9993,'Berkshire','BRK',1226),(9994,'West Midlands','WMD',1226),(9998,'West Glamorgan','WGM',1226),(9999,'London','LON',1226),(10000,'Carbonia-Iglesias','CI',1107),(10001,'Olbia-Tempio','OT',1107),(10002,'Medio Campidano','VS',1107),(10003,'Ogliastra','OG',1107),(10009,'Jura','39',1076),(10010,'Barletta-Andria-Trani','Bar',1107),(10011,'Fermo','Fer',1107),(10012,'Monza e Brianza','Mon',1107),(10013,'Clwyd','CWD',1226),(10015,'South Glamorgan','SGM',1226),(10016,'Artibonite','AR',1094),(10017,'Centre','CE',1094),(10018,'Nippes','NI',1094),(10019,'Nord','ND',1094),(10020,'La Rioja','F',1010),(10021,'Andorra la Vella','07',1005),(10022,'Canillo','02',1005),(10023,'Encamp','03',1005),(10024,'Escaldes-Engordany','08',1005),(10025,'La Massana','04',1005),(10026,'Ordino','05',1005),(10027,'Sant Julia de Loria','06',1005),(10028,'Abaco Islands','AB',1212),(10029,'Andros Island','AN',1212),(10030,'Berry Islands','BR',1212),(10031,'Eleuthera','EL',1212),(10032,'Grand Bahama','GB',1212),(10033,'Rum Cay','RC',1212),(10034,'San Salvador Island','SS',1212),(10035,'Kongo central','01',1050),(10036,'Kwango','02',1050),(10037,'Kwilu','03',1050),(10038,'Mai-Ndombe','04',1050),(10039,'Kasai','05',1050),(10040,'Lulua','06',1050),(10041,'Lomami','07',1050),(10042,'Sankuru','08',1050),(10043,'Ituri','09',1050),(10044,'Haut-Uele','10',1050),(10045,'Tshopo','11',1050),(10046,'Bas-Uele','12',1050),(10047,'Nord-Ubangi','13',1050),(10048,'Mongala','14',1050),(10049,'Sud-Ubangi','15',1050),(10050,'Tshuapa','16',1050),(10051,'Haut-Lomami','17',1050),(10052,'Lualaba','18',1050),(10053,'Haut-Katanga','19',1050),(10054,'Tanganyika','20',1050),(10055,'Toledo','TO',1198),(10056,'Córdoba','CO',1198),(10057,'Metropolitan Manila','MNL',1170),(10058,'La Paz','LP',1097),(10059,'Yinchuan','YN',1045),(10060,'Shizuishan','SZ',1045),(10061,'Wuzhong','WZ',1045),(10062,'Guyuan','GY',1045),(10063,'Zhongwei','ZW',1045),(10064,'Luxembourg','L',1126),(10065,'Aizkraukles novads','002',1119),(10066,'Jaunjelgavas novads','038',1119),(10067,'Pļaviņu novads','072',1119),(10068,'Kokneses novads','046',1119),(10069,'Neretas novads','065',1119),(10070,'Skrīveru novads','092',1119),(10071,'Alūksnes novads','007',1119),(10072,'Apes novads','009',1119),(10073,'Balvu novads','015',1119),(10074,'Viļakas novads','108',1119),(10075,'Baltinavas novads','014',1119),(10076,'Rugāju novads','082',1119),(10077,'Bauskas novads','016',1119),(10078,'Iecavas novads','034',1119),(10079,'Rundāles novads','083',1119),(10080,'Vecumnieku novads','105',1119),(10081,'Cēsu novads','022',1119),(10082,'Līgatnes novads','055',1119),(10083,'Amatas novads','008',1119),(10084,'Jaunpiebalgas novads','039',1119),(10085,'Priekuļu novads','075',1119),(10086,'Pārgaujas novads','070',1119),(10087,'Raunas novads','076',1119),(10088,'Vecpiebalgas novads','104',1119),(10089,'Daugavpils novads','025',1119),(10090,'Ilūkstes novads','036',1119),(10091,'Dobeles novads','026',1119),(10092,'Auces novads','010',1119),(10093,'Tērvetes novads','098',1119),(10094,'Gulbenes novads','033',1119),(10095,'Jelgavas novads','041',1119),(10096,'Ozolnieku novads','069',1119),(10097,'Jēkabpils novads','042',1119),(10098,'Aknīstes novads','004',1119),(10099,'Viesītes novads','107',1119),(10100,'Krustpils novads','049',1119),(10101,'Salas novads','085',1119),(10102,'Krāslavas novads','047',1119),(10103,'Dagdas novads','024',1119),(10104,'Aglonas novads','001',1119),(10105,'Kuldīgas novads','050',1119),(10106,'Skrundas novads','093',1119),(10107,'Alsungas novads','006',1119),(10108,'Aizputes novads','003',1119),(10109,'Durbes novads','028',1119),(10110,'Grobiņas novads','032',1119),(10111,'Pāvilostas novads','071',1119),(10112,'Priekules novads','074',1119),(10113,'Nīcas novads','066',1119),(10114,'Rucavas novads','081',1119),(10115,'Vaiņodes novads','100',1119),(10116,'Limbažu novads','054',1119),(10117,'Alojas novads','005',1119),(10118,'Salacgrīvas novads','086',1119),(10119,'Ludzas novads','058',1119),(10120,'Kārsavas novads','044',1119),(10121,'Zilupes novads','110',1119),(10122,'Ciblas novads','023',1119),(10123,'Madonas novads','059',1119),(10124,'Cesvaines novads','021',1119),(10125,'Lubānas novads','057',1119),(10126,'Varakļānu novads','102',1119),(10127,'Ērgļu novads','030',1119),(10128,'Ogres novads','067',1119),(10129,'Ikšķiles novads','035',1119),(10130,'Ķeguma novads','051',1119),(10131,'Lielvārdes novads','053',1119),(10132,'Preiļu novads','073',1119),(10133,'Līvānu novads','056',1119),(10134,'Riebiņu novads','078',1119),(10135,'Vārkavas novads','103',1119),(10136,'Rēzeknes novads','077',1119),(10137,'Viļānu novads','109',1119),(10138,'Baldones novads','013',1119),(10139,'Ķekavas novads','052',1119),(10140,'Olaines novads','068',1119),(10141,'Salaspils novads','087',1119),(10142,'Saulkrastu novads','089',1119),(10143,'Siguldas novads','091',1119),(10144,'Inčukalna novads','037',1119),(10145,'Ādažu novads','011',1119),(10146,'Babītes novads','012',1119),(10147,'Carnikavas novads','020',1119),(10148,'Garkalnes novads','031',1119),(10149,'Krimuldas novads','048',1119),(10150,'Mālpils novads','061',1119),(10151,'Mārupes novads','062',1119),(10152,'Ropažu novads','080',1119),(10153,'Sējas novads','090',1119),(10154,'Stopiņu novads','095',1119),(10155,'Saldus novads','088',1119),(10156,'Brocēnu novads','018',1119),(10157,'Talsu novads','097',1119),(10158,'Dundagas novads','027',1119),(10159,'Mērsraga novads','063',1119),(10160,'Rojas novads','079',1119),(10161,'Tukuma novads','099',1119),(10162,'Kandavas novads','043',1119),(10163,'Engures novads','029',1119),(10164,'Jaunpils novads','040',1119),(10165,'Valkas novads','101',1119),(10166,'Smiltenes novads','094',1119),(10167,'Strenču novads','096',1119),(10168,'Kocēnu novads','045',1119),(10169,'Mazsalacas novads','060',1119),(10170,'Rūjienas novads','084',1119),(10171,'Beverīnas novads','017',1119),(10172,'Burtnieku novads','019',1119),(10173,'Naukšēnu novads','064',1119),(10174,'Ventspils novads','106',1119),(10175,'Jēkabpils','JKB',1119),(10176,'Valmiera','VMR',1119),(10177,'Florida','FL',1229),(10178,'Rio Negro','RN',1229),(10179,'San Jose','SJ',1229),(10180,'Plateau','PL',1157),(10181,'Pieria','61',1085),(10182,'Los Rios','LR',1044),(10183,'Arica y Parinacota','AP',1044),(10184,'Amazonas','AMA',1169),(10185,'Kalimantan Tengah','KT',1102),(10186,'Sulawesi Barat','SR',1102),(10187,'Kalimantan Utara','KU',1102),(10188,'Ankaran','86',1193),(10189,'Apače','87',1193),(10190,'Cirkulane','88',1193),(10191,'Gorje','89',1193),(10192,'Kostanjevica na Krki','90',1193),(10193,'Log-Dragomer','91',1193),(10194,'Makole','92',1193),(10195,'Mirna','93',1193),(10196,'Mokronog-Trebelno','94',1193),(10197,'Odranci','95',1193),(10198,'Oplotnica','96',1193),(10199,'Ormož','97',1193),(10200,'Osilnica','98',1193),(10201,'Pesnica','99',1193),(10202,'Piran','100',1193),(10203,'Pivka','101',1193),(10204,'Podčetrtek','102',1193),(10205,'Podlehnik','103',1193),(10206,'Podvelka','104',1193),(10207,'Poljčane','105',1193),(10208,'Polzela','106',1193),(10209,'Postojna','107',1193),(10210,'Prebold','108',1193),(10211,'Preddvor','109',1193),(10212,'Prevalje','110',1193),(10213,'Ptuj','111',1193),(10214,'Puconci','112',1193),(10215,'Rače-Fram','113',1193),(10216,'Radeče','114',1193),(10217,'Radenci','115',1193),(10218,'Radlje ob Dravi','139',1193),(10219,'Radovljica','145',1193),(10220,'Ravne na Koroškem','171',1193),(10221,'Razkrižje','172',1193),(10222,'Rečica ob Savinji','173',1193),(10223,'Renče-Vogrsko','174',1193),(10224,'Ribnica','175',1193),(10225,'Ribnica na Pohorju','176',1193),(10226,'Rogaška Slatina','177',1193),(10227,'Rogašovci','178',1193),(10228,'Rogatec','179',1193),(10229,'Ruše','180',1193),(10230,'Selnica ob Dravi','195',1193),(10231,'Semič','196',1193),(10232,'Šentrupert','197',1193),(10233,'Sevnica','198',1193),(10234,'Sežana','199',1193),(10235,'Slovenj Gradec','200',1193),(10236,'Slovenska Bistrica','201',1193),(10237,'Slovenske Konjice','202',1193),(10238,'Šmarješke Toplice','203',1193),(10239,'Sodražica','204',1193),(10240,'Solčava','205',1193),(10241,'Središče ob Dravi','206',1193),(10242,'Starše','207',1193),(10243,'Straža','208',1193),(10244,'Sveta Trojica v Slovenskih goricah','209',1193),(10245,'Sveti Jurij v Slovenskih goricah','210',1193),(10246,'Sveti Tomaž','211',1193),(10247,'Vodice','212',1193),(10248,'Abkhazia','AB',1081),(10249,'Adjara','AJ',1081),(10250,'Tbilisi','TB',1081),(10251,'Guria','GU',1081),(10252,'Imereti','IM',1081),(10253,'Kakheti','KA',1081),(10254,'Kvemo Kartli','KK',1081),(10255,'Mtskheta-Mtianeti','MM',1081),(10256,'Racha-Lechkhumi and Kvemo Svaneti','RL',1081),(10257,'Samegrelo-Zemo Svaneti','SZ',1081),(10258,'Samtskhe-Javakheti','SJ',1081),(10259,'Shida Kartli','SK',1081),(10260,'Central','C',1074),(10261,'Punjab','PB',1163),(10262,'La Libertad','LI',1066),(10263,'La Paz','PA',1066),(10264,'La Union','UN',1066),(10265,'Littoral','LT',1038),(10266,'Nord-Ouest','NW',1038),(10267,'Telangana','TG',1101),(10268,'Ash Sharqiyah','04',1187),(10269,'Guadeloupe','GP',1076),(10270,'Martinique','MQ',1076),(10271,'Guyane','GF',1076),(10272,'La Réunion','RE',1076),(10273,'Mayotte','YT',1076),(10274,'Baringo','01',1112),(10275,'Bomet','02',1112),(10276,'Bungoma','03',1112),(10277,'Busia','04',1112),(10278,'Elgeyo/Marakwet','05',1112),(10279,'Embu','06',1112),(10280,'Garissa','07',1112),(10281,'Homa Bay','08',1112),(10282,'Isiolo','09',1112),(10283,'Kajiado','10',1112),(10284,'Kakamega','11',1112),(10285,'Kericho','12',1112),(10286,'Kiambu','13',1112),(10287,'Kilifi','14',1112),(10288,'Kirinyaga','15',1112),(10289,'Kisii','16',1112),(10290,'Kisumu','17',1112),(10291,'Kitui','18',1112),(10292,'Kwale','19',1112),(10293,'Laikipia','20',1112),(10294,'Lamu','21',1112),(10295,'Machakos','22',1112),(10296,'Makueni','23',1112),(10297,'Mandera','24',1112),(10298,'Marsabit','25',1112),(10299,'Meru','26',1112),(10300,'Migori','27',1112),(10301,'Mombasa','28',1112),(10302,'Murang\'a','29',1112),(10303,'Nairobi City','30',1112),(10304,'Nakuru','31',1112),(10305,'Nandi','32',1112),(10306,'Narok','33',1112),(10307,'Nyamira','34',1112),(10308,'Nyandarua','35',1112),(10309,'Nyeri','36',1112),(10310,'Samburu','37',1112),(10311,'Siaya','38',1112),(10312,'Taita/Taveta','39',1112),(10313,'Tana River','40',1112),(10314,'Tharaka-Nithi','41',1112),(10315,'Trans Nzoia','42',1112),(10316,'Turkana','43',1112),(10317,'Uasin Gishu','44',1112),(10318,'Vihiga','45',1112),(10319,'Wajir','46',1112),(10320,'West Pokot','47',1112),(10321,'Chandigarh','CH',1101),(10322,'Central','CP',1083),(10323,'Eastern','EP',1083),(10324,'Northern','NP',1083),(10325,'Western','WP',1083),(10326,'Saint Kitts','K',1181),(10327,'Nevis','N',1181),(10328,'Eastern','E',1190),(10329,'Northern','N',1190),(10330,'Southern','S',1190),(10331,'Dushanbe','DU',1209),(10332,'Nohiyahoi Tobei Jumhurí','RA',1209),(10333,'Wallis-et-Futuna','WF',1076),(10334,'Nouvelle-Calédonie','NC',1076),(10335,'Haute-Marne','52',1076),(10336,'Saint George','03',1009),(10337,'Saint John','04',1009),(10338,'Saint Mary','05',1009),(10339,'Saint Paul','06',1009),(10340,'Saint Peter','07',1009),(10341,'Saint Philip','08',1009),(10342,'Barbuda','10',1009),(10343,'Redonda','11',1009),(10344,'Christ Church','01',1018),(10345,'Saint Andrew','02',1018),(10346,'Saint George','03',1018),(10347,'Saint James','04',1018),(10348,'Saint John','05',1018),(10349,'Saint Joseph','06',1018),(10350,'Saint Lucy','07',1018),(10351,'Saint Michael','08',1018),(10352,'Saint Peter','09',1018),(10353,'Saint Philip','10',1018),(10354,'Saint Thomas','11',1018),(10355,'Estuaire','01',1080),(10356,'Haut-Ogooué','02',1080),(10357,'Moyen-Ogooué','03',1080),(10358,'Ngounié','04',1080),(10359,'Nyanga','05',1080),(10360,'Ogooué-Ivindo','06',1080),(10361,'Ogooué-Lolo','07',1080),(10362,'Ogooué-Maritime','08',1080),(10363,'Woleu-Ntem','09',1080),(10364,'Monmouthshire','MON',1226),(10365,'Antrim and Newtownabbey','ANN',1226),(10366,'Ards and North Down','AND',1226),(10367,'Armagh City, Banbridge and Craigavon','ABC',1226),(10368,'Belfast','BFS',1226),(10369,'Causeway Coast and Glens','CCG',1226),(10370,'Derry City and Strabane','DRS',1226),(10371,'Fermanagh and Omagh','FMO',1226),(10372,'Lisburn and Castlereagh','LBC',1226),(10373,'Mid and East Antrim','MEA',1226),(10374,'Mid Ulster','MUL',1226),(10375,'Newry, Mourne and Down','NMD',1226),(10376,'Bridgend','BGE',1226),(10377,'Caerphilly','CAY',1226),(10378,'Cardiff','CRF',1226),(10379,'Carmarthenshire','CRF',1226),(10380,'Ceredigion','CGN',1226),(10381,'Conwy','CWY',1226),(10382,'Denbighshire','DEN',1226),(10383,'Flintshire','FLN',1226),(10384,'Isle of Anglesey','AGY',1226),(10385,'Merthyr Tydfil','MTY',1226),(10386,'Neath Port Talbot','NTL',1226),(10387,'Newport','NWP',1226),(10388,'Pembrokeshire','PEM',1226),(10389,'Rhondda, Cynon, Taff','RCT',1226),(10390,'Swansea','SWA',1226),(10391,'Torfaen','TOF',1226),(10392,'Wrexham','WRX',1226); /*!40000 ALTER TABLE `civicrm_state_province` ENABLE KEYS */; UNLOCK TABLES; @@ -1347,7 +1347,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_subscription_history` WRITE; /*!40000 ALTER TABLE `civicrm_subscription_history` DISABLE KEYS */; -INSERT INTO `civicrm_subscription_history` (`id`, `contact_id`, `group_id`, `date`, `method`, `status`, `tracking`) VALUES (1,169,2,'2019-11-20 21:26:21','Admin','Added',NULL),(2,24,2,'2019-12-23 11:52:30','Email','Added',NULL),(3,124,2,'2019-11-18 09:34:53','Email','Added',NULL),(4,57,2,'2019-09-21 08:05:46','Admin','Added',NULL),(5,17,2,'2019-11-27 11:47:55','Email','Added',NULL),(6,182,2,'2020-03-12 13:17:00','Email','Added',NULL),(7,99,2,'2019-08-04 20:42:42','Email','Added',NULL),(8,138,2,'2020-07-14 02:26:21','Email','Added',NULL),(9,81,2,'2020-02-17 20:51:29','Email','Added',NULL),(10,53,2,'2019-12-12 16:46:40','Email','Added',NULL),(11,15,2,'2020-06-08 11:55:39','Email','Added',NULL),(12,33,2,'2019-12-02 00:17:20','Email','Added',NULL),(13,179,2,'2019-09-18 20:51:54','Admin','Added',NULL),(14,83,2,'2020-02-21 16:59:13','Email','Added',NULL),(15,164,2,'2019-09-04 18:42:28','Email','Added',NULL),(16,146,2,'2019-08-16 17:31:30','Admin','Added',NULL),(17,120,2,'2019-10-25 00:35:51','Admin','Added',NULL),(18,193,2,'2020-05-08 16:05:56','Email','Added',NULL),(19,76,2,'2019-08-18 21:58:45','Email','Added',NULL),(20,162,2,'2019-08-25 15:21:21','Email','Added',NULL),(21,66,2,'2019-08-21 12:54:54','Admin','Added',NULL),(22,92,2,'2019-08-30 06:33:41','Admin','Added',NULL),(23,167,2,'2020-03-26 10:25:26','Email','Added',NULL),(24,65,2,'2020-04-21 20:54:05','Admin','Added',NULL),(25,190,2,'2019-09-11 17:19:20','Email','Added',NULL),(26,184,2,'2019-12-21 22:09:38','Email','Added',NULL),(27,67,2,'2019-08-13 13:10:41','Email','Added',NULL),(28,185,2,'2020-05-16 21:14:47','Admin','Added',NULL),(29,183,2,'2020-06-23 07:14:06','Email','Added',NULL),(30,175,2,'2019-12-09 11:30:16','Admin','Added',NULL),(31,129,2,'2020-03-06 02:22:27','Email','Added',NULL),(32,197,2,'2019-08-28 11:28:01','Email','Added',NULL),(33,122,2,'2019-09-12 07:55:23','Email','Added',NULL),(34,7,2,'2019-11-13 02:54:04','Admin','Added',NULL),(35,154,2,'2019-08-30 21:35:11','Email','Added',NULL),(36,51,2,'2020-03-13 22:09:33','Email','Added',NULL),(37,97,2,'2020-01-04 06:55:30','Email','Added',NULL),(38,111,2,'2020-04-21 03:12:40','Admin','Added',NULL),(39,143,2,'2019-11-15 07:26:31','Email','Added',NULL),(40,77,2,'2020-04-10 22:45:14','Email','Added',NULL),(41,186,2,'2020-05-11 19:35:51','Admin','Added',NULL),(42,12,2,'2020-02-20 08:29:05','Admin','Added',NULL),(43,8,2,'2020-01-17 21:34:08','Admin','Added',NULL),(44,84,2,'2020-05-11 14:40:31','Email','Added',NULL),(45,71,2,'2019-12-18 13:22:22','Admin','Added',NULL),(46,3,2,'2020-06-23 16:06:41','Email','Added',NULL),(47,123,2,'2020-04-15 15:26:58','Admin','Added',NULL),(48,119,2,'2020-02-11 11:16:39','Admin','Added',NULL),(49,161,2,'2019-09-14 18:37:42','Admin','Added',NULL),(50,145,2,'2020-05-23 07:34:56','Email','Added',NULL),(51,60,2,'2019-08-22 10:28:33','Email','Added',NULL),(52,31,2,'2019-11-13 10:56:38','Email','Added',NULL),(53,55,2,'2020-02-13 23:43:08','Admin','Added',NULL),(54,88,2,'2019-12-24 11:11:02','Email','Added',NULL),(55,64,2,'2020-02-03 07:32:36','Admin','Added',NULL),(56,41,2,'2019-08-08 18:06:57','Email','Added',NULL),(57,30,2,'2020-04-26 23:17:36','Email','Added',NULL),(58,2,2,'2020-01-16 00:51:51','Email','Added',NULL),(59,156,2,'2019-11-24 19:05:36','Email','Added',NULL),(60,118,2,'2020-05-08 22:41:55','Admin','Added',NULL),(61,87,3,'2020-02-12 19:47:53','Email','Added',NULL),(62,49,3,'2019-11-24 14:21:59','Email','Added',NULL),(63,23,3,'2020-03-20 02:01:17','Email','Added',NULL),(64,5,3,'2020-02-12 06:13:02','Email','Added',NULL),(65,93,3,'2020-03-26 23:29:51','Admin','Added',NULL),(66,18,3,'2019-09-26 12:23:17','Email','Added',NULL),(67,6,3,'2019-09-19 13:40:19','Admin','Added',NULL),(68,199,3,'2020-04-23 00:44:59','Email','Added',NULL),(69,176,3,'2020-02-29 17:05:30','Email','Added',NULL),(70,132,3,'2020-02-17 15:44:05','Admin','Added',NULL),(71,80,3,'2020-03-01 11:59:37','Email','Added',NULL),(72,45,3,'2020-01-23 09:13:35','Admin','Added',NULL),(73,44,3,'2019-08-22 22:38:26','Admin','Added',NULL),(74,96,3,'2020-07-20 11:43:21','Email','Added',NULL),(75,166,3,'2019-10-22 19:46:03','Email','Added',NULL),(76,169,4,'2020-04-20 15:35:07','Email','Added',NULL),(77,138,4,'2019-09-14 05:27:21','Admin','Added',NULL),(78,164,4,'2019-12-21 08:53:52','Email','Added',NULL),(79,92,4,'2019-11-08 12:12:13','Email','Added',NULL),(80,183,4,'2020-02-20 08:24:27','Email','Added',NULL),(81,51,4,'2020-05-18 10:54:03','Admin','Added',NULL),(82,8,4,'2019-08-23 17:30:49','Admin','Added',NULL),(83,145,4,'2020-06-15 07:19:20','Email','Added',NULL); +INSERT INTO `civicrm_subscription_history` (`id`, `contact_id`, `group_id`, `date`, `method`, `status`, `tracking`) VALUES (1,79,2,'2020-01-22 13:31:46','Admin','Added',NULL),(2,47,2,'2019-12-13 18:51:02','Admin','Added',NULL),(3,51,2,'2020-05-23 23:30:41','Admin','Added',NULL),(4,118,2,'2020-03-26 14:17:12','Admin','Added',NULL),(5,34,2,'2020-02-27 11:33:43','Admin','Added',NULL),(6,7,2,'2020-06-19 17:25:43','Admin','Added',NULL),(7,44,2,'2020-08-27 08:50:27','Admin','Added',NULL),(8,139,2,'2020-01-14 04:47:50','Email','Added',NULL),(9,99,2,'2020-06-13 04:50:54','Email','Added',NULL),(10,126,2,'2020-01-22 00:26:10','Admin','Added',NULL),(11,17,2,'2020-02-03 11:02:29','Admin','Added',NULL),(12,78,2,'2020-05-04 01:43:48','Admin','Added',NULL),(13,64,2,'2020-01-31 02:56:19','Admin','Added',NULL),(14,12,2,'2019-09-26 09:00:38','Admin','Added',NULL),(15,87,2,'2019-12-23 08:43:59','Email','Added',NULL),(16,88,2,'2020-02-04 10:50:45','Email','Added',NULL),(17,9,2,'2020-07-01 08:26:48','Admin','Added',NULL),(18,55,2,'2020-04-01 21:43:28','Admin','Added',NULL),(19,132,2,'2020-03-25 10:56:29','Admin','Added',NULL),(20,173,2,'2020-08-07 02:07:47','Email','Added',NULL),(21,104,2,'2019-09-23 10:04:58','Admin','Added',NULL),(22,91,2,'2020-05-20 23:44:42','Email','Added',NULL),(23,100,2,'2020-05-12 03:57:07','Email','Added',NULL),(24,65,2,'2019-10-29 15:18:03','Admin','Added',NULL),(25,38,2,'2020-08-13 00:41:18','Email','Added',NULL),(26,36,2,'2020-04-29 15:42:35','Admin','Added',NULL),(27,11,2,'2020-01-23 10:13:54','Admin','Added',NULL),(28,201,2,'2020-07-01 16:40:40','Admin','Added',NULL),(29,181,2,'2019-10-13 23:55:12','Admin','Added',NULL),(30,192,2,'2020-08-31 02:44:31','Email','Added',NULL),(31,32,2,'2019-11-30 00:12:09','Email','Added',NULL),(32,168,2,'2020-04-30 07:51:14','Email','Added',NULL),(33,164,2,'2019-12-06 07:30:34','Email','Added',NULL),(34,160,2,'2019-10-15 21:24:04','Email','Added',NULL),(35,92,2,'2020-05-19 10:04:53','Admin','Added',NULL),(36,94,2,'2020-04-26 02:19:16','Email','Added',NULL),(37,119,2,'2019-09-18 04:55:47','Admin','Added',NULL),(38,8,2,'2020-08-02 05:50:02','Email','Added',NULL),(39,60,2,'2020-01-17 10:46:13','Email','Added',NULL),(40,133,2,'2020-07-17 18:32:07','Email','Added',NULL),(41,42,2,'2020-07-30 14:40:53','Email','Added',NULL),(42,154,2,'2020-07-29 11:28:43','Admin','Added',NULL),(43,125,2,'2020-06-21 01:09:47','Admin','Added',NULL),(44,197,2,'2020-03-28 10:38:21','Email','Added',NULL),(45,171,2,'2020-05-19 01:57:03','Email','Added',NULL),(46,152,2,'2020-03-17 15:28:59','Email','Added',NULL),(47,112,2,'2020-04-11 09:21:31','Email','Added',NULL),(48,108,2,'2019-10-09 18:38:57','Admin','Added',NULL),(49,194,2,'2019-09-29 15:39:45','Email','Added',NULL),(50,190,2,'2020-03-06 10:41:12','Admin','Added',NULL),(51,162,2,'2019-10-06 09:20:01','Email','Added',NULL),(52,14,2,'2019-10-24 09:47:30','Email','Added',NULL),(53,187,2,'2020-06-04 10:38:11','Email','Added',NULL),(54,183,2,'2020-02-18 08:41:20','Admin','Added',NULL),(55,191,2,'2020-09-11 19:39:03','Admin','Added',NULL),(56,31,2,'2020-04-06 06:55:05','Admin','Added',NULL),(57,130,2,'2019-10-27 03:53:29','Email','Added',NULL),(58,184,2,'2020-02-20 00:31:02','Admin','Added',NULL),(59,59,2,'2020-02-17 07:30:42','Email','Added',NULL),(60,46,2,'2020-02-09 08:13:38','Email','Added',NULL),(61,193,3,'2020-06-06 16:15:04','Admin','Added',NULL),(62,16,3,'2020-05-02 10:49:41','Admin','Added',NULL),(63,199,3,'2020-06-05 17:22:07','Admin','Added',NULL),(64,114,3,'2020-02-26 06:40:38','Email','Added',NULL),(65,61,3,'2019-12-16 10:52:05','Email','Added',NULL),(66,33,3,'2019-09-30 02:27:58','Admin','Added',NULL),(67,86,3,'2019-12-04 06:19:11','Admin','Added',NULL),(68,182,3,'2020-08-19 17:11:21','Email','Added',NULL),(69,151,3,'2020-01-28 14:29:31','Email','Added',NULL),(70,137,3,'2020-05-17 06:12:26','Email','Added',NULL),(71,189,3,'2020-08-26 17:54:20','Admin','Added',NULL),(72,35,3,'2020-08-28 04:52:00','Admin','Added',NULL),(73,117,3,'2020-01-27 16:51:48','Admin','Added',NULL),(74,147,3,'2020-08-27 19:30:21','Email','Added',NULL),(75,28,3,'2020-05-20 09:52:21','Admin','Added',NULL),(76,79,4,'2020-05-07 21:30:06','Admin','Added',NULL),(77,139,4,'2020-03-22 23:56:36','Admin','Added',NULL),(78,87,4,'2020-04-05 03:56:25','Email','Added',NULL),(79,91,4,'2020-08-29 17:30:44','Email','Added',NULL),(80,181,4,'2020-08-25 00:37:37','Email','Added',NULL),(81,94,4,'2020-07-25 20:01:49','Admin','Added',NULL),(82,125,4,'2020-03-09 02:04:45','Admin','Added',NULL),(83,190,4,'2020-07-14 23:39:38','Admin','Added',NULL); /*!40000 ALTER TABLE `civicrm_subscription_history` ENABLE KEYS */; UNLOCK TABLES; @@ -1443,7 +1443,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_website` WRITE; /*!40000 ALTER TABLE `civicrm_website` DISABLE KEYS */; -INSERT INTO `civicrm_website` (`id`, `contact_id`, `url`, `website_type_id`) VALUES (1,174,'http://northpointdevelopmentschool.org',1),(2,105,'http://urbanculture.org',1),(3,144,'http://globalempowerment.org',1),(4,148,'http://dallaspartnership.org',1),(5,90,'http://rebeccafellowship.org',1),(6,86,'http://beechdevelopmenttrust.org',1),(7,56,'http://kentuckyinitiative.org',1),(8,137,'http://aptossustainability.org',1),(9,14,'http://bltechnologyfund.org',1),(10,178,'http://sierrasoftwaresolutions.org',1),(11,117,'http://maincollective.org',1),(12,157,'http://moxahaladevelopmentalliance.org',1),(13,91,'http://greenpoetry.org',1),(14,79,'http://ogdensburgpoetry.org',1),(15,37,'http://urbanactionschool.org',1),(16,46,'http://greeninitiative.org',1),(17,50,'http://collegehealthassociation.org',1); +INSERT INTO `civicrm_website` (`id`, `contact_id`, `url`, `website_type_id`) VALUES (1,172,'http://cadellhealth.org',1),(2,103,'http://dameronenvironmentalservices.org',1),(3,15,'http://dowlenagricultureinitiative.org',1),(4,149,'http://baypartnership.org',1),(5,39,'http://jacksonsystems.org',1),(6,21,'http://indianapartnership.org',1),(7,167,'http://kansasalliance.org',1),(8,101,'http://communityinitiative.org',1),(9,102,'http://fairbankslegalsystems.org',1),(10,23,'http://watervilleassociation.org',1),(11,161,'http://beechfoodpartnership.org',1),(12,93,'http://wdlegalsolutions.org',1),(13,49,'http://ruraladvocacysolutions.org',1),(14,170,'http://caulderfund.org',1),(15,129,'http://maplenetwork.org',1),(16,165,'http://williamsburgsoftware.org',1),(17,77,'http://paragonahservices.org',1); /*!40000 ALTER TABLE `civicrm_website` ENABLE KEYS */; UNLOCK TABLES; @@ -1475,7 +1475,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-07-24 15:34:05 +-- Dump completed on 2020-09-16 19:54:44 -- +--------------------------------------------------------------------+ -- | Copyright CiviCRM LLC. All rights reserved. | -- | | diff --git a/sql/test_data_second_domain.mysql b/sql/test_data_second_domain.mysql index fd4896bad472..02be43b1922a 100644 --- a/sql/test_data_second_domain.mysql +++ b/sql/test_data_second_domain.mysql @@ -10,13 +10,13 @@ SELECT @addId := id from civicrm_address where street_address = '15 Main St'; INSERT INTO civicrm_email (contact_id, location_type_id, email, is_primary, is_billing, on_hold, hold_date, reset_date) VALUES - (@contactID, 1, '"Domain Email" ', 0, 0, 0, NULL, NULL); + (@contactID, 1, 'domainemail2@example.org', 1, 0, 0, NULL, NULL); SELECT @emailId := id from civicrm_email where email = 'domainemail2@example.org'; INSERT INTO civicrm_phone (contact_id, location_type_id, is_primary, is_billing, mobile_provider_id, phone, phone_type_id) VALUES - (@contactID, 1, 0, 0, NULL,'204 555-1001', 1); + (@contactID, 1, 1, 0, NULL,'204 555-1001', 1); SELECT @phoneId := id from civicrm_phone where phone = '204 555-1001'; @@ -87,32 +87,32 @@ SET @searchlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/contact/search&reset=1', 'Find Contacts', 'Find Contacts', NULL, '', @searchlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/contact/search/advanced&reset=1', 'Advanced Search', 'Advanced Search', NULL, '', @searchlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/contact/search/custom&csid=15&reset=1', 'Full-text Search', 'Full-text Search', NULL, '', @searchlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/contact/search/builder&reset=1', 'Search Builder', 'Search Builder', NULL, '', @searchlastID, '1', '1', 4 ), - ( @domainID, 'civicrm/case/search&reset=1', 'Find Cases', 'Find Cases', 'access my cases and activities,access all cases and activities', 'OR', @searchlastID, '1', NULL, 5 ), - ( @domainID, 'civicrm/contribute/search&reset=1', 'Find Contributions', 'Find Contributions', 'access CiviContribute', '', @searchlastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/mailing&reset=1', 'Find Mailings', 'Find Mailings', 'access CiviMail', '', @searchlastID, '1', NULL, 7 ), - ( @domainID, 'civicrm/member/search&reset=1', 'Find Memberships', 'Find Memberships', 'access CiviMember', '', @searchlastID, '1', NULL, 8 ), - ( @domainID, 'civicrm/event/search&reset=1', 'Find Participants', 'Find Participants', 'access CiviEvent', '', @searchlastID, '1', NULL, 9 ), + ( @domainID, 'civicrm/contact/search&reset=1', 'Find Contacts', 'Find Contacts', NULL, '', @searchlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/contact/search/advanced&reset=1', 'Advanced Search', 'Advanced Search', NULL, '', @searchlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/contact/search/custom&csid=15&reset=1', 'Full-text Search', 'Full-text Search', NULL, '', @searchlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/contact/search/builder&reset=1', 'Search Builder', 'Search Builder', NULL, '', @searchlastID, '1', '1', 4 ), + ( @domainID, 'civicrm/case/search&reset=1', 'Find Cases', 'Find Cases', 'access my cases and activities,access all cases and activities', 'OR', @searchlastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/contribute/search&reset=1', 'Find Contributions', 'Find Contributions', 'access CiviContribute', '', @searchlastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/mailing&reset=1', 'Find Mailings', 'Find Mailings', 'access CiviMail', '', @searchlastID, '1', NULL, 7 ), + ( @domainID, 'civicrm/member/search&reset=1', 'Find Memberships', 'Find Memberships', 'access CiviMember', '', @searchlastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/event/search&reset=1', 'Find Participants', 'Find Participants', 'access CiviEvent', '', @searchlastID, '1', NULL, 9 ), ( @domainID, 'civicrm/pledge/search&reset=1', 'Find Pledges', 'Find Pledges', 'access CiviPledge', '', @searchlastID, '1', NULL, 10 ), ( @domainID, 'civicrm/activity/search&reset=1', 'Find Activities', 'Find Activities', NULL, '', @searchlastID, '1', '1', 11 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/contact/search/custom/list&reset=1', 'Custom Searches', 'Custom Searches', NULL, '', @searchlastID, '1', NULL, 12 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Contacts', 'Contacts', NULL, '', NULL, '1', NULL, 20 ); SET @contactlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/contact/add&reset=1&ct=Individual', 'New Individual', 'New Individual', 'add contacts', '', @contactlastID, '1', NULL, 1 ), ( @domainID, 'civicrm/contact/add&reset=1&ct=Household', 'New Household', 'New Household', 'add contacts', '', @contactlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/contact/add&reset=1&ct=Organization', 'New Organization', 'New Organization', 'add contacts', '', @contactlastID, '1', 1, 3 ); @@ -121,100 +121,100 @@ VALUES INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/activity&reset=1&action=add&context=standalone', 'New Activity', 'New Activity', NULL, '', @contactlastID, '1', NULL, 4 ), - ( @domainID, 'civicrm/activity/email/add&atype=3&action=add&reset=1&context=standalone', 'New Email', 'New Email', NULL, '', @contactlastID, '1', '1', 5 ), - ( @domainID, 'civicrm/import/contact&reset=1', 'Import Contacts', 'Import Contacts', 'import contacts', '', @contactlastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/import/activity&reset=1', 'Import Activities', 'Import Activities', 'import contacts', '', @contactlastID, '1', '1', 7 ), - ( @domainID, 'civicrm/group/add&reset=1', 'New Group', 'New Group', 'edit groups', '', @contactlastID, '1', NULL, 8 ), - ( @domainID, 'civicrm/group&reset=1', 'Manage Groups', 'Manage Groups', 'access CiviCRM', '', @contactlastID, '1', '1', 9 ), - ( @domainID, 'civicrm/admin/tag&reset=1&action=add', 'New Tag', 'New Tag', 'administer CiviCRM', '', @contactlastID, '1', NULL, 10 ), + ( @domainID, 'civicrm/activity&reset=1&action=add&context=standalone', 'New Activity', 'New Activity', NULL, '', @contactlastID, '1', NULL, 4 ), + ( @domainID, 'civicrm/activity/email/add&atype=3&action=add&reset=1&context=standalone', 'New Email', 'New Email', NULL, '', @contactlastID, '1', '1', 5 ), + ( @domainID, 'civicrm/import/contact&reset=1', 'Import Contacts', 'Import Contacts', 'import contacts', '', @contactlastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/import/activity&reset=1', 'Import Activities', 'Import Activities', 'import contacts', '', @contactlastID, '1', '1', 7 ), + ( @domainID, 'civicrm/group/add&reset=1', 'New Group', 'New Group', 'edit groups', '', @contactlastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/group&reset=1', 'Manage Groups', 'Manage Groups', 'access CiviCRM', '', @contactlastID, '1', '1', 9 ), + ( @domainID, 'civicrm/admin/tag&reset=1&action=add', 'New Tag', 'New Tag', 'administer CiviCRM', '', @contactlastID, '1', NULL, 10 ), ( @domainID, 'civicrm/admin/tag&reset=1', 'Manage Tags (Categories)', 'Manage Tags (Categories)', 'administer CiviCRM', '', @contactlastID, '1','1', 11 ), ( @domainID, 'civicrm/contact/deduperules&reset=1', 'Find and Merge Duplicate Contacts', 'Find and Merge Duplicate Contacts', 'administer dedupe rules,merge duplicate contacts', 'OR', @contactlastID, '1', NULL, 12 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Contributions', 'Contributions', 'access CiviContribute', '', NULL, '1', NULL, 30 ); SET @contributionlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/contribute&reset=1', 'Dashboard', 'Dashboard', 'access CiviContribute', '', @contributionlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/contribute/add&reset=1&action=add&context=standalone', 'New Contribution', 'New Contribution', 'access CiviContribute,edit contributions', 'AND', @contributionlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/contribute/search&reset=1', 'Find Contributions', 'Find Contributions', 'access CiviContribute', '', @contributionlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/batch&reset=1', 'Batches', 'Batches', 'access CiviContribute,access CiviMember', '', @contributionlastID, '1', NULL, 4 ), +VALUES + ( @domainID, 'civicrm/contribute&reset=1', 'Dashboard', 'Dashboard', 'access CiviContribute', '', @contributionlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/contribute/add&reset=1&action=add&context=standalone', 'New Contribution', 'New Contribution', 'access CiviContribute,edit contributions', 'AND', @contributionlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/contribute/search&reset=1', 'Find Contributions', 'Find Contributions', 'access CiviContribute', '', @contributionlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/batch&reset=1', 'Batches', 'Batches', 'access CiviContribute,access CiviMember', '', @contributionlastID, '1', NULL, 4 ), ( @domainID, 'civicrm/contribute/import&reset=1', 'Import Contributions', 'Import Contributions', 'access CiviContribute,edit contributions', 'AND', @contributionlastID, '1', '1', 5 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID,NULL, 'Pledges', 'Pledges', 'access CiviPledge', '', @contributionlastID, '1', 1, 5 ); - + SET @pledgelastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/pledge&reset=1', 'Dashboard', 'Dashboard', 'access CiviPledge', '', @pledgelastID, '1', NULL, 1 ), +VALUES + ( @domainID, 'civicrm/pledge&reset=1', 'Dashboard', 'Dashboard', 'access CiviPledge', '', @pledgelastID, '1', NULL, 1 ), ( @domainID, 'civicrm/pledge/add&reset=1&action=add&context=standalone', 'New Pledge', 'New Pledge', 'access CiviPledge,edit pledges', 'AND', @pledgelastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/pledge/search&reset=1', 'Find Pledges', 'Find Pledges', 'access CiviPledge', '', @pledgelastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/admin/contribute/add&reset=1&action=add', 'New Contribution Page', 'New Contribution Page', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/contribute&reset=1', 'Manage Contribution Pages', 'Manage Contribution Pages', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', '1', 7 ), - ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=contribute', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/pledge/search&reset=1', 'Find Pledges', 'Find Pledges', 'access CiviPledge', '', @pledgelastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/admin/contribute/add&reset=1&action=add', 'New Contribution Page', 'New Contribution Page', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/admin/contribute&reset=1', 'Manage Contribution Pages', 'Manage Contribution Pages', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', '1', 7 ), + ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=contribute', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 8 ), ( @domainID, 'civicrm/admin/contribute/managePremiums&reset=1', 'Premiums (Thank-you Gifts)', 'Premiums', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', 1, 9 ), ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 10 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 11 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Events', 'Events', 'access CiviEvent', '', NULL, '1', NULL, 40 ); SET @eventlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/event&reset=1', 'Dashboard', 'CiviEvent Dashboard', 'access CiviEvent', '', @eventlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/participant/add&reset=1&action=add&context=standalone', 'Register Event Participant', 'Register Event Participant', 'access CiviEvent,edit event participants', 'AND', @eventlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/event/search&reset=1', 'Find Participants', 'Find Participants', 'access CiviEvent', '', @eventlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/event/import&reset=1', 'Import Participants','Import Participants', 'access CiviEvent,edit event participants', 'AND', @eventlastID, '1', '1', 4 ), - ( @domainID, 'civicrm/event/add&reset=1&action=add', 'New Event', 'New Event', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 5 ), - ( @domainID, 'civicrm/event/manage&reset=1', 'Manage Events', 'Manage Events', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', 1, 6 ), +VALUES + ( @domainID, 'civicrm/event&reset=1', 'Dashboard', 'CiviEvent Dashboard', 'access CiviEvent', '', @eventlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/participant/add&reset=1&action=add&context=standalone', 'Register Event Participant', 'Register Event Participant', 'access CiviEvent,edit event participants', 'AND', @eventlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/event/search&reset=1', 'Find Participants', 'Find Participants', 'access CiviEvent', '', @eventlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/event/import&reset=1', 'Import Participants','Import Participants', 'access CiviEvent,edit event participants', 'AND', @eventlastID, '1', '1', 4 ), + ( @domainID, 'civicrm/event/add&reset=1&action=add', 'New Event', 'New Event', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/event/manage&reset=1', 'Manage Events', 'Manage Events', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', 1, 6 ), ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=event', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviEvent,administer CiviCRM', 'AND', @eventlastID, '1', 1, 7 ), - ( @domainID, 'civicrm/admin/eventTemplate&reset=1', 'Event Templates', 'Event Templates', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', 1, 8 ), - ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 9 ), + ( @domainID, 'civicrm/admin/eventTemplate&reset=1', 'Event Templates', 'Event Templates', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', 1, 8 ), + ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 9 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 10 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Mailings', 'Mailings', 'access CiviMail,create mailings,approve mailings,schedule mailings', 'OR', NULL, '1', NULL, 50 ); SET @mailinglastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/mailing/send&reset=1', 'New Mailing', 'New Mailing', 'access CiviMail,create mailings', 'OR', @mailinglastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/mailing/browse/unscheduled&reset=1&scheduled=false', 'Draft and Unscheduled Mailings', 'Draft and Unscheduled Mailings', 'access CiviMail,create mailings,schedule mailings', 'OR', @mailinglastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/mailing/browse/scheduled&reset=1&scheduled=true', 'Scheduled and Sent Mailings', 'Scheduled and Sent Mailings', 'access CiviMail,approve mailings,create mailings,schedule mailings', 'OR', @mailinglastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/mailing/browse/archived&reset=1', 'Archived Mailings', 'Archived Mailings', 'access CiviMail,create mailings', 'OR', @mailinglastID, '1', 1, 4 ), +VALUES + ( @domainID, 'civicrm/mailing/send&reset=1', 'New Mailing', 'New Mailing', 'access CiviMail,create mailings', 'OR', @mailinglastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/mailing/browse/unscheduled&reset=1&scheduled=false', 'Draft and Unscheduled Mailings', 'Draft and Unscheduled Mailings', 'access CiviMail,create mailings,schedule mailings', 'OR', @mailinglastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/mailing/browse/scheduled&reset=1&scheduled=true', 'Scheduled and Sent Mailings', 'Scheduled and Sent Mailings', 'access CiviMail,approve mailings,create mailings,schedule mailings', 'OR', @mailinglastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/mailing/browse/archived&reset=1', 'Archived Mailings', 'Archived Mailings', 'access CiviMail,create mailings', 'OR', @mailinglastID, '1', 1, 4 ), ( @domainID, 'civicrm/admin/component&reset=1', 'Headers, Footers, and Automated Messages', 'Headers, Footers, and Automated Messages', 'access CiviMail,administer CiviCRM', 'AND', @mailinglastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @mailinglastID, '1', NULL, 6 ), ( @domainID, 'civicrm/admin/options/from_email&group=from_email_address&reset=1', 'From Email Addresses', 'From Email Addresses', 'administer CiviCRM', '', @mailinglastID, '1', 1, 7 ), ( @domainID, 'civicrm/sms/send?reset=1', 'New SMS', 'New SMS', 'administer CiviCRM', NULL, @mailinglastID, '1', 1, 8 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Memberships', 'Memberships', 'access CiviMember', '', NULL, '1', NULL, 60 ); SET @memberlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/member&reset=1', 'Dashboard', 'Dashboard', 'access CiviMember', '', @memberlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/member/add&reset=1&action=add&context=standalone', 'New Membership', 'New Membership', 'access CiviMember,edit memberships', 'AND', @memberlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/member/search&reset=1', 'Find Memberships', 'Find Memberships','access CiviMember', '', @memberlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/batch&reset=1', 'Batches', 'Batches','access CiviMember,access CiviContribute', '', @memberlastID, '1', NULL, 4 ), +VALUES + ( @domainID, 'civicrm/member&reset=1', 'Dashboard', 'Dashboard', 'access CiviMember', '', @memberlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/member/add&reset=1&action=add&context=standalone', 'New Membership', 'New Membership', 'access CiviMember,edit memberships', 'AND', @memberlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/member/search&reset=1', 'Find Memberships', 'Find Memberships','access CiviMember', '', @memberlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/batch&reset=1', 'Batches', 'Batches','access CiviMember,access CiviContribute', '', @memberlastID, '1', NULL, 4 ), ( @domainID, 'civicrm/member/import&reset=1', 'Import Memberships', 'Import Members', 'access CiviMember,edit memberships', 'AND', @memberlastID, '1', 1, 5 ), ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviMember,administer CiviCRM', 'AND', @memberlastID, '1', NULL, 6 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviMember,administer CiviCRM', 'AND', @memberlastID, '1', NULL, 7 ); @@ -228,16 +228,16 @@ VALUES SET @campaignlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/campaign&reset=1', 'Dashboard', 'Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 1 ); SET @campaigndashboardlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/campaign&reset=1&subPage=survey', 'Surveys', 'Survey Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/campaign&reset=1&subPage=petition', 'Petitions', 'Petition Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/campaign&reset=1&subPage=campaign', 'Campaigns', 'Campaign Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/campaign/add&reset=1', 'New Campaign', 'New Campaign', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/campaign&reset=1&subPage=survey', 'Surveys', 'Survey Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/campaign&reset=1&subPage=petition', 'Petitions', 'Petition Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/campaign&reset=1&subPage=campaign', 'Campaigns', 'Campaign Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/campaign/add&reset=1', 'New Campaign', 'New Campaign', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/survey/add&reset=1', 'New Survey', 'New Survey', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 3 ), ( @domainID, 'civicrm/petition/add&reset=1', 'New Petition', 'New Petition', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 4 ), ( @domainID, 'civicrm/survey/search&reset=1&op=reserve', 'Reserve Respondents', 'Reserve Respondents', 'administer CiviCampaign,manage campaign,reserve campaign contacts', 'OR', @campaignlastID, '1', NULL, 5 ), @@ -254,80 +254,80 @@ VALUES SET @caselastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/case&reset=1', 'Dashboard', 'Dashboard', 'access my cases and activities,access all cases and activities', 'OR', @caselastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/case/add&reset=1&action=add&atype=13&context=standalone', 'New Case', 'New Case', 'add cases,access all cases and activities', 'OR', @caselastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/case&reset=1', 'Dashboard', 'Dashboard', 'access my cases and activities,access all cases and activities', 'OR', @caselastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/case/add&reset=1&action=add&atype=13&context=standalone', 'New Case', 'New Case', 'add cases,access all cases and activities', 'OR', @caselastID, '1', NULL, 2 ), ( @domainID, 'civicrm/case/search&reset=1', 'Find Cases', 'Find Cases', 'access my cases and activities,access all cases and activities', 'OR', @caselastID, '1', 1, 3 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Grants', 'Grants', 'access CiviGrant', '', NULL, '1', NULL, 90 ); SET @grantlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/grant&reset=1', 'Dashboard', 'Dashboard', 'access CiviGrant', '', @grantlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/grant/add&reset=1&action=add&context=standalone', 'New Grant', 'New Grant', 'access CiviGrant,edit grants', 'AND', @grantlastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/grant&reset=1', 'Dashboard', 'Dashboard', 'access CiviGrant', '', @grantlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/grant/add&reset=1&action=add&context=standalone', 'New Grant', 'New Grant', 'access CiviGrant,edit grants', 'AND', @grantlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/grant/search&reset=1', 'Find Grants', 'Find Grants', 'access CiviGrant', '', @grantlastID, '1', 1, 3 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Administer', 'Administer', 'administer CiviCRM', '', NULL, '1', NULL, 100 ); SET @adminlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin&reset=1', 'Administration Console', 'Administration Console', 'administer CiviCRM', '', @adminlastID, '1', NULL, 1 ); SET @adminConsolelastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/configtask&reset=1', 'Configuration Checklist', 'Configuration Checklist', 'administer CiviCRM', '', @adminConsolelastID, '1', NULL, 1 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Customize Data and Screens', 'Customize Data and Screens', 'administer CiviCRM', '', @adminlastID, '1', NULL, 3 ); SET @CustomizelastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/admin/custom/group&reset=1', 'Custom Fields', 'Custom Fields', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/uf/group&reset=1', 'Profiles', 'Profiles', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/tag&reset=1', 'Tags (Categories)', 'Tags (Categories)', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/admin/options/activity_type&reset=1&group=activity_type', 'Activity Types', 'Activity Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 4 ), - ( @domainID, 'civicrm/admin/reltype&reset=1', 'Relationship Types', 'Relationship Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/admin/custom/group&reset=1', 'Custom Fields', 'Custom Fields', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/uf/group&reset=1', 'Profiles', 'Profiles', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/admin/tag&reset=1', 'Tags (Categories)', 'Tags (Categories)', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/admin/options/activity_type&reset=1&group=activity_type', 'Activity Types', 'Activity Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 4 ), + ( @domainID, 'civicrm/admin/reltype&reset=1', 'Relationship Types', 'Relationship Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/options/subtype&reset=1', 'Contact Types','Contact Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/setting/preferences/display&reset=1', 'Display Preferences', 'Display Preferences', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 9 ), - ( @domainID, 'civicrm/admin/setting/search&reset=1', 'Search Preferences', 'Search Preferences', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 10 ), - ( @domainID, 'civicrm/admin/menu&reset=1', 'Navigation Menu', 'Navigation Menu', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 11 ), + ( @domainID, 'civicrm/admin/setting/preferences/display&reset=1', 'Display Preferences', 'Display Preferences', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 9 ), + ( @domainID, 'civicrm/admin/setting/search&reset=1', 'Search Preferences', 'Search Preferences', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 10 ), + ( @domainID, 'civicrm/admin/menu&reset=1', 'Navigation Menu', 'Navigation Menu', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 11 ), ( @domainID, 'civicrm/admin/options/wordreplacements&reset=1','Word Replacements','Word Replacements', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 12 ), ( @domainID, 'civicrm/admin/options/custom_search&reset=1&group=custom_search', 'Manage Custom Searches', 'Manage Custom Searches', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 13 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Dropdown Options', 'Dropdown Options', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 8 ); - + SET @optionListlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/options/gender&reset=1&group=gender', 'Gender Options', 'Gender Options', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/options/individual_prefix&group=individual_prefix&reset=1', 'Individual Prefixes (Ms, Mr...)', 'Individual Prefixes (Ms, Mr...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/options/individual_suffix&group=individual_suffix&reset=1', 'Individual Suffixes (Jr, Sr...)', 'Individual Suffixes (Jr, Sr...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/admin/options/instant_messenger_service&group=instant_messenger_service&reset=1', 'Instant Messenger Services', 'Instant Messenger Services', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 4 ), - ( @domainID, 'civicrm/admin/locationType&reset=1', 'Location Types (Home, Work...)', 'Location Types (Home, Work...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 5 ), - ( @domainID, 'civicrm/admin/options/mobile_provider&group=mobile_provider&reset=1', 'Mobile Phone Providers', 'Mobile Phone Providers', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/options/phone_type&group=phone_type&reset=1', 'Phone Types', 'Phone Types', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 7 ), +VALUES + ( @domainID, 'civicrm/admin/options/gender&reset=1&group=gender', 'Gender Options', 'Gender Options', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/options/individual_prefix&group=individual_prefix&reset=1', 'Individual Prefixes (Ms, Mr...)', 'Individual Prefixes (Ms, Mr...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/admin/options/individual_suffix&group=individual_suffix&reset=1', 'Individual Suffixes (Jr, Sr...)', 'Individual Suffixes (Jr, Sr...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/admin/options/instant_messenger_service&group=instant_messenger_service&reset=1', 'Instant Messenger Services', 'Instant Messenger Services', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 4 ), + ( @domainID, 'civicrm/admin/locationType&reset=1', 'Location Types (Home, Work...)', 'Location Types (Home, Work...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/admin/options/mobile_provider&group=mobile_provider&reset=1', 'Mobile Phone Providers', 'Mobile Phone Providers', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/admin/options/phone_type&group=phone_type&reset=1', 'Phone Types', 'Phone Types', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 7 ), ( @domainID, 'civicrm/admin/options/website_type&group=website_type&reset=1', 'Website Types', 'Website Types', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 8 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES @@ -336,41 +336,41 @@ VALUES SET @communicationslastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/domain&action=update&reset=1', 'Organization Address and Contact Info', 'Organization Address and Contact Info', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/options/from_email_address&group=from_email_address&reset=1', 'FROM Email Addresses', 'FROM Email Addresses', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 3 ), +VALUES + ( @domainID, 'civicrm/admin/domain&action=update&reset=1', 'Organization Address and Contact Info', 'Organization Address and Contact Info', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/options/from_email_address&group=from_email_address&reset=1', 'FROM Email Addresses', 'FROM Email Addresses', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/scheduleReminders&reset=1', 'Schedule Reminders', 'Schedule Reminders', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 4 ), ( @domainID, 'civicrm/admin/options/preferred_communication_method&group=preferred_communication_method&reset=1', 'Preferred Communication Methods', 'Preferred Communication Methods', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/labelFormats&reset=1', 'Label Formats', 'Label Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/pdfFormats&reset=1', 'Print Page (PDF) Formats', 'Print Page (PDF) Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 7 ), - ( @domainID, 'civicrm/admin/options/email_greeting&group=email_greeting&reset=1', 'Email Greeting Formats', 'Email Greeting Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 8 ), - ( @domainID, 'civicrm/admin/options/postal_greeting&group=postal_greeting&reset=1', 'Postal Greeting Formats', 'Postal Greeting Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 9 ), + ( @domainID, 'civicrm/admin/pdfFormats&reset=1', 'Print Page (PDF) Formats', 'Print Page (PDF) Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 7 ), + ( @domainID, 'civicrm/admin/options/email_greeting&group=email_greeting&reset=1', 'Email Greeting Formats', 'Email Greeting Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/admin/options/postal_greeting&group=postal_greeting&reset=1', 'Postal Greeting Formats', 'Postal Greeting Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 9 ), ( @domainID, 'civicrm/admin/options/addressee&group=addressee&reset=1', 'Addressee Formats', 'Addressee Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 10 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Localization', 'Localization', 'administer CiviCRM', '', @adminlastID, '1', NULL, 6 ); SET @locallastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/setting/localization&reset=1', 'Languages, Currency, Locations', 'Languages, Currency, Locations', 'administer CiviCRM', '', @locallastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/setting/preferences/address&reset=1', 'Address Settings', 'Address Settings', 'administer CiviCRM', '', @locallastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/admin/setting/localization&reset=1', 'Languages, Currency, Locations', 'Languages, Currency, Locations', 'administer CiviCRM', '', @locallastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/setting/preferences/address&reset=1', 'Address Settings', 'Address Settings', 'administer CiviCRM', '', @locallastID, '1', NULL, 2 ), ( @domainID, 'civicrm/admin/setting/date&reset=1', 'Date Formats', 'Date Formats', 'administer CiviCRM', '', @locallastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/options/languages&group=languages&reset=1', 'Preferred Language Options', 'Preferred Language Options', 'administer CiviCRM', '', @locallastID, '1', NULL, 4 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Users and Permissions', 'Users and Permissions', 'administer CiviCRM', '', @adminlastID, '1', NULL, 7 ); SET @usersPermslastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/access&reset=1', 'Permissions (Access Control)', 'Permissions (Access Control)', 'administer CiviCRM', '', @usersPermslastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/synchUser&reset=1', 'Synchronize Users to Contacts', 'Synchronize Users to Contacts', 'administer CiviCRM', '', @usersPermslastID, '1', NULL, 2 ); @@ -383,19 +383,19 @@ SET @systemSettingslastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/admin/setting/component&reset=1', 'Enable CiviCRM Components', 'Enable Components', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/setting/component&reset=1', 'Enable CiviCRM Components', 'Enable Components', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/extensions&reset=1', 'Manage Extensions', 'Manage Extensions', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/setting/smtp&reset=1', 'Outbound Email (SMTP/Sendmail)', 'Outbound Email', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/admin/paymentProcessor&reset=1', 'Payment Processors', 'Payment Processors', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 4 ), - ( @domainID, 'civicrm/admin/setting/mapping&reset=1', 'Mapping and Geocoding', 'Mapping and Geocoding', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 5 ), - ( @domainID, 'civicrm/admin/setting/misc&reset=1', 'Undelete, Logging and ReCAPTCHA', 'Undelete, Logging and ReCAPTCHA', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/setting/path&reset=1', 'Directories', 'Directories', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 7 ), - ( @domainID, 'civicrm/admin/setting/url&reset=1', 'Resource URLs', 'Resource URLs', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/admin/setting/smtp&reset=1', 'Outbound Email (SMTP/Sendmail)', 'Outbound Email', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/admin/paymentProcessor&reset=1', 'Payment Processors', 'Payment Processors', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 4 ), + ( @domainID, 'civicrm/admin/setting/mapping&reset=1', 'Mapping and Geocoding', 'Mapping and Geocoding', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/admin/setting/misc&reset=1', 'Undelete, Logging and ReCAPTCHA', 'Undelete, Logging and ReCAPTCHA', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/admin/setting/path&reset=1', 'Directories', 'Directories', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 7 ), + ( @domainID, 'civicrm/admin/setting/url&reset=1', 'Resource URLs', 'Resource URLs', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 8 ), ( @domainID, 'civicrm/admin/setting/updateConfigBackend&reset=1', 'Cleanup Caches and Update Paths', 'Cleanup Caches and Update Paths', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 9 ), - ( @domainID, 'civicrm/admin/setting/uf&reset=1', 'CMS Database Integration', 'CMS Integration', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 10 ), - ( @domainID, 'civicrm/admin/options/safe_file_extension&group=safe_file_extension&reset=1', 'Safe File Extensions', 'Safe File Extensions','administer CiviCRM', '',@systemSettingslastID, '1', NULL, 11 ), - ( @domainID, 'civicrm/admin/options?reset=1', 'Option Groups', 'Option Groups', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 12 ), - ( @domainID, 'civicrm/admin/mapping&reset=1', 'Import/Export Mappings', 'Import/Export Mappings', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 13 ), + ( @domainID, 'civicrm/admin/setting/uf&reset=1', 'CMS Database Integration', 'CMS Integration', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 10 ), + ( @domainID, 'civicrm/admin/options/safe_file_extension&group=safe_file_extension&reset=1', 'Safe File Extensions', 'Safe File Extensions','administer CiviCRM', '',@systemSettingslastID, '1', NULL, 11 ), + ( @domainID, 'civicrm/admin/options?reset=1', 'Option Groups', 'Option Groups', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 12 ), + ( @domainID, 'civicrm/admin/mapping&reset=1', 'Import/Export Mappings', 'Import/Export Mappings', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 13 ), ( @domainID, 'civicrm/admin/setting/debug&reset=1', 'Debugging and Error Handling','Debugging and Error Handling', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 14 ), ( @domainID, 'civicrm/admin/setting/preferences/multisite&reset=1', 'Multi Site Settings', 'Multi Site Settings', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 15 ), ( @domainID, 'civicrm/admin/job&reset=1', 'Scheduled Jobs', 'Scheduled Jobs', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 16 ), @@ -405,13 +405,13 @@ VALUES -- begin component admin menus INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviCampaign', 'CiviCampaign', 'administer CiviCampaign,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 9 ); SET @adminCampaignlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/campaign/surveyType&reset=1', 'Survey Types', 'Survey Types', 'administer CiviCampaign', '', @adminCampaignlastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/options/campaign_type&group=campaign_type&reset=1', 'Campaign Types', 'Campaign Types', 'administer CiviCampaign', '', @adminCampaignlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/admin/options/campaign_status&group=campaign_status&reset=1', 'Campaign Status', 'Campaign Status', 'administer CiviCampaign', '', @adminCampaignlastID, '1', NULL, 3 ), @@ -420,33 +420,33 @@ VALUES INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviCase', 'CiviCase', 'administer CiviCase', NULL, @adminlastID, '1', NULL, 10 ); SET @adminCaselastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/options/case_type&group=case_type&reset=1', 'Case Types', 'Case Types', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 1 ), +VALUES + ( @domainID, 'civicrm/admin/options/case_type&group=case_type&reset=1', 'Case Types', 'Case Types', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/options/redaction_rule&group=redaction_rule&reset=1', 'Redaction Rules', 'Redaction Rules', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 2 ), ( @domainID, 'civicrm/admin/options/case_status&group=case_status&reset=1', 'Case Statuses', 'Case Statuses', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/options/encounter_medium&group=encounter_medium&reset=1', 'Encounter Medium', 'Encounter Medium', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 4 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviContribute', 'CiviContribute', 'access CiviContribute,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 11 ); - + SET @adminContributelastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/admin/contribute&reset=1&action=add', 'New Contribution Page', 'New Contribution Page', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/contribute&reset=1', 'Manage Contribution Pages', 'Manage Contribution Pages', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', '1', 7 ), - ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=contribute', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 8 ), - ( @domainID, 'civicrm/admin/contribute/managePremiums&reset=1', 'Premiums (Thank-you Gifts)', 'Premiums', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', 1, 9 ), - ( @domainID, 'civicrm/admin/contribute/contributionType&reset=1', 'Contribution Types', 'Contribution Types', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 10), - ( @domainID, 'civicrm/admin/options/payment_instrument&group=payment_instrument&reset=1', 'Payment Instruments', 'Payment Instruments', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 11 ), + ( @domainID, 'civicrm/admin/contribute&reset=1&action=add', 'New Contribution Page', 'New Contribution Page', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/admin/contribute&reset=1', 'Manage Contribution Pages', 'Manage Contribution Pages', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', '1', 7 ), + ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=contribute', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/admin/contribute/managePremiums&reset=1', 'Premiums (Thank-you Gifts)', 'Premiums', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', 1, 9 ), + ( @domainID, 'civicrm/admin/contribute/contributionType&reset=1', 'Contribution Types', 'Contribution Types', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 10), + ( @domainID, 'civicrm/admin/options/payment_instrument&group=payment_instrument&reset=1', 'Payment Instruments', 'Payment Instruments', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 11 ), ( @domainID, 'civicrm/admin/options/accept_creditcard&group=accept_creditcard&reset=1', 'Accepted Credit Cards', 'Accepted Credit Cards', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', 1, 12 ), ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 13 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 14 ), @@ -454,64 +454,64 @@ VALUES INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviEvent', 'CiviEvent', 'access CiviEvent,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 12 ); SET @adminEventlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/event/add&reset=1&action=add', 'New Event', 'New Event', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/event/manage&reset=1', 'Manage Events', 'Manage Events', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 2 ), +VALUES + ( @domainID, 'civicrm/event/add&reset=1&action=add', 'New Event', 'New Event', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/event/manage&reset=1', 'Manage Events', 'Manage Events', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 2 ), ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=event', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 3 ), - ( @domainID, 'civicrm/admin/eventTemplate&reset=1', 'Event Templates', 'Event Templates', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 4 ), - ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/admin/eventTemplate&reset=1', 'Event Templates', 'Event Templates', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 4 ), + ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 6 ), - ( @domainID, 'civicrm/admin/options/event_type&group=event_type&reset=1', 'Event Types', 'Event Types', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 7 ), - ( @domainID, 'civicrm/admin/participant_status&reset=1', 'Participant Statuses', 'Participant Statuses', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/admin/options/event_type&group=event_type&reset=1', 'Event Types', 'Event Types', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 7 ), + ( @domainID, 'civicrm/admin/participant_status&reset=1', 'Participant Statuses', 'Participant Statuses', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 8 ), ( @domainID, 'civicrm/admin/options/participant_role&group=participant_role&reset=1', 'Participant Roles', 'Participant Roles', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 9 ), - ( @domainID, 'civicrm/admin/options/participant_listing&group=participant_listing&reset=1', 'Participant Listing Options', 'Participant Listing Options', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 10 ), - ( @domainID, 'civicrm/admin/options/event_badge&group=event_badge&reset=1', 'Event Badge Formats', 'Event Badge Formats', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 11 ), + ( @domainID, 'civicrm/admin/options/participant_listing&group=participant_listing&reset=1', 'Participant Listing Options', 'Participant Listing Options', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 10 ), + ( @domainID, 'civicrm/admin/options/event_badge&group=event_badge&reset=1', 'Event Badge Formats', 'Event Badge Formats', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 11 ), ( @domainID, 'civicrm/admin/paymentProcessor&reset=1', 'Payment Processors', 'Payment Processors', 'administer CiviCRM', '', @adminEventlastID, '1', NULL, 12), ( @domainID, 'civicrm/admin/setting/preferences/event&reset=1', 'CiviEvent Component Settings', 'CiviEvent Component Settings','access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 13 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviGrant', 'CiviGrant', 'access CiviGrant,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 13 ); SET @adminGrantlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/options/grant_type&group=grant_type&reset=1', 'Grant Types', 'Grant Types', 'access CiviGrant,administer CiviCRM', 'AND', @adminGrantlastID, '1', NULL, 1 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviMail', 'CiviMail', 'access CiviMail,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 14 ); SET @adminMailinglastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/component&reset=1', 'Headers, Footers, and Automated Messages', 'Headers, Footers, and Automated Messages', 'access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @adminMailinglastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/options/from_email&group=from_email_address&reset=1', 'From Email Addresses', 'From Email Addresses', 'administer CiviCRM', '', @adminMailinglastID, '1', NULL, 3 ), +VALUES + ( @domainID, 'civicrm/admin/component&reset=1', 'Headers, Footers, and Automated Messages', 'Headers, Footers, and Automated Messages', 'access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @adminMailinglastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/admin/options/from_email&group=from_email_address&reset=1', 'From Email Addresses', 'From Email Addresses', 'administer CiviCRM', '', @adminMailinglastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/mailSettings&reset=1', 'Mail Accounts', 'Mail Accounts', 'access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 4 ), ( @domainID, 'civicrm/admin/mail&reset=1', 'Mailer Settings', 'Mailer Settings', 'access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/setting/preferences/mailing&reset=1', 'CiviMail Component Settings', 'CiviMail Component Settings','access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 6 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviMember', 'CiviMember', 'access CiviMember,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 15 ); SET @adminMemberlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/member/membershipType&reset=1', 'Membership Types', 'Membership Types', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', NULL, 1 ), +VALUES + ( @domainID, 'civicrm/admin/member/membershipType&reset=1', 'Membership Types', 'Membership Types', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/member/membershipStatus&reset=1', 'Membership Status Rules', 'Membership Status Rules', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', 1, 2 ), ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', NULL, 4 ), @@ -519,48 +519,48 @@ VALUES INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviReport', 'CiviReport', 'access CiviReport,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 16 ); SET @adminReportlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/report/list&reset=1', 'Reports Listing', 'Reports Listing', 'access CiviReport', '', @adminReportlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/report/template/list&reset=1', 'Create Reports from Templates', 'Create Reports from Templates', 'administer Reports', '', @adminReportlastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/report/list&reset=1', 'Reports Listing', 'Reports Listing', 'access CiviReport', '', @adminReportlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/report/template/list&reset=1', 'Create Reports from Templates', 'Create Reports from Templates', 'administer Reports', '', @adminReportlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/admin/report/options/report_template&reset=1', 'Manage Templates', 'Manage Templates', 'administer Reports', '', @adminReportlastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/report/register&reset=1', 'Register Report', 'Register Report', 'administer Reports', '', @adminReportlastID, '1', NULL, 4 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Help', 'Help', NULL, '', NULL, '1', NULL, 110); SET @adminHelplastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'http://documentation.civicrm.org', 'Documentation', 'Documentation', NULL, 'AND', @adminHelplastID, '1', NULL, 1 ), - ( @domainID, 'http://forum.civicrm.org', 'Community Forums', 'Community Forums', NULL, 'AND', @adminHelplastID, '1', NULL, 2 ), - ( @domainID, 'http://civicrm.org/participate', 'Participate', 'Participate', NULL, 'AND', @adminHelplastID, '1', NULL, 3 ), +VALUES + ( @domainID, 'http://documentation.civicrm.org', 'Documentation', 'Documentation', NULL, 'AND', @adminHelplastID, '1', NULL, 1 ), + ( @domainID, 'http://forum.civicrm.org', 'Community Forums', 'Community Forums', NULL, 'AND', @adminHelplastID, '1', NULL, 2 ), + ( @domainID, 'http://civicrm.org/participate', 'Participate', 'Participate', NULL, 'AND', @adminHelplastID, '1', NULL, 3 ), ( @domainID, 'http://civicrm.org/aboutcivicrm', 'About', 'About', NULL, 'AND', @adminHelplastID, '1', NULL, 4 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Reports', 'Reports', 'access CiviReport', '', NULL, '1', NULL, 95 ); SET @reportlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/report/list&reset=1', 'Reports Listing', 'Reports Listing', 'access CiviReport', '', @reportlastID, '1', 1, 1 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/report/template/list&reset=1', 'Create Reports from Templates', 'Create Reports from Templates', 'administer Reports', '', @reportlastID, '1', 1, 2 ); - + -- sample reports with navigation menus INSERT INTO `civicrm_report_instance` @@ -588,12 +588,12 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Activity Report ', 'activity', 'Provides a list of constituent activity including activity statistics for one/all contacts during a given date range(required)', 'administer CiviCRM', 'a:26:{s:6:"fields";a:6:{s:16:"contact_assignee";s:1:"1";s:14:"contact_target";s:1:"1";s:16:"activity_type_id";s:1:"1";s:16:"activity_subject";s:1:"1";s:18:"activity_date_time";s:1:"1";s:9:"status_id";s:1:"1";}s:17:"contact_source_op";s:3:"has";s:20:"contact_source_value";s:0:"";s:19:"contact_assignee_op";s:3:"has";s:22:"contact_assignee_value";s:0:"";s:17:"contact_target_op";s:3:"has";s:20:"contact_target_value";s:0:"";s:15:"current_user_op";s:2:"eq";s:18:"current_user_value";s:1:"0";s:27:"activity_date_time_relative";s:10:"this.month";s:23:"activity_date_time_from";s:0:"";s:21:"activity_date_time_to";s:0:"";s:19:"activity_subject_op";s:3:"has";s:22:"activity_subject_value";s:0:"";s:19:"activity_type_id_op";s:2:"in";s:22:"activity_type_id_value";a:0:{}s:12:"status_id_op";s:2:"in";s:15:"status_id_value";a:0:{}s:11:"description";s:126:"Provides a list of constituent activity including activity statistics for one/all contacts during a given date range(required)";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:18:"administer CiviCRM";s:6:"groups";s:0:"";s:9:"group_bys";N;s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Activity Report', 'activity', 'administer CiviCRM', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; @@ -604,7 +604,7 @@ VALUES SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Current Employer Report', 'Current Employer Report', 'administer CiviCRM', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; @@ -671,52 +671,52 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'LYBUNT Report', 'contribute/lybunt', 'Last year but not this year. Provides a list of constituents who donated last year but did not donate during the time period you specify as the current year.', 'access CiviContribute', 'a:19:{s:6:"fields";a:3:{s:9:"sort_name";s:1:"1";s:5:"email";s:1:"1";s:5:"phone";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"yid_op";s:2:"eq";s:9:"yid_value";s:4:"2011";s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:157:"Last year but not this year. Provides a list of constituents who donated last year but did not donate during the time period you specify as the current year.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:6:"charts";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'LYBUNT Report', 'LYBUNT Report', 'access CiviContribute', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Contributions by Organization Report', 'contribute/organizationSummary', 'Displays a detailed list of contributions grouped by organization, which includes contributions made by employees for the organisation.', 'access CiviContribute', 'a:20:{s:6:"fields";a:5:{s:17:"organization_name";s:1:"1";s:9:"sort_name";s:1:"1";s:12:"total_amount";s:1:"1";s:22:"contribution_status_id";s:1:"1";s:12:"receive_date";s:1:"1";}s:20:"organization_name_op";s:3:"has";s:23:"organization_name_value";s:0:"";s:23:"relationship_type_id_op";s:2:"eq";s:26:"relationship_type_id_value";s:5:"4_b_a";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:11:"description";s:193:"Displays a detailed contribution report for Organization relationships with contributors, as to if contribution done was from an employee of some organization or from that Organization itself.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Contributions by Organization Report', 'Contributions by Organization Report', 'access CiviContribute', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Contributions by Household Report', 'contribute/householdSummary', 'Displays a detailed list of contributions grouped by household which includes contributions made by members of the household.', 'access CiviContribute', 'a:21:{s:6:"fields";a:5:{s:14:"household_name";s:1:"1";s:9:"sort_name";s:1:"1";s:12:"total_amount";s:1:"1";s:22:"contribution_status_id";s:1:"1";s:12:"receive_date";s:1:"1";}s:17:"household_name_op";s:3:"has";s:20:"household_name_value";s:0:"";s:23:"relationship_type_id_op";s:2:"eq";s:26:"relationship_type_id_value";s:5:"6_b_a";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:11:"description";s:213:"Provides a detailed report for Contributions made by contributors(Or Household itself) who are having a relationship with household (For ex a Contributor is Head of Household for some household or is a member of.)";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Contributions by Household Report', 'Contributions by Household Report', 'access CiviContribute', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Top Donors Report', 'contribute/topDonor', 'Provides a list of the top donors during a time period you define. You can include as many donors as you want (for example, top 100 of your donors).', 'access CiviContribute', 'a:20:{s:6:"fields";a:2:{s:12:"display_name";s:1:"1";s:12:"total_amount";s:1:"1";}s:21:"receive_date_relative";s:9:"this.year";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:15:"total_range_min";s:0:"";s:15:"total_range_max";s:0:"";s:14:"total_range_op";s:2:"eq";s:17:"total_range_value";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:11:"description";s:148:"Provides a list of the top donors during a time period you define. You can include as many donors as you want (for example, top 100 of your donors).";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Top Donors Report', 'Top Donors Report', 'access CiviContribute', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Soft Credit Report', 'contribute/softcredit', 'Shows contributions made by contacts that have been soft-credited to other contacts.', 'access CiviContribute', 'a:23:{s:6:"fields";a:5:{s:21:"display_name_creditor";s:1:"1";s:24:"display_name_constituent";s:1:"1";s:14:"email_creditor";s:1:"1";s:14:"phone_creditor";s:1:"1";s:12:"total_amount";s:1:"1";}s:5:"id_op";s:2:"in";s:8:"id_value";a:0:{}s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:20:"Soft Credit details.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -728,7 +728,7 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Personal Campaign Page Summary', 'contribute/pcp', 'Summarizes amount raised and number of contributors for each Personal Campaign Page.', 'access CiviContribute', 'a:22:{s:6:"fields";a:8:{s:9:"sort_name";s:1:"1";s:10:"page_title";s:1:"1";s:5:"title";s:1:"1";s:11:"goal_amount";s:1:"1";s:8:"amount_1";s:1:"1";s:8:"amount_2";s:1:"1";s:7:"soft_id";s:1:"1";s:12:"receive_date";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:13:"page_title_op";s:3:"has";s:16:"page_title_value";s:0:"";s:8:"title_op";s:3:"has";s:11:"title_value";s:0:"";s:12:"amount_2_min";s:0:"";s:12:"amount_2_max";s:0:"";s:11:"amount_2_op";s:3:"lte";s:14:"amount_2_value";s:0:"";s:11:"description";s:35:"Shows Personal Campaign Page Report";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -740,29 +740,29 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Pledge Summary Report', 'pledge/detail', 'Summary of pledges including amount pledged, pledge status, next payment date, balance due, total amount paid etc.', 'access CiviPledge', 'a:27:{s:6:"fields";a:4:{s:9:"sort_name";s:1:"1";s:10:"country_id";s:1:"1";s:6:"amount";s:1:"1";s:9:"status_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:27:"pledge_create_date_relative";s:1:"0";s:23:"pledge_create_date_from";s:0:"";s:21:"pledge_create_date_to";s:0:"";s:17:"pledge_amount_min";s:0:"";s:17:"pledge_amount_max";s:0:"";s:16:"pledge_amount_op";s:3:"lte";s:19:"pledge_amount_value";s:0:"";s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:13:"Pledge Report";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviPledge";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Pledge Summary Report', 'Pledge Summary Report', 'access CiviPledge', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Pledged But not Paid Report', 'pledge/pbnp', 'Pledged but not Paid Report', 'access CiviPledge', 'a:17:{s:6:"fields";a:5:{s:9:"sort_name";s:1:"1";s:18:"pledge_create_date";s:1:"1";s:6:"amount";s:1:"1";s:14:"scheduled_date";s:1:"1";s:10:"country_id";s:1:"1";}s:27:"pledge_create_date_relative";s:1:"0";s:23:"pledge_create_date_from";s:0:"";s:21:"pledge_create_date_to";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:27:"Pledged but not Paid Report";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviPledge";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Pledged But not Paid Report', 'Pledged But not Paid Report', 'access CiviPledge', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Bookkeeping Transactions Report', 'contribute/bookkeeping', 'Shows Bookkeeping Transactions Report', 'access CiviContribute', 'a:25:{s:6:"fields";a:10:{s:9:"sort_name";s:1:"1";s:12:"receive_date";s:1:"1";s:12:"total_amount";s:1:"1";s:20:"contribution_type_id";s:1:"1";s:7:"trxn_id";s:1:"1";s:10:"invoice_id";s:1:"1";s:12:"check_number";s:1:"1";s:21:"payment_instrument_id";s:1:"1";s:22:"contribution_status_id";s:1:"1";s:2:"id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:11:"description";s:37:"Shows Bookkeeping Transactions Report";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -775,7 +775,7 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Membership Report (Summary)', 'member/summary', 'Provides a summary of memberships by type and join date.', 'access CiviMember', 'a:18:{s:6:"fields";a:2:{s:18:"membership_type_id";s:1:"1";s:12:"total_amount";s:1:"1";}s:18:"join_date_relative";s:1:"0";s:14:"join_date_from";s:0:"";s:12:"join_date_to";s:0:"";s:21:"membership_type_id_op";s:2:"in";s:24:"membership_type_id_value";a:0:{}s:12:"status_id_op";s:2:"in";s:15:"status_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:0:{}s:9:"group_bys";a:2:{s:9:"join_date";s:1:"1";s:18:"membership_type_id";s:1:"1";}s:14:"group_bys_freq";a:1:{s:9:"join_date";s:5:"MONTH";}s:11:"description";s:56:"Provides a summary of memberships by type and join date.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviMember";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -787,19 +787,19 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Membership Report (Detail)', 'member/detail', 'Provides a list of members along with their membership status and membership details (Join Date, Start Date, End Date). Can also display contributions (payments) associated with each membership.', 'access CiviMember', 'a:28:{s:6:"fields";a:5:{s:9:"sort_name";s:1:"1";s:18:"membership_type_id";s:1:"1";s:21:"membership_start_date";s:1:"1";s:19:"membership_end_date";s:1:"1";s:4:"name";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:18:"join_date_relative";s:1:"0";s:14:"join_date_from";s:0:"";s:12:"join_date_to";s:0:"";s:23:"owner_membership_id_min";s:0:"";s:23:"owner_membership_id_max";s:0:"";s:22:"owner_membership_id_op";s:3:"lte";s:25:"owner_membership_id_value";s:0:"";s:6:"tid_op";s:2:"in";s:9:"tid_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:119:"Provides a list of members along with their membership status and membership details (Join Date, Start Date, End Date).";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviMember";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Membership Report (Detail)', 'Membership Report (Detail)', 'access CiviMember', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; -- contribution and membership report INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Contribution and Membership Details', 'member/contributionDetail', 'Contribution details for any type of contribution, plus associated membership information for contributions which are in payment for memberships.', '', 'a:67:{s:6:"fields";a:12:{s:9:"sort_name";s:1:"1";s:5:"email";s:1:"1";s:5:"phone";s:1:"1";s:20:"contribution_type_id";s:1:"1";s:12:"receive_date";s:1:"1";s:12:"total_amount";s:1:"1";s:18:"membership_type_id";s:1:"1";s:21:"membership_start_date";s:1:"1";s:19:"membership_end_date";s:1:"1";s:9:"join_date";s:1:"1";s:22:"membership_status_name";s:1:"1";s:10:"country_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:24:"payment_instrument_id_op";s:2:"in";s:27:"payment_instrument_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:0:{}s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:13:"ordinality_op";s:2:"in";s:16:"ordinality_value";a:0:{}s:18:"join_date_relative";s:1:"0";s:14:"join_date_from";s:0:"";s:12:"join_date_to";s:0:"";s:30:"membership_start_date_relative";s:1:"0";s:26:"membership_start_date_from";s:0:"";s:24:"membership_start_date_to";s:0:"";s:28:"membership_end_date_relative";s:1:"0";s:24:"membership_end_date_from";s:0:"";s:22:"membership_end_date_to";s:0:"";s:23:"owner_membership_id_min";s:0:"";s:23:"owner_membership_id_max";s:0:"";s:22:"owner_membership_id_op";s:3:"lte";s:25:"owner_membership_id_value";s:0:"";s:6:"tid_op";s:2:"in";s:9:"tid_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:17:"street_number_min";s:0:"";s:17:"street_number_max";s:0:"";s:16:"street_number_op";s:3:"lte";s:19:"street_number_value";s:0:"";s:14:"street_name_op";s:3:"has";s:17:"street_name_value";s:0:"";s:15:"postal_code_min";s:0:"";s:15:"postal_code_max";s:0:"";s:14:"postal_code_op";s:3:"lte";s:17:"postal_code_value";s:0:"";s:7:"city_op";s:3:"has";s:10:"city_value";s:0:"";s:12:"county_id_op";s:2:"in";s:15:"county_id_value";a:0:{}s:20:"state_province_id_op";s:2:"in";s:23:"state_province_id_value";a:0:{}s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:35:"Contribution and Membership Details";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:1:"0";s:9:"domain_id";i:1;}{s:6:"fields";a:12:{s:9:"sort_name";s:1:"1";s:5:"email";s:1:"1";s:5:"phone";s:1:"1";s:20:"contribution_type_id";s:1:"1";s:12:"receive_date";s:1:"1";s:12:"total_amount";s:1:"1";s:18:"membership_type_id";s:1:"1";s:21:"membership_start_date";s:1:"1";s:19:"membership_end_date";s:1:"1";s:9:"join_date";s:1:"1";s:22:"membership_status_name";s:1:"1";s:10:"country_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:24:"payment_instrument_id_op";s:2:"in";s:27:"payment_instrument_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:0:{}s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:13:"ordinality_op";s:2:"in";s:16:"ordinality_value";a:0:{}s:18:"join_date_relative";s:1:"0";s:14:"join_date_from";s:0:"";s:12:"join_date_to";s:0:"";s:30:"membership_start_date_relative";s:1:"0";s:26:"membership_start_date_from";s:0:"";s:24:"membership_start_date_to";s:0:"";s:28:"membership_end_date_relative";s:1:"0";s:24:"membership_end_date_from";s:0:"";s:22:"membership_end_date_to";s:0:"";s:23:"owner_membership_id_min";s:0:"";s:23:"owner_membership_id_max";s:0:"";s:22:"owner_membership_id_op";s:3:"lte";s:25:"owner_membership_id_value";s:0:"";s:6:"tid_op";s:2:"in";s:9:"tid_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:17:"street_number_min";s:0:"";s:17:"street_number_max";s:0:"";s:16:"street_number_op";s:3:"lte";s:19:"street_number_value";s:0:"";s:14:"street_name_op";s:3:"has";s:17:"street_name_value";s:0:"";s:15:"postal_code_min";s:0:"";s:15:"postal_code_max";s:0:"";s:14:"postal_code_op";s:3:"lte";s:17:"postal_code_value";s:0:"";s:7:"city_op";s:3:"has";s:10:"city_value";s:0:"";s:12:"county_id_op";s:2:"in";s:15:"county_id_value";a:0:{}s:20:"state_province_id_op";s:2:"in";s:23:"state_province_id_value";a:0:{}s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:35:"Contribution and Membership Details";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:1:"0";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -810,67 +810,67 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Membership Report (Lapsed)', 'member/lapse', 'Provides a list of memberships that lapsed or will lapse before the date you specify.', 'access CiviMember', 'a:16:{s:6:"fields";a:5:{s:9:"sort_name";s:1:"1";s:18:"membership_type_id";s:1:"1";s:19:"membership_end_date";s:1:"1";s:4:"name";s:1:"1";s:10:"country_id";s:1:"1";}s:6:"tid_op";s:2:"in";s:9:"tid_value";a:0:{}s:28:"membership_end_date_relative";s:1:"0";s:24:"membership_end_date_from";s:0:"";s:22:"membership_end_date_to";s:0:"";s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:85:"Provides a list of memberships that lapsed or will lapse before the date you specify.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviMember";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Membership Report (Lapsed)', 'Membership Report (Lapsed)', 'access CiviMember', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Event Participant Report (List)', 'event/participantListing', 'Provides lists of participants for an event.', 'access CiviEvent', 'a:27:{s:6:"fields";a:4:{s:9:"sort_name";s:1:"1";s:8:"event_id";s:1:"1";s:9:"status_id";s:1:"1";s:7:"role_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:8:"email_op";s:3:"has";s:11:"email_value";s:0:"";s:11:"event_id_op";s:2:"in";s:14:"event_id_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:6:"rid_op";s:2:"in";s:9:"rid_value";a:0:{}s:34:"participant_register_date_relative";s:1:"0";s:30:"participant_register_date_from";s:0:"";s:28:"participant_register_date_to";s:0:"";s:6:"eid_op";s:2:"in";s:9:"eid_value";a:0:{}s:11:"custom_4_op";s:2:"in";s:14:"custom_4_value";a:0:{}s:16:"blank_column_end";s:0:"";s:11:"description";s:44:"Provides lists of participants for an event.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviEvent";s:6:"groups";s:0:"";s:7:"options";N;s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Event Participant Report (List)', 'Event Participant Report (List)', 'access CiviEvent', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Event Income Report (Summary)', 'event/summary', 'Provides an overview of event income. You can include key information such as event ID, registration, attendance, and income generated to help you determine the success of an event.', 'access CiviEvent', 'a:18:{s:6:"fields";a:2:{s:5:"title";s:1:"1";s:13:"event_type_id";s:1:"1";}s:5:"id_op";s:2:"in";s:8:"id_value";a:0:{}s:16:"event_type_id_op";s:2:"in";s:19:"event_type_id_value";a:0:{}s:25:"event_start_date_relative";s:1:"0";s:21:"event_start_date_from";s:0:"";s:19:"event_start_date_to";s:0:"";s:23:"event_end_date_relative";s:1:"0";s:19:"event_end_date_from";s:0:"";s:17:"event_end_date_to";s:0:"";s:11:"description";s:181:"Provides an overview of event income. You can include key information such as event ID, registration, attendance, and income generated to help you determine the success of an event.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviEvent";s:6:"charts";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Event Income Report (Summary)', 'Event Income Report (Summary)', 'access CiviEvent', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Event Income Report (Detail)', 'event/income', 'Helps you to analyze the income generated by an event. The report can include details by participant type, status and payment method.', 'access CiviEvent', 'a:7:{s:5:"id_op";s:2:"in";s:8:"id_value";N;s:11:"description";s:133:"Helps you to analyze the income generated by an event. The report can include details by participant type, status and payment method.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviEvent";}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Event Income Report (Detail)', 'Event Income Report (Detail)', 'access CiviEvent', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Attendee List', 'event/participantListing', 'Provides lists of event attendees.', 'access CiviEvent', 'a:27:{s:6:"fields";a:4:{s:9:"sort_name";s:1:"1";s:8:"event_id";s:1:"1";s:9:"status_id";s:1:"1";s:7:"role_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:8:"email_op";s:3:"has";s:11:"email_value";s:0:"";s:11:"event_id_op";s:2:"in";s:14:"event_id_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:6:"rid_op";s:2:"in";s:9:"rid_value";a:0:{}s:34:"participant_register_date_relative";s:1:"0";s:30:"participant_register_date_from";s:0:"";s:28:"participant_register_date_to";s:0:"";s:6:"eid_op";s:2:"in";s:9:"eid_value";a:0:{}s:11:"custom_4_op";s:2:"in";s:14:"custom_4_value";a:0:{}s:16:"blank_column_end";s:0:"";s:11:"description";s:44:"Provides lists of participants for an event.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviEvent";s:6:"groups";s:0:"";s:7:"options";N;s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Attendee List', 'Attendee List', 'access CiviEvent', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Grant Report (Detail)', 'grant/detail', 'Grant Report Detail', 'access CiviGrant', 'a:40:{s:6:"fields";a:2:{s:9:"sort_name";s:1:"1";s:25:"application_received_date";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:12:"gender_id_op";s:2:"in";s:15:"gender_id_value";a:0:{}s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:20:"state_province_id_op";s:2:"in";s:23:"state_province_id_value";a:0:{}s:13:"grant_type_op";s:2:"in";s:16:"grant_type_value";a:0:{}s:12:"status_id_op";s:2:"in";s:15:"status_id_value";a:0:{}s:18:"amount_granted_min";s:0:"";s:18:"amount_granted_max";s:0:"";s:17:"amount_granted_op";s:3:"lte";s:20:"amount_granted_value";s:0:"";s:20:"amount_requested_min";s:0:"";s:20:"amount_requested_max";s:0:"";s:19:"amount_requested_op";s:3:"lte";s:22:"amount_requested_value";s:0:"";s:34:"application_received_date_relative";s:1:"0";s:30:"application_received_date_from";s:0:"";s:28:"application_received_date_to";s:0:"";s:28:"money_transfer_date_relative";s:1:"0";s:24:"money_transfer_date_from";s:0:"";s:22:"money_transfer_date_to";s:0:"";s:23:"grant_due_date_relative";s:1:"0";s:19:"grant_due_date_from";s:0:"";s:17:"grant_due_date_to";s:0:"";s:11:"description";s:19:"Grant Report Detail";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviGrant";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID( ); INSERT INTO civicrm_navigation @@ -882,7 +882,7 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Grant Report (Statistics)', 'grant/statistics', 'Grant Report Statistics', 'access CiviGrant', 'a:42:{s:6:"fields";a:2:{s:18:"summary_statistics";s:1:"1";s:13:"grant_type_id";s:1:"1";}s:34:"application_received_date_relative";s:1:"0";s:30:"application_received_date_from";s:0:"";s:28:"application_received_date_to";s:0:"";s:22:"decision_date_relative";s:1:"0";s:18:"decision_date_from";s:0:"";s:16:"decision_date_to";s:0:"";s:28:"money_transfer_date_relative";s:1:"0";s:24:"money_transfer_date_from";s:0:"";s:22:"money_transfer_date_to";s:0:"";s:23:"grant_due_date_relative";s:1:"0";s:19:"grant_due_date_from";s:0:"";s:17:"grant_due_date_to";s:0:"";s:13:"grant_type_op";s:2:"in";s:16:"grant_type_value";a:0:{}s:12:"status_id_op";s:2:"in";s:15:"status_id_value";a:0:{}s:20:"amount_requested_min";s:0:"";s:20:"amount_requested_max";s:0:"";s:19:"amount_requested_op";s:3:"lte";s:22:"amount_requested_value";s:0:"";s:18:"amount_granted_min";s:0:"";s:18:"amount_granted_max";s:0:"";s:17:"amount_granted_op";s:3:"lte";s:20:"amount_granted_value";s:0:"";s:24:"grant_report_received_op";s:2:"eq";s:27:"grant_report_received_value";s:0:"";s:12:"gender_id_op";s:2:"in";s:15:"gender_id_value";a:0:{}s:15:"contact_type_op";s:2:"in";s:18:"contact_type_value";a:0:{}s:12:"region_id_op";s:2:"in";s:15:"region_id_value";a:0:{}s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:11:"description";s:23:"Grant Report Statistics";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:1:"0";s:9:"parent_id";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID( ); INSERT INTO civicrm_navigation @@ -963,4 +963,4 @@ INSERT INTO civicrm_navigation VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Mailing Detail Report', 'Mailing Detail Report', 'administer CiviMail', 'OR', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; -UPDATE civicrm_domain SET version = '5.30.alpha1'; +UPDATE civicrm_domain SET version = '5.31.alpha1'; diff --git a/templates/CRM/Activity/Form/ActivityView.tpl b/templates/CRM/Activity/Form/ActivityView.tpl index 4f68416e217b..b0a02df612d4 100644 --- a/templates/CRM/Activity/Form/ActivityView.tpl +++ b/templates/CRM/Activity/Form/ActivityView.tpl @@ -119,7 +119,7 @@
{ts}Details{/ts}{$values.details|crmStripAlternatives|nl2br}{ts}Details{/ts}{$values.details|crmStripAlternatives|purify|nl2br}
- - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + +
{$form.name.label}{$form.name.html}
 {ts}Name of this group of settings.{/ts}
{$form.name.label}{$form.name.html}
 {ts}Name of this group of settings.{/ts}
{$form.server.label}{$form.server.html}
 {ts}Name or IP address of mail server machine.{/ts}
{$form.server.label}{$form.server.html}
 {ts}Name or IP address of mail server machine.{/ts}
{$form.username.label}{$form.username.html}
 {ts}Username to use when polling (for IMAP and POP3).{/ts}
{$form.username.label}{$form.username.html}
 {ts}Username to use when polling (for IMAP and POP3).{/ts}
{$form.password.label}{$form.password.html}
 {ts}Password to use when polling (for IMAP and POP3).{/ts}
{$form.password.label}{$form.password.html}
 {ts}Password to use when polling (for IMAP and POP3).{/ts}
{$form.localpart.label}{$form.localpart.html}
 {ts}Optional local part (e.g., 'civimail+' for addresses like civimail+s.1.2@example.com).{/ts}
{$form.localpart.label}{$form.localpart.html}
 {ts}Optional local part (e.g., 'civimail+' for addresses like civimail+s.1.2@example.com).{/ts}
{$form.domain.label}{$form.domain.html}
 {ts}Email address domain (the part after @).{/ts}
{$form.domain.label}{$form.domain.html}
 {ts}Email address domain (the part after @).{/ts}
{$form.return_path.label}{$form.return_path.html}
 {ts}Contents of the Return-Path header.{/ts}
{$form.return_path.label}{$form.return_path.html}
 {ts}Contents of the Return-Path header.{/ts}
{$form.protocol.label}{$form.protocol.html}
 {ts}Name of the protocol to use for polling.{/ts}
{$form.protocol.label}{$form.protocol.html}
 {ts}Name of the protocol to use for polling.{/ts}
{$form.source.label}{$form.source.html}
 {ts}Folder to poll from when using IMAP (will default to INBOX when empty), path to poll from when using Maildir, etc..{/ts}
{$form.source.label}{$form.source.html}
 {ts}Folder to poll from when using IMAP (will default to INBOX when empty), path to poll from when using Maildir, etc..{/ts}
{$form.is_ssl.label}{$form.is_ssl.html}
 {ts}Whether to use SSL for IMAP and POP3 or not.{/ts}
{$form.is_ssl.label}{$form.is_ssl.html}
 {ts}Whether to use SSL for IMAP and POP3 or not.{/ts}
{$form.is_default.label}{$form.is_default.html}
 {ts}How this mail account will be used. Only one box may be used for bounce processing. It will also be used as the envelope email when sending mass mailings.{/ts}
{$form.is_default.label}{$form.is_default.html}
 {ts}How this mail account will be used. Only one box may be used for bounce processing. It will also be used as the envelope email when sending mass mailings.{/ts}
{$form.activity_status.label}{$form.activity_status.html}
 {$form.is_non_case_email_skipped.html}{$form.is_non_case_email_skipped.label} {help id='is_non_case_email_skipped'}
 {$form.is_contact_creation_disabled_if_no_match.html}{$form.is_contact_creation_disabled_if_no_match.label} {help id='is_contact_creation_disabled_if_no_match'}
 {$form.activity_status.label}
{$form.activity_status.html}
-
{include file="CRM/common/formButtons.tpl" location="bottom"}
-{/if} + +
{include file="CRM/common/formButtons.tpl" location="bottom"}
+ {/if}
+ {literal} {/literal} diff --git a/templates/CRM/Admin/Form/Preferences/Display.tpl b/templates/CRM/Admin/Form/Preferences/Display.tpl index 44ff0ba7aabb..b06cb53588ac 100644 --- a/templates/CRM/Admin/Form/Preferences/Display.tpl +++ b/templates/CRM/Admin/Form/Preferences/Display.tpl @@ -161,10 +161,7 @@ {$form.editor_id.html}   - - - {$form.ckeditor_config.html} - + {$form.ckeditor_config.html} @@ -206,22 +203,14 @@ {$form.menubar_color.html} - - {if $config->userSystem->is_drupal EQ '1'} - - {ts}Theme{/ts} {help id="theme"} - {$form.theme_backend.html} - - {else} - - {$form.theme_backend.label} {help id="theme_backend"} - {$form.theme_backend.html} - - - {$form.theme_frontend.label} {help id="theme_frontend"} - {$form.theme_frontend.html} - - {/if} + + {$form.theme_backend.label} {help id="theme_backend"} + {$form.theme_backend.html} + + + {$form.theme_frontend.label} {help id="theme_frontend"} + {$form.theme_frontend.html} +
{include file="CRM/common/formButtons.tpl" location="bottom"}
diff --git a/templates/CRM/Admin/Form/Setting/Mail.hlp b/templates/CRM/Admin/Form/Setting/Mail.hlp new file mode 100644 index 000000000000..e33c7912c59f --- /dev/null +++ b/templates/CRM/Admin/Form/Setting/Mail.hlp @@ -0,0 +1,14 @@ +{* + +--------------------------------------------------------------------+ + | Copyright CiviCRM LLC. All rights reserved. | + | | + | This work is published under the GNU AGPLv3 license with some | + | permitted exceptions and without any warranty. For full license | + | and copyright information, see https://civicrm.org/licensing | + +--------------------------------------------------------------------+ +*} +{htxt id="civimail-sync-interval-id"} +

+ {ts}CiviMail records email sent at the frequency you specify. If you set it to 1, it will update the database every time it sends an email. This ensures that emails are not resent if the batch job fails, but this may cause a performance hit, particularly for large jobs.{/ts} +

+{/htxt} diff --git a/templates/CRM/Admin/Page/APIExplorer.tpl b/templates/CRM/Admin/Page/APIExplorer.tpl index 9c127fcb6fca..2be5f1f3c4ab 100644 --- a/templates/CRM/Admin/Page/APIExplorer.tpl +++ b/templates/CRM/Admin/Page/APIExplorer.tpl @@ -285,9 +285,9 @@
- - - +
diff --git a/templates/CRM/Admin/Page/JobLog.tpl b/templates/CRM/Admin/Page/JobLog.tpl
index 367b0f5b1b11..ca3bac9e5566 100644
--- a/templates/CRM/Admin/Page/JobLog.tpl
+++ b/templates/CRM/Admin/Page/JobLog.tpl
@@ -19,6 +19,9 @@
 
   
 
 {if $rows}
@@ -60,5 +63,8 @@
 
   
 
diff --git a/templates/CRM/Admin/Page/MailSettings.hlp b/templates/CRM/Admin/Page/MailSettings.hlp
new file mode 100644
index 000000000000..fac9cf4bc610
--- /dev/null
+++ b/templates/CRM/Admin/Page/MailSettings.hlp
@@ -0,0 +1,30 @@
+{*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved.                        |
+ |                                                                    |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
+ +--------------------------------------------------------------------+
+*}
+
+{htxt id="is_non_case_email_skipped-title"}
+  {ts}Skip emails which do not have a Case ID or Case hash{/ts}
+{/htxt}
+
+{htxt id="is_non_case_email_skipped"}
+  

{ts}CiviCRM has functionality to file emails which contain the Case ID or Case Hash in the subject line in the format [case #1234] against a case record.{/ts}

+

{ts}Where the Case ID or Case Hash is not included CiviCRM will file the email against the contact record, by matching the email addresses on the email with any email addresses of Contact records in CiviCRM.{/ts}

+

{ts}Enabling this option will have CiviCRM skip any emails that do not have the Case ID or Case Hash so that the system will only process emails that can be placed on case records.{/ts}

+

{ts}Any emails that are not processed will be moved to the ignored folder.{/ts}

+

{ts}If email is skipped, no activities or contacts ("from"/"to"/"cc"/"bcc") will be created.{/ts}

+{/htxt} + +{htxt id="is_contact_creation_disabled_if_no_match-title"} + {ts}Do not create new contacts when filing emails{/ts} +{/htxt} + +{htxt id="is_contact_creation_disabled_if_no_match"} +

{ts}If this option is enabled, CiviCRM will not create new contacts ("from"/"to"/"cc"/"bcc") when filing emails.{/ts}

+

{ts}If the email subject contains a valid Case ID or Case hash, the email will be filed against the case.{/ts}

+{/htxt} diff --git a/templates/CRM/Batch/Form/Entry.tpl b/templates/CRM/Batch/Form/Entry.tpl index 70c0a1c35069..14581e634359 100644 --- a/templates/CRM/Batch/Form/Entry.tpl +++ b/templates/CRM/Batch/Form/Entry.tpl @@ -22,9 +22,7 @@
{ts}Total for amounts entered below does not match the expected batch total.{/ts}
- - {$form._qf_Entry_upload_force.html} - + {$form._qf_Entry_upload_force.html}
{/if} diff --git a/templates/CRM/Block/Add.tpl b/templates/CRM/Block/Add.tpl index dd4f36735a8e..00bf545715ad 100644 --- a/templates/CRM/Block/Add.tpl +++ b/templates/CRM/Block/Add.tpl @@ -45,7 +45,7 @@ -
+
diff --git a/templates/CRM/Block/FullTextSearch.tpl b/templates/CRM/Block/FullTextSearch.tpl index 4f85ad1ba258..b076bc2f3a1f 100644 --- a/templates/CRM/Block/FullTextSearch.tpl +++ b/templates/CRM/Block/FullTextSearch.tpl @@ -24,7 +24,7 @@
-   +  
- - - - - - - {foreach from=$rows item=row} - - - - - - {/foreach} -
{ts}Display Name{/ts}{ts}Start Date{/ts}{ts}Status{/ts}
{$row.display_name}{$row.start_date}{$row.status}
- - -
- {include file="CRM/common/formButtons.tpl" location="bottom"} -
- -{else} -
- {icon icon="fa-info-circle"}{/icon} - {ts}There are no records selected.{/ts} -
-{/if} diff --git a/templates/CRM/Contact/Form/Contact.tpl b/templates/CRM/Contact/Form/Contact.tpl index 2acbff7dccbd..2844d09e35a4 100644 --- a/templates/CRM/Contact/Form/Contact.tpl +++ b/templates/CRM/Contact/Form/Contact.tpl @@ -66,14 +66,10 @@ {*add dupe buttons *} - - {$form._qf_Contact_refresh_dedupe.html} - + {$form._qf_Contact_refresh_dedupe.html} {if $isDuplicate}    - - {$form._qf_Contact_upload_duplicate.html} - + {$form._qf_Contact_upload_duplicate.html} {/if}
@@ -212,7 +208,7 @@ loadMultiRecordFields(); {/literal}{if $oldSubtypes}{literal} - $('input[name=_qf_Contact_upload_view], input[name=_qf_Contact_upload_new]').click(function() { + $('button[name=_qf_Contact_upload_view], button[name=_qf_Contact_upload_new]').click(function() { var submittedSubtypes = $('#contact_sub_type').val(); var oldSubtypes = {/literal}{$oldSubtypes}{literal}; diff --git a/templates/CRM/Contact/Form/Search/Basic.hlp b/templates/CRM/Contact/Form/Search/Basic.hlp index 4fceec8fc9c9..5d84d1f7f717 100644 --- a/templates/CRM/Contact/Form/Search/Basic.hlp +++ b/templates/CRM/Contact/Form/Search/Basic.hlp @@ -26,19 +26,6 @@
  • {ts}Use the 'Group Status...' checkboxes to view contacts with 'Pending' status and/or contacts who have been 'Removed' from this group.{/ts}
  • - {if $params.permissionedForGroup} - {capture assign=addMembersURL}{crmURL q="context=amtg&amtgID=`$params.group_id`&reset=1"}{/capture} -

    {ts 1=$addMembersURL 2=$params.group_title}Click Add Contacts to %2 if you want to add contacts to this group.{/ts} - {if !empty($params.ssID)} - {if $params.ssMappingID} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/builder" q="reset=1&force=1&ssID=`$params.ssID`"}{/capture} - {else} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/advanced" q="reset=1&force=1&ssID=`$params.ssID`"}{/capture} - {/if} - {ts 1=$editSmartGroupURL}Click Edit Smart Group Search Criteria... to change the search query used for this 'smart' group.{/ts} - {/if} -

    - {/if} {/htxt} {htxt id="id-amtg-criteria-title"} diff --git a/templates/CRM/Contact/Form/Search/Builder.js b/templates/CRM/Contact/Form/Search/Builder.js index fd6a984c1394..4dc3523571e9 100644 --- a/templates/CRM/Contact/Form/Search/Builder.js +++ b/templates/CRM/Contact/Form/Search/Builder.js @@ -293,7 +293,7 @@ }) // Add new field - if there's a hidden one, show it // Otherwise allow form to submit and fetch more from the server - .on('click', 'input[name^=addMore]', function() { + .on('click', 'button[name^=addMore]', function() { var table = $(this).closest('table'); if ($('tr:hidden', table).length) { $('tr:hidden', table).first().show(); diff --git a/templates/CRM/Contact/Form/Search/Intro.tpl b/templates/CRM/Contact/Form/Search/Intro.tpl index adc70018d03a..8cbfb012cf7b 100644 --- a/templates/CRM/Contact/Form/Search/Intro.tpl +++ b/templates/CRM/Contact/Form/Search/Intro.tpl @@ -11,20 +11,11 @@ {* smog = 'show members of group'; amtg = 'add members to group' *} {if $context EQ 'smog'} {* Provide link to modify smart group search criteria if we are viewing a smart group (ssID = saved search ID) *} - {if $permissionEditSmartGroup} - {if !empty($ssID)} - {if $ssMappingID} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/builder" q="reset=1&ssID=`$ssID`"}{/capture} - {elseif $savedSearch.search_custom_id} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/custom" q="reset=1&ssID=`$ssID`"}{/capture} - {else} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/advanced" q="reset=1&ssID=`$ssID`"}{/capture} - {/if} + {if $permissionEditSmartGroup && !empty($editSmartGroupURL)} - {/if} {/if} {if $permissionedForGroup} diff --git a/templates/CRM/Contact/Form/Search/ResultTasks.tpl b/templates/CRM/Contact/Form/Search/ResultTasks.tpl index 1e3e0df3cca7..28ca892fa15e 100644 --- a/templates/CRM/Contact/Form/Search/ResultTasks.tpl +++ b/templates/CRM/Contact/Form/Search/ResultTasks.tpl @@ -23,7 +23,7 @@ {ts}Search Builder{/ts}
    {/if} {if $context eq 'smog'} - {help id="id-smog-criteria" group_id=$group.id group_title=$group.title ssID=$ssID ssMappingID=$ssMappingID permissionedForGroup=$permissionedForGroup} + {help id="id-smog-criteria" group_title=$group.title} {elseif $context eq 'amtg'} {help id="id-amtg-criteria" group_title=$group.title} {else} diff --git a/templates/CRM/Contact/Page/View/Print.tpl b/templates/CRM/Contact/Page/View/Print.tpl index 1fb9798cc53f..6031bf210b8f 100644 --- a/templates/CRM/Contact/Page/View/Print.tpl +++ b/templates/CRM/Contact/Page/View/Print.tpl @@ -19,7 +19,7 @@ {/literal}
    -       +      

    diff --git a/templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl b/templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl index 6ca766cc26b3..5a3bd098639c 100644 --- a/templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl +++ b/templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl @@ -62,7 +62,7 @@
    {$row.name}
    {ts 1=$row.min_contribution|crmMoney}You must contribute at least %1 to get this item{/ts}
    - +
    {$row.description} @@ -235,7 +235,7 @@ amounts.sort(function(a,b){return a - b}); // make contribution instead buttons work - $('.premium-full-disabled input').click(function(){ + $('.premium-full-disabled button').click(function(){ var amount = Number($(this).attr('amount')); if (price_sets[amount]) { if (!$(price_sets[amount]).length) { @@ -347,4 +347,3 @@ {/literal} {/if} {/if} - diff --git a/templates/CRM/Contribute/Form/Task/Invoice.tpl b/templates/CRM/Contribute/Form/Task/Invoice.tpl index 9f3dde88890e..777354f29f06 100644 --- a/templates/CRM/Contribute/Form/Task/Invoice.tpl +++ b/templates/CRM/Contribute/Form/Task/Invoice.tpl @@ -28,6 +28,18 @@ {$form.from_email_address.label} {$form.from_email_address.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin} + + {$form.cc_id.label} + + {$form.cc_id.html} + + + + {$form.subject.label} + + {$form.subject.html} + + {$form.email_comment.label} {$form.email_comment.html} diff --git a/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index a14a183b1774..000000000000 --- a/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,38 +0,0 @@ -{if $rows} -
    - {$form.buttons.html} -
    - -
    - -
    -
    - - - - - - - - - {foreach from=$rows item=row} - - - - - - - {/foreach} -
    {ts}Display Name{/ts}{ts}Amount{/ts}{ts}Source{/ts}{ts}Receive Date{/ts}
    {$row.display_name}{$row.amount}{$row.source}{$row.receive_date}
    -
    - -
    - {$form.buttons.html} -
    - -{else} -
    - {icon icon="fa-info-circle"}{/icon} - {ts}There are no records selected.{/ts} -
    -{/if} diff --git a/templates/CRM/Custom/Form/ChangeFieldType.tpl b/templates/CRM/Custom/Form/ChangeFieldType.tpl deleted file mode 100644 index e87067ea8447..000000000000 --- a/templates/CRM/Custom/Form/ChangeFieldType.tpl +++ /dev/null @@ -1,46 +0,0 @@ -{* - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC. All rights reserved. | - | | - | This work is published under the GNU AGPLv3 license with some | - | permitted exceptions and without any warranty. For full license | - | and copyright information, see https://civicrm.org/licensing | - +--------------------------------------------------------------------+ -*} -
    -
    {include file="CRM/common/formButtons.tpl" location="top"}
    -
    {icon icon="fa-info-circle"}{/icon} -  {ts}Warning: This functionality is currently in beta stage. Consider backing up your database before using it. Click "Cancel" to return to the "edit custom field" form without making changes.{/ts} -
    - - - - - - - - - -
    {$form.src_html_type.label}{$form.src_html_type.html}
    {$form.dst_html_type.label}{$form.dst_html_type.html}
    -
    {include file="CRM/common/formButtons.tpl" location="bottom"}
    -
    -{literal} - -{/literal} - diff --git a/templates/CRM/Custom/Form/Field.tpl b/templates/CRM/Custom/Form/Field.tpl index c50080cef884..aeb56d695bc6 100644 --- a/templates/CRM/Custom/Form/Field.tpl +++ b/templates/CRM/Custom/Form/Field.tpl @@ -20,19 +20,11 @@ {$form.data_type.label} - {$form.data_type.html} - {if $action neq 4 and $action neq 2} -
    {ts}Select the type of data you want to collect and store for this contact. Then select from the available HTML input field types (choices are based on the type of data being collected).{/ts} - {/if} - {if $action eq 2 and $changeFieldType} -
    - - - {ts}Change Input Field Type{/ts} - -
    - {/if} - + {$form.data_type.html} + + + {$form.html_type.label} + {$form.html_type.html} {$form.serialize.label} @@ -171,19 +163,45 @@ {literal} {/literal} -{* Give link to view/edit choice options if in edit mode and html_type is one of the multiple choice types *} -{if $action eq 2 AND ($form.data_type.value.1.0 eq 'CheckBox' OR ($form.data_type.value.1.0 eq 'Radio' AND $form.data_type.value.0.0 neq 6) OR $form.data_type.value.1.0 eq 'Select' OR ($form.data_type.value.1.0 eq 'Multi-Select' AND $dontShowLink neq 1 ) ) } +{* Give link to view/edit option group *} +{if $action eq 2 && !empty($hasOptionGroup) } diff --git a/templates/CRM/Event/Form/ManageEvent/Registration.hlp b/templates/CRM/Event/Form/ManageEvent/Registration.hlp index 2aa4f62db7de..8fba9c56a980 100644 --- a/templates/CRM/Event/Form/ManageEvent/Registration.hlp +++ b/templates/CRM/Event/Form/ManageEvent/Registration.hlp @@ -89,5 +89,5 @@ {ts}Cancellation or Transfer Time Limit{/ts} {/htxt} {htxt id="id-selfcancelxfer_time"} - {ts}Number of hours prior to event start date to allow self-service cancellation or transfer. Enter 0 (or leave empty) to allow cancellation or transfer up until the event has started.{/ts} + {ts}Number of hours prior to event start date to allow self-service cancellation or transfer. Enter a negative number of hours to allow cancellation after the event starts. Enter 0 (or leave empty) to allow cancellation or transfer up until the event has started.{/ts} {/htxt} diff --git a/templates/CRM/Event/Form/ManageEvent/Registration.tpl b/templates/CRM/Event/Form/ManageEvent/Registration.tpl index 4858e9803259..27c4cdb59b21 100644 --- a/templates/CRM/Event/Form/ManageEvent/Registration.tpl +++ b/templates/CRM/Event/Form/ManageEvent/Registration.tpl @@ -396,7 +396,7 @@ invert = 0 diff --git a/templates/CRM/common/TabHeader.js b/templates/CRM/common/TabHeader.js index e816f0baacd4..ba514b81268f 100644 --- a/templates/CRM/common/TabHeader.js +++ b/templates/CRM/common/TabHeader.js @@ -23,7 +23,7 @@ CRM.$(function($) { params.autoClose = params.openInline = params.cancelButton = params.refreshAction = false; ui.panel.on('crmFormLoad', function() { // Hack: "Save and done" and "Cancel" buttons submit without ajax - $('.cancel.crm-form-submit, input[name$=upload_done]', this).on('click', function(e) { + $('.cancel.crm-form-submit, button[name$=upload_done]', this).on('click', function(e) { $(this).closest('form').ajaxFormUnbind(); }); }); diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template index e36756840f30..d66a63d632ec 100644 --- a/templates/CRM/common/civicrm.settings.php.template +++ b/templates/CRM/common/civicrm.settings.php.template @@ -73,7 +73,7 @@ if (!defined('CIVICRM_UF')) { * define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true'); */ if (!defined('CIVICRM_UF_DSN') && CIVICRM_UF !== 'UnitTests') { - define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true'); + define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true%%CMSdbSSL%%'); } // %%extraSettings%% @@ -106,7 +106,7 @@ if (!defined('CIVICRM_DSN')) { define('CIVICRM_DSN', $GLOBALS['_CV']['TEST_DB_DSN']); } else { - define('CIVICRM_DSN', 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true'); + define('CIVICRM_DSN', 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true%%dbSSL%%'); } } diff --git a/templates/CRM/common/deferredFinancialType.tpl b/templates/CRM/common/deferredFinancialType.tpl index 0b8f6645c158..10c9628b2dbd 100644 --- a/templates/CRM/common/deferredFinancialType.tpl +++ b/templates/CRM/common/deferredFinancialType.tpl @@ -12,7 +12,7 @@ {literal}