Merge pull request #1176 from pratik-joshi/CRM-13025
authorKurund Jalmi <kurund@civicrm.org>
Wed, 17 Jul 2013 08:52:09 +0000 (01:52 -0700)
committerKurund Jalmi <kurund@civicrm.org>
Wed, 17 Jul 2013 08:52:09 +0000 (01:52 -0700)
CRM-13025

48 files changed:
CRM/Admin/Form/Setting.php
CRM/Badge/BAO/Badge.php
CRM/Badge/Form/Layout.php
CRM/Campaign/Form/Petition/Signature.php
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Contact/Permission.php
CRM/Contact/BAO/Contact/Utils.php
CRM/Contact/BAO/Query.php
CRM/Contact/BAO/Query/Hook.php
CRM/Contact/BAO/Query/Interface.php
CRM/Contact/Form/RelatedContact.php
CRM/Contact/Form/Search/Advanced.php
CRM/Contact/Form/Search/Builder.php
CRM/Contact/Form/Task/Delete.php
CRM/Core/BAO/ConfigSetting.php
CRM/Core/Config/Variables.php
CRM/Core/Permission.php
CRM/Core/Permission/WordPress.php
CRM/Custom/Form/Group.php
CRM/Financial/BAO/FinancialItem.php
CRM/Financial/BAO/FinancialTypeAccount.php
CRM/Logging/ReportSummary.php
CRM/Logging/Schema.php
CRM/PCP/Form/PCPAccount.php
CRM/Pledge/BAO/PledgePayment.php
CRM/Price/Form/Set.php
CRM/Profile/Form/Edit.php
CRM/Profile/Selector/Listings.php
CRM/Report/BAO/ReportInstance.php
CRM/Report/Form/Member/Detail.php
CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_html.tpl
CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_text.tpl
CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_html.tpl
CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_text.tpl
CRM/Upgrade/Incremental/php/FourThree.php
CRM/Utils/Hook.php
CRM/Utils/System/Joomla.php
api/v3/utils.php
css/Audit/style.css
css/civicrm.css
js/jquery/jquery.crmasmselect.js
js/jquery/jquery.crmeditable.js
templates/CRM/Admin/Page/PaymentProcessor.hlp
templates/CRM/Profile/Page/Listings.tpl
tests/phpunit/CRM/Contact/BAO/QueryTestDataProvider.php
tests/phpunit/CRM/Financial/BAO/FinancialTypeAccountTest.php
tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php
tests/templates/documentFunction.tpl

index 6d65cad9012231b70859effb0442480fa50d0d3e..9fbe3747c678f2e8f56bfed15cd98541740c921d 100644 (file)
@@ -219,7 +219,7 @@ LIMIT  1
       unset($params['autocompleteContactReference']);
     }
 
-    // save components to be enabled 
+    // save components to be enabled
     if (CRM_Utils_Array::value('enableComponents', $params)) {
       CRM_Core_BAO_Setting::setItem($params['enableComponents'],
         CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,'enable_components');
index 70ba84216ff5bf980c5a6777ed5589a51422e37d..04ef2c42b7e067979178d26b686621ac277aba71 100644 (file)
@@ -91,7 +91,7 @@ class CRM_Badge_BAO_Badge {
           $value = $row[$element];
           // hack to fix date field display format
           if (strpos($element, '_date')) {
-            $value = CRM_Utils_Date::customFormat($value, "%e %b");
+            $value = CRM_Utils_Date::customFormat($value, "%B %E%f");
           }
         }
 
index 5c9931a99aeea49f05c2db4243f8ba6eedfb6ae3..4d4f2d435c38030f421ac6f70ebbdaad260e7f12 100644 (file)
@@ -221,6 +221,7 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
     $badgeInfo = CRM_Badge_BAO_Layout::create($params);
 
     if (isset($params['_qf_Layout_refresh'])) {
+      $this->set('id', $badgeInfo->id);
       $params['badge_id'] = $badgeInfo->id;
       self::buildPreview($params);
     }
@@ -235,6 +236,12 @@ class CRM_Badge_Form_Layout extends CRM_Admin_Form {
     // get a max participant id
     $participantID = CRM_Core_DAO::singleValueQuery('select max(id) from civicrm_participant');
 
+    if (!$participantID) {
+      CRM_Core_Session::setStatus(ts('Preview requires at least one event and one participant record.
+       If you are just getting started, you can add a test participant record.'), ts('Preview Requirements'), 'alert');
+      return;
+    }
+
     $this->_single = TRUE;
     $this->_participantIds = array($participantID);
     $this->_componentClause = " civicrm_participant.id = $participantID ";
index 2bfe2cd12a9120823db7a0bb68d175db160102b8..b00282c63e182807aec630b59fc391e0b7d46cb1 100644 (file)
@@ -283,7 +283,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
     }
 
     $this->setDefaults($this->_defaults);
-    
+
     // add in all state country selectors for enabled countries
     CRM_Core_BAO_Address::fixAllStateSelects($this, $this->_defaults);
   }
@@ -587,7 +587,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
    */
   function buildCustom($id, $name, $viewOnly = FALSE) {
 
-    // create state country map array to hold selectors 
+    // create state country map array to hold selectors
     $stateCountryMap = array();
 
     if ($id) {
@@ -630,15 +630,15 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
             // ignore file upload fields
             continue;
           }
-          
-          // if state or country in the profile, create map 
+
+          // if state or country in the profile, create map
           list($prefixName, $index) = CRM_Utils_System::explode('-', $key, 2);
           if ($prefixName == 'state_province' || $prefixName == 'country' || $prefixName == 'county') {
             if (!array_key_exists($index, $stateCountryMap)) {
               $stateCountryMap[$index] = array();
             }
             $stateCountryMap[$index][$prefixName] = $key;
-          }  
+          }
 
           CRM_Core_BAO_UFGroup::buildProfile($this, $field, CRM_Profile_Form::MODE_CREATE, $contactID, TRUE);
           $this->_fields[$key] = $field;
@@ -647,7 +647,7 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
           }
         }
 
