$this->getElement('buttons')->setElements($buttons);
if (!empty($setStatus)) {
- CRM_Core_Session::setStatus(ts("Some fields are loaded as 'readonly' as they have been set (overridden) in civicrm.settings.php."), '', 'info', array('expires' => 0));
+ CRM_Core_Session::setStatus(ts("Some fields are loaded as 'readonly' as they have been set (overridden) in civicrm.settings.php."), '', 'info', ['expires' => 0]);
}
}
else {
$session = CRM_Core_Session::singleton();
$userID = $session->get('userID');
- list($toDisplayName, $toEmail) = CRM_Contact_BAO_Contact::getContactDetails($userID);
+ [$toDisplayName, $toEmail] = CRM_Contact_BAO_Contact::getContactDetails($userID);
//get the default domain email address.CRM-4250
- list($domainEmailName, $domainEmailAddress) = CRM_Core_BAO_Domain::getNameAndEmail();
+ [$domainEmailName, $domainEmailAddress] = CRM_Core_BAO_Domain::getNameAndEmail();
- if (!$domainEmailAddress || $domainEmailAddress == 'info@EXAMPLE.ORG') {
- $fixUrl = CRM_Utils_System::url("civicrm/admin/options/from_email_address", 'action=update&reset=1');
+ if (!$domainEmailAddress || $domainEmailAddress === 'info@EXAMPLE.ORG') {
+ $fixUrl = CRM_Utils_System::url('civicrm/admin/options/from_email_address', 'action=update&reset=1');
CRM_Core_Error::statusBounce(ts('The site administrator needs to enter a valid \'FROM Email Address\' in <a href="%1">Administer CiviCRM » System Settings » Option Groups » From Email Address</a>. The email address used may need to be a valid mail account with your email service provider.', [1 => $fixUrl]));
}
if (!$toEmail) {
*
* @var array
*/
- public static $_links = NULL;
+ public static $_links;
/**
* Get BAO Name.
*/
public function &links() {
if (!(self::$_links)) {
- self::$_links = array(
- CRM_Core_Action::FOLLOWUP => array(
+ self::$_links = [
+ CRM_Core_Action::FOLLOWUP => [
'name' => ts('View Job Log'),
'url' => 'civicrm/admin/joblog',
'qs' => 'jid=%%id%%&reset=1',
'title' => ts('See log entries for this Scheduled Job'),
- ),
- CRM_Core_Action::UPDATE => array(
+ ],
+ CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
'url' => 'civicrm/admin/job',
'qs' => 'action=update&id=%%id%%&reset=1',
'title' => ts('Edit Scheduled Job'),
- ),
- CRM_Core_Action::VIEW => array(
+ ],
+ CRM_Core_Action::VIEW => [
'name' => ts('Execute Now'),
'url' => 'civicrm/admin/job',
'qs' => 'action=view&id=%%id%%&reset=1',
'title' => ts('Execute Scheduled Job Now'),
- ),
- CRM_Core_Action::DISABLE => array(
+ ],
+ CRM_Core_Action::DISABLE => [
'name' => ts('Disable'),
'ref' => 'crm-enable-disable',
'title' => ts('Disable Scheduled Job'),
- ),
- CRM_Core_Action::ENABLE => array(
+ ],
+ CRM_Core_Action::ENABLE => [
'name' => ts('Enable'),
'ref' => 'crm-enable-disable',
'title' => ts('Enable Scheduled Job'),
- ),
- CRM_Core_Action::DELETE => array(
+ ],
+ CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => 'civicrm/admin/job',
'qs' => 'action=delete&id=%%id%%',
'title' => ts('Delete Scheduled Job'),
- ),
- CRM_Core_Action::COPY => array(
+ ],
+ CRM_Core_Action::COPY => [
'name' => ts('Copy'),
'url' => 'civicrm/admin/job',
'qs' => 'action=copy&id=%%id%%',
'title' => ts('Copy Scheduled Job'),
- ),
- );
+ ],
+ ];
}
return self::$_links;
}
public function run() {
// set title and breadcrumb
CRM_Utils_System::setTitle(ts('Settings - Scheduled Jobs'));
- $breadCrumb = array(
- array(
+ $breadCrumb = [
+ [
'title' => ts('Scheduled Jobs'),
'url' => CRM_Utils_System::url('civicrm/admin',
'reset=1'
),
- ),
- );
+ ],
+ ];
CRM_Utils_System::appendBreadCrumb($breadCrumb);
$this->_id = CRM_Utils_Request::retrieve('id', 'String',
if (($this->_action & CRM_Core_Action::COPY) && (!empty($this->_id))) {
try {
- $jobResult = civicrm_api3('Job', 'clone', array('id' => $this->_id));
+ $jobResult = civicrm_api3('Job', 'clone', ['id' => $this->_id]);
if ($jobResult['count'] > 0) {
CRM_Core_Session::setStatus($jobResult['values'][$jobResult['id']]['name'], ts('Job copied successfully'), 'success');
}
public function browse() {
// check if non-prod mode is enabled.
if (CRM_Core_Config::environment() != 'Production') {
- CRM_Core_Session::setStatus(ts('Execution of scheduled jobs has been turned off by default since this is a non-production environment. You can override this for particular jobs by adding runInNonProductionEnvironment=TRUE as a parameter. This will ignore email settings for this job and will send actual emails if this job is sending mails!'), ts("Non-production Environment"), "warning", array('expires' => 0));
+ CRM_Core_Session::setStatus(ts('Execution of scheduled jobs has been turned off by default since this is a non-production environment. You can override this for particular jobs by adding runInNonProductionEnvironment=TRUE as a parameter. This will ignore email settings for this job and will send actual emails if this job is sending mails!'), ts('Non-production Environment'), 'warning', ['expires' => 0]);
}
else {
$cronError = Civi\Api4\System::check(FALSE)
CRM_Utils_System::civiExit();
}
$defaultId = NULL;
- if ($_GET['_value'] == 'select') {
+ if ($_GET['_value'] === 'select') {
$result = CRM_Contribute_PseudoConstant::financialAccount();
}
else {
CRM_Utils_System::civiExit();
}
- if ($_GET['_value'] != 'select') {
+ if ($_GET['_value'] !== 'select') {
$financialAccountType = CRM_Financial_BAO_FinancialAccount::getfinancialAccountRelations(TRUE);
$financialAccountId = CRM_Utils_Request::retrieve('_value', 'Positive');
$financialAccountTypeId = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', $financialAccountId, 'financial_account_type_id');
if (method_exists($recordBAO, $methods[$op]) & !empty($params)) {
try {
- $updated = call_user_func_array(array($recordBAO, $methods[$op]), array(&$params));
+ $updated = call_user_func_array([$recordBAO, $methods[$op]], [&$params]);
}
catch (\CRM_Core_Exception $e) {
$errorMessage = $e->getMessage();