From e5e8ab99b3012a72d0c2a8caf8af8fd93ae6f591 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 24 Sep 2014 19:27:53 -0400 Subject: [PATCH] CRM-15367 - Standardize buttons for option edit screens --- CRM/Price/Form/Option.php | 2 +- CRM/Price/Page/Field.php | 5 +- CRM/Price/Page/Option.php | 3 - templates/CRM/Admin/Page/ContactType.tpl | 1 + templates/CRM/Admin/Page/LocationType.tpl | 1 + templates/CRM/Admin/Page/MailSettings.tpl | 1 + templates/CRM/Admin/Page/OptionGroup.tpl | 1 + templates/CRM/Admin/Page/Options.tpl | 7 +- .../CRM/Admin/Page/ParticipantStatus.tpl | 3 +- .../CRM/Admin/Page/PaymentProcessorType.tpl | 10 +- templates/CRM/Admin/Page/PdfFormats.tpl | 6 +- templates/CRM/Admin/Page/RelationshipType.tpl | 1 + .../CRM/Contribute/Page/ContributionType.tpl | 14 +- templates/CRM/Custom/Page/Field.tpl | 1 + templates/CRM/Custom/Page/Option.tpl | 1 + .../CRM/Financial/Page/FinancialType.tpl | 15 +- .../CRM/Member/Page/MembershipStatus.tpl | 5 +- templates/CRM/Price/Form/Option.tpl | 170 +++++++++--------- templates/CRM/Price/Page/Field.tpl | 25 ++- templates/CRM/Price/Page/Option.tpl | 93 +++++----- 20 files changed, 183 insertions(+), 182 deletions(-) diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php index 2657ec5bab..543ed01140 100644 --- a/CRM/Price/Form/Option.php +++ b/CRM/Price/Form/Option.php @@ -63,7 +63,7 @@ class CRM_Price_Form_Option extends CRM_Core_Form { * @access public */ public function preProcess() { - + $this->setPageTitle(ts('Price Option')); $this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this ); diff --git a/CRM/Price/Page/Field.php b/CRM/Price/Page/Field.php index 756fdce079..60287d91da 100644 --- a/CRM/Price/Page/Field.php +++ b/CRM/Price/Page/Field.php @@ -289,7 +289,10 @@ class CRM_Price_Page_Field extends CRM_Core_Page { } } - if ($this->_sid) { + if ($action & CRM_Core_Action::DELETE) { + CRM_Utils_System::setTitle(ts('Delete Price Field')); + } + elseif ($this->_sid) { $groupTitle = CRM_Price_BAO_PriceSet::getTitle($this->_sid); $this->assign('sid', $this->_sid); $this->assign('groupTitle', $groupTitle); diff --git a/CRM/Price/Page/Option.php b/CRM/Price/Page/Option.php index 78a0bb7c59..0f1d5849e6 100644 --- a/CRM/Price/Page/Option.php +++ b/CRM/Price/Page/Option.php @@ -214,9 +214,6 @@ class CRM_Price_Page_Option extends CRM_Core_Page { $controller->process(); $controller->run(); - - $this->browse(); - if ($action & CRM_Core_Action::DELETE) { // add breadcrumb $url = CRM_Utils_System::url('civicrm/admin/price/field/option', 'reset=1'); diff --git a/templates/CRM/Admin/Page/ContactType.tpl b/templates/CRM/Admin/Page/ContactType.tpl index eae3fe1dec..128c2218ad 100644 --- a/templates/CRM/Admin/Page/ContactType.tpl +++ b/templates/CRM/Admin/Page/ContactType.tpl @@ -65,5 +65,6 @@ {/if} {/if} diff --git a/templates/CRM/Admin/Page/LocationType.tpl b/templates/CRM/Admin/Page/LocationType.tpl index 7a07c54b14..33a4fd4da5 100644 --- a/templates/CRM/Admin/Page/LocationType.tpl +++ b/templates/CRM/Admin/Page/LocationType.tpl @@ -71,5 +71,6 @@ {/if} {/if} diff --git a/templates/CRM/Admin/Page/MailSettings.tpl b/templates/CRM/Admin/Page/MailSettings.tpl index ba0111f4bd..a8e2192adc 100644 --- a/templates/CRM/Admin/Page/MailSettings.tpl +++ b/templates/CRM/Admin/Page/MailSettings.tpl @@ -76,5 +76,6 @@ {/if} {/if} diff --git a/templates/CRM/Admin/Page/OptionGroup.tpl b/templates/CRM/Admin/Page/OptionGroup.tpl index fddc4e317d..d287d6e70b 100644 --- a/templates/CRM/Admin/Page/OptionGroup.tpl +++ b/templates/CRM/Admin/Page/OptionGroup.tpl @@ -59,6 +59,7 @@ {if $action ne 1 and $action ne 2} {/if} diff --git a/templates/CRM/Admin/Page/Options.tpl b/templates/CRM/Admin/Page/Options.tpl index d75725c4a0..e00194ec49 100644 --- a/templates/CRM/Admin/Page/Options.tpl +++ b/templates/CRM/Admin/Page/Options.tpl @@ -157,10 +157,11 @@ {ts}None found.{/ts} {/if} - {if $isLocked ne 1} - {/if} {/if} diff --git a/templates/CRM/Admin/Page/ParticipantStatus.tpl b/templates/CRM/Admin/Page/ParticipantStatus.tpl index efcfbac344..2e78465c45 100644 --- a/templates/CRM/Admin/Page/ParticipantStatus.tpl +++ b/templates/CRM/Admin/Page/ParticipantStatus.tpl @@ -63,7 +63,8 @@ {if $action ne 1 and $action ne 2} {/if} diff --git a/templates/CRM/Admin/Page/PaymentProcessorType.tpl b/templates/CRM/Admin/Page/PaymentProcessorType.tpl index 1572953a1e..ed79ccf0f2 100644 --- a/templates/CRM/Admin/Page/PaymentProcessorType.tpl +++ b/templates/CRM/Admin/Page/PaymentProcessorType.tpl @@ -61,17 +61,17 @@ {/strip} {if $action ne 1 and $action ne 2} - {elseif $action ne 1}
- {ts}status{/ts} - {capture assign=crmURL}{crmURL p='civicrm/admin/paymentProcessorType' q="action=add&reset=1"}{/capture} - {ts 1=$crmURL}There are no Payment Processors entered. You can add one.{/ts} + {ts}status{/ts} + {ts}None found.{/ts}
{/if} {/if} diff --git a/templates/CRM/Admin/Page/PdfFormats.tpl b/templates/CRM/Admin/Page/PdfFormats.tpl index 8fc34c94d7..c2b1a5be18 100644 --- a/templates/CRM/Admin/Page/PdfFormats.tpl +++ b/templates/CRM/Admin/Page/PdfFormats.tpl @@ -60,12 +60,12 @@ {else}
- {capture assign=link}href="{crmURL q="action=add&reset=1"}" class="action-item"{/capture} - {ts 1=$link}There are no PDF Page Formats configured. You can add one.{/ts} + {ts}None found.{/ts}
{/if}
{/if} diff --git a/templates/CRM/Admin/Page/RelationshipType.tpl b/templates/CRM/Admin/Page/RelationshipType.tpl index 827219de27..52bfe7e05a 100644 --- a/templates/CRM/Admin/Page/RelationshipType.tpl +++ b/templates/CRM/Admin/Page/RelationshipType.tpl @@ -84,5 +84,6 @@ {/if} {/if} diff --git a/templates/CRM/Contribute/Page/ContributionType.tpl b/templates/CRM/Contribute/Page/ContributionType.tpl index 9a9d27c723..0ccc548c67 100644 --- a/templates/CRM/Contribute/Page/ContributionType.tpl +++ b/templates/CRM/Contribute/Page/ContributionType.tpl @@ -62,18 +62,18 @@ {/strip} - {if $action ne 1 and $action ne 2} - - {/if} {else}
- {capture assign=crmURL}{crmURL q="action=add&reset=1"}{/capture} - {ts 1=$crmURL}There are no Financial Types entered. You can add one.{/ts} + {ts}None found.{/ts}
{/if} + {if $action ne 1 and $action ne 2} + + {/if} {/if} diff --git a/templates/CRM/Custom/Page/Field.tpl b/templates/CRM/Custom/Page/Field.tpl index 16fb0e61ce..ae012e6141 100644 --- a/templates/CRM/Custom/Page/Field.tpl +++ b/templates/CRM/Custom/Page/Field.tpl @@ -78,6 +78,7 @@ {/if} {/if} diff --git a/templates/CRM/Custom/Page/Option.tpl b/templates/CRM/Custom/Page/Option.tpl index 85b231b646..9608786b32 100644 --- a/templates/CRM/Custom/Page/Option.tpl +++ b/templates/CRM/Custom/Page/Option.tpl @@ -65,6 +65,7 @@ diff --git a/templates/CRM/Financial/Page/FinancialType.tpl b/templates/CRM/Financial/Page/FinancialType.tpl index 0856c4289e..2bd846324b 100644 --- a/templates/CRM/Financial/Page/FinancialType.tpl +++ b/templates/CRM/Financial/Page/FinancialType.tpl @@ -65,19 +65,18 @@ {/foreach} {/strip} - - {if $action ne 1 and $action ne 2} - - {/if} {else}
- {capture assign=crmURL}{crmURL q="action=add&reset=1"}{/capture} - {ts 1=$crmURL}There are no Financial Types entered. You can add one.{/ts} + {ts}None found.{/ts}
{/if} + {if $action ne 1 and $action ne 2} + + {/if} {/if} diff --git a/templates/CRM/Member/Page/MembershipStatus.tpl b/templates/CRM/Member/Page/MembershipStatus.tpl index 9049805229..402b829c23 100644 --- a/templates/CRM/Member/Page/MembershipStatus.tpl +++ b/templates/CRM/Member/Page/MembershipStatus.tpl @@ -67,8 +67,9 @@ {/strip} {if $action ne 1 and $action ne 2} - diff --git a/templates/CRM/Price/Form/Option.tpl b/templates/CRM/Price/Form/Option.tpl index 68e8e6a2d1..22337a36a3 100644 --- a/templates/CRM/Price/Form/Option.tpl +++ b/templates/CRM/Price/Form/Option.tpl @@ -23,107 +23,99 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if $action eq 8} -
-
- {ts}WARNING: Deleting this option will result in the loss of all data.{/ts} {ts}This action cannot be undone.{/ts} {ts}Do you want to continue?{/ts} - -
- {/if} -

{if $action eq 8 }{ts}Delete Option{/ts}{elseif $action eq 1}{ts}New Option{/ts}{elseif $action eq 2}{ts}Edit Option{/ts}{/if}

- {if $action neq 8} - + {if $action eq 8} +
+
+ {ts}WARNING: Deleting this option will result in the loss of all data.{/ts} {ts}This action cannot be undone.{/ts} {ts}Do you want to continue?{/ts} +
+ {else} +
{if $showMember} - - - - - - - - + + + + + + + + {/if} - - - - - - - - - - - + + + + + + + + + + + - - + - - {* fix for CRM-10241 *} - {if $form.count.html} - - - - - {* 2 line fix for CRM-10241 *} - {/if} - {if $form.max_value.html} - - - - - {* fix for CRM-10241 *} - {/if} - - - - - - - - {if !$hideDefaultOption} + {$form.financial_type_id.html} + {/if} + + + {* fix for CRM-10241 *} + {if $form.count.html} + + + + + {* 2 line fix for CRM-10241 *} + {/if} + {if $form.max_value.html} + + + + + {* fix for CRM-10241 *} + {/if} + + + + + + + + {if !$hideDefaultOption} - - - - {/if} -
{$form.membership_type_id.label}{$form.membership_type_id.html} -
{ts}If a membership type is selected, a membership will be created or renewed when users select this option. Leave this blank if you are using this for non-membership options (e.g. magazine subscription).{/ts} {help id="id-member-price-options" file="CRM/Price/Page/Field.hlp"}
{$form.membership_num_terms.label}{$form.membership_num_terms.html} -
{ts}You can set this to a number other than one to allow multiple membership terms.{/ts}
{$form.membership_type_id.label}{$form.membership_type_id.html} +
{ts}If a membership type is selected, a membership will be created or renewed when users select this option. Leave this blank if you are using this for non-membership options (e.g. magazine subscription).{/ts} {help id="id-member-price-options" file="CRM/Price/Page/Field.hlp"}
{$form.membership_num_terms.label}{$form.membership_num_terms.html} +
{ts}You can set this to a number other than one to allow multiple membership terms.{/ts}
{$form.label.label}{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='label' id=$sid}{/if}{$form.label.html}
{$form.amount.label}{$form.amount.html}
{$form.description.label}{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='description' id=$sid}{/if}{$form.description.html}
{$form.label.label}{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='label' id=$sid}{/if}{$form.label.html}
{$form.amount.label}{$form.amount.html}
{$form.description.label}{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='description' id=$sid}{/if}{$form.description.html}
{$form.financial_type_id.label} - {if !$financialType } - {capture assign=ftUrl}{crmURL p='civicrm/admin/financial/financialType' q="reset=1"}{/capture} - {ts 1=$ftUrl}There are no financial types configured with a linked 'Revenue Account of' account. Click here if you want to configure financial types for your site.{/ts} + {$form.financial_type_id.label} + {if !$financialType } + {capture assign=ftUrl}{crmURL p='civicrm/admin/financial/financialType' q="reset=1"}{/capture} + {ts 1=$ftUrl}There are no financial types configured with a linked 'Revenue Account of' account. Click here if you want to configure financial types for your site.{/ts} {else} - {$form.financial_type_id.html} - {/if} -
{$form.count.label}{$form.count.html} {help id="id-participant-count" file="CRM/Price/Page/Field.hlp"}
{$form.max_value.label}{$form.max_value.html} {help id="id-participant-max" file="CRM/Price/Page/Field.hlp"}
{$form.weight.label}{$form.weight.html}
{$form.is_active.label}{$form.is_active.html}
{$form.count.label}{$form.count.html} {help id="id-participant-count" file="CRM/Price/Page/Field.hlp"}
{$form.max_value.label}{$form.max_value.html} {help id="id-participant-max" file="CRM/Price/Page/Field.hlp"}
{$form.weight.label}{$form.weight.html}
{$form.is_active.label}{$form.is_active.html}
{$form.is_default.label}{$form.is_default.html}
+ {$form.is_default.label} + {$form.is_default.html} + {/if} + + {literal} + + {/if} -{literal} - +
diff --git a/templates/CRM/Price/Page/Field.tpl b/templates/CRM/Price/Page/Field.tpl index 9ec0fea8e7..52e3879331 100644 --- a/templates/CRM/Price/Page/Field.tpl +++ b/templates/CRM/Price/Page/Field.tpl @@ -29,19 +29,18 @@ {include file="CRM/Price/Form/DeleteField.tpl"} {elseif $action eq 1024 } {include file="CRM/Price/Form/Preview.tpl"} -{else} - {if ($usedBy and $action eq 8) or $usedBy.civicrm_event or $usedBy.civicrm_contribution_page} -
-
- {if $action eq 8} - {ts 1=$usedPriceSetTitle}Unable to delete the '%1' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates.{/ts} - {/if} +{elseif ($usedBy and $action eq 8) or $usedBy.civicrm_event or $usedBy.civicrm_contribution_page} +
+
+ {if $action eq 8} + {ts 1=$usedPriceSetTitle}Unable to delete the '%1' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates.{/ts} + {/if} - {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template} - {include file="CRM/Price/Page/table.tpl"} - {/if} -
- {/if} + {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template} + {include file="CRM/Price/Page/table.tpl"} + {/if} +
+{else} @@ -80,7 +79,7 @@ {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if} {if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if} - {if $row.html_type eq "Text"}{$row.price|crmMoney}{else}{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}{/if} + {if $row.html_type eq "Text"}{$row.price|crmMoney}{else}{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}{/if} {$row.action|replace:'xx':$row.id} {/foreach} diff --git a/templates/CRM/Price/Page/Option.tpl b/templates/CRM/Price/Page/Option.tpl index 41626147fa..b002a57c1e 100644 --- a/templates/CRM/Price/Page/Option.tpl +++ b/templates/CRM/Price/Page/Option.tpl @@ -25,9 +25,8 @@ *} {if ($action eq 1 or $action eq 2 or $action eq 4 or $action eq 8 and !$usedBy) and !$isReserved} {include file="CRM/Price/Form/Option.tpl"} -{/if} -{if $usedBy} +{elseif $usedBy}
@@ -40,56 +39,58 @@ {/if}
-{/if} - +{else} -{if $customOption} + {if $customOption} -
-

- {strip} - {* handle enable/disable actions*} - {include file="CRM/common/enableDisableApi.tpl"} - {include file="CRM/common/crmeditable.tpl"} - - - - - - - - - - - - - {foreach from=$customOption item=row} - - - - - - - - +
+

+ {strip} + {* handle enable/disable actions*} + {include file="CRM/common/enableDisableApi.tpl"} + {include file="CRM/common/crmeditable.tpl"} +
{ts}Option Label{/ts}{ts}Option Amount{/ts}{ts}Default{/ts}{ts}Financial Type{/ts}{ts}Order{/ts}{ts}Enabled?{/ts}
{$row.label}{$row.amount|crmMoney}{if $row.is_default}{ts}Default{/ts}{/if}{$row.financial_type_id}{$row.weight}{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}{$row.action|replace:'xx':$row.id}
+ + + + + + + + + - {/foreach} - -
{ts}Option Label{/ts}{ts}Option Amount{/ts}{ts}Default{/ts}{ts}Financial Type{/ts}{ts}Order{/ts}{ts}Enabled?{/ts}
- {/strip} - {if $addMoreFields && !$isReserved} - + + {else} + {if $action eq 16} +
+ {ts}status{/ts} + {ts}None found.{/ts}
{/if} -
- -{else} - {if $action eq 16} -
- {ts}status{/ts} - {capture assign=crmURL}{crmURL p='civicrm/admin/price/field/option' q="action=add&fid=$fid&sid=$sid"}{/capture}{ts 1=$fieldTitle 2=$crmURL}There are no options for the price field '%1', add one.{/ts} + {/if} + {if $addMoreFields && !$isReserved} + {/if} {/if} -- 2.25.1