CRM-13863 - Contact summary popup fixes
authorColeman Watts <coleman@civicrm.org>
Thu, 2 Jan 2014 22:13:45 +0000 (14:13 -0800)
committerColeman Watts <coleman@civicrm.org>
Mon, 6 Jan 2014 21:26:19 +0000 (13:26 -0800)
templates/CRM/Contact/Page/View/Email.tpl
templates/CRM/Contribute/Page/ContributionRecur.tpl
templates/CRM/Contribute/Page/Tab.tpl
templates/CRM/Event/Page/Tab.tpl
templates/CRM/Member/Form/Membership.tpl
templates/CRM/Member/Page/Tab.tpl
templates/CRM/Pledge/Page/Tab.tpl
templates/CRM/common/success.tpl

index 75f379155bf67ff534a9eb19ff533ae073e07858..7f6effd5c242b02e59453e1b3a10a8914be17d1d 100644 (file)
@@ -32,7 +32,7 @@
 <dt>{ts}To{/ts}</dt><dd>{$toName|escape}</dd>
 <dt>{ts}Subject{/ts}</dt><dd>{$subject}</dd>
 <dt>{ts}Message{/ts}</dt><dd>{$message}</dd>
-<dt>&nbsp;</dt><dd><input type="button" name="Done" value="Done" onclick="location.href='{crmURL p='civicrm/contact/view' q="history=1&show=1&selectedChild=activity"}';"></dd>
+<dt>&nbsp;</dt><dd><a class="button cancel form-submit" href="{crmURL p='civicrm/contact/view' q="history=1&show=1&selectedChild=activity"}">{ts}Done{/ts}</a></dd>
 </dl>
 </fieldset>
 </div>
index 298483656ff605d43350c8e9b02359d6e79bfe07..673bf3e86ae08f30eec77f46faf1c0f7ebfb620d 100644 (file)
@@ -51,7 +51,7 @@
             <tr><td class="label">{ts}Auto Renew?{/ts}</td><td>{if $recur.auto_renew}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}</td></tr>
             {if $recur.payment_processor}<tr><td class="label">{ts}Payment Processor{/ts}</td><td>{$recur.payment_processor}</td></tr>{/if}
           </table>
-          <div class="crm-submit-buttons"><input type="button" name='cancel' value="{ts}Done{/ts}" onclick="location.href='{crmURL p='civicrm/contact/view' q='action=browse&selectedChild=contribute'}';"/></div>
+          <div class="crm-submit-buttons"><a class="button cancel form-submit" href="{crmURL p='civicrm/contact/view' q='action=browse&selectedChild=contribute'}">{ts}Done{/ts}</a></div>
         </div>
     {/if}
 {/if}
index 96f8392ea9a39dcc8d53d8dddb1864f6913571db..27c32d46da29e557ab1ee8291afb639095264a2d 100644 (file)
     <div class="view-content">
         <div id="help">
             {if $permission EQ 'edit'}
-                {capture assign=newContribURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=contribution"}{/capture}
-                {ts 1=$newContribURL}Click <a href='%1'>Record Contribution (Check, Cash, EFT ...)</a> to record a new contribution received from this contact.{/ts}
+              {capture assign=newContribURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=contribution"}{/capture}
+              {capture assign=link}class="action-item action-item-first" href="{$newContribURL}"{/capture}
+              {ts 1=$link}Click <a %1>Record Contribution</a> to record a new contribution received from this contact.{/ts}
                 {if $newCredit}
-                    {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=contribution&mode=live"}{/capture}
-                    {ts 1=$newCreditURL}Click <a href='%1'>Submit Credit Card Contribution</a> to process a new contribution on behalf of the contributor using their credit card.{/ts}
+                  {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=contribution&mode=live"}{/capture}
+                  {capture assign=link}class="action-item action-item-first" href="{$newCreditURL}"{/capture}
+                  {ts 1=$link}Click <a %1>Submit Credit Card Contribution</a> to process a new contribution on behalf of the contributor using their credit card.{/ts}
                 {/if}
             {else}
                 {ts 1=$displayName}Contributions received from %1 since inception.{/ts}
index 100e32c859a391fd514df9ea2efd52e2b47bc188..9d6d8a02143bd0b49fed12379c4eb46f4f8c2d9b 100644 (file)
 
     <div id="help">
         <p>{ts 1=$displayName}This page lists all event registrations for %1 since inception.{/ts}
-        {if $permission EQ 'edit'}{ts 1=$newEventURL}Click <a accesskey="N" href='%1'>Add Event Registration</a> to register this contact for an event.{/ts}{/if}
+        {capture assign="link"}class="action-item action-item-first" href="{$newEventURL}"{/capture}
+        {if $permission EQ 'edit'}{ts 1=$link}Click <a %1>Add Event Registration</a> to register this contact for an event.{/ts}{/if}
         {if $accessContribution and $newCredit}
             {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/participant" q="reset=1&action=add&cid=`$contactId`&context=participant&mode=live"}{/capture}
-            {ts 1=$newCreditURL}Click <a href='%1'>Submit Credit Card Event Registration</a> to process a new New Registration on behalf of the participant using their credit card.{/ts}
+            {capture assign="link"}class="action-item action-item-first" href="{$newCreditURL}"{/capture}
+            {ts 1=$link}Click <a %1>Submit Credit Card Event Registration</a> to process a new New Registration on behalf of the participant using their credit card.{/ts}
         {/if}
         </p>
     </div>
index 61cf3eadfd81375efd117512e085b93ffd2ab467..fd73e63bd7bffcf2736bf1228876e7f0daeed3b6 100644 (file)
 
     {literal}
     <script type="text/javascript">
-    cj( function( ) {
+
+      function setPaymentBlock(mode, checkboxEvent) {
+        var memType = parseInt(cj('#membership_type_id_1').val( ));
+        var isPriceSet = 0;
+
+        if ( cj('#price_set_id').length > 0 && cj('#price_set_id').val() ) {
+          isPriceSet = 1;
+        }
+
+        if ( !memType || isPriceSet ) {
+          return;
+        }
+
+        var allMemberships = {/literal}{$allMembershipInfo}{literal};
+        if ( !mode ) {
+          //check the record_contribution checkbox if membership is a paid one
+          {/literal}{if $action eq 1}{literal}
+          if (!checkboxEvent) {
+            if (allMemberships[memType]['total_amount_numeric'] > 0) {
+              cj('#record_contribution').prop('checked','checked');
+              cj('#recordContribution').show();
+            }
+            else {
+              cj('#record_contribution').prop('checked', false);
+              cj('#recordContribution').hide();
+            }
+          }
+          {/literal}{/if}{literal}
+        }
+
+        // skip this for test and live modes because financial type is set automatically
+        cj("#financial_type_id").val(allMemberships[memType]['financial_type_id']);
+        var term = cj('#num_terms').val();
+        if ( term ) {
+          var feeTotal = allMemberships[memType]['total_amount_numeric'] * term;
+          cj("#total_amount").val( feeTotal.toFixed(2) );
+        }
+        else {
+          cj("#total_amount").val( allMemberships[memType]['total_amount'] );
+        }
+      }
+
+
+      cj( function( ) {
       var mode   = {/literal}'{$membershipMode}'{literal};
       if ( !mode ) {
         // Offline form (mode = false) has the record_contribution checkbox
     }
     {/literal}{/if}
 
-    {literal}
-    function setPaymentBlock(mode, checkboxEvent) {
-      var memType = parseInt(cj('#membership_type_id_1').val( ));
-      var isPriceSet = 0;
-
-      if ( cj('#price_set_id').length > 0 && cj('#price_set_id').val() ) {
-        isPriceSet = 1;
-      }
-
-      if ( !memType || isPriceSet ) {
-        return;
-      }
-
-      var allMemberships = {/literal}{$allMembershipInfo}{literal};
-      if ( !mode ) {
-        //check the record_contribution checkbox if membership is a paid one
-        {/literal}{if $action eq 1}{literal}
-          if (!checkboxEvent) {
-            if (allMemberships[memType]['total_amount_numeric'] > 0) {
-              cj('#record_contribution').prop('checked','checked');
-              cj('#recordContribution').show();
-            }
-            else {
-              cj('#record_contribution').prop('checked', false);
-              cj('#recordContribution').hide();
-            }
-          }
-        {/literal}{/if}{literal}
-      }
-
-      // skip this for test and live modes because financial type is set automatically
-      cj("#financial_type_id").val(allMemberships[memType]['financial_type_id']);
-      var term = cj('#num_terms').val();
-      if ( term ) {
-        var feeTotal = allMemberships[memType]['total_amount_numeric'] * term;
-        cj("#total_amount").val( feeTotal.toFixed(2) );
-      }
-      else {
-        cj("#total_amount").val( allMemberships[memType]['total_amount'] );
-      }
-    }
-
-    {/literal}
     {if $context eq 'standalone' and $outBound_option != 2 }
     {literal}
     cj( function( ) {
index e43974ac52c5790d0996fa09d6f01abc92521108..2b6bdd7d0a942835db78b4a590290083280db376 100644 (file)
 {elseif $action eq 32768}  {* renew *}
     {include file="CRM/Member/Form/MembershipRenewal.tpl"}
 {elseif $action eq 16} {* Browse memberships for a contact *}
-    {if $permission EQ 'edit'}{capture assign=newURL}{crmURL p="civicrm/contact/view/membership" q="reset=1&action=add&cid=`$contactId`&context=membership"}{/capture}{/if}
+    {if $permission EQ 'edit'}
+      {capture assign=newURL}{crmURL p="civicrm/contact/view/membership" q="reset=1&action=add&cid=`$contactId`&context=membership"}{/capture}{/if}
 
     {if $action ne 1 and $action ne 2 and $permission EQ 'edit'}
         <div id="help">
             {if $permission EQ 'edit'}
-                {ts 1=$newURL}Click <a href='%1'>Add Membership</a> to record a new membership.{/ts}
+              {capture assign="link"}class="action-item action-item-first" href="{$newURL}"{/capture}
+              {ts 1=$link}Click <a %1>Add Membership</a> to record a new membership.{/ts}
               {if $newCredit}
-                    {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/membership" q="reset=1&action=add&cid=`$contactId`&context=membership&mode=live"}{/capture}
-                    {ts 1=$newCreditURL}Click <a href='%1'>Submit Credit Card Membership</a> to process a Membership on behalf of the member using their credit card.{/ts}
+                {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/membership" q="reset=1&action=add&cid=`$contactId`&context=membership&mode=live"}{/capture}
+                {capture assign="link"}class="action-item action-item-first" href="{$newCreditURL}"{/capture}
+                {ts 1=$link}Click <a %1>Submit Credit Card Membership</a> to process a Membership on behalf of the member using their credit card.{/ts}
                 {/if}
             {else}
                 {ts 1=$displayName}Current and inactive memberships for %1 are listed below.{/ts}
index a6844669993afd2b370e82c84251ea3362fe56db..7eb58b67677e5fa1b7abe1ac9f20b4bac4993330 100644 (file)
@@ -32,8 +32,9 @@
 <div id="help">
     {ts 1=$displayName}Pledges received from %1 since inception.{/ts}
     {if $permission EQ 'edit'}
-     {capture assign=newContribURL}class="action-item action-item-first" href="{crmURL p="civicrm/contact/view/pledge" q="reset=1&action=add&cid=`$contactId`&context=pledge"}"{/capture}
-     {ts 1=$newContribURL}Click <a %1>Add Pledge</a> to record a new pledge received from this contact.{/ts}
+     {capture assign=newContribURL}{crmURL p="civicrm/contact/view/pledge" q="reset=1&action=add&cid=`$contactId`&context=pledge"}{/capture}
+     {capture assign=link}class="action-item action-item-first" href="{$newContribURL}"{/capture}
+     {ts 1=$link}Click <a %1>Add Pledge</a> to record a new pledge received from this contact.{/ts}
     {/if}
 </div>
 
index 61c6e216319c9d5e99116887dd65f521c246b80a..f574be3c6181b471d13b380ee567f31d08683c6f 100644 (file)
@@ -43,7 +43,7 @@
         <p>{ts}Click 'Upgrade Now' if you are ready to proceed. Otherwise click 'Cancel' to return to the CiviCRM home page.{/ts}</p>
         <input type="hidden" name="action" value="begin" />
         <input type="submit" value="{ts}Upgrade Now{/ts}" name="upgrade" onclick="return confirm('{ts escape="js"}Are you sure you are ready to upgrade now?{/ts}');" /> &nbsp;&nbsp;
-        <input type="button" value="{ts}Cancel{/ts}" onclick="window.location='{$cancelURL}';" />
+        <a class="button cancel form-submit" value="{ts}Cancel{/ts}" href="{$cancelURL}">{ts}Cancel{/ts}</a>
     </form>
   </div>