<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC https://civicrm.org/licensing
*/
/**
*
* @var array
*/
- protected $_locationDefaults = array();
+ protected $_locationDefaults = [];
/**
* How many locationBlocks should we display?
*
*/
public function setDefaultValues() {
- $defaults = array();
- $params = array();
+ $defaults = [];
+ $params = [];
if (isset($this->_id)) {
$params['id'] = $this->_id;
$this->_contactId = $domainDefaults['contact_id'];
unset($params['id']);
- $locParams = array('contact_id' => $domainDefaults['contact_id']);
+ $locParams = ['contact_id' => $domainDefaults['contact_id']];
$this->_locationDefaults = $defaults = CRM_Core_BAO_Location::getValues($locParams);
$config = CRM_Core_Config::singleton();
* Build the form object.
*/
public function buildQuickForm() {
- $this->addField('name', array('label' => ts('Organization Name')), TRUE);
- $this->addField('description', array('label' => ts('Description'), 'size' => 30));
+ $this->addField('name', ['label' => ts('Organization Name')], TRUE);
+ $this->addField('description', ['label' => ts('Description'), 'size' => 30]);
//build location blocks.
CRM_Contact_Form_Location::buildQuickForm($this);
- $this->addButtons(array(
- array(
+ $this->addButtons([
+ [
'type' => 'next',
'name' => ts('Save'),
'subName' => 'view',
'isDefault' => TRUE,
- ),
- array(
+ ],
+ [
'type' => 'cancel',
'name' => ts('Cancel'),
- ),
- ));
+ ],
+ ]);
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();
* Add local and global form rules.
*/
public function addRules() {
- $this->addFormRule(array('CRM_Contact_Form_Domain', 'formRule'));
+ $this->addFormRule(['CRM_Contact_Form_Domain', 'formRule']);
}
/**
// $errors === TRUE means no errors from above formRule excution,
// so declaring $errors to array for further processing
if ($errors === TRUE) {
- $errors = array();
+ $errors = [];
}
if ($fields['name'] == 'Default Domain Name') {
$params['email'][1]['location_type_id'] = $defaultLocationType->id;
}
- $params += array('contact_id' => $this->_contactId);
- $contactParams = array(
+ $params += ['contact_id' => $this->_contactId];
+ $contactParams = [
'sort_name' => $domain->name,
'display_name' => $domain->name,
'legal_name' => $domain->name,
'organization_name' => $domain->name,
'contact_id' => $this->_contactId,
'contact_type' => 'Organization',
- );
+ ];
if ($this->_contactId) {
$contactParams['contact_sub_type'] = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId);
CRM_Core_BAO_Domain::edit($params, $this->_id);
- CRM_Core_Session::setStatus(ts("Domain information for '%1' has been saved.", array(1 => $domain->name)), ts('Saved'), 'success');
+ CRM_Core_Session::setStatus(ts("Domain information for '%1' has been saved.", [1 => $domain->name]), ts('Saved'), 'success');
$session = CRM_Core_Session::singleton();
$session->replaceUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
}