-        // initialize the state country map        
+        // initialize the state country map
         CRM_Core_BAO_Address::addStateCountryMap($stateCountryMap);
 
         if ($addCaptcha &&
index 27133f317340fdf9cfa6c69807c2581d09308a04..f6fbc52631dbe16dd4d5d15a3c68e6d217e35a65 100644 (file)
@@ -231,7 +231,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
       // create current employer
       if (isset($params['employer_id'])) {
         CRM_Contact_BAO_Contact_Utils::createCurrentEmployerRelationship($contact->id,
-          $params['employer_id']
+          $params['employer_id'], $employerId
         );
       }
       elseif ($params['current_employer']) {
@@ -723,7 +723,7 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
     ) {
       return FALSE;
     }
-    
+
     // CRM-12929
     // Restrict contact to be delete if contact has financial trxns
     $error = NULL;
index 424833e63d8a273875cbe562e36edf00c980476e..4b4cce81c32d071bd148ee40f130ffff8f458231 100644 (file)
@@ -280,27 +280,27 @@ LEFT JOIN civicrm_relationship seconddegbb
   and seconddegbb.is_permission_a_b = 1
   and firstdeg.is_permission_a_b = 1
   and seconddegbb.is_active = 1
-WHERE  
+WHERE
   (
-    ( firstdeg.contact_id_a = %1 AND firstdeg.contact_id_b = %2 AND firstdeg.is_permission_a_b = 1 ) 
+    ( firstdeg.contact_id_a = %1 AND firstdeg.contact_id_b = %2 AND firstdeg.is_permission_a_b = 1 )
     OR ( firstdeg.contact_id_a = %2 AND firstdeg.contact_id_b = %1 AND firstdeg.is_permission_b_a = 1 )
-    OR ( 
+    OR (
       firstdeg.contact_id_a = %1 AND seconddegba.contact_id_a = %2
-      AND (seconddegba.contact_id_a NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)) 
+      AND (seconddegba.contact_id_a NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1))
     )
-    OR ( 
+    OR (
       firstdeg.contact_id_a = %1 AND seconddegbb.contact_id_b = %2
-      AND (seconddegbb.contact_id_b NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)) 
+      AND (seconddegbb.contact_id_b NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1))
     )
-    OR ( 
+    OR (
       firstdeg.contact_id_b = %1 AND seconddegab.contact_id_b = %2
-      AND (seconddegab.contact_id_b NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)) 
+      AND (seconddegab.contact_id_b NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1))
     )
-    OR ( 
-      firstdeg.contact_id_b = %1 AND seconddegaa.contact_id_a = %2      AND (seconddegaa.contact_id_a NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)) 
+    OR (
+      firstdeg.contact_id_b = %1 AND seconddegaa.contact_id_a = %2      AND (seconddegaa.contact_id_a NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1))
     )
-  ) 
-  AND (firstdeg.contact_id_a NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)) 
+  )
+  AND (firstdeg.contact_id_a NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1))
   AND (firstdeg.contact_id_b NOT IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1))
   AND ( firstdeg.is_active = 1)
       ";
index c463a0c1b39a7a7f6f8aaee288869ab6ec795e20..cab40793dc5435be40f76dfcfb945304b7314d41 100644 (file)
@@ -259,7 +259,7 @@ UNION
    * @access public
    * @static
    */
-  static function createCurrentEmployerRelationship($contactID, $organization) {
+  static function createCurrentEmployerRelationship($contactID, $organization, $previousEmployerID = NULL) {
     $organizationId = NULL;
 
     // if organization id is passed.
@@ -296,8 +296,7 @@ UNION
       }
     }
 
-    $previousEmployerID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactID, 'employer_id');
-    if ($organizationId && $organizationId != $previousEmployerID) {
+    if ($organizationId) {
       $cid = array('contact' => $contactID);
 
       // get the relationship type id of "Employee of"
@@ -318,6 +317,9 @@ UNION
 
 
       // In case we change employer, clean prveovious employer related records.
+      if (!$previousEmployerID) {
+        $previousEmployerID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactID, 'employer_id');
+      }
       if ($previousEmployerID &&
         $previousEmployerID != $organizationId
       ) {
@@ -329,7 +331,7 @@ UNION
 
       $relationshipParams['relationship_ids'] = $relationshipIds;
       // handle related meberships. CRM-3792
-      self::currentEmployerRelatedMembership($contactID, $organizationId, $relationshipParams, $duplicate);
+      self::currentEmployerRelatedMembership($contactID, $organizationId, $relationshipParams, $duplicate, $previousEmployerID);
     }
   }
 
@@ -344,7 +346,7 @@ UNION
    * @access public
    * @static
    */
-  static function currentEmployerRelatedMembership($contactID, $employerID, $relationshipParams, $duplicate = FALSE) {
+  static function currentEmployerRelatedMembership($contactID, $employerID, $relationshipParams, $duplicate = FALSE, $previousEmpID = NULL) {
     $ids = array();
     $action = CRM_Core_Action::ADD;
 
@@ -365,7 +367,9 @@ UNION
     }
 
     //need to handle related meberships. CRM-3792
-    CRM_Contact_BAO_Relationship::relatedMemberships($contactID, $relationshipParams, $ids, $action);
+    if ($previousEmpID != $employerID) {
+      CRM_Contact_BAO_Relationship::relatedMemberships($contactID, $relationshipParams, $ids, $action);
+    }
   }
 
   /**
index 588e46723373cd6297258ce0b74dc7463cfbbcd9..9d510df582867e93408ddc51b15e7d491a47f3b1 100644 (file)
@@ -1392,6 +1392,12 @@ class CRM_Contact_BAO_Query {
       return;
     }
 
+    // skip for hook injected fields / params
+    $extFields = CRM_Contact_BAO_Query_Hook::singleton()->getFields();
+    if (array_key_exists($values[0], $extFields)) {
+      return;
+    }
+
     switch ($values[0]) {
       case 'deleted_contacts':
         $this->deletedContacts($values);
@@ -2168,6 +2174,8 @@ class CRM_Contact_BAO_Query {
 
     // to handle table dependencies of components
     CRM_Core_Component::tableNames($tables);
+    // to handle table dependencies of hook injected tables
+    CRM_Contact_BAO_Query_Hook::singleton()->setTableDependency($tables);
 
     //format the table list according to the weight
     $info = CRM_Core_TableHierarchy::info();
index 6f3ecefc754ba7ab4dd49d98336409cdeac06fed..419b5aad0ee09580a6c2b403c58829a3276c2b63 100644 (file)
@@ -37,7 +37,7 @@
  * Delegate query functions based on hook system
  */
 class CRM_Contact_BAO_Query_Hook {
+
   /**
    * @var array of CRM_Contact_BAO_Query_Interface objects
    */
@@ -70,7 +70,7 @@ class CRM_Contact_BAO_Query_Hook {
     }
     return $this->_queryObjects;
   }
