CRM-15367 - Standardize buttons for option edit screens
authorColeman Watts <coleman@civicrm.org>
Wed, 24 Sep 2014 23:27:53 +0000 (19:27 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 24 Sep 2014 23:27:53 +0000 (19:27 -0400)
20 files changed:
CRM/Price/Form/Option.php
CRM/Price/Page/Field.php
CRM/Price/Page/Option.php
templates/CRM/Admin/Page/ContactType.tpl
templates/CRM/Admin/Page/LocationType.tpl
templates/CRM/Admin/Page/MailSettings.tpl
templates/CRM/Admin/Page/OptionGroup.tpl
templates/CRM/Admin/Page/Options.tpl
templates/CRM/Admin/Page/ParticipantStatus.tpl
templates/CRM/Admin/Page/PaymentProcessorType.tpl
templates/CRM/Admin/Page/PdfFormats.tpl
templates/CRM/Admin/Page/RelationshipType.tpl
templates/CRM/Contribute/Page/ContributionType.tpl
templates/CRM/Custom/Page/Field.tpl
templates/CRM/Custom/Page/Option.tpl
templates/CRM/Financial/Page/FinancialType.tpl
templates/CRM/Member/Page/MembershipStatus.tpl
templates/CRM/Price/Form/Option.tpl
templates/CRM/Price/Page/Field.tpl
templates/CRM/Price/Page/Option.tpl

index 2657ec5bab66ba0b3bacdffeab69c65914616fba..543ed011402c3f2b4b2e03e710043a2152d33d65 100644 (file)
@@ -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
     );
index 756fdce079690ab2f87685a3a3ea4883f3147288..60287d91da75e1e6f8a2829bdce5288d7aaf4fc0 100644 (file)
@@ -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);
index 78a0bb7c59b7bc54ddc7b850f038c31f7810971e..0f1d5849e6652f98238e358c86b80baac480d0fe 100644 (file)
@@ -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');
index eae3fe1dec3b77aa5e5d9f48bcd4f5fa58215820..128c2218ad5d0687b73773375f1bc0586d1885bc 100644 (file)
@@ -65,5 +65,6 @@
   {/if}
   <div class="action-link">
     <a href="{crmURL q="action=add&reset=1"}" class="button"><span><div class="icon add-icon"></div>{ts}Add Contact Type{/ts}</span></a>
+    <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
   </div>
 {/if}
index 7a07c54b14852289f2332defc24b77931daadc39..33a4fd4da573411e7f902185bfe3e19700c45c24 100644 (file)
@@ -71,5 +71,6 @@
   {/if}
   <div class="action-link">
     <a href="{crmURL q="action=add&reset=1"}" id="newLocationType" class="button"><span><div class="icon add-icon"></div>{ts}Add Location Type{/ts}</span></a>
+    <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
   </div>
 {/if}
index ba0111f4bdf98e56efc7b65698531ec5a003398d..a8e2192adc2aa2c84e36f4ce667de3e0a5232939 100644 (file)
@@ -76,5 +76,6 @@
 {/if}
   <div class="action-link">
     <a href="{crmURL q="action=add&reset=1"}" id="newMailSettings" class="button"><span><div class="icon add-icon"></div>{ts}Add Mail Account{/ts}</span></a>
+    <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
   </div>
 {/if}
index fddc4e317dda7189a64b11261757459e7f37ec22..d287d6e70b334b9cdf79f2dda11ff36875ec4103 100644 (file)
@@ -59,6 +59,7 @@
     {if $action ne 1 and $action ne 2}
       <div class="action-link">
           <a href="{crmURL q="action=add&reset=1"}" id="newOptionGroup" class="button"><span><div class="icon add-icon"></div>{ts}Add Option Group{/ts}</span></a>
+          <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
         </div>
     {/if}
 </div>
index d75725c4a06de9e08fd122638cc7c2dbd9ae858c..e00194ec49e2b77fe7362b609d5ba49cd473666d 100644 (file)
       {ts}None found.{/ts}
     </div>
 {/if}
-  {if $isLocked ne 1}
     <div class="action-link">
