CRM-13863 - Consolidate livePage.js handling in parent page class
authorColeman Watts <coleman@civicrm.org>
Fri, 14 Mar 2014 14:38:07 +0000 (10:38 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 14 Mar 2014 15:00:14 +0000 (11:00 -0400)
33 files changed:
CRM/ACL/Page/ACL.php
CRM/ACL/Page/EntityRole.php
CRM/Admin/Page/ContactType.php
CRM/Admin/Page/LabelFormats.php
CRM/Admin/Page/LocationType.php
CRM/Admin/Page/MailSettings.php
CRM/Admin/Page/MessageTemplates.php
CRM/Admin/Page/Options.php
CRM/Admin/Page/ParticipantStatus.php
CRM/Admin/Page/PdfFormats.php
CRM/Admin/Page/RelationshipType.php
CRM/Admin/Page/ScheduleReminders.php
CRM/Admin/Page/Tag.php
CRM/Campaign/Page/Campaign.php
CRM/Campaign/Page/Survey.php
CRM/Campaign/Page/SurveyType.php
CRM/Contribute/Page/ManagePremiums.php
CRM/Contribute/Page/Tab.php
CRM/Core/Page.php
CRM/Custom/Page/Field.php
CRM/Custom/Page/Option.php
CRM/Event/Form/Participant.php
CRM/Event/Form/ParticipantFeeSelection.php
CRM/Event/Form/ParticipantView.php
CRM/Financial/Page/FinancialAccount.php
CRM/Financial/Page/FinancialType.php
CRM/Member/Page/MembershipStatus.php
CRM/Member/Page/MembershipType.php
CRM/Price/Page/Field.php
CRM/Price/Page/Option.php
CRM/Report/Page/Options.php
CRM/SMS/Page/Provider.php
CRM/UF/Page/Field.php

index e4ff23d7be518ac570788ef331c86294bfdaad4d..7517d2460df57a88f8e71ccd0dde2b137c12f9ec 100644 (file)
@@ -42,6 +42,8 @@
  */
 class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -156,12 +158,6 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-        CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-      }
-    }
-
     // get all acl's sorted by weight
     $acl = array();
     $query = "
index 4acc15923a324e59a005773ae6dfd250c8643a41..0b8cde61e42c4e62ba98115959d81a68adc2cbec 100644 (file)
@@ -42,6 +42,8 @@
  */
 class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -139,9 +141,6 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic {
 
     // finally browse the acl's
     if ($action & CRM_Core_Action::BROWSE) {
-      if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-        CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-      }
     }
 
     // parent run
@@ -156,9 +155,6 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
 
     // get all acl's sorted by weight
     $entityRoles = array();