-  
+
   public function &getFields() {
     $extFields = array();
     foreach (self::getSearchQueryObjects() as $obj) {
@@ -79,13 +79,13 @@ class CRM_Contact_BAO_Query_Hook {
     }
     return $extFields;
   }
-  
+
   public function alterSearchQuery(&$query, $fnName) {
     foreach (self::getSearchQueryObjects() as $obj) {
       $obj->$fnName($query);
     }
   }
-  
+
   public function buildSearchfrom($fieldName, $mode, $side) {
     $from = '';
     foreach (self::getSearchQueryObjects() as $obj) {
@@ -93,4 +93,28 @@ class CRM_Contact_BAO_Query_Hook {
     }
     return $from;
   }
+
+  public function setTableDependency(&$tables) {
+    foreach (self::getSearchQueryObjects() as $obj) {
+      $obj->setTableDependency($tables);
+    }
+  }
+
+  public function registerAdvancedSearchPane(&$panes) {
+    foreach (self::getSearchQueryObjects() as $obj) {
+      $obj->registerAdvancedSearchPane($panes);
+    }
+  }
+
+  public function buildAdvancedSearchPaneForm(&$form, $type) {
+    foreach (self::getSearchQueryObjects() as $obj) {
+      $obj->buildAdvancedSearchPaneForm($form, $type);
+    }
+  }
+
+  public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) {
+    foreach (self::getSearchQueryObjects() as $obj) {
+      $obj->setAdvancedSearchPaneTemplatePath($paneTemplatePathArray, $type);
+    }
+  }
 }
\ No newline at end of file
index 18f0077c04b5244379d02b7fe98f168db855cb81..38bc944de8d3dc1c764765d68ddec7b1c800a36e 100644 (file)
  */
 
 /**
- * Interface for search BAO query objects
+ * Abstract class for search BAO query objects
  */
-interface CRM_Contact_BAO_Query_Interface {
+abstract class CRM_Contact_BAO_Query_Interface {
 
-  public function &getFields();
+  abstract public function &getFields();
+  abstract public function from($fieldName, $mode, $side);
 
-  public function select(&$query);
+  public function select(&$query) {
+    return NULL;
+  }
 
-  public function where(&$query);
+  public function where(&$query) {
+    return NULL;
+  }
 
-  public function from($fieldName, $mode, $side);
+  public function setTableDependency(&$tables) {
+    return NULL;
+  }
+
+  public function registerAdvancedSearchPane(&$panes) {
+    return NULL;
+  }
+
+  public function buildAdvancedSearchPaneForm(&$form, $type) {
+    return NULL;
+  }
+
+  public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) {
+    return NULL;
+  }
 }
\ No newline at end of file
index 2fc33c31a6d78db0c43aec20f1d79094e8b4a9b1..4ed894d1f4ee5147b0031d08f371e7935ef86567 100644 (file)
@@ -134,7 +134,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
       );
       $stateID = CRM_Utils_Array::value('state_province_id',
         $this->_defaults['address'][1]
-      );      
+      );
     }
     CRM_Contact_BAO_Contact_Utils::buildOnBehalfForm($this,
       $this->_contactType,
index ed1193f1433f5276049eda05232f3ee4a5686423..6ad1e97d0cb236950a912ffbca1db1a31d5023e7 100644 (file)
@@ -126,10 +126,13 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
       $paneNames[$pane['title']] = $pane['name'];
     }
 
-    $this->_paneTemplatePath = array();
+    $hookPanes = array();
+    CRM_Contact_BAO_Query_Hook::singleton()->registerAdvancedSearchPane($hookPanes);
+    $paneNames = array_merge($paneNames, $hookPanes);
 
