CRM-14015 - Extend everywhere via regex
authorColeman Watts <coleman@civicrm.org>
Sun, 22 Dec 2013 01:43:01 +0000 (17:43 -0800)
committerColeman Watts <coleman@civicrm.org>
Mon, 6 Jan 2014 19:10:40 +0000 (11:10 -0800)
85 files changed:
CRM/ACL/Page/ACL.php
CRM/ACL/Page/EntityRole.php
CRM/Admin/Page/AJAX.php
CRM/Admin/Page/ContactType.php
CRM/Admin/Page/Job.php
CRM/Admin/Page/LocationType.php
CRM/Admin/Page/MessageTemplates.php
CRM/Admin/Page/OptionGroup.php
CRM/Admin/Page/OptionValue.php
CRM/Admin/Page/Options.php
CRM/Admin/Page/ParticipantStatus.php
CRM/Admin/Page/PaymentProcessor.php
CRM/Admin/Page/PaymentProcessorType.php
CRM/Admin/Page/RelationshipType.php
CRM/Admin/Page/ScheduleReminders.php
CRM/Badge/Page/Layout.php
CRM/Campaign/Page/Campaign.php
CRM/Campaign/Page/DashBoard.php
CRM/Campaign/Page/Survey.php
CRM/Campaign/Page/SurveyType.php
CRM/Contact/BAO/Group.php
CRM/Contribute/Page/ContributionPage.php
CRM/Contribute/Page/ManagePremiums.php
CRM/Contribute/Page/Tab.php
CRM/Custom/Page/Field.php
CRM/Custom/Page/Group.php
CRM/Custom/Page/Option.php
CRM/Event/Page/ManageEvent.php
CRM/Financial/Page/FinancialAccount.php
CRM/Financial/Page/FinancialType.php
CRM/Mailing/Page/Component.php
CRM/Member/Page/MembershipStatus.php
CRM/Member/Page/MembershipType.php
CRM/Price/Page/Field.php
CRM/Price/Page/Option.php
CRM/Price/Page/Set.php
CRM/Report/Page/Options.php
CRM/SMS/Page/Provider.php
CRM/UF/Page/Field.php
CRM/UF/Page/Group.php
templates/CRM/Admin/Page/ContactType.tpl
templates/CRM/Admin/Page/Extensions.tpl
templates/CRM/Admin/Page/Extensions/AddNew.tpl
templates/CRM/Admin/Page/Extensions/Main.tpl
templates/CRM/Admin/Page/Job.tpl
templates/CRM/Admin/Page/JobLog.tpl
templates/CRM/Admin/Page/LocationType.tpl
templates/CRM/Admin/Page/MessageTemplates.tpl
templates/CRM/Admin/Page/OptionGroup.tpl
templates/CRM/Admin/Page/OptionValue.tpl
templates/CRM/Admin/Page/ParticipantStatus.tpl
templates/CRM/Admin/Page/PaymentProcessor.tpl
templates/CRM/Admin/Page/PaymentProcessorType.tpl
templates/CRM/Admin/Page/RelationshipType.tpl
templates/CRM/Admin/Page/Reminders.tpl
templates/CRM/Badge/Page/Layout.tpl
templates/CRM/Campaign/Form/Search/Campaign.tpl
templates/CRM/Campaign/Form/Search/Petition.tpl
templates/CRM/Campaign/Form/Search/Survey.tpl
templates/CRM/Campaign/Page/Campaign.tpl
templates/CRM/Campaign/Page/Petition.tpl
templates/CRM/Campaign/Page/Survey.tpl
templates/CRM/Campaign/Page/SurveyType.tpl
templates/CRM/Contribute/Page/ContributionPage.tpl
templates/CRM/Contribute/Page/ContributionRecur.tpl
templates/CRM/Contribute/Page/ContributionType.tpl
templates/CRM/Contribute/Page/ManagePremiums.tpl
templates/CRM/Custom/Page/Group.tpl
templates/CRM/Custom/Page/Option.tpl
templates/CRM/Event/Page/ManageEvent.tpl
templates/CRM/Financial/Page/FinancialAccount.tpl
templates/CRM/Financial/Page/FinancialType.tpl
templates/CRM/Financial/Page/FinancialTypeAccount.tpl
templates/CRM/Group/Form/Search.tpl
templates/CRM/Mailing/Page/Component.tpl
templates/CRM/Member/Page/MembershipStatus.tpl
templates/CRM/Member/Page/MembershipType.tpl
templates/CRM/Price/Page/Field.tpl
templates/CRM/Price/Page/Option.tpl
templates/CRM/Price/Page/Set.tpl
templates/CRM/Report/Page/Options.tpl
templates/CRM/SMS/Page/Provider.tpl
templates/CRM/UF/Page/Field.tpl
templates/CRM/UF/Page/Group.tpl
templates/CRM/common/enableDisableApi.tpl

index 1806602679d8a5205b9d91530e47eeee9cbc3759..aa7f0c9d100af3635fbf646f149faa0b198f4540 100644 (file)
@@ -141,7 +141,6 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic {
 
     // finally browse the acl's
     if ($action & CRM_Core_Action::BROWSE) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
       $this->browse();
     }
 
@@ -157,6 +156,7 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
 
     // get all acl's sorted by weight
     $acl = array();
