From: unknown Date: Fri, 10 Oct 2014 14:35:14 +0000 (+0100) Subject: show dialog for Recurring Entity - Centralised X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6266861ed94d93e5debb79c50bee7af0cb9c1a17;p=civicrm-core.git show dialog for Recurring Entity - Centralised --- diff --git a/CRM/Core/Form/RecurringEntity.php b/CRM/Core/Form/RecurringEntity.php index e59f77dc81..30a1cd45fd 100644 --- a/CRM/Core/Form/RecurringEntity.php +++ b/CRM/Core/Form/RecurringEntity.php @@ -68,12 +68,18 @@ class CRM_Core_Form_RecurringEntity { */ public static $_entityType; + /** + * Checks current entityID has parent + */ + public static $_hasParent = FALSE; + static function preProcess($entityType) { self::$_entityId = (int) CRM_Utils_Request::retrieve('id', 'Positive'); self::$_entityType = $entityType; if (self::$_entityId && $entityType) { $checkParentExistsForThisId = CRM_Core_BAO_RecurringEntity::getParentFor(self::$_entityId, 'civicrm_'.$entityType); if ($checkParentExistsForThisId) { + self::$_hasParent = TRUE; self::$_parentEntityId = $checkParentExistsForThisId; self::$_scheduleReminderDetails = CRM_Core_BAO_RecurringEntity::getReminderDetailsByEntityId($checkParentExistsForThisId, $entityType); } @@ -90,7 +96,7 @@ class CRM_Core_Form_RecurringEntity { $excludeOptionValues[$val['value']] = date('m/d/Y', strtotime($val['value'])); } self::$_excludeDateInfo = $excludeOptionValues; - } + } } /** @@ -140,6 +146,7 @@ class CRM_Core_Form_RecurringEntity { $form->assign('currentEntityId', self::$_entityId); $form->assign('entityType', self::$_entityType); $form->assign('scheduleReminderId', self::$_scheduleReminderID); + $form->assign('hasParent', self::$_hasParent); $form->_freqUnits = array('hour' => 'hour') + CRM_Core_OptionGroup::values('recur_frequency_units'); foreach ($form->_freqUnits as $val => $label) { diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index 76c60bf161..4961b9e99b 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -190,8 +190,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { //Is a repeating event if ($this->_isRepeatingEvent) { - $isRepeat = 'repeat'; - $this->assign('isRepeat', $isRepeat); + $isRepeatingEntity = TRUE; + $this->assign('isRepeatingEntity', $isRepeatingEntity); } // also set up tabs diff --git a/templates/CRM/Core/Form/RecurringEntity.tpl b/templates/CRM/Core/Form/RecurringEntity.tpl index 81977b966e..e02f78b58c 100644 --- a/templates/CRM/Core/Form/RecurringEntity.tpl +++ b/templates/CRM/Core/Form/RecurringEntity.tpl @@ -89,8 +89,7 @@
-
- +
{literal} - {/literal} \ No newline at end of file +{/literal} +{/if} \ No newline at end of file