-      <a href="{crmURL p="civicrm/admin/options/$gName" q='action=add&reset=1'}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$gLabel}Add %1{/ts}</span></a>
+      {if $isLocked ne 1}
+        <a href="{crmURL p="civicrm/admin/options/$gName" q='action=add&reset=1'}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$gLabel}Add %1{/ts}</span></a>
+      {/if}
+      <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
     </div>
-  {/if}
 </div>
 {/if}
index efcfbac34454e24c564e2bf93ca6b8849a0d5ce0..2e78465c45c74ae447d63cfde5d22766e1fa6590 100644 (file)
@@ -63,7 +63,8 @@
 
   {if $action ne 1 and $action ne 2}
     <div class="action-link">
-      <a href="{crmURL q="action=add&reset=1"}" class="button"><span><div class="icon add-icon"></div>{ts}Add Participant Status{/ts}</span></a>
+      <a href="{crmURL q="action=add&reset=1"}" class="button"><span><div class="icon add-icon"></div> {ts}Add Participant Status{/ts}</span></a>
+      <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
     </div>
   {/if}
 </div>
index 1572953a1e4d73acd246aadd0e77e8d479fd4772..ed79ccf0f204ecb52ec978f842b1d0e9da4ca113 100644 (file)
         {/strip}
 
         {if $action ne 1 and $action ne 2}
-      <div class="action-link">
-      <a href="{crmURL q="action=add&reset=1"}" id="newPaymentProcessor">&raquo; {ts}New Payment Processor{/ts}</a>
+        <div class="action-link">
+          <a href="{crmURL q="action=add&reset=1"}" id="newPaymentProcessor">&raquo; {ts}New Payment Processor{/ts}</a>
+          <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
         </div>
         {/if}
     </div>
 </div>
 {elseif $action ne 1}
     <div class="messages status no-popup">
-        <img src="{$config->resourceBase}i/Inform.gif" alt="{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 <a href='%1'>add one</a>.{/ts}
+      <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
+      {ts}None found.{/ts}
     </div>
 {/if}
 {/if}
index 8fc34c94d7b58bc5736da298a86bef4d732619dd..c2b1a5be18d171877b7d0c4d3655a4961f0317f2 100644 (file)
 {else}
     <div class="messages status no-popup">
       <div class="icon inform-icon"></div>