index 622a527471a8027c7023dbd8500d5069f7274ee1..d07e35373b47cc277519ae92c16078633475211d 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -105,9 +107,6 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
   }
 
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 3fc46604a5b385ec4c86d3182d1df62d339af37b..04f7fb65eba661e64fcf753432614242bfb2ab21 100644 (file)
@@ -39,6 +39,8 @@
  */
 class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -124,9 +126,6 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic {
    * @static
    */
   function browse($action = NULL) {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     // Get list of configured Label Formats
     $labelFormatList= CRM_Core_BAO_LabelFormat::getList();
     $nameFormatList= CRM_Core_BAO_LabelFormat::getList(false, 'name_badge');
index 61739f2f1c047ef05743fc2b7ac0bc7f6e67e080..ea2947a0f6c7cd02d4e34cddf94bc68ccc05be39 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -61,9 +63,6 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic {
    * @return array (reference) of action links
    */
   function &links() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     if (!(self::$_links)) {
       self::$_links = array(
         CRM_Core_Action::UPDATE => array(
index 37dcf2b549535d1027a43435e0d139ae44a38453..43b4533211dff6db5ffd1965893e27cab0733771 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+  
   /**
    * The action links that we need to display for the browse screen
    *
index 36f2fa671a0efad33c611d150279bf1371974151..ef326cb11bef641098f2adafaea524585f909885 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -223,9 +225,6 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
    * @access public
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 86995267728f90962fdff1d0f608709cb6ea5ae7..0096055c986032fbae5629a225bbc31e6136fe89 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -228,9 +230,6 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
     if (!self::$_gName) {
       return parent::browse();
     }
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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');
     $gName       = self::$_gName;
index 6eeefd2b05517589ce6d94517d5b946add9aeae6..1d1e833ad18df1ef7e6d85dde334f2d8652f14cd 100644 (file)
@@ -33,6 +33,8 @@
  *
  */
 class CRM_Admin_Page_ParticipantStatus extends CRM_Core_Page_Basic {
+
+  public $useLivePageJS = TRUE;
   function getBAOName() {
     return 'CRM_Event_BAO_ParticipantStatusType';
   }
@@ -69,9 +71,6 @@ class CRM_Admin_Page_ParticipantStatus extends CRM_Core_Page_Basic {
   }
 
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $statusTypes = array();
 
     $dao = new CRM_Event_DAO_ParticipantStatusType;
index d8b0cea4e852c4e19e355ae0c82354f962d12981..9689b06e135ed77f685cb03b55d639a917f5f871 100644 (file)
@@ -39,6 +39,8 @@
  */
 class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -118,9 +120,6 @@ class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic {
    * @static
    */
   function browse($action = NULL) {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     // Get list of configured PDF Page Formats
     $pdfFormatList = CRM_Core_BAO_PdfFormat::getList();
 
index fb9a5d9aa8893e9f0c9d55dd7c43eebecb494d36..cc255a25a6128f2ff9c4827703db3fff7f3027f5 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -61,9 +63,6 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic {
    * @return array (reference) of action links
    */
   function &links() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     if (!(self::$_links)) {
       self::$_links = array(
         CRM_Core_Action::VIEW => array(
index 1e88f71f8b941339199e18d5c360e6817a422888..30867d664b927df4913fd23f1aee1f1068a6c6fc 100644 (file)
@@ -39,6 +39,8 @@
  */
 class CRM_Admin_Page_ScheduleReminders extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -128,9 +130,6 @@ class CRM_Admin_Page_ScheduleReminders extends CRM_Core_Page_Basic {
    * @static
    */
   function browse($action = NULL) {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     // Get list of configured reminders
     $reminderList = CRM_Core_BAO_ActionSchedule::getList();
 
index f3bc45e733078993a4ffc489b9728c3aa1ab611a..483f2f7e3e58809cfbca072e1fb3448813f611c2 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -134,9 +136,6 @@ class CRM_Admin_Page_Tag extends CRM_Core_Page_Basic {
    * override function browse()
    */
   function browse($action = NULL, $sort = NULL) {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $adminTagSet = FALSE;
     if (CRM_Core_Permission::check('administer Tagsets')) {
       $adminTagSet = TRUE;
index 693faea46bd30e5bea2f487a3df68839bf84ea73..1a57c4d3ca1a909c10201f50038bbf953cb176dc 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Campaign_Page_Campaign extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -84,9 +86,6 @@ class CRM_Campaign_Page_Campaign extends CRM_Core_Page {
   }
 
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
 
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaignSummary();
 
index 9dea4ea65f4b48c86401670764b97aca792c92d9..6974cd6a53d00832b2e247d52939ca7757a724dd 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Campaign_Page_Survey extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   private static $_actionLinks;
 
   function &actionLinks() {
@@ -73,9 +75,6 @@ class CRM_Campaign_Page_Survey extends CRM_Core_Page {
   }
 
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
 
     $surveys = CRM_Campaign_BAO_Survey::getSurveySummary();
 
index 2c4cda344b3f7e83e0af5b7f84adda8062b29d0a..2fe8db425dfefd56a7ffda062bd148cd7f059cad 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -155,9 +157,6 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $this->assign('includeWysiwygEditor', TRUE);
 
     $campaingCompId = CRM_Core_Component::getComponentID('CiviCampaign');
index b6bdffd2b7a23b9fa114ca92877bddb389066928..6f68dfca344af9fe58f53e869f74023ce5def72f 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -141,9 +143,6 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 19b5e572bfa174180777a81bf6a4f2ed9d5177a3..1fe52f33d7e2140c1328d1449b256d460a5e1a7a 100644 (file)
@@ -109,10 +109,6 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
    * @access public
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
-
     // add annual contribution
     $annual = array();
     list($annual['count'],
index c16e33a84fc44b66faf2d6881a7d4ea63af2db7e..4973d594fdad173614998af8bac90381f81683b8 100644 (file)
@@ -118,6 +118,12 @@ class CRM_Core_Page {
    */
   public $urlPath = array();
 
+  /**
+   * Should crm.livePage.js be added to the page?
+   * @var bool
+   */
+  public $useLivePageJS;
+
   /**
    * class constructor
    *
@@ -215,17 +221,20 @@ class CRM_Core_Page {
 
     $config = CRM_Core_Config::singleton();
 
-    // TODO: Is there a better way to ensure these actions don't happen during AJAX requests?
-    if (empty($_GET['snippet'])) {
-      // Version check and intermittent alert to admins
-      CRM_Utils_VersionCheck::singleton()->versionAlert();
-      CRM_Utils_Check_Security::singleton()->showPeriodicAlerts();
+    // Version check and intermittent alert to admins
+    CRM_Utils_VersionCheck::singleton()->versionAlert();
+    CRM_Utils_Check_Security::singleton()->showPeriodicAlerts();
 
-      // Debug msg once per hour
-      if ($config->debug && CRM_Core_Permission::check('administer CiviCRM') && CRM_Core_Session::singleton()->timer('debug_alert', 3600)) {
-        $msg = ts('Warning: Debug is enabled in <a href="%1">system settings</a>. This should not be enabled on production servers.', array(1 => CRM_Utils_System::url('civicrm/admin/setting/debug', 'reset=1')));
-        CRM_Core_Session::setStatus($msg, ts('Debug Mode'));
-      }
+    // Debug msg once per hour
+    if ($config->debug && CRM_Core_Permission::check('administer CiviCRM') && CRM_Core_Session::singleton()->timer('debug_alert', 3600)) {
+      $msg = ts('Warning: Debug is enabled in <a href="%1">system settings</a>. This should not be enabled on production servers.', array(1 => CRM_Utils_System::url('civicrm/admin/setting/debug', 'reset=1')));
+      CRM_Core_Session::setStatus($msg, ts('Debug Mode'));
+    }
+
+    if ($this->useLivePageJS &&
+      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE))
+    {
+      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
     }
 
     $content = self::$_template->fetch('CRM/common/' . strtolower($config->userFramework) . '.tpl');
index d91fe415bbcbd6f44a24e33bd7128329501e79a9..7c3730425f7ffba23647b50a1f4bfd50d06d4aa7 100644 (file)
@@ -43,6 +43,8 @@
  */
 class CRM_Custom_Page_Field extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The group id of the field
    *
@@ -124,9 +126,6 @@ class CRM_Custom_Page_Field extends CRM_Core_Page {
    * @access public
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $customField = array();
     $customFieldBAO = new CRM_Core_BAO_CustomField();
 
index e3664f4466dfed8f44a9d716af64af37ad962011..c08794b35e6408ad897579503b7139dca3a89dea 100644 (file)
@@ -43,6 +43,8 @@
  */
 class CRM_Custom_Page_Option extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The Group id of the option
    *
@@ -120,9 +122,6 @@ class CRM_Custom_Page_Option extends CRM_Core_Page {
    * @access public
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 d2d94eabda3e410ae18c18fc41f7279d9a77b7b0..6fc9e598bfb5e23e03192dc57f70021308137881 100644 (file)
@@ -40,6 +40,8 @@
  */
 class CRM_Event_Form_Participant extends CRM_Contact_Form_Task {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * the values for the contribution db object
    *
@@ -671,9 +673,6 @@ SELECT civicrm_custom_group.name as name,
    * @access public
    */
   public function buildQuickForm() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $participantStatuses = CRM_Event_PseudoConstant::participantStatus();
     $partiallyPaidStatusId = array_search('Partially paid', $participantStatuses);
     $this->assign('partiallyPaidStatusId', $partiallyPaidStatusId);
index f5eddbd10708a4ead3f0b65f29cd232acdabe23a..f2cd3ad319dd542d5e3d7db38c25df702cb76a3b 100644 (file)
@@ -40,6 +40,8 @@
  */
 class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
 
+  public $useLivePageJS = TRUE;
+
   protected $_contactId = NULL;
 
   protected $_contributorDisplayName = NULL;
@@ -125,9 +127,6 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
   }
 
   public function buildQuickForm() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
 
     $statuses = CRM_Event_PseudoConstant::participantStatus();
     $this->assign('partiallyPaid',  array_search('Partially paid', $statuses));
index 3f4e1e125a056a3a0df46bfe574cef8728780791..408780ca9e67b1fa59bf563a19a75c15ef7faaa3 100644 (file)
@@ -39,6 +39,8 @@
  */
 class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * Function to set variables up before form is built
    *
@@ -208,9 +210,6 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
    * @access public
    */
   public function buildQuickForm() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $this->addButtons(array(
         array(
           'type' => 'cancel',
index 572bee71a88ff28153d3b4acc9f30d6d197f8e52..e4c8b62d7d9c9ecf34d54a53b0f5e9c91f41d2a9 100644 (file)
@@ -37,6 +37,8 @@
  * Page for displaying list of financial types
  */
 class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic {
+
+  public $useLivePageJS = TRUE;
   /**
    * The action links that we need to display for the browse screen
    *
@@ -126,9 +128,6 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 af77fdfcd139205a983b7489cfd83e01162a1656..55d93e7d6687694791d1d742ba4d8cf12e569ad5 100644 (file)
@@ -37,6 +37,8 @@
  * Page for displaying list of financial types
  */
 class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic {
+
+  public $useLivePageJS = TRUE;
   /**
    * The action links that we need to display for the browse screen
    *
@@ -132,9 +134,6 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 6f519d0b2de4a6c706b61e1ff648e13f126943d3..9e19cfe3fdd9cd40b1b150fea6d95ed179f46e03 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -134,9 +136,6 @@ class CRM_Member_Page_MembershipStatus extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 559308baed1a860a425ad96510a94902d12c1799..f8bda91dae2607b4e9097f55996510a5afe0019f 100644 (file)
@@ -46,6 +46,8 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page {
    */
   static $_links = NULL;
 
+  public $useLivePageJS = TRUE;
+
   /**
    * Get action Links
    *
@@ -108,9 +110,6 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 e5cd3b43ca8d742bedb1dc27a4965c0a729e5754..996554022591eebc86a2350710e5a53c1d86f014 100644 (file)
@@ -43,6 +43,8 @@
  */
 class CRM_Price_Page_Field extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The price set group id of the field
    *
@@ -122,9 +124,6 @@ class CRM_Price_Page_Field extends CRM_Core_Page {
    * @access public
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $priceField    = array();
     $priceFieldBAO = new CRM_Price_BAO_PriceField();
 
index a837c74d78a3865b60ab3955cae946db62b103a3..59b1379bc58fa5790aecea9e42b296fec88f1af0 100644 (file)
@@ -43,6 +43,8 @@
  */
 class CRM_Price_Page_Option extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The field id of the option
    *
@@ -127,9 +129,6 @@ class CRM_Price_Page_Option extends CRM_Core_Page {
    * @access public
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 a7d54373f03f7990637aa5bdde4417cf73172c01..04d32e86cd2677f0c7ff546b500ae3a071ad2f56 100644 (file)
@@ -39,6 +39,8 @@
  */
 class CRM_Report_Page_Options extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -165,9 +167,6 @@ class CRM_Report_Page_Options extends CRM_Core_Page_Basic {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      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 cc925a0a640d37e461e6727d704e72adc66038a4..9098abad03f423d8d9c03023e9e22ba2962265cb 100644 (file)
@@ -38,6 +38,8 @@
  */
 class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The action links that we need to display for the browse screen
    *
@@ -129,9 +131,6 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic {
    * @static
    */
   function browse($action = NULL) {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $providers = CRM_SMS_BAO_Provider::getProviders();
     $rows = array();
     foreach ($providers as $provider) {
index 723e1f343bcf76e6673d3d51ba56bab40b9e8558..50263c39a48206cd492d42367325073fcf35d45a 100644 (file)
@@ -43,6 +43,8 @@
  */
 class CRM_UF_Page_Field extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * The group id of the field
    *
@@ -108,9 +110,6 @@ class CRM_UF_Page_Field extends CRM_Core_Page {
    * @static
    */
   function browse() {
-    if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'ajax_popups_enabled', NULL, TRUE)) {
-      CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
-    }
     $ufField = array();
     $ufFieldBAO = new CRM_Core_BAO_UFField();