index d91c6a19b452967c82eaae19c343214bc93411b2..806c6d6a95df31eec56d380065ce9055c53849d3 100644 (file)
@@ -140,7 +140,6 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic {
     // finally browse the acl's
     if ($action & CRM_Core_Action::BROWSE) {
       CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-      $this->browse();
     }
 
     // parent run
@@ -155,6 +154,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
 
     // get all acl's sorted by weight
     $entityRoles = array();
index 6c3be55a8cc9d8700080b6c6ba8e659585f93292..582d090805b82de19baff40dfe9cb59ef9758462 100644 (file)
@@ -86,26 +86,23 @@ class CRM_Admin_Page_AJAX {
     require_once('api/v3/utils.php');
     $recordID  = CRM_Utils_Type::escape($_GET['id'], 'Integer');
     $entity = CRM_Utils_Type::escape($_GET['entity'], 'String');
-    $show = $status = NULL;
+    $ret = array();
 
-    if ($recordID && $entity) {
-      $recordBAO = _civicrm_api3_get_BAO($entity);
+    if ($recordID && $entity && $recordBAO = _civicrm_api3_get_BAO($entity)) {
       switch ($recordBAO) {
         case 'CRM_Core_BAO_UFGroup':
-          require_once (str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . '.php');
           $method = 'getUFJoinRecord';
           $result = array($recordBAO, $method);
           $ufJoin = call_user_func_array(($result), array($recordID, TRUE));
           if (!empty($ufJoin)) {
-            $status = ts('This profile is currently used for %1.', array(1 => implode(', ', $ufJoin))) . ' <br/><br/>' . ts('If you disable the profile - it will be removed from these forms and/or modules. Do you want to continue?');
+            $ret['content'] = ts('This profile is currently used for %1.', array(1 => implode(', ', $ufJoin))) . ' <br/><br/>' . ts('If you disable the profile - it will be removed from these forms and/or modules. Do you want to continue?');
           }
           else {
-            $status = ts('Are you sure you want to disable this profile?');
+            $ret['content'] = ts('Are you sure you want to disable this profile?');
           }
           break;
 
         case 'CRM_Price_BAO_PriceSet':
-          require_once (str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . '.php');
           $usedBy = CRM_Price_BAO_PriceSet::getUsedBy($recordID);
           $priceSet = CRM_Price_BAO_PriceSet::getTitle($recordID);
 
@@ -125,153 +122,134 @@ class CRM_Admin_Page_AJAX {
             }
             $template->assign('contexts', $contexts);
 
-            $show   = 'noButton';
+            $ret['illegal'] = TRUE;
             $table  = $template->fetch('CRM/Price/Page/table.tpl');
-            $status = ts('Unable to disable the \'%1\' price set - it is currently in use by one or more active events, contribution pages or contributions.', array(
+            $ret['content'] = ts('Unable to disable the \'%1\' price set - it is currently in use by one or more active events, contribution pages or contributions.', array(
               1 => $priceSet)) . "<br/> $table";
           }
           else {
-            $status = ts('Are you sure you want to disable \'%1\' Price Set?', array(1 => $priceSet));
+            $ret['content'] = ts('Are you sure you want to disable \'%1\' Price Set?', array(1 => $priceSet));
           }
           break;
 
         case 'CRM_Event_BAO_Event':
-          $status = ts('Are you sure you want to disable this Event?');
+          $ret['content'] = ts('Are you sure you want to disable this Event?');
           break;
 
         case 'CRM_Core_BAO_UFField':
-          $status = ts('Are you sure you want to disable this CiviCRM Profile field?');
+          $ret['content'] = ts('Are you sure you want to disable this CiviCRM Profile field?');
           break;
 
         case 'CRM_Contribute_BAO_ManagePremiums':
-          $status = ts('Are you sure you want to disable this premium? This action will remove the premium from any contribution pages that currently offer it. However it will not delete the premium record - so you can re-enable it and add it back to your contribution page(s) at a later time.');
+          $ret['content'] = ts('Are you sure you want to disable this premium? This action will remove the premium from any contribution pages that currently offer it. However it will not delete the premium record - so you can re-enable it and add it back to your contribution page(s) at a later time.');
           break;
 
         case 'CRM_Contact_BAO_RelationshipType':
-          $status = ts('Are you sure you want to disable this relationship type?') . '<br/><br/>' . ts('Users will no longer be able to select this value when adding or editing relationships between contacts.');
+          $ret['content'] = ts('Are you sure you want to disable this relationship type?') . '<br/><br/>' . ts('Users will no longer be able to select this value when adding or editing relationships between contacts.');
           break;
 
         case 'CRM_Financial_BAO_FinancialType':
-          $status = ts('Are you sure you want to disable this financial type?');
+          $ret['content'] = ts('Are you sure you want to disable this financial type?');
           break;
 
         case 'CRM_Financial_BAO_FinancialAccount':
           if (!CRM_Financial_BAO_FinancialAccount::getARAccounts($recordID)) {
-            $show   = 'noButton';
-            $status = ts('The selected financial account cannot be disabled because at least one Accounts Receivable type account is required (to ensure that accounting transactions are in balance).');
+            $ret['illegal'] = TRUE;
+            $ret['content'] = ts('The selected financial account cannot be disabled because at least one Accounts Receivable type account is required (to ensure that accounting transactions are in balance).');
           }
           else {
-            $status = ts('Are you sure you want to disable this financial account?');
+            $ret['content'] = ts('Are you sure you want to disable this financial account?');
           }
           break;
 
         case 'CRM_Financial_BAO_PaymentProcessor':
-          $status = ts('Are you sure you want to disable this payment processor?') . ' <br/><br/>' . ts('Users will no longer be able to select this value when adding or editing transaction pages.');
+          $ret['content'] = ts('Are you sure you want to disable this payment processor?') . ' <br/><br/>' . ts('Users will no longer be able to select this value when adding or editing transaction pages.');
           break;
 
         case 'CRM_Financial_BAO_PaymentProcessorType':
-          $status = ts('Are you sure you want to disable this payment processor type?');
+          $ret['content'] = ts('Are you sure you want to disable this payment processor type?');
           break;
 
         case 'CRM_Core_BAO_LocationType':
-          $status = ts('Are you sure you want to disable this location type?') . ' <br/><br/>' . ts('Users will no longer be able to select this value when adding or editing contact locations.');
+          $ret['content'] = ts('Are you sure you want to disable this location type?') . ' <br/><br/>' . ts('Users will no longer be able to select this value when adding or editing contact locations.');
           break;
 
         case 'CRM_Event_BAO_ParticipantStatusType':
-          $status = ts('Are you sure you want to disable this Participant Status?') . '<br/><br/> ' . ts('Users will no longer be able to select this value when adding or editing Participant Status.');
+          $ret['content'] = ts('Are you sure you want to disable this Participant Status?') . '<br/><br/> ' . ts('Users will no longer be able to select this value when adding or editing Participant Status.');
           break;
 
         case 'CRM_Mailing_BAO_Component':
-          $status = ts('Are you sure you want to disable this component?');
+          $ret['content'] = ts('Are you sure you want to disable this component?');
           break;
 
         case 'CRM_Core_BAO_CustomField':
-          $status = ts('Are you sure you want to disable this custom data field?');
+          $ret['content'] = ts('Are you sure you want to disable this custom data field?');
           break;
 
         case 'CRM_Core_BAO_CustomGroup':
-          $status = ts('Are you sure you want to disable this custom data group? Any profile fields that are linked to custom fields of this group will be disabled.');
+          $ret['content'] = ts('Are you sure you want to disable this custom data group? Any profile fields that are linked to custom fields of this group will be disabled.');
           break;
 
         case 'CRM_Core_BAO_MessageTemplate':
-          $status = ts('Are you sure you want to disable this message tempate?');
+          $ret['content'] = ts('Are you sure you want to disable this message tempate?');
           break;
 
         case 'CRM_ACL_BAO_ACL':
-          $status = ts('Are you sure you want to disable this ACL?');
+          $ret['content'] = ts('Are you sure you want to disable this ACL?');
           break;
 
         case 'CRM_ACL_BAO_EntityRole':
-          $status = ts('Are you sure you want to disable this ACL Role Assignment?');
+          $ret['content'] = ts('Are you sure you want to disable this ACL Role Assignment?');
           break;
 
         case 'CRM_Member_BAO_MembershipType':
-          $status = ts('Are you sure you want to disable this membership type?');
+          $ret['content'] = ts('Are you sure you want to disable this membership type?');
           break;
 
         case 'CRM_Member_BAO_MembershipStatus':
-          $status = ts('Are you sure you want to disable this membership status rule?');
+          $ret['content'] = ts('Are you sure you want to disable this membership status rule?');
           break;
 
         case 'CRM_Price_BAO_PriceField':
-          $status = ts('Are you sure you want to disable this price field?');
+          $ret['content'] = ts('Are you sure you want to disable this price field?');
           break;
 
         case 'CRM_Contact_BAO_Group':
-          $status = ts('Are you sure you want to disable this Group?');
+          $ret['content'] = ts('Are you sure you want to disable this Group?');
           break;
 
         case 'CRM_Core_BAO_OptionGroup':
-          $status = ts('Are you sure you want to disable this Option?');
+          $ret['content'] = ts('Are you sure you want to disable this Option?');
           break;
 
         case 'CRM_Contact_BAO_ContactType':
-          $status = ts('Are you sure you want to disable this Contact Type?');
+          $ret['content'] = ts('Are you sure you want to disable this Contact Type?');
           break;
 
         case 'CRM_Core_BAO_OptionValue':
-          require_once (str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . '.php');
           $label = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $recordID, 'label');
-          $status = ts('Are you sure you want to disable the \'%1\' option ?', array(1 => $label));
-          $status .= '<br /><br />' . ts('WARNING - Disabling an option which has been assigned to existing records will result in that option being cleared when the record is edited.');
+          $ret['content'] = ts('Are you sure you want to disable the \'%1\' option ?', array(1 => $label));
+          $ret['content'] .= '<br /><br />' . ts('WARNING - Disabling an option which has been assigned to existing records will result in that option being cleared when the record is edited.');
           break;
 
         case 'CRM_Contribute_BAO_ContributionRecur':
           $recurDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($recordID);
-          $status = ts('Are you sure you want to mark this recurring contribution as cancelled?');
-          $status .= '<br /><br /><strong>' . ts('WARNING - This action sets the CiviCRM recurring contribution status to Cancelled, but does NOT send a cancellation request to the payment processor. You will need to ensure that this recurring payment (subscription) is cancelled by the payment processor.') . '</strong>';
+          $ret['content'] = ts('Are you sure you want to mark this recurring contribution as cancelled?');
+          $ret['content'] .= '<br /><br /><strong>' . ts('WARNING - This action sets the CiviCRM recurring contribution status to Cancelled, but does NOT send a cancellation request to the payment processor. You will need to ensure that this recurring payment (subscription) is cancelled by the payment processor.') . '</strong>';
           if ($recurDetails->membership_id) {
-            $status .= '<br /><br /><strong>' . ts('This recurring contribution is linked to an auto-renew membership. If you cancel it, the associated membership will no longer renew automatically. However, the current membership status will not be affected.') . '</strong>';
-          }
-          break;
-
-        case 'CRM_Batch_BAO_Batch':
-          if ($op == 'close') {
-            $status = ts('Are you sure you want to close this batch?');
-          }
-          elseif ($op == 'open') {
-            $status = ts('Are you sure you want to reopen this batch?');
-          }
-          elseif ($op == 'delete') {
-            $status = ts('Are you sure you want to delete this batch?');
-          }
-          elseif ($op == 'remove') {
-            $status = ts('Are you sure you want to remove this financial transaction?');
-          }
-          elseif ($op == 'export') {
-            $status = ts('Are you sure you want to close and export this batch?');
-          }
-          else {
-            $status = ts('Are you sure you want to assign this financial transaction to the batch?');
+            $ret['content'] .= '<br /><br /><strong>' . ts('This recurring contribution is linked to an auto-renew membership. If you cancel it, the associated membership will no longer renew automatically. However, the current membership status will not be affected.') . '</strong>';
           }
           break;
 
         default:
-          $status = ts('Are you sure you want to disable this record?');
+          $ret['content'] = ts('Are you sure you want to disable this record?');
           break;
       }
     }
-    CRM_Core_Page_AJAX::returnJsonResponse($status);
+    else {
+      $ret = array('status' => 'error', 'content' => 'Error: Unknown entity type.', 'illegal' => TRUE);
+    }
+    CRM_Core_Page_AJAX::returnJsonResponse($ret);
   }
 
   static function getTagList() {
index 870e7038b5e7de81f6378c8f6039a68bc859e713..169a06b14cf93da0d4bc2226c1aa15f18f85a12f 100644 (file)
@@ -73,15 +73,13 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
         CRM_Core_Action::DISABLE =>
         array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contact_BAO_ContactType' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Contact Type'),
         ),
         CRM_Core_Action::ENABLE =>
         array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contact_BAO_ContactType' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Contact Type'),
         ),
         CRM_Core_Action::DELETE =>
@@ -107,6 +105,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
   }
 
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $rows = CRM_Contact_BAO_ContactType::contactTypeInfo(TRUE);
     foreach ($rows as $key => $value) {
       $mask = NULL;
index 2bc2e5c49615745ea6c2168b34ea6432abc96215..7d9305c5349b4cf2258a421b852bced65f3bf23e 100644 (file)
@@ -83,14 +83,12 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_Job' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Scheduled Job'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_Job' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Scheduled Job'),
         ),
         CRM_Core_Action::DELETE => array(
index 0ea8f4067d1a01e53b9ae96aa178896e9411b446..f1052979c76a654892ee43986fe59551985990b1 100644 (file)
@@ -71,14 +71,12 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_LocationType' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Location Type'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_LocationType' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Location Type'),
         ),
         CRM_Core_Action::DELETE => array(
index a2a834b7fd89b753a9da2c81146c494e571beee6..d9a75806e53eaf652a555d2b89fb5472de868a89 100644 (file)
@@ -100,14 +100,12 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_MessageTemplate' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable this message template'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_MessageTemplate' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable this message template'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -225,6 +223,7 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
    * @access public
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $action = func_num_args() ? func_get_arg(0) : NULL;
     if ($this->_action & CRM_Core_Action::ADD) {
       return;
index adbc1e3d6e8b0c1679d6a4ac54b6719617a99c65..0d39c0816d57d0fb238c495e0ae2e775098432c1 100644 (file)
@@ -77,14 +77,12 @@ class CRM_Admin_Page_OptionGroup extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionGroup' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Option'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionGroup' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Option'),
         ),
         CRM_Core_Action::DELETE => array(
index 396a97f2a1d538373150967af4f043df260770af..7f28c87ce9aaef0ae4962c086c9e9c861edfcd79 100644 (file)
@@ -81,14 +81,12 @@ class CRM_Admin_Page_OptionValue extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionValue' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Option Value'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionValue' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Option Value'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -149,6 +147,7 @@ class CRM_Admin_Page_OptionValue extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $dao = new CRM_Core_DAO_OptionValue();
 
     $dao->option_group_id = $this->_gid;
index e8d3c4a239aa3bbe924a278216b5b7922fa06fd2..de748d0e6cb84ba8747343647d67455a7cf91004 100644 (file)
@@ -211,7 +211,6 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
 
     $groupParams = array('name' => self::$_gName);
     $optionValue = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'component_id,weight');