-        {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 <a %1>add one</a>.{/ts}
+      {ts}None found.{/ts}
     </div>
 {/if}
     <div class="spacer"></div>
     <div class="action-link">
-        <a href="{crmURL q="action=add&reset=1"}" id="newPdfFormat" class="button"><span><div class="icon add-icon"></div>{ts}Add PDF Page Format{/ts}</span></a>
+      <a href="{crmURL q="action=add&reset=1"}" id="newPdfFormat" class="button"><span><div class="icon add-icon"></div>{ts}Add PDF Page Format{/ts}</span></a>
+      <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
     </div>
 {/if}
index 827219de275fa94cff3ef955e27605a73ed710fb..52bfe7e05a7fcabdaa39128519112d720338d2e9 100644 (file)
@@ -84,5 +84,6 @@
 {/if}
   <div class="action-link">
     <a href="{crmURL q="action=add&reset=1"}" class="button newRelationshipType"><span><div class="icon add-icon"></div>{ts}Add Relationship Type{/ts}</span></a>
+    <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
   </div>
 {/if}
index 9a9d27c723f8b080f443371c08b4d2d6b6a6ac1e..0ccc548c67dbf38694f66fc912d12958e00eb8f2 100644 (file)
          </table>
         {/strip}
 
-        {if $action ne 1 and $action ne 2}
-      <div class="action-link">
-      <a href="{crmURL q="action=add&reset=1"}" id="newContributionType" class="button"><span><div class="icon add-icon"></div>{ts}Add Financial Type{/ts}</span></a>
-        </div>
-        {/if}
     </div>
 </div>
 {else}
     <div class="messages status no-popup">
         <div class="icon inform-icon"></div>
-        {capture assign=crmURL}{crmURL q="action=add&reset=1"}{/capture}
-        {ts 1=$crmURL}There are no Financial Types entered. You can <a href='%1'>add one</a>.{/ts}
+      {ts}None found.{/ts}
     </div>
 {/if}
+  {if $action ne 1 and $action ne 2}
+    <div class="action-link">
+      <a href="{crmURL q="action=add&reset=1"}" id="newContributionType" class="button"><span><div class="icon add-icon"></div>{ts}Add Financial Type{/ts}</span></a>
+      <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
+    </div>
+  {/if}
 {/if}
index 16fb0e61cefda6a0fa5b6f86b7a31d8bedd34a91..ae012e614145dd1723461e9e3a618714329c6280 100644 (file)
@@ -78,6 +78,7 @@
     {/if}
     <div class="action-link">
       <a href="{crmURL p='civicrm/admin/custom/group/field/add' q="reset=1&action=add&gid=$gid"}" id="newCustomField" class="button action-item"><span><div class="icon add-icon"></div>{ts}Add Custom Field{/ts}</span></a>
+      <a href="{crmURL p="civicrm/admin/custom/group" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
     </div>
 {/if}
 
index 85b231b64665bb9610815370594a4b795c5b6ee6..9608786b32dd150a7576a65ace2cd6aad1b1a272 100644 (file)
@@ -65,6 +65,7 @@
 
         <div class="action-link">
             <a href="{crmURL q="reset=1&action=add&fid=$fid&gid=$gid"}" class="button action-item"><span><div class="icon add-icon"></div> {ts 1=$fieldTitle}Add Option for '%1'{/ts}</span></a>
+            <a href="{crmURL p="civicrm/admin/custom/group/field" q="reset=1&action=browse&gid=$gid"}" class="button action-item cancel"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
         </div>
       </div>
     </div>
index 0856c4289ee93c0b2f238abdfe353c9b6f35da0d..2bd846324b62d9d3d434ff7b913177e8193a86ed 100644 (file)
         {/foreach}
          </table>
         {/strip}
-
-        {if $action ne 1 and $action ne 2}
-      <div class="action-link">
-      <a href="{crmURL q="action=add&reset=1"}" id="newFinancialType" class="button"><span><div class="icon add-icon"></div>{ts}Add Financial Type{/ts}</span></a>
-        </div>
-        {/if}
     </div>
 </div>
 {else}
     <div class="messages status no-popup">
         <div class="icon inform-icon"></div>
-        {capture assign=crmURL}{crmURL q="action=add&reset=1"}{/capture}
-        {ts 1=$crmURL}There are no Financial Types entered. You can <a href='%1'>add one</a>.{/ts}
+      {ts}None found.{/ts}
     </div>
 {/if}
+  {if $action ne 1 and $action ne 2}
+    <div class="action-link">
+      <a href="{crmURL q="action=add&reset=1"}" id="newFinancialType" class="button"><span><div class="icon add-icon"></div>{ts}Add Financial Type{/ts}</span></a>
+      <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
+    </div>
+  {/if}
 {/if}
index 9049805229b7bedaccc374f6683ef1639faa4554..402b829c231c618397511b8bf16632d2e18d6abf 100644 (file)
@@ -67,8 +67,9 @@
         {/strip}
 
         {if $action ne 1 and $action ne 2}
-      <div class="action-link">
-      <a href="{crmURL q="action=add&reset=1"}" id="newMembershipStatus" class="button"><span><div class="icon add-icon"></div>{ts}Add Membership Status{/ts}</span></a>
+        <div class="action-link">
+          <a href="{crmURL q="action=add&reset=1"}" id="newMembershipStatus" class="button"><span><div class="icon add-icon"></div>{ts}Add Membership Status{/ts}</span></a>
+          <a href="{crmURL p="civicrm/admin" q="reset=1"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
         </div>
         {/if}
     </div>
index 68e8e6a2d19e159443d5a17715696b0e764d73b1..22337a36a33a86c7128143405d5eaf8fd19d5b44 100644 (file)
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
 *}
-{if $action eq 8}
-      <div class="messages status no-popup">
-       <div class="icon inform-icon"></div>
-          {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}
-
-      </div>
-     {/if}
-<h3>{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}</h3>
 <div class="crm-form-block">
