Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Commit

Permalink
Applied changes for v5.22.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Edzelopez committed Mar 5, 2020
1 parent ff0b97f commit 73a688e
Show file tree
Hide file tree
Showing 8 changed files with 713 additions and 903 deletions.
348 changes: 167 additions & 181 deletions CRM/Core/BAO/UFField.php

Large diffs are not rendered by default.

722 changes: 317 additions & 405 deletions CRM/Core/BAO/UFGroup.php

Large diffs are not rendered by default.

72 changes: 28 additions & 44 deletions CRM/Core/Controller.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
*/

Expand All @@ -38,7 +22,7 @@
* for other useful tips and suggestions
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2018
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/

require_once 'HTML/QuickForm/Controller.php';
Expand Down Expand Up @@ -82,7 +66,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
* so the display routine needs to not do any work. (The
* parent object takes care of the display)
*
* @var boolean
* @var bool
*/
protected $_embedded = FALSE;

Expand All @@ -94,22 +78,22 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
* Useful when we run form in non civicrm context
* and we need to transfer control back.(eg. drupal)
*
* @var boolean
* @var bool
*/
protected $_skipRedirection = FALSE;

/**
* Are we in print mode? if so we need to modify the display
* functionality to do a minimal display :)
*
* @var boolean
* @var bool
*/
public $_print = 0;

/**
* Should we generate a qfKey, true by default
*
* @var boolean
* @var bool
*/
public $_generateQFKey = TRUE;

Expand Down Expand Up @@ -144,7 +128,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
/**
* The destination if set will override the destination the code wants to send it to.
*
* @var string;
* @var string
*/
public $_destination = NULL;

Expand All @@ -170,6 +154,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
* Should we add a unique sequence number to the end of the key.
* @param bool $ignoreKey
* Should we not set a qfKey for this controller (for standalone forms).
*
* @throws \CRM_Core_Exception
*/
public function __construct(
$title = NULL,
Expand Down Expand Up @@ -214,10 +200,10 @@ public function __construct(
// only use the civicrm cache if we have a valid key
// else we clash with other users CRM-7059
if (!empty($this->_key)) {
CRM_Core_Session::registerAndRetrieveSessionObjects(array(
CRM_Core_Session::registerAndRetrieveSessionObjects([
"_{$name}_container",
array('CiviCRM', $this->_scope),
));
['CiviCRM', $this->_scope],
]);
}

parent::__construct($name, $modal);
Expand All @@ -239,7 +225,7 @@ public function __construct(
$this->_print = CRM_Core_Smarty::PRINT_NOFORM;
}
// Respond with JSON if in AJAX context (also support legacy value '6')
elseif (in_array($snippet, array(CRM_Core_Smarty::PRINT_JSON, 6))) {
elseif (in_array($snippet, [CRM_Core_Smarty::PRINT_JSON, 6])) {
$this->_print = CRM_Core_Smarty::PRINT_JSON;
$this->_QFResponseType = 'json';
}
Expand Down Expand Up @@ -275,12 +261,10 @@ public function __construct(
}

public function fini() {
CRM_Core_BAO_Cache::storeSessionToCache(array(
"_{$this->_name}_container",
array('CiviCRM', $this->_scope),
),
TRUE
);
CRM_Core_BAO_Cache::storeSessionToCache([
"_{$this->_name}_container",
['CiviCRM', $this->_scope],
], TRUE);
}

/**
Expand Down Expand Up @@ -382,7 +366,7 @@ public function validate() {
* @param array $uploadNames for the various upload buttons (note u can have more than 1 upload)
*/
public function addActions($uploadDirectory = NULL, $uploadNames = NULL) {
$names = array(
$names = [
'display' => 'CRM_Core_QuickForm_Action_Display',
'next' => 'CRM_Core_QuickForm_Action_Next',
'back' => 'CRM_Core_QuickForm_Action_Back',
Expand All @@ -393,7 +377,7 @@ public function addActions($uploadDirectory = NULL, $uploadNames = NULL) {
'done' => 'CRM_Core_QuickForm_Action_Done',
'jump' => 'CRM_Core_QuickForm_Action_Jump',
'submit' => 'CRM_Core_QuickForm_Action_Submit',
);
];

foreach ($names as $name => $classPath) {
$action = new $classPath($this->_stateMachine);
Expand Down Expand Up @@ -535,12 +519,12 @@ public function get($name) {
* @return array
*/
public function wizardHeader($currentPageName) {
$wizard = array();
$wizard['steps'] = array();
$wizard = [];
$wizard['steps'] = [];
$count = 0;
foreach ($this->_pages as $name => $page) {
$count++;
$wizard['steps'][] = array(
$wizard['steps'][] = [
'name' => $name,
'title' => $page->getTitle(),
//'link' => $page->getLink ( ),
Expand All @@ -549,7 +533,7 @@ public function wizardHeader($currentPageName) {
'valid' => TRUE,
'stepNumber' => $count,
'collapsed' => FALSE,
);
];

if ($name == $currentPageName) {
$wizard['currentStepNumber'] = $count;
Expand All @@ -570,7 +554,7 @@ public function wizardHeader($currentPageName) {
* @param array $wizard
*/
public function addWizardStyle(&$wizard) {
$wizard['style'] = array(
$wizard['style'] = [
'barClass' => '',
'stepPrefixCurrent' => '&raquo;',
'stepPrefixPast' => '&#x2714;',
Expand All @@ -579,7 +563,7 @@ public function addWizardStyle(&$wizard) {
'subStepPrefixPast' => '&nbsp;&nbsp;',
'subStepPrefixFuture' => '&nbsp;&nbsp;',
'showTitle' => 1,
);
];
}

/**
Expand Down
Loading

0 comments on commit 73a688e

Please sign in to comment.