<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
| Copyright (C) 2011 Marty Wright |
| Licensed to CiviCRM under the Academic Free License version 3.0. |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
}
//get the frequency units.
- $this->_freqUnits = array('hour' => 'hour') + CRM_Core_OptionGroup::values('recur_frequency_units');
+ $this->_freqUnits = CRM_Core_SelectValues::getScheduleReminderFrequencyUnits();
//pass the mapping ID in UPDATE mode
$mappings = CRM_Core_BAO_ActionSchedule::getMapping($mappingID);
$recipientListing->setMultiple(TRUE);
$this->add('hidden', 'is_recipient_listing', empty($recipientListingOptions) ? FALSE : TRUE, array('id' => 'is_recipient_listing'));
- //auto-complete url
- $dataUrl = CRM_Utils_System::url('civicrm/ajax/rest',
- 'className=CRM_Contact_Page_AJAX&fnName=getContactList&json=1&context=activity&reset=1',
- FALSE, NULL, FALSE
- );
-
- $this->assign('dataUrl', $dataUrl);
- //token input url
- $tokenUrl = CRM_Utils_System::url('civicrm/ajax/checkemail',
- 'noemail=1',
- FALSE, NULL, FALSE
- );
- $this->assign('tokenUrl', $tokenUrl);
- $this->add('text', 'recipient_manual_id', ts('Manual Recipients'));
+ $this->addEntityRef('recipient_manual_id', ts('Manual Recipients'), array('multiple' => TRUE, 'create' => TRUE));
$this->addElement(
'select',
}
if (!CRM_Utils_System::isNull($fields['absolute_date'])) {
- if (CRM_Utils_Date::format(CRM_Utils_Date::processDate($fields['absolute_date'], NULL)) < CRM_Utils_Date::format(date('YmdHi00'))) {
+ if (CRM_Utils_Date::format(CRM_Utils_Date::processDate($fields['absolute_date'], NULL)) < CRM_Utils_Date::format(date('Ymd'))) {
$errors['absolute_date'] = ts('Absolute date cannot be earlier than the current time.');
}
}
}
elseif (!empty($defaults['recipient_manual'])) {
$defaults['recipient'] = 'manual';
- $recipients = array();
- foreach (explode(',', $defaults['recipient_manual']) as $cid) {
- $recipients[$cid] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
- $cid,
- 'sort_name'
- );
- }
- $this->assign('recipients', $recipients);
+ $defaults['recipient_manual_id'] = $defaults['recipient_manual'];
}
}