-     {if $action neq 8}
-  <table class="form-layout">
+  {if $action eq 8}
+    <div class="messages status no-popup">
+      <div class="icon inform-icon"></div>
+      {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}
+    </div>
+  {else}
+    <table class="form-layout">
       {if $showMember}
-            <tr class="crm-price-option-form-block-membership_type_id">
-                 <td class="label">{$form.membership_type_id.label}</td>
-                 <td>{$form.membership_type_id.html}
-                 <br /> <span class="description">{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"}</span></td>
-            </tr>
-            <tr class="crm-price-option-form-block-membership_num_terms">
-                 <td class="label">{$form.membership_num_terms.label}</td>
-                 <td>{$form.membership_num_terms.html}
-                 <br /> <span class="description">{ts}You can set this to a number other than one to allow multiple membership terms.{/ts}</span></td>
-            </tr>
+        <tr class="crm-price-option-form-block-membership_type_id">
+          <td class="label">{$form.membership_type_id.label}</td>
+          <td>{$form.membership_type_id.html}
+            <br /> <span class="description">{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"}</span></td>
+        </tr>
+        <tr class="crm-price-option-form-block-membership_num_terms">
+          <td class="label">{$form.membership_num_terms.label}</td>
+          <td>{$form.membership_num_terms.html}
+            <br /> <span class="description">{ts}You can set this to a number other than one to allow multiple membership terms.{/ts}</span></td>
+        </tr>
       {/if}
       <tr class="crm-price-option-form-block-label">
-               <td class="label">{$form.label.label}</td>
-               <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='label' id=$sid}{/if}{$form.label.html}</td>
-            </tr>
-            <tr class="crm-price-option-form-block-amount">
-                <td class="label">{$form.amount.label}</td>
-                <td>{$form.amount.html}</td>
-            </tr>
-            <tr class="crm-price-option-form-block-description">
-                <td class="label">{$form.description.label}</td>
-                <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='description' id=$sid}{/if}{$form.description.html}</td>
-            </tr>
+        <td class="label">{$form.label.label}</td>
+        <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='label' id=$sid}{/if}{$form.label.html}</td>
+      </tr>
+      <tr class="crm-price-option-form-block-amount">
+        <td class="label">{$form.amount.label}</td>
+        <td>{$form.amount.html}</td>
+      </tr>
+      <tr class="crm-price-option-form-block-description">
+        <td class="label">{$form.description.label}</td>
+        <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='description' id=$sid}{/if}{$form.description.html}</td>
+      </tr>
       <tr class="crm-price-option-form-block-financial-type">
