CRM-17425 - Help improvement for Batch Entry and fix selectedChild behavior in UFGrou...
authorDave Greenberg <dave@civicrm.org>
Wed, 28 Oct 2015 22:14:59 +0000 (15:14 -0700)
committerDave Greenberg <dave@civicrm.org>
Wed, 28 Oct 2015 22:14:59 +0000 (15:14 -0700)
----------------------------------------
* CRM-17425: Allow PCP selection in contribution batch entry
  https://issues.civicrm.org/jira/browse/CRM-17425

CRM/UF/Page/Group.php
templates/CRM/Batch/Form/Entry.tpl
templates/CRM/UF/Page/Group.tpl

index d3ab1a54ca1dc9f46ac40749e955e9113f09f195..07ad421e1e1e550435f19820a280a0a295e964b7 100644 (file)
@@ -157,6 +157,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
 
     // assign vars to templates
     $this->assign('action', $action);
+    $this->assign('selectedChild', CRM_Utils_Request::retrieve('selectedChild', 'String', $this));
     $id = CRM_Utils_Request::retrieve('id', 'Positive',
       $this, FALSE, 0
     );
index bc31812ebf5a5a6cf1ac48dd185de88375e86ddc..b98970082baa972e65dc13fba8ff919671eca14a 100755 (executable)
 *}
 <div class="batch-entry form-item">
   <div class="help">
-    {ts}Click Validate & Process below when you've entered all items for the batch. You can also Save & Continue Later at any time. Go to Administer > Customize Data and Screens > Profiles > Reserved Profiles > to add, remove or change the order of columns.{/ts}
+    {ts}Click Validate & Process below when you've entered all items for the batch. You can also Save & Continue Later at any time.{/ts}
+    {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM')}
+      {capture assign=batchEntryProfileURL}{crmURL p="civicrm/admin/uf/group" q="reset=1&selectedChild=reserved-profiles"}{/capture}
+      {ts 1=$batchEntryProfileURL}Add, remove or change the order of columns by editing the reserved <a href="%1" target="_blank">Contribution Bulk Entry profile</a>. Custom fields and a Personal Campaign Page field can be added if needed.{/ts}
+    {/if}
   </div>
   {if $batchAmountMismatch}
     <div class="status message status-warning">
index 4dbadda4fdd05c855811d762cfa63624e2aa12f3..1c07ec71fcf71388dc1d30d90f73e022fb01d862 100644 (file)
@@ -59,8 +59,8 @@
     {if $rows}
     <div id='mainTabContainer'>
         <ul>
-            <li id='tab_user'>    <a href='#user-profiles'     title='{ts}User-defined Profile{/ts}'>{ts}User-defined Profiles{/ts}</a></li>
-            <li id='tab_reserved'><a href='#reserved-profiles' title='{ts}Reserved Profiles{/ts}'>{ts}Reserved Profiles{/ts}</a></li>
+            <li id='tab_user-profiles'>    <a href='#user-profiles'     title='{ts}User-defined Profile{/ts}'>{ts}User-defined Profiles{/ts}</a></li>
+            <li id='tab_reserved-profiles'><a href='#reserved-profiles' title='{ts}Reserved Profiles{/ts}'>{ts}Reserved Profiles{/ts}</a></li>
         </ul>
 
         {* handle enable/disable actions*}
 
   </div> {* maincontainer*}
   <script type='text/javascript'>
-      CRM.$(function($) {ldelim}
-        var selectedTab = '{if $selectedChild}{$selectedChild}{else}user-profiles{/if}';
-        var tabIndex = $('#tab_' + selectedTab).prevAll().length;
-        {literal}
+    var selectedTab = 'user-profiles';
+    {if $selectedChild}selectedTab = '{$selectedChild}';{/if}
+    {literal}
+      CRM.$(function($) {
+        var tabIndex = $('#tab_' + selectedTab).prevAll().length
         $("#mainTabContainer").tabs( {active: tabIndex} );
       });
     {/literal}