Add versionAlert setting CRM-12701
authorColeman Watts <coleman@civicrm.org>
Tue, 28 May 2013 03:06:47 +0000 (20:06 -0700)
committerColeman Watts <coleman@civicrm.org>
Tue, 28 May 2013 03:06:47 +0000 (20:06 -0700)
CRM/Admin/Form/Setting/Miscellaneous.php
CRM/Utils/VersionCheck.php
settings/Core.setting.php
templates/CRM/Admin/Form/Setting/Miscellaneous.tpl

index e15c20636e7aaa7d87f8809a5b3ee9e7f29d5130..c5448037cadd6e4bb3b52b6e17677e5ff7e06f20 100644 (file)
@@ -42,6 +42,7 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting {
   protected $_settings = array(
     'max_attachments' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
     'contact_undelete' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
+    'versionAlert' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
     'versionCheck' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
     'maxFileSize' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
     'doNotAttachPDFReceipt' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
@@ -56,7 +57,6 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting {
   public function buildQuickForm() {
     CRM_Utils_System::setTitle(ts('Settings - Undelete, Logging and ReCAPTCHA'));
 
-
     // also check if we can enable triggers
     $validTriggerPermission = CRM_Core_DAO::checkTriggerViewPermission(FALSE);
 
index 0f6404d756c08954f3318cd065f784ae3168b5f1..f94487cdda995608360b96557ae5dca7b211f2e1 100644 (file)
@@ -177,7 +177,8 @@ class CRM_Utils_VersionCheck {
    * Show the message once a day
    */
   public function versionAlert() {
-    if (CRM_Core_Permission::check('administer CiviCRM') && $this->newerVersion()) {
+    if (CRM_Core_Permission::check('administer CiviCRM') && $this->newerVersion()
+    && CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'versionAlert', NULL, TRUE)) {
       $session = CRM_Core_Session::singleton();
       if ($session->timer('version_alert', 24 * 60 * 60)) {
         $msg = ts('A newer version of CiviCRM is available: %1', array(1 => $this->latestVersion))
index 8e7a982e7e2fff91c9c1089ceecbd9680a45cebe..d8f06a2765369b775c2d791d8611eb5e71fdb756 100644 (file)
@@ -323,6 +323,22 @@ return array (
     'description' => 'If enabled, deleted contacts will be moved to trash (instead of being destroyed). Users with the proper permission are able to search for the deleted contacts and restore them (or delete permanently).',
     'help_text' => null,
   ),
+  'versionAlert' => array(
+    'group_name' => 'CiviCRM Preferences',
+    'group' => 'core',
+    'name' => 'versionAlert',
+    'prefetch' => 1,
+    'config_only'=> 1,
+    'type' => 'Boolean',
+    'quick_form_type' => 'YesNo',
+    'default' => 1,
+    'add' => '4.3',
+    'title' => 'New Version Alerts',
+    'is_domain' => 1,
+    'is_contact' => 0,
+    'description' => 'Displays an on-screen alert to users with "Administer CiviCRM" permissions when a new version of CiviCRM is available. This setting will only work if the "Version Check & Statistics Reporting" setting is enabled.',
+    'help_text' => null,
+  ),
   'versionCheck' => array(
     'group_name' => 'CiviCRM Preferences',
     'group' => 'core',
@@ -546,4 +562,4 @@ When enabled, statistics about your CiviCRM installation are reported anonymousl
     'description' => 'If disabled, backend HTTPS services will allow unverified, insecure connections',
     'help_text' => 'Unless you are absolutely unable to configure your server to check the SSL certificate of the remote server you should leave this set to Yes',
   ),
-);
\ No newline at end of file
+);
index 086deaca68eb872d96b6188dce7cf34327d995a0..8e397e3ec3600361ffce4feb976bdebd124b09dc 100644 (file)
                 <p class="description">{ts 1="http://code.google.com/p/wkhtmltopdf/"}<a href="%1">wkhtmltopdf is an alternative utility for generating PDF's</a> which may provide better performance especially if you are generating a large number of PDF letters or receipts. Your system administrator will need to download and install this utility, and enter the executable path here.{/ts}</p>
             </td>
         </tr>
+        <tr class="crm-miscellaneous-form-block-versionAlert">
+            <td class="label">{$form.versionAlert.label}</td>
+            <td>{$form.versionAlert.html}<br />
+                <p class="description">{ts}Displays an on-screen alert to users with "Administer CiviCRM" permissions when a new version of CiviCRM is available. This setting will only work if the "Version Check &amp; Statistics Reporting" setting is enabled.{/ts}</p></td>
+        </tr>
         <tr class="crm-miscellaneous-form-block-versionCheck">
             <td class="label">{$form.versionCheck.label}</td>
             <td>{$form.versionCheck.html}<br />
-                <p class="description">{ts}If enabled, CiviCRM automatically checks availablity of a newer version of the software. New version alerts will be displayed on the main CiviCRM Administration page.{/ts}</p>
                 <p class="description">{ts}When enabled, statistics about your CiviCRM installation are reported anonymously to the CiviCRM team to assist in prioritizing ongoing development efforts. The following information is gathered: CiviCRM version, versions of PHP, MySQL and framework (Drupal/Joomla/standalone), and default language. Counts (but no actual data) of the following record types are reported: contacts, activities, cases, relationships, contributions, contribution pages, contribution products, contribution widgets, discounts, price sets, profiles, events, participants, tell-a-friend pages, grants, mailings, memberships, membership blocks, pledges, pledge blocks and active payment processor types.{/ts}</p></td>
         </tr>
         <tr class="crm-miscellaneous-form-block-max_attachments">