diff --git a/civicrm/CRM/Activity/DAO/ActivityAssignment.php b/civicrm/CRM/Activity/DAO/ActivityAssignment.php deleted file mode 100644 index 088104798c851eb439fec03d86017816dbdbd1d7..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Activity/DAO/ActivityAssignment.php +++ /dev/null @@ -1,231 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Activity_DAO_ActivityAssignment extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_activity_assignment'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = true; - /** - * Activity assignment id - * - * @var int unsigned - */ - public $id; - /** - * Foreign key to the activity for this assignment. - * - * @var int unsigned - */ - public $activity_id; - /** - * Foreign key to the contact for this assignment. - * - * @var int unsigned - */ - public $assignee_contact_id; - /** - * class constructor - * - * @access public - * @return civicrm_activity_assignment - */ - function __construct() - { - $this->__table = 'civicrm_activity_assignment'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'activity_id' => 'civicrm_activity:id', - 'assignee_contact_id' => 'civicrm_contact:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Activity Assignment ID') , - 'required' => true, - ) , - 'activity_id' => array( - 'name' => 'activity_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Activity ID') , - 'required' => true, - 'FKClassName' => 'CRM_Activity_DAO_Activity', - ) , - 'assignee_contact_id' => array( - 'name' => 'assignee_contact_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Assignee Contact ID') , - 'required' => true, - 'FKClassName' => 'CRM_Contact_DAO_Contact', - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return self::$_tableName; - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['activity_assignment'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['activity_assignment'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } -} diff --git a/civicrm/CRM/Activity/DAO/ActivityTarget.php b/civicrm/CRM/Activity/DAO/ActivityTarget.php deleted file mode 100644 index a3309367a6b0be62770c3a510a4d89ccbd51efa2..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Activity/DAO/ActivityTarget.php +++ /dev/null @@ -1,236 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Activity_DAO_ActivityTarget extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_activity_target'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = true; - /** - * Activity target id - * - * @var int unsigned - */ - public $id; - /** - * Foreign key to the activity for this target. - * - * @var int unsigned - */ - public $activity_id; - /** - * Foreign key to the contact for this target. - * - * @var int unsigned - */ - public $target_contact_id; - /** - * class constructor - * - * @access public - * @return civicrm_activity_target - */ - function __construct() - { - $this->__table = 'civicrm_activity_target'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'activity_id' => 'civicrm_activity:id', - 'target_contact_id' => 'civicrm_contact:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Activity Target ID') , - 'required' => true, - ) , - 'activity_id' => array( - 'name' => 'activity_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Activity ID') , - 'required' => true, - 'FKClassName' => 'CRM_Activity_DAO_Activity', - ) , - 'target_contact_id' => array( - 'name' => 'target_contact_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Contact ID (match to contact)') , - 'required' => true, - 'import' => true, - 'where' => 'civicrm_activity_target.target_contact_id', - 'headerPattern' => '', - 'dataPattern' => '', - 'export' => true, - 'FKClassName' => 'CRM_Contact_DAO_Contact', - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return self::$_tableName; - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['activity_target'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['activity_target'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } -} diff --git a/civicrm/CRM/Admin/Form/Navigation.php b/civicrm/CRM/Admin/Form/Navigation.php index 318e5bfa8424001d3e1a6923a823d04a6a2826e9..5f631f62e12a40dfe4b11e8594e40e2c71f6dee5 100644 --- a/civicrm/CRM/Admin/Form/Navigation.php +++ b/civicrm/CRM/Admin/Form/Navigation.php @@ -47,6 +47,8 @@ class CRM_Admin_Form_Navigation extends CRM_Admin_Form { public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('Menu Item')); + if ($this->_action & CRM_Core_Action::DELETE) { return; } @@ -65,27 +67,22 @@ class CRM_Admin_Form_Navigation extends CRM_Admin_Form { ); $this->add('text', 'url', ts('Url'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Navigation', 'url')); - $permissions = CRM_Core_Permission::basicPermissions(TRUE); - $include = &$this->addElement('advmultiselect', 'permission', - ts('Permission') . ' ', $permissions, - array( - 'size' => 5, - 'style' => 'width:auto', - 'class' => 'advmultiselect', - ) + $permissions = array(); + foreach (CRM_Core_Permission::basicPermissions(TRUE, TRUE) as $id => $vals) { + $permissions[] = array('id' => $id, 'label' => $vals[0], 'description' => (array) CRM_Utils_Array::value(1, $vals)); + } + $this->add('text', 'permission', ts('Permission'), + array('placeholder' => ts('Unrestricted'), 'class' => 'huge', 'data-select-params' => json_encode(array('data' => $permissions))) ); - $include->setButtonAttributes('add', array('value' => ts('Add >>'))); - $include->setButtonAttributes('remove', array('value' => ts('<< Remove'))); - - $operators = array('AND' => 'AND', 'OR' => 'OR'); - $this->add('select', 'permission_operator', ts('Operator'), $operators); + $operators = array('AND' => ts('AND'), 'OR' => ts('OR')); + $this->add('select', 'permission_operator', NULL, $operators); //make separator location configurable - $separator = array(0 => 'None', 1 => 'After Menu Element', 2 => 'Before Menu Element'); - $this->add('select', 'has_separator', ts('Separator?'), $separator); + $separator = array(ts('None'), ts('After menu element'), ts('Before menu element')); + $this->add('select', 'has_separator', ts('Separator'), $separator); - $active = $this->add('checkbox', 'is_active', ts('Enabled?')); + $active = $this->add('advcheckbox', 'is_active', ts('Enabled')); if (CRM_Utils_Array::value('name', $this->_defaults) == 'Home') { $active->freeze(); @@ -101,7 +98,7 @@ class CRM_Admin_Form_Navigation extends CRM_Admin_Form { $homeMenuId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Home', 'id', 'name'); unset($parentMenu[$homeMenuId]); - $parent = $this->add('select', 'parent_id', ts('Parent'), array('' => ts('- select -')) + $parentMenu); + $this->add('select', 'parent_id', ts('Parent'), array('' => ts('Top level')) + $parentMenu, FALSE, array('class' => 'crm-select2')); } } @@ -111,12 +108,6 @@ class CRM_Admin_Form_Navigation extends CRM_Admin_Form { public function setDefaultValues() { $defaults = $this->_defaults; if (isset($this->_id)) { - if (!empty($this->_defaults['permission'])) { - foreach (explode(',', $this->_defaults['permission']) as $value) { - $components[$value] = $value; - } - $defaults['permission'] = $components; - } //Take parent id in object variable to calculate the menu //weight if menu parent id changed $this->_currentParentID = CRM_Utils_Array::value('parent_id', $this->_defaults); diff --git a/civicrm/CRM/Admin/Form/Setting/Component.php b/civicrm/CRM/Admin/Form/Setting/Component.php index cdcf59be823fda913654ae2b7c452f4a225021d9..092a86c523410c26c2d32c4bd6bf56bb5538022f 100644 --- a/civicrm/CRM/Admin/Form/Setting/Component.php +++ b/civicrm/CRM/Admin/Form/Setting/Component.php @@ -119,11 +119,9 @@ class CRM_Admin_Form_Setting_Component extends CRM_Admin_Form_Setting { * @param string $fileName * @param bool $lineMode */ - public static function loadCaseSampleData($dsn, $fileName, $lineMode = FALSE) { - $db = &DB::connect($dsn); - if (PEAR::isError($db)) { - die("Cannot open $dsn: " . $db->getMessage()); - } + public static function loadCaseSampleData($fileName, $lineMode = FALSE) { + $dao = new CRM_Core_DAO(); + $db = $dao->getDatabaseConnection(); $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); diff --git a/civicrm/CRM/Admin/Page/CKEditorConfig.php b/civicrm/CRM/Admin/Page/CKEditorConfig.php index 138566f33d9462f3562aad676bc7e34a8895201d..572f41476f2380ea5ff6e6b1baa69db84fe2942e 100644 --- a/civicrm/CRM/Admin/Page/CKEditorConfig.php +++ b/civicrm/CRM/Admin/Page/CKEditorConfig.php @@ -67,7 +67,7 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page { } CRM_Core_Resources::singleton() - ->addScriptFile('civicrm', 'bower_components/ckeditor/ckeditor.js', 0, 'html-header') + ->addScriptFile('civicrm', 'bower_components/ckeditor/ckeditor.js', 0, 'page-header') ->addScriptFile('civicrm', 'bower_components/ckeditor/samples/toolbarconfigurator/js/fulltoolbareditor.js', 1) ->addScriptFile('civicrm', 'bower_components/ckeditor/samples/toolbarconfigurator/js/abstracttoolbarmodifier.js', 2) ->addScriptFile('civicrm', 'bower_components/ckeditor/samples/toolbarconfigurator/js/toolbarmodifier.js', 3) diff --git a/civicrm/CRM/Case/Info.php b/civicrm/CRM/Case/Info.php index 6117e85a187f266eb981877005b5c016bd230d3c..89669c2cb6d191d0d4e45af5695eafec09a6a92f 100644 --- a/civicrm/CRM/Case/Info.php +++ b/civicrm/CRM/Case/Info.php @@ -249,8 +249,7 @@ class CRM_Case_Info extends CRM_Core_Component_Info { (!$oldValue || !in_array('CiviCase', $oldValue)) ) { $pathToCaseSampleTpl = __DIR__ . '/xml/configuration.sample/'; - $config = CRM_Core_Config::singleton(); - CRM_Admin_Form_Setting_Component::loadCaseSampleData($config->dsn, $pathToCaseSampleTpl . 'case_sample.mysql.tpl'); + CRM_Admin_Form_Setting_Component::loadCaseSampleData($pathToCaseSampleTpl . 'case_sample.mysql.tpl'); if (!CRM_Case_BAO_Case::createCaseViews()) { $msg = ts("Could not create the MySQL views for CiviCase. Your mysql user needs to have the 'CREATE VIEW' permission"); CRM_Core_Error::fatal($msg); diff --git a/civicrm/CRM/Contribute/BAO/Contribution.php b/civicrm/CRM/Contribute/BAO/Contribution.php index 27e8e9b9b4ba83af7b396b9cb4d7df979c9b44f0..e49d8a7b87b849940a7ca27306f52fcbd4b4a7e3 100644 --- a/civicrm/CRM/Contribute/BAO/Contribution.php +++ b/civicrm/CRM/Contribute/BAO/Contribution.php @@ -3411,21 +3411,12 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $params['trxnParams']['payment_instrument_id'] = $params['contribution']->payment_instrument_id; } } - $trxn = CRM_Core_BAO_FinancialTrxn::create($params['trxnParams']); - $params['entity_id'] = $trxn->id; if ($context == 'changedStatus') { if (($params['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatus) || $params['prevContribution']->contribution_status_id == array_search('In Progress', $contributionStatus)) && ($params['contribution']->contribution_status_id == array_search('Completed', $contributionStatus)) ) { - $query = "UPDATE civicrm_financial_item SET status_id = %1 WHERE entity_id = %2 and entity_table = 'civicrm_line_item'"; - $sql = "SELECT id, amount FROM civicrm_financial_item WHERE entity_id = %1 and entity_table = 'civicrm_line_item'"; - - $entityParams = array( - 'entity_table' => 'civicrm_financial_item', - 'financial_trxn_id' => $trxn->id, - ); if (empty($params['line_item'])) { //CRM-15296 //@todo - check with Joe regarding this situation - payment processors create pending transactions with no line items @@ -3433,6 +3424,15 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac // & this can be removed return; } + $trxn = CRM_Core_BAO_FinancialTrxn::create($params['trxnParams']); + $params['entity_id'] = $trxn->id; + $query = "UPDATE civicrm_financial_item SET status_id = %1 WHERE entity_id = %2 and entity_table = 'civicrm_line_item'"; + $sql = "SELECT id, amount FROM civicrm_financial_item WHERE entity_id = %1 and entity_table = 'civicrm_line_item'"; + + $entityParams = array( + 'entity_table' => 'civicrm_financial_item', + 'financial_trxn_id' => $trxn->id, + ); foreach ($params['line_item'] as $fieldId => $fields) { foreach ($fields as $fieldValueId => $fieldValues) { $fparams = array( @@ -3454,6 +3454,9 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac return; } } + + $trxn = CRM_Core_BAO_FinancialTrxn::create($params['trxnParams']); + $params['entity_id'] = $trxn->id; if ($context != 'changePaymentInstrument') { $itemParams['entity_table'] = 'civicrm_line_item'; $trxnIds['id'] = $params['entity_id']; @@ -4487,10 +4490,6 @@ LIMIT 1;"; if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && $input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) { $input['payment_processor'] = $paymentProcessorId; } - $input['contribution_status_id'] = $contributionStatuses['Completed']; - $input['total_amount'] = $input['amount']; - $input['contribution'] = $contribution; - $input['financial_type_id'] = $contribution->financial_type_id; if (!empty($contribution->_relatedObjects['participant'])) { $input['contribution_mode'] = 'participant'; @@ -4500,7 +4499,14 @@ LIMIT 1;"; elseif (!empty($contribution->_relatedObjects['membership'])) { $input['skipLineItem'] = TRUE; $input['contribution_mode'] = 'membership'; + $contribution->contribution_status_id = $contributionStatuses['Completed']; + $contribution->trxn_id = CRM_Utils_Array::value('trxn_id', $input); + $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date); } + $input['contribution_status_id'] = $contributionStatuses['Completed']; + $input['total_amount'] = $input['amount']; + $input['contribution'] = $contribution; + $input['financial_type_id'] = $contribution->financial_type_id; //@todo writing a unit test I was unable to create a scenario where this line did not fatal on second // and subsequent payments. In this case the line items are created at // CRM_Contribute_BAO_ContributionRecur::addRecurLineItems @@ -4750,8 +4756,8 @@ LIMIT 1;"; */ public static function addPayments($lineItems, $contributions) { // get financial trxn which is a payment - $ftSql = "SELECT ft.id - FROM civicrm_financial_trxn ft + $ftSql = "SELECT ft.id + FROM civicrm_financial_trxn ft INNER JOIN civicrm_entity_financial_trxn eft ON eft.financial_trxn_id = ft.id AND eft.entity_table = 'civicrm_contribution' WHERE eft.entity_id = %1 AND ft.is_payment = 1"; $sql = "SELECT fi.id, li.price_field_value_id @@ -4823,4 +4829,30 @@ LIMIT 1;"; } } + /** + * Function to check line items + * + * @param array $params + * array of order params. + * + */ + public static function checkLineItems(&$params) { + $totalAmount = CRM_Utils_Array::value('total_amount', $params); + $lineItemAmount = 0; + foreach ($params['line_items'] as &$lineItems) { + foreach ($lineItems['line_item'] as &$item) { + if (empty($item['financial_type_id'])) { + $item['financial_type_id'] = $params['financial_type_id']; + } + $lineItemAmount += $item['line_total']; + } + } + if (!isset($totalAmount)) { + $params['total_amount'] = $lineItemAmount; + } + elseif ($totalAmount != $lineItemAmount) { + throw new API_Exception("Line item total doesn't match with total amount."); + } + } + } diff --git a/civicrm/CRM/Core/BAO/SchemaHandler.php b/civicrm/CRM/Core/BAO/SchemaHandler.php index f27648762a335623d55742e6f901c7a14dae1d71..a92572c03a7fbe530f5d3aa92367354e37b4d723 100644 --- a/civicrm/CRM/Core/BAO/SchemaHandler.php +++ b/civicrm/CRM/Core/BAO/SchemaHandler.php @@ -373,7 +373,7 @@ ALTER TABLE {$tableName} */ public static function dropColumn($tableName, $columnName) { $sql = "ALTER TABLE $tableName DROP COLUMN $columnName"; - $dao = CRM_Core_DAO::executeQuery($sql); + CRM_Core_DAO::executeQuery($sql); } /** @@ -395,13 +395,28 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )"; } /** + * Create indexes. + * * @param $tables + * Tables to create index for in the format: + * array('civicrm_entity_table' => 'entity_id') + * OR + * array('civicrm_entity_table' => array('entity_id', 'entity_table')) + * The latter will create a combined index on the 2 keys (in order). + * + * Side note - when creating combined indexes the one with the most variation + * goes first - so entity_table always goes after entity_id. + * + * It probably makes sense to consider more sophisticated options at some point + * but at the moment this is only being as enhanced as fast as the test is. + * + * @todo add support for length & multilingual on combined keys. + * * @param string $createIndexPrefix * @param array $substrLenghts */ - public static function createIndexes(&$tables, $createIndexPrefix = 'index', $substrLenghts = array()) { + public static function createIndexes($tables, $createIndexPrefix = 'index', $substrLenghts = array()) { $queries = array(); - require_once 'CRM/Core/DAO/Domain.php'; $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales); @@ -423,16 +438,26 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )"; // now check for all fields if the index exists foreach ($fields as $field) { - // handle indices over substrings, CRM-6245 - // $lengthName is appended to index name, $lengthSize is the field size modifier - $lengthName = isset($substrLenghts[$table][$field]) ? "_{$substrLenghts[$table][$field]}" : ''; - $lengthSize = isset($substrLenghts[$table][$field]) ? "({$substrLenghts[$table][$field]})" : ''; + $fieldName = implode('_', (array) $field); + + if (is_array($field)) { + // No support for these for combined indexes as yet - add a test when you + // want to add that. + $lengthName = ''; + $lengthSize = ''; + } + else { + // handle indices over substrings, CRM-6245 + // $lengthName is appended to index name, $lengthSize is the field size modifier + $lengthName = isset($substrLenghts[$table][$fieldName]) ? "_{$substrLenghts[$table][$fieldName]})" : ''; + $lengthSize = isset($substrLenghts[$table][$fieldName]) ? "({$substrLenghts[$table][$fieldName]})" : ''; + } $names = array( - "index_{$field}{$lengthName}", - "FK_{$table}_{$field}{$lengthName}", - "UI_{$field}{$lengthName}", - "{$createIndexPrefix}_{$field}{$lengthName}", + "index_{$fieldName}{$lengthName}", + "FK_{$table}_{$fieldName}{$lengthName}", + "UI_{$fieldName}{$lengthName}", + "{$createIndexPrefix}_{$fieldName}{$lengthName}", ); // skip to the next $field if one of the above $names exists; handle multilingual for CRM-4126 @@ -445,13 +470,16 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )"; // the index doesn't exist, so create it // if we're multilingual and the field is internationalised, do it for every locale - if (!CRM_Utils_System::isNull($locales) and isset($columns[$table][$field])) { + // @todo remove is_array check & add multilingual support for combined indexes and add a test. + // Note combined indexes currently using this function are on fields like + // entity_id + entity_table which are not multilingual. + if (!is_array($field) && !CRM_Utils_System::isNull($locales) and isset($columns[$table][$fieldName])) { foreach ($locales as $locale) { - $queries[] = "CREATE INDEX {$createIndexPrefix}_{$field}{$lengthName}_{$locale} ON {$table} ({$field}_{$locale}{$lengthSize})"; + $queries[] = "CREATE INDEX {$createIndexPrefix}_{$fieldName}{$lengthName}_{$locale} ON {$table} ({$fieldName}_{$locale}{$lengthSize})"; } } else { - $queries[] = "CREATE INDEX {$createIndexPrefix}_{$field}{$lengthName} ON {$table} ({$field}{$lengthSize})"; + $queries[] = "CREATE INDEX {$createIndexPrefix}_{$fieldName}{$lengthName} ON {$table} (" . implode(',', (array) $field) . "{$lengthSize})"; } } } @@ -463,6 +491,18 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )"; } } + /** + * Drop an index if one by that name exists. + * + * @param string $tableName + * @param string $indexName + */ + public static function dropIndexIfExists($tableName, $indexName) { + if (self::checkIfIndexExists($tableName, $indexName)) { + CRM_Core_DAO::executeQuery("DROP INDEX $indexName ON $tableName"); + } + } + /** * @param int $customFieldID * @param string $tableName @@ -520,4 +560,23 @@ MODIFY {$columnName} varchar( $length ) } } + /** + * Check if the table has an index matching the name. + * + * @param string $tableName + * @param array $indexName + * + * @return \CRM_Core_DAO|object + */ + public static function checkIfIndexExists($tableName, $indexName) { + $result = CRM_Core_DAO::executeQuery( + "SHOW INDEX FROM $tableName WHERE key_name = %1 AND seq_in_index = 1", + array(1 => array($indexName, 'String')) + ); + if ($result->fetch()) { + return TRUE; + } + return FALSE; + } + } diff --git a/civicrm/CRM/Core/ClassLoader.php b/civicrm/CRM/Core/ClassLoader.php index 3002716fbebc5b91ece2b7633292f359acaed8d2..c32ef990009c0ad34b9e27b7f2dd4af59e461ffe 100644 --- a/civicrm/CRM/Core/ClassLoader.php +++ b/civicrm/CRM/Core/ClassLoader.php @@ -42,6 +42,14 @@ class CRM_Core_ClassLoader { */ private static $_singleton = NULL; + /** + * The classes in CiviTest have ucky, non-standard naming. + * + * @var array + * Array(string $className => string $filePath). + */ + private $civiTestClasses; + /** * @param bool $force * @@ -63,6 +71,23 @@ class CRM_Core_ClassLoader { */ protected function __construct() { $this->_registered = FALSE; + $this->civiTestClasses = array( + 'CiviCaseTestCase', + 'CiviDBAssert', + 'CiviMailUtils', + 'CiviReportTestCase', + 'CiviSeleniumTestCase', + 'CiviTester', + 'CiviTestSuite', + 'CiviUnitTestCase', + 'Contact', + 'ContributionPage', + 'Custom', + 'Event', + 'Membership', + 'Participant', + 'PaypalPro', + ); } /** @@ -170,6 +195,20 @@ class CRM_Core_ClassLoader { require_once $file; } } + elseif (in_array($class, $this->civiTestClasses)) { + $file = "tests/phpunit/CiviTest/{$class}.php"; + if (FALSE != stream_resolve_include_path($file)) { + require_once $file; + } + } + elseif ($class === 'CiviSeleniumSettings') { + if (!empty($GLOBALS['_CV'])) { + require_once 'tests/phpunit/CiviTest/CiviSeleniumSettings.auto.php'; + } + elseif (CRM_Utils_File::isIncludable('tests/phpunit/CiviTest/CiviSeleniumSettings.php')) { + require_once 'tests/phpunit/CiviTest/CiviSeleniumSettings.php'; + } + } } } diff --git a/civicrm/CRM/Core/DAO.php b/civicrm/CRM/Core/DAO.php index 76892fb6267ddcf456c598b44ef220a03cad255e..189b6c8d59a626440de68f4d23b33d6c1fdba50d 100644 --- a/civicrm/CRM/Core/DAO.php +++ b/civicrm/CRM/Core/DAO.php @@ -1166,6 +1166,64 @@ FROM civicrm_domain $object->delete(); } + /** + * execute an unbuffered query. This is a wrapper around new functionality + * exposed with CRM-17748. + * + * @param string $query query to be executed + * + * @return Object CRM_Core_DAO object that points to an unbuffered result set + * @static + * @access public + */ + static public function executeUnbufferedQuery( + $query, + $params = array(), + $abort = TRUE, + $daoName = NULL, + $freeDAO = FALSE, + $i18nRewrite = TRUE, + $trapException = FALSE + ) { + $queryStr = self::composeQuery($query, $params, $abort); + //CRM_Core_Error::debug( 'q', $queryStr ); + if (!$daoName) { + $dao = new CRM_Core_DAO(); + } + else { + $dao = new $daoName(); + } + + if ($trapException) { + CRM_Core_Error::ignoreException(); + } + + // set the DAO object to use an unbuffered query + $dao->setOptions(array('result_buffering' => 0)); + + $result = $dao->query($queryStr, $i18nRewrite); + + if ($trapException) { + CRM_Core_Error::setCallback(); + } + + if (is_a($result, 'DB_Error')) { + return $result; + } + + // since it is unbuffered, ($dao->N==0) is true. This blocks the standard fetch() mechanism. + $dao->N = TRUE; + + if ($freeDAO || + preg_match('/^(insert|update|delete|create|drop|replace)/i', $queryStr) + ) { + // we typically do this for insert/update/delete stataments OR if explicitly asked to + // free the dao + $dao->free(); + } + return $dao; + } + /** * Execute a query. * diff --git a/civicrm/CRM/Core/DAO/.listAll.php b/civicrm/CRM/Core/DAO/.listAll.php deleted file mode 100644 index cc5ddcba44d9fa4082c7b1e6c6f9781e23278e24..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Core/DAO/.listAll.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php -$dao = array (); -$dao['AddressFormat'] = 'CRM_Core_DAO_AddressFormat'; -$dao['Extension'] = 'CRM_Core_DAO_Extension'; -$dao['File'] = 'CRM_Core_DAO_File'; -$dao['LocationType'] = 'CRM_Core_DAO_LocationType'; -$dao['MailSettings'] = 'CRM_Core_DAO_MailSettings'; -$dao['Managed'] = 'CRM_Core_DAO_Managed'; -$dao['Mapping'] = 'CRM_Core_DAO_Mapping'; -$dao['OptionGroup'] = 'CRM_Core_DAO_OptionGroup'; -$dao['PreferencesDate'] = 'CRM_Core_DAO_PreferencesDate'; -$dao['Worldregion'] = 'CRM_Core_DAO_Worldregion'; -$dao['Component'] = 'CRM_Core_DAO_Component'; -$dao['Persistent'] = 'CRM_Core_DAO_Persistent'; -$dao['PrevNextCache'] = 'CRM_Core_DAO_PrevNextCache'; -$dao['ActionMapping'] = 'CRM_Core_DAO_ActionMapping'; -$dao['ACL'] = 'CRM_ACL_DAO_ACL'; -$dao['EntityRole'] = 'CRM_ACL_DAO_EntityRole'; -$dao['Contact'] = 'CRM_Contact_DAO_Contact'; -$dao['ACLContactCache'] = 'CRM_Contact_DAO_ACLContactCache'; -$dao['RelationshipType'] = 'CRM_Contact_DAO_RelationshipType'; -$dao['SavedSearch'] = 'CRM_Contact_DAO_SavedSearch'; -$dao['ContactType'] = 'CRM_Contact_DAO_ContactType'; -$dao['Batch'] = 'CRM_Batch_DAO_Batch'; -$dao['EntityBatch'] = 'CRM_Batch_DAO_EntityBatch'; -//NAMESPACE ERROR: Component already used . CRM_Mailing_DAO_Component ignored. -$dao['BounceType'] = 'CRM_Mailing_DAO_BounceType'; -$dao['BouncePattern'] = 'CRM_Mailing_DAO_BouncePattern'; -$dao['Premium'] = 'CRM_Contribute_DAO_Premium'; -$dao['Currency'] = 'CRM_Financial_DAO_Currency'; -$dao['FinancialAccount'] = 'CRM_Financial_DAO_FinancialAccount'; -$dao['PaymentProcessorType'] = 'CRM_Financial_DAO_PaymentProcessorType'; -$dao['FinancialType'] = 'CRM_Financial_DAO_FinancialType'; -$dao['EntityFinancialAccount'] = 'CRM_Financial_DAO_EntityFinancialAccount'; -$dao['FinancialItem'] = 'CRM_Financial_DAO_FinancialItem'; -$dao['Provider'] = 'CRM_SMS_DAO_Provider'; -$dao['Project'] = 'CRM_Project_DAO_Project'; -$dao['Task'] = 'CRM_Project_DAO_Task'; -$dao['TaskStatus'] = 'CRM_Project_DAO_TaskStatus'; -$dao['MembershipStatus'] = 'CRM_Member_DAO_MembershipStatus'; -$dao['Campaign'] = 'CRM_Campaign_DAO_Campaign'; -$dao['CampaignGroup'] = 'CRM_Campaign_DAO_CampaignGroup'; -$dao['Survey'] = 'CRM_Campaign_DAO_Survey'; -$dao['ParticipantStatusType'] = 'CRM_Event_DAO_ParticipantStatusType'; -$dao['Cart'] = 'CRM_Event_Cart_DAO_Cart'; -$dao['RuleGroup'] = 'CRM_Dedupe_DAO_RuleGroup'; -$dao['Rule'] = 'CRM_Dedupe_DAO_Rule'; -$dao['Exception'] = 'CRM_Dedupe_DAO_Exception'; -$dao['Case'] = 'CRM_Case_DAO_Case'; -$dao['CaseContact'] = 'CRM_Case_DAO_CaseContact'; -$dao['Grant'] = 'CRM_Grant_DAO_Grant'; -$dao['Friend'] = 'CRM_Friend_DAO_Friend'; -$dao['PledgeBlock'] = 'CRM_Pledge_DAO_PledgeBlock'; -$dao['QueueItem'] = 'CRM_Queue_DAO_QueueItem'; -$dao['PCP'] = 'CRM_PCP_DAO_PCP'; -$dao['Cache'] = 'CRM_Core_DAO_Cache'; -$dao['Country'] = 'CRM_Core_DAO_Country'; -$dao['CustomGroup'] = 'CRM_Core_DAO_CustomGroup'; -$dao['CustomField'] = 'CRM_Core_DAO_CustomField'; -$dao['Domain'] = 'CRM_Core_DAO_Domain'; -$dao['Email'] = 'CRM_Core_DAO_Email'; -$dao['EntityFile'] = 'CRM_Core_DAO_EntityFile'; -$dao['IM'] = 'CRM_Core_DAO_IM'; -$dao['Job'] = 'CRM_Core_DAO_Job'; -$dao['JobLog'] = 'CRM_Core_DAO_JobLog'; -$dao['Log'] = 'CRM_Core_DAO_Log'; -$dao['MappingField'] = 'CRM_Core_DAO_MappingField'; -$dao['Menu'] = 'CRM_Core_DAO_Menu'; -$dao['Navigation'] = 'CRM_Core_DAO_Navigation'; -$dao['Note'] = 'CRM_Core_DAO_Note'; -$dao['OptionValue'] = 'CRM_Core_DAO_OptionValue'; -$dao['Phone'] = 'CRM_Core_DAO_Phone'; -$dao['StateProvince'] = 'CRM_Core_DAO_StateProvince'; -$dao['Tag'] = 'CRM_Core_DAO_Tag'; -$dao['UFMatch'] = 'CRM_Core_DAO_UFMatch'; -$dao['Timezone'] = 'CRM_Core_DAO_Timezone'; -$dao['OpenID'] = 'CRM_Core_DAO_OpenID'; -$dao['Website'] = 'CRM_Core_DAO_Website'; -$dao['Setting'] = 'CRM_Core_DAO_Setting'; -//NAMESPACE ERROR: Cache already used . CRM_ACL_DAO_Cache ignored. -$dao['Group'] = 'CRM_Contact_DAO_Group'; -$dao['SubscriptionHistory'] = 'CRM_Contact_DAO_SubscriptionHistory'; -$dao['GroupContactCache'] = 'CRM_Contact_DAO_GroupContactCache'; -$dao['GroupNesting'] = 'CRM_Contact_DAO_GroupNesting'; -$dao['GroupOrganization'] = 'CRM_Contact_DAO_GroupOrganization'; -$dao['Relationship'] = 'CRM_Contact_DAO_Relationship'; -$dao['Subscribe'] = 'CRM_Mailing_Event_DAO_Subscribe'; -$dao['Confirm'] = 'CRM_Mailing_Event_DAO_Confirm'; -$dao['ContributionPage'] = 'CRM_Contribute_DAO_ContributionPage'; -$dao['Product'] = 'CRM_Contribute_DAO_Product'; -$dao['PremiumsProduct'] = 'CRM_Contribute_DAO_PremiumsProduct'; -$dao['Widget'] = 'CRM_Contribute_DAO_Widget'; -$dao['PaymentProcessor'] = 'CRM_Financial_DAO_PaymentProcessor'; -$dao['MembershipType'] = 'CRM_Member_DAO_MembershipType'; -$dao['MembershipBlock'] = 'CRM_Member_DAO_MembershipBlock'; -$dao['Activity'] = 'CRM_Activity_DAO_Activity'; -$dao['ActivityAssignment'] = 'CRM_Activity_DAO_ActivityAssignment'; -$dao['ActivityTarget'] = 'CRM_Activity_DAO_ActivityTarget'; -$dao['CaseActivity'] = 'CRM_Case_DAO_CaseActivity'; -$dao['Pledge'] = 'CRM_Pledge_DAO_Pledge'; -$dao['Instance'] = 'CRM_Report_DAO_Instance'; -$dao['Set'] = 'CRM_Price_DAO_Set'; -$dao['SetEntity'] = 'CRM_Price_DAO_SetEntity'; -$dao['County'] = 'CRM_Core_DAO_County'; -$dao['Dashboard'] = 'CRM_Core_DAO_Dashboard'; -$dao['Discount'] = 'CRM_Core_DAO_Discount'; -$dao['EntityTag'] = 'CRM_Core_DAO_EntityTag'; -$dao['MessageTemplates'] = 'CRM_Core_DAO_MessageTemplates'; -$dao['UFGroup'] = 'CRM_Core_DAO_UFGroup'; -$dao['UFField'] = 'CRM_Core_DAO_UFField'; -$dao['UFJoin'] = 'CRM_Core_DAO_UFJoin'; -$dao['ActionSchedule'] = 'CRM_Core_DAO_ActionSchedule'; -$dao['ActionLog'] = 'CRM_Core_DAO_ActionLog'; -$dao['DashboardContact'] = 'CRM_Contact_DAO_DashboardContact'; -$dao['Mailing'] = 'CRM_Mailing_DAO_Mailing'; -//NAMESPACE ERROR: Group already used . CRM_Mailing_DAO_Group ignored. -$dao['TrackableURL'] = 'CRM_Mailing_DAO_TrackableURL'; -//NAMESPACE ERROR: Job already used . CRM_Mailing_DAO_Job ignored. -$dao['Recipients'] = 'CRM_Mailing_DAO_Recipients'; -$dao['Spool'] = 'CRM_Mailing_DAO_Spool'; -$dao['Queue'] = 'CRM_Mailing_Event_DAO_Queue'; -$dao['Bounce'] = 'CRM_Mailing_Event_DAO_Bounce'; -$dao['Delivered'] = 'CRM_Mailing_Event_DAO_Delivered'; -$dao['Forward'] = 'CRM_Mailing_Event_DAO_Forward'; -$dao['Opened'] = 'CRM_Mailing_Event_DAO_Opened'; -$dao['Reply'] = 'CRM_Mailing_Event_DAO_Reply'; -$dao['TrackableURLOpen'] = 'CRM_Mailing_Event_DAO_TrackableURLOpen'; -$dao['Unsubscribe'] = 'CRM_Mailing_Event_DAO_Unsubscribe'; -$dao['ContributionRecur'] = 'CRM_Contribute_DAO_ContributionRecur'; -$dao['FinancialTrxn'] = 'CRM_Financial_DAO_FinancialTrxn'; -$dao['OfficialReceipt'] = 'CRM_Financial_DAO_OfficialReceipt'; -$dao['Membership'] = 'CRM_Member_DAO_Membership'; -$dao['MembershipLog'] = 'CRM_Member_DAO_MembershipLog'; -$dao['Field'] = 'CRM_Price_DAO_Field'; -$dao['FieldValue'] = 'CRM_Price_DAO_FieldValue'; -$dao['LineItem'] = 'CRM_Price_DAO_LineItem'; -$dao['PCPBlock'] = 'CRM_PCP_DAO_PCPBlock'; -$dao['Address'] = 'CRM_Core_DAO_Address'; -$dao['LocBlock'] = 'CRM_Core_DAO_LocBlock'; -$dao['GroupContact'] = 'CRM_Contact_DAO_GroupContact'; -$dao['Contribution'] = 'CRM_Contribute_DAO_Contribution'; -$dao['ContributionProduct'] = 'CRM_Contribute_DAO_ContributionProduct'; -$dao['ContributionSoft'] = 'CRM_Contribute_DAO_ContributionSoft'; -$dao['EntityFinancialTrxn'] = 'CRM_Financial_DAO_EntityFinancialTrxn'; -$dao['MembershipPayment'] = 'CRM_Member_DAO_MembershipPayment'; -$dao['Event'] = 'CRM_Event_DAO_Event'; -$dao['Participant'] = 'CRM_Event_DAO_Participant'; -$dao['ParticipantPayment'] = 'CRM_Event_DAO_ParticipantPayment'; -$dao['EventInCart'] = 'CRM_Event_Cart_DAO_EventInCart'; -$dao['PledgePayment'] = 'CRM_Pledge_DAO_PledgePayment'; \ No newline at end of file diff --git a/civicrm/CRM/Core/DAO/MessageTemplates.php b/civicrm/CRM/Core/DAO/MessageTemplates.php deleted file mode 100644 index eecda89067df4aab40504ea33dd3eeeb8dc10e5f..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Core/DAO/MessageTemplates.php +++ /dev/null @@ -1,302 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Core_DAO_MessageTemplates extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_msg_template'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = false; - /** - * Message Template ID - * - * @var int unsigned - */ - public $id; - /** - * Descriptive title of message - * - * @var string - */ - public $msg_title; - /** - * Subject for email message. - * - * @var text - */ - public $msg_subject; - /** - * Text formatted message - * - * @var longtext - */ - public $msg_text; - /** - * HTML formatted message - * - * @var longtext - */ - public $msg_html; - /** - * - * @var boolean - */ - public $is_active; - /** - * a pseudo-FK to civicrm_option_value - * - * @var int unsigned - */ - public $workflow_id; - /** - * is this the default message template for the workflow referenced by workflow_id? - * - * @var boolean - */ - public $is_default; - /** - * is this the reserved message template which we ship for the workflow referenced by workflow_id? - * - * @var boolean - */ - public $is_reserved; - /** - * FK to civicrm_option_value containing PDF Page Format. - * - * @var int unsigned - */ - public $pdf_format_id; - /** - * class constructor - * - * @access public - * @return civicrm_msg_template - */ - function __construct() - { - $this->__table = 'civicrm_msg_template'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'pdf_format_id' => 'civicrm_option_value:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'msg_title' => array( - 'name' => 'msg_title', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Msg Title') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'msg_subject' => array( - 'name' => 'msg_subject', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Msg Subject') , - ) , - 'msg_text' => array( - 'name' => 'msg_text', - 'type' => CRM_Utils_Type::T_LONGTEXT, - 'title' => ts('Msg Text') , - ) , - 'msg_html' => array( - 'name' => 'msg_html', - 'type' => CRM_Utils_Type::T_LONGTEXT, - 'title' => ts('Msg Html') , - ) , - 'is_active' => array( - 'name' => 'is_active', - 'type' => CRM_Utils_Type::T_BOOLEAN, - 'title' => ts('Is Active') , - 'default' => '', - ) , - 'workflow_id' => array( - 'name' => 'workflow_id', - 'type' => CRM_Utils_Type::T_INT, - ) , - 'is_default' => array( - 'name' => 'is_default', - 'type' => CRM_Utils_Type::T_BOOLEAN, - 'default' => '', - ) , - 'is_reserved' => array( - 'name' => 'is_reserved', - 'type' => CRM_Utils_Type::T_BOOLEAN, - ) , - 'pdf_format_id' => array( - 'name' => 'pdf_format_id', - 'type' => CRM_Utils_Type::T_INT, - 'FKClassName' => 'CRM_Core_DAO_OptionValue', - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return self::$_tableName; - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['msg_template'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['msg_template'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } -} diff --git a/civicrm/CRM/Core/I18n.php b/civicrm/CRM/Core/I18n.php index 59a5f7b2c7a611098affa59f9e14f959681736a3..61a932ef5652c2695597c5ddff24b8fae72cd7be 100644 --- a/civicrm/CRM/Core/I18n.php +++ b/civicrm/CRM/Core/I18n.php @@ -542,6 +542,21 @@ class CRM_Core_I18n { return (bool) $domain->locales; } + /** + * Is the language written "right-to-left"? + * + * @param $language + * Language (for example 'en_US', or 'fr_CA'). + * + * @return Bool + * True if it is an RTL language. + */ + public static function isLanguageRTL($language) { + $rtl = CRM_Core_I18n_PseudoConstant::getRTLlanguages(); + $short = CRM_Core_I18n_PseudoConstant::shortForLong($language); + + return (in_array($short, $rtl)); + } /** * Change the processing language without changing the current user language diff --git a/civicrm/CRM/Core/I18n/PseudoConstant.php b/civicrm/CRM/Core/I18n/PseudoConstant.php index 555f2ec237f9b09faa585b95d91a513abd982b18..91d850fef0dbd013f34ff28d57f07407b4a19388 100644 --- a/civicrm/CRM/Core/I18n/PseudoConstant.php +++ b/civicrm/CRM/Core/I18n/PseudoConstant.php @@ -78,4 +78,20 @@ class CRM_Core_I18n_PseudoConstant { return substr($long, 0, 2); } + /** + * Returns a list of ISO 639-1 "right-to-left" language codes. + * + * @return array + */ + public static function getRTLlanguages() { + $rtl = array( + 'ar', + 'fa', + 'he', + 'ur', + ); + + return $rtl; + } + } diff --git a/civicrm/CRM/Core/Permission.php b/civicrm/CRM/Core/Permission.php index 554d31d5a908b5de17a031da48ec866e0071ef8d..242fdf40748f897f2b3fa50486a076458fbfeb2b 100644 --- a/civicrm/CRM/Core/Permission.php +++ b/civicrm/CRM/Core/Permission.php @@ -553,30 +553,18 @@ class CRM_Core_Permission { /** * @param bool $all + * Include disabled components * @param bool $descriptions - * whether to return descriptions + * Whether to return descriptions * * @return array */ - public static function &basicPermissions($all = FALSE, $descriptions = FALSE) { - if ($descriptions) { - static $permissionsDesc = NULL; - - if (!$permissionsDesc) { - $permissionsDesc = self::assembleBasicPermissions($all, $descriptions); - } - - return $permissionsDesc; - } - else { - static $permissions = NULL; - - if (!$permissions) { - $permissions = self::assembleBasicPermissions($all, $descriptions); - } - - return $permissions; + public static function basicPermissions($all = FALSE, $descriptions = FALSE) { + $cacheKey = implode('-', array($all, $descriptions)); + if (empty(Civi::$statics[__CLASS__][__FUNCTION__][$cacheKey])) { + Civi::$statics[__CLASS__][__FUNCTION__][$cacheKey] = self::assembleBasicPermissions($all, $descriptions); } + return Civi::$statics[__CLASS__][__FUNCTION__][$cacheKey]; } /** diff --git a/civicrm/CRM/Core/Permission/Drupal8.php b/civicrm/CRM/Core/Permission/Drupal8.php index 3b7d69a513bddd8f489dc6019599b12b664b2c06..58b9cae7adf119c753cae356349f522903efdc0f 100644 --- a/civicrm/CRM/Core/Permission/Drupal8.php +++ b/civicrm/CRM/Core/Permission/Drupal8.php @@ -61,4 +61,49 @@ class CRM_Core_Permission_Drupal8 extends CRM_Core_Permission_DrupalBase { return \Drupal::currentUser()->hasPermission($str); } + /** + * Get all the contact emails for users that have a specific permission. + * + * @param string $permissionName + * Name of the permission we are interested in. + * + * @return string + * a comma separated list of email addresses + */ + public function permissionEmails($permissionName) { + static $_cache = array(); + + if (isset($_cache[$permissionName])) { + return $_cache[$permissionName]; + } + + $role_ids = array_map( + function (\Drupal\user\RoleInterface $role) { + return $role->id(); + }, user_roles(TRUE, $permissionName) + ); + $users = \Drupal::entityTypeManager()->getStorage('user')->loadByProperties(array('roles' => $role_ids)); + $uids = array_keys($users); + + $_cache[$permissionName] = self::getContactEmails($uids); + return $_cache[$permissionName]; + } + + /** + * @inheritDoc + */ + public function upgradePermissions($permissions) { + $civicrm_perms = array_keys(CRM_Core_Permission::getCorePermissions()); + if (empty($civicrm_perms)) { + throw new CRM_Core_Exception("Cannot upgrade permissions: permission list missing"); + } + + $roles = user_roles(TRUE); + foreach ($roles as $role) { + foreach ($civicrm_perms as $permission) { + $role->revokePermission($permission); + } + } + } + } diff --git a/civicrm/CRM/Core/Permission/WordPress.php b/civicrm/CRM/Core/Permission/WordPress.php index bbe2463207df2dbb73c809c0c8179dca33af0cbb..4de5a0e539a78591d1ec6361c2c771531313a899 100644 --- a/civicrm/CRM/Core/Permission/WordPress.php +++ b/civicrm/CRM/Core/Permission/WordPress.php @@ -47,9 +47,9 @@ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base { * true if yes, else false */ public function check($str) { - // Generic cms 'administer users' role tranlates to 'administrator' WordPress role + // Generic cms 'administer users' role tranlates to users with the 'edit_users' capability' in WordPress $str = $this->translatePermission($str, 'WordPress', array( - 'administer users' => 'administrator', + 'administer users' => 'edit_users', )); if ($str == CRM_Core_Permission::ALWAYS_DENY_PERMISSION) { return FALSE; diff --git a/civicrm/CRM/Core/xml/Menu/Misc.xml b/civicrm/CRM/Core/xml/Menu/Misc.xml index aec5f169d76761ffd267d98a9280c32f1117bbd2..c587e86adc588095ba4fbf060b9660c34d320b93 100644 --- a/civicrm/CRM/Core/xml/Menu/Misc.xml +++ b/civicrm/CRM/Core/xml/Menu/Misc.xml @@ -183,7 +183,7 @@ <item> <path>civicrm/ajax/angular-modules</path> <page_callback>\Civi\Angular\Page\Modules</page_callback> - <access_arguments>access CiviCRM</access_arguments> + <access_arguments>*always allow*</access_arguments> </item> <item> <path>civicrm/ajax/recurringentity/update-mode</path> diff --git a/civicrm/CRM/Dedupe/BAO/RuleGroup.php b/civicrm/CRM/Dedupe/BAO/RuleGroup.php index 1616392f6d04371c248867deb714c4586d5834a0..aaca7d84d0d24129059d8597dc1e298ee37a38e8 100644 --- a/civicrm/CRM/Dedupe/BAO/RuleGroup.php +++ b/civicrm/CRM/Dedupe/BAO/RuleGroup.php @@ -77,6 +77,7 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { 'addressee.label' => 'civicrm_contact.addressee_id', 'email_greeting.label' => 'civicrm_contact.email_greeting_id', 'postal_greeting.label' => 'civicrm_contact.postal_greeting_id', + 'civicrm_phone.phone' => 'civicrm_phone.phone_numeric', ); // the table names we support in dedupe rules - a filter for importableFields() $supportedTables = array( diff --git a/civicrm/CRM/Financial/DAO/OfficialReceipt.php b/civicrm/CRM/Financial/DAO/OfficialReceipt.php deleted file mode 100644 index 11226147b56497d1d8d199189406d7b657a2872a..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Financial/DAO/OfficialReceipt.php +++ /dev/null @@ -1,343 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Financial_DAO_OfficialReceipt extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_official_receipt'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = true; - /** - * Receipt ID - * - * @var int unsigned - */ - public $id; - /** - * FK to Contact ID - * - * @var int unsigned - */ - public $contact_id; - /** - * Serialized array of contact info of payor at time receipt is created - * - * @var text - */ - public $contact_snapshot; - /** - * - * @var datetime - */ - public $issued_date; - /** - * - * @var datetime - */ - public $start_date; - /** - * - * @var datetime - */ - public $end_date; - /** - * pseudo FK to civicrm_option_value - * - * @var int unsigned - */ - public $receipt_status_id; - /** - * pseudo FK to civicrm_option_value - * - * @var int unsigned - */ - public $receipt_type_id; - /** - * Total amount for this receipt. - * - * @var float - */ - public $total_amount; - /** - * Portion of total amount which is NOT tax deductible. Equal to total_amount for non-deductible financial types. - * - * @var float - */ - public $non_deductible_amount; - /** - * 3 character string, value from config setting or input via user. - * - * @var string - */ - public $currency; - /** - * template used to generate receipt - * - * @var int unsigned - */ - public $msg_template_id; - /** - * class constructor - * - * @access public - * @return civicrm_official_receipt - */ - function __construct() - { - $this->__table = 'civicrm_official_receipt'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'contact_id' => 'civicrm_contact:id', - 'msg_template_id' => 'civicrm_msg_template:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'receipt_contact_id' => array( - 'name' => 'contact_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Contact ID') , - 'required' => true, - 'import' => true, - 'where' => 'civicrm_official_receipt.contact_id', - 'headerPattern' => '/contact(.?id)?/i', - 'dataPattern' => '/^\d+$/', - 'export' => true, - 'FKClassName' => 'CRM_Contact_DAO_Contact', - ) , - 'contact_snapshot' => array( - 'name' => 'contact_snapshot', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Contact Snapshot') , - 'rows' => 4, - 'cols' => 80, - ) , - 'issued_date' => array( - 'name' => 'issued_date', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, - 'title' => ts('Issued Date') , - 'required' => true, - ) , - 'start_date' => array( - 'name' => 'start_date', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, - 'title' => ts('Start Date') , - 'required' => true, - ) , - 'end_date' => array( - 'name' => 'end_date', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, - 'title' => ts('End Date') , - 'required' => true, - ) , - 'receipt_status_id' => array( - 'name' => 'receipt_status_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'receipt_type_id' => array( - 'name' => 'receipt_type_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'total_amount' => array( - 'name' => 'total_amount', - 'type' => CRM_Utils_Type::T_MONEY, - 'title' => ts('Total Amount') , - 'required' => true, - ) , - 'non_deductible_amount' => array( - 'name' => 'non_deductible_amount', - 'type' => CRM_Utils_Type::T_MONEY, - 'title' => ts('Non Deductible Amount') , - ) , - 'currency' => array( - 'name' => 'currency', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Currency') , - 'maxlength' => 3, - 'size' => CRM_Utils_Type::FOUR, - 'import' => true, - 'where' => 'civicrm_official_receipt.currency', - 'headerPattern' => '/cur(rency)?/i', - 'dataPattern' => '/^[A-Z]{3}$/', - 'export' => true, - 'default' => 'UL', - ) , - 'msg_template_id' => array( - 'name' => 'msg_template_id', - 'type' => CRM_Utils_Type::T_INT, - 'FKClassName' => 'CRM_Core_DAO_MessageTemplates', - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return self::$_tableName; - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['official_receipt'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['official_receipt'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } -} diff --git a/civicrm/CRM/Mailing/BAO/Mailing.php b/civicrm/CRM/Mailing/BAO/Mailing.php index 4fcf26f6e10d9e2a471570e8f41f480f62f0dafa..607ef31f12793053e47a82148a01bcb2a5d2e559 100644 --- a/civicrm/CRM/Mailing/BAO/Mailing.php +++ b/civicrm/CRM/Mailing/BAO/Mailing.php @@ -758,18 +758,28 @@ ORDER BY i.contact_id, i.{$tempColumn} if (!$this->templates) { $this->getHeaderFooter(); $this->templates = array(); - - if ($this->body_text) { + if ($this->body_text || $this->header->body_text || $this->footer->body_text) { $template = array(); - if ($this->header) { + if ($this->header->body_text) { $template[] = $this->header->body_text; } + else { + $template[] = CRM_Utils_String::htmlToText($this->header->body_html); + } - $template[] = $this->body_text; + if ($this->body_text) { + $template[] = $this->body_text; + } + else { + $template[] = CRM_Utils_String::htmlToText($this->body_html); + } - if ($this->footer) { + if ($this->footer->body_text) { $template[] = $this->footer->body_text; } + else { + $template[] = CRM_Utils_String::htmlToText($this->footer->body_html); + } $this->templates['text'] = implode("\n", $template); } @@ -792,7 +802,7 @@ ORDER BY i.contact_id, i.{$tempColumn} // this is where we create a text template from the html template if the text template did not exist // this way we ensure that every recipient will receive an email even if the pref is set to text and the // user uploads an html email only - if (!$this->body_text) { + if (empty($this->templates['text'])) { $this->templates['text'] = CRM_Utils_String::htmlToText($this->templates['html']); } } @@ -3139,8 +3149,8 @@ AND m.id = %1 */ public static function mailingGroupEntityTables() { $tables = array( - 'civicrm_group', - 'civicrm_mailing', + CRM_Contact_BAO_Group::getTableName(), + CRM_Mailing_BAO_Mailing::getTableName(), ); // Identical keys & values return array_combine($tables, $tables); diff --git a/civicrm/CRM/Mailing/DAO/Group.php b/civicrm/CRM/Mailing/DAO/Group.php deleted file mode 100644 index e7cd90e71115894fbd04aabfa6b2e317f634be73..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Mailing/DAO/Group.php +++ /dev/null @@ -1,321 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Mailing_DAO_Group extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_mailing_group'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = false; - /** - * - * @var int unsigned - */ - public $id; - /** - * The ID of a previous mailing to include/exclude recipients. - * - * @var int unsigned - */ - public $mailing_id; - /** - * Are the members of the group included or excluded?. - * - * @var enum('Include', 'Exclude', 'Base') - */ - public $group_type; - /** - * Name of table where item being referenced is stored. - * - * @var string - */ - public $entity_table; - /** - * Foreign key to the referenced item. - * - * @var int unsigned - */ - public $entity_id; - /** - * The filtering search. custom search id or -1 for civicrm api search - * - * @var int - */ - public $search_id; - /** - * The arguments to be sent to the search function - * - * @var text - */ - public $search_args; - /** - * class constructor - * - * @access public - * @return civicrm_mailing_group - */ - function __construct() - { - $this->__table = 'civicrm_mailing_group'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'mailing_id' => 'civicrm_mailing:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'mailing_id' => array( - 'name' => 'mailing_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - 'FKClassName' => 'CRM_Mailing_DAO_Mailing', - ) , - 'group_type' => array( - 'name' => 'group_type', - 'type' => CRM_Utils_Type::T_ENUM, - 'title' => ts('Group Type') , - 'enumValues' => 'Include, Exclude, Base', - ) , - 'entity_table' => array( - 'name' => 'entity_table', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Entity Table') , - 'required' => true, - 'maxlength' => 64, - 'size' => CRM_Utils_Type::BIG, - ) , - 'entity_id' => array( - 'name' => 'entity_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'search_id' => array( - 'name' => 'search_id', - 'type' => CRM_Utils_Type::T_INT, - ) , - 'search_args' => array( - 'name' => 'search_args', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Search Args') , - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return self::$_tableName; - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['mailing_group'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['mailing_group'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } - /** - * returns an array containing the enum fields of the civicrm_mailing_group table - * - * @return array (reference) the array of enum fields - */ - static function &getEnums() - { - static $enums = array( - 'group_type', - ); - return $enums; - } - /** - * returns a ts()-translated enum value for display purposes - * - * @param string $field the enum field in question - * @param string $value the enum value up for translation - * - * @return string the display value of the enum - */ - static function tsEnum($field, $value) - { - static $translations = null; - if (!$translations) { - $translations = array( - 'group_type' => array( - 'Include' => ts('Include') , - 'Exclude' => ts('Exclude') , - 'Base' => ts('Base') , - ) , - ); - } - return $translations[$field][$value]; - } - /** - * adds $value['foo_display'] for each $value['foo'] enum from civicrm_mailing_group - * - * @param array $values (reference) the array up for enhancing - * @return void - */ - static function addDisplayEnums(&$values) - { - $enumFields = & CRM_Mailing_DAO_Group::getEnums(); - foreach($enumFields as $enum) { - if (isset($values[$enum])) { - $values[$enum . '_display'] = CRM_Mailing_DAO_Group::tsEnum($enum, $values[$enum]); - } - } - } -} diff --git a/civicrm/CRM/Mailing/DAO/Job.php b/civicrm/CRM/Mailing/DAO/Job.php deleted file mode 100644 index db746504aa98008229075e5ed9db50c4ab5cc86a..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Mailing/DAO/Job.php +++ /dev/null @@ -1,368 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Mailing_DAO_Job extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_mailing_job'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = false; - /** - * - * @var int unsigned - */ - public $id; - /** - * The ID of the mailing this Job will send. - * - * @var int unsigned - */ - public $mailing_id; - /** - * date on which this job was scheduled. - * - * @var datetime - */ - public $scheduled_date; - /** - * date on which this job was started. - * - * @var datetime - */ - public $start_date; - /** - * date on which this job ended. - * - * @var datetime - */ - public $end_date; - /** - * The state of this job - * - * @var enum('Scheduled', 'Running', 'Complete', 'Paused', 'Canceled') - */ - public $status; - /** - * Is this job for a test mail? - * - * @var boolean - */ - public $is_test; - /** - * Type of mailling job: null | child - * - * @var string - */ - public $job_type; - /** - * Parent job id - * - * @var int unsigned - */ - public $parent_id; - /** - * Offset of the child job - * - * @var int - */ - public $job_offset; - /** - * Queue size limit for each child job - * - * @var int - */ - public $job_limit; - /** - * class constructor - * - * @access public - * @return civicrm_mailing_job - */ - function __construct() - { - $this->__table = 'civicrm_mailing_job'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'mailing_id' => 'civicrm_mailing:id', - 'parent_id' => 'civicrm_mailing_job:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'mailing_id' => array( - 'name' => 'mailing_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - 'FKClassName' => 'CRM_Mailing_DAO_Mailing', - ) , - 'scheduled_date' => array( - 'name' => 'scheduled_date', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, - 'title' => ts('Scheduled Date') , - ) , - 'start_date' => array( - 'name' => 'start_date', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, - 'title' => ts('Start Date') , - ) , - 'end_date' => array( - 'name' => 'end_date', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, - 'title' => ts('End Date') , - ) , - 'status' => array( - 'name' => 'status', - 'type' => CRM_Utils_Type::T_ENUM, - 'title' => ts('Status') , - 'enumValues' => 'Scheduled, Running, Complete, Paused, Canceled', - ) , - 'is_test' => array( - 'name' => 'is_test', - 'type' => CRM_Utils_Type::T_BOOLEAN, - ) , - 'job_type' => array( - 'name' => 'job_type', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Job Type') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'parent_id' => array( - 'name' => 'parent_id', - 'type' => CRM_Utils_Type::T_INT, - 'default' => 'UL', - 'FKClassName' => 'CRM_Mailing_DAO_Job', - ) , - 'job_offset' => array( - 'name' => 'job_offset', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Job Offset') , - ) , - 'job_limit' => array( - 'name' => 'job_limit', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Job Limit') , - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return self::$_tableName; - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['mailing_job'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['mailing_job'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } - /** - * returns an array containing the enum fields of the civicrm_mailing_job table - * - * @return array (reference) the array of enum fields - */ - static function &getEnums() - { - static $enums = array( - 'status', - ); - return $enums; - } - /** - * returns a ts()-translated enum value for display purposes - * - * @param string $field the enum field in question - * @param string $value the enum value up for translation - * - * @return string the display value of the enum - */ - static function tsEnum($field, $value) - { - static $translations = null; - if (!$translations) { - $translations = array( - 'status' => array( - 'Scheduled' => ts('Scheduled') , - 'Running' => ts('Running') , - 'Complete' => ts('Complete') , - 'Paused' => ts('Paused') , - 'Canceled' => ts('Canceled') , - ) , - ); - } - return $translations[$field][$value]; - } - /** - * adds $value['foo_display'] for each $value['foo'] enum from civicrm_mailing_job - * - * @param array $values (reference) the array up for enhancing - * @return void - */ - static function addDisplayEnums(&$values) - { - $enumFields = & CRM_Mailing_DAO_Job::getEnums(); - foreach($enumFields as $enum) { - if (isset($values[$enum])) { - $values[$enum . '_display'] = CRM_Mailing_DAO_Job::tsEnum($enum, $values[$enum]); - } - } - } -} diff --git a/civicrm/CRM/Member/Form/Membership.php b/civicrm/CRM/Member/Form/Membership.php index 059d6cb70c11f0e4a11a6c0086df0a03dd30b3cd..0ddedb633a5e3b78f6f3ee51b0c791da4cba772a 100644 --- a/civicrm/CRM/Member/Form/Membership.php +++ b/civicrm/CRM/Member/Form/Membership.php @@ -243,7 +243,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { if (!$this->_memType) { $params = CRM_Utils_Request::exportValues(); - if (isset($params['membership_type_id'][1])) { + if (!empty($params['membership_type_id'][1])) { $this->_memType = $params['membership_type_id'][1]; } } diff --git a/civicrm/CRM/Member/Import/Parser/Membership.php b/civicrm/CRM/Member/Import/Parser/Membership.php index ee60221155e030596d0f250557ad3bfcc427340e..5bef01d667cd0059e40200ab9e22a1f5dd130d03 100644 --- a/civicrm/CRM/Member/Import/Parser/Membership.php +++ b/civicrm/CRM/Member/Import/Parser/Membership.php @@ -162,7 +162,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { return CRM_Import_Parser::ERROR; } - $params = &$this->getActiveFieldParams(); + $params = $this->getActiveFieldParams(); $errorMessage = NULL; //To check whether start date or join date is provided @@ -269,7 +269,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { return $response; } - $params = &$this->getActiveFieldParams(); + $params = $this->getActiveFieldParams(); //assign join date equal to start date if join date is not provided if (empty($params['join_date']) && !empty($params['membership_start_date'])) { diff --git a/civicrm/CRM/Price/DAO/Field.php b/civicrm/CRM/Price/DAO/Field.php deleted file mode 100644 index 647c92bae3ffda877655b8d19d13c9ccd3545fdd..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Price/DAO/Field.php +++ /dev/null @@ -1,446 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Price_DAO_Field extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_price_field'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = true; - /** - * Price Field - * - * @var int unsigned - */ - public $id; - /** - * FK to civicrm_price_set - * - * @var int unsigned - */ - public $price_set_id; - /** - * Variable name/programmatic handle for this field. - * - * @var string - */ - public $name; - /** - * Text for form field label (also friendly name for administering this field). - * - * @var string - */ - public $label; - /** - * - * @var enum('Text', 'Select', 'Radio', 'CheckBox') - */ - public $html_type; - /** - * Enter a quantity for this field? - * - * @var boolean - */ - public $is_enter_qty; - /** - * Description and/or help text to display before this field. - * - * @var text - */ - public $help_pre; - /** - * Description and/or help text to display after this field. - * - * @var text - */ - public $help_post; - /** - * Order in which the fields should appear - * - * @var int - */ - public $weight; - /** - * Should the price be displayed next to the label for each option? - * - * @var boolean - */ - public $is_display_amounts; - /** - * number of options per line for checkbox and radio - * - * @var int unsigned - */ - public $options_per_line; - /** - * Is this price field active - * - * @var boolean - */ - public $is_active; - /** - * Is this price field required (value must be > 1) - * - * @var boolean - */ - public $is_required; - /** - * If non-zero, do not show this field before the date specified - * - * @var datetime - */ - public $active_on; - /** - * If non-zero, do not show this field after the date specified - * - * @var datetime - */ - public $expire_on; - /** - * Optional scripting attributes for field - * - * @var string - */ - public $javascript; - /** - * Implicit FK to civicrm_option_group with name = \'visibility\' - * - * @var int unsigned - */ - public $visibility_id; - /** - * class constructor - * - * @access public - * @return civicrm_price_field - */ - function __construct() - { - $this->__table = 'civicrm_price_field'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'price_set_id' => 'civicrm_price_set:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'price_set_id' => array( - 'name' => 'price_set_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - 'FKClassName' => 'CRM_Price_DAO_Set', - ) , - 'name' => array( - 'name' => 'name', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Name') , - 'required' => true, - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'label' => array( - 'name' => 'label', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Label') , - 'required' => true, - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'html_type' => array( - 'name' => 'html_type', - 'type' => CRM_Utils_Type::T_ENUM, - 'title' => ts('Html Type') , - 'required' => true, - 'enumValues' => 'Text, Select, Radio, CheckBox', - ) , - 'is_enter_qty' => array( - 'name' => 'is_enter_qty', - 'type' => CRM_Utils_Type::T_BOOLEAN, - ) , - 'help_pre' => array( - 'name' => 'help_pre', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Help Pre') , - 'rows' => 4, - 'cols' => 80, - ) , - 'help_post' => array( - 'name' => 'help_post', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Help Post') , - 'rows' => 4, - 'cols' => 80, - ) , - 'weight' => array( - 'name' => 'weight', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Weight') , - 'default' => '', - ) , - 'is_display_amounts' => array( - 'name' => 'is_display_amounts', - 'type' => CRM_Utils_Type::T_BOOLEAN, - 'default' => '', - ) , - 'options_per_line' => array( - 'name' => 'options_per_line', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Options Per Line') , - 'default' => '', - ) , - 'is_active' => array( - 'name' => 'is_active', - 'type' => CRM_Utils_Type::T_BOOLEAN, - 'default' => '', - ) , - 'is_required' => array( - 'name' => 'is_required', - 'type' => CRM_Utils_Type::T_BOOLEAN, - 'default' => '', - ) , - 'active_on' => array( - 'name' => 'active_on', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, - 'title' => ts('Active On') , - 'default' => 'UL', - ) , - 'expire_on' => array( - 'name' => 'expire_on', - 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, - 'title' => ts('Expire On') , - 'default' => 'UL', - ) , - 'javascript' => array( - 'name' => 'javascript', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Javascript') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'visibility_id' => array( - 'name' => 'visibility_id', - 'type' => CRM_Utils_Type::T_INT, - 'default' => '', - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return CRM_Core_DAO::getLocaleTableName(self::$_tableName); - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['price_field'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['price_field'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } - /** - * returns an array containing the enum fields of the civicrm_price_field table - * - * @return array (reference) the array of enum fields - */ - static function &getEnums() - { - static $enums = array( - 'html_type', - ); - return $enums; - } - /** - * returns a ts()-translated enum value for display purposes - * - * @param string $field the enum field in question - * @param string $value the enum value up for translation - * - * @return string the display value of the enum - */ - static function tsEnum($field, $value) - { - static $translations = null; - if (!$translations) { - $translations = array( - 'html_type' => array( - 'Text' => ts('Text') , - 'Select' => ts('Select') , - 'Radio' => ts('Radio') , - 'CheckBox' => ts('CheckBox') , - ) , - ); - } - return $translations[$field][$value]; - } - /** - * adds $value['foo_display'] for each $value['foo'] enum from civicrm_price_field - * - * @param array $values (reference) the array up for enhancing - * @return void - */ - static function addDisplayEnums(&$values) - { - $enumFields = & CRM_Price_DAO_Field::getEnums(); - foreach($enumFields as $enum) { - if (isset($values[$enum])) { - $values[$enum . '_display'] = CRM_Price_DAO_Field::tsEnum($enum, $values[$enum]); - } - } - } -} diff --git a/civicrm/CRM/Price/DAO/FieldValue.php b/civicrm/CRM/Price/DAO/FieldValue.php deleted file mode 100644 index a88c6daf8abc85867966e4e9c39ecb1c1ac9ad14..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Price/DAO/FieldValue.php +++ /dev/null @@ -1,378 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Price_DAO_FieldValue extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_price_field_value'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = false; - /** - * Price Field Value - * - * @var int unsigned - */ - public $id; - /** - * FK to civicrm_price_field - * - * @var int unsigned - */ - public $price_field_id; - /** - * Price field option name - * - * @var string - */ - public $name; - /** - * Price field option label - * - * @var string - */ - public $label; - /** - * >Price field option description. - * - * @var text - */ - public $description; - /** - * Price field option amount - * - * @var string - */ - public $amount; - /** - * Number of participants per field option - * - * @var int unsigned - */ - public $count; - /** - * Max number of participants per field options - * - * @var int unsigned - */ - public $max_value; - /** - * Order in which the field options should appear - * - * @var int - */ - public $weight; - /** - * FK to Membership Type - * - * @var int unsigned - */ - public $membership_type_id; - /** - * Number of terms for this membership - * - * @var int unsigned - */ - public $membership_num_terms; - /** - * Is this default price field option - * - * @var boolean - */ - public $is_default; - /** - * Is this price field value active - * - * @var boolean - */ - public $is_active; - /** - * FK to Financial Type. - * - * @var int unsigned - */ - public $financial_type_id; - /** - * Tax-deductible portion of the amount - * - * @var float - */ - public $deductible_amount; - /** - * class constructor - * - * @access public - * @return civicrm_price_field_value - */ - function __construct() - { - $this->__table = 'civicrm_price_field_value'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'price_field_id' => 'civicrm_price_field:id', - 'membership_type_id' => 'civicrm_membership_type:id', - 'financial_type_id' => 'civicrm_financial_type:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'price_field_id' => array( - 'name' => 'price_field_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - 'FKClassName' => 'CRM_Price_DAO_Field', - ) , - 'name' => array( - 'name' => 'name', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Name') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'label' => array( - 'name' => 'label', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Label') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'description' => array( - 'name' => 'description', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Description') , - 'rows' => 2, - 'cols' => 60, - 'default' => 'UL', - ) , - 'amount' => array( - 'name' => 'amount', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Amount') , - 'required' => true, - 'maxlength' => 512, - 'size' => CRM_Utils_Type::EIGHT, - ) , - 'count' => array( - 'name' => 'count', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Count') , - 'default' => 'UL', - ) , - 'max_value' => array( - 'name' => 'max_value', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Max Value') , - 'default' => 'UL', - ) , - 'weight' => array( - 'name' => 'weight', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Weight') , - 'default' => '', - ) , - 'membership_type_id' => array( - 'name' => 'membership_type_id', - 'type' => CRM_Utils_Type::T_INT, - 'default' => 'UL', - 'FKClassName' => 'CRM_Member_DAO_MembershipType', - ) , - 'membership_num_terms' => array( - 'name' => 'membership_num_terms', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Membership Num Terms') , - 'default' => 'UL', - ) , - 'is_default' => array( - 'name' => 'is_default', - 'type' => CRM_Utils_Type::T_BOOLEAN, - ) , - 'is_active' => array( - 'name' => 'is_active', - 'type' => CRM_Utils_Type::T_BOOLEAN, - 'default' => '', - ) , - 'financial_type_id' => array( - 'name' => 'financial_type_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Financial Type') , - 'default' => 'UL', - 'FKClassName' => 'CRM_Financial_DAO_FinancialType', - ) , - 'deductible_amount' => array( - 'name' => 'deductible_amount', - 'type' => CRM_Utils_Type::T_MONEY, - 'title' => ts('Deductible Amount') , - 'required' => true, - 'default' => '.', - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return CRM_Core_DAO::getLocaleTableName(self::$_tableName); - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['price_field_value'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['price_field_value'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } -} diff --git a/civicrm/CRM/Price/DAO/Set.php b/civicrm/CRM/Price/DAO/Set.php deleted file mode 100644 index 418abac4e7c6bbd2f0d155ef5b704f214adfcd9f..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Price/DAO/Set.php +++ /dev/null @@ -1,340 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Price_DAO_Set extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_price_set'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = true; - /** - * Price Set - * - * @var int unsigned - */ - public $id; - /** - * Which Domain is this price-set for - * - * @var int unsigned - */ - public $domain_id; - /** - * Variable name/programmatic handle for this set of price fields. - * - * @var string - */ - public $name; - /** - * Displayed title for the Price Set. - * - * @var string - */ - public $title; - /** - * Is this price set active - * - * @var boolean - */ - public $is_active; - /** - * Description and/or help text to display before fields in form. - * - * @var text - */ - public $help_pre; - /** - * Description and/or help text to display after fields in form. - * - * @var text - */ - public $help_post; - /** - * Optional Javascript script function(s) included on the form with this price_set. Can be used for conditional - * - * @var string - */ - public $javascript; - /** - * What components are using this price set? - * - * @var string - */ - public $extends; - /** - * FK to Financial Type(for membership price sets only). - * - * @var int unsigned - */ - public $financial_type_id; - /** - * Is set if edited on Contribution or Event Page rather than through Manage Price Sets - * - * @var boolean - */ - public $is_quick_config; - /** - * Is this a predefined system price set (i.e. it can not be deleted, edited)? - * - * @var boolean - */ - public $is_reserved; - /** - * class constructor - * - * @access public - * @return civicrm_price_set - */ - function __construct() - { - $this->__table = 'civicrm_price_set'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'domain_id' => 'civicrm_domain:id', - 'financial_type_id' => 'civicrm_financial_type:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'domain_id' => array( - 'name' => 'domain_id', - 'type' => CRM_Utils_Type::T_INT, - 'FKClassName' => 'CRM_Core_DAO_Domain', - ) , - 'name' => array( - 'name' => 'name', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Name') , - 'required' => true, - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'title' => array( - 'name' => 'title', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Title') , - 'required' => true, - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'is_active' => array( - 'name' => 'is_active', - 'type' => CRM_Utils_Type::T_BOOLEAN, - 'default' => '', - ) , - 'help_pre' => array( - 'name' => 'help_pre', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Help Pre') , - 'rows' => 4, - 'cols' => 80, - ) , - 'help_post' => array( - 'name' => 'help_post', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Help Post') , - 'rows' => 4, - 'cols' => 80, - ) , - 'javascript' => array( - 'name' => 'javascript', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Javascript') , - 'maxlength' => 64, - 'size' => CRM_Utils_Type::BIG, - ) , - 'extends' => array( - 'name' => 'extends', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Extends') , - 'required' => true, - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'financial_type_id' => array( - 'name' => 'financial_type_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Financial Type') , - 'default' => 'UL', - 'FKClassName' => 'CRM_Financial_DAO_FinancialType', - ) , - 'is_quick_config' => array( - 'name' => 'is_quick_config', - 'type' => CRM_Utils_Type::T_BOOLEAN, - ) , - 'is_reserved' => array( - 'name' => 'is_reserved', - 'type' => CRM_Utils_Type::T_BOOLEAN, - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return CRM_Core_DAO::getLocaleTableName(self::$_tableName); - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['price_set'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['price_set'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } -} diff --git a/civicrm/CRM/Price/DAO/SetEntity.php b/civicrm/CRM/Price/DAO/SetEntity.php deleted file mode 100644 index 2015dbbf4205f19b6870512324f9a9c2a3815b3f..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Price/DAO/SetEntity.php +++ /dev/null @@ -1,240 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Price_DAO_SetEntity extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_price_set_entity'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = true; - /** - * Price Set Entity - * - * @var int unsigned - */ - public $id; - /** - * Table which uses this price set - * - * @var string - */ - public $entity_table; - /** - * Item in table - * - * @var int unsigned - */ - public $entity_id; - /** - * price set being used - * - * @var int unsigned - */ - public $price_set_id; - /** - * class constructor - * - * @access public - * @return civicrm_price_set_entity - */ - function __construct() - { - $this->__table = 'civicrm_price_set_entity'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'price_set_id' => 'civicrm_price_set:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'entity_table' => array( - 'name' => 'entity_table', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Entity Table') , - 'required' => true, - 'maxlength' => 64, - 'size' => CRM_Utils_Type::BIG, - ) , - 'entity_id' => array( - 'name' => 'entity_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'price_set_id' => array( - 'name' => 'price_set_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - 'FKClassName' => 'CRM_Price_DAO_Set', - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return self::$_tableName; - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['price_set_entity'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['price_set_entity'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } -} diff --git a/civicrm/CRM/Profile/Page/MultipleRecordFieldsListing.php b/civicrm/CRM/Profile/Page/MultipleRecordFieldsListing.php index b37349b8e574245eb8e19fecc6413f6615645de1..ae46a19c1537d99d5564ebf28d4cc27a5a06f631 100644 --- a/civicrm/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/civicrm/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -389,7 +389,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $actionParams['cid'] = $actionParams['entityID'] = $this->_contactId; $actionParams['recId'] = $recId; $actionParams['type'] = $this->_contactType; - $actionParams['cgcount'] = $cgcount; + $actionParams['cgcount'] = empty($DTparams['sort']) ? $cgcount : $recId; $actionParams['newCgCount'] = $newCgCount; // DELETE action links diff --git a/civicrm/CRM/Report/DAO/Instance.php b/civicrm/CRM/Report/DAO/Instance.php deleted file mode 100644 index a426a42588b92bbb5382a0fe4aead22ecb8dce1a..0000000000000000000000000000000000000000 --- a/civicrm/CRM/Report/DAO/Instance.php +++ /dev/null @@ -1,438 +0,0 @@ -<?php -/* -+--------------------------------------------------------------------+ -| CiviCRM version 4.3 | -+--------------------------------------------------------------------+ -| Copyright CiviCRM LLC (c) 2004-2013 | -+--------------------------------------------------------------------+ -| 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. | -| | -| 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 | -+--------------------------------------------------------------------+ -*/ -/** - * - * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 - * $Id$ - * - */ -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Utils/Type.php'; -class CRM_Report_DAO_Instance extends CRM_Core_DAO -{ - /** - * static instance to hold the table name - * - * @var string - * @static - */ - static $_tableName = 'civicrm_report_instance'; - /** - * static instance to hold the field values - * - * @var array - * @static - */ - static $_fields = null; - /** - * static instance to hold the FK relationships - * - * @var string - * @static - */ - static $_links = null; - /** - * static instance to hold the values that can - * be imported - * - * @var array - * @static - */ - static $_import = null; - /** - * static instance to hold the values that can - * be exported - * - * @var array - * @static - */ - static $_export = null; - /** - * static value to see if we should log any modifications to - * this table in the civicrm_log table - * - * @var boolean - * @static - */ - static $_log = false; - /** - * Report Instance ID - * - * @var int unsigned - */ - public $id; - /** - * Which Domain is this instance for - * - * @var int unsigned - */ - public $domain_id; - /** - * Report Instance Title. - * - * @var string - */ - public $title; - /** - * FK to civicrm_option_value for the report template - * - * @var string - */ - public $report_id; - /** - * when combined with report_id/template uniquely identifies the instance - * - * @var string - */ - public $name; - /** - * arguments that are passed in the url when invoking the instance - * - * @var string - */ - public $args; - /** - * Report Instance description. - * - * @var string - */ - public $description; - /** - * permission required to be able to run this instance - * - * @var string - */ - public $permission; - /** - * role required to be able to run this instance - * - * @var string - */ - public $grouprole; - /** - * Submitted form values for this report - * - * @var text - */ - public $form_values; - /** - * Is this entry active? - * - * @var boolean - */ - public $is_active; - /** - * Subject of email - * - * @var string - */ - public $email_subject; - /** - * comma-separated list of email addresses to send the report to - * - * @var text - */ - public $email_to; - /** - * comma-separated list of email addresses to send the report to - * - * @var text - */ - public $email_cc; - /** - * comma-separated list of email addresses to send the report to - * - * @var text - */ - public $header; - /** - * comma-separated list of email addresses to send the report to - * - * @var text - */ - public $footer; - /** - * FK to navigation ID - * - * @var int unsigned - */ - public $navigation_id; - /** - * FK to instance ID drilldown to - * - * @var int unsigned - */ - public $drilldown_id; - /** - * - * @var boolean - */ - public $is_reserved; - /** - * class constructor - * - * @access public - * @return civicrm_report_instance - */ - function __construct() - { - $this->__table = 'civicrm_report_instance'; - parent::__construct(); - } - /** - * return foreign links - * - * @access public - * @return array - */ - function links() - { - if (!(self::$_links)) { - self::$_links = array( - 'domain_id' => 'civicrm_domain:id', - 'navigation_id' => 'civicrm_navigation:id', - 'drilldown_id' => 'civicrm_report_instance:id', - ); - } - return self::$_links; - } - /** - * returns all the column names of this table - * - * @access public - * @return array - */ - static function &fields() - { - if (!(self::$_fields)) { - self::$_fields = array( - 'id' => array( - 'name' => 'id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - ) , - 'domain_id' => array( - 'name' => 'domain_id', - 'type' => CRM_Utils_Type::T_INT, - 'required' => true, - 'FKClassName' => 'CRM_Core_DAO_Domain', - ) , - 'title' => array( - 'name' => 'title', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Report Instance Title') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'report_id' => array( - 'name' => 'report_id', - 'type' => CRM_Utils_Type::T_STRING, - 'required' => true, - 'maxlength' => 64, - 'size' => CRM_Utils_Type::BIG, - ) , - 'name' => array( - 'name' => 'name', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Name') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'args' => array( - 'name' => 'args', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Args') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'description' => array( - 'name' => 'description', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Description') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'permission' => array( - 'name' => 'permission', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Permission') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'grouprole' => array( - 'name' => 'grouprole', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Grouprole') , - 'maxlength' => 1024, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'form_values' => array( - 'name' => 'form_values', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Submitted Form Values') , - 'import' => true, - 'where' => 'civicrm_report_instance.form_values', - 'headerPattern' => '', - 'dataPattern' => '', - 'export' => true, - ) , - 'is_active' => array( - 'name' => 'is_active', - 'type' => CRM_Utils_Type::T_BOOLEAN, - ) , - 'email_subject' => array( - 'name' => 'email_subject', - 'type' => CRM_Utils_Type::T_STRING, - 'title' => ts('Email Subject') , - 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, - ) , - 'email_to' => array( - 'name' => 'email_to', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Email To') , - ) , - 'email_cc' => array( - 'name' => 'email_cc', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Email Cc') , - ) , - 'header' => array( - 'name' => 'header', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Header') , - 'rows' => 4, - 'cols' => 60, - ) , - 'footer' => array( - 'name' => 'footer', - 'type' => CRM_Utils_Type::T_TEXT, - 'title' => ts('Footer') , - 'rows' => 4, - 'cols' => 60, - ) , - 'navigation_id' => array( - 'name' => 'navigation_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Navigation ID') , - 'import' => true, - 'where' => 'civicrm_report_instance.navigation_id', - 'headerPattern' => '', - 'dataPattern' => '', - 'export' => true, - 'FKClassName' => 'CRM_Core_DAO_Navigation', - ) , - 'drilldown_id' => array( - 'name' => 'drilldown_id', - 'type' => CRM_Utils_Type::T_INT, - 'title' => ts('Drilldown Report ID') , - 'import' => true, - 'where' => 'civicrm_report_instance.drilldown_id', - 'headerPattern' => '', - 'dataPattern' => '', - 'export' => true, - 'FKClassName' => 'CRM_Report_DAO_Instance', - ) , - 'is_reserved' => array( - 'name' => 'is_reserved', - 'type' => CRM_Utils_Type::T_BOOLEAN, - ) , - ); - } - return self::$_fields; - } - /** - * returns the names of this table - * - * @access public - * @static - * @return string - */ - static function getTableName() - { - return self::$_tableName; - } - /** - * returns if this table needs to be logged - * - * @access public - * @return boolean - */ - function getLog() - { - return self::$_log; - } - /** - * returns the list of fields that can be imported - * - * @access public - * return array - * @static - */ - static function &import($prefix = false) - { - if (!(self::$_import)) { - self::$_import = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('import', $field)) { - if ($prefix) { - self::$_import['report_instance'] = & $fields[$name]; - } else { - self::$_import[$name] = & $fields[$name]; - } - } - } - } - return self::$_import; - } - /** - * returns the list of fields that can be exported - * - * @access public - * return array - * @static - */ - static function &export($prefix = false) - { - if (!(self::$_export)) { - self::$_export = array(); - $fields = self::fields(); - foreach($fields as $name => $field) { - if (CRM_Utils_Array::value('export', $field)) { - if ($prefix) { - self::$_export['report_instance'] = & $fields[$name]; - } else { - self::$_export[$name] = & $fields[$name]; - } - } - } - } - return self::$_export; - } -} diff --git a/civicrm/CRM/Report/Form/Event/Income.php b/civicrm/CRM/Report/Form/Event/Income.php index 60b4c3bec7d9cf97afc7a0acff1b9c6f354ee5d7..51e869c7077f127656063b4837d642f5cfc3589d 100644 --- a/civicrm/CRM/Report/Form/Event/Income.php +++ b/civicrm/CRM/Report/Form/Event/Income.php @@ -279,7 +279,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { } /** - * @inheritdoc + * @inheritDoc */ public function limit($rowCount = self::ROW_COUNT_LIMIT) { parent::limit($rowCount); diff --git a/civicrm/CRM/Upgrade/Incremental/php/FourSeven.php b/civicrm/CRM/Upgrade/Incremental/php/FourSeven.php index 0d1dd5601f6b02f53e9c609788ed1bd436c559ca..da42435c132bd65caba3ba2b90656b2ce398d06c 100644 --- a/civicrm/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/civicrm/CRM/Upgrade/Incremental/php/FourSeven.php @@ -145,6 +145,15 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base $this->addTask('Add Index to financial_trxn trxn_id field', 'addIndexFinancialTrxnTrxnID'); } + /** + * Upgrade function. + * + * @param string $rev + */ + public function upgrade_4_7_1($rev) { + $this->addTask('Add Index to civicrm_contribution creditnote_id field', 'addIndexContributionCreditNoteID'); + } + /** * CRM-16354 * @@ -405,4 +414,17 @@ FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id"; return TRUE; } + /** + * CRM-17882 Add index to civicrm_contribution.credit_note_id. + * + * @param \CRM_Queue_TaskContext $ctx + * + * @return bool + */ + public function addIndexContributionCreditNoteID(CRM_Queue_TaskContext $ctx) { + $tables = array('civicrm_contribution' => array('creditnote_id')); + CRM_Core_BAO_SchemaHandler::createIndexes($tables); + return TRUE; + } + } diff --git a/civicrm/CRM/Upgrade/Incremental/sql/4.7.1.mysql.tpl b/civicrm/CRM/Upgrade/Incremental/sql/4.7.1.mysql.tpl new file mode 100644 index 0000000000000000000000000000000000000000..3dc0b34d14ae7581ed815e66ddfcefb51a7c83e6 --- /dev/null +++ b/civicrm/CRM/Upgrade/Incremental/sql/4.7.1.mysql.tpl @@ -0,0 +1,32 @@ +{* file to handle db changes in 4.7.1 during upgrade *} +# CRM-17852 - Misspeled state names in Estonia/Lithuania + +#Estonia + +SET @EstoniaCountryId = (SELECT id FROM civicrm_country cc WHERE cc.name = 'Estonia'); + +UPDATE civicrm_state_province SET name = 'Harjumaa' where name='Harjumsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Hiiumaa' where name='Hitumea' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Ida-Virumaa' where name='Ida-Virumsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Jõgevamaa' where name='Jogevamsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Järvamaa' where name='Jarvamsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Läänemaa' where name='Lasnemsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Lääne-Virumaa' where name='Laane-Virumaa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Põlvamaa' where name='Polvamea' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Pärnumaa' where name='Parnumsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Raplamaa' where name='Raplamsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Saaremaa' where name='Saaremsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Tartumaa' where name='Tartumsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Viljandimaa' where name='Viljandimsa' AND country_id = @EstoniaCountryId; +UPDATE civicrm_state_province SET name = 'Võrumaa' where name='Vorumaa' AND country_id = @EstoniaCountryId; + +#Lithuania + +SET @LithuaniaCountryId = (SELECT id FROM civicrm_country cc WHERE cc.name = 'Lithuania'); + +UPDATE civicrm_state_province SET name = 'Klaipėdos Apskritis' where name='Klaipedos Apskritis' AND country_id = @LithuaniaCountryId; +UPDATE civicrm_state_province SET name = 'Marijampolės Apskritis' where name='Marijampoles Apskritis' AND country_id = @LithuaniaCountryId; +UPDATE civicrm_state_province SET name = 'Panevėžio Apskritis' where name='Panevezio Apskritis' AND country_id = @LithuaniaCountryId; +UPDATE civicrm_state_province SET name = 'Šiaulių Apskritis' where name='Sisuliu Apskritis' AND country_id = @LithuaniaCountryId; +UPDATE civicrm_state_province SET name = 'Tauragės Apskritis' where name='Taurages Apskritis' AND country_id = @LithuaniaCountryId; +UPDATE civicrm_state_province SET name = 'Telšių Apskritis' where name='Telsiu Apskritis' AND country_id = @LithuaniaCountryId; diff --git a/civicrm/CRM/Utils/Array.php b/civicrm/CRM/Utils/Array.php index 4ace0a208681ca3b920098479e5096756eccb4fc..17fc32963be70b71f824b90dcf4b04018c39374a 100644 --- a/civicrm/CRM/Utils/Array.php +++ b/civicrm/CRM/Utils/Array.php @@ -106,7 +106,7 @@ class CRM_Utils_Array { * @return int|string|null * Returns the key, which could be an int or a string, or NULL on failure. */ - public static function key($value, &$list) { + public static function key($value, $list) { if (is_array($list)) { $key = array_search($value, $list); diff --git a/civicrm/CRM/Utils/Check/Component/Security.php b/civicrm/CRM/Utils/Check/Component/Security.php index 828ccf69d473d6a4eb7f44477efcba167c2a17b8..3d2e37ec5e579303cf43c86b26dab9b794a97167 100644 --- a/civicrm/CRM/Utils/Check/Component/Security.php +++ b/civicrm/CRM/Utils/Check/Component/Security.php @@ -246,7 +246,7 @@ class CRM_Utils_Check_Component_Security extends CRM_Utils_Check_Component { if (file_exists($file[0])) { $messages[] = new CRM_Utils_Check_Message( __FUNCTION__, - ts('File \'%1\' presents a security risk and should be deleted.', array(1 => $file)), + ts('File \'%1\' presents a security risk and should be deleted.', array(1 => $file[0])), ts('Unsafe Files'), $file[1], 'fa-lock' diff --git a/civicrm/CRM/Utils/System/Drupal8.php b/civicrm/CRM/Utils/System/Drupal8.php index d626e9cb3dede7ce949a9b317ff7530555072dba..09f95cd0d524572882a5a6180eca598c92554eb3 100644 --- a/civicrm/CRM/Utils/System/Drupal8.php +++ b/civicrm/CRM/Utils/System/Drupal8.php @@ -450,7 +450,7 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { chdir($root); // Create a mock $request object - $autoloader = require_once $root . '/core/vendor/autoload.php'; + $autoloader = require_once $root . '/vendor/autoload.php'; // @Todo: do we need to handle case where $_SERVER has no HTTP_HOST key, ie. when run via cli? $request = new \Symfony\Component\HttpFoundation\Request(array(), array(), array(), array(), array(), $_SERVER); @@ -546,4 +546,20 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase { } } + /** + * @inheritDoc + */ + public function getModules() { + $modules = array(); + + $module_data = system_rebuild_module_data(); + foreach ($module_data as $module_name => $extension) { + if (!isset($extension->info['hidden']) && $extension->origin != 'core') { + $extension->schema_version = drupal_get_installed_schema_version($module_name); + $modules[] = new CRM_Core_Module('drupal.' . $module_name, ($extension->status == 1 ? TRUE : FALSE)); + } + } + return $modules; + } + } diff --git a/civicrm/CRM/Utils/System/WordPress.php b/civicrm/CRM/Utils/System/WordPress.php index 63ab4e3dbabb9d7cb470d3242a4020c8b6ac9f3b..4f8c32b30583b98f1d1e6f4e43e2f40cc93641c7 100644 --- a/civicrm/CRM/Utils/System/WordPress.php +++ b/civicrm/CRM/Utils/System/WordPress.php @@ -578,9 +578,8 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { $errors[$emailName] = "Your email is invaid"; } elseif (email_exists($params['mail'])) { - $resetUrl = $config->userFrameworkBaseURL . 'wp-login.php?action=lostpassword'; $errors[$emailName] = ts('The email address %1 already has an account associated with it. <a href="%2">Have you forgotten your password?</a>', - array(1 => $params['mail'], 2 => $resetUrl) + array(1 => $params['mail'], 2 => wp_lostpassword_url()) ); } } @@ -650,8 +649,7 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { */ public function getLoginURL($destination = '') { $config = CRM_Core_Config::singleton(); - $loginURL = $config->userFrameworkBaseURL; - $loginURL .= 'wp-login.php'; + $loginURL = wp_login_url(); return $loginURL; } diff --git a/civicrm/Civi/API/ExternalBatch.php b/civicrm/Civi/API/ExternalBatch.php index 1ff9282d0ad1326bd730fd808051ac963de9d362..1a2230077ac6e8b4b038bca0908144ebca336bfa 100644 --- a/civicrm/Civi/API/ExternalBatch.php +++ b/civicrm/Civi/API/ExternalBatch.php @@ -28,7 +28,7 @@ class ExternalBatch { protected $settingsPath; - protected $env = array(); + protected $env; /** * @var array @@ -51,6 +51,7 @@ class ExternalBatch { $this->root = $civicrm_root; $this->settingsPath = defined('CIVICRM_SETTINGS_PATH') ? CIVICRM_SETTINGS_PATH : NULL; $this->defaultParams = $defaultParams; + $this->env = $_ENV; } /** @@ -179,23 +180,35 @@ class ExternalBatch { public function createProcess($apiCall) { $parts = array(); - $executableFinder = new PhpExecutableFinder(); - $php = $executableFinder->find(); - if (!$php) { - throw new \CRM_Core_Exception("Failed to locate PHP interpreter."); + if (defined('CIVICRM_TEST') && CIVICRM_TEST) { + // When testing, civicrm.settings.php may rely on $_CV, which is only + // populated/propagated if we execute through `cv`. + $parts[] = 'cv api'; + $parts[] = escapeshellarg($apiCall['entity'] . '.' . $apiCall['action']); + $parts[] = "--out=json-strict"; + foreach ($apiCall['params'] as $key => $value) { + $parts[] = escapeshellarg("$key=$value"); + } } - $parts[] = $php; - - $parts[] = escapeshellarg($this->root . '/bin/cli.php'); - $parts[] = escapeshellarg("-e=" . $apiCall['entity']); - $parts[] = escapeshellarg("-a=" . $apiCall['action']); - $parts[] = "--json"; - $parts[] = escapeshellarg("-u=dummyuser"); - foreach ($apiCall['params'] as $key => $value) { - $parts[] = escapeshellarg("--$key=$value"); + else { + // But in production, we may not have `cv` installed. + $executableFinder = new PhpExecutableFinder(); + $php = $executableFinder->find(); + if (!$php) { + throw new \CRM_Core_Exception("Failed to locate PHP interpreter."); + } + $parts[] = $php; + $parts[] = escapeshellarg($this->root . '/bin/cli.php'); + $parts[] = escapeshellarg("-e=" . $apiCall['entity']); + $parts[] = escapeshellarg("-a=" . $apiCall['action']); + $parts[] = "--json"; + $parts[] = escapeshellarg("-u=dummyuser"); + foreach ($apiCall['params'] as $key => $value) { + $parts[] = escapeshellarg("--$key=$value"); + } } - $command = implode(" ", $parts); + $command = implode(" ", $parts); $env = array_merge($this->env, array( 'CIVICRM_SETTINGS' => $this->settingsPath, )); diff --git a/civicrm/Civi/API/Provider/AdhocProvider.php b/civicrm/Civi/API/Provider/AdhocProvider.php index 93612675405720130acce9d3fdb6058dcddc7b64..3664a17f20d66402a392530279dbed30bd15743b 100644 --- a/civicrm/Civi/API/Provider/AdhocProvider.php +++ b/civicrm/Civi/API/Provider/AdhocProvider.php @@ -123,7 +123,7 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { } /** - * {inheritdoc} + * @inheritDoc * @param array $apiRequest * @return array|mixed */ @@ -132,7 +132,7 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { } /** - * {inheritdoc} + * @inheritDoc * @param int $version * @return array */ @@ -141,7 +141,7 @@ class AdhocProvider implements EventSubscriberInterface, ProviderInterface { } /** - * {inheritdoc} + * @inheritDoc * @param int $version * @param string $entity * @return array diff --git a/civicrm/Civi/API/Provider/MagicFunctionProvider.php b/civicrm/Civi/API/Provider/MagicFunctionProvider.php index 5ecf8bddcabeb8561074ecf29ffd4cea9759958a..2dbe6679c1434eaf36addd31a091d6169707321d 100644 --- a/civicrm/Civi/API/Provider/MagicFunctionProvider.php +++ b/civicrm/Civi/API/Provider/MagicFunctionProvider.php @@ -73,7 +73,7 @@ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterfa } /** - * {inheritdoc} + * @inheritDoc * @param array $apiRequest * @return array */ @@ -92,7 +92,7 @@ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterfa } /** - * {inheritdoc} + * @inheritDoc * @param int $version * @return array */ @@ -134,7 +134,7 @@ class MagicFunctionProvider implements EventSubscriberInterface, ProviderInterfa } /** - * {inheritdoc} + * @inheritDoc * @param int $version * @param string $entity * @return array diff --git a/civicrm/Civi/API/Provider/ReflectionProvider.php b/civicrm/Civi/API/Provider/ReflectionProvider.php index c750ff7be1bfd61234769e3ba84ef81c646ee213..aebc8057f200592303a55c4e3b1045b74e76d5bd 100644 --- a/civicrm/Civi/API/Provider/ReflectionProvider.php +++ b/civicrm/Civi/API/Provider/ReflectionProvider.php @@ -104,7 +104,7 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface } /** - * {inheritdoc} + * @inheritDoc * @param array $apiRequest * @return array * @throws \API_Exception @@ -128,7 +128,7 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface } /** - * {inheritdoc} + * @inheritDoc * @param int $version * @return array */ @@ -137,7 +137,7 @@ class ReflectionProvider implements EventSubscriberInterface, ProviderInterface } /** - * {inheritdoc} + * @inheritDoc * @param int $version * @param string $entity * @return array diff --git a/civicrm/Civi/Core/Container.php b/civicrm/Civi/Core/Container.php index fdcf1b15593841470cf23f61117049a468496384..68404a6028ddd14ac9c05a42d1d3c3ad55841f0d 100644 --- a/civicrm/Civi/Core/Container.php +++ b/civicrm/Civi/Core/Container.php @@ -226,6 +226,7 @@ class Container { public function createEventDispatcher($container) { $dispatcher = new ContainerAwareEventDispatcher($container); $dispatcher->addListener(SystemInstallEvent::EVENT_NAME, array('\Civi\Core\InstallationCanary', 'check')); + $dispatcher->addListener(SystemInstallEvent::EVENT_NAME, array('\Civi\Core\DatabaseInitializer', 'initialize')); $dispatcher->addListener('hook_civicrm_post::Activity', array('\Civi\CCase\Events', 'fireCaseChange')); $dispatcher->addListener('hook_civicrm_post::Case', array('\Civi\CCase\Events', 'fireCaseChange')); $dispatcher->addListener('hook_civicrm_caseChange', array('\Civi\CCase\Events', 'delegateToXmlListeners')); diff --git a/civicrm/Civi/Core/DatabaseInitializer.php b/civicrm/Civi/Core/DatabaseInitializer.php new file mode 100644 index 0000000000000000000000000000000000000000..91ead0c6d4a4759af6d5733ecf508158a0996681 --- /dev/null +++ b/civicrm/Civi/Core/DatabaseInitializer.php @@ -0,0 +1,53 @@ +<?php +/* + +--------------------------------------------------------------------+ + | CiviCRM version 4.7 | + +--------------------------------------------------------------------+ + | Copyright CiviCRM LLC (c) 2004-2015 | + +--------------------------------------------------------------------+ + | 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. | + | | + | 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 | + +--------------------------------------------------------------------+ + */ + +namespace Civi\Core; + +use Civi\Core\Event\SystemInstallEvent; + +/** + * Class DatabaseInitializer + * @package Civi\Core + */ +class DatabaseInitializer { + + /** + * Flush system to build the menu and MySQL triggers + * + * @param \Civi\Core\Event\SystemInstallEvent $event + * @throws \CRM_Core_Exception + */ + public static function initialize(SystemInstallEvent $event) { + $api_params = array( + 'version' => 3, + 'triggers' => 1, + 'session' => 1, + ); + civicrm_api('System', 'flush', $api_params); + } + +} diff --git a/civicrm/ang/crmCxn/ManageCtrl.js b/civicrm/ang/crmCxn/ManageCtrl.js index 12bba3c4e5aad7d5954e2270edd802845af68050..b23901b0cf4fc6413309efbbed114d641361e6d3 100644 --- a/civicrm/ang/crmCxn/ManageCtrl.js +++ b/civicrm/ang/crmCxn/ManageCtrl.js @@ -98,7 +98,7 @@ }; $scope.openLink = function openLink(appMeta, page, options) { - var promise = crmApi('Cxn', 'getlink', {app_guid: appMeta.appId, page: page}).then(function(result) { + var promise = crmApi('Cxn', 'getlink', {app_guid: appMeta.appId, page_name: page}).then(function(result) { var mode = result.values.mode ? result.values.mode : 'popup'; switch (result.values.mode) { case 'iframe': diff --git a/civicrm/api/v3/Cxn.php b/civicrm/api/v3/Cxn.php index 25d9ee9f5a0151719c7dbf880b130c2e204a93de..c080f70761dcafef0cf76090d3f3204d5e256c34 100644 --- a/civicrm/api/v3/Cxn.php +++ b/civicrm/api/v3/Cxn.php @@ -222,13 +222,14 @@ function _civicrm_api3_cxn_getlink_spec(&$spec) { $daoFields = CRM_Cxn_DAO_Cxn::fields(); $spec['app_guid'] = $daoFields['app_guid']; $spec['cxn_guid'] = $daoFields['cxn_guid']; - $spec['page'] = array( - 'name' => 'page', + $spec['page_name'] = array( + 'name' => 'page_name', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Page Type'), 'description' => 'The type of page (eg "settings")', 'maxlength' => 63, 'size' => CRM_Utils_Type::HUGE, + 'api.aliases' => array('page'), ); } @@ -245,14 +246,14 @@ function civicrm_api3_cxn_getlink($params) { $cxnId = _civicrm_api3_cxn_parseCxnId($params); $appMeta = CRM_Cxn_BAO_Cxn::getAppMeta($cxnId); - if (empty($params['page']) || !is_string($params['page'])) { + if (empty($params['page_name']) || !is_string($params['page_name'])) { throw new API_Exception("Invalid page"); } /** @var \Civi\Cxn\Rpc\RegistrationClient $client */ $client = \Civi::service('cxn_reg_client'); return $client->call($appMeta, 'Cxn', 'getlink', array( - 'page' => $params['page'], + 'page' => $params['page_name'], )); } @@ -270,19 +271,6 @@ function civicrm_api3_cxn_getcfg($params) { 'siteCallbackUrl' => CRM_Cxn_BAO_Cxn::getSiteCallbackUrl(), ); return civicrm_api3_create_success($result); - - $cxnId = _civicrm_api3_cxn_parseCxnId($params); - $appMeta = CRM_Cxn_BAO_Cxn::getAppMeta($cxnId); - - if (empty($params['page']) || !is_string($params['page'])) { - throw new API_Exception("Invalid page"); - } - - /** @var \Civi\Cxn\Rpc\RegistrationClient $client */ - $client = \Civi\Core\Container::singleton()->get('cxn_reg_client'); - return $client->call($appMeta, 'Cxn', 'getlink', array( - 'page' => $params['page'], - )); } /** diff --git a/civicrm/api/v3/Mailing.php b/civicrm/api/v3/Mailing.php index 7463032416d75a8f591dccc8157fc6df6e01b5dd..6b7d164058e5190894279865f3e7ecb25cf074da 100755 --- a/civicrm/api/v3/Mailing.php +++ b/civicrm/api/v3/Mailing.php @@ -544,7 +544,7 @@ function civicrm_api3_mailing_preview($params) { $details = CRM_Utils_Token::getTokenDetails($mailingParams, $returnProperties, TRUE, TRUE, NULL, $mailing->getFlattenedTokens()); - $mime = &$mailing->compose(NULL, NULL, NULL, $session->get('userID'), $fromEmail, $fromEmail, + $mime = $mailing->compose(NULL, NULL, NULL, $session->get('userID'), $fromEmail, $fromEmail, TRUE, $details[0][$contactID], $attachments ); diff --git a/civicrm/api/v3/Order.php b/civicrm/api/v3/Order.php index 4ef1b32b250a862ee83d5b8c1bd743ba160e1291..7580405072b9dfe51216d6acd5584c2c9cbbb7c4 100644 --- a/civicrm/api/v3/Order.php +++ b/civicrm/api/v3/Order.php @@ -59,3 +59,97 @@ function civicrm_api3_order_get($params) { $params['sequential'] = $isSequential; return civicrm_api3_create_success($contributions, $params, 'Order', 'get'); } + +/** + * Add or update a Order. + * + * @param array $params + * Input parameters. + * + * @throws API_Exception + * @return array + * Api result array + */ +function civicrm_api3_order_create(&$params) { + $contribution = array(); + $entity = NULL; + $entityIds = array(); + if (CRM_Utils_Array::value('line_items', $params) && is_array($params['line_items'])) { + $priceSetID = NULL; + CRM_Contribute_BAO_Contribution::checkLineItems($params); + foreach ($params['line_items'] as $lineItems) { + $entityParams = CRM_Utils_Array::value('params', $lineItems, array()); + if (!empty($entityParams) && !empty($lineItems['line_item'])) { + $item = reset($lineItems['line_item']); + $entity = str_replace('civicrm_', '', $item['entity_table']); + } + if ($entityParams) { + if (in_array($entity, array('participant', 'membership'))) { + $entityParams['skipLineItem'] = TRUE; + $entityResult = civicrm_api3($entity, 'create', $entityParams); + $params['contribution_mode'] = $entity; + $entityIds[] = $params[$entity . '_id'] = $entityResult['id']; + foreach ($lineItems['line_item'] as &$items) { + $items['entity_id'] = $entityResult['id']; + } + } + else { + // pledge payment + } + } + if (empty($priceSetID)) { + $item = reset($lineItems['line_item']); + $priceSetID = civicrm_api3('PriceField', 'getvalue', array( + 'return' => 'price_set_id', + 'id' => $item['price_field_id'], + )); + $params['line_item'][$priceSetID] = array(); + } + $params['line_item'][$priceSetID] = array_merge($params['line_item'][$priceSetID], $lineItems['line_item']); + } + } + $contribution = civicrm_api3('Contribution', 'create', $params); + // add payments + if ($entity && CRM_Utils_Array::value('id', $contribution)) { + foreach ($entityIds as $entityId) { + $paymentParams = array( + 'contribution_id' => $contribution['id'], + $entity . '_id' => $entityId, + ); + // if entity is pledge then build pledge param + if ($entity == 'pledge') { + $paymentParams += $entityParams; + } + $payments = civicrm_api3($entity . '_payment', 'create', $paymentParams); + } + } + return civicrm_api3_create_success(CRM_Utils_Array::value('values', $contribution), $params, 'Order', 'create'); +} + +/** + * Adjust Metadata for Create action. + * + * The metadata is used for setting defaults, documentation & validation. + * + * @param array $params + * Array of parameters determined by getfields. + */ +function _civicrm_api3_order_create_spec(&$params) { + $params['contact_id'] = array( + 'name' => 'contact_id', + 'title' => 'Contact ID', + 'type' => CRM_Utils_Type::T_INT, + 'api.required' => TRUE, + ); + $params['total_amount'] = array( + 'name' => 'total_amount', + 'title' => 'Total Amount', + 'api.required' => TRUE, + ); + $params['financial_type_id'] = array( + 'name' => 'financial_type_id', + 'title' => 'Financial Type', + 'type' => CRM_Utils_Type::T_INT, + 'api.required' => TRUE, + ); +} diff --git a/civicrm/bin/setup.conf b/civicrm/bin/setup.conf new file mode 100644 index 0000000000000000000000000000000000000000..e6c119c260be55e39f6d4e54ed969cf59d2efb8e --- /dev/null +++ b/civicrm/bin/setup.conf @@ -0,0 +1,59 @@ +# Define the path for civicrm source directory here +CIVISOURCEDIR= + +# define your schema file name here, will be overriden by +# FIRST command line argument if given +SCHEMA=schema/Schema.xml + +## define your database host and port here +DBHOST= +DBPORT= + +# define your database name here, will be overriden by +# SECOND command line argument if given +DBNAME= + +# define your database usernamename here, will be overriden by +# THIRD command line argument if given +DBUSER= + +# define your database password here, will be overriden by +# FOURTH command line argument if given +DBPASS= + +# any extra args you need in your mysql connect string +# number of arguments should be specified within "" +# FIFTH command line argument if given +DBARGS="" + +# set your PHP5 bin dir path here, if it's not in PATH +# The path should be terminated with dir separator! +PHP5PATH= + +# Set a special DB load filename here for custom installs +# If a filename is passed, civicrm_data.mysql AND the +# passed file will be loaded instead of civicrm_generated.mysql. +# The DBLOAD file must be in the sql directory. +DBLOAD= + +# Set a special SQL filename here which you want to load +# IN ADDITION TO either civicrm_generated or civicrm_data. +# The DBADD file must be in the sql directory. +# DBADD= + +# GenCode produces localized data files for all known +# locales. This is good for stable-releases but +# cumbersome during development. To speed it up, +# list the desired locales. +# export CIVICRM_LOCALES=en_US,fr_FR + +# GenCode produces some CMS-specific config files +# If omitted, defaults to drupal. +GENCODE_CMS="" +# GENCODE_CMS=drupal +# GENCODE_CMS=wordpress + +# GenCode is relatively slow; and, usually, it only needs +# to run if the gencode files have changed. Set +# this option to enable caching (and speed up setup.sh) +# export CIVICRM_GENCODE_DIGEST=/tmp/gencode.md5 diff --git a/civicrm/bower_components/lodash-compat/.bower.json b/civicrm/bower_components/lodash-compat/.bower.json index 5f53c7a60e2df15e7c55e004a06486b019ce4434..399db377aa74735e0c198c0252d5eb0eeb760a2a 100644 --- a/civicrm/bower_components/lodash-compat/.bower.json +++ b/civicrm/bower_components/lodash-compat/.bower.json @@ -15,7 +15,7 @@ "_resolution": { "type": "version", "tag": "3.0.1", - "commit": "4102b7689f595c76655be45eacc1c2a04cdca8aa" + "commit": "c0dd92d1e5c993c632d8efeb083d6b2ace640118" }, "_source": "git://github.com/lodash/lodash-compat.git", "_target": "~3.0", diff --git a/civicrm/civicrm-version.php b/civicrm/civicrm-version.php index 9a7ac8989e6ef9d5f6db99f3fc81e3c72825972f..996b64a518c42ea8280affa418fe1fbb6c3d6a6c 100644 --- a/civicrm/civicrm-version.php +++ b/civicrm/civicrm-version.php @@ -1,7 +1,7 @@ <?php function civicrmVersion( ) { - return array( 'version' => '4.7.0', + return array( 'version' => '4.7.1', 'cms' => 'Wordpress', - 'revision' => '' ); + 'revision' => '9197af85b5' ); } diff --git a/civicrm/civicrm.config.php b/civicrm/civicrm.config.php index ce0cbb55977fcd02e28131c991467d249f650d17..e073e71b42aa77ad1e200e78f736e79d25ddfc5b 100644 --- a/civicrm/civicrm.config.php +++ b/civicrm/civicrm.config.php @@ -1,117 +1,411 @@ <?php // WORD PRESS VARIANT of civicrm.config.php +// COPY OF Bootstrap.php from https://github.com/civicrm/cv +namespace Civi\Cv; /** - * This function has been copied from DRUPAL_ROOT/includes/bootstrap.inc - */ - -/** - * Locate the appropriate configuration file. + * Bootstrap the CiviCRM runtime. * - * Try finding a matching configuration directory by stripping the - * website's hostname from left to right and pathname from right to - * left. The first configuration file found will be used, the - * remaining will ignored. If no configuration file is found, - * return a default value '$confdir/default'. + * @code + * // Use default bootstrap + * require_once '/path/to/Civi/Bootstrap.php'; + * Civi\Bootstrap::singleton()->boot(); * - * Example for a fictitious site installed at - * http://www.drupal.org/mysite/test/ the 'settings.php' is - * searched in the following directories: + * // Use custom bootstrap + * require_once '/path/to/Civi/Bootstrap.php'; + * Civi\Bootstrap::singleton()->boot(array( + * 'settingsFile' => '/path/to/civicrm.settings.php', + * )); + * @endcode * - * 1. $confdir/www.drupal.org.mysite.test - * 2. $confdir/drupal.org.mysite.test - * 3. $confdir/org.mysite.test + * This class is intended to be run *before* the classloader is available. Therefore, it + * must be self-sufficient. * - * 4. $confdir/www.drupal.org.mysite - * 5. $confdir/drupal.org.mysite - * 6. $confdir/org.mysite + * A key issue is locating the civicrm.settings.php file -- this is complicated because + * each CMS has a different structure, because some CMS's have multisite features, and + * because we don't know who's calling us. * - * 7. $confdir/www.drupal.org - * 8. $confdir/drupal.org - * 9. $confdir/org + * By default, bootstrap will search as follows: + * - Check ../settings_location.php for define(CIVICRM_CONFDIR) + * - Check ENV['CIVICRM_SETTINGS'] + * - Check $options['settingsFile'] + * - Scan PWD and every ancestor directory to see if it + * contains civicrm.settings.php in one of the + * standard subdirectories. * - * 10. $confdir/default + * Recommendations: + * - Administrators with an unusual directory structure should either: + * - Set env var CIVICRM_SETTINGS in their httpd vhost and bashrc, or + * - Create settings_location.php + * - Primary CMS-integration modules should preemptively configure the + * defaults so that other code may bootstrap without specifying options. + * require_once $cividir/Civi/Bootstrap.php + * Civi\Bootstrap::singleton()->setOptions( + * 'settingsFile' => ..., + * 'search' => FALSE, + * )); + * - External scripts should call: + * require_once $cividir/Civi/Bootstrap.php; + * Civi\Bootstrap::singleton()->boot(); + * - Administrators who are concerned about bootstrap time for external + * scripts should use CIVICRM_SETTINGS or settings_location.php. + * - Pre-installation programs (code-generators, installers, etc) should not + * use Civi\Bootstrap. Instead, they should use CRM_Core_ClassLoader. * + * The bootstrapper accepts a few options (either via setOptions() or boot()). They are: + * - dynamicSettingsFile: string|NULL. The location of a PHP file which dynamically + * determines the location of civicrm.settings.php. This is provided for backward + * compatibility. + * (Default: $civiRoot/settings_location.php) + * - cmsType: string|NULL. Give a hint to the search algorithm about which + * type of CMS is being used. + * (Default: NULL) + * - env: string|NULL. The environment variable which may contain the path to + * civicrm.settings.php. Set NULL to disable. + * (Default: CIVICRM_SETTINGS) + * - prefetch: bool. Whether to load various caches. + * (Default: TRUE) + * - settingsFile: string|NULL. The full path to the civicrm.settings.php + * (Default: NULL) + * - search: bool|string. Attempt to determine root+settings by searching + * the file system and checking against common Civi directory structures. + * Boolean TRUE means it should use a default (PWD). + * (Default: TRUE aka PWD) + * + * TODO: Consider adding flags for CMS bootstrap. + * + * @package Civi */ +class Bootstrap { + + protected static $singleton = NULL; + + protected $options = array(); + + /** + * @return Bootstrap + */ + public static function singleton() { + if (self::$singleton === NULL) { + self::$singleton = new Bootstrap(array( + 'dynamicSettingsFile' => dirname(__DIR__) . '/settings_location.php', + 'env' => 'CIVICRM_SETTINGS', + 'prefetch' => TRUE, + 'settingsFile' => NULL, + 'search' => TRUE, + 'cmsType' => NULL, + 'httpHost' => array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : '', + )); + } + return self::$singleton; + } + + /** + * @param array $options + * See options in class doc. + */ + public function __construct($options = array()) { + $this->options = $options; + } + + /** + * Bootstrap the CiviCRM runtime. + * + * @param array $options + * See options in class doc. + * @throws \Exception + */ + public function boot($options = array()) { + if (!defined('CIVICRM_SETTINGS_PATH')) { + $this->options = $options = array_merge($this->options, $options); + + $settings = $this->getCivicrmSettingsPhp($options); + if (empty($settings) || !file_exists($settings)) { + throw new \Exception("Failed to locate civicrm.settings.php. Please boot with settingsFile, search, or CIVICRM_SETTINGS; or normalize your directory structure."); + } -function civicrm_conf_init() { - global $skipConfigError; +// $reader = new SiteConfigReader($settings); +// $GLOBALS['_CV'] = $reader->compile(array('buildkit', 'home')); - static $conf = ''; + define('CIVICRM_SETTINGS_PATH', $settings); + $error = @include_once $settings; + if ($error == FALSE) { + throw new \Exception("Could not load the CiviCRM settings file: {$settings}"); + } - if ($conf) { - return $conf; + list ($cmsType, $cmsBasePath) = $this->findCmsRoot($this->getSearchDir()); + $_SERVER['SCRIPT_FILENAME'] = $cmsBasePath . '/index.php'; + $_SERVER['REMOTE_ADDR'] = "127.0.0.1"; + $_SERVER['SERVER_SOFTWARE'] = NULL; + $_SERVER['REQUEST_METHOD'] = 'GET'; + if (ord($_SERVER['SCRIPT_NAME']) != 47) { + $_SERVER['SCRIPT_NAME'] = '/' . $_SERVER['SCRIPT_NAME']; + } + } + + // Backward compatibility - New civicrm.settings.php files include + // the classloader, but old ones don't. + global $civicrm_root; + require_once $civicrm_root . '/CRM/Core/ClassLoader.php'; + \CRM_Core_ClassLoader::singleton()->register(); + + if (!empty($options['prefetch'])) { + // I'm not sure why this is called explicitly during bootstrap + // rather than lazily. However, it seems to be done by all + // the existing bootstrap code. Perhaps initializing Config + // has a side-effect of initializing other things? + \CRM_Core_Config::singleton(); + } + } + + /** + * Generate bootstrap logic. + * + * NOTE: Assumes boot() has already run. + * + * @return string + * PHP code. + */ + public function generate() { + $code = array(); + + $code[] = 'if (PHP_SAPI === "cli") {'; + $srvVars = array( + 'SCRIPT_FILENAME', + 'REMOTE_ADDR', + 'SERVER_SOFTWARE', + 'REQUEST_METHOD', + 'SCRIPT_NAME' + ); + foreach ($srvVars as $srvVar) { + $code [] = sprintf('$_SERVER["%s"] = %s;', + $srvVar, var_export($_SERVER[$srvVar], 1)); + } + foreach (array('CIVICRM_UF') as $envVar) { + if (getenv($envVar)) { + $code[] = sprintf('putenv("%s=" . %s);', $envVar, var_export(getenv($envVar), 1)); + $code[] = sprintf('$_ENV["%s"] = %s;', $envVar, var_export(getenv($envVar), 1)); + } + } + $code [] = '}'; + + $code [] = sprintf('$GLOBALS[\'_CV\'] = %s;', var_export($GLOBALS['_CV'], 1)); + + $code [] = sprintf('define("CIVICRM_SETTINGS_PATH", %s);', var_export(CIVICRM_SETTINGS_PATH, 1)); + $code [] = '$error = @include_once CIVICRM_SETTINGS_PATH;'; + $code [] = 'if ($error == FALSE) {'; + $code [] = ' throw new \Exception("Could not load the CiviCRM settings file: {$settings}");'; + $code [] = '}'; + + $code [] = 'require_once $GLOBALS["civicrm_root"] . "/CRM/Core/ClassLoader.php";'; + $code [] = '\CRM_Core_ClassLoader::singleton()->register();'; + + return implode("\n", $code); + } + + /** + * @return array + * See options in class doc. + */ + public function getOptions() { + return $this->options; + } + + /** + * @param array $options + * See options in class doc. + */ + public function setOptions($options) { + $this->options = $options; + } + + /** + * @param array $options + * @return string + * @throws \Exception + */ + public function getCivicrmSettingsPhp($options) { + if (!empty($options['dynamicSettingsFile']) && file_exists($options['dynamicSettingsFile'])) { + include $options['dynamicSettingsFile']; } /** - * We are within the civicrm module, the drupal root is 2 links - * above us, so use that + * @var string + * Path to the settings file. */ - $currentDir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; - if ( file_exists( $currentDir . 'settings_location.php' ) ) { - include $currentDir . 'settings_location.php'; - } - - if ( defined( 'CIVICRM_CONFDIR' ) && ! isset( $confdir ) ) { - $confdir = CIVICRM_CONFDIR; - } else { - // make it relative to civicrm.config.php, else php makes it relative - // to the script that invokes it - $moduleDir = 'sites' . DIRECTORY_SEPARATOR . 'all' . DIRECTORY_SEPARATOR . 'modules'; - $contribDir = $moduleDir . DIRECTORY_SEPARATOR . 'contrib'; - // check to see if this is under sites/all/modules/contrib - if ( strpos( $currentDir, $contribDir ) !== false ) { - $confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'; - // check to see if this is under sites/all/modules - } else if ( strpos( $currentDir, $moduleDir ) !== false ) { - $confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'; - } else if ( strpos( $currentDir, 'plugins' . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm' ) !== false ) { - //if its wordpress - $confdir = $currentDir . DIRECTORY_SEPARATOR . '..'; - } else { - $confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR; - } + $settings = NULL; + + if (defined('CIVICRM_CONFDIR') && file_exists(CIVICRM_CONFDIR . '/civicrm.settings.php')) { + $settings = CIVICRM_CONFDIR . '/civicrm.settings.php'; + } + elseif (!empty($options['env']) && getenv($options['env']) && file_exists(getenv($options['env']))) { + $settings = getenv($options['env']); } + elseif (!empty($options['settingsFile']) && file_exists($options['settingsFile'])) { + $settings = $options['settingsFile']; + } + elseif (!empty($options['search'])) { + list (, , $settings) = $this->findCivicrmSettingsPhp($this->getSearchDir()); + } + + return $settings; + } + + /** + * Locate a civicrm.settings.php using normal directory structures. + * + * @param string $searchDir + * The directory from which to begin the upward search. + * @return array + * Array(string $cmsType, string $cmsRoot, string $settingsFile). + */ + protected function findCivicrmSettingsPhp($searchDir) { + list ($cmsType, $cmsRoot) = $this->findCmsRoot($searchDir); + + $settings = NULL; + switch ($cmsType) { + case 'backdrop': + $settings = $this->findFirstFile( + array_merge($this->findDrupalDirs($cmsRoot), array($cmsRoot)), + 'civicrm.settings.php' + ); + break; + + case 'drupal': + $settings = $this->findFirstFile($this->findDrupalDirs($cmsRoot), 'civicrm.settings.php'); + break; - if ( file_exists( $confdir . DIRECTORY_SEPARATOR . 'civicrm.settings.php' ) ) { - return $confdir; + case 'joomla': + // Note: Joomla technically has two copies of civicrm.settings.php with + // slightly different values of CIVICRM_UF_BASEURL. It appears that Joomla + // always used the admin copy for CLI/bin/extern scripts, so we do the + // same. However, the arrangement seems gratuitous considering that WP + // has the same frontend/backend split and does not need two copies of + // civicrm.settings.php. + + $settings = $cmsRoot . 'administrator/components/com_civicrm/civicrm.settings.php'; + // $result = $cmsRoot . 'components/com_civicrm/civicrm.settings.php'; + break; + + case 'wp': + $wpDirs = array( + $cmsRoot . '/*/uploads/civicrm', + $cmsRoot . '/*/plugins/civicrm', + ); + $settings = $this->findFirstFile($wpDirs, 'civicrm.settings.php'); + break; } + return array($cmsType, $cmsRoot, $settings); + } - if ( ! file_exists( $confdir ) && ! $skipConfigError ) { - echo "Could not find valid configuration dir, best guess: $confdir<br/><br/>\n"; - exit( ); + /** + * Get an ordered list of multisite dirs that might apply to this request. + * + * @param string $cmsRoot + * The root of the Drupal installation. + * @return array + */ + protected function findDrupalDirs($cmsRoot) { + $dirs = array(); + $server = explode('.', implode('.', array_reverse(explode(':', rtrim($this->options['httpHost'], '.'))))); + for ($j = count($server); $j > 0; $j--) { + $dirs[] = "$cmsRoot/sites/" . implode('.', array_slice($server, -$j)); } + $dirs[] = "$cmsRoot/sites/default"; + return $dirs; + } + + /** + * @param string $searchDir + * The directory from which to begin the upward search. + * @return array + * Array(string $cmsType, string $cmsRoot, string $civiRoot) + */ + protected function findCmsRoot($searchDir) { + // A list of file patterns; if one of the patterns matches a give + // directory, then we can assume that this directory is the + // CMS root. + $cmsPatterns = array( + 'wp' => array( + 'wp-includes/version.php', + // Future? 'vendor/civicrm/wordpress/civicrm.php' => 'wp', + ), + 'joomla' => array( + 'administrator/components/com_civicrm/civicrm/civicrm-version.php', + // Future? 'vendor/civicrm/joomla/civicrm.php' => 'joomla', + ), + 'drupal' => array( + 'modules/system/system.module', // D7 + 'core/core.services.yml', // D8 + ), + 'backdrop' => array( + 'core/modules/layout/layout.module', + ), + ); - $phpSelf = array_key_exists( 'PHP_SELF' , $_SERVER ) ? $_SERVER['PHP_SELF' ] : ''; - $httpHost = array_key_exists( 'HTTP_HOST', $_SERVER ) ? $_SERVER['HTTP_HOST'] : ''; + $parts = explode('/', str_replace('\\', '/', $searchDir)); + while (!empty($parts)) { + $basePath = implode('/', $parts); - $uri = explode('/', $phpSelf ); - $server = explode('.', implode('.', array_reverse(explode(':', rtrim($httpHost, '.'))))); - for ($i = count($uri) - 1; $i > 0; $i--) { - for ($j = count($server); $j > 0; $j--) { - $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i)); - if (file_exists("$confdir/$dir/civicrm.settings.php")) { - $conf = "$confdir/$dir"; - return $conf; - } + foreach ($cmsPatterns as $cmsType => $relPaths) { + if (!empty($this->options['cmsType']) && $this->options['cmsType'] != $cmsType) { + continue; } + foreach ($relPaths as $relPath) { + $matches = glob("$basePath/$relPath"); + if (!empty($matches)) { + return array($cmsType, $basePath); + } + } + } + + array_pop($parts); } - // FIXME: problem spot for Drupal 5.1 config dir layout - $conf = "$confdir/default"; - return $conf; -} + return array(NULL, NULL); + } -$settingsFile = civicrm_conf_init( ) . '/civicrm.settings.php'; -define('CIVICRM_SETTINGS_PATH', $settingsFile); -$error = @include_once( $settingsFile ); -if ( $error == false ) { - echo "Could not load the settings file at: {$settingsFile}\n"; - exit( ); + /** + * @param string|array $dirs + * List of directories to check. + * @param string|array $items + * List of globs to check in each directory. + * @return null|string + */ + protected function findFirstFile($dirs, $items) { + $dirs = (array) $dirs; + $items = (array) $items; + foreach ($dirs as $dir) { + foreach ($items as $item) { + $matches = (array) glob("$dir/$item"); + if (isset($matches[0])) { + return $matches[0]; + } + } + } + return NULL; + } + + /** + * @return string + */ + protected function getSearchDir() { + if ($this->options['search'] === TRUE) { + // exec(pwd) works better with symlinked source trees, but it's + // probably not portable to Windows. + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + return getcwd(); + } + else { + exec('pwd', $output); + return trim(implode("\n", $output)); + } + } + else { + return $this->options['search']; + } + } } -// Load class loader -global $civicrm_root; -require_once $civicrm_root . '/CRM/Core/ClassLoader.php'; -CRM_Core_ClassLoader::singleton()->register(); +\Civi\Cv\Bootstrap::singleton()->boot(); diff --git a/civicrm/install/index.php b/civicrm/install/index.php index adc88051aed2ef3faedb7c11647d495ec5a9bbcd..d0f7f0bada79cb08e275c22fdcf42b56affb7edf 100644 --- a/civicrm/install/index.php +++ b/civicrm/install/index.php @@ -174,9 +174,12 @@ global $tsLocale; $tsLocale = 'en_US'; $seedLanguage = 'en_US'; -if (isset($_POST['seedLanguage']) and isset($langs[$_POST['seedLanguage']])) { - $seedLanguage = $_POST['seedLanguage']; - $tsLocale = $_POST['seedLanguage']; +// CRM-16801 This validates that seedLanguage is valid by looking in $langs. +// NB: the variable is initial a $_REQUEST for the initial page reload, +// then becomes a $_POST when the installation form is submitted. +if (isset($_REQUEST['seedLanguage']) and isset($langs[$_REQUEST['seedLanguage']])) { + $seedLanguage = $_REQUEST['seedLanguage']; + $tsLocale = $_REQUEST['seedLanguage']; } $config = CRM_Core_Config::singleton(FALSE); @@ -185,6 +188,11 @@ $GLOBALS['civicrm_default_error_scope'] = NULL; // The translation files are in the parent directory (l10n) $i18n = CRM_Core_I18n::singleton(); +// Support for Arabic, Hebrew, Farsi, etc. +// Used in the template.html +$short_lang_code = CRM_Core_I18n_PseudoConstant::shortForLong($tsLocale); +$text_direction = (CRM_Core_I18n::isLanguageRTL($tsLocale) ? 'rtl' : 'ltr'); + global $cmsPath; if ($installType == 'drupal') { //CRM-6840 -don't force to install in sites/all/modules/ @@ -202,7 +210,7 @@ elseif ($installType == 'wordpress') { $cmsPath = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'civicrm'; $upload_dir = wp_upload_dir(); $files_dirname = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm'; - $wp_civi_settings = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm.settingsphp'; + $wp_civi_settings = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm.settings.php'; $wp_civi_settings_deprectated = CIVICRM_PLUGIN_DIR . 'civicrm.settings.php'; if (file_exists($wp_civi_settings_deprectated)) { $alreadyInstalled = $wp_civi_settings_deprectated; @@ -1392,10 +1400,6 @@ class Installer extends InstallRequirements { //change the default language to one chosen if (isset($config['seedLanguage']) && $config['seedLanguage'] != 'en_US') { - // This ensures that defaults get set, otherwise the user will login - // and most configurations will be empty, not set to en_US defaults. - civicrm_api3('Setting', 'revert'); - civicrm_api3('Setting', 'create', array( 'domain_id' => 'current_domain', 'lcMessages' => $config['seedLanguage'], diff --git a/civicrm/install/template.css b/civicrm/install/template.css index ff81f26af33e8bb1e55382bec9448c49ae504043..7c96816e54a72f86dbc65a20edf9a614f080be6a 100644 --- a/civicrm/install/template.css +++ b/civicrm/install/template.css @@ -13,6 +13,10 @@ body { max-width: 1200px; } +.civicrm-logo { + float: right; +} + form { margin: 0; } diff --git a/civicrm/install/template.html b/civicrm/install/template.html index d63821166cd08148b3835dea78526b71adc4e727..7fcd53e4cbce32b1a9c538b5be2054305e8032a9 100644 --- a/civicrm/install/template.html +++ b/civicrm/install/template.html @@ -1,15 +1,19 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $short_lang_code; ?>" lang="<?php echo $short_lang_code; ?>" dir="<?php echo $text_direction; ?>"> <head> -<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> -<title><?php echo ts('CiviCRM Installer'); ?></title> -<link rel="stylesheet" type="text/css" href=<?php echo $installURLPath . "template.css"?> /> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title><?php echo ts('CiviCRM Installer'); ?></title> + <link rel="stylesheet" type="text/css" href=<?php echo $installURLPath . "template.css"?> /> +<?php +if ($text_direction == 'rtl') { + echo " <link rel='stylesheet' type='text/css' href='{$installURLPath}template-rtl.css' />\n"; +} +?> </head> - <body> <div id="All"> - <div style="float: right"><strong><?php echo ts('Version %1', array(1 => "{$civicrm_version['version']} {$civicrm_version['cms']}")); ?></strong><br/> + <div class="civicrm-logo"><strong><?php echo ts('Version %1', array(1 => "{$civicrm_version['version']} {$civicrm_version['cms']}")); ?></strong><br/> <span><img src=<?php echo $installURLPath . "block_small.png"?> /></span> </div> diff --git a/civicrm/js/crm.ajax.js b/civicrm/js/crm.ajax.js index 91565ef6030ff35b0dbb79c59ad9cfd51964f473..b01e814bf076d3c0613793ef8a43d97d5fd3e69b 100644 --- a/civicrm/js/crm.ajax.js +++ b/civicrm/js/crm.ajax.js @@ -240,6 +240,10 @@ if (this.options.crmForm) $('form', this.element).ajaxFormUnbind(); if (this.options.block) this.element.block(); $.getJSON(url, function(data) { + if (data.status === 'redirect') { + that.options.url = data.userContext; + return that.refresh(); + } if (that.options.block) that.element.unblock(); if (!$.isPlainObject(data)) { that._onFailure(data); @@ -276,13 +280,6 @@ $('.blockUI', this.element).remove(); this._originalContent = this.element.contents().detach(); } - if (window.tinyMCE && tinyMCE.editors) { - $.each(tinyMCE.editors, function(k) { - if ($.contains(that.element[0], this.getElement())) { - this.remove(); - } - }); - } if (this.options.crmForm) $('form', this.element).ajaxFormUnbind(); }, _destroy: function() { @@ -442,7 +439,7 @@ }, settings.ajaxForm)); if (settings.openInline) { settings.autoClose = $el.crmSnippet('isOriginalUrl'); - $(this).on('click', settings.openInline, function(e) { + $(this).off('.openInline').on('click.openInline', settings.openInline, function(e) { if ($(this).is(exclude + ', .crm-popup')) { return; } diff --git a/civicrm/js/wysiwyg/crm.ckeditor.js b/civicrm/js/wysiwyg/crm.ckeditor.js index 4f8e9cb80d85adcd8e748035fd714912a5bea4d0..5130121f84574f52fffde179e27faf11b8166976 100644 --- a/civicrm/js/wysiwyg/crm.ckeditor.js +++ b/civicrm/js/wysiwyg/crm.ckeditor.js @@ -75,6 +75,7 @@ filebrowserUploadUrl: uploadUrl + '&type=files', filebrowserImageUploadUrl: uploadUrl + '&type=images', filebrowserFlashUploadUrl: uploadUrl + '&type=flash', + allowedContent: true, // For CiviMail! customConfig: CRM.config.CKEditorCustomConfig, on: { instanceReady: onReady diff --git a/civicrm/sql/civicrm.mysql b/civicrm/sql/civicrm.mysql index 30dc638dbdb5a3d0e0a7ef9dcb292c88760c7f82..e7c631952300e2eb084e092d4044b31d90cc71fa 100644 --- a/civicrm/sql/civicrm.mysql +++ b/civicrm/sql/civicrm.mysql @@ -4575,6 +4575,9 @@ CREATE TABLE `civicrm_contribution` ( , INDEX `check_number`( check_number ) + , INDEX `creditnote_id`( + creditnote_id + ) , CONSTRAINT FK_civicrm_contribution_contact_id FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE, CONSTRAINT FK_civicrm_contribution_financial_type_id FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type`(`id`) , CONSTRAINT FK_civicrm_contribution_contribution_page_id FOREIGN KEY (`contribution_page_id`) REFERENCES `civicrm_contribution_page`(`id`) ON DELETE SET NULL, CONSTRAINT FK_civicrm_contribution_contribution_recur_id FOREIGN KEY (`contribution_recur_id`) REFERENCES `civicrm_contribution_recur`(`id`) ON DELETE SET NULL, CONSTRAINT FK_civicrm_contribution_address_id FOREIGN KEY (`address_id`) REFERENCES `civicrm_address`(`id`) ON DELETE SET NULL, CONSTRAINT FK_civicrm_contribution_campaign_id FOREIGN KEY (`campaign_id`) REFERENCES `civicrm_campaign`(`id`) ON DELETE SET NULL ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ; diff --git a/civicrm/sql/civicrm_data.mysql b/civicrm/sql/civicrm_data.mysql index 4127ab5562ca40e1f3e44fb692a35294cbfb20ea..3f257d7eb5d1e0354f2ea490a163c54535be7818 100644 --- a/civicrm/sql/civicrm_data.mysql +++ b/civicrm/sql/civicrm_data.mysql @@ -1305,21 +1305,21 @@ INSERT INTO civicrm_state_province (id, country_id, abbreviation, name) VALUES (2373, 1064, "U", "Sucumbios"), (2374, 1064, "T", "Tungurahua"), (2375, 1064, "Z", "Zamora-Chinchipe"), -(2376, 1069, "37", "Harjumsa"), -(2377, 1069, "39", "Hitumea"), -(2378, 1069, "44", "Ida-Virumsa"), -(2379, 1069, "49", "Jogevamsa"), -(2380, 1069, "51", "Jarvamsa"), -(2381, 1069, "57", "Lasnemsa"), -(2382, 1069, "59", "Laane-Virumaa"), -(2383, 1069, "65", "Polvamea"), -(2384, 1069, "67", "Parnumsa"), -(2385, 1069, "70", "Raplamsa"), -(2386, 1069, "74", "Saaremsa"), -(2387, 1069, "7B", "Tartumsa"), +(2376, 1069, "37", "Harjumaa"), +(2377, 1069, "39", "Hiiumaa"), +(2378, 1069, "44", "Ida-Virumaa"), +(2379, 1069, "49", "Jõgevamaa"), +(2380, 1069, "51", "Järvamaa"), +(2381, 1069, "57", "Läänemaa"), +(2382, 1069, "59", "Lääne-Virumaa"), +(2383, 1069, "65", "Põlvamaa"), +(2384, 1069, "67", "Pärnumaa"), +(2385, 1069, "70", "Raplamaa"), +(2386, 1069, "74", "Saaremaa"), +(2387, 1069, "7B", "Tartumaa"), (2388, 1069, "82", "Valgamaa"), -(2389, 1069, "84", "Viljandimsa"), -(2390, 1069, "86", "Vorumaa"), +(2389, 1069, "84", "Viljandimaa"), +(2390, 1069, "86", "Võrumaa"), (2391, 1065, "DK", "Ad Daqahllyah"), (2392, 1065, "BA", "Al Bahr al Ahmar"), (2393, 1065, "BH", "Al Buhayrah"), @@ -2292,12 +2292,12 @@ INSERT INTO civicrm_state_province (id, country_id, abbreviation, name) VALUES (3511, 1121, "K", "Thaba-Tseka"), (3512, 1125, "AL", "Alytaus Apskritis"), (3513, 1125, "KU", "Kauno Apskritis"), -(3514, 1125, "KL", "Klaipedos Apskritis"), -(3515, 1125, "MR", "Marijampoles Apskritis"), -(3516, 1125, "PN", "Panevezio Apskritis"), -(3517, 1125, "SA", "Sisuliu Apskritis"), -(3518, 1125, "TA", "Taurages Apskritis"), -(3519, 1125, "TE", "Telsiu Apskritis"), +(3514, 1125, "KL", "Klaipėdos Apskritis"), +(3515, 1125, "MR", "Marijampolės Apskritis"), +(3516, 1125, "PN", "Panevėžio Apskritis"), +(3517, 1125, "SA", "Šiaulių Apskritis"), +(3518, 1125, "TA", "Tauragės Apskritis"), +(3519, 1125, "TE", "Telšių Apskritis"), (3520, 1125, "UT", "Utenos Apskritis"), (3521, 1125, "VL", "Vilniaus Apskritis"), (3522, 1126, "D", "Diekirch"), @@ -24264,4 +24264,4 @@ INSERT INTO `civicrm_report_instance` VALUES ( @domainID, 'Survey Details', 'survey/detail', 'Detailed report for canvassing, phone-banking, walk lists or other surveys.', 'access CiviReport', 'a:39:{s:6:"fields";a:2:{s:9:"sort_name";s:1:"1";s:6:"result";s:1:"1";}s:22:"assignee_contact_id_op";s:2:"eq";s:25:"assignee_contact_id_value";s:0:"";s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:17:"street_number_min";s:0:"";s:17:"street_number_max";s:0:"";s:16:"street_number_op";s:3:"lte";s:19:"street_number_value";s:0:"";s:14:"street_name_op";s:3:"has";s:17:"street_name_value";s:0:"";s:15:"postal_code_min";s:0:"";s:15:"postal_code_max";s:0:"";s:14:"postal_code_op";s:3:"lte";s:17:"postal_code_value";s:0:"";s:7:"city_op";s:3:"has";s:10:"city_value";s:0:"";s:20:"state_province_id_op";s:2:"in";s:23:"state_province_id_value";a:0:{}s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:12:"survey_id_op";s:2:"in";s:15:"survey_id_value";a:0:{}s:12:"status_id_op";s:2:"eq";s:15:"status_id_value";s:1:"1";s:11:"custom_1_op";s:2:"in";s:14:"custom_1_value";a:0:{}s:11:"custom_2_op";s:2:"in";s:14:"custom_2_value";a:0:{}s:17:"custom_3_relative";s:1:"0";s:13:"custom_3_from";s:0:"";s:11:"custom_3_to";s:0:"";s:11:"description";s:75:"Detailed report for canvassing, phone-banking, walk lists or other surveys.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviReport";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); -UPDATE civicrm_domain SET version = '4.7.0'; +UPDATE civicrm_domain SET version = '4.7.1'; diff --git a/civicrm/sql/civicrm_generated.mysql b/civicrm/sql/civicrm_generated.mysql index 9918c6e71c8181f0619cfd2875a3b2bdf6b48a56..d85a0c3643070d728a587ea2bc42f40e5f2963df 100644 --- a/civicrm/sql/civicrm_generated.mysql +++ b/civicrm/sql/civicrm_generated.mysql @@ -399,7 +399,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_domain` WRITE; /*!40000 ALTER TABLE `civicrm_domain` DISABLE KEYS */; -INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `config_backend`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,NULL,'4.7.0',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}'); +INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `config_backend`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,NULL,'4.7.1',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}'); /*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */; UNLOCK TABLES; diff --git a/civicrm/templates/CRM/Admin/Form/Navigation.tpl b/civicrm/templates/CRM/Admin/Form/Navigation.tpl index 95770d3ee42733fa21974749820043b1b0539626..d7d296051b24390dcf9b0b705a4c2616caa9fd9e 100644 --- a/civicrm/templates/CRM/Admin/Form/Navigation.tpl +++ b/civicrm/templates/CRM/Admin/Form/Navigation.tpl @@ -23,35 +23,51 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{* this template is used for adding/editing CiviCRM Menu *} +{* Template for adding/editing a CiviCRM Navigation Menu Item *} <div class="crm-block crm-form-block crm-navigation-form-block"> -<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> -<fieldset><legend>{if $action eq 1}{ts}New Menu{/ts}{elseif $action eq 2}{ts}Edit Menu{/ts}{else}{ts}Delete Menu{/ts}{/if}</legend> -<table class="form-layout-compressed"> + <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> + <table class="form-layout-compressed"> <tr class="crm-navigation-form-block-label"> - <td class="label">{$form.label.label}</td><td>{$form.label.html}</td> + <td class="label">{$form.label.label}</td><td>{$form.label.html}</td> </tr> <tr class="crm-navigation-form-block-url"> - <td class="label">{$form.url.label}</td><td>{$form.url.html} {help id="id-menu_url" file="CRM/Admin/Form/Navigation.hlp"}</td> - </tr> - { if $form.parent_id.html } - <tr class="crm-navigation-form-block-parent_id"> - <td class="label">{$form.parent_id.label}</td><td>{$form.parent_id.html} {help id="id-parent" file="CRM/Admin/Form/Navigation.hlp"}</td> + <td class="label">{$form.url.label} {help id="id-menu_url" file="CRM/Admin/Form/Navigation.hlp"}</td> + <td>{$form.url.html} </td> </tr> + {if $form.parent_id.html} + <tr class="crm-navigation-form-block-parent_id"> + <td class="label">{$form.parent_id.label} {help id="id-parent" file="CRM/Admin/Form/Navigation.hlp"}</td> + <td>{$form.parent_id.html}</td> + </tr> {/if} <tr class="crm-navigation-form-block-has_separator"> - <td class="label">{$form.has_separator.label}</td><td>{$form.has_separator.html} {help id="id-has_separator" file="CRM/Admin/Form/Navigation.hlp"}</td> + <td class="label">{$form.has_separator.label} {help id="id-has_separator" file="CRM/Admin/Form/Navigation.hlp"}</td> + <td>{$form.has_separator.html} </td> </tr> <tr class="crm-navigation-form-block-permission"> - <td class="label">{$form.permission.label}{help id="id-menu_permission" file="CRM/Admin/Form/Navigation.hlp"}</td><td>{$form.permission.html}</td> - </tr> - <tr class="crm-navigation-form-block-permission_operator"> - <td class="label"> </td><td>{$form.permission_operator.html} {$form.permission_operator.label} {help id="id-permission_operator" file="CRM/Admin/Form/Navigation.hlp"}</td> + <td class="label">{$form.permission.label} {help id="id-menu_permission" file="CRM/Admin/Form/Navigation.hlp"}</td> + <td>{$form.permission.html} <span class="permission_operator_wrapper">{$form.permission_operator.html} {help id="id-permission_operator" file="CRM/Admin/Form/Navigation.hlp"}</span></td> </tr> <tr class="crm-navigation-form-block-is_active"> - <td class="label">{$form.is_active.label}</td><td>{$form.is_active.html}</td> + <td class="label">{$form.is_active.label}</td><td>{$form.is_active.html}</td> </tr> -</table> -</fieldset> -<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> + </table> + <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> </div> +{literal} +<script type="text/javascript"> + CRM.$(function($) { + var $form = $('form.{/literal}{$form.formClass}{literal}'); + $('input[name=permission]', $form) + .on('change', function() { + $('span.permission_operator_wrapper').toggle(CRM._.includes($(this).val(), ',')); + }) + .change() + .crmSelect2({ + formatResult: CRM.utils.formatSelect2Result, + formatSelection: function(row) {return row.label}, + multiple: true + }); + }); +</script> +{/literal} diff --git a/civicrm/templates/CRM/Admin/Page/APIExplorer.js b/civicrm/templates/CRM/Admin/Page/APIExplorer.js index 3696c7ce6190b1322b82422d14b71c3913ced8b7..62f2fe5b2dd677b5ed6493a593519af65899dc51 100644 --- a/civicrm/templates/CRM/Admin/Page/APIExplorer.js +++ b/civicrm/templates/CRM/Admin/Page/APIExplorer.js @@ -82,7 +82,7 @@ description: field.description || '', required: !(!field['api.required'] || field['api.required'] === '0') }); - if (joins[name]) { + if (typeof joins[name] === 'string') { fields[pos].children = []; populateFields(fields[pos].children, joins[name], 'get', name + '.'); } diff --git a/civicrm/templates/CRM/Profile/Form/Dynamic.tpl b/civicrm/templates/CRM/Profile/Form/Dynamic.tpl index 3b74ad9ebe86ca66afd729d295de5466fa681b19..6b33985267295beadbe176f446a6e6428e55f5f0 100644 --- a/civicrm/templates/CRM/Profile/Form/Dynamic.tpl +++ b/civicrm/templates/CRM/Profile/Form/Dynamic.tpl @@ -171,8 +171,8 @@ {$form.$phone_ext_field.html} {/if} {else} - {if ( $field.data_type eq 'Date' or - ( ( ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) or ( $n eq 'activity_date_time' ) ) ) ) and $field.is_view neq 1 } + {if + ( ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) or ( $n eq 'activity_date_time' ) ) and $field.is_view neq 1 } {include file="CRM/common/jcalendar.tpl" elementName=$n} {else} {$form.$n.html} diff --git a/civicrm/templates/CRM/Profile/Form/Search.tpl b/civicrm/templates/CRM/Profile/Form/Search.tpl index cc1f6b69ae34ca3691e3f28fcde9319b0c8d0198..350b38e86e1ae402b104f6bfcc8431e4a7c8f0b9 100644 --- a/civicrm/templates/CRM/Profile/Form/Search.tpl +++ b/civicrm/templates/CRM/Profile/Form/Search.tpl @@ -44,18 +44,10 @@ {if $field.is_search_range} {assign var=from value=$field.name|cat:'_from'} {assign var=to value=$field.name|cat:'_to'} - {if $field.data_type neq 'Date'} <tr> <td class="label">{$form.$from.label}</td> <td class="description">{$form.$from.html} {$form.$to.label} {$form.$to.html}</td> </tr> - {else} - <tr> - <td class="label">{$form.$from.label}</td> - <td class="description">{include file="CRM/common/jcalendar.tpl" elementName=$from} - {$form.$to.label} {include file="CRM/common/jcalendar.tpl" elementName=$to}</td> - </tr> - {/if} {else} <tr> <td class="label"> @@ -73,8 +65,7 @@ </td> {else} <td class="description"> - {if ( $field.data_type eq 'Date' or - ( ( ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) ) ) ) } + {if ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) } {include file="CRM/common/jcalendar.tpl" elementName=$n} {elseif $n|substr:0:5 eq 'phone'} {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'} diff --git a/civicrm/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl b/civicrm/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl index 31c560c43b7b2418ba62d56338b6ae2f7f1d2a4a..2b07f7f7bf78d3af8e17d34080d63fd0736f4cf3 100644 --- a/civicrm/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl +++ b/civicrm/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl @@ -35,7 +35,7 @@ <div id="custom-{$customGroupId}-table-wrapper" {if $pageViewType eq 'customDataView'}class="crm-entity" data-entity="contact" data-id="{$contactId}"{/if}> <div> {strip} - <table id="records" class={if $pageViewType eq 'customDataView'}"crm-multifield-selector crm-ajax-table"{else}'display'{/if}> + <table id="records-{$customGroupId}" class={if $pageViewType eq 'customDataView'}"crm-multifield-selector crm-ajax-table"{else}'display'{/if}> <thead> <tr> {if $pageViewType eq 'customDataView'} @@ -52,6 +52,7 @@ <script type="text/javascript"> (function($) { var ZeroRecordText = {/literal}'{ts 1=$customGroupTitle}No records of type \'%1\' found.{/ts}'{literal}; + var $table = $('#records-' + {/literal}'{$customGroupId}'{literal}); $('table.crm-multifield-selector').data({ "ajax": { "url": {/literal}'{crmURL p="civicrm/ajax/multirecordfieldlist" h=0 q="snippet=4&cid=$contactId&cgid=$customGroupId"}'{literal}, @@ -61,7 +62,7 @@ }, //Add class attributes to cells "rowCallback": function(row, data) { - $('thead th').each( function(index) { + $('thead th', $table).each(function(index) { var fName = $(this).attr('data-data'); var cell = $('td:eq(' + index + ')', row); if (typeof data[fName] == 'object') { diff --git a/civicrm/templates/CRM/common/civicrm.settings.php.template b/civicrm/templates/CRM/common/civicrm.settings.php.template index 29d4cdfdbd46b515e1bf815e16cccdae4ed1a0c3..2b2060f1701d886ab8ad92498ed075fe6ca5650f 100644 --- a/civicrm/templates/CRM/common/civicrm.settings.php.template +++ b/civicrm/templates/CRM/common/civicrm.settings.php.template @@ -54,7 +54,12 @@ * (Administer::System Settings::Resource URLs). */ if (!defined('CIVICRM_UF')) { - define( 'CIVICRM_UF', '%%cms%%'); + if (getenv('CIVICRM_UF')) { + define('CIVICRM_UF', getenv('CIVICRM_UF')); + } + else { + define('CIVICRM_UF', '%%cms%%'); + } } /** @@ -64,7 +69,7 @@ if (!defined('CIVICRM_UF')) { * Datasource (DSN) format: * define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true'); */ -if (!defined('CIVICRM_UF_DSN')) { +if (!defined('CIVICRM_UF_DSN') && CIVICRM_UF !== 'UnitTests') { define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true'); } @@ -89,7 +94,12 @@ if (!defined('CIVICRM_UF_DSN')) { * */ if (!defined('CIVICRM_DSN')) { - define( 'CIVICRM_DSN' , 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true'); + if (CIVICRM_UF === 'UnitTests' && isset($GLOBALS['_CV']['TEST_DB_DSN'])) { + define('CIVICRM_DSN', $GLOBALS['_CV']['TEST_DB_DSN']); + } + else { + define('CIVICRM_DSN', 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true'); + } } /** @@ -384,6 +394,11 @@ if (!defined('CIVICRM_DB_CACHE_PREFIX')) { // define('CIVICRM_MYSQL_STRICT', TRUE ); // } +if (CIVICRM_UF === 'UnitTests') { + if (!defined('CIVICRM_CONTAINER_CACHE')) define('CIVICRM_CONTAINER_CACHE', 'auto'); + if (!defined('CIVICRM_MYSQL_STRICT')) define('CIVICRM_MYSQL_STRICT', true); +} + /** * * Do not change anything below this line. Keep as is diff --git a/civicrm/templates/CRM/common/version.tpl b/civicrm/templates/CRM/common/version.tpl index 1163055e28e8e7f468a15d63124bb70ed6cdeb33..cfacfe40809cdae8f4ca23c9a3061eb1807b8045 100644 --- a/civicrm/templates/CRM/common/version.tpl +++ b/civicrm/templates/CRM/common/version.tpl @@ -1 +1 @@ -4.7.0 \ No newline at end of file +4.7.1 \ No newline at end of file diff --git a/civicrm/vendor/autoload.php b/civicrm/vendor/autoload.php index 91dc959b087a61636c01fbcf7489c0d8a395ff7c..00877ca14ec59fc7d3ef62583ea4073de1d09ece 100644 --- a/civicrm/vendor/autoload.php +++ b/civicrm/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit5a11e2db9669069f4ff788ec537591bf::getLoader(); +return ComposerAutoloaderInit117b3f5e16d3ac2f649a6e9a17fb4952::getLoader(); diff --git a/civicrm/vendor/composer/ClassLoader.php b/civicrm/vendor/composer/ClassLoader.php index 5e1469e8307d9c644831f694ed8eccdd4afccc28..4e05d3b158348d499092a409f7beec47328946da 100644 --- a/civicrm/vendor/composer/ClassLoader.php +++ b/civicrm/vendor/composer/ClassLoader.php @@ -351,7 +351,7 @@ class ClassLoader foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { if (0 === strpos($class, $prefix)) { foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { return $file; } } @@ -361,7 +361,7 @@ class ClassLoader // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } @@ -380,7 +380,7 @@ class ClassLoader foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } @@ -390,7 +390,7 @@ class ClassLoader // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } diff --git a/civicrm/vendor/composer/LICENSE b/civicrm/vendor/composer/LICENSE deleted file mode 100644 index c8d57af8b2788b6908cbfabc50c35970f40d7cc6..0000000000000000000000000000000000000000 --- a/civicrm/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) 2015 Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/civicrm/vendor/composer/autoload_real.php b/civicrm/vendor/composer/autoload_real.php index 6384bba92a25871a14d68b63ae48f594a854febd..2fb85f6d20c9dcffc544dafac5c6fb5a6c371560 100644 --- a/civicrm/vendor/composer/autoload_real.php +++ b/civicrm/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit5a11e2db9669069f4ff788ec537591bf +class ComposerAutoloaderInit117b3f5e16d3ac2f649a6e9a17fb4952 { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit5a11e2db9669069f4ff788ec537591bf return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit5a11e2db9669069f4ff788ec537591bf', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit117b3f5e16d3ac2f649a6e9a17fb4952', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit5a11e2db9669069f4ff788ec537591bf', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit117b3f5e16d3ac2f649a6e9a17fb4952', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); @@ -46,14 +46,14 @@ class ComposerAutoloaderInit5a11e2db9669069f4ff788ec537591bf $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequire5a11e2db9669069f4ff788ec537591bf($file); + composerRequire117b3f5e16d3ac2f649a6e9a17fb4952($file); } return $loader; } } -function composerRequire5a11e2db9669069f4ff788ec537591bf($file) +function composerRequire117b3f5e16d3ac2f649a6e9a17fb4952($file) { require $file; } diff --git a/civicrm/vendor/composer/installed.json b/civicrm/vendor/composer/installed.json index 955a58bd0cdad8f63bc4402438cdb16ffa43c986..4f80df16f1d0ab2b0f9db6d73e567bd71649711f 100644 --- a/civicrm/vendor/composer/installed.json +++ b/civicrm/vendor/composer/installed.json @@ -39,212 +39,6 @@ "psr-3" ] }, - { - "name": "totten/ca-config", - "version": "v13.02.0", - "version_normalized": "13.02.0.0", - "source": { - "type": "git", - "url": "https://github.com/totten/ca_config.git", - "reference": "7a51033f4e18c1ac846a16c6de16050e735b01cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/totten/ca_config/zipball/7a51033f4e18c1ac846a16c6de16050e735b01cf", - "reference": "7a51033f4e18c1ac846a16c6de16050e735b01cf", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "time": "2013-02-13 03:40:18", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "CA_Config": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Tim Otten", - "email": "to-git@think.hm" - } - ], - "description": "Default configuration for certificate authorities", - "homepage": "https://github.com/totten/ca_config" - }, - { - "name": "symfony/dependency-injection", - "version": "v2.5.12", - "version_normalized": "2.5.12.0", - "target-dir": "Symfony/Component/DependencyInjection", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "c42aee05b466cc9c66b87ddf7d263402befb6962" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c42aee05b466cc9c66b87ddf7d263402befb6962", - "reference": "c42aee05b466cc9c66b87ddf7d263402befb6962", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/config": "~2.2", - "symfony/expression-language": "~2.4,>=2.4.10", - "symfony/yaml": "~2.1" - }, - "suggest": { - "symfony/config": "", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "time": "2015-01-25 04:37:39", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\DependencyInjection\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.5.12", - "version_normalized": "2.5.12.0", - "target-dir": "Symfony/Component/EventDispatcher", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "af6eb6a9a1a3b411facfd8e7e3f82a6be7919c04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/af6eb6a9a1a3b411facfd8e7e3f82a6be7919c04", - "reference": "af6eb6a9a1a3b411facfd8e7e3f82a6be7919c04", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.0,>=2.0.5,<2.6.0", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "time": "2015-01-29 18:20:43", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com" - }, - { - "name": "symfony/finder", - "version": "v2.5.12", - "version_normalized": "2.5.12.0", - "target-dir": "Symfony/Component/Finder", - "source": { - "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "e527ebf47ff912a45e148b7d0b107b80ec0b3cc2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/e527ebf47ff912a45e148b7d0b107b80ec0b3cc2", - "reference": "e527ebf47ff912a45e148b7d0b107b80ec0b3cc2", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2015-01-03 08:01:13", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\Finder\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Finder Component", - "homepage": "http://symfony.com" - }, { "name": "phpseclib/phpseclib", "version": "0.3.10", @@ -565,6 +359,173 @@ "description": "Symfony Config Component", "homepage": "http://symfony.com" }, + { + "name": "symfony/dependency-injection", + "version": "v2.5.12", + "version_normalized": "2.5.12.0", + "target-dir": "Symfony/Component/DependencyInjection", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "c42aee05b466cc9c66b87ddf7d263402befb6962" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c42aee05b466cc9c66b87ddf7d263402befb6962", + "reference": "c42aee05b466cc9c66b87ddf7d263402befb6962", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": "~2.2", + "symfony/expression-language": "~2.4,>=2.4.10", + "symfony/yaml": "~2.1" + }, + "suggest": { + "symfony/config": "", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "time": "2015-01-25 04:37:39", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.5.12", + "version_normalized": "2.5.12.0", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "af6eb6a9a1a3b411facfd8e7e3f82a6be7919c04" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/af6eb6a9a1a3b411facfd8e7e3f82a6be7919c04", + "reference": "af6eb6a9a1a3b411facfd8e7e3f82a6be7919c04", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.0,>=2.0.5,<2.6.0", + "symfony/stopwatch": "~2.3" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "time": "2015-01-29 18:20:43", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com" + }, + { + "name": "symfony/finder", + "version": "v2.5.12", + "version_normalized": "2.5.12.0", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "e527ebf47ff912a45e148b7d0b107b80ec0b3cc2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/e527ebf47ff912a45e148b7d0b107b80ec0b3cc2", + "reference": "e527ebf47ff912a45e148b7d0b107b80ec0b3cc2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2015-01-03 08:01:13", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Finder Component", + "homepage": "http://symfony.com" + }, { "name": "symfony/process", "version": "v2.5.12", @@ -614,6 +575,45 @@ "description": "Symfony Process Component", "homepage": "http://symfony.com" }, + { + "name": "totten/ca-config", + "version": "v13.02.0", + "version_normalized": "13.02.0.0", + "source": { + "type": "git", + "url": "https://github.com/totten/ca_config.git", + "reference": "7a51033f4e18c1ac846a16c6de16050e735b01cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/totten/ca_config/zipball/7a51033f4e18c1ac846a16c6de16050e735b01cf", + "reference": "7a51033f4e18c1ac846a16c6de16050e735b01cf", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "time": "2013-02-13 03:40:18", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "CA_Config": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Tim Otten", + "email": "to-git@think.hm" + } + ], + "description": "Default configuration for certificate authorities", + "homepage": "https://github.com/totten/ca_config" + }, { "name": "zetacomponents/base", "version": "1.7",