+    $this->_paneTemplatePath = array();
     foreach ($paneNames as $name => $type) {
-      if (!$this->_searchOptions[$type]) {
+      if (!array_key_exists($type, $this->_searchOptions) && !in_array($type, $hookPanes)) {
         continue;
       }
 
@@ -148,13 +151,16 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
       ) {
         $allPanes[$name]['open'] = 'true';
 
-
         if (CRM_Utils_Array::value($type, $components)) {
           $c = $components[$type];
           $this->add('hidden', "hidden_$type", 1);
           $c->buildAdvancedSearchPaneForm($this);
           $this->_paneTemplatePath[$type] = $c->getAdvancedSearchPaneTemplatePath();
         }
+        else if (in_array($type, $hookPanes)) {
+          CRM_Contact_BAO_Query_Hook::singleton()->buildAdvancedSearchPaneForm($this, $type);
+          CRM_Contact_BAO_Query_Hook::singleton()->setAdvancedSearchPaneTemplatePath($this->_paneTemplatePath, $type);
+        }
         else {
           CRM_Contact_Form_Search_Criteria::$type($this);
           $template = ucfirst($type);
index 950c1613960e1169aff5875d41ec99c4d124317e..5690430d27cd55ad917475748cf052fdbc1cba5b 100644 (file)
@@ -407,10 +407,10 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
     // Hack to add options not retrieved by getfields
     // This list could go on and on, but it would be better to fix getfields
     $options = array(
-      'group' => 'contact',
-      'tag' => 'contact',
-      'country' => 'contact',
-      'state_province' => 'contact',
+      'group' => 'group_contact',
+      'tag' => 'entity_tag',
+      'country' => 'address',
+      'state_province' => 'address',
       'gender' => 'contact',
       'world_region' => 'contact',
       'individual_prefix' => 'contact',
index d9aa4935407c962a82670c25c30c4e112354a052..3f43c1c0aa5b1cf4b70a3d6e84000c4fc5df0291 100644 (file)
@@ -169,7 +169,7 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
     else {
       $this->addDefaultButtons($label, 'done');
     }
-    
+
     $this->addFormRule(array('CRM_Contact_Form_Task_Delete', 'formRule'), $this);
   }
 
index 95933fba60bd942ce278831624f2087eb4254104..7864add6b3ce532976c817788f18348bfc036d25 100644 (file)
@@ -353,11 +353,11 @@ class CRM_Core_BAO_ConfigSetting {
       // retrieve directory and url preferences also
       CRM_Core_BAO_Setting::retrieveDirectoryAndURLPreferences($defaults);
 
-      // Pickup enabled-components from settings table if found. 
+      // Pickup enabled-components from settings table if found.
       $enableComponents = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
       if (!empty($enableComponents)) {
         $defaults['enableComponents'] = $enableComponents;
-        
+
         $components = CRM_Core_Component::getComponents();
         $enabledComponentIDs = array();
         foreach ($defaults['enableComponents'] as $name) {
@@ -627,7 +627,7 @@ WHERE  option_group_id = (
     }
 
     // get enabled-components from DB and add to the list
-    $enabledComponents = 
+    $enabledComponents =
       CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
     $enabledComponents[] = $componentName;
 
index 469ff3d6b417369d8048b9f2faeb98a5e1786044..ee44cbdb667e614a899fa9ed17706fb603da3b6c 100644 (file)
@@ -452,12 +452,12 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults {
    * Path to wkhtmltopdf if available
    */
   public $wkhtmltopdfPath = FALSE;
-  
+
   /**
    * Allow second-degree relations permission to edit contacts
    */
   public $secondDegRelPermissions = FALSE;
-  
+
 
   /**
    * Allow second-degree relations permission to edit contacts
index 6ca3f84fe93e9f1f9527f12c579bd8f37dc3e883..52cc6f041a4b651017650957e751b60352cd28f5 100644 (file)
@@ -280,7 +280,7 @@ class CRM_Core_Permission {
       return $permissionedEvents;
     }
     if (!empty($permissionedEvents)){
-      return array_search($eventID, $permissionedEvents) === FALSE ? NULL : $eventID;      
+      return array_search($eventID, $permissionedEvents) === FALSE ? NULL : $eventID;
     } else {
       return $eventID;
     }
index e2f5947b2eacd5236896b87bd62e5b23716127bd..d65427466a13ba7e76dda104500cfdd5a2802b2f 100644 (file)
@@ -46,7 +46,7 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base {
    * @access public
    */
   function check($str) {
-    // Generic cms 'administer users' role tranlates to 'administrator' WordPress role 
+    // Generic cms 'administer users' role tranlates to 'administrator' WordPress role
     $str = $this->translatePermission($str, 'WordPress', array(
       'administer users' => 'administrator',
     ));
index 48c3c2133c3bc570c66fda7740f7426cb9e7147f..0e144dadb7843f9812f46ebf9bcfe6aedf5404cb 100644 (file)
@@ -523,7 +523,7 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
   /*
    * Function to return a formatted list of relationship name.
    * @param $list array array of relationship name.
-   * @static 
+   * @static
    * return array array of relationship name.
    */
   static function getFormattedList(&$list) {
index 44b508ac98b2422c57a9d7578614dab311a9cb93..3df83df8ed4e91c28c936ffc1c1acdd4795e7344 100644 (file)
@@ -203,7 +203,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
       return null;
     }
   }
-  
+
   /**
    * check if contact is present in financial_item table
    *
@@ -221,7 +221,7 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
     if (empty($contactIds)) {
       return FALSE;
     }
-    
+
     $allowPermDelete = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'allowPermDeleteFinancial');
 
     if (!$allowPermDelete) {
@@ -234,14 +234,14 @@ WHERE cc.id IN (' . implode (',', $contactIds) . ') AND con.is_test = 0';
           $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid=$dao->id");
           $not_deleted[$dao->id] = "<a href='$url'>$dao->display_name</a>";
         }
-        
+
         $errorStatus = '';
         if (is_array($error)) {
           $errorStatus = '<ul><li>' . implode('</li><li>', $not_deleted) . '</li></ul>';
         }
-        
+
         $error['_qf_default'] = $errorStatus .  ts('This contact(s) can not be permanently deleted because the contact record is linked to one or more live financial transactions. Deleting this contact would result in the loss of financial data.');
-        return $error; 
+        return $error;
       }
     }
     return FALSE;
index 834c3cc1c6b8f7af45ba3573b2b1e8516999276a..68df112f79c8080fb6358a6a523bc33daca918fa 100644 (file)
@@ -137,7 +137,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin
         break;
       }
     }
-    
+
     if ($check) {
       if ($name[1] == 'PremiumsProduct' || $name[1] == 'Product') {
         CRM_Core_Session::setStatus(ts('You cannot remove an account with a %1 relationship while the Financial Type is used for a Premium.', array(1 => $relationValues[$financialTypeAccountId])));
index 9d0677e106b9eeab63e9fbcf455a35c5e5175fef..452c26f8a14e11313a6fb98e2eb744cc9d11eab1 100644 (file)
@@ -217,7 +217,7 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form {
     $replaceWith = array();
     while($dao->fetch()){
       $type = $this->getLogType($dao->log_type);
-      if (!array_key_exists($type,$replaceWith)) 
+      if (!array_key_exists($type,$replaceWith))
         $replaceWith[$type] = array();
       $replaceWith[$type][] = $dao->log_type;
     }
@@ -226,7 +226,7 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form {
         $replaceWith[$type] = implode("','", $tables);
       }
     }
-    
+
     $sql = "ALTER TABLE civicrm_temp_civireport_logsummary ADD COLUMN log_civicrm_entity_log_type_label varchar(64)";
     CRM_Core_DAO::executeQuery($sql);
     foreach ($replaceWith as $type => $in) {
index dc02bb590e77a52be767505e8bb99df150f8c5ef..3ebddca89d296ba31d7e7c11afb4560351c9f02c 100644 (file)
@@ -46,6 +46,12 @@ class CRM_Logging_Schema {
     'logging/contribute/summary',
   );
 
+  //CRM-13028 / NYSS-6933 - table => array (cols) - to be excluded from the update statement 
+  private $exceptions = array(
+    'civicrm_job'   => array('last_run'),
+    'civicrm_group' => array('cache_date'),
+  ); 
+
   /**
    * Populate $this->tables and $this->logs with current db state.
    */
@@ -403,7 +409,7 @@ COLS;
       $cond = array( );
       foreach ($columns as $column) {
         // ignore modified_date changes
-        if ($column != 'modified_date') {
+        if ($column != 'modified_date' && !in_array($column, CRM_Utils_Array::value($table, $this->exceptions, array()))) {
           $cond[] = "IFNULL(OLD.$column,'') <> IFNULL(NEW.$column,'')";
         }
       }
index 81acc9083c155dd65a166ca0d972ae644b6763de..8f1be0354466d8cffd525cc02fa107012655fac7 100644 (file)
@@ -112,7 +112,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
       foreach ($this->_fields as $name => $dontcare) {
         $fields[$name] = 1;
       }
-      
+
       CRM_Core_BAO_UFGroup::setProfileDefaults($this->_contactID, $fields, $this->_defaults);
     }
     $stateCountryMap = array();
index 299c3b342e3cd359850a7e9c08265cf65753e176..73bffd2c752b3a95f0ffc4218956aea191f14359 100644 (file)
@@ -719,7 +719,7 @@ WHERE civicrm_pledge_payment.contribution_id = {$paymentContributionId}
       while ($paymentsAffected->fetch()) {
         $paymentIDs[] = $paymentsAffected->id;
       }
-      // Reset the affected values by the amount paid more than the scheduled amount 
+      // Reset the affected values by the amount paid more than the scheduled amount
       foreach($paymentIDs as $key => $value) {
         $payment = new CRM_Pledge_DAO_PledgePayment();
         $payment->id = $value;
@@ -733,11 +733,11 @@ WHERE civicrm_pledge_payment.contribution_id = {$paymentContributionId}
           $payment->save();
         }
       }
-      
+
       //Cancel the initial paid amount
       CRM_Core_DAO::setFieldValue('CRM_Pledge_DAO_PledgePayment', reset($paymentIDs), 'status_id', $paymentStatusID, 'id');
       CRM_Core_DAO::setFieldValue('CRM_Pledge_DAO_PledgePayment', reset($paymentIDs), 'actual_amount', $actualAmount, 'id');
-      
+
       //Add new payment after the last payment for the pledge
       $allPayments = self::getPledgePayments($pledgeID);
       $lastPayment = array_pop($allPayments);
index ceafecd0a8b2d2496d398745d0f4a32dac2ed0fd..4ebf087e2c19c82c82b9f14615981a7bf97de8b8 100644 (file)
@@ -263,7 +263,6 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     // get the submitted form values.
     $params = $this->controller->exportValues('Set');
     $nameLength = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceSet', 'name');
-    $params['name'] = CRM_Utils_String::titleToVar($params['title'], CRM_Utils_Array::value('maxlength', $nameLength));
     $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
     $params['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $params, FALSE);
 
@@ -277,6 +276,10 @@ class CRM_Price_Form_Set extends CRM_Core_Form {
     if ($this->_action & CRM_Core_Action::UPDATE) {
       $params['id'] = $this->_sid;
     }
+    else {
+      $params['name'] = CRM_Utils_String::titleToVar($params['title'],
+        CRM_Utils_Array::value('maxlength', $nameLength));
+    }
 
     $set = CRM_Price_BAO_PriceSet::create($params);
     if ($this->_action & CRM_Core_Action::UPDATE) {
index 2c13ae4c60ba84a5081a4ecbc6890bb12aedcdf7..5de91aab3d07c1ad1fd605ad159a55e497e11783 100644 (file)
@@ -218,7 +218,7 @@ SELECT module
           $popupRedirect = CRM_Utils_System::url('civicrm/profile/edit', $urlParams, FALSE, NULL, FALSE);
         }
         elseif ($this->_onPopupClose == 'redirectToTab') {
-          $popupRedirect = CRM_Utils_System::url('civicrm/contact/view', 
+          $popupRedirect = CRM_Utils_System::url('civicrm/contact/view',
             "reset=1&cid={$this->_id}&selectedChild=custom_{$this->_customGroupId}", FALSE, NULL, FALSE);
         }
 
index 2d3aacbea154b4a7414796d9970d39312f78a882..65e08c04715bf1549daa64c11483d8ddfcb8f9f4 100644 (file)
@@ -306,6 +306,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
           'name' => ts('Name'),
           'sort' => 'sort_name',
           'direction' => CRM_Utils_Sort::ASCENDING,
+          'field_name' => 'sort_name',
         ),
       );
 
@@ -357,6 +358,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
             'name' => $field['title'],
             'sort' => $name,
             'direction' => $direction,
+            'field_name' => CRM_Core_BAO_UFField::isValidFieldName($name) ? $name : $fieldName,
           );
 
           $direction = CRM_Utils_Sort::DONTCARE;
@@ -583,7 +585,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
         $showProfileOverlay
       );
       if ($result->sort_name) {
-        $row['sort_name'] = $result->sort_name;
+        $row[] = $result->sort_name;
         $empty = FALSE;
       }
       else {
index c58477858473a5d1d4dfc18b44e0b4bc4e3e3ae4..9f82c4d1da21b2b51639383c531864d8c43a5de5 100644 (file)
@@ -107,7 +107,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance {
       $instance->report_id = CRM_Report_Utils_Report::getValueFromUrl();
     }
     $instance->save();
-    
+
     if ($instanceID) {
       CRM_Utils_Hook::pre('edit', 'ReportInstance', $instance->id, $instance);
     }
@@ -179,8 +179,8 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance {
 
     // add / update navigation as required
     if (!empty($navigationParams)) {
-      if (!CRM_Utils_Array::value('id',$params) && 
-        !CRM_Utils_Array::value('instance_id',$params) && 
+      if (!CRM_Utils_Array::value('id',$params) &&
+        !CRM_Utils_Array::value('instance_id',$params) &&
         CRM_Utils_Array::value('id', $navigationParams)) {
         unset($navigationParams['id']);
       }
index 43cdcf869417ddfe52860d4000aa5fd10c1aea9f..d170de8ca703ed913b6927213361482f9daa7852 100644 (file)
@@ -436,7 +436,7 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form {
 
     if ($this->_contribField) {
       $this->_orderBy .= ", {$this->_aliases['civicrm_contribution']}.receive_date DESC";
-    } 
+    }
   }
 
   function postProcess() {
index 4c25e016df66db71c9f7aa42f6551a4ab403df8a..d26a95bf4c24a6d8a8df1b42e544585c3f463c85 100644 (file)
@@ -178,12 +178,12 @@ registration process.{/ts}</p>
              <th>{ts}Qty{/ts}</th>
              <th>{ts}Each{/ts}</th>
              <th>{ts}Total{/ts}</th>
-            {if $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if}
+       {if $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if}
             </tr>
             {foreach from=$value item=line}
              <tr>
               <td>
-             {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}     
+        {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}<div>{$line.description|truncate:30:"..."}</div>{/if}
               </td>
               <td>
                {$line.qty}
@@ -194,11 +194,11 @@ registration process.{/ts}</p>
               <td>
                {$line.line_total|crmMoney}
               </td>
-             {if  $pricesetFieldsCount }
-             <td>
-               {$line.participant_count}
+        {if  $pricesetFieldsCount }
+        <td>
+    {$line.participant_count}
               </td>
-             {/if}
+        {/if}
              </tr>
             {/foreach}
            </table>
@@ -228,10 +228,10 @@ registration process.{/ts}</p>
        </tr>
        {if $pricesetFieldsCount }
      <tr>
-       <td {$labelStyle}> 
-        {ts}Total Participants{/ts}</td>   
+       <td {$labelStyle}>
+   {ts}Total Participants{/ts}</td>
        <td {$valueStyle}>
-        {assign var="count" value= 0}
+   {assign var="count" value= 0}
          {foreach from=$lineItem item=pcount}
          {assign var="lineItemCount" value=0}
          {if $pcount neq 'skip'}
@@ -240,11 +240,11 @@ registration process.{/ts}</p>
            {/foreach}
            {if $lineItemCount < 1 }
            assign var="lineItemCount" value=1}
-           {/if}       
+           {/if}
            {assign var="count" value=$count+$lineItemCount}
          {/if}
          {/foreach}
-        {$count}
+   {$count}
        </td>
      </tr>
      {/if}
index 1c6a5f4fa5b6d9af4432e440500797ce5b1f9aa0..02985ca010ddb1349e68a8bddccebb194c9dec87 100644 (file)
@@ -145,14 +145,14 @@ registration process.{/ts}
         {/foreach}
         {if $lineItemCount < 1 }
         {assign var="lineItemCount" value=1}
-        {/if}  
+        {/if}
       {assign var="count" value=$count+$lineItemCount}
       {/if}
       {/foreach}
 
 {ts}Total Participants{/ts}: {$count}
 {/if}
-   
+
 {if $is_pay_later }
 
 ==========================================================={if $pricesetFieldsCount }===================={/if}
index ef247c007cfd18a0c60bc0b807964a1829686038..704017e841487755da6d4dcade4dd135fb8df25a 100644 (file)
 
   <tr>
    <td>
-       <p>Dear {contact.display_name},</p>
+  <p>Dear {contact.display_name},</p>
 
     {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}
      <p>{$event.confirm_email_text|htmlize}</p>
 
     {else}
-       <p>Thank you for your participation.  This letter is a confirmation that your registration has been received and your status has been updated to <strong>{if $isOnWaitlist}waitlisted{else}registered{/if}</strong> for the following:</p>
+  <p>Thank you for your participation.  This letter is a confirmation that your registration has been received and your status has been updated to <strong>{if $isOnWaitlist}waitlisted{else}registered{/if}</strong> for the following:</p>
 
     {/if}
 
@@ -72,20 +72,20 @@ registration process.{/ts}</p>
      {if $conference_sessions}
       <tr>
        <td colspan="2" {$labelStyle}>
-       {ts}Your schedule:{/ts}
+  {ts}Your schedule:{/ts}
        </td>
       </tr>
       <tr>
        <td colspan="2" {$valueStyle}>
-       {assign var='group_by_day' value='NA'}
-       {foreach from=$conference_sessions item=session}
-        {if $session.start_date|date_format:"%Y/%m/%d" != $group_by_day|date_format:"%Y/%m/%d"}
-         {assign var='group_by_day' value=$session.start_date}
+  {assign var='group_by_day' value='NA'}
+  {foreach from=$conference_sessions item=session}
+   {if $session.start_date|date_format:"%Y/%m/%d" != $group_by_day|date_format:"%Y/%m/%d"}
+    {assign var='group_by_day' value=$session.start_date}
           <em>{$group_by_day|date_format:"%m/%d/%Y"}</em><br />
-        {/if}
-        {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}<br />
-        {if $session.location}&nbsp;&nbsp;&nbsp;&nbsp;{$session.location}<br />{/if}
-       {/foreach}
+   {/if}
+   {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}<br />
+   {if $session.location}&nbsp;&nbsp;&nbsp;&nbsp;{$session.location}<br />{/if}
+  {/foreach}
        </td>
       </tr>
      {/if}
@@ -180,7 +180,7 @@ registration process.{/ts}</p>
      </tr>
      <tr>
        <td colspan="2" {$valueStyle}>
-             {$payer.name}
+        {$payer.name}
        </td>
      </tr>
     {/if}
@@ -212,7 +212,7 @@ registration process.{/ts}</p>
              <th>{ts}Qty{/ts}</th>
              <th>{ts}Each{/ts}</th>
              <th>{ts}Total{/ts}</th>
-            {if  $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if}
+       {if  $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if}
             </tr>
             {foreach from=$value item=line}
              <tr>
@@ -228,7 +228,7 @@ registration process.{/ts}</p>
               <td>
                {$line.line_total|crmMoney:$currency}
               </td>
-             {if $pricesetFieldsCount }<td>{$line.participant_count}</td> {/if}
+        {if $pricesetFieldsCount }<td>{$line.participant_count}</td> {/if}
              </tr>
             {/foreach}
            </table>
@@ -252,17 +252,17 @@ registration process.{/ts}</p>
        <tr>
         <td {$labelStyle}>
          {ts}Total Amount{/ts}
-        </td>  
+        </td>
         <td {$valueStyle}>
          {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if}
         </td>
        </tr>
        {if $pricesetFieldsCount }
      <tr>
-       <td {$labelStyle}> 
-      {ts}Total Participants{/ts}</td>   
+       <td {$labelStyle}>
+      {ts}Total Participants{/ts}</td>
       <td {$valueStyle}>
-      {assign var="count" value= 0}     
+      {assign var="count" value= 0}
       {foreach from=$lineItem item=pcount}
       {assign var="lineItemCount" value=0}
       {if $pcount neq 'skip'}
@@ -271,7 +271,7 @@ registration process.{/ts}</p>
         {/foreach}
       {if $lineItemCount < 1 }
         {assign var="lineItemCount" value=1}
-      {/if}    
+      {/if}
       {assign var="count" value=$count+$lineItemCount}
       {/if}
       {/foreach}
@@ -414,8 +414,8 @@ registration process.{/ts}</p>
      <tr><th {$headerStyle}>{$customProfile.title.$pid}</th></tr>
      {foreach from=$eachProfile item=val key=field}
      <tr>{foreach from=$val item=v key=f}
-         <td {$labelStyle}>{$field}</td> 
-         <td {$valueStyle}>{$v}</td> 
+         <td {$labelStyle}>{$field}</td>
+         <td {$valueStyle}>{$v}</td>
          {/foreach}
      </tr>
      {/foreach}
@@ -442,7 +442,7 @@ registration process.{/ts}</p>
        {/foreach}
       {/foreach}
      {/if}
-   
+
     </table>
    </td>
   </tr>
index f34add1949b75e22ef43a01fde24879dfb4af14c..2e18deffb42fdef5992c2d01c419b5e6e19f71dd 100644 (file)
@@ -162,14 +162,14 @@ You were registered by: {$payer.name}
         {/foreach}
       {if $lineItemCount < 1 }
         {assign var="lineItemCount" value=1}
-      {/if}    
+      {/if}
       {assign var="count" value=$count+$lineItemCount}
       {/if}
       {/foreach}
 
 {ts}Total Participants{/ts}: {$count}
 {/if}
-  
+
 {if $register_date}
 {ts}Registration Date{/ts}: {$register_date|crmDate}
 {/if}
@@ -233,7 +233,7 @@ You were registered by: {$payer.name}
 {foreach from=$customPost item=customPos key=j}
 ==========================================================={if $pricesetFieldsCount }===================={/if}
 
-{$customPost_grouptitle.$j} 
+{$customPost_grouptitle.$j}
 ==========================================================={if $pricesetFieldsCount }===================={/if}
 
 {foreach from=$customPos item=customValue key=customName}
index c0c8429c88e1185d0880194d1db72d502e7675c1..d0b97abaa68671da4e82f46128fd50b61d872938 100644 (file)
@@ -299,7 +299,7 @@ ADD COLUMN   premiums_nothankyou_label varchar(255) COLLATE utf8_unicode_ci DEFA
   function upgrade_4_3_4($rev) {
     $this->addTask(ts('Upgrade DB to 4.3.4: SQL'), 'task_4_3_x_runSql', $rev);
   }
-  
+
   function upgrade_4_3_5($rev) {
     // CRM-12156
     $config = CRM_Core_Config::singleton();
@@ -310,7 +310,7 @@ WHERE CONSTRAINT_NAME = 'FK_civicrm_financial_item_contact_id'
 AND CONSTRAINT_SCHEMA = %1";
     $params = array(1 => array($dbname['database'], 'String'));
     $onDelete = CRM_Core_DAO::singleValueQuery($sql, $params, TRUE, FALSE);
-    
+
     if ($onDelete != 'CASCADE') {
       $query = "ALTER TABLE `civicrm_financial_item`
 DROP FOREIGN KEY FK_civicrm_financial_item_contact_id,
index e7cb5189ac0aafa33ffdefef559858295f3f4991..efc8ac72b7629fc115861a9722faa023b5820ff3 100644 (file)
@@ -472,10 +472,10 @@ abstract class CRM_Utils_Hook {
    * This hook is called when rendering the tabs
    * used for events and potentially contribution pages, etc
    * @param string $tabset   - name of the screen or visual element
-   * @param array $tabs      - the array of tabs that will be displayed   
+   * @param array $tabs      - the array of tabs that will be displayed
    * @param array $context   - extra data about the screen or context in which the tab is used
    *
-   * @return null 
+   * @return null
    * @access public
    */
   static function tabset($tabsetName, &$tabs, $context) {
@@ -1314,7 +1314,7 @@ abstract class CRM_Utils_Hook {
   }
 
   /**
-   * This hook is called while building the core search query, 
+   * This hook is called while building the core search query,
    * so hook implementers can provide their own query objects which alters/extends core search.
    *
    * @param Array $queryObjects
index 52414fdb557b7975de40c727da92a71c3aea58da..19b03bf9172d58e7c4d29a2eb57bfca9a8ea6f39 100644 (file)
@@ -602,7 +602,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
 
     // Get the framework.
     if (file_exists($joomlaBase . '/libraries/import.legacy.php')) {
-      require $joomlaBase . '/libraries/import.legacy.php';  
+      require $joomlaBase . '/libraries/import.legacy.php';
     }
     require $joomlaBase . '/libraries/import.php';
     require $joomlaBase . '/libraries/joomla/event/dispatcher.php';
index cd67feb0b886332a3b162dc8bcc0c41b025e607e..b29b0713a816aeafdccd8287d4a20d9e030ad13e 100644 (file)
@@ -1633,6 +1633,9 @@ function _civicrm_api3_api_resolve_alias($entity, $fieldName) {
     'action' => 'create',
   ));
   $meta = $result['values'];
+  if (!isset($meta[$fieldName]['name']) && isset($meta[$fieldName . '_id'])) {
+    $fieldName = $fieldName . '_id';
+  }
   if (isset($meta[$fieldName])) {
     return $meta[$fieldName]['name'];
   }
index 934d0e3b0df2ff376e80c96517141a0d14421974..aec13991b9ebd7f7ce5c851636bdbefae2d45cd7 100644 (file)
@@ -82,7 +82,7 @@
 }
 
 .activity a:link, .activity a:visited {
-} 
+}
 
 .activityheader {
   display: none;
index a883418e3470b22638496733241bee6b71f9958a..e1c706378dddd03833a767bbf00853a9b2550d8c 100644 (file)
@@ -1254,7 +1254,7 @@ div.crm-container label {
   height: auto;
   margin: 0 1px;
   padding: 2px 5px;
-  font-family: Arial, Helvetica, sans-serif; 
+  font-family: Arial, Helvetica, sans-serif;
 }
 
 .crm-container #alpha-filter a {
index 902e09907f14a71d3dd41996a962356f74545e84..ffee488329987e11beefc1f2bc189b7ad3260faa 100644 (file)
                                // initialize the alternate select multiple
 
                                // this loop ensures uniqueness, in case of existing crmasmSelects placed by ajax (1.0.3)
-                               while($("#" + options.containerClass + index).size() > 0) index++; 
+                               while($("#" + options.containerClass + index).size() > 0) index++;
 
                                $select = $("<select></select>")
                                        .addClass(options.selectClass)
                                        .attr('name', options.selectClass + index)
-                                       .attr('id', options.selectClass + index); 
+                                       .attr('id', options.selectClass + index);
 
-                               $selectRemoved = $("<select></select>"); 
+                               $selectRemoved = $("<select></select>");
 
                                $ol = $("<" + options.listType + "></" + options.listType + ">")
                                        .addClass(options.listClass)
-                                       .attr('id', options.listClass + index); 
+                                       .attr('id', options.listClass + index);
 
                                $container = $("<div></div>")
                                        .addClass(options.containerClass) 
                                        'id': optionId,
                                        'item': $ol.children("[rel=" + optionId + "]"),
                                        'type': type
-                               }]); 
+                               }]);
                        }
 
                        init();
                });
        };
 
-})(jQuery); 
+})(jQuery);
+
index fea1a794f71e853bb92663336635513e10c25132..cd7c9f02ac9143edfc5ee7229745a378833e95c6 100644 (file)
@@ -27,7 +27,7 @@
 *
 *
 * This offers two features:
-* - crmEditable() edit in place of a single field 
+* - crmEditable() edit in place of a single field
 *  (mostly a wrapper that binds jeditable features with the ajax api and replies on crm-entity crmf-{field} html conventions)
 *  if you want to add an edit in place on a template:
 *  - add a class crm-entity and id {EntityName}-{Entityid} higher in the dom
@@ -90,7 +90,7 @@
           if  (!getEntityID (this,function (e,id) {
             entity=e;
             params.id = id;
-            
+
           })) { return };
 
           params['field']=getFieldName(this);
             var id= $i.closest('.crm-entity').attr('id');
             if (id) {
               var e=id.match(/(\S*)-(\S*)/);
-               if (!e) 
+               if (!e)
                  console && console.log && console.log("Couldn't get the entity id. You need to set class='crm-entity' id='{entityName}-{id}'");
               formSettings.entity=e[1];
               formSettings.id=e[2];
index db9d3f01894c66831c3700adbe94061fd0c35e9b..2cbf67b8022401b306b088cfeff28472fbc7e020 100644 (file)
 {ts 1='4111111111111111' 2='76'}The test Credit Card number is %1 - this is the only credit card number that will work on the test gateway. The test Total Amount can be any amount except one that ends in a value of .%2 (e.g. $10.%2) - all amounts ending in .%2 will return a failed response.{/ts}
 {/htxt}
 
-{htxt id='Payment_Express-test-url-site'} {ts}This is the URL for accessing the DPS/Payment Express payment site.  
+{htxt id='Payment_Express-test-url-site'} {ts}This is the URL for accessing the DPS/Payment Express payment site.
 If you have been given a MAC key please fill in the Mac Key field, and use https://sec.paymentexpress.com/pxpay/pxpay.aspx for the Site URL.
 Otherwise use https://sec.paymentexpress.com/pxpay/pxaccess.aspx for the Site URL.{/ts} {/htxt}
 
 {htxt id='Payment_Express-live-user-name'} {ts}Payment Express UserID (LIVE account):{/ts}
 {ts}This is the live user name provided to you by DPS/Payment Express.{/ts}{/htxt}
 
-{htxt id='Payment_Express-live-url-site'} {ts}This is the URL for accessing the DPS/Payment Express payment site.  
+{htxt id='Payment_Express-live-url-site'} {ts}This is the URL for accessing the DPS/Payment Express payment site.
 If you have been given a MAC key please fill in the Mac Key field, and use https://sec.paymentexpress.com/pxpay/pxpay.aspx for the Site URL.
-Otherwise use https://sec.paymentexpress.com/pxpay/pxaccess.aspx for the Site URL.{/ts} {/htxt} 
+Otherwise use https://sec.paymentexpress.com/pxpay/pxaccess.aspx for the Site URL.{/ts} {/htxt}
 
 {htxt id='Elavon-live-user-name'}
 <p>{ts}This is the LIVE <strong>Elavon Merchant ID</strong> associated with your Elavon account.{/ts}</p>
index 21c579906e1c9fc3fee7d2688ba9e4519754780e..66edb0ce740421be5b63d862802b89fbabd3a636 100644 (file)
       {counter start=0 skip=1 print=false}
       {foreach from=$rows item=row name=listings}
       <tr id="row-{$smarty.foreach.listings.iteration}" class="{cycle values="odd-row,even-row"}">
-      {foreach from=$row item=value}
-        <td>{$value}</td>
+      {foreach from=$row key=index item=value}
+        {if $columnHeaders.$index.field_name}
+          <td class="crm-{$columnHeaders.$index.field_name}">{$value}</td>
+        {else}
+          <td>{$value}</td>
+        {/if}
       {/foreach}
       </tr>
       {/foreach}
index 4a64b6f7d7231e2003abc9fc82a92435bffd4f0e..800eb545e5b5d83a9a1078d27ff1ff032840cb56 100644 (file)
@@ -97,7 +97,7 @@ class CRM_Contact_BAO_QueryTestDataProvider implements Iterator {
         '18', '19', '20', '22', '23', '24',
       ),
     ),
-    
+
     // gender_id 1
     array(
       'fv' => array('gender' => 'Female'),
index 975ac1f849a7ccadffd301a879fb4031a1fce7c7..5ad19568badadd76b0d0c2cfde443f0e950b8c56 100755 (executable)
@@ -157,7 +157,7 @@ class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase {
       'name' => 'paymentProcessor',
     );
     $processor = CRM_Financial_BAO_PaymentProcessor::create($params);
-    
+
     $account = CRM_Financial_BAO_FinancialTypeAccount::getFinancialAccount(
       $processor->id,
       'civicrm_payment_processor'
index 468f75a8b222b84ce60c1ae8ff459978b851ad1d..a941b9caf40ad121d16436cc9f682ad4493b8f20 100644 (file)
@@ -45,7 +45,7 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase {
     return array(
       array(
         'CRM_Report_Form_Contribute_Detail',
-        array( 
+        array(
           'fields' => array(
             'first_name',
             'email',
@@ -58,7 +58,7 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase {
           // FIXME: add filters
         ),
         'fixtures/dataset.sql',
-        'fixtures/report.csv',      
+        'fixtures/report.csv',
       ),
     );
   }
@@ -74,7 +74,7 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase {
    */
   public function testReportOutput($reportClass, $inputParams, $dataSet, $expectedOutputCsvFile) {
     $this->foreignKeyChecksOff();
-    
+
     $this->quickCleanup(self::$_tablesToTruncate);
 
     $config = CRM_Core_Config::singleton();
index c28b59f876dd6058fef3fd415e68198e6743e42a..9343e575d6e85519f8f16a787e66aa94cb1c120a 100644 (file)
@@ -1,7 +1,7 @@
 {literal}<?php{/literal}
 
 /*
- {$description}
*{$description}
  */
 function {$function}_example(){literal}{{/literal}
 $params = {$params|@print_array};