index c87e99e18b31ef24f095b0bffa398d3b5a22d961..5140c14b754f7012a95ff8a33cb590d5bd0421c6 100644 (file)
@@ -55,14 +55,12 @@ class CRM_Admin_Page_ParticipantStatus extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Event_BAO_ParticipantStatusType' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Status'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Event_BAO_ParticipantStatusType' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Status'),
         ),
       );
@@ -71,6 +69,7 @@ class CRM_Admin_Page_ParticipantStatus extends CRM_Core_Page_Basic {
   }
 
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $statusTypes = array();
 
     $dao = new CRM_Event_DAO_ParticipantStatusType;
index b5a4b5e837989707093030678812a7144303a720..2196e125134a6814233e2851ab168891e4d8abf7 100644 (file)
@@ -71,14 +71,12 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Financial_BAO_PaymentProcessor' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Payment Processor'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Financial_BAO_PaymentProcessor' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Payment Processor'),
         ),
         CRM_Core_Action::DELETE => array(
index c1e9cecb282515450ab56be0917c211ed9570aa3..d324b330c56949a7edcc8d7fc768482f1e244a67 100644 (file)
@@ -71,14 +71,12 @@ class CRM_Admin_Page_PaymentProcessorType extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Financial_BAO_PaymentProcessorType' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Payment ProcessorType'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Financial_BAO_PaymentProcessorType' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Payment ProcessorType'),
         ),
         CRM_Core_Action::DELETE => array(
index 83353333d20a9ac9ac69dfa689674abcd0dd0379..ae551ea2e41b898398e2bbd1dac3670cde143bac 100644 (file)
@@ -77,14 +77,12 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contact_BAO_RelationshipType' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Relationship Type'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contact_BAO_RelationshipType' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Relationship Type'),
         ),
         CRM_Core_Action::DELETE => array(
index 6c684af78d03721e304399b02c0a914a0cffef90..8d117b33d654be6d5990c3c2d69a3c265adf565e 100644 (file)
@@ -73,14 +73,12 @@ class CRM_Admin_Page_ScheduleReminders extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_ActionSchedule' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Label Format'),
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_ActionSchedule' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Label Format'),
         ),
         CRM_Core_Action::DELETE => array(
index a60ec2b47874fe5523fe85d6b0f24cc0e2ed2d51..fe8ec2974b4723618b333ecbc8d3ba22c9498e16 100644 (file)
@@ -71,14 +71,12 @@ class CRM_Badge_Page_Layout extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_DAO_PrintLabel' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Badge Layout'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_DAO_PrintLabel' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Badge Layout'),
         ),
         CRM_Core_Action::DELETE => array(
index 3523409c36eb7e7cec64376cb15904eb969eb19b..d17f23ec3bbf278a3403071ccf920f66e29ae329 100644 (file)
@@ -65,14 +65,12 @@ class CRM_Campaign_Page_Campaign extends CRM_Core_Page {
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
           'title' => ts('Disable Campaign'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Campaign' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
           'title' => ts('Enable Campaign'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Campaign' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
         ),
         CRM_Core_Action::DELETE => array(
           'name' => ts('Delete'),
@@ -86,6 +84,7 @@ class CRM_Campaign_Page_Campaign extends CRM_Core_Page {
   }
 
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
 
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaignSummary();
 
index 7fceadf1df34298a690be847f181b871e2d1038e..de364c9b6c134743061db9e4731cd3e0aaf97429 100644 (file)
@@ -67,14 +67,12 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
           'title' => ts('Disable Campaign'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Campaign' . '\',\'' . 'enable-disable' . '\',\'' . NULL . '\',\'' . 'campaign_row' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
           'title' => ts('Enable Campaign'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Campaign' . '\',\'' . 'disable-enable' . '\',\'' . NULL . '\',\'' . 'campaign_row' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
         ),
         CRM_Core_Action::DELETE => array(
           'name' => ts('Delete'),
@@ -100,14 +98,12 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Survey' . '\',\'' . 'enable-disable' . '\',\'' . NULL . '\',\'' . 'survey_row' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Survey'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Survey' . '\',\'' . 'disable-enable' . '\',\'' . NULL . '\',\'' . 'survey_row' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Survey'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -133,14 +129,12 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
       );
       self::$_petitionActionLinks[CRM_Core_Action::DISABLE] = array(
         'name' => ts('Disable'),
-        'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Survey' . '\',\'' . 'enable-disable' . '\',\'' . NULL . '\',\'' . 'petition_row' . '\' );"',
-        'ref' => 'disable-action',
+        'ref' => 'crm-enable-disable',
         'title' => ts('Disable Petition'),
       );
       self::$_petitionActionLinks[CRM_Core_Action::ENABLE] = array(
         'name' => ts('Enable'),
-        'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Survey' . '\',\'' . 'disable-enable' . '\',\'' . NULL . '\',\'' . 'petition_row' . '\' );"',
-        'ref' => 'enable-action',
+        'ref' => 'crm-enable-disable',
         'title' => ts('Enable Petition'),
       );
       self::$_petitionActionLinks[CRM_Core_Action::DELETE] = array(
@@ -426,6 +420,7 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
   }
 
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $this->_tabs = array('campaign' => ts('Campaigns'),
       'survey' => ts('Surveys'),
       'petition' => ts('Petitions'),
index 0d0448f0b21872c1f3a9d1179b32ce9349199c77..02bca24b496105368fad5f158ae7929fb617274b 100644 (file)
@@ -53,14 +53,12 @@ class CRM_Campaign_Page_Survey extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Survey' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Survey'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Campaign_BAO_Survey' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Survey'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -75,6 +73,7 @@ class CRM_Campaign_Page_Survey extends CRM_Core_Page {
   }
 
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
 
     $surveys = CRM_Campaign_BAO_Survey::getSurveySummary();
 
index 522713278925322dc1b6b0d03ce31382b4acc9ff..37174e2c67758a7203ea721b4eaa23a74fe45dac 100644 (file)
@@ -117,14 +117,12 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionValue' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable %1', array(1 => $this->_gName)),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionValue' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable %1', array(1 => $this->_gName)),
         ),
         CRM_Core_Action::DELETE => array(
@@ -157,6 +155,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
 
     $campaingCompId = CRM_Core_Component::getComponentID('CiviCampaign');
     $groupParams    = array('name' => $this->_gName);
index ac1a27fa0bb752a3c412ba994d047045048747cb..da200837d4bfae24b09221a5d2c16d1dc8662c98 100644 (file)
@@ -1184,14 +1184,12 @@ WHERE {$whereClause}";
       ),
       CRM_Core_Action::DISABLE => array(
         'name' => ts('Disable'),
-        'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contact_BAO_Group' . '\',\'' . 'enable-disable' . '\' );"',
-        'ref' => 'disable-action',
+        'ref' => 'crm-enable-disable',
         'title' => ts('Disable Group'),
       ),
       CRM_Core_Action::ENABLE => array(
         'name' => ts('Enable'),
-        'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contact_BAO_Group' . '\',\'' . 'disable-enable' . '\' );"',
-        'ref' => 'enable-action',
+        'ref' => 'crm-enable-disable',
         'title' => ts('Enable Group'),
       ),
       CRM_Core_Action::DELETE => array(
index 8c97a372256226579d0fbc84aa0839a9d8a9b8bb..54a29025936c7b20a9a5def5fd36fe94cf0c522a 100644 (file)
@@ -85,13 +85,11 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
           'title' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contribute_BAO_ContributionPage' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contribute_BAO_ContributionPage' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable'),
         ),
         CRM_Core_Action::DELETE => array(
index 3ee39d0d45f179d46c19140ff20f4e8c240e7c71..bbc1f161ddccc69456ec15586a008dcb296d3ae3 100644 (file)
@@ -77,14 +77,12 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contribute_BAO_ManagePremiums' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Premium'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Contribute_BAO_ManagePremiums' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Premium'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -143,6 +141,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     // get all custom groups sorted by weight
     $premiums = array();
     $dao = new CRM_Contribute_DAO_Product();
index d80848fcded6dd5f191f2ebf90ae5fe7680053f9..bedc1f5f679679af9bdced21f1d890738f5aae83 100644 (file)
@@ -114,8 +114,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Cancel'),
           'title' => ts('Cancel'),
-          'extra' => 'onclick = "enableDisable( %%crid%%,\'' . 'CRM_Contribute_BAO_ContributionRecur' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
         ),
       );
     }
@@ -147,6 +146,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
    * @access public
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
 
     // add annual contribution
     $annual = array();
index d0a53d861cb730fdc710de3efdb8bd62212aba13..a31ae10f4df5904e6169333552e55946f0e8b4e1 100644 (file)
@@ -124,6 +124,7 @@ class CRM_Custom_Page_Field extends CRM_Core_Page {
    * @access public
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $customField = array();
     $customFieldBAO = new CRM_Core_BAO_CustomField();
 
@@ -288,7 +289,6 @@ class CRM_Custom_Page_Field extends CRM_Core_Page {
       $this->preview($id);
     }
     else {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
       $this->browse();
     }
 
index 5f0984f98f6b332145b37c24bef2bb95310d170f..b26cea535d3ae55d0c4c84ec4f248f7bfcc8927f 100644 (file)
@@ -82,14 +82,12 @@ class CRM_Custom_Page_Group extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_CustomGroup' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Custom Set'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_CustomGroup' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Custom Set'),
         ),
         CRM_Core_Action::DELETE => array(
index 95c2a655859712574ae3e356b28a7f8e03d63aba..73cdb12c6a98663f3b5ae1008848b3a3f210385f 100644 (file)
@@ -92,14 +92,12 @@ class CRM_Custom_Page_Option extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionValue' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Mutliple Choice Option'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionValue' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Mutliple Choice Option'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -122,6 +120,7 @@ class CRM_Custom_Page_Option extends CRM_Core_Page {
    * @access public
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     //get the default value from custom fields
     $customFieldBAO = new CRM_Core_BAO_CustomField();
     $customFieldBAO->id = $this->_fid;
index 7af2bac53cba40e17f1d803455e6734e47dbbc66..a52317e577c50b3cb46cd5b0578bfd4aaf8ecb4c 100644 (file)
@@ -70,14 +70,12 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page {
       self::$_actionLinks = array(
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Event_BAO_Event' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Event'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Event_BAO_Event' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Event'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -230,6 +228,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page {
    * @return void
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter',
       'String',
       $this
index 7da3b0226702df1d5dad93bb5d0eb14171c483c7..5b90a3d1f4305b15d964d15331c5626f4ff8f544 100644 (file)
@@ -70,13 +70,11 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name'  => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\''. 'CRM_Financial_BAO_FinancialAccount' . '\',\'' . 'enable-disable' . '\' );"',
           'ref'   => 'disable-action',
           'title' => ts('Disable Financial Type'),
         ),
         CRM_Core_Action::ENABLE  => array(
           'name'  => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\''. 'CRM_Financial_BAO_FinancialAccount' . '\',\'' . 'disable-enable' . '\' );"',
           'ref'   => 'enable-action',
           'title' => ts('Enable Financial Type'),
         ),
@@ -128,6 +126,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     // get all custom groups sorted by weight
     $contributionType = array();
     $dao = new CRM_Financial_DAO_FinancialAccount();
index 3559b4d90c7d6dea4379e53997c1c15b9ae23fc5..d00c6c6dbe713916cf4badd351fc2b054e6697ce 100644 (file)
@@ -76,13 +76,11 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name'  => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\''. 'CRM_Financial_BAO_FinancialType' . '\',\'' . 'enable-disable' . '\' );"',
           'ref'   => 'disable-action',
           'title' => ts('Disable Financial Type'),
         ),
         CRM_Core_Action::ENABLE  => array(
           'name'  => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\''. 'CRM_Financial_BAO_FinancialType' . '\',\'' . 'disable-enable' . '\' );"',
           'ref'   => 'enable-action',
           'title' => ts('Enable Financial Type'),
         ),
@@ -134,6 +132,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     // get all financial types sorted by weight
     $financialType = array();
     $dao = new CRM_Financial_DAO_FinancialType();
index f53d2125f4f1483fec3ff42053f09fe48af8f606..9daf5bef40bdafeb52a03713f900b8e4f210cdf2 100644 (file)
@@ -72,14 +72,12 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Mailing_BAO_Component' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Mailing Component'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Mailing_BAO_Component' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Mailing Component'),
         ),
       );
