From 6015844210a7307b2043eef0102f03f7923a0065 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 23 Dec 2013 10:32:05 -0800 Subject: [PATCH] CRM-13863 - Ajax fixes --- CRM/Admin/Page/LabelFormats.php | 1 + CRM/Admin/Page/LocationType.php | 1 + CRM/Admin/Page/PdfFormats.php | 1 + CRM/SMS/Page/Provider.php | 1 + js/crm.livePage.js | 2 +- js/jquery/jquery.crmeditable.js | 2 +- templates/CRM/Admin/Form/LabelFormats.tpl | 8 +++----- templates/CRM/Admin/Form/PdfFormats.tpl | 8 ++++---- templates/CRM/Admin/Page/Job.tpl | 2 +- templates/CRM/Admin/Page/LocationType.tpl | 7 +++---- templates/CRM/Admin/Page/Reminders.tpl | 2 +- templates/CRM/Price/Form/Field.tpl | 23 +++++++++++------------ templates/CRM/Price/Page/Option.tpl | 2 +- 13 files changed, 30 insertions(+), 30 deletions(-) diff --git a/CRM/Admin/Page/LabelFormats.php b/CRM/Admin/Page/LabelFormats.php index 8c25975a46..b3050f8208 100644 --- a/CRM/Admin/Page/LabelFormats.php +++ b/CRM/Admin/Page/LabelFormats.php @@ -124,6 +124,7 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic { * @static */ function browse($action = NULL) { + 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'); diff --git a/CRM/Admin/Page/LocationType.php b/CRM/Admin/Page/LocationType.php index f1052979c7..cad2e1cadf 100644 --- a/CRM/Admin/Page/LocationType.php +++ b/CRM/Admin/Page/LocationType.php @@ -61,6 +61,7 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic { * @return array (reference) of action links */ function &links() { + CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js'); if (!(self::$_links)) { self::$_links = array( CRM_Core_Action::UPDATE => array( diff --git a/CRM/Admin/Page/PdfFormats.php b/CRM/Admin/Page/PdfFormats.php index 88f4f4549b..d93602e415 100644 --- a/CRM/Admin/Page/PdfFormats.php +++ b/CRM/Admin/Page/PdfFormats.php @@ -118,6 +118,7 @@ class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic { * @static */ function browse($action = NULL) { + CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js'); // Get list of configured PDF Page Formats $pdfFormatList = CRM_Core_BAO_PdfFormat::getList(); diff --git a/CRM/SMS/Page/Provider.php b/CRM/SMS/Page/Provider.php index 1f06458f9b..9811cfa001 100644 --- a/CRM/SMS/Page/Provider.php +++ b/CRM/SMS/Page/Provider.php @@ -129,6 +129,7 @@ class CRM_SMS_Page_Provider extends CRM_Core_Page_Basic { * @static */ function browse($action = NULL) { + CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js'); $providers = CRM_SMS_BAO_Provider::getProviders(); $rows = array(); foreach ($providers as $provider) { diff --git a/js/crm.livePage.js b/js/crm.livePage.js index 4c0e8c9791..b7f8f15f4d 100644 --- a/js/crm.livePage.js +++ b/js/crm.livePage.js @@ -7,7 +7,7 @@ cj(function($) { // Open action links in a popup .on('click', 'a.button, a.action-item', function() { // only follow real links not javascript buttons - if ($(this).attr('href') === '#' || $(this).attr('onclick')) {console.log('bogus', this); + if ($(this).attr('href') === '#' || $(this).attr('onclick')) { return; } CRM.loadForm($(this).attr('href'), { diff --git a/js/jquery/jquery.crmeditable.js b/js/jquery/jquery.crmeditable.js index 539ef4e73a..1c37cbd592 100644 --- a/js/jquery/jquery.crmeditable.js +++ b/js/jquery/jquery.crmeditable.js @@ -32,7 +32,7 @@ if (!ret.entity || !ret.id) { return false; } - $('.crm-editable', $row).each(function() { + $('.crm-editable, [data-field]', $row).each(function() { var fieldName = $(this).data('field') || this.className.match(/crmf-(\S*)/)[1]; if (fieldName) { ret[fieldName] = $(this).text(); diff --git a/templates/CRM/Admin/Form/LabelFormats.tpl b/templates/CRM/Admin/Form/LabelFormats.tpl index 1aa838686d..f4095eb869 100644 --- a/templates/CRM/Admin/Form/LabelFormats.tpl +++ b/templates/CRM/Admin/Form/LabelFormats.tpl @@ -113,10 +113,6 @@
{ts}Weight controls the order in which Label Formats are displayed in selection lists. Enter a positive or negative integer. Lower numbers are displayed ahead of higher numbers.{/ts}
- {/if} -
{include file="CRM/common/formButtons.tpl" location="bottom"}
- -{if $action neq 8} {literal} {/literal} -{/if} + {/if} +
{include file="CRM/common/formButtons.tpl" location="bottom"}
+ diff --git a/templates/CRM/Admin/Form/PdfFormats.tpl b/templates/CRM/Admin/Form/PdfFormats.tpl index 15e1be5cbe..0995a6de2d 100644 --- a/templates/CRM/Admin/Form/PdfFormats.tpl +++ b/templates/CRM/Admin/Form/PdfFormats.tpl @@ -66,10 +66,6 @@ -{/if} -
{include file="CRM/common/formButtons.tpl" location="bottom"}
- - {literal} {/literal} + +{/if} +
{include file="CRM/common/formButtons.tpl" location="bottom"}
+ diff --git a/templates/CRM/Admin/Page/Job.tpl b/templates/CRM/Admin/Page/Job.tpl index f67d3374dd..f44cf4bf2f 100644 --- a/templates/CRM/Admin/Page/Job.tpl +++ b/templates/CRM/Admin/Page/Job.tpl @@ -56,7 +56,7 @@ {foreach from=$rows item=row} - {$row.name} ({$row.run_frequency})
+ {$row.name} ({$row.run_frequency})
{$row.description}
{ts}API Entity:{/ts} {$row.api_entity}
{ts}API Action:{/ts} {$row.api_action}
diff --git a/templates/CRM/Admin/Page/LocationType.tpl b/templates/CRM/Admin/Page/LocationType.tpl index 3756ad48b8..4ae1bf91ec 100644 --- a/templates/CRM/Admin/Page/LocationType.tpl +++ b/templates/CRM/Admin/Page/LocationType.tpl @@ -23,13 +23,12 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -
- {ts}Location types provide convenient labels to differentiate contacts' location(s). Administrators may define as many additional types as appropriate for your constituents (examples might be Main Office, School, Vacation Home...).{/ts} -
- {if $action eq 1 or $action eq 2 or $action eq 8} {include file="CRM/Admin/Form/LocationType.tpl"} {else} +
+ {ts}Location types provide convenient labels to differentiate contacts' location(s). Administrators may define as many additional types as appropriate for your constituents (examples might be Main Office, School, Vacation Home...).{/ts} +
{if $rows}
diff --git a/templates/CRM/Admin/Page/Reminders.tpl b/templates/CRM/Admin/Page/Reminders.tpl index c43c32729a..fc4c6646db 100755 --- a/templates/CRM/Admin/Page/Reminders.tpl +++ b/templates/CRM/Admin/Page/Reminders.tpl @@ -44,7 +44,7 @@ {foreach from=$rows item=row} - + {$row.title} {$row.entity} - {$row.value} {if $row.absolute_date}{$row.absolute_date|crmDate}{else}{$row.start_action_offset} {$row.start_action_unit}{if $row.start_action_offset > 1}{ts}(s){/ts}{/if} {$row.start_action_condition} {$row.entityDate}{/if} diff --git a/templates/CRM/Price/Form/Field.tpl b/templates/CRM/Price/Form/Field.tpl index 986d332ad8..ed0908df52 100644 --- a/templates/CRM/Price/Form/Field.tpl +++ b/templates/CRM/Price/Form/Field.tpl @@ -27,17 +27,16 @@ {literal}