-                <td class="label">{$form.financial_type_id.label}</td>
-                <td>
-    {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. <a href='%1'>Click here</a> if you want to configure financial types for your site.{/ts}
+        <td class="label">{$form.financial_type_id.label}</td>
+        <td>
+          {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. <a href='%1'>Click here</a> if you want to configure financial types for your site.{/ts}
           {else}
-      {$form.financial_type_id.html}
-    {/if}
-    </td>
-            </tr>
-            {* fix for CRM-10241 *}
-            {if $form.count.html}
-            <tr class="crm-price-option-form-block-count">
-                <td class="label">{$form.count.label}</td>
-                <td>{$form.count.html} {help id="id-participant-count" file="CRM/Price/Page/Field.hlp"}</td>
-            </tr>
-            {* 2 line fix for CRM-10241 *}
-            {/if}
-            {if $form.max_value.html}
-            <tr class="crm-price-option-form-block-max_value">
-                <td class="label">{$form.max_value.label}</td>
-                <td>{$form.max_value.html} {help id="id-participant-max" file="CRM/Price/Page/Field.hlp"}</td>
-            </tr>
-            {* fix for CRM-10241 *}
-            {/if}
-            <tr class="crm-price-option-form-block-weight">
-               <td class="label">{$form.weight.label}</td>
-               <td>{$form.weight.html}</td>
-            </tr>
-            <tr class="crm-price-option-form-block-is_active">
-               <td class="label">{$form.is_active.label}</td>
-               <td>{$form.is_active.html}</td>
-  {if !$hideDefaultOption}
+            {$form.financial_type_id.html}
+          {/if}
+        </td>
+      </tr>
+      {* fix for CRM-10241 *}
+      {if $form.count.html}
+        <tr class="crm-price-option-form-block-count">
+          <td class="label">{$form.count.label}</td>
+          <td>{$form.count.html} {help id="id-participant-count" file="CRM/Price/Page/Field.hlp"}</td>
+        </tr>
+        {* 2 line fix for CRM-10241 *}
+      {/if}
+      {if $form.max_value.html}
+        <tr class="crm-price-option-form-block-max_value">
+          <td class="label">{$form.max_value.label}</td>
+          <td>{$form.max_value.html} {help id="id-participant-max" file="CRM/Price/Page/Field.hlp"}</td>
+        </tr>
+        {* fix for CRM-10241 *}
+      {/if}
+      <tr class="crm-price-option-form-block-weight">
+        <td class="label">{$form.weight.label}</td>
+        <td>{$form.weight.html}</td>
+      </tr>
+      <tr class="crm-price-option-form-block-is_active">
+        <td class="label">{$form.is_active.label}</td>
+        <td>{$form.is_active.html}</td>
+        {if !$hideDefaultOption}
       <tr class="crm-price-option-form-block-is_default">
-               <td class="label">{$form.is_default.label}</td>
-               <td>{$form.is_default.html}</td>
-            </tr>
-  {/if}
-  </table>
+        <td class="label">{$form.is_default.label}</td>
+        <td>{$form.is_default.html}</td>
+      </tr>
       {/if}
+    </table>
 
+  {literal}
+    <script type="text/javascript">
 
-    <div id="crm-submit-buttons" class="form-item">
-    <table class="form-layout">
-        <tr>
-           <td>&nbsp;</td>
-           <td>{include file="CRM/common/formButtons.tpl"}</td>
-        </tr>
-    </table>
-    </div>
+      function calculateRowValues( ) {
+        var mtype = cj("#membership_type_id").val();
+        var postUrl = "{/literal}{crmURL p='civicrm/ajax/memType' h=0}{literal}";
+        cj.post( postUrl, {mtype: mtype}, function( data ) {
+          cj("#amount").val( data.total_amount );
+          cj("#label").val( data.name );
 
-</div>
+        }, 'json');
+      }
+      {/literal}
+    </script>
+  {/if}
 
-{literal}
-     <script type="text/javascript">
 
-     function calculateRowValues( ) {
-      var mtype = cj("#membership_type_id").val();
-      var postUrl = "{/literal}{crmURL p='civicrm/ajax/memType' h=0}{literal}";
-      cj.post( postUrl, {mtype: mtype}, function( data ) {
-              cj("#amount").val( data.total_amount );
-              cj("#label").val( data.name );
+  <div class="crm-submit-buttons">
+    {include file="CRM/common/formButtons.tpl"}
+  </div>
 
-              }, 'json');
-     }
-    {/literal}
-</script>
+</div>
 
index 9ec0fea8e7f1c8f2d4f3a137238d169c82131e17..52e3879331e8131217fba20d6043917b75fae078 100644 (file)
     {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}
-    <div id="price_set_used_by" class="messages status no-popup">
-      <div class="icon inform-icon"></div>
-        {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}
+  <div id="price_set_used_by" class="messages status no-popup">
+    <div class="icon inform-icon"></div>
+    {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}
-    </div>
-  {/if}
+    {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template}
+      {include file="CRM/Price/Page/table.tpl"}
+    {/if}
+  </div>
+{else}
 
 
 
@@ -80,7 +79,7 @@
             <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
             <td>{if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if}</td>
             <td>{if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if}</td>
-            <td>{if $row.html_type eq "Text"}{$row.price|crmMoney}{else}<a href="{crmURL p="civicrm/admin/price/field/option" q="action=browse&reset=1&sid=$sid&fid=$fid"}">{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}</a>{/if}</td>
+            <td>{if $row.html_type eq "Text"}{$row.price|crmMoney}{else}<a class="action-item" href="{crmURL p="civicrm/admin/price/field/option" q="action=browse&reset=1&sid=$sid&fid=$fid"}">{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}</a>{/if}</td>
             <td class="field-action">{$row.action|replace:'xx':$row.id}</td>
         </tr>
         {/foreach}
index 41626147fa02fadb684d1aff5fe2e57df5070fc6..b002a57c1e4bdb9a48520cf2049e524754cec9a5 100644 (file)
@@ -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}
   <div class='spacer'></div>
   <div id="price_set_used_by" class="messages status no-popup">
     <div class="icon inform-icon"></div>
     {/if}
 
   </div>
-{/if}
-
+{else}
 
 
-{if $customOption}
+  {if $customOption}
 
-  <div id="field_page">
-    <p></p>
-    {strip}
-      {* handle enable/disable actions*}
-      {include file="CRM/common/enableDisableApi.tpl"}
-      {include file="CRM/common/crmeditable.tpl"}
-      <table id="options" class="row-highlight">
-        <thead>
-        <tr>
-          <th>{ts}Option Label{/ts}</th>
-          <th>{ts}Option Amount{/ts}</th>
-          <th>{ts}Default{/ts}</th>
-          <th>{ts}Financial Type{/ts}</th>
-          <th>{ts}Order{/ts}</th>
-          <th>{ts}Enabled?{/ts}</th>
-          <th></th>
-        </tr>
-        </thead>
-        {foreach from=$customOption item=row}
-          <tr id="price_field_value-{$row.id}" class="crm-entity {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>
-            <td class="nowrap crm-price-option-order">{$row.weight}</td>
-            <td id="row_{$row.id}_status" class="crm-price-option-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>
+    <div id="field_page">
+      <p></p>
+      {strip}
+        {* handle enable/disable actions*}
+        {include file="CRM/common/enableDisableApi.tpl"}
+        {include file="CRM/common/crmeditable.tpl"}
+        <table id="options" class="row-highlight">
+          <thead>
+          <tr>
+            <th>{ts}Option Label{/ts}</th>
+            <th>{ts}Option Amount{/ts}</th>
+            <th>{ts}Default{/ts}</th>
+            <th>{ts}Financial Type{/ts}</th>
+            <th>{ts}Order{/ts}</th>
+            <th>{ts}Enabled?{/ts}</th>
+            <th></th>
           </tr>
-        {/foreach}
-        </tbody>
-      </table>
-    {/strip}
-    {if $addMoreFields && !$isReserved}
-      <div class="action-link">
-        <a href="{crmURL q="reset=1&action=add&fid=$fid&sid=$sid"}" class="button"><span><div class="icon add-icon"></div> {ts 1=$fieldTitle}New Option for '%1'{/ts}</span></a>
+          </thead>
+          <tbody>
+          {foreach from=$customOption item=row}
+            <tr id="price_field_value-{$row.id}" class="crm-entity {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>
+              <td class="nowrap crm-price-option-order">{$row.weight}</td>
+              <td id="row_{$row.id}_status" class="crm-price-option-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>
+            </tr>
+          {/foreach}
+          </tbody>
+        </table>
+      {/strip}
+    </div>
+
+  {else}
+    {if $action eq 16}
+      <div class="messages status no-popup">
+        <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
+        {ts}None found.{/ts}
       </div>
     {/if}
-  </div>
-
-{else}
-  {if $action eq 16}
-    <div class="messages status no-popup">
-      <img src="{$config->resourceBase}i/Inform.gif" alt="{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', <a href='%2'>add one</a>.{/ts}
+  {/if}
+  {if $addMoreFields && !$isReserved}
+    <div class="action-link">
+      <a href="{crmURL q="reset=1&action=add&fid=$fid&sid=$sid"}" class="button"><span><div class="icon add-icon"></div> {ts 1=$fieldTitle}New Option for '%1'{/ts}</span></a>
+      <a href="{crmURL p="civicrm/admin/price/field" q="reset=1&sid=$sid"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
     </div>
   {/if}
 {/if}