projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CRM-19723 - CaseType Config UI improvements: icons, popups, labels
[civicrm-core.git]
/
CRM
/
Admin
/
Form.php
diff --git
a/CRM/Admin/Form.php
b/CRM/Admin/Form.php
index ea32fd3169d923d1b33f8387e4c8b6b4fc6456b4..cc3186887fcc6cf3cce791421ca49978d3b14808 100644
(file)
--- a/
CRM/Admin/Form.php
+++ b/
CRM/Admin/Form.php
@@
-3,7
+3,7
@@
+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
5
|
+ | Copyright CiviCRM LLC (c) 2004-201
7
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-28,7
+28,7
@@
/**
*
* @package CRM
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-201
5
+ * @copyright CiviCRM LLC (c) 2004-201
7
*/
/**
*/
/**
@@
-69,6
+69,7
@@
class CRM_Admin_Form extends CRM_Core_Form {
*/
public function preProcess() {
Civi::resources()->addStyleFile('civicrm', 'css/admin.css');
*/
public function preProcess() {
Civi::resources()->addStyleFile('civicrm', 'css/admin.css');
+ Civi::resources()->addScriptFile('civicrm', 'js/crm.admin.js');
$this->_id = $this->get('id');
$this->_BAOName = $this->get('BAOName');
$this->_id = $this->get('id');
$this->_BAOName = $this->get('BAOName');
@@
-89,6
+90,7
@@
class CRM_Admin_Form extends CRM_Core_Form {
* @return array
*/
public function setDefaultValues() {
* @return array
*/
public function setDefaultValues() {
+ // Fetch defaults from the db
if (isset($this->_id) && empty($this->_values)) {
$this->_values = array();
$params = array('id' => $this->_id);
if (isset($this->_id) && empty($this->_values)) {
$this->_values = array();
$params = array('id' => $this->_id);
@@
-97,6
+99,15
@@
class CRM_Admin_Form extends CRM_Core_Form {
}
$defaults = $this->_values;
}
$defaults = $this->_values;
+ // Allow defaults to be set from the url
+ if (empty($this->_id) && $this->_action & CRM_Core_Action::ADD) {
+ foreach ($_GET as $key => $val) {
+ if ($this->elementExists($key)) {
+ $defaults[$key] = $val;
+ }
+ }
+ }
+
if ($this->_action == CRM_Core_Action::DELETE &&
isset($defaults['name'])
) {
if ($this->_action == CRM_Core_Action::DELETE &&
isset($defaults['name'])
) {