index cb803473561ff6d55e7ebaae63f966d5e17870e4..07c5b075793c93fefb0c78da56b15c87ac26fb89 100644 (file)
@@ -71,14 +71,12 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Member_BAO_MembershipStatus' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Membership Status'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Member_BAO_MembershipStatus' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Membership Status'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -136,6 +134,7 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     // get all custom groups sorted by weight
     $membershipStatus = array();
     $dao = new CRM_Member_DAO_MembershipStatus();
index 8b530cf97c103528680faf41d7553b36f5c4cbab..0ad3122ced51da2b88bae9e3c9b4ab7bf5fae6fb 100644 (file)
@@ -62,14 +62,12 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Member_BAO_MembershipType' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Membership Type'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Member_BAO_MembershipType' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Membership Type'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -110,6 +108,7 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     // get all membership types sorted by weight
     $membershipType = array();
     $dao = new CRM_Member_DAO_MembershipType();
index 46494f77a6fbb5fb5baf11224621f0cf144d0d57..f78efa343da3c45041ca943e66b0bb5c73d6eda4 100644 (file)
@@ -93,14 +93,12 @@ class CRM_Price_Page_Field extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%fid%%,\'' . 'CRM_Price_BAO_PriceField' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Price'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%fid%%,\'' . 'CRM_Price_BAO_PriceField' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Price'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -124,6 +122,7 @@ class CRM_Price_Page_Field extends CRM_Core_Page {
    * @access public
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $priceField    = array();
     $priceFieldBAO = new CRM_Price_BAO_PriceField();
 
index 8662d8c4ef571715d90a3e793cfd51003a2466bd..8f7220e393e045468a4eb710af0ded92ef32fcb1 100644 (file)
@@ -99,14 +99,12 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%oid%%,\'' . 'CRM_Price_BAO_PriceFieldValue' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Price Option'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%oid%%,\'' . 'CRM_Price_BAO_PriceFieldValue' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Price Option'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -129,6 +127,7 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
    * @access public
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $customOption = array();
     CRM_Price_BAO_PriceFieldValue::getValues($this->_fid, $customOption);
     $config = CRM_Core_Config::singleton();
index a0a7c9cbdd208c96cc492bd1f6e1ddd3b3d102a1..c6523bb90f747d49d606005bf44b43a547409a07 100644 (file)
@@ -84,14 +84,12 @@ class CRM_Price_Page_Set extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%sid%%,\'' . 'CRM_Price_BAO_PriceSet' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Price Set'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%sid%%,\'' . 'CRM_Price_BAO_PriceSet' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Price Set'),
         ),
         CRM_Core_Action::DELETE => array(
index 9130a3831dc5403e742119ea46d1871dc32ab80a..9adf3b1ed6f718f879cbc1f79cb921c942169ce6 100644 (file)
@@ -126,14 +126,12 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionValue' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable %1', array(1 => self::$_gName)),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_OptionValue' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable %1', array(1 => self::$_gName)),
         ),
         CRM_Core_Action::DELETE => array(
@@ -167,6 +165,7 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $groupParams = array('name' => self::$_gName);
     $optionValue = CRM_Core_OptionValue::getRows($groupParams, $this->links(), 'weight');
     $gName       = self::$_gName;
index 4b58e551d39f5e7ecfc1119fc9c9e00e384c9666..1f06458f9bf2d915ce1a48c83b13ac2d702056b5 100644 (file)
@@ -77,14 +77,12 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic {
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_SMS_BAO_Provider' . '\',\'' . 'disable-enable' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable Provider'),
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_SMS_BAO_Provider' . '\',\'' . 'enable-disable' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable Provider'),
         ),
       );
index bd3ab1e0470cb7a26cf622400e36f6f4d2e6e354..37b67017989d1d63b5aec946e999acb8806ae242 100644 (file)
@@ -81,14 +81,12 @@ class CRM_UF_Page_Field extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_UFField' . '\',\'' . 'enable-disable' . '\',0,\'UFField\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable CiviCRM Profile Field'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_UFField' . '\',\'' . 'disable-enable' . '\',0,\'UFField\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable CiviCRM Profile Field'),
         ),
         CRM_Core_Action::DELETE => array(
@@ -110,6 +108,7 @@ class CRM_UF_Page_Field extends CRM_Core_Page {
    * @static
    */
   function browse() {
+    CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     $ufField = array();
     $ufFieldBAO = new CRM_Core_BAO_UFField();
 
index 6494f3ea565aca9bf48e2db2c622d55939a58727..8279ba39806e0ab32d4d51200aa8fdb7e761132e 100644 (file)
@@ -90,14 +90,12 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
         ),
         CRM_Core_Action::DISABLE => array(
           'name' => ts('Disable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_UFGroup' . '\',\'' . 'enable-disable\',0,\'UFGroup' . '\' );"',
-          'ref' => 'disable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Disable CiviCRM Profile Group'),
         ),
         CRM_Core_Action::ENABLE => array(
           'name' => ts('Enable'),
-          'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_UFGroup' . '\',\'' . 'disable-enable\',0,\'UFGroup' . '\' );"',
-          'ref' => 'enable-action',
+          'ref' => 'crm-enable-disable',
           'title' => ts('Enable CiviCRM Profile Group'),
         ),
         CRM_Core_Action::DELETE => array(
index eeb3a78240637124569531bae6ba9b20a52f8e8f..322034284327f6a087e1099bd932ed8e7012c4c5 100644 (file)
@@ -35,7 +35,8 @@
 <div>
     {strip}
     {* handle enable/disable actions*}
-    {include file="CRM/common/enableDisable.tpl"}
+    {include file="CRM/common/enableDisableApi.tpl"}
+    {include file="CRM/common/crmeditable.tpl"}
     {include file="CRM/common/jsortable.tpl"}
     <table id="options" class="display">
     <thead>
     </tr>
     </thead>
     {foreach from=$rows item=row}
-      <tr id="row_{$row.id}" class="{cycle values="odd-row,even-row"} {$row.class} crm-contactType {if NOT $row.is_active} disabled{/if}">
-        <td class="crm-contactType-label">{ts}{$row.label}{/ts}</td>
+      <tr id="contact_type-{$row.id}" class="{cycle values="odd-row,even-row"} {$row.class} crm-contactType crm-entity {if NOT $row.is_active} disabled{/if}">
+        <td class="crm-contactType-label crm-editable" data-field="label">{ts}{$row.label}{/ts}</td>
         <td class="crm-contactType-parent">{if $row.parent}{ts}{$row.parent_label}{/ts}{else}{ts}(built-in){/ts}{/if}</td>
-        <td class="crm-contactType-description">{$row.description}</td>
+        <td class="crm-contactType-description crm-editable" data-field="description">{$row.description}</td>
         <td>{$row.action|replace:'xx':$row.id}</td>
     </tr>
     {/foreach}
index 6bc3e1ef2171c6e51daa73e5d4c02f3c2007c46b..3519adffb03244192c6de90b7109e20831ec4589 100644 (file)
@@ -39,7 +39,8 @@
 
     {include file="CRM/Admin/Page/Extensions/About.tpl"}
 
-    {include file="CRM/common/enableDisable.tpl"}
+    {include file="CRM/common/enableDisableApi.tpl"}
+    {include file="CRM/common/crmeditable.tpl"}
     {include file="CRM/common/jsortable.tpl"}
 
     <div id="mainTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
index 3d38ef14f70c3c84ff2a179217920e87fe61e17f..1274a773c0c92e4f72d279472de71499224c3885 100644 (file)
@@ -1,7 +1,7 @@
 {* 
 Display a table of remotely-available extensions
 
-Depends: CRM/common/enableDisable.tpl and CRM/common/jsortable.tpl 
+Depends: CRM/common/enableDisableApi.tpl and CRM/common/jsortable.tpl
 *}
 {if $remoteExtensionRows}
   <div id="extensions-addnew">
index d9c8a8331fb7d7f85cc7f6a692def6d44098adce..fe07c0ffe5136f8dfb79e87cbcecab8ec139c402 100644 (file)
@@ -1,7 +1,7 @@
 {*
 Display a table of locally-available extensions.
 
-Depends: CRM/common/enableDisable.tpl and CRM/common/jsortable.tpl
+Depends: CRM/common/enableDisableApi.tpl and CRM/common/jsortable.tpl
 *}
 {if $localExtensionRows}
   <div id="extensions">
@@ -19,7 +19,7 @@ Depends: CRM/common/enableDisable.tpl and CRM/common/jsortable.tpl
       </thead>
       <tbody>
         {foreach from=$localExtensionRows key=extKey item=row}
-        <tr id="row_{$row.id}" class="crm-extensions crm-extensions_{$row.id}{if $row.status eq 'disabled'} disabled{/if}{if $row.status eq 'installed-missing' or $row.status eq 'disabled-missing'} extension-missing{/if}{if $row.upgradable} extension-upgradable{elseif $row.status eq 'installed'} extension-installed{/if}">
+        <tr id="extension-{$row.id}" class="crm-entity crm-extension_{$row.id}{if $row.status eq 'disabled'} disabled{/if}{if $row.status eq 'installed-missing' or $row.status eq 'disabled-missing'} extension-missing{/if}{if $row.upgradable} extension-upgradable{elseif $row.status eq 'installed'} extension-installed{/if}">
           <td class="crm-extensions-label">
               <a class="collapsed" href="#"></a>&nbsp;<strong>{$row.label}</strong><br/>({$row.key})
               {if $extAddNewEnabled && $remoteExtensionRows[$extKey] && $remoteExtensionRows[$extKey].is_upgradeable}
index c9aa8bc101b26e0bf214e16504191637840f2689..f67d3374dd1567db73c2a4e6525db2a77d171209 100644 (file)
@@ -44,7 +44,8 @@
 <div id="ltype">
     {strip}
         {* handle enable/disable actions*}
-       {include file="CRM/common/enableDisable.tpl"}
+       {include file="CRM/common/enableDisableApi.tpl"}
+       {include file="CRM/common/crmeditable.tpl"}
         <br/><table class="selector">
         <tr class="columnheader">
             <th >{ts}Name (Frequency)/Description{/ts}</th>
@@ -54,7 +55,7 @@
             <th ></th>
         </tr>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="crm-job {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+        <tr id="job-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
             <td class="crm-job-name"><strong>{$row.name}</strong> ({$row.run_frequency})<br/>
                 {$row.description}<br />
                 {ts}API Entity:{/ts} {$row.api_entity}<br/>
index a17114c98a012beb3122cb358bcae7512889c840..886c1f8a47b37002e0ebc4811049121a2ed3a4fa 100644 (file)
@@ -39,7 +39,8 @@
 <div id="ltype">
         {strip}
         {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
         <table class="selector">
         <tr class="columnheader">
             <th >{ts}Date{/ts}</th>
@@ -47,7 +48,7 @@
             <th >{ts}Command{/ts}/{ts}Job Status{/ts}/{ts}Additional Information{/ts}</th>
         </tr>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="crm-job {cycle values="odd-row,even-row"} {$row.class}">
+        <tr id="job-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}">
             <td class="crm-joblog-run_datetime">{$row.run_time}</td>
             <td class="crm-joblog-name">{$row.name}</td>
             <td class="crm-joblog-details">
index 5a56359883bd6366791cb2f69853b755a0b8f8af..3756ad48b8c592d87d15cc2950ff185e24c2ed91 100644 (file)
@@ -35,7 +35,8 @@
 <div id="ltype">
     {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
     {include file="CRM/common/jsortable.tpl"}
     <table id="options" class="display">
     <thead>
@@ -50,7 +51,7 @@
     </tr>
     </thead>
     {foreach from=$rows item=row}
-    <tr id="row_{$row.id}"class="{cycle values="odd-row,even-row"} {$row.class} crm-locationType {if NOT $row.is_active} disabled{/if}">
+    <tr id="location_type-{$row.id}" class="{cycle values="odd-row,even-row"} {$row.class} crm-entity {if NOT $row.is_active} disabled{/if}">
         <td class="crm-locationType-name">{$row.name}</td>
         <td class="crm-locationType-display_name">{$row.display_name}</td>
         <td class="crm-locationType-vcard_name">{$row.vcard_name}</td>
index d2e6b5a74eda35d2b32f1f767afbbad99a558ef9..b0f2637130a97f86a5ff7dc03f97ce835505af39 100644 (file)
@@ -94,7 +94,8 @@
     </ul>
 
     {* create two selector tabs, first being the â€˜user’ one, the second being the â€˜workflow’ one *}
-    {include file="CRM/common/enableDisable.tpl"}
+    {include file="CRM/common/enableDisableApi.tpl"}
+    {include file="CRM/common/crmeditable.tpl"}
     {include file="CRM/common/jsortable.tpl"}
     {foreach from=$rows item=template_row key=type}
       <div id="{if $type eq 'userTemplates'}user{else}workflow{/if}" class='ui-tabs-panel ui-widget-content ui-corner-bottom'>
                 </thead>
                 <tbody>
                 {foreach from=$template_row item=row}
-                    <tr id="row_{$row.id}" class="{$row.class}{if NOT $row.is_active} disabled{/if}">
+                    <tr id="message_template-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
                       <td>{$row.msg_title}</td>
                       {if $type eq 'userTemplates'}
                         <td>{$row.msg_subject}</td>
index 598171adcb43a18622d6d77fc48678099d6d5586..3054e66a392708afae138288781684cf25f8b540 100644 (file)
@@ -38,7 +38,8 @@
 <div id="browseValues">
     {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
     <table cellpadding="0" cellspacing="0" border="0">
         <tr class="columnheader">
         <th>{ts}Title{/ts}</th>
@@ -46,7 +47,7 @@
         <th></th>
         </tr>
         {foreach from=$rows item=row}
-      <tr id="row_{$row.id}"class="crm-admin-optionGroup {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+      <tr id="optionGroup-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
             <td class="crm-admin-optionGroup-title">{if $row.title}{$row.title}{else}( {ts}none{/ts} ){/if}</td>
             <td class="crm-admin-optionGroup-name">{$row.name}</td>
             <td><a href="{crmURL p="civicrm/admin/optionValue" q="gid=`$row.id`&reset=1"}" title="{ts}View and Edit Options{/ts}">{ts}Options{/ts}</a></td>
index 050d6b3a5a58cd14b7e6b0394d26010bf01661e6..4a9d60038cd9f3c464de664a76a0538b3afa8e2e 100644 (file)
@@ -37,7 +37,8 @@
 <div id="browseValues">
     {strip}
    {* handle enable/disable actions*}
-    {include file="CRM/common/enableDisable.tpl"}
+    {include file="CRM/common/enableDisableApi.tpl"}
+    {include file="CRM/common/crmeditable.tpl"}
     {include file="CRM/common/jsortable.tpl"}
          <table id="options" class="display">
          <thead>
@@ -55,8 +56,8 @@
         </tr>
         </thead>
         {foreach from=$rows item=row}
-      <tr id="row_{$row.id}"class="crm-admin-optionValue {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
-            <td class="crm-admin-optionValue-label">{$row.label}</td>
+      <tr id="optionValue-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+            <td class="crm-admin-optionValue-label crm-editable" data-field="label">{$row.label}</td>
             <td class="crm-admin-optionValue-value">{$row.value}</td>
             <td class="crm-admin-optionValue-description">{$row.description}</td>
             <td class="nowrap crm-admin-optionValue-weight">{$row.weight}</td>
index 27b1b69df2f76ecd42b118fe5098d34b6c575f6e..395cfe7cb113999bcb237e8cd824061a8a1204bf 100644 (file)
@@ -31,7 +31,8 @@
 <div class="crm-section participant-status">
   {strip}
     {* handle enable/disable actions*}
-    {include file="CRM/common/enableDisable.tpl"}
+    {include file="CRM/common/enableDisableApi.tpl"}
+    {include file="CRM/common/crmeditable.tpl"}
     <table cellpadding="0" cellspacing="0" border="0">
       <thead class="sticky">
         <th>{ts}Label{/ts}</th>
@@ -45,8 +46,8 @@
         <th></th>
       </thead>
       {foreach from=$rows item=row}
-       <tr id="row_{$row.id}" class=" crm-particpant crm-participant_{$row.id} {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
-          <td class="crm-particpant-label">{$row.label}</td>
+       <tr id="particpant_status_type-{$row.id}" class="crm-entity crm-participant_{$row.id} {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+          <td class="crm-particpant-label crm-editable" data-field="label">{$row.label}</td>
           <td class="crm-particpant-name">{$row.name} ({$row.id})</td>
           <td class="crm-particpant-class">{$row.class}</td>
           <td class="yes-no crm-participant-is_reserved">{if $row.is_reserved}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Reserved{/ts}" />{/if}</td>
index 33beefb10640d20d6bb837733f7fa67a14aa1454..d69ec827a29960398b247f5ea0cd06f257bca46c 100644 (file)
@@ -36,7 +36,8 @@
 <div id="ltype">
         {strip}
         {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
         <table class="selector">
         <tr class="columnheader">
             <th >{ts}Name{/ts}</th>
@@ -48,7 +49,7 @@
             <th ></th>
         </tr>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="crm-payment_processor {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+        <tr id="payment_processor-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
             <td class="crm-payment_processor-name">{$row.name}</td>
             <td class="crm-payment_processor-payment_processor_type">{$row.payment_processor_type}</td>
             <td class="crm-payment_processor-description">{$row.description}</td>
index a927654d43951005f145e9d1fe7869e02582ad50..95213b3c18640838e30f854ba863cd6afe2b7c77 100644 (file)
@@ -36,7 +36,8 @@
 <p></p>
     <div class="form-item">
         {strip}
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
         <table cellpadding="0" cellspacing="0" border="0">
         <tr class="columnheader">
             <th>{ts}Name{/ts}</th>
@@ -47,9 +48,9 @@
             <th></th>
         </tr>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="{cycle values="odd-row,even-row"} {$row.class} crm-paymentProcessorType {if NOT $row.is_active} disabled{/if}">
+        <tr id="paymentProcessorType-{$row.id}" class="{cycle values="odd-row,even-row"} {$row.class} crm-entity {if NOT $row.is_active} disabled{/if}">
           <td class="crm-paymentProcessorType-name">{$row.name}</td>
-          <td class="crm-paymentProcessorType-title">{$row.title}</td>
+          <td class="crm-paymentProcessorType-title crm-editable" data-field="title">{$row.title}</td>
             <td class="crm-paymentProcessorType-description">{$row.description}</td>
           <td id="row_{$row.id}_status" class="crm-paymentProcessorType-is_active">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td class="crm-paymentProcessorType-is_default">{if $row.is_default eq 1}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" />{/if}&nbsp;</td>
index 51f711ce0860e39776a124259d923f8665373bf6..45f9f7dc451aa2d31c91b60ac36f71919e16b456 100644 (file)
 
     {strip}
   {* handle enable/disable actions*}
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
     {include file="CRM/common/jsortable.tpl"}
         <table id="options" class="display">
         <thead>
         <tr>
-          <th id="sortable">{ts}Relationship A to B{/ts}</th>
+          <th id="sortable">{t\function browses}Relationship A to B{/ts}</th>
           <th>{ts}Relationship B to A{/ts}</th>
           <th>{ts}Contact Type A{/ts}</th>
           <th>{ts}Contact Type B{/ts}</th>
@@ -59,9 +60,9 @@
         </tr>
         </thead>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="{cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if} crm-relationship">
-            <td class="crm-relationship-label_a_b">{$row.label_a_b}</td>
-            <td class="crm-relationship-label_b_a">{$row.label_b_a}</td>
+        <tr id="relationship_type-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if} crm-relationship">
+            <td class="crm-relationship-label_a_b crm-editable" data-field="label_a_b">{$row.label_a_b}</td>
+            <td class="crm-relationship-label_b_a crm-editable" data-field="label_b_a">{$row.label_b_a}</td>
             <td class="crm-relationship-contact_type_a_display">
                 {if $row.contact_type_a_display} {$row.contact_type_a_display}
                 {if $row.contact_sub_type_a} - {$row.contact_sub_type_a} {/if}{else} {ts}All Contacts{/ts} {/if} </td>
index 77439fb3ee9a89ef2e1cd9f20efbe67b837db222..c43c32729a286dd050932179dbd4ac468f63c9f7 100755 (executable)
@@ -27,7 +27,8 @@
 {* this template is for configuring Scheduled Reminders Table*}
 
         {strip}
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
         {include file="CRM/common/jsortable.tpl"}
         <table id="scheduleReminders" class="display">
         <thead>
@@ -43,8 +44,8 @@
         </tr>
         </thead>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="crm-scheduleReminders {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
-            <td class="crm-scheduleReminders-title">{$row.title}</td>
+        <tr id="scheduleReminders-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+            <td class="crm-scheduleReminders-title crm-editable" data-field="title">{$row.title}</td>
             <td class="crm-scheduleReminders-value">{$row.entity} - {$row.value}</td>
             <td class="crm-scheduleReminders-description">{if $row.absolute_date}{$row.absolute_date|crmDate}{else}{$row.start_action_offset}&nbsp;{$row.start_action_unit}{if $row.start_action_offset > 1}{ts}(s){/ts}{/if}&nbsp;{$row.start_action_condition}&nbsp;{$row.entityDate}{/if}</td>
             <td class="crm-scheduleReminders-title">{$row.status}</td>
index 6701144f42d6dc737c129d9cb4406229966576b3..93e0af073b6deb97f49d480a76d8c0c7af31f6a4 100644 (file)
@@ -35,7 +35,8 @@
     <div id="badge-layout">
       {strip}
       {* handle enable/disable actions*}
-        {include file="CRM/common/enableDisable.tpl"}
+        {include file="CRM/common/enableDisableApi.tpl"}
+        {include file="CRM/common/crmeditable.tpl"}
         {include file="CRM/common/jsortable.tpl"}
         <table id="options" class="display">
           <thead>
@@ -50,7 +51,7 @@
           {foreach from=$rows item=row}
             <tr id="row_{$row.id}"
                 class="{cycle values="odd-row,even-row"} {$row.class} crm-badge-layout {if NOT $row.is_active} disabled{/if}">
-              <td class="crm-badge-layout-title">{$row.title}</td>
+              <td class="crm-badge-layout-title crm-editable" data-field="title">{$row.title}</td>
               <td class="crm-badge-layout-description">{$row.description}</td>
               <td id="row_{$row.id}_status" class="crm-badge-layout-is_active">
                 {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}
index e39864aa26fb42ed0b1807da25889cc8c3cec691..2e7ab3157d1620f66df6694cbd580bc8602ce52d 100755 (executable)
@@ -38,7 +38,8 @@
 
 {* load campaign selector *}
 
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
 
   {literal}
     <script type="text/javascript">
index e741940899297c5addcb9593561f1148e2494312..19acfbfee7fdbdb9adadad249f7b97036a338eff 100755 (executable)
@@ -41,7 +41,8 @@
 
        {* load petition selector *}
 
-       {include file="CRM/common/enableDisable.tpl"}
+       {include file="CRM/common/enableDisableApi.tpl"}
+       {include file="CRM/common/crmeditable.tpl"}
 
        {literal}
        <script type="text/javascript">
index 319626b59387ee3c01e8675ef9f8fb86631a8d2a..98c85467652909e5b446306fe245c7c4d1a8fc90 100755 (executable)
@@ -40,7 +40,8 @@
   <div id="survey-result-set-dialog" class="hiddenElement"></div>
 
   {* load survey selector *}
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
 
   {literal}
   <script type="text/javascript">
index 4959cdf94731ef310a7eb98d7c5a8510485574cd..a8d14b25d49226856d94d2252d1e5b5818b991bc 100644 (file)
@@ -28,7 +28,8 @@
   <div class="action-link">
       <a href="{$addCampaignUrl}" class="button"><span>&raquo; {ts}Add Campaign{/ts}</span></a>
   </div>
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
   <div id="campaignType">
     <table id="options" class="display">
       <thead>
@@ -44,8 +45,8 @@
   </tr>
       </thead>
       {foreach from=$campaigns item=campaign}
-        <tr id="row_{$campaign.campaign_id}" {if $campaign.is_active neq 1}class="disabled"{/if}>
-          <td>{$campaign.title}</td>
+        <tr id="campaign-{$campaign.campaign_id}" class="crm-entity {if $campaign.is_active neq 1} disabled{/if}">
+          <td class="crm-editable" data-field="title">{$campaign.title}</td>
           <td>{$campaign.description}</td>
           <td>{$campaign.start_date}</td>
           <td>{$campaign.end_date}</td>
index 6762047f25d6cb3ed56df1526d0420c0d4c0c455..62f6fa1c5e1faf9bba40022a9a866c085d128ff3 100644 (file)
@@ -29,7 +29,8 @@
   <div class="action-link">
     <a href="{$addSurveyUrl}" class="button"><span>&raquo; {ts}Add Survey{/ts}</span></a>
   </div>
- {include file="CRM/common/enableDisable.tpl"}
+ {include file="CRM/common/enableDisableApi.tpl"}
+ {include file="CRM/common/crmeditable.tpl"}
  {include file="CRM/common/jsortable.tpl"}
   <div id="surveyList">
     <table id="options" class="display">
@@ -47,7 +48,7 @@
         </tr>
       </thead>
       {foreach from=$surveys item=survey}
-        <tr id="row_{$survey.id}" {if $survey.is_active neq 1}class="disabled"{/if}>
+        <tr id="survey-{$survey.id}" class="crm-entity {if $survey.is_active neq 1} disabled{/if}">
     <td>{$survey.title}</td>
           <td>{$survey.campaign_id}</td>
           <td>{$survey.activity_type_id}</td>
index 6762047f25d6cb3ed56df1526d0420c0d4c0c455..62f6fa1c5e1faf9bba40022a9a866c085d128ff3 100644 (file)
@@ -29,7 +29,8 @@
   <div class="action-link">
     <a href="{$addSurveyUrl}" class="button"><span>&raquo; {ts}Add Survey{/ts}</span></a>
   </div>
- {include file="CRM/common/enableDisable.tpl"}
+ {include file="CRM/common/enableDisableApi.tpl"}
+ {include file="CRM/common/crmeditable.tpl"}
  {include file="CRM/common/jsortable.tpl"}
   <div id="surveyList">
     <table id="options" class="display">
@@ -47,7 +48,7 @@
         </tr>
       </thead>
       {foreach from=$surveys item=survey}
-        <tr id="row_{$survey.id}" {if $survey.is_active neq 1}class="disabled"{/if}>
+        <tr id="survey-{$survey.id}" class="crm-entity {if $survey.is_active neq 1} disabled{/if}">
     <td>{$survey.title}</td>
           <td>{$survey.campaign_id}</td>
           <td>{$survey.activity_type_id}</td>
index 031d313b6a17ed33f231610f9283d59632b8922d..2724483a84d425087aa3704153fb767ff19663d6 100644 (file)
@@ -10,7 +10,8 @@
 <div id={$gName}>
         {strip}
   {* handle enable/disable actions*}
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
         {include file="CRM/common/jsortable.tpl"}
         <table class="display">
          <thead>
@@ -30,8 +31,8 @@
                  </tr>
         </thead>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="crm-admin-options crm-admin-options_{$row.id} {if NOT $row.is_active} disabled{/if}">
-          <td class="crm-admin-options-label">{$row.label}</td>
+        <tr id="option_value-{$row.id}" class="crm-entity crm-admin-options_{$row.id} {if NOT $row.is_active} disabled{/if}">
+          <td class="crm-admin-options-label crm-editable" data-field="label">{$row.label}</td>
           <td class="crm-admin-options-value">{$row.value}</td>
           <td class="crm-admin-options-description">{$row.description}</td>
           <td class="nowrap crm-admin-options-order">{$row.order}</td>
@@ -55,4 +56,4 @@
     </div>
 {/if}
 {/if}
-</div>
\ No newline at end of file
+</div>
index 51d261485089bb33d79c85cb4038d5893c650731..04704b1515e8b901e11b3488cdbc977771ce614f 100644 (file)
@@ -45,7 +45,8 @@
        {include file="CRM/common/pager.tpl" location="top"}
              {include file="CRM/common/pagerAToZ.tpl"}
              {* handle enable/disable actions *}
-             {include file="CRM/common/enableDisable.tpl"}
+             {include file="CRM/common/enableDisableApi.tpl"}
+             {include file="CRM/common/crmeditable.tpl"}
        {include file="CRM/common/jsortable.tpl"}
              <table id="options" class="display">
                <thead>
@@ -60,7 +61,7 @@
                </tr>
                </thead>
                {foreach from=$rows item=row}
-                 <tr id="row_{$row.id}" class="{if NOT $row.is_active} disabled{/if}">
+                 <tr id="contribution_page-{$row.id}" class="crm-entity {if NOT $row.is_active} disabled{/if}">
                      <td><strong>{$row.title}</strong></td>
                      <td>{$row.id}</td>
                      <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
index 9dbd7bcd4fe8787ce542758b8d87812be5ae8f19..298483656ff605d43350c8e9b02359d6e79bfe07 100644 (file)
@@ -24,7 +24,8 @@
  +--------------------------------------------------------------------+
 *}
 
-{include file="CRM/common/enableDisable.tpl"}
+{include file="CRM/common/enableDisableApi.tpl"}
+{include file="CRM/common/crmeditable.tpl"}
 
 {if $action eq 4} {* when action is view *}
     {if $recur}
@@ -68,7 +69,7 @@
 
         {foreach from=$recurRows item=row}
             {assign var=id value=$row.id}
-            <tr id="row_{$row.id}" class="{cycle values="even-row,odd-row"}{if NOT $row.is_active} disabled{/if}">
+            <tr id="contribution_recur-{$row.id}" class="crm-entity {cycle values="even-row,odd-row"}{if NOT $row.is_active} disabled{/if}">
                 <td>{$row.amount|crmMoney}{if $row.is_test} ({ts}test{/ts}){/if}</td>
                 <td>{ts}Every{/ts} {$row.frequency_interval} {$row.frequency_unit} </td>
                 <td>{$row.start_date|crmDate}</td>
index 111f8b94ec53c82d1ebe0586b857503429698aea..f767787cb090187f06e329fd564688a0e7e9a447 100644 (file)
@@ -36,7 +36,8 @@
     <div class="form-item">
         {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
         <table cellpadding="0" cellspacing="0" border="0">
            <thead class="sticky">
             <th>{ts}Name{/ts}</th>
@@ -48,7 +49,7 @@
             <th></th>
           </thead>
          {foreach from=$rows item=row}
-        <tr id="row_{$row.id}"class="{cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+        <tr id="contribution_type-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
           <td>{$row.name}</td>
           <td>{$row.description}</td>
               <td>{$row.accounting_code}</td>
index 3445047ede739620ac2bf7e942a54fa24ed2e8c3..87d1bce9fbd9517d782248c0fadc4f10640d97a6 100644 (file)
@@ -42,7 +42,8 @@
 <p></p>
     {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
   {include file="CRM/common/jsortable.tpl"}
         <table id="options" class="display">
           <thead>
index 39006bccbedafd43757bd34e5ddfb8016f282b6a..c56a04617148546229191bed2eb91dc66019b8dc 100644 (file)
@@ -40,7 +40,8 @@
     <div id="custom_group">
      {strip}
    {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
    {include file="CRM/common/jsortable.tpl"}
       <table id="options" class="display">
         <thead>
@@ -90,5 +91,4 @@
        {/if}
     {/if}
 {/if}
-{include file="CRM/common/crmeditable.tpl"}
 
index 0626703a3307207d616448022cfba67be83fe41d..800693ef5e56671deedebf0d86a0d8f4cc6b85b7 100644 (file)
@@ -39,7 +39,8 @@
       <div class="form-item">
         {strip}
         {* handle enable/disable actions*}
-         {include file="CRM/common/enableDisable.tpl"}
+         {include file="CRM/common/enableDisableApi.tpl"}
+         {include file="CRM/common/crmeditable.tpl"}
         <table class="selector">
           <tr class="columnheader">
             <th>{ts}Label{/ts}</th>
@@ -76,6 +77,3 @@
         </div>
     {/if}
 {/if}
-
-{include file="CRM/common/crmeditable.tpl"}
-
index 1718d81c1e91ab2ade429b680db93a8819757ff2..1327bc83ee32dd07cd805fd1c78a8e0e0e0d6c21 100644 (file)
@@ -60,7 +60,8 @@
   {include file="CRM/common/pager.tpl" location="top"}
   {include file="CRM/common/pagerAToZ.tpl"}
   {* handle enable/disable actions*}
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
   {include file="CRM/common/jsortable.tpl"}
     <table id="options" class="display">
       <thead>
@@ -83,7 +84,7 @@
       </thead>
       {foreach from=$rows key=keys item=row}
         {if $keys neq 'tab'}
-          <tr id="row_{$row.id}" class="{if NOT $row.is_active} disabled{/if}">
+          <tr id="event-{$row.id}" class="crm-entity {if NOT $row.is_active} disabled{/if}">
           <td class="crm-event_{$row.id}">
             <a href="{crmURL p='civicrm/event/info' q="id=`$row.id`&reset=1"}"
                title="{ts}View event info page{/ts}" class="bold">{$row.title}</a>&nbsp;&nbsp;({ts}ID:{/ts} {$row.id})
index 2e8f4210592e0125f1ec106fb166246bb81f1e9f..934095f8431822550425348227d46ab3c727784b 100644 (file)
@@ -45,7 +45,8 @@
       <div class="form-item">
       {strip}
       {* handle enable/disable actions*}
-       {include file="CRM/common/enableDisable.tpl"}
+       {include file="CRM/common/enableDisableApi.tpl"}
+       {include file="CRM/common/crmeditable.tpl"}
       <table id="crm-financial_accounts" class="display">
          <thead class="sticky">
           <th>{ts}Name{/ts}</th>
@@ -59,7 +60,7 @@
           <th></th>
         </thead>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}"class="{cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+        <tr id="financial_account-{$row.id} "class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
         <td>{$row.name}</td>
         <td>{$row.description}</td>
         <td>{$row.accounting_code}</td>
index ad03fd3c3bca7099112401b600e20a46238d9d4c..80bc323f30eb0c6d7f4ab89b14c134eed2aa282c 100644 (file)
@@ -39,7 +39,8 @@
     <div class="form-item">
         {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
         <table cellpadding="0" cellspacing="0" border="0">
            <thead class="sticky">
             <th>{ts}Name{/ts}</th>
index 676c3fff457c8f11b82f25f9f07957d2744b66fd..8171c733476d787ca95f659cfedd320fd75612df 100644 (file)
@@ -37,7 +37,8 @@
     {/if}
     {strip}
     {* handle enable/disable actions*}
-     {include file="CRM/common/enableDisable.tpl"}
+     {include file="CRM/common/enableDisableApi.tpl"}
+     {include file="CRM/common/crmeditable.tpl"}
       <table cellpadding="0" cellspacing="0" border="0">
         <thead class="sticky">
           <th>{ts}Relationship{/ts}</th>
index e3d2e46f8267401e31d18678060c970ac0ea6540..af6a6e6b532639ebd27e670e79fd5eb7f2deb025 100644 (file)
@@ -86,7 +86,8 @@
 </table>
 
 {* handle enable/disable actions*}
-{include file="CRM/common/enableDisable.tpl"}
+{include file="CRM/common/enableDisableApi.tpl"}
+{include file="CRM/common/crmeditable.tpl"}
 
 {literal}
 <script type="text/javascript">
index 8dc5f8e163d1d7d94b2afe2b866addd497af172b..980e84b4c3e73fb4b26b6110dd65edd3e5729d7d 100644 (file)
@@ -32,7 +32,8 @@
     <div class="form-item">
        {strip}
        {* handle enable/disable actions*}
-       {include file="CRM/common/enableDisable.tpl"}
+       {include file="CRM/common/enableDisableApi.tpl"}
+       {include file="CRM/common/crmeditable.tpl"}
        <table cellpadding="0" cellspacing="0" border="0">
         <thead class="sticky">
         <th>{ts}Name{/ts}</th>
index c9103b2d4d3a1bcf393878dd6b0a92bcc9624ed4..6fff18fe8db353461825aced6772240adb92d813 100644 (file)
@@ -39,7 +39,8 @@
     <div id="membership_status_id">
         {strip}
         {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
         <table cellpadding="0" cellspacing="0" border="0">
         <thead class="sticky">
             <th>{ts}Status{/ts}</th>
@@ -52,8 +53,8 @@
           <th></th>
         </thead>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="{cycle values="odd-row,even-row"} {$row.class} {if NOT $row.is_active} disabled{/if} crm-membership-status">
-          <td class="crm-membership-status-label">{$row.label}</td>
+        <tr id="membership_status-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class} {if NOT $row.is_active} disabled{/if} crm-membership-status">
+          <td class="crm-membership-status-label crm-editable" data-field="label">{$row.label}</td>
           <td class="crm-membership-status-start_event">{$row.start_event}</td>
           <td class="crm-membership-status-end_event">{$row.end_event}</td>
           <td class="crm-membership-status-is_current_member">{if $row.is_current_member eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
index 9d4d32a65cfed7606eb0d1ee2677cd9b81502c91..0c25a7e6fa8e5c158e4475a728e24244fa353c4a 100644 (file)
@@ -34,7 +34,8 @@
 <div id="membership_type">
   {strip}
   {* handle enable/disable actions*}
-  {include file="CRM/common/enableDisable.tpl"}
+  {include file="CRM/common/enableDisableApi.tpl"}
+  {include file="CRM/common/crmeditable.tpl"}
   {include file="CRM/common/jsortable.tpl"}
     <table id="options" class="display">
       <thead>
@@ -55,8 +56,8 @@
       </tr>
       </thead>
       {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="{cycle values='odd-row,even-row'} {$row.class} crm-membership-type {if NOT $row.is_active} disabled{/if}">
-          <td class="crm-membership-type-type_name">{$row.name}</td>
+        <tr id="membership_type-{$row.id}" class="crm-entity {cycle values='odd-row,even-row'} {$row.class} crm-membership-type {if NOT $row.is_active} disabled{/if}">
+          <td class="crm-membership-type-type_name crm-editable" data-field="name">{$row.name}</td>
           <td class="crm-memberhip-type-period_type">{$row.period_type}</td>
           <td class="crm-membership-type-fixed_period_start_day">{$row.fixed_period_start_day}</td>
           <td class="crm-membership-type-minimum_fee" align="right">{$row.minimum_fee|crmMoney}</td>
index e84f34e9e12792a10a68bab8b93b7c84f45cbab5..ab968e1ae1fa9520c5c4b4078092a2bf74a0a0ed 100644 (file)
@@ -55,7 +55,8 @@
     <div id="field_page">
     {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
     {include file="CRM/common/jsortable.tpl"}
          <table id="options" class="display">
          <thead>
@@ -73,8 +74,8 @@
         </tr>
         </thead>
         {foreach from=$priceField key=fid item=row}
-      <tr id="row_{$row.id}"class="{cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
-            <td>{$row.label}</td>
+      <tr id="price_field-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+            <td class="crm-editable" data-field="label">{$row.label}</td>
             <td>{$row.html_type}</td>
             <td class="nowrap">{$row.order}</td>
             <td>{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
index f9bb0fc5e835e9656cffed8e2de969f58fb639f0..e325e049dd90f588fcdfcc2c8d9b58f57026857d 100644 (file)
@@ -50,7 +50,8 @@
      <p></p>
         {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
    {include file="CRM/common/jsortable.tpl"}
         <table id="options" class="display">
         <thead>
@@ -66,8 +67,8 @@
          </tr>
         </thead>
         {foreach from=$customOption item=row}
-      <tr id="row_{$row.id}"class=" crm-price-option crm-price-option_{$row.id} {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
-            <td class="crm-price-option-label">{$row.label}</td>
+      <tr id="price_option-{$row.id}" class="crm-entity crm-price-option_{$row.id} {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+            <td class="crm-price-option-label crm-editable" data-field="label">{$row.label}</td>
             <td class="crm-price-option-value">{$row.amount|crmMoney}</td>
       <td class="crm-price-option-is_default">{if $row.is_default}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" />{/if}</td>
       <td class="nowrap crm-price-option-financial-type-id">{$row.financial_type_id}</td>
index 115df948190a52059a01e60ece976920c2df9728..96951bd459b0b4025ea2472d92ae72c50533ee02 100644 (file)
@@ -53,7 +53,8 @@
     <p></p>
         {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
   {include file="CRM/common/jsortable.tpl"}
         <table id="price_set" class="display crm-price-set-listing">
         <thead>
@@ -65,8 +66,8 @@
         </tr>
         </thead>
         {foreach from=$rows item=row}
-      <tr id="row_{$row.id}"class=" crm-price-set crm-price-set_{$row.id} {cycle values="even-row,odd-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
-            <td class="crm-price-set-title">{$row.title}</td>
+      <tr id="price_set-{$row.id}" class="crm-entity crm-price-set_{$row.id} {cycle values="even-row,odd-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+            <td class="crm-price-set-title crm-editable" data-field="title">{$row.title}</td>
           <td class="crm-price-set-extends">{$row.extends}</td>
           <td id="row_{$row.id}_status" class="crm-price-set-is_active">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td>{$row.action|replace:'xx':$row.id}</td>
index 16358cdf27e19db7ca886e5d33cc7753daabe992..573a2c79d1b97daf2c172855e883f773558af47e 100644 (file)
@@ -36,7 +36,8 @@
     <div id="optionList">
   {strip}
   {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
    {include file="CRM/common/jsortable.tpl"}
        <table id="options" class="display">
        <thead>
@@ -56,8 +57,8 @@
     </tr>
         </thead>
     {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="crm-report {cycle values="odd-row,even-row"}{$row.class}{if NOT $row.is_active} crm-report-optionList crm-report-optionList-status_disable disabled{else} crm-report-optionList crm-report-optionList-status_enable{/if}">
-             <td class="crm-report-optionList-label">{$row.label}</td>
+        <tr id="report-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"}{$row.class}{if NOT $row.is_active} crm-report-optionList crm-report-optionList-status_disable disabled{else} crm-report-optionList crm-report-optionList-status_enable{/if}">
+             <td class="crm-report-optionList-label crm-editable" data-field="label">{$row.label}</td>
             <td class="crm-report-optionList-value">{$row.value}</td>
             <td class="crm-report-optionList-description">{$row.description}</td>
             <td class="nowrap crm-report-optionList-order">{$row.order}</td>
index 1090a35920d70a85d613d2c590a7a4ac08ed5c93..55472c436e4d1d2fc161c67cc0c29ad14173addc 100644 (file)
@@ -42,7 +42,8 @@
 <div id="ltype">
     {strip}
         {* handle enable/disable actions*}
-       {include file="CRM/common/enableDisable.tpl"}
+       {include file="CRM/common/enableDisableApi.tpl"}
+       {include file="CRM/common/crmeditable.tpl"}
         <br/><table class="selector">
         <tr class="columnheader">
             <th >{ts}Provider Details{/ts}</th>
@@ -51,7 +52,7 @@
             <th >{ts}Action{/ts}</th>
         </tr>
         {foreach from=$rows item=row}
-        <tr id="row_{$row.id}" class="crm-provider {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
+        <tr id="provider-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
             <td class="crm-provider-name"><strong>{$row.name}</strong> ({$row.title})<br/>
                 {ts}API Type:{/ts} {$row.api_type}<br/>
                 {ts}API Url:{/ts} {$row.api_url}<br/>
index 6e596a94dce0fa66b09f62f4a830254b17df70bd..90c980448bd9107c3860be69ec330753c130dede 100644 (file)
@@ -44,7 +44,8 @@
         {/if}
         {strip}
         {* handle enable/disable actions*}
-   {include file="CRM/common/enableDisable.tpl"}
+   {include file="CRM/common/enableDisableApi.tpl"}
+   {include file="CRM/common/crmeditable.tpl"}
    {include file="CRM/common/jsortable.tpl"}
         <table id="options" class="display">
             <thead>
     {/if}
 </div>
 {/if}
-
-{include file="CRM/common/crmeditable.tpl"}
-
index faca606d792966242fadd1902e271066fd67042f..d1440f5457944990c65682ea468c803a78ef77f4 100644 (file)
@@ -64,7 +64,8 @@
         </ul>
 
         {* handle enable/disable actions*}
-        {include file="CRM/common/enableDisable.tpl"}
+        {include file="CRM/common/enableDisableApi.tpl"}
+        {include file="CRM/common/crmeditable.tpl"}
         {include file="CRM/common/jsortable.tpl"}
         <div id="user-profiles">
            <div class="crm-content-block">
@@ -83,7 +84,7 @@
             <tbody>
             {foreach from=$rows item=row}
             {if !$row.is_reserved }
-              <tr id="UFGroup-{$row.id}"class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
+              <tr id="UFGroup-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
                 <td><span class="crmf-title crm-editable">{$row.title}</span></td>
                 <td>
                   {if $row.created_id && $row.created_by}
             <tbody>
             {foreach from=$rows item=row}
             {if $row.is_reserved}
-              <tr id="row_{$row.id}"class="{$row.class}{if NOT $row.is_active} disabled{/if}">
+              <tr id="UFGroup-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
                 <td>{$row.title}</td>
                 <td>
                   {if $row.created_id && $row.created_by}
     {/if}
     {/if}
 {/if}
-{include file="CRM/common/crmeditable.tpl"}
index 36ef55d950e005970974ebb2aa5cc3202b22a9e5..649bf8fd9a2343afe6f145ade02ae2e140f28f0a 100644 (file)
@@ -27,7 +27,7 @@
 {literal}
 <script type="text/javascript">
   cj(function($) {
-    var $row, $table, entity, id, enabled;
+    var $row, $table, entity, id, enabled, fieldLabel;
 
     function refresh() {
       if (false && $.fn.DataTable.fnIsDataTable($table[0])) { // fixme why doesn't this work?
         // Refresh an existing ajax container or create a new one
         $row.closest('.crm-ajax-container, #crm-main-content-wrapper').crmSnippet().crmSnippet('refresh');
       }
-      CRM.alert('', enabled ? {/literal}'{ts escape="js"}Record Disabled{/ts}' : '{ts escape="js"}Record Enabled{/ts}'{literal}, 'success');
+      var msg = enabled ? {/literal}'{ts escape="js" 1="<em>%1</em>"}%1 Disabled{/ts}' : '{ts escape="js" 1="<em>%1</em>"}%1 Enabled{/ts}'{literal};
+      CRM.alert('', ts(msg, fieldLabel), 'success');
     }
 
     function save() {
       $table = $row.closest('table');
       $table.block();
-      CRM.api(entity, 'create', {id: id, is_active: enabled ? 0 : 1}, {success: refresh});
+      CRM.api(entity, 'setvalue', {id: id, field: 'is_active', value: enabled ? 0 : 1}, {success: refresh});
+      if (enabled) {
+        $(this).dialog('close');
+      }
     }
 
     function confirmation() {
-      var dialog = $(this);
+      var conf = $(this);
       $.getJSON(CRM.url('civicrm/ajax/statusmsg', {entity: entity, id: id}), function(response) {
-        dialog.html(response.content);
+        conf.html(response.content);
+        if (!response.illegal) {
+          conf.dialog('option', 'buttons', [
+            {text: {/literal}'{ts escape="js"}Disable{/ts}'{literal}, click: save},
+            {text: {/literal}'{ts escape="js"}Cancel{/ts}'{literal}, click: function() {$(this).dialog('close');}}
+          ]);
+        }
       });
     }
 
+    function getLabel() {
+      var label = {/literal}'{ts escape="js"}Record{/ts}'{literal};
+      var labelField = $('.crmf-label, .crmf-title, [data-field=label], [data-field=title]', $row);
+      if (labelField.length) {
+        label = labelField.first().text();
+      }
+      // Format as object the way ts() wants it
+      fieldLabel = {1: label};
+    }
+
     function enableDisable() {
       var $a = $(this);
       $row = $a.closest('.crm-entity');
+      getLabel();
       // FIXME: abstract and reuse code from $.crmEditable for fetching entity/id instead of reinventing it here
       entity = $row.data('entity');
       id = $row.data('id');
@@ -64,8 +85,9 @@
       }
       enabled = !$row.hasClass('disabled');
       if (enabled) {
-        CRM.confirm(save, {{/literal}
-          title: '{ts escape="js"}Disable Record{/ts}',
+        CRM.confirm({}, {{/literal}
+          {* client-side variable substitutions in smarty are AWKWARD! *}
+          title: ts('{ts escape="js" 1='%1'}Disable %1{/ts}', fieldLabel),
           message: '<div class="crm-loading-element">{ts escape="js"}Loading{/ts}...</div>',
           width: 300,
           open: confirmation