From a7f41fd04c3fa11ca3f62c721724055655c3011d Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Fri, 24 Jul 2020 17:18:36 +0530 Subject: [PATCH] Add configure icons on public pages --- CRM/Event/Form/Registration/Register.php | 1 + CRM/Price/BAO/PriceSet.php | 1 + templates/CRM/Contribute/Form/Contribution/Main.tpl | 5 +++++ templates/CRM/Event/Form/Registration/Register.tpl | 5 +++++ templates/CRM/Price/Form/PriceSet.tpl | 8 ++++++++ 5 files changed, 20 insertions(+) diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 80e3f7c72f..1504cc5e7d 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -629,6 +629,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } } } + $form->_priceSet['id'] = $form->_priceSet['id'] ?? $form->_priceSetId; $form->assign('priceSet', $form->_priceSet); } else { diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 2ed80ff8eb..bc87b6e9fe 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -860,6 +860,7 @@ WHERE id = %1"; } } } + $form->_priceSet['id'] = $form->_priceSet['id'] ?? $priceSetId; $form->assign('priceSet', $form->_priceSet); $component = 'contribution'; diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index c56308b119..c9f9e671d2 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -56,6 +56,11 @@ {/if} + {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') } + {capture assign="configureURL"}{crmURL p="civicrm/admin/contribute/settings" q="reset=1&action=update&id=`$contributionPageID`"}{/capture} + {ts 1=$configureURL} Configure{/ts} +
+ {/if} {include file="CRM/common/TrackingFields.tpl"}
diff --git a/templates/CRM/Event/Form/Registration/Register.tpl b/templates/CRM/Event/Form/Registration/Register.tpl index 59fd872132..a686920a78 100644 --- a/templates/CRM/Event/Form/Registration/Register.tpl +++ b/templates/CRM/Event/Form/Registration/Register.tpl @@ -7,6 +7,11 @@ | and copyright information, see https://civicrm.org/licensing | +--------------------------------------------------------------------+ *} +{if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') } + {capture assign="configureURL"}{crmURL p="civicrm/event/manage/settings" q="reset=1&action=update&id=`$event.id`"}{/capture} + {ts 1=$configureURL} Configure{/ts} +
+{/if} {* Callback snippet: Load payment processor *} {if $action & 1024} {include file="CRM/Event/Form/Registration/PreviewHeader.tpl"} diff --git a/templates/CRM/Price/Form/PriceSet.tpl b/templates/CRM/Price/Form/PriceSet.tpl index e41bdb7b1e..aef67b9010 100644 --- a/templates/CRM/Price/Form/PriceSet.tpl +++ b/templates/CRM/Price/Form/PriceSet.tpl @@ -16,6 +16,14 @@ {assign var='adminFld' value=false} {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') } {assign var='adminFld' value=true} + {if $priceSet.id && !$priceSet.is_quick_config} + {capture assign="priceSetURL"}{crmURL p="civicrm/admin/price/field" q="reset=1&action=browse&sid=`$priceSet.id`"}{/capture} +
+ {ts 1=$priceSetURL} + + {/ts} +
+ {/if} {/if} {foreach from=$priceSet.fields item=element key=field_id} -- 2.25.1