<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
* Set variables up before form is built
*
* @return void
- * @access public
*/
public function preProcess() {
if (CRM_Mailing_Info::workflowEnabled() &&
//when user come from search context.
$ssID = $this->get('ssID');
- $this->assign('ssid',$ssID);
+ $this->assign('ssid', $ssID);
$this->_searchBasedMailing = CRM_Contact_Form_Search::isSearchContext($this->get('context'));
- if(CRM_Contact_Form_Search::isSearchContext($this->get('context')) && !$ssID){
+ if (CRM_Contact_Form_Search::isSearchContext($this->get('context')) && !$ssID) {
$params = array();
$result = CRM_Core_BAO_PrevNextCache::getSelectedContacts();
$this->assign("value", $result);
$this->_scheduleFormOnly = TRUE;
}
}
+
/**
* Set default values for the form.
*
- * @access public
*
* @return void
*/
- function setDefaultValues() {
+ public function setDefaultValues() {
$defaults = array();
if ($this->_scheduleFormOnly) {
$count = CRM_Mailing_BAO_Recipients::mailingSize($this->_mailingID);
else {
$count = $this->get('count');
}
- $this->assign('count', $count);
+ $this->assign('count', $count);
$defaults['now'] = 1;
return $defaults;
}
* @param
*
* @return void
- * @access public
*/
public function buildQuickform() {
$this->addDateTime('start_date', ts('Schedule Mailing'), FALSE, array('formatType' => 'mailing'));
if ($this->_scheduleFormOnly) {
$title = ts('Schedule Mailing') . ' - ' . CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing',
- $this->_mailingID,
- 'name'
- );
+ $this->_mailingID,
+ 'name'
+ );
CRM_Utils_System::setTitle($title);
$buttons = array(
- array('type' => 'next',
+ array(
+ 'type' => 'next',
'name' => ts('Submit Mailing'),
'spacing' => ' ',
'isDefault' => TRUE,
//search base mailing, we should handle it when we fix CRM-3876
if ($this->_searchBasedMailing) {
$buttons = array(
- array('type' => 'back',
- 'name' => ts('<< Previous'),
+ array(
+ 'type' => 'back',
+ 'name' => ts('Previous'),
),
array(
'type' => 'next',
}
else {
$buttons = array(
- array('type' => 'back',
- 'name' => ts('<< Previous'),
+ array(
+ 'type' => 'back',
+ 'name' => ts('Previous'),
),
array(
'type' => 'next',
$this->_scheduleFormOnly
) {
// add the preview elements
- $preview = array();
- $preview['type'] = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingID, 'body_html') ? 'html' : 'text';
+ $preview = array();
+ $preview['type'] = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing', $this->_mailingID, 'body_html') ? 'html' : 'text';
$preview['subject'] = CRM_Core_DAO::getFieldValue('CRM_Mailing_DAO_Mailing',
$this->_mailingID,
'subject'
* Warning: if you make changes here, be sure to also make them in
* Retry.php
*
- * @param array $params The form values
+ * @param array $params
+ * The form values.
*
* @param $files
* @param $self
*
- * @return boolean True if either we deliver immediately, or the
+ * @return bool
+ * True if either we deliver immediately, or the
* date is properly set.
- * @static
*/
public static function formRule($params, $files, $self) {
if (!empty($params['_qf_Schedule_submit'])) {
}
$urlParams = "force=1&reset=1&ssID={$ssID}&context={$context}";
- $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
+ $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $self);
if (CRM_Utils_Rule::qfKey($qfKey)) {
$urlParams .= "&qfKey=$qfKey";
}
CRM_Core_Session::setStatus($status, ts('Mailing Saved'), 'success');
CRM_Utils_System::redirect($url);
}
- if (isset($params['now']) || CRM_Utils_Array::value('_qf_Schedule_back', $params) == '<< Previous') {
+ if (isset($params['now']) || CRM_Utils_Array::value('_qf_Schedule_back', $params) == ts('Previous')) {
return TRUE;
}
if (CRM_Utils_Date::format(CRM_Utils_Date::processDate($params['start_date'],
- $params['start_date_time']
- )) < CRM_Utils_Date::format(date('YmdHi00'))) {
+ $params['start_date_time']
+ )) < CRM_Utils_Date::format(date('YmdHi00'))
+ ) {
return array(
'start_date' => ts('Start date cannot be earlier than the current time.'),
);
* @param
*
* @return void
- * @access public
*/
public function postProcess() {
$params = array();
$params[$parameter] = $this->controller->exportValue($this->_name, $parameter);
}
-
// Previously, we checked if $mailing->is_template, and did *not*
// schedule if it was set. Discussed with Lobo, removed that check
// as it appeared to prevent mails being scheduled if they were
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/mailing/browse/scheduled',
- 'reset=1&scheduled=true'
- ));
+ 'reset=1&scheduled=true'
+ ));
}
/**
* Display Name of the form
*
- * @access public
*
* @return string
*/
public function getTitle() {
return ts('Schedule or Send');
}
-}
+}