From 4cbe461a4d4c66220fd91c5609945ac042c9fcfa Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Wed, 9 Sep 2020 18:15:18 +1200 Subject: [PATCH 01/16] dev/financial#86 Make 'Record Payment' & 'Record Refund' visible regardless of whether the balance 'requires' one This was agreed about a year ago - might as well do it --- CRM/Contribute/BAO/Contribution.php | 34 +++++++++++------------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 3de7326172e1..018e99b27a31 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -5201,35 +5201,27 @@ protected static function getContributionPaymentLinks($id, $balance, $contributi 'title' => ts('Record Payment'), ]; - if ((int) $balance > 0) { - // @todo - this should be possible even if not > 0 - test & remove this if. - // it is possible to 'overpay' in the real world & we honor that. - if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { - $actionLinks[] = [ - 'url' => CRM_Utils_System::url('civicrm/payment', [ - 'action' => 'add', - 'reset' => 1, - 'is_refund' => 0, - 'id' => $id, - 'mode' => 'live', - ]), - 'title' => ts('Submit Credit Card payment'), - ]; - } - } - elseif ((int) $balance < 0) { - // @todo - in the future remove this IF - OK to refund money even when not due since - // ... life. + if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { $actionLinks[] = [ 'url' => CRM_Utils_System::url('civicrm/payment', [ 'action' => 'add', 'reset' => 1, + 'is_refund' => 0, 'id' => $id, - 'is_refund' => 1, + 'mode' => 'live', ]), - 'title' => ts('Record Refund'), + 'title' => ts('Submit Credit Card payment'), ]; } + $actionLinks[] = [ + 'url' => CRM_Utils_System::url('civicrm/payment', [ + 'action' => 'add', + 'reset' => 1, + 'id' => $id, + 'is_refund' => 1, + ]), + 'title' => ts('Record Refund'), + ]; return $actionLinks; } From fba045e1d152968400b6916099ae01319a289591 Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Sun, 13 Sep 2020 19:54:30 +1200 Subject: [PATCH 02/16] [Ref] Code simplification - remove conditional chunk All this calculation of component is only to insert it into an error messaage that we don't expect to see (ie it's an 'unknown error' error message, not an anticipated one. Given that, it's hard to see why we would use so many lines of code to calculate it --- CRM/Activity/BAO/Activity.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 40f6fdc90665..ac7cac12fd1a 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -1699,16 +1699,10 @@ public static function addActivity( $params = [] ) { $date = date('YmdHis'); - if ($activity->__table == 'civicrm_membership') { - $component = 'Membership'; + if ($activity->__table === 'civicrm_participant' && $activityType !== 'Email') { + $activityType = 'Event Registration'; } - elseif ($activity->__table == 'civicrm_participant') { - if ($activityType != 'Email') { - $activityType = 'Event Registration'; - } - $component = 'Event'; - } - elseif ($activity->__table == 'civicrm_contribution') { + if ($activity->__table == 'civicrm_contribution') { // create activity record only for Completed Contributions $contributionCompletedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); if ($activity->contribution_status_id != $contributionCompletedStatusId) { @@ -1718,7 +1712,7 @@ public static function addActivity( } $params['status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', 'Scheduled'); } - $activityType = $component = 'Contribution'; + $activityType = 'Contribution'; // retrieve existing activity based on source_record_id and activity_type if (empty($params['id'])) { @@ -1772,7 +1766,7 @@ public static function addActivity( // @todo - use api - remove lots of wrangling above. Remove deprecated fatal & let form layer // deal with any exceptions. if (is_a(self::create($activityParams), 'CRM_Core_Error')) { - throw new CRM_Core_Exception("Failed creating Activity for $component of id {$activity->id}"); + throw new CRM_Core_Exception("Failed creating Activity of type $activityType for entity id {$activity->id}"); } } From b505922618b2d7ecc9539815faf33dfffad58479 Mon Sep 17 00:00:00 2001 From: demeritcowboy <demeritcowboy@hotmail.com> Date: Sat, 12 Sep 2020 23:48:03 -0400 Subject: [PATCH 03/16] drupal 9 deprecations --- CRM/Utils/System/Drupal8.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CRM/Utils/System/Drupal8.php b/CRM/Utils/System/Drupal8.php index feb6dc58e5a7..85d0468296e9 100644 --- a/CRM/Utils/System/Drupal8.php +++ b/CRM/Utils/System/Drupal8.php @@ -34,7 +34,7 @@ public function createUser(&$params, $mail) { } /** @var \Drupal\user\Entity\User $account */ - $account = entity_create('user'); + $account = \Drupal::entityTypeManager()->getStorage('user')->create(); $account->setUsername($params['cms_name'])->setEmail($params[$mail]); // Allow user to set password only if they are an admin or if @@ -109,7 +109,7 @@ public function createUser(&$params, $mail) { * @inheritDoc */ public function updateCMSName($ufID, $email) { - $user = entity_load('user', $ufID); + $user = \Drupal::entityTypeManager()->getStorage('user')->load($ufID); if ($user && $user->getEmail() != $email) { $user->setEmail($email); @@ -134,7 +134,7 @@ public static function checkUserNameEmailExists(&$params, &$errors, $emailName = if (!empty($params['name'])) { $name = $params['name']; - $user = entity_create('user'); + $user = \Drupal::entityTypeManager()->getStorage('user')->create(); $user->setUsername($name); // This checks for both username uniqueness and validity. @@ -152,7 +152,7 @@ public static function checkUserNameEmailExists(&$params, &$errors, $emailName = if (!empty($params['mail'])) { $mail = $params['mail']; - $user = entity_create('user'); + $user = \Drupal::entityTypeManager()->getStorage('user')->create(); $user->setEmail($mail); // This checks for both email uniqueness. @@ -172,7 +172,7 @@ public static function checkUserNameEmailExists(&$params, &$errors, $emailName = */ public function getLoginURL($destination = '') { $query = $destination ? ['destination' => $destination] : []; - return \Drupal::url('user.login', [], ['query' => $query]); + return \Drupal\Core\Url::fromRoute('user.login', [], ['query' => $query])->toString(); } /** @@ -430,7 +430,7 @@ public function loadBootStrap($params = [], $loadUser = TRUE, $throwError = TRUE CRM_Utils_Hook::config($config); if ($loadUser) { - if (!empty($params['uid']) && $username = \Drupal\user\Entity\User::load($params['uid'])->getUsername()) { + if (!empty($params['uid']) && $username = \Drupal\user\Entity\User::load($params['uid'])->getAccountName()) { $this->loadUser($username); } elseif (!empty($params['name']) && !empty($params['pass']) && \Drupal::service('user.auth')->authenticate($params['name'], $params['pass'])) { From 9a0fec655f8a81dde9344a35d75395617f437e35 Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Mon, 14 Sep 2020 16:44:43 +1200 Subject: [PATCH 04/16] dev/core#2017 remove unused SearchTaskHookSample.php This appears to be unused demo code. Interested to see if any intrepid sleuths can fix any alternate explanation --- .../Form/Task/SearchTaskHookSample.php | 73 ------------------- CRM/Case/Form/Task/SearchTaskHookSample.php | 68 ----------------- .../Form/Task/SearchTaskHookSample.php | 68 ----------------- CRM/Event/Form/Task/SearchTaskHookSample.php | 71 ------------------ CRM/Grant/Form/Task/SearchTaskHookSample.php | 72 ------------------ CRM/Member/Form/Task/SearchTaskHookSample.php | 71 ------------------ CRM/Pledge/Form/Task/SearchTaskHookSample.php | 65 ----------------- .../Case/Form/Task/SearchTaskHookSample.tpl | 36 --------- .../Form/Task/SearchTaskHookSample.tpl | 38 ---------- .../Event/Form/Task/SearchTaskHookSample.tpl | 36 --------- .../Grant/Form/Task/SearchTaskHookSample.tpl | 34 --------- 11 files changed, 632 deletions(-) delete mode 100644 CRM/Activity/Form/Task/SearchTaskHookSample.php delete mode 100644 CRM/Case/Form/Task/SearchTaskHookSample.php delete mode 100644 CRM/Contribute/Form/Task/SearchTaskHookSample.php delete mode 100644 CRM/Event/Form/Task/SearchTaskHookSample.php delete mode 100644 CRM/Grant/Form/Task/SearchTaskHookSample.php delete mode 100644 CRM/Member/Form/Task/SearchTaskHookSample.php delete mode 100644 CRM/Pledge/Form/Task/SearchTaskHookSample.php delete mode 100644 templates/CRM/Case/Form/Task/SearchTaskHookSample.tpl delete mode 100644 templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl delete mode 100644 templates/CRM/Event/Form/Task/SearchTaskHookSample.tpl delete mode 100644 templates/CRM/Grant/Form/Task/SearchTaskHookSample.tpl diff --git a/CRM/Activity/Form/Task/SearchTaskHookSample.php b/CRM/Activity/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 003dd58c7e2b..000000000000 --- a/CRM/Activity/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -/* - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC. All rights reserved. | - | | - | This work is published under the GNU AGPLv3 license with some | - | permitted exceptions and without any warranty. For full license | - | and copyright information, see https://civicrm.org/licensing | - +--------------------------------------------------------------------+ - */ - -/** - * - * @package CRM - * @copyright CiviCRM LLC https://civicrm.org/licensing - */ - -/** - * This class provides the functionality to save a search - * Saved Searches are used for saving frequently used queries - */ -class CRM_Activity_Form_Task_SearchTaskHookSample extends CRM_Activity_Form_Task { - - /** - * Build all the data structures needed to build the form. - */ - public function preProcess() { - parent::preProcess(); - $rows = []; - // display name and activity details of all selected contacts - $activityIDs = implode(',', $this->_activityHolderIds); - - $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); - $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); - $query = " - SELECT at.subject as subject, - ov.label as activity_type, - at.activity_date_time as activity_date, - ct.display_name as display_name - FROM civicrm_activity at -LEFT JOIN civicrm_activity_contact ac ON ( ac.activity_id = at.id AND ac.record_type_id = {$sourceID} ) -INNER JOIN civicrm_contact ct ON ( ac.contact_id = ct.id ) - LEFT JOIN civicrm_option_group og ON ( og.name = 'activity_type' ) - LEFT JOIN civicrm_option_value ov ON (at.activity_type_id = ov.value AND og.id = ov.option_group_id ) - WHERE at.id IN ( $activityIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - - while ($dao->fetch()) { - $rows[] = [ - 'subject' => $dao->subject, - 'activity_type' => $dao->activity_type, - 'activity_date' => $dao->activity_date, - 'display_name' => $dao->display_name, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Case/Form/Task/SearchTaskHookSample.php b/CRM/Case/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index df83772a1ff0..000000000000 --- a/CRM/Case/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php -/* - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC. All rights reserved. | - | | - | This work is published under the GNU AGPLv3 license with some | - | permitted exceptions and without any warranty. For full license | - | and copyright information, see https://civicrm.org/licensing | - +--------------------------------------------------------------------+ - */ - -/** - * - * @package CRM - * @copyright CiviCRM LLC https://civicrm.org/licensing - */ - -/** - * This class provides the functionality to save a search - * Saved Searches are used for saving frequently used queries - */ -class CRM_Case_Form_Task_SearchTaskHookSample extends CRM_Case_Form_Task { - - /** - * Build all the data structures needed to build the form. - */ - public function preProcess() { - parent::preProcess(); - $rows = []; - // display name and email of all contact ids - $caseIDs = implode(',', $this->_entityIds); - $statusId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'case_status', 'id', 'name'); - $query = " -SELECT ct.display_name as display_name, - cs.start_date as start_date, - ov.label as status - -FROM civicrm_case cs -INNER JOIN civicrm_case_contact cc ON ( cs.id = cc.case_id) -INNER JOIN civicrm_contact ct ON ( cc.contact_id = ct.id) -LEFT JOIN civicrm_option_value ov ON (cs.status_id = ov.value AND ov.option_group_id = {$statusId} ) -WHERE cs.id IN ( {$caseIDs} )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'start_date' => CRM_Utils_Date::customFormat($dao->start_date), - 'status' => $dao->status, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Contribute/Form/Task/SearchTaskHookSample.php b/CRM/Contribute/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 0e081647bb22..000000000000 --- a/CRM/Contribute/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php -/* - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC. All rights reserved. | - | | - | This work is published under the GNU AGPLv3 license with some | - | permitted exceptions and without any warranty. For full license | - | and copyright information, see https://civicrm.org/licensing | - +--------------------------------------------------------------------+ - */ - -/** - * - * @package CRM - * @copyright CiviCRM LLC https://civicrm.org/licensing - */ - -/** - * This class provides the functionality to save a search - * Saved Searches are used for saving frequently used queries - */ -class CRM_Contribute_Form_Task_SearchTaskHookSample extends CRM_Contribute_Form_Task { - - /** - * Build all the data structures needed to build the form. - */ - public function preProcess() { - parent::preProcess(); - $rows = []; - // display name and contribution details of all selected contacts - $contribIDs = implode(',', $this->_contributionIds); - - $query = " - SELECT co.total_amount as amount, - co.receive_date as receive_date, - co.source as source, - ct.display_name as display_name - FROM civicrm_contribution co -INNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id ) - WHERE co.id IN ( $contribIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'amount' => $dao->amount, - 'source' => $dao->source, - 'receive_date' => $dao->receive_date, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Event/Form/Task/SearchTaskHookSample.php b/CRM/Event/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index efc940e57437..000000000000 --- a/CRM/Event/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/* - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC. All rights reserved. | - | | - | This work is published under the GNU AGPLv3 license with some | - | permitted exceptions and without any warranty. For full license | - | and copyright information, see https://civicrm.org/licensing | - +--------------------------------------------------------------------+ - */ - -/** - * - * @package CRM - * @copyright CiviCRM LLC https://civicrm.org/licensing - */ - -/** - * This class provides the functionality to save a search - * Saved Searches are used for saving frequently used queries - */ -class CRM_Event_Form_Task_SearchTaskHookSample extends CRM_Event_Form_Task { - - /** - * Build all the data structures needed to build the form. - * - * @return void - */ - public function preProcess() { - parent::preProcess(); - $rows = []; - // display name and participation details of participants - $participantIDs = implode(',', $this->_participantIds); - - $query = " - SELECT p.fee_amount as amount, - p.register_date as register_date, - p.source as source, - ct.display_name as display_name - FROM civicrm_participant p - INNER JOIN civicrm_contact ct ON ( p.contact_id = ct.id ) - WHERE p.id IN ( $participantIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'amount' => $dao->amount, - 'register_date' => CRM_Utils_Date::customFormat($dao->register_date), - 'source' => $dao->source, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - * - * @return void - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Grant/Form/Task/SearchTaskHookSample.php b/CRM/Grant/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 01ce981f4531..000000000000 --- a/CRM/Grant/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/* - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC. All rights reserved. | - | | - | This work is published under the GNU AGPLv3 license with some | - | permitted exceptions and without any warranty. For full license | - | and copyright information, see https://civicrm.org/licensing | - +--------------------------------------------------------------------+ - */ - -/** - * - * @package CRM - * @copyright CiviCRM LLC https://civicrm.org/licensing - */ - -/** - * This class provides the functionality to save a search - * Saved Searches are used for saving frequently used queries - */ -class CRM_Grant_Form_Task_SearchTaskHookSample extends CRM_Grant_Form_Task { - - /** - * Build all the data structures needed to build the form. - * - * @return void - */ - public function preProcess() { - parent::preProcess(); - $rows = []; - // display name and grant details of all selectced contacts - $grantIDs = implode(',', $this->_grantIds); - - $query = " - SELECT grt.decision_date as decision_date, - grt.amount_total as amount_total, - grt.amount_granted as amount_granted, - ct.display_name as display_name - FROM civicrm_grant grt -INNER JOIN civicrm_contact ct ON ( grt.contact_id = ct.id ) - WHERE grt.id IN ( $grantIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'decision_date' => $dao->decision_date, - 'amount_requested' => $dao->amount_total, - 'amount_granted' => $dao->amount_granted, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - * - * @return void - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Member/Form/Task/SearchTaskHookSample.php b/CRM/Member/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index d73ffc549f09..000000000000 --- a/CRM/Member/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/* - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC. All rights reserved. | - | | - | This work is published under the GNU AGPLv3 license with some | - | permitted exceptions and without any warranty. For full license | - | and copyright information, see https://civicrm.org/licensing | - +--------------------------------------------------------------------+ - */ - -/** - * - * @package CRM - * @copyright CiviCRM LLC https://civicrm.org/licensing - */ - -/** - * This class provides the functionality to save a search - * Saved Searches are used for saving frequently used queries - */ -class CRM_Member_Form_Task_SearchTaskHookSample extends CRM_Member_Form_Task { - - /** - * Build all the data structures needed to build the form. - * - * @return void - */ - public function preProcess() { - parent::preProcess(); - $rows = []; - // display name and membership details of all selected contacts - $memberIDs = implode(',', $this->_memberIds); - - $query = " - SELECT mem.start_date as start_date, - mem.end_date as end_date, - mem.source as source, - ct.display_name as display_name -FROM civicrm_membership mem -INNER JOIN civicrm_contact ct ON ( mem.contact_id = ct.id ) -WHERE mem.id IN ( $memberIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'start_date' => CRM_Utils_Date::customFormat($dao->start_date), - 'end_date' => CRM_Utils_Date::customFormat($dao->end_date), - 'source' => $dao->source, - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - * - * @return void - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/CRM/Pledge/Form/Task/SearchTaskHookSample.php b/CRM/Pledge/Form/Task/SearchTaskHookSample.php deleted file mode 100644 index 5af8bf1e5bd0..000000000000 --- a/CRM/Pledge/Form/Task/SearchTaskHookSample.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/* - +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC. All rights reserved. | - | | - | This work is published under the GNU AGPLv3 license with some | - | permitted exceptions and without any warranty. For full license | - | and copyright information, see https://civicrm.org/licensing | - +--------------------------------------------------------------------+ - */ - -/** - * - * @package CRM - * @copyright CiviCRM LLC https://civicrm.org/licensing - */ - -/** - * This class provides the functionality to save a search - * Saved Searches are used for saving frequently used queries - */ -class CRM_Pledge_Form_Task_SearchTaskHookSample extends CRM_Pledge_Form_Task { - - /** - * Build all the data structures needed to build the form. - */ - public function preProcess() { - parent::preProcess(); - $rows = []; - // display name and pledge details of all selected contacts - $pledgeIDs = implode(',', $this->_pledgeIds); - - $query = " - SELECT plg.amount as amount, - plg.create_date as create_date, - ct.display_name as display_name - FROM civicrm_pledge plg -INNER JOIN civicrm_contact ct ON ( plg.contact_id = ct.id ) - WHERE plg.id IN ( $pledgeIDs )"; - - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $rows[] = [ - 'display_name' => $dao->display_name, - 'amount' => $dao->amount, - 'create_date' => CRM_Utils_Date::customFormat($dao->create_date), - ]; - } - $this->assign('rows', $rows); - } - - /** - * Build the form object. - */ - public function buildQuickForm() { - $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ]); - } - -} diff --git a/templates/CRM/Case/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Case/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index cff2cc5fb098..000000000000 --- a/templates/CRM/Case/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{if $rows} -<div class="crm-submit-buttons"> - <span class="element-right">{include file="CRM/common/formButtons.tpl" location="top"}</span> -</div> - -<div class="spacer"></div> - -<div> -<br /> -<table> - <tr class="columnheader"> - <th>{ts}Display Name{/ts}</th> - <th>{ts}Start Date{/ts}</th> - <th>{ts}Status{/ts}</th> - </tr> - - {foreach from=$rows item=row} - <tr class="{cycle values="odd-row,even-row"}"> - <td class="crm-case-searchtaskhooksample-display_name">{$row.display_name}</td> - <td class="crm-case-searchtaskhooksample-start_date">{$row.start_date}</td> - <td class="crm-case-searchtaskhooksample-status">{$row.status}</td> - </tr> - {/foreach} -</table> -</div> - -<div class="crm-submit-buttons"> - <span class="element-right">{include file="CRM/common/formButtons.tpl" location="bottom"}</span> -</div> - -{else} - <div class="messages status no-popup"> - {icon icon="fa-info-circle"}{/icon} - {ts}There are no records selected.{/ts} - </div> -{/if} diff --git a/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index a14a183b1774..000000000000 --- a/templates/CRM/Contribute/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,38 +0,0 @@ -{if $rows} -<div class="form-item crm-block crm-form-block crm-contribution-form-block"> - <span class="element-right">{$form.buttons.html}</span> -</div> - -<div class="spacer"></div> - -<div> -<br /> -<table> - <tr class="columnheader"> - <th>{ts}Display Name{/ts}</th> - <th>{ts}Amount{/ts}</th> - <th>{ts}Source{/ts}</th> - <th>{ts}Receive Date{/ts}</th> - </tr> - - {foreach from=$rows item=row} - <tr class="{cycle values="odd-row,even-row"}"> - <td>{$row.display_name}</td> - <td>{$row.amount}</td> - <td>{$row.source}</td> - <td>{$row.receive_date}</td> - </tr> - {/foreach} -</table> -</div> - -<div class="form-item"> - <span class="element-right">{$form.buttons.html}</span> -</div> - -{else} - <div class="messages status no-popup"> - {icon icon="fa-info-circle"}{/icon} - {ts}There are no records selected.{/ts} - </div> -{/if} diff --git a/templates/CRM/Event/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Event/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index 9cfdab000893..000000000000 --- a/templates/CRM/Event/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{if $rows} -<div class="crm-submit-buttons"> - <span class="element-right">{include file="CRM/common/formButtons.tpl" location="top"}</span> -</div> - -<div class="spacer"></div> -<div> -<br /> -<table> - <tr class="columnheader"> - <th>{ts}Display Name{/ts}</th> - <th>{ts}Amount{/ts}</th> - <th>{ts}Register Date{/ts}</th> - <th>{ts}Source{/ts}</th> - </tr> - - {foreach from=$rows item=row} - <tr class="{cycle values="odd-row,even-row"}"> - <td class="crm-event-searchtaskhooksample-display_name">{$row.display_name}</td> - <td class="crm-event-searchtaskhooksample-amount">{$row.amount}</td> - <td class="crm-event-searchtaskhooksample-register_date">{$row.register_date}</td> - <td class="crm-event-searchtaskhooksample-source">{$row.source}</td> - </tr> - {/foreach} -</table> -</div> - -<div class="crm-submit-buttons"> - <span class="element-right">{include file="CRM/common/formButtons.tpl" location="bottom"}</span> -</div> - -{else} - <div class="messages status no-popup"> - {icon icon="fa-info-circle"}{/icon}{ts}There are no records selected.{/ts} - </div> -{/if} diff --git a/templates/CRM/Grant/Form/Task/SearchTaskHookSample.tpl b/templates/CRM/Grant/Form/Task/SearchTaskHookSample.tpl deleted file mode 100644 index 144ad174ca59..000000000000 --- a/templates/CRM/Grant/Form/Task/SearchTaskHookSample.tpl +++ /dev/null @@ -1,34 +0,0 @@ -{if $rows} -<div class="crm-submit-buttons element-right">{include file="CRM/common/formButtons.tpl" location="top"}</div> - -<div class="spacer"></div> - -<div> -<br /> -<table> - <tr class="columnheader"> - <td>{ts}Display Name{/ts}</td> - <td>{ts}Decision Date{/ts}</td> - <td>{ts}Amount Requested{/ts}</td> - <td>{ts}Amount Granted{/ts}</td> - </tr> - - {foreach from=$rows item=row} - <tr class="{cycle values="odd-row,even-row"} crm-grant"> - <td class="crm-grant-task-SearchTaskHookSample-form-block-display_name">{$row.display_name}</td> - <td class="crm-grant-task-SearchTaskHookSample-form-block-decision_date">{$row.decision_date}</td> - <td class="crm-grant-task-SearchTaskHookSample-form-block-amount_requested">{$row.amount_requested}</td> - <td class="crm-grant-task-SearchTaskHookSample-form-block-amount_granted">{$row.amount_granted}</td> - </tr> - {/foreach} -</table> -</div> - -<div class="crm-submit-buttons element-right">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> - -{else} - <div class="messages status no-popup"> - {icon icon="fa-info-circle"}{/icon} - {ts}There are no records selected.{/ts} - </div> -{/if} From 73bf38128c9799b1a0ee07287eb845fdbdccf6a2 Mon Sep 17 00:00:00 2001 From: Matthew Wire <mjw@mjwconsult.co.uk> Date: Mon, 14 Sep 2020 17:03:08 +0100 Subject: [PATCH 05/16] Fix parameters for MembershipTest --- tests/phpunit/CRM/Member/Form/MembershipTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CRM/Member/Form/MembershipTest.php b/tests/phpunit/CRM/Member/Form/MembershipTest.php index 8c5d42578ea3..bc7fad299b8a 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipTest.php @@ -288,7 +288,7 @@ public function testFormRuleRollingLifetimeEnd() { public function testFormRulePermanentOverrideWithNoStatus() { $params = [ 'join_date' => date('Y-m-d'), - 'membership_type_id' => [$this->ids['contact']['organization'], '$this->membershipTypeAnnualFixedID'], + 'membership_type_id' => [$this->ids['contact']['organization'], $this->membershipTypeAnnualFixedID], 'is_override' => TRUE, ]; $files = []; @@ -301,7 +301,7 @@ public function testFormRulePermanentOverrideWithNoStatus() { public function testFormRuleUntilDateOverrideWithValidOverrideEndDate() { $params = [ 'join_date' => date('Y-m-d'), - 'membership_type_id' => [$this->ids['contact']['organization'], '$this->membershipTypeAnnualFixedID'], + 'membership_type_id' => [$this->ids['contact']['organization'], $this->membershipTypeAnnualFixedID], 'is_override' => TRUE, 'status_id' => 1, 'status_override_end_date' => date('Y-m-d'), From 8afb20472e567795b65db7fd7becdd3737c9df66 Mon Sep 17 00:00:00 2001 From: Coleman Watts <coleman@civicrm.org> Date: Thu, 10 Sep 2020 11:39:25 -0400 Subject: [PATCH 06/16] Search ext: improve debug output --- ext/search/ang/search/crmSearch.component.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/search/ang/search/crmSearch.component.js b/ext/search/ang/search/crmSearch.component.js index 66a14f0f2c10..039e74d99a76 100644 --- a/ext/search/ang/search/crmSearch.component.js +++ b/ext/search/ang/search/crmSearch.component.js @@ -169,7 +169,10 @@ }) .finally(function() { if (ctrl.debug) { - ctrl.debug.params = JSON.stringify(ctrl.params, null, 2); + ctrl.debug.params = JSON.stringify(_.extend({version: 4}, ctrl.params), null, 2); + if (ctrl.debug.timeIndex) { + ctrl.debug.timeIndex = Number.parseFloat(ctrl.debug.timeIndex).toPrecision(2); + } } }); } From 2c7e2f4b6b195988da15a99566b5f1e3041b9089 Mon Sep 17 00:00:00 2001 From: Coleman Watts <coleman@civicrm.org> Date: Fri, 11 Sep 2020 11:58:52 -0400 Subject: [PATCH 07/16] Search ext: load saved searches --- ext/search/CRM/Search/Page/Ang.php | 2 +- ext/search/ang/search.module.js | 56 ++++++++++++++++--- ext/search/ang/search/SaveSmartGroup.ctrl.js | 14 +++-- ext/search/ang/search/crmSearch.component.js | 27 +++++++-- ext/search/ang/search/crmSearch/criteria.html | 8 ++- 5 files changed, 89 insertions(+), 18 deletions(-) diff --git a/ext/search/CRM/Search/Page/Ang.php b/ext/search/CRM/Search/Page/Ang.php index 2549f622d5b0..e38271a694cd 100644 --- a/ext/search/CRM/Search/Page/Ang.php +++ b/ext/search/CRM/Search/Page/Ang.php @@ -49,7 +49,7 @@ public function run() { $loader->setModules(['search']); $loader->setPageName('civicrm/search'); $loader->useApp([ - 'defaultRoute' => '/Contact', + 'defaultRoute' => '/create/Contact', ]); $loader->load(); parent::run(); diff --git a/ext/search/ang/search.module.js b/ext/search/ang/search.module.js index 3b2eeb34ffe1..ed60680e0020 100644 --- a/ext/search/ang/search.module.js +++ b/ext/search/ang/search.module.js @@ -2,27 +2,67 @@ "use strict"; // Shared between router and searchMeta service - var searchEntity; + var searchEntity, + // For loading saved search + savedSearch, + undefined; // Declare module and route/controller/services angular.module('search', CRM.angRequires('search')) .config(function($routeProvider) { - $routeProvider.when('/:entity', { + $routeProvider.when('/:mode/:entity/:name?', { controller: 'searchRoute', - template: '<div id="bootstrap-theme" class="crm-search"><crm-search entity="entity"></crm-search></div>', - reloadOnSearch: false + template: '<div id="bootstrap-theme" class="crm-search"><crm-search ng-if="$ctrl.mode === \'create\'" entity="$ctrl.entity" load=":: $ctrl.savedSearch"></crm-search></div>', + reloadOnSearch: false, + resolve: { + // For paths like /load/Group/MySmartGroup, load the group, stash it in the savedSearch variable, and then redirect + // For paths like /create/Contact, return the stashed savedSearch if present + savedSearch: function($route, $location, $timeout, crmApi4) { + var retrievedSearch = savedSearch, + params = $route.current.params; + savedSearch = undefined; + switch (params.mode) { + case 'create': + return retrievedSearch; + + case 'load': + // In theory savedSearches could be attached to something other than groups, but for now that's not supported + if (params.entity !== 'Group' || !params.name) { + throw 'Failed to load ' + params.entity; + } + return crmApi4(params.entity, 'get', { + select: ['id', 'title', 'saved_search_id', 'saved_search.api_entity', 'saved_search.api_params'], + where: [['name', '=', params.name]] + }, 0).then(function(retrieved) { + savedSearch = { + type: params.entity, + id: retrieved.id, + title: retrieved.title, + saved_search_id: retrieved.saved_search_id, + api_params: retrieved['saved_search.api_params'] + }; + $timeout(function() { + $location.url('/create/' + retrieved['saved_search.api_entity']); + }); + }); + } + } + } }); }) // Controller binds entity to route - .controller('searchRoute', function($scope, $routeParams, $location) { - searchEntity = $scope.entity = $routeParams.entity; + .controller('searchRoute', function($scope, $routeParams, $location, savedSearch) { + searchEntity = this.entity = $routeParams.entity; + this.mode = $routeParams.mode; + this.savedSearch = savedSearch; + $scope.$ctrl = this; // Changing entity will refresh the angular page - $scope.$watch('entity', function(newEntity, oldEntity) { + $scope.$watch('$ctrl.entity', function(newEntity, oldEntity) { if (newEntity && oldEntity && newEntity !== oldEntity) { - $location.url('/' + newEntity); + $location.url('/create/' + newEntity); } }); }) diff --git a/ext/search/ang/search/SaveSmartGroup.ctrl.js b/ext/search/ang/search/SaveSmartGroup.ctrl.js index 74401b984731..18b0298e96f7 100644 --- a/ext/search/ang/search/SaveSmartGroup.ctrl.js +++ b/ext/search/ang/search/SaveSmartGroup.ctrl.js @@ -1,7 +1,7 @@ (function(angular, $, _) { "use strict"; - angular.module('search').controller('SaveSmartGroup', function ($scope, crmApi4, dialogService) { + angular.module('search').controller('SaveSmartGroup', function ($scope, $element, crmApi4, dialogService) { var ts = $scope.ts = CRM.ts(), model = $scope.model; $scope.groupEntityRefParams = { @@ -23,9 +23,15 @@ administerReservedGroups: CRM.checkPerm('administer reserved groups') }; $scope.groupFields = _.indexBy(_.find(CRM.vars.search.schema, {name: 'Group'}).fields, 'name'); - $scope.$watch('model.id', function (id) { - if (id) { - _.assign(model, $('#api-save-search-select-group').select2('data').extra); + $element.on('change', '#api-save-search-select-group', function() { + if ($(this).val()) { + $scope.$apply(function() { + var group = $('#api-save-search-select-group').select2('data').extra; + model.saved_search_id = group.saved_search_id; + model.description = group.description || ''; + model.group_type = group.group_type || []; + model.visibility = group.visibility; + }); } }); $scope.cancel = function () { diff --git a/ext/search/ang/search/crmSearch.component.js b/ext/search/ang/search/crmSearch.component.js index 039e74d99a76..30ebfa99c352 100644 --- a/ext/search/ang/search/crmSearch.component.js +++ b/ext/search/ang/search/crmSearch.component.js @@ -3,7 +3,8 @@ angular.module('search').component('crmSearch', { bindings: { - entity: '=' + entity: '=', + load: '<' }, templateUrl: '~/search/crmSearch.html', controller: function($scope, $element, $timeout, crmApi4, dialogService, searchMeta, formatForSelect2) { @@ -244,6 +245,9 @@ ctrl.stale = true; } } + if (ctrl.load) { + ctrl.load.saved = false; + } } function onChangeOrderBy() { @@ -255,6 +259,9 @@ function onChangeFilters() { ctrl.stale = true; ctrl.selectedRows.length = 0; + if (ctrl.load) { + ctrl.load.saved = false; + } if (ctrl.autoSearch) { ctrl.refreshAll(); } @@ -526,6 +533,13 @@ } $scope.$watch('$ctrl.params.having', onChangeFilters, true); + if (this.load) { + this.params = this.load.api_params; + $timeout(function() { + ctrl.load.saved = true; + }); + } + loadFieldOptions(); }; @@ -540,16 +554,21 @@ description: '', visibility: 'User and User Admin Only', group_type: [], - id: null, + id: ctrl.load ? ctrl.load.id : null, entity: ctrl.entity, - params: angular.extend({}, ctrl.params, {version: 4, select: [selectField]}) + params: angular.extend({}, ctrl.params, {version: 4}) }; delete model.params.orderBy; var options = CRM.utils.adjustDialogDefaults({ autoOpen: false, title: ts('Save smart group') }); - dialogService.open('saveSearchDialog', '~/search/saveSmartGroup.html', model, options); + dialogService.open('saveSearchDialog', '~/search/saveSmartGroup.html', model, options) + .then(function() { + if (ctrl.load) { + ctrl.load.saved = true; + } + }); }; } }); diff --git a/ext/search/ang/search/crmSearch/criteria.html b/ext/search/ang/search/crmSearch/criteria.html index 6bb500a7419f..a142e498c597 100644 --- a/ext/search/ang/search/crmSearch/criteria.html +++ b/ext/search/ang/search/crmSearch/criteria.html @@ -2,7 +2,7 @@ <div> <div class="form-inline"> <label for="crm-search-main-entity">{{:: ts('Search for') }}</label> - <input id="crm-search-main-entity" class="form-control" ng-model="$ctrl.entity" crm-ui-select="::{allowClear: false, data: entities}" ng-change="changeEntity()" /> + <input id="crm-search-main-entity" class="form-control" ng-model="$ctrl.entity" crm-ui-select="::{allowClear: false, data: entities}" /> </div> <div ng-if=":: $ctrl.paramExists('join')"> <fieldset ng-repeat="join in $ctrl.params.join"> @@ -40,6 +40,12 @@ </fieldset> </div> <div> + <div class="navbar-form clearfix" ng-if="$ctrl.load"> + <div class="form-group pull-right"> + <label>{{ $ctrl.load.title }}</label> + <button class="btn btn-default" ng-disabled="$ctrl.load.saved" ng-click="saveGroup()">{{ $ctrl.load.saved ? ts('Saved') : ts('Save') }}</button> + </div> + </div> <fieldset class="api4-clause-fieldset" crm-search-clause="{format: 'string', clauses: $ctrl.params.where, op: 'AND', label: ts('Where'), fields: fieldsForWhere}"> </fieldset> <fieldset ng-if="$ctrl.paramExists('having') && $ctrl.params.groupBy.length" class="api4-clause-fieldset" crm-search-clause="{format: 'string', clauses: $ctrl.params.having, op: 'AND', label: ts('Filter'), fields: fieldsForHaving}"> From 4cb27797ea99ca5e8b6318d3a45f56048d0d7bdf Mon Sep 17 00:00:00 2001 From: Coleman Watts <coleman@civicrm.org> Date: Fri, 11 Sep 2020 13:58:43 -0400 Subject: [PATCH 08/16] Update links to APIv4 smart groups to point to the new search ext --- CRM/Contact/BAO/SavedSearch.php | 33 +++++++++++++++++-- CRM/Contact/Form/Search.php | 5 ++- CRM/Group/Form/Edit.php | 9 +---- templates/CRM/Contact/Form/Search/Basic.hlp | 13 -------- templates/CRM/Contact/Form/Search/Intro.tpl | 11 +------ .../CRM/Contact/Form/Search/ResultTasks.tpl | 2 +- templates/CRM/Group/Form/Edit.tpl | 11 ++----- 7 files changed, 38 insertions(+), 46 deletions(-) diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index c5cd15e6e4df..d2ed700e7dcd 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -54,9 +54,9 @@ public function getAll() { * @param array $defaults * (reference ) an assoc array to hold the flattened values. * - * @return CRM_Contact_BAO_SavedSearch + * @return CRM_Contact_DAO_SavedSearch */ - public static function retrieve(&$params, &$defaults) { + public static function retrieve($params, &$defaults = []) { $savedSearch = new CRM_Contact_DAO_SavedSearch(); $savedSearch->copyValues($params); if ($savedSearch->find(TRUE)) { @@ -422,4 +422,33 @@ public static function decodeRelativeFields(&$formValues, $fieldName, $op, $valu } } + /** + * Generate a url to the appropriate search form for a given savedSearch + * + * @param int $id + * Saved search id + * @return string + */ + public static function getEditSearchUrl($id) { + $savedSearch = self::retrieve(['id' => $id]); + // APIv4 search + if (!empty($savedSearch->api_entity)) { + $groupName = self::getName($id); + return CRM_Utils_System::url('civicrm/search', NULL, FALSE, "/load/Group/$groupName"); + } + // Classic search builder + if (!empty($savedSearch->mapping_id)) { + $path = 'civicrm/contact/search/builder'; + } + // Classic custom search + elseif (!empty($savedSearch->search_custom_id)) { + $path = 'civicrm/contact/search/custom'; + } + // Classic advanced search + else { + $path = 'civicrm/contact/search/advanced'; + } + return CRM_Utils_System::url($path, ['reset' => 1, 'ssID' => $id]); + } + } diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index af5e9f821310..d41d16bb6cd8 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -429,11 +429,10 @@ public function buildQuickForm() { $ssID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group', $this->_groupID, 'saved_search_id'); $this->assign('ssID', $ssID); - //get the saved search mapping id + //get the saved search edit link if ($ssID) { $this->_ssID = $ssID; - $ssMappingId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $ssID, 'mapping_id'); - $this->assign('ssMappingID', $ssMappingId); + $this->assign('editSmartGroupURL', CRM_Contact_BAO_SavedSearch::getEditSearchUrl($ssID)); } // Set dynamic page title for 'Show Members of Group' diff --git a/CRM/Group/Form/Edit.php b/CRM/Group/Form/Edit.php index e384dc36cc7f..2fb7d2199d88 100644 --- a/CRM/Group/Form/Edit.php +++ b/CRM/Group/Form/Edit.php @@ -137,14 +137,7 @@ public function preProcess() { 'saved_search_id' => $this->_groupValues['saved_search_id'] ?? '', ); if (isset($this->_groupValues['saved_search_id'])) { - $groupValues['mapping_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', - $this->_groupValues['saved_search_id'], - 'mapping_id' - ); - $groupValues['search_custom_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', - $this->_groupValues['saved_search_id'], - 'search_custom_id' - ); + $this->assign('editSmartGroupURL', CRM_Contact_BAO_SavedSearch::getEditSearchUrl($this->_groupValues['saved_search_id'])); } if (!empty($this->_groupValues['created_id'])) { $groupValues['created_by'] = CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['created_id'], 'sort_name', 'id'); diff --git a/templates/CRM/Contact/Form/Search/Basic.hlp b/templates/CRM/Contact/Form/Search/Basic.hlp index 4fceec8fc9c9..5d84d1f7f717 100644 --- a/templates/CRM/Contact/Form/Search/Basic.hlp +++ b/templates/CRM/Contact/Form/Search/Basic.hlp @@ -26,19 +26,6 @@ <li>{ts}Use the 'Group Status...' checkboxes to view contacts with 'Pending' status and/or contacts who have been 'Removed' from this group.{/ts}</li> </ul> </p> - {if $params.permissionedForGroup} - {capture assign=addMembersURL}{crmURL q="context=amtg&amtgID=`$params.group_id`&reset=1"}{/capture} - <p>{ts 1=$addMembersURL 2=$params.group_title}Click <a href='%1'>Add Contacts to %2</a> if you want to add contacts to this group.{/ts} - {if !empty($params.ssID)} - {if $params.ssMappingID} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/builder" q="reset=1&force=1&ssID=`$params.ssID`"}{/capture} - {else} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/advanced" q="reset=1&force=1&ssID=`$params.ssID`"}{/capture} - {/if} - {ts 1=$editSmartGroupURL}Click <a href='%1'>Edit Smart Group Search Criteria...</a> to change the search query used for this 'smart' group.{/ts} - {/if} - </p> - {/if} {/htxt} {htxt id="id-amtg-criteria-title"} diff --git a/templates/CRM/Contact/Form/Search/Intro.tpl b/templates/CRM/Contact/Form/Search/Intro.tpl index adc70018d03a..8cbfb012cf7b 100644 --- a/templates/CRM/Contact/Form/Search/Intro.tpl +++ b/templates/CRM/Contact/Form/Search/Intro.tpl @@ -11,20 +11,11 @@ {* smog = 'show members of group'; amtg = 'add members to group' *} {if $context EQ 'smog'} {* Provide link to modify smart group search criteria if we are viewing a smart group (ssID = saved search ID) *} - {if $permissionEditSmartGroup} - {if !empty($ssID)} - {if $ssMappingID} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/builder" q="reset=1&ssID=`$ssID`"}{/capture} - {elseif $savedSearch.search_custom_id} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/custom" q="reset=1&ssID=`$ssID`"}{/capture} - {else} - {capture assign=editSmartGroupURL}{crmURL p="civicrm/contact/search/advanced" q="reset=1&ssID=`$ssID`"}{/capture} - {/if} + {if $permissionEditSmartGroup && !empty($editSmartGroupURL)} <div class="crm-submit-buttons"> <a href="{$editSmartGroupURL}" class="button no-popup"><span><i class="crm-i fa-pencil" aria-hidden="true"></i> {ts 1=$group.title}Edit Smart Group Search Criteria for %1{/ts}</span></a> {help id="id-edit-smartGroup"} </div> - {/if} {/if} {if $permissionedForGroup} diff --git a/templates/CRM/Contact/Form/Search/ResultTasks.tpl b/templates/CRM/Contact/Form/Search/ResultTasks.tpl index 1e3e0df3cca7..28ca892fa15e 100644 --- a/templates/CRM/Contact/Form/Search/ResultTasks.tpl +++ b/templates/CRM/Contact/Form/Search/ResultTasks.tpl @@ -23,7 +23,7 @@ <a href="{$searchBuilderURL}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}Search Builder{/ts}</a><br /> {/if} {if $context eq 'smog'} - {help id="id-smog-criteria" group_id=$group.id group_title=$group.title ssID=$ssID ssMappingID=$ssMappingID permissionedForGroup=$permissionedForGroup} + {help id="id-smog-criteria" group_title=$group.title} {elseif $context eq 'amtg'} {help id="id-amtg-criteria" group_title=$group.title} {else} diff --git a/templates/CRM/Group/Form/Edit.tpl b/templates/CRM/Group/Form/Edit.tpl index 42b82ac93e79..fb46c69e9bc9 100644 --- a/templates/CRM/Group/Form/Edit.tpl +++ b/templates/CRM/Group/Form/Edit.tpl @@ -83,16 +83,9 @@ {if $action neq 1} <div class="action-link"> <a {$crmURL}><i class="crm-i fa-users" aria-hidden="true"></i> {ts}Contacts in this Group{/ts}</a> - {if $group.saved_search_id} + {if $editSmartGroupURL} <br /> - {if $group.mapping_id} - <a class="no-popup" href="{crmURL p="civicrm/contact/search/builder" q="reset=1&ssID=`$group.saved_search_id`"}"><i class="crm-i fa-pencil" aria-hidden="true"></i> {ts}Edit Smart Group Criteria{/ts}</a> - {elseif $group.search_custom_id} - <a class="no-popup" href="{crmURL p="civicrm/contact/search/custom" q="reset=1&ssID=`$group.saved_search_id`"}"><i class="crm-i fa-pencil" aria-hidden="true"></i> {ts}Edit Smart Group Criteria{/ts}</a> - {else} - <a class="no-popup" href="{crmURL p="civicrm/contact/search/advanced" q="reset=1&ssID=`$group.saved_search_id`"}"><i class="crm-i fa-pencil" aria-hidden="true"></i> {ts}Edit Smart Group Criteria{/ts}</a> - {/if} - + <a class="no-popup" href="{$editSmartGroupURL}"><i class="crm-i fa-pencil" aria-hidden="true"></i> {ts}Edit Smart Group Criteria{/ts}</a> {/if} </div> {/if} From 3495fe676d93f71ea41054f192af1e9e7f65a142 Mon Sep 17 00:00:00 2001 From: Coleman Watts <coleman@civicrm.org> Date: Fri, 11 Sep 2020 14:18:11 -0400 Subject: [PATCH 09/16] APIv4 Explorer: Only show result length if result is array --- ang/api4Explorer/Explorer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ang/api4Explorer/Explorer.js b/ang/api4Explorer/Explorer.js index 41750691c61c..7c64b6e6671c 100644 --- a/ang/api4Explorer/Explorer.js +++ b/ang/api4Explorer/Explorer.js @@ -791,7 +791,7 @@ $scope.debug = debugFormat(resp.data); $scope.result = [ formatMeta(resp.data), - prettyPrintOne('(' + resp.data.values.length + ') ' + _.escape(JSON.stringify(resp.data.values, null, 2)), 'js', 1) + prettyPrintOne((_.isArray(resp.data.values) ? '(' + resp.data.values.length + ') ' : '') + _.escape(JSON.stringify(resp.data.values, null, 2)), 'js', 1) ]; }, function(resp) { $scope.loading = false; From 9573d2c52f5a32b7f3dd6ee8c6f9caebda2a871f Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Tue, 15 Sep 2020 08:49:07 +1200 Subject: [PATCH 10/16] dev/core#1921 Remove iso convert relevant tests api_v3_CaseTest.testCaseActivityUpdate_Tracked api_v3_CaseTest.testCaseActivityUpdateCustom --- CRM/Activity/Page/AJAX.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 65262d50f96f..f61df22bb478 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -275,7 +275,7 @@ public static function _convertToCaseActivity($params) { if (!$otherActivity->find(TRUE)) { return (['error_msg' => 'activity record is missing.']); } - $actDateTime = CRM_Utils_Date::isoToMysql($otherActivity->activity_date_time); + $actDateTime = $otherActivity->activity_date_time; // Create new activity record. $mainActivity = new CRM_Activity_DAO_Activity(); From 629c4d302f478ea7591f6d21b212cad55b5d3a15 Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Tue, 15 Sep 2020 08:55:42 +1200 Subject: [PATCH 11/16] dev/core#1921 Further removal of iso date handling Overview ---------------------------------------- Same deal as https://github.com/civicrm/civicrm-core/pull/18359 Before ---------------------------------------- Casting to ISO date to avoid 2014 bug After ---------------------------------------- We are stuck in 2020 Technical Details ---------------------------------------- Comments ---------------------------------------- relevant tests api_v3_CaseTest::testCaseMerge --- CRM/Case/BAO/Case.php | 2 +- tests/phpunit/api/v3/CaseTest.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index e78e55923653..96a511e69bc9 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -2070,7 +2070,7 @@ public static function mergeCases( CRM_Core_DAO::storeValues($otherActivity, $mainActVals); $mainActivity->copyValues($mainActVals); $mainActivity->id = NULL; - $mainActivity->activity_date_time = CRM_Utils_Date::isoToMysql($otherActivity->activity_date_time); + $mainActivity->activity_date_time = $otherActivity->activity_date_time; $mainActivity->source_record_id = CRM_Utils_Array::value($mainActivity->source_record_id, $activityMappingIds ); diff --git a/tests/phpunit/api/v3/CaseTest.php b/tests/phpunit/api/v3/CaseTest.php index efd080234293..a362e8592928 100644 --- a/tests/phpunit/api/v3/CaseTest.php +++ b/tests/phpunit/api/v3/CaseTest.php @@ -1003,19 +1003,17 @@ public function testCaseAddtimeline($enableRevisions) { * Test the case merge function. * * 2 cases should be mergeable into 1 - * - * @throws \Exception */ public function testCaseMerge() { $contact1 = $this->individualCreate([], 1); $case1 = $this->callAPISuccess('Case', 'create', [ 'contact_id' => $contact1, - 'subject' => "Test case 1", + 'subject' => 'Test case 1', 'case_type_id' => $this->caseTypeId, ]); $case2 = $this->callAPISuccess('Case', 'create', [ 'contact_id' => $contact1, - 'subject' => "Test case 2", + 'subject' => 'Test case 2', 'case_type_id' => $this->caseTypeId, ]); $result = $this->callAPISuccess('Case', 'getcount', ['contact_id' => $contact1]); From 8a5f52de3df220f7f4e1bab73cafc4b6b0925f0c Mon Sep 17 00:00:00 2001 From: Tim Otten <totten@civicrm.org> Date: Mon, 14 Sep 2020 20:59:01 -0700 Subject: [PATCH 12/16] dev/core#1393, dev/core#1990 - Assert that Drupal-style tarballs have no symlinks --- distmaker/dists/backdrop_php5.sh | 1 + distmaker/dists/common.sh | 12 ++++++++++++ distmaker/dists/drupal6_php5.sh | 1 + distmaker/dists/drupal_php5.sh | 1 + distmaker/dists/drupal_sk_php5.sh | 1 + 5 files changed, 16 insertions(+) diff --git a/distmaker/dists/backdrop_php5.sh b/distmaker/dists/backdrop_php5.sh index 65d8fb899d9f..59f85c14e110 100644 --- a/distmaker/dists/backdrop_php5.sh +++ b/distmaker/dists/backdrop_php5.sh @@ -28,6 +28,7 @@ dm_install_cvext com.iatspayments.civicrm "$TRG/ext/iatspayments" # gen tarball cd $TRG/.. +dm_assert_no_symlinks civicrm tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-backdrop.tar.gz civicrm # clean up diff --git a/distmaker/dists/common.sh b/distmaker/dists/common.sh index cf6bcd9350a9..dc2cd9a65a41 100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@ -10,6 +10,18 @@ function dm_reset_dirs() { mkdir -p "$@" } +## Assert that a folder contains no symlinks +## +## ex: dev/core#1393, dev/core#1990 +## usage: dm_assert_no_symlinks <basedir> +function dm_assert_no_symlinks() { + local SYMLINKS=$( find "$1" -type l ) + if [ -n "$SYMLINKS" ]; then + echo "ERROR: Folder $1 contains unexpected symlink(s): $SYMLINKS" + exit 10 + fi +} + ## Copy files from one dir into another dir ## usage: dm_install_dir <from-dir> <to-dir> function dm_install_dir() { diff --git a/distmaker/dists/drupal6_php5.sh b/distmaker/dists/drupal6_php5.sh index 2ecb1a2b1447..6c9d94cc7893 100755 --- a/distmaker/dists/drupal6_php5.sh +++ b/distmaker/dists/drupal6_php5.sh @@ -28,6 +28,7 @@ dm_install_cvext com.iatspayments.civicrm "$TRG/ext/iatspayments" # gen tarball cd $TRG/.. +dm_assert_no_symlinks civicrm tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-drupal6.tar.gz civicrm # clean up diff --git a/distmaker/dists/drupal_php5.sh b/distmaker/dists/drupal_php5.sh index 7245be3fe847..64e5f9aa4bbb 100755 --- a/distmaker/dists/drupal_php5.sh +++ b/distmaker/dists/drupal_php5.sh @@ -28,6 +28,7 @@ dm_install_cvext com.iatspayments.civicrm "$TRG/ext/iatspayments" # gen tarball cd $TRG/.. +dm_assert_no_symlinks civicrm tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-drupal.tar.gz civicrm # clean up diff --git a/distmaker/dists/drupal_sk_php5.sh b/distmaker/dists/drupal_sk_php5.sh index b375d2ad2837..4419053ac0a5 100755 --- a/distmaker/dists/drupal_sk_php5.sh +++ b/distmaker/dists/drupal_sk_php5.sh @@ -36,6 +36,7 @@ rm -rf $TRG/packages/tinymce # gen tarball cd $TRG/.. +dm_assert_no_symlinks civicrm tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-starterkit.tgz civicrm # clean up From 48cd94bb6cb73dcbc98c7f20732c76d9cb9f69ae Mon Sep 17 00:00:00 2001 From: Tim Otten <totten@civicrm.org> Date: Mon, 14 Sep 2020 19:58:36 -0700 Subject: [PATCH 13/16] dev/core#1393, dev/core#1990 - Exclude README.rst symlink --- distmaker/dists/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distmaker/dists/common.sh b/distmaker/dists/common.sh index dc2cd9a65a41..0b7e42ed5dfe 100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@ -200,7 +200,7 @@ function dm_install_vendor() { local excludes_rsync="" ## CRM-21729 - .idea test-cases unit-test come from phpquery package. - for exclude in .git .svn {T,t}est{,s} {D,d}oc{,s} {E,e}xample{,s} .idea test-cases unit-test; do + for exclude in .git .svn {T,t}est{,s} {D,d}oc{,s} {E,e}xample{,s} .idea test-cases unit-test README.rst; do excludes_rsync="--exclude=${exclude} ${excludes_rsync}" done From b667ca8be1a7cd0016dc99a3f571d5a56130abe9 Mon Sep 17 00:00:00 2001 From: demeritcowboy <demeritcowboy@hotmail.com> Date: Tue, 15 Sep 2020 13:57:24 -0400 Subject: [PATCH 14/16] DB is no longer in packages, now autoloaded from vendor --- install/civicrm.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/install/civicrm.php b/install/civicrm.php index e68861340392..5b6dcb263a61 100644 --- a/install/civicrm.php +++ b/install/civicrm.php @@ -131,8 +131,6 @@ function civicrm_main(&$config) { function civicrm_source($dsn, $fileName, $lineMode = FALSE) { global $crmPath; - require_once "$crmPath/packages/DB.php"; - // CRM-19699 See also CRM_Core_DAO for PHP7 mysqli compatiblity. // Duplicated here because this is not using CRM_Core_DAO directly // and this function may be called directly from Drush. From 98d31ddf9c8bcfa50dae8d4baaa9df56a1b394a6 Mon Sep 17 00:00:00 2001 From: eileen <emcnaughton@wikimedia.org> Date: Wed, 16 Sep 2020 11:08:24 +1200 Subject: [PATCH 15/16] [NFC] Remove trailing whitespace --- sql/test_data_second_domain.mysql | 402 +++++++++++++++--------------- 1 file changed, 201 insertions(+), 201 deletions(-) diff --git a/sql/test_data_second_domain.mysql b/sql/test_data_second_domain.mysql index f87b4519b797..c9dd5008dac2 100644 --- a/sql/test_data_second_domain.mysql +++ b/sql/test_data_second_domain.mysql @@ -87,32 +87,32 @@ SET @searchlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/contact/search&reset=1', 'Find Contacts', 'Find Contacts', NULL, '', @searchlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/contact/search/advanced&reset=1', 'Advanced Search', 'Advanced Search', NULL, '', @searchlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/contact/search/custom&csid=15&reset=1', 'Full-text Search', 'Full-text Search', NULL, '', @searchlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/contact/search/builder&reset=1', 'Search Builder', 'Search Builder', NULL, '', @searchlastID, '1', '1', 4 ), - ( @domainID, 'civicrm/case/search&reset=1', 'Find Cases', 'Find Cases', 'access my cases and activities,access all cases and activities', 'OR', @searchlastID, '1', NULL, 5 ), - ( @domainID, 'civicrm/contribute/search&reset=1', 'Find Contributions', 'Find Contributions', 'access CiviContribute', '', @searchlastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/mailing&reset=1', 'Find Mailings', 'Find Mailings', 'access CiviMail', '', @searchlastID, '1', NULL, 7 ), - ( @domainID, 'civicrm/member/search&reset=1', 'Find Memberships', 'Find Memberships', 'access CiviMember', '', @searchlastID, '1', NULL, 8 ), - ( @domainID, 'civicrm/event/search&reset=1', 'Find Participants', 'Find Participants', 'access CiviEvent', '', @searchlastID, '1', NULL, 9 ), + ( @domainID, 'civicrm/contact/search&reset=1', 'Find Contacts', 'Find Contacts', NULL, '', @searchlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/contact/search/advanced&reset=1', 'Advanced Search', 'Advanced Search', NULL, '', @searchlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/contact/search/custom&csid=15&reset=1', 'Full-text Search', 'Full-text Search', NULL, '', @searchlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/contact/search/builder&reset=1', 'Search Builder', 'Search Builder', NULL, '', @searchlastID, '1', '1', 4 ), + ( @domainID, 'civicrm/case/search&reset=1', 'Find Cases', 'Find Cases', 'access my cases and activities,access all cases and activities', 'OR', @searchlastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/contribute/search&reset=1', 'Find Contributions', 'Find Contributions', 'access CiviContribute', '', @searchlastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/mailing&reset=1', 'Find Mailings', 'Find Mailings', 'access CiviMail', '', @searchlastID, '1', NULL, 7 ), + ( @domainID, 'civicrm/member/search&reset=1', 'Find Memberships', 'Find Memberships', 'access CiviMember', '', @searchlastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/event/search&reset=1', 'Find Participants', 'Find Participants', 'access CiviEvent', '', @searchlastID, '1', NULL, 9 ), ( @domainID, 'civicrm/pledge/search&reset=1', 'Find Pledges', 'Find Pledges', 'access CiviPledge', '', @searchlastID, '1', NULL, 10 ), ( @domainID, 'civicrm/activity/search&reset=1', 'Find Activities', 'Find Activities', NULL, '', @searchlastID, '1', '1', 11 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/contact/search/custom/list&reset=1', 'Custom Searches', 'Custom Searches', NULL, '', @searchlastID, '1', NULL, 12 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Contacts', 'Contacts', NULL, '', NULL, '1', NULL, 20 ); SET @contactlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/contact/add&reset=1&ct=Individual', 'New Individual', 'New Individual', 'add contacts', '', @contactlastID, '1', NULL, 1 ), ( @domainID, 'civicrm/contact/add&reset=1&ct=Household', 'New Household', 'New Household', 'add contacts', '', @contactlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/contact/add&reset=1&ct=Organization', 'New Organization', 'New Organization', 'add contacts', '', @contactlastID, '1', 1, 3 ); @@ -121,100 +121,100 @@ VALUES INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/activity&reset=1&action=add&context=standalone', 'New Activity', 'New Activity', NULL, '', @contactlastID, '1', NULL, 4 ), - ( @domainID, 'civicrm/activity/email/add&atype=3&action=add&reset=1&context=standalone', 'New Email', 'New Email', NULL, '', @contactlastID, '1', '1', 5 ), - ( @domainID, 'civicrm/import/contact&reset=1', 'Import Contacts', 'Import Contacts', 'import contacts', '', @contactlastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/import/activity&reset=1', 'Import Activities', 'Import Activities', 'import contacts', '', @contactlastID, '1', '1', 7 ), - ( @domainID, 'civicrm/group/add&reset=1', 'New Group', 'New Group', 'edit groups', '', @contactlastID, '1', NULL, 8 ), - ( @domainID, 'civicrm/group&reset=1', 'Manage Groups', 'Manage Groups', 'access CiviCRM', '', @contactlastID, '1', '1', 9 ), - ( @domainID, 'civicrm/admin/tag&reset=1&action=add', 'New Tag', 'New Tag', 'administer CiviCRM', '', @contactlastID, '1', NULL, 10 ), + ( @domainID, 'civicrm/activity&reset=1&action=add&context=standalone', 'New Activity', 'New Activity', NULL, '', @contactlastID, '1', NULL, 4 ), + ( @domainID, 'civicrm/activity/email/add&atype=3&action=add&reset=1&context=standalone', 'New Email', 'New Email', NULL, '', @contactlastID, '1', '1', 5 ), + ( @domainID, 'civicrm/import/contact&reset=1', 'Import Contacts', 'Import Contacts', 'import contacts', '', @contactlastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/import/activity&reset=1', 'Import Activities', 'Import Activities', 'import contacts', '', @contactlastID, '1', '1', 7 ), + ( @domainID, 'civicrm/group/add&reset=1', 'New Group', 'New Group', 'edit groups', '', @contactlastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/group&reset=1', 'Manage Groups', 'Manage Groups', 'access CiviCRM', '', @contactlastID, '1', '1', 9 ), + ( @domainID, 'civicrm/admin/tag&reset=1&action=add', 'New Tag', 'New Tag', 'administer CiviCRM', '', @contactlastID, '1', NULL, 10 ), ( @domainID, 'civicrm/admin/tag&reset=1', 'Manage Tags (Categories)', 'Manage Tags (Categories)', 'administer CiviCRM', '', @contactlastID, '1','1', 11 ), ( @domainID, 'civicrm/contact/deduperules&reset=1', 'Find and Merge Duplicate Contacts', 'Find and Merge Duplicate Contacts', 'administer dedupe rules,merge duplicate contacts', 'OR', @contactlastID, '1', NULL, 12 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Contributions', 'Contributions', 'access CiviContribute', '', NULL, '1', NULL, 30 ); SET @contributionlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/contribute&reset=1', 'Dashboard', 'Dashboard', 'access CiviContribute', '', @contributionlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/contribute/add&reset=1&action=add&context=standalone', 'New Contribution', 'New Contribution', 'access CiviContribute,edit contributions', 'AND', @contributionlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/contribute/search&reset=1', 'Find Contributions', 'Find Contributions', 'access CiviContribute', '', @contributionlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/batch&reset=1', 'Batches', 'Batches', 'access CiviContribute,access CiviMember', '', @contributionlastID, '1', NULL, 4 ), +VALUES + ( @domainID, 'civicrm/contribute&reset=1', 'Dashboard', 'Dashboard', 'access CiviContribute', '', @contributionlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/contribute/add&reset=1&action=add&context=standalone', 'New Contribution', 'New Contribution', 'access CiviContribute,edit contributions', 'AND', @contributionlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/contribute/search&reset=1', 'Find Contributions', 'Find Contributions', 'access CiviContribute', '', @contributionlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/batch&reset=1', 'Batches', 'Batches', 'access CiviContribute,access CiviMember', '', @contributionlastID, '1', NULL, 4 ), ( @domainID, 'civicrm/contribute/import&reset=1', 'Import Contributions', 'Import Contributions', 'access CiviContribute,edit contributions', 'AND', @contributionlastID, '1', '1', 5 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID,NULL, 'Pledges', 'Pledges', 'access CiviPledge', '', @contributionlastID, '1', 1, 5 ); - + SET @pledgelastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/pledge&reset=1', 'Dashboard', 'Dashboard', 'access CiviPledge', '', @pledgelastID, '1', NULL, 1 ), +VALUES + ( @domainID, 'civicrm/pledge&reset=1', 'Dashboard', 'Dashboard', 'access CiviPledge', '', @pledgelastID, '1', NULL, 1 ), ( @domainID, 'civicrm/pledge/add&reset=1&action=add&context=standalone', 'New Pledge', 'New Pledge', 'access CiviPledge,edit pledges', 'AND', @pledgelastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/pledge/search&reset=1', 'Find Pledges', 'Find Pledges', 'access CiviPledge', '', @pledgelastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/admin/contribute/add&reset=1&action=add', 'New Contribution Page', 'New Contribution Page', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/contribute&reset=1', 'Manage Contribution Pages', 'Manage Contribution Pages', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', '1', 7 ), - ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=contribute', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/pledge/search&reset=1', 'Find Pledges', 'Find Pledges', 'access CiviPledge', '', @pledgelastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/admin/contribute/add&reset=1&action=add', 'New Contribution Page', 'New Contribution Page', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/admin/contribute&reset=1', 'Manage Contribution Pages', 'Manage Contribution Pages', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', '1', 7 ), + ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=contribute', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 8 ), ( @domainID, 'civicrm/admin/contribute/managePremiums&reset=1', 'Premiums (Thank-you Gifts)', 'Premiums', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', 1, 9 ), ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 10 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviContribute,administer CiviCRM', 'AND', @contributionlastID, '1', NULL, 11 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Events', 'Events', 'access CiviEvent', '', NULL, '1', NULL, 40 ); SET @eventlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/event&reset=1', 'Dashboard', 'CiviEvent Dashboard', 'access CiviEvent', '', @eventlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/participant/add&reset=1&action=add&context=standalone', 'Register Event Participant', 'Register Event Participant', 'access CiviEvent,edit event participants', 'AND', @eventlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/event/search&reset=1', 'Find Participants', 'Find Participants', 'access CiviEvent', '', @eventlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/event/import&reset=1', 'Import Participants','Import Participants', 'access CiviEvent,edit event participants', 'AND', @eventlastID, '1', '1', 4 ), - ( @domainID, 'civicrm/event/add&reset=1&action=add', 'New Event', 'New Event', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 5 ), - ( @domainID, 'civicrm/event/manage&reset=1', 'Manage Events', 'Manage Events', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', 1, 6 ), +VALUES + ( @domainID, 'civicrm/event&reset=1', 'Dashboard', 'CiviEvent Dashboard', 'access CiviEvent', '', @eventlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/participant/add&reset=1&action=add&context=standalone', 'Register Event Participant', 'Register Event Participant', 'access CiviEvent,edit event participants', 'AND', @eventlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/event/search&reset=1', 'Find Participants', 'Find Participants', 'access CiviEvent', '', @eventlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/event/import&reset=1', 'Import Participants','Import Participants', 'access CiviEvent,edit event participants', 'AND', @eventlastID, '1', '1', 4 ), + ( @domainID, 'civicrm/event/add&reset=1&action=add', 'New Event', 'New Event', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/event/manage&reset=1', 'Manage Events', 'Manage Events', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', 1, 6 ), ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=event', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviEvent,administer CiviCRM', 'AND', @eventlastID, '1', 1, 7 ), - ( @domainID, 'civicrm/admin/eventTemplate&reset=1', 'Event Templates', 'Event Templates', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', 1, 8 ), - ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 9 ), + ( @domainID, 'civicrm/admin/eventTemplate&reset=1', 'Event Templates', 'Event Templates', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', 1, 8 ), + ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 9 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviEvent,edit all events', 'AND', @eventlastID, '1', NULL, 10 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Mailings', 'Mailings', 'access CiviMail,create mailings,approve mailings,schedule mailings', 'OR', NULL, '1', NULL, 50 ); SET @mailinglastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/mailing/send&reset=1', 'New Mailing', 'New Mailing', 'access CiviMail,create mailings', 'OR', @mailinglastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/mailing/browse/unscheduled&reset=1&scheduled=false', 'Draft and Unscheduled Mailings', 'Draft and Unscheduled Mailings', 'access CiviMail,create mailings,schedule mailings', 'OR', @mailinglastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/mailing/browse/scheduled&reset=1&scheduled=true', 'Scheduled and Sent Mailings', 'Scheduled and Sent Mailings', 'access CiviMail,approve mailings,create mailings,schedule mailings', 'OR', @mailinglastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/mailing/browse/archived&reset=1', 'Archived Mailings', 'Archived Mailings', 'access CiviMail,create mailings', 'OR', @mailinglastID, '1', 1, 4 ), +VALUES + ( @domainID, 'civicrm/mailing/send&reset=1', 'New Mailing', 'New Mailing', 'access CiviMail,create mailings', 'OR', @mailinglastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/mailing/browse/unscheduled&reset=1&scheduled=false', 'Draft and Unscheduled Mailings', 'Draft and Unscheduled Mailings', 'access CiviMail,create mailings,schedule mailings', 'OR', @mailinglastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/mailing/browse/scheduled&reset=1&scheduled=true', 'Scheduled and Sent Mailings', 'Scheduled and Sent Mailings', 'access CiviMail,approve mailings,create mailings,schedule mailings', 'OR', @mailinglastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/mailing/browse/archived&reset=1', 'Archived Mailings', 'Archived Mailings', 'access CiviMail,create mailings', 'OR', @mailinglastID, '1', 1, 4 ), ( @domainID, 'civicrm/admin/component&reset=1', 'Headers, Footers, and Automated Messages', 'Headers, Footers, and Automated Messages', 'access CiviMail,administer CiviCRM', 'AND', @mailinglastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @mailinglastID, '1', NULL, 6 ), ( @domainID, 'civicrm/admin/options/from_email&group=from_email_address&reset=1', 'From Email Addresses', 'From Email Addresses', 'administer CiviCRM', '', @mailinglastID, '1', 1, 7 ), ( @domainID, 'civicrm/sms/send?reset=1', 'New SMS', 'New SMS', 'administer CiviCRM', NULL, @mailinglastID, '1', 1, 8 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Memberships', 'Memberships', 'access CiviMember', '', NULL, '1', NULL, 60 ); SET @memberlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/member&reset=1', 'Dashboard', 'Dashboard', 'access CiviMember', '', @memberlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/member/add&reset=1&action=add&context=standalone', 'New Membership', 'New Membership', 'access CiviMember,edit memberships', 'AND', @memberlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/member/search&reset=1', 'Find Memberships', 'Find Memberships','access CiviMember', '', @memberlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/batch&reset=1', 'Batches', 'Batches','access CiviMember,access CiviContribute', '', @memberlastID, '1', NULL, 4 ), +VALUES + ( @domainID, 'civicrm/member&reset=1', 'Dashboard', 'Dashboard', 'access CiviMember', '', @memberlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/member/add&reset=1&action=add&context=standalone', 'New Membership', 'New Membership', 'access CiviMember,edit memberships', 'AND', @memberlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/member/search&reset=1', 'Find Memberships', 'Find Memberships','access CiviMember', '', @memberlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/batch&reset=1', 'Batches', 'Batches','access CiviMember,access CiviContribute', '', @memberlastID, '1', NULL, 4 ), ( @domainID, 'civicrm/member/import&reset=1', 'Import Memberships', 'Import Members', 'access CiviMember,edit memberships', 'AND', @memberlastID, '1', 1, 5 ), ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviMember,administer CiviCRM', 'AND', @memberlastID, '1', NULL, 6 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviMember,administer CiviCRM', 'AND', @memberlastID, '1', NULL, 7 ); @@ -228,16 +228,16 @@ VALUES SET @campaignlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/campaign&reset=1', 'Dashboard', 'Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 1 ); SET @campaigndashboardlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/campaign&reset=1&subPage=survey', 'Surveys', 'Survey Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/campaign&reset=1&subPage=petition', 'Petitions', 'Petition Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/campaign&reset=1&subPage=campaign', 'Campaigns', 'Campaign Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/campaign/add&reset=1', 'New Campaign', 'New Campaign', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/campaign&reset=1&subPage=survey', 'Surveys', 'Survey Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/campaign&reset=1&subPage=petition', 'Petitions', 'Petition Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/campaign&reset=1&subPage=campaign', 'Campaigns', 'Campaign Dashboard', 'manage campaign,administer CiviCampaign', 'OR', @campaigndashboardlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/campaign/add&reset=1', 'New Campaign', 'New Campaign', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/survey/add&reset=1', 'New Survey', 'New Survey', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 3 ), ( @domainID, 'civicrm/petition/add&reset=1', 'New Petition', 'New Petition', 'manage campaign,administer CiviCampaign', 'OR', @campaignlastID, '1', NULL, 4 ), ( @domainID, 'civicrm/survey/search&reset=1&op=reserve', 'Reserve Respondents', 'Reserve Respondents', 'administer CiviCampaign,manage campaign,reserve campaign contacts', 'OR', @campaignlastID, '1', NULL, 5 ), @@ -254,80 +254,80 @@ VALUES SET @caselastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/case&reset=1', 'Dashboard', 'Dashboard', 'access my cases and activities,access all cases and activities', 'OR', @caselastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/case/add&reset=1&action=add&atype=13&context=standalone', 'New Case', 'New Case', 'add cases,access all cases and activities', 'OR', @caselastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/case&reset=1', 'Dashboard', 'Dashboard', 'access my cases and activities,access all cases and activities', 'OR', @caselastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/case/add&reset=1&action=add&atype=13&context=standalone', 'New Case', 'New Case', 'add cases,access all cases and activities', 'OR', @caselastID, '1', NULL, 2 ), ( @domainID, 'civicrm/case/search&reset=1', 'Find Cases', 'Find Cases', 'access my cases and activities,access all cases and activities', 'OR', @caselastID, '1', 1, 3 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Grants', 'Grants', 'access CiviGrant', '', NULL, '1', NULL, 90 ); SET @grantlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/grant&reset=1', 'Dashboard', 'Dashboard', 'access CiviGrant', '', @grantlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/grant/add&reset=1&action=add&context=standalone', 'New Grant', 'New Grant', 'access CiviGrant,edit grants', 'AND', @grantlastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/grant&reset=1', 'Dashboard', 'Dashboard', 'access CiviGrant', '', @grantlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/grant/add&reset=1&action=add&context=standalone', 'New Grant', 'New Grant', 'access CiviGrant,edit grants', 'AND', @grantlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/grant/search&reset=1', 'Find Grants', 'Find Grants', 'access CiviGrant', '', @grantlastID, '1', 1, 3 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Administer', 'Administer', 'administer CiviCRM', '', NULL, '1', NULL, 100 ); SET @adminlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin&reset=1', 'Administration Console', 'Administration Console', 'administer CiviCRM', '', @adminlastID, '1', NULL, 1 ); SET @adminConsolelastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/configtask&reset=1', 'Configuration Checklist', 'Configuration Checklist', 'administer CiviCRM', '', @adminConsolelastID, '1', NULL, 1 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Customize Data and Screens', 'Customize Data and Screens', 'administer CiviCRM', '', @adminlastID, '1', NULL, 3 ); SET @CustomizelastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/admin/custom/group&reset=1', 'Custom Fields', 'Custom Fields', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/uf/group&reset=1', 'Profiles', 'Profiles', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/tag&reset=1', 'Tags (Categories)', 'Tags (Categories)', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/admin/options/activity_type&reset=1&group=activity_type', 'Activity Types', 'Activity Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 4 ), - ( @domainID, 'civicrm/admin/reltype&reset=1', 'Relationship Types', 'Relationship Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/admin/custom/group&reset=1', 'Custom Fields', 'Custom Fields', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/uf/group&reset=1', 'Profiles', 'Profiles', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/admin/tag&reset=1', 'Tags (Categories)', 'Tags (Categories)', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/admin/options/activity_type&reset=1&group=activity_type', 'Activity Types', 'Activity Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 4 ), + ( @domainID, 'civicrm/admin/reltype&reset=1', 'Relationship Types', 'Relationship Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/options/subtype&reset=1', 'Contact Types','Contact Types', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/setting/preferences/display&reset=1', 'Display Preferences', 'Display Preferences', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 9 ), - ( @domainID, 'civicrm/admin/setting/search&reset=1', 'Search Preferences', 'Search Preferences', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 10 ), - ( @domainID, 'civicrm/admin/menu&reset=1', 'Navigation Menu', 'Navigation Menu', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 11 ), + ( @domainID, 'civicrm/admin/setting/preferences/display&reset=1', 'Display Preferences', 'Display Preferences', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 9 ), + ( @domainID, 'civicrm/admin/setting/search&reset=1', 'Search Preferences', 'Search Preferences', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 10 ), + ( @domainID, 'civicrm/admin/menu&reset=1', 'Navigation Menu', 'Navigation Menu', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 11 ), ( @domainID, 'civicrm/admin/options/wordreplacements&reset=1','Word Replacements','Word Replacements', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 12 ), ( @domainID, 'civicrm/admin/options/custom_search&reset=1&group=custom_search', 'Manage Custom Searches', 'Manage Custom Searches', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 13 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Dropdown Options', 'Dropdown Options', 'administer CiviCRM', '', @CustomizelastID, '1', NULL, 8 ); - + SET @optionListlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/options/gender&reset=1&group=gender', 'Gender Options', 'Gender Options', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/options/individual_prefix&group=individual_prefix&reset=1', 'Individual Prefixes (Ms, Mr...)', 'Individual Prefixes (Ms, Mr...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/options/individual_suffix&group=individual_suffix&reset=1', 'Individual Suffixes (Jr, Sr...)', 'Individual Suffixes (Jr, Sr...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/admin/options/instant_messenger_service&group=instant_messenger_service&reset=1', 'Instant Messenger Services', 'Instant Messenger Services', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 4 ), - ( @domainID, 'civicrm/admin/locationType&reset=1', 'Location Types (Home, Work...)', 'Location Types (Home, Work...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 5 ), - ( @domainID, 'civicrm/admin/options/mobile_provider&group=mobile_provider&reset=1', 'Mobile Phone Providers', 'Mobile Phone Providers', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/options/phone_type&group=phone_type&reset=1', 'Phone Types', 'Phone Types', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 7 ), +VALUES + ( @domainID, 'civicrm/admin/options/gender&reset=1&group=gender', 'Gender Options', 'Gender Options', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/options/individual_prefix&group=individual_prefix&reset=1', 'Individual Prefixes (Ms, Mr...)', 'Individual Prefixes (Ms, Mr...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/admin/options/individual_suffix&group=individual_suffix&reset=1', 'Individual Suffixes (Jr, Sr...)', 'Individual Suffixes (Jr, Sr...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/admin/options/instant_messenger_service&group=instant_messenger_service&reset=1', 'Instant Messenger Services', 'Instant Messenger Services', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 4 ), + ( @domainID, 'civicrm/admin/locationType&reset=1', 'Location Types (Home, Work...)', 'Location Types (Home, Work...)', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/admin/options/mobile_provider&group=mobile_provider&reset=1', 'Mobile Phone Providers', 'Mobile Phone Providers', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/admin/options/phone_type&group=phone_type&reset=1', 'Phone Types', 'Phone Types', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 7 ), ( @domainID, 'civicrm/admin/options/website_type&group=website_type&reset=1', 'Website Types', 'Website Types', 'administer CiviCRM', '', @optionListlastID, '1', NULL, 8 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES @@ -336,41 +336,41 @@ VALUES SET @communicationslastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/domain&action=update&reset=1', 'Organization Address and Contact Info', 'Organization Address and Contact Info', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/options/from_email_address&group=from_email_address&reset=1', 'FROM Email Addresses', 'FROM Email Addresses', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 3 ), +VALUES + ( @domainID, 'civicrm/admin/domain&action=update&reset=1', 'Organization Address and Contact Info', 'Organization Address and Contact Info', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/options/from_email_address&group=from_email_address&reset=1', 'FROM Email Addresses', 'FROM Email Addresses', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/scheduleReminders&reset=1', 'Schedule Reminders', 'Schedule Reminders', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 4 ), ( @domainID, 'civicrm/admin/options/preferred_communication_method&group=preferred_communication_method&reset=1', 'Preferred Communication Methods', 'Preferred Communication Methods', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/labelFormats&reset=1', 'Label Formats', 'Label Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/pdfFormats&reset=1', 'Print Page (PDF) Formats', 'Print Page (PDF) Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 7 ), - ( @domainID, 'civicrm/admin/options/email_greeting&group=email_greeting&reset=1', 'Email Greeting Formats', 'Email Greeting Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 8 ), - ( @domainID, 'civicrm/admin/options/postal_greeting&group=postal_greeting&reset=1', 'Postal Greeting Formats', 'Postal Greeting Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 9 ), + ( @domainID, 'civicrm/admin/pdfFormats&reset=1', 'Print Page (PDF) Formats', 'Print Page (PDF) Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 7 ), + ( @domainID, 'civicrm/admin/options/email_greeting&group=email_greeting&reset=1', 'Email Greeting Formats', 'Email Greeting Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/admin/options/postal_greeting&group=postal_greeting&reset=1', 'Postal Greeting Formats', 'Postal Greeting Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 9 ), ( @domainID, 'civicrm/admin/options/addressee&group=addressee&reset=1', 'Addressee Formats', 'Addressee Formats', 'administer CiviCRM', '', @communicationslastID, '1', NULL, 10 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Localization', 'Localization', 'administer CiviCRM', '', @adminlastID, '1', NULL, 6 ); SET @locallastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/setting/localization&reset=1', 'Languages, Currency, Locations', 'Languages, Currency, Locations', 'administer CiviCRM', '', @locallastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/setting/preferences/address&reset=1', 'Address Settings', 'Address Settings', 'administer CiviCRM', '', @locallastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/admin/setting/localization&reset=1', 'Languages, Currency, Locations', 'Languages, Currency, Locations', 'administer CiviCRM', '', @locallastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/setting/preferences/address&reset=1', 'Address Settings', 'Address Settings', 'administer CiviCRM', '', @locallastID, '1', NULL, 2 ), ( @domainID, 'civicrm/admin/setting/date&reset=1', 'Date Formats', 'Date Formats', 'administer CiviCRM', '', @locallastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/options/languages&group=languages&reset=1', 'Preferred Language Options', 'Preferred Language Options', 'administer CiviCRM', '', @locallastID, '1', NULL, 4 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Users and Permissions', 'Users and Permissions', 'administer CiviCRM', '', @adminlastID, '1', NULL, 7 ); SET @usersPermslastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/access&reset=1', 'Permissions (Access Control)', 'Permissions (Access Control)', 'administer CiviCRM', '', @usersPermslastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/synchUser&reset=1', 'Synchronize Users to Contacts', 'Synchronize Users to Contacts', 'administer CiviCRM', '', @usersPermslastID, '1', NULL, 2 ); @@ -383,19 +383,19 @@ SET @systemSettingslastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/admin/setting/component&reset=1', 'Enable CiviCRM Components', 'Enable Components', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/setting/component&reset=1', 'Enable CiviCRM Components', 'Enable Components', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/extensions&reset=1', 'Manage Extensions', 'Manage Extensions', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/setting/smtp&reset=1', 'Outbound Email (SMTP/Sendmail)', 'Outbound Email', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 3 ), - ( @domainID, 'civicrm/admin/paymentProcessor&reset=1', 'Payment Processors', 'Payment Processors', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 4 ), - ( @domainID, 'civicrm/admin/setting/mapping&reset=1', 'Mapping and Geocoding', 'Mapping and Geocoding', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 5 ), - ( @domainID, 'civicrm/admin/setting/misc&reset=1', 'Undelete, Logging and ReCAPTCHA', 'Undelete, Logging and ReCAPTCHA', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/setting/path&reset=1', 'Directories', 'Directories', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 7 ), - ( @domainID, 'civicrm/admin/setting/url&reset=1', 'Resource URLs', 'Resource URLs', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/admin/setting/smtp&reset=1', 'Outbound Email (SMTP/Sendmail)', 'Outbound Email', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 3 ), + ( @domainID, 'civicrm/admin/paymentProcessor&reset=1', 'Payment Processors', 'Payment Processors', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 4 ), + ( @domainID, 'civicrm/admin/setting/mapping&reset=1', 'Mapping and Geocoding', 'Mapping and Geocoding', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/admin/setting/misc&reset=1', 'Undelete, Logging and ReCAPTCHA', 'Undelete, Logging and ReCAPTCHA', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/admin/setting/path&reset=1', 'Directories', 'Directories', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 7 ), + ( @domainID, 'civicrm/admin/setting/url&reset=1', 'Resource URLs', 'Resource URLs', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 8 ), ( @domainID, 'civicrm/admin/setting/updateConfigBackend&reset=1', 'Cleanup Caches and Update Paths', 'Cleanup Caches and Update Paths', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 9 ), - ( @domainID, 'civicrm/admin/setting/uf&reset=1', 'CMS Database Integration', 'CMS Integration', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 10 ), - ( @domainID, 'civicrm/admin/options/safe_file_extension&group=safe_file_extension&reset=1', 'Safe File Extensions', 'Safe File Extensions','administer CiviCRM', '',@systemSettingslastID, '1', NULL, 11 ), - ( @domainID, 'civicrm/admin/options?reset=1', 'Option Groups', 'Option Groups', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 12 ), - ( @domainID, 'civicrm/admin/mapping&reset=1', 'Import/Export Mappings', 'Import/Export Mappings', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 13 ), + ( @domainID, 'civicrm/admin/setting/uf&reset=1', 'CMS Database Integration', 'CMS Integration', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 10 ), + ( @domainID, 'civicrm/admin/options/safe_file_extension&group=safe_file_extension&reset=1', 'Safe File Extensions', 'Safe File Extensions','administer CiviCRM', '',@systemSettingslastID, '1', NULL, 11 ), + ( @domainID, 'civicrm/admin/options?reset=1', 'Option Groups', 'Option Groups', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 12 ), + ( @domainID, 'civicrm/admin/mapping&reset=1', 'Import/Export Mappings', 'Import/Export Mappings', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 13 ), ( @domainID, 'civicrm/admin/setting/debug&reset=1', 'Debugging and Error Handling','Debugging and Error Handling', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 14 ), ( @domainID, 'civicrm/admin/setting/preferences/multisite&reset=1', 'Multi Site Settings', 'Multi Site Settings', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 15 ), ( @domainID, 'civicrm/admin/job&reset=1', 'Scheduled Jobs', 'Scheduled Jobs', 'administer CiviCRM', '', @systemSettingslastID, '1', NULL, 16 ), @@ -405,13 +405,13 @@ VALUES -- begin component admin menus INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviCampaign', 'CiviCampaign', 'administer CiviCampaign,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 9 ); SET @adminCampaignlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/campaign/surveyType&reset=1', 'Survey Types', 'Survey Types', 'administer CiviCampaign', '', @adminCampaignlastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/options/campaign_type&group=campaign_type&reset=1', 'Campaign Types', 'Campaign Types', 'administer CiviCampaign', '', @adminCampaignlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/admin/options/campaign_status&group=campaign_status&reset=1', 'Campaign Status', 'Campaign Status', 'administer CiviCampaign', '', @adminCampaignlastID, '1', NULL, 3 ), @@ -420,33 +420,33 @@ VALUES INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviCase', 'CiviCase', 'administer CiviCase', NULL, @adminlastID, '1', NULL, 10 ); SET @adminCaselastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/options/case_type&group=case_type&reset=1', 'Case Types', 'Case Types', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 1 ), +VALUES + ( @domainID, 'civicrm/admin/options/case_type&group=case_type&reset=1', 'Case Types', 'Case Types', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/options/redaction_rule&group=redaction_rule&reset=1', 'Redaction Rules', 'Redaction Rules', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 2 ), ( @domainID, 'civicrm/admin/options/case_status&group=case_status&reset=1', 'Case Statuses', 'Case Statuses', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/options/encounter_medium&group=encounter_medium&reset=1', 'Encounter Medium', 'Encounter Medium', 'administer CiviCase', NULL, @adminCaselastID, '1', NULL, 4 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviContribute', 'CiviContribute', 'access CiviContribute,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 11 ); - + SET @adminContributelastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) VALUES - ( @domainID, 'civicrm/admin/contribute&reset=1&action=add', 'New Contribution Page', 'New Contribution Page', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 6 ), - ( @domainID, 'civicrm/admin/contribute&reset=1', 'Manage Contribution Pages', 'Manage Contribution Pages', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', '1', 7 ), - ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=contribute', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 8 ), - ( @domainID, 'civicrm/admin/contribute/managePremiums&reset=1', 'Premiums (Thank-you Gifts)', 'Premiums', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', 1, 9 ), - ( @domainID, 'civicrm/admin/contribute/contributionType&reset=1', 'Contribution Types', 'Contribution Types', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 10), - ( @domainID, 'civicrm/admin/options/payment_instrument&group=payment_instrument&reset=1', 'Payment Instruments', 'Payment Instruments', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 11 ), + ( @domainID, 'civicrm/admin/contribute&reset=1&action=add', 'New Contribution Page', 'New Contribution Page', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 6 ), + ( @domainID, 'civicrm/admin/contribute&reset=1', 'Manage Contribution Pages', 'Manage Contribution Pages', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', '1', 7 ), + ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=contribute', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/admin/contribute/managePremiums&reset=1', 'Premiums (Thank-you Gifts)', 'Premiums', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', 1, 9 ), + ( @domainID, 'civicrm/admin/contribute/contributionType&reset=1', 'Contribution Types', 'Contribution Types', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 10), + ( @domainID, 'civicrm/admin/options/payment_instrument&group=payment_instrument&reset=1', 'Payment Instruments', 'Payment Instruments', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 11 ), ( @domainID, 'civicrm/admin/options/accept_creditcard&group=accept_creditcard&reset=1', 'Accepted Credit Cards', 'Accepted Credit Cards', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', 1, 12 ), ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 13 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviContribute,administer CiviCRM', 'AND', @adminContributelastID, '1', NULL, 14 ), @@ -454,64 +454,64 @@ VALUES INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviEvent', 'CiviEvent', 'access CiviEvent,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 12 ); SET @adminEventlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/event/add&reset=1&action=add', 'New Event', 'New Event', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/event/manage&reset=1', 'Manage Events', 'Manage Events', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 2 ), +VALUES + ( @domainID, 'civicrm/event/add&reset=1&action=add', 'New Event', 'New Event', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/event/manage&reset=1', 'Manage Events', 'Manage Events', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 2 ), ( @domainID, 'civicrm/admin/pcp?reset=1&page_type=event', 'Personal Campaign Pages', 'Personal Campaign Pages', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 3 ), - ( @domainID, 'civicrm/admin/eventTemplate&reset=1', 'Event Templates', 'Event Templates', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 4 ), - ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 5 ), + ( @domainID, 'civicrm/admin/eventTemplate&reset=1', 'Event Templates', 'Event Templates', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 4 ), + ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', 1, 6 ), - ( @domainID, 'civicrm/admin/options/event_type&group=event_type&reset=1', 'Event Types', 'Event Types', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 7 ), - ( @domainID, 'civicrm/admin/participant_status&reset=1', 'Participant Statuses', 'Participant Statuses', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 8 ), + ( @domainID, 'civicrm/admin/options/event_type&group=event_type&reset=1', 'Event Types', 'Event Types', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 7 ), + ( @domainID, 'civicrm/admin/participant_status&reset=1', 'Participant Statuses', 'Participant Statuses', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 8 ), ( @domainID, 'civicrm/admin/options/participant_role&group=participant_role&reset=1', 'Participant Roles', 'Participant Roles', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 9 ), - ( @domainID, 'civicrm/admin/options/participant_listing&group=participant_listing&reset=1', 'Participant Listing Options', 'Participant Listing Options', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 10 ), - ( @domainID, 'civicrm/admin/options/event_badge&group=event_badge&reset=1', 'Event Badge Formats', 'Event Badge Formats', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 11 ), + ( @domainID, 'civicrm/admin/options/participant_listing&group=participant_listing&reset=1', 'Participant Listing Options', 'Participant Listing Options', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 10 ), + ( @domainID, 'civicrm/admin/options/event_badge&group=event_badge&reset=1', 'Event Badge Formats', 'Event Badge Formats', 'access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 11 ), ( @domainID, 'civicrm/admin/paymentProcessor&reset=1', 'Payment Processors', 'Payment Processors', 'administer CiviCRM', '', @adminEventlastID, '1', NULL, 12), ( @domainID, 'civicrm/admin/setting/preferences/event&reset=1', 'CiviEvent Component Settings', 'CiviEvent Component Settings','access CiviEvent,administer CiviCRM', 'AND', @adminEventlastID, '1', NULL, 13 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviGrant', 'CiviGrant', 'access CiviGrant,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 13 ); SET @adminGrantlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/options/grant_type&group=grant_type&reset=1', 'Grant Types', 'Grant Types', 'access CiviGrant,administer CiviCRM', 'AND', @adminGrantlastID, '1', NULL, 1 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviMail', 'CiviMail', 'access CiviMail,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 14 ); SET @adminMailinglastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/component&reset=1', 'Headers, Footers, and Automated Messages', 'Headers, Footers, and Automated Messages', 'access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @adminMailinglastID, '1', NULL, 2 ), - ( @domainID, 'civicrm/admin/options/from_email&group=from_email_address&reset=1', 'From Email Addresses', 'From Email Addresses', 'administer CiviCRM', '', @adminMailinglastID, '1', NULL, 3 ), +VALUES + ( @domainID, 'civicrm/admin/component&reset=1', 'Headers, Footers, and Automated Messages', 'Headers, Footers, and Automated Messages', 'access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/messageTemplates&reset=1', 'Message Templates', 'Message Templates', 'administer CiviCRM', '', @adminMailinglastID, '1', NULL, 2 ), + ( @domainID, 'civicrm/admin/options/from_email&group=from_email_address&reset=1', 'From Email Addresses', 'From Email Addresses', 'administer CiviCRM', '', @adminMailinglastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/mailSettings&reset=1', 'Mail Accounts', 'Mail Accounts', 'access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 4 ), ( @domainID, 'civicrm/admin/mail&reset=1', 'Mailer Settings', 'Mailer Settings', 'access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 5 ), ( @domainID, 'civicrm/admin/setting/preferences/mailing&reset=1', 'CiviMail Component Settings', 'CiviMail Component Settings','access CiviMail,administer CiviCRM', 'AND', @adminMailinglastID, '1', NULL, 6 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviMember', 'CiviMember', 'access CiviMember,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 15 ); SET @adminMemberlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/admin/member/membershipType&reset=1', 'Membership Types', 'Membership Types', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', NULL, 1 ), +VALUES + ( @domainID, 'civicrm/admin/member/membershipType&reset=1', 'Membership Types', 'Membership Types', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', NULL, 1 ), ( @domainID, 'civicrm/admin/member/membershipStatus&reset=1', 'Membership Status Rules', 'Membership Status Rules', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', 1, 2 ), ( @domainID, 'civicrm/admin/price&reset=1&action=add', 'New Price Set', 'New Price Set', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/price&reset=1', 'Manage Price Sets', 'Manage Price Sets', 'access CiviMember,administer CiviCRM', 'AND', @adminMemberlastID, '1', NULL, 4 ), @@ -519,48 +519,48 @@ VALUES INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'CiviReport', 'CiviReport', 'access CiviReport,administer CiviCRM', 'AND', @adminlastID, '1', NULL, 16 ); SET @adminReportlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'civicrm/report/list&reset=1', 'Reports Listing', 'Reports Listing', 'access CiviReport', '', @adminReportlastID, '1', NULL, 1 ), - ( @domainID, 'civicrm/admin/report/template/list&reset=1', 'Create Reports from Templates', 'Create Reports from Templates', 'administer Reports', '', @adminReportlastID, '1', NULL, 2 ), +VALUES + ( @domainID, 'civicrm/report/list&reset=1', 'Reports Listing', 'Reports Listing', 'access CiviReport', '', @adminReportlastID, '1', NULL, 1 ), + ( @domainID, 'civicrm/admin/report/template/list&reset=1', 'Create Reports from Templates', 'Create Reports from Templates', 'administer Reports', '', @adminReportlastID, '1', NULL, 2 ), ( @domainID, 'civicrm/admin/report/options/report_template&reset=1', 'Manage Templates', 'Manage Templates', 'administer Reports', '', @adminReportlastID, '1', NULL, 3 ), ( @domainID, 'civicrm/admin/report/register&reset=1', 'Register Report', 'Register Report', 'administer Reports', '', @adminReportlastID, '1', NULL, 4 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Help', 'Help', NULL, '', NULL, '1', NULL, 110); SET @adminHelplastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( @domainID, 'http://documentation.civicrm.org', 'Documentation', 'Documentation', NULL, 'AND', @adminHelplastID, '1', NULL, 1 ), - ( @domainID, 'http://forum.civicrm.org', 'Community Forums', 'Community Forums', NULL, 'AND', @adminHelplastID, '1', NULL, 2 ), - ( @domainID, 'http://civicrm.org/participate', 'Participate', 'Participate', NULL, 'AND', @adminHelplastID, '1', NULL, 3 ), +VALUES + ( @domainID, 'http://documentation.civicrm.org', 'Documentation', 'Documentation', NULL, 'AND', @adminHelplastID, '1', NULL, 1 ), + ( @domainID, 'http://forum.civicrm.org', 'Community Forums', 'Community Forums', NULL, 'AND', @adminHelplastID, '1', NULL, 2 ), + ( @domainID, 'http://civicrm.org/participate', 'Participate', 'Participate', NULL, 'AND', @adminHelplastID, '1', NULL, 3 ), ( @domainID, 'http://civicrm.org/aboutcivicrm', 'About', 'About', NULL, 'AND', @adminHelplastID, '1', NULL, 4 ); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, NULL, 'Reports', 'Reports', 'access CiviReport', '', NULL, '1', NULL, 95 ); SET @reportlastID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/report/list&reset=1', 'Reports Listing', 'Reports Listing', 'access CiviReport', '', @reportlastID, '1', 1, 1 ); - + INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, 'civicrm/admin/report/template/list&reset=1', 'Create Reports from Templates', 'Create Reports from Templates', 'administer Reports', '', @reportlastID, '1', 1, 2 ); - + -- sample reports with navigation menus INSERT INTO `civicrm_report_instance` @@ -588,12 +588,12 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Activity Report ', 'activity', 'Provides a list of constituent activity including activity statistics for one/all contacts during a given date range(required)', 'administer CiviCRM', 'a:26:{s:6:"fields";a:6:{s:16:"contact_assignee";s:1:"1";s:14:"contact_target";s:1:"1";s:16:"activity_type_id";s:1:"1";s:16:"activity_subject";s:1:"1";s:18:"activity_date_time";s:1:"1";s:9:"status_id";s:1:"1";}s:17:"contact_source_op";s:3:"has";s:20:"contact_source_value";s:0:"";s:19:"contact_assignee_op";s:3:"has";s:22:"contact_assignee_value";s:0:"";s:17:"contact_target_op";s:3:"has";s:20:"contact_target_value";s:0:"";s:15:"current_user_op";s:2:"eq";s:18:"current_user_value";s:1:"0";s:27:"activity_date_time_relative";s:10:"this.month";s:23:"activity_date_time_from";s:0:"";s:21:"activity_date_time_to";s:0:"";s:19:"activity_subject_op";s:3:"has";s:22:"activity_subject_value";s:0:"";s:19:"activity_type_id_op";s:2:"in";s:22:"activity_type_id_value";a:0:{}s:12:"status_id_op";s:2:"in";s:15:"status_id_value";a:0:{}s:11:"description";s:126:"Provides a list of constituent activity including activity statistics for one/all contacts during a given date range(required)";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:18:"administer CiviCRM";s:6:"groups";s:0:"";s:9:"group_bys";N;s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Activity Report', 'activity', 'administer CiviCRM', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; @@ -604,7 +604,7 @@ VALUES SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Current Employer Report', 'Current Employer Report', 'administer CiviCRM', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; @@ -671,52 +671,52 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'LYBUNT Report', 'contribute/lybunt', 'Last year but not this year. Provides a list of constituents who donated last year but did not donate during the time period you specify as the current year.', 'access CiviContribute', 'a:19:{s:6:"fields";a:3:{s:9:"sort_name";s:1:"1";s:5:"email";s:1:"1";s:5:"phone";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"yid_op";s:2:"eq";s:9:"yid_value";s:4:"2011";s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:157:"Last year but not this year. Provides a list of constituents who donated last year but did not donate during the time period you specify as the current year.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:6:"charts";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'LYBUNT Report', 'LYBUNT Report', 'access CiviContribute', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Contributions by Organization Report', 'contribute/organizationSummary', 'Displays a detailed list of contributions grouped by organization, which includes contributions made by employees for the organisation.', 'access CiviContribute', 'a:20:{s:6:"fields";a:5:{s:17:"organization_name";s:1:"1";s:9:"sort_name";s:1:"1";s:12:"total_amount";s:1:"1";s:22:"contribution_status_id";s:1:"1";s:12:"receive_date";s:1:"1";}s:20:"organization_name_op";s:3:"has";s:23:"organization_name_value";s:0:"";s:23:"relationship_type_id_op";s:2:"eq";s:26:"relationship_type_id_value";s:5:"4_b_a";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:11:"description";s:193:"Displays a detailed contribution report for Organization relationships with contributors, as to if contribution done was from an employee of some organization or from that Organization itself.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Contributions by Organization Report', 'Contributions by Organization Report', 'access CiviContribute', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Contributions by Household Report', 'contribute/householdSummary', 'Displays a detailed list of contributions grouped by household which includes contributions made by members of the household.', 'access CiviContribute', 'a:21:{s:6:"fields";a:5:{s:14:"household_name";s:1:"1";s:9:"sort_name";s:1:"1";s:12:"total_amount";s:1:"1";s:22:"contribution_status_id";s:1:"1";s:12:"receive_date";s:1:"1";}s:17:"household_name_op";s:3:"has";s:20:"household_name_value";s:0:"";s:23:"relationship_type_id_op";s:2:"eq";s:26:"relationship_type_id_value";s:5:"6_b_a";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:11:"description";s:213:"Provides a detailed report for Contributions made by contributors(Or Household itself) who are having a relationship with household (For ex a Contributor is Head of Household for some household or is a member of.)";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Contributions by Household Report', 'Contributions by Household Report', 'access CiviContribute', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Top Donors Report', 'contribute/topDonor', 'Provides a list of the top donors during a time period you define. You can include as many donors as you want (for example, top 100 of your donors).', 'access CiviContribute', 'a:20:{s:6:"fields";a:2:{s:12:"display_name";s:1:"1";s:12:"total_amount";s:1:"1";}s:21:"receive_date_relative";s:9:"this.year";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:15:"total_range_min";s:0:"";s:15:"total_range_max";s:0:"";s:14:"total_range_op";s:2:"eq";s:17:"total_range_value";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:11:"description";s:148:"Provides a list of the top donors during a time period you define. You can include as many donors as you want (for example, top 100 of your donors).";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Top Donors Report', 'Top Donors Report', 'access CiviContribute', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Soft Credit Report', 'contribute/softcredit', 'Shows contributions made by contacts that have been soft-credited to other contacts.', 'access CiviContribute', 'a:23:{s:6:"fields";a:5:{s:21:"display_name_creditor";s:1:"1";s:24:"display_name_constituent";s:1:"1";s:14:"email_creditor";s:1:"1";s:14:"phone_creditor";s:1:"1";s:12:"total_amount";s:1:"1";}s:5:"id_op";s:2:"in";s:8:"id_value";a:0:{}s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:20:"Soft Credit details.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -728,7 +728,7 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Personal Campaign Page Summary', 'contribute/pcp', 'Summarizes amount raised and number of contributors for each Personal Campaign Page.', 'access CiviContribute', 'a:22:{s:6:"fields";a:8:{s:9:"sort_name";s:1:"1";s:10:"page_title";s:1:"1";s:5:"title";s:1:"1";s:11:"goal_amount";s:1:"1";s:8:"amount_1";s:1:"1";s:8:"amount_2";s:1:"1";s:7:"soft_id";s:1:"1";s:12:"receive_date";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:13:"page_title_op";s:3:"has";s:16:"page_title_value";s:0:"";s:8:"title_op";s:3:"has";s:11:"title_value";s:0:"";s:12:"amount_2_min";s:0:"";s:12:"amount_2_max";s:0:"";s:11:"amount_2_op";s:3:"lte";s:14:"amount_2_value";s:0:"";s:11:"description";s:35:"Shows Personal Campaign Page Report";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -740,29 +740,29 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Pledge Summary Report', 'pledge/detail', 'Summary of pledges including amount pledged, pledge status, next payment date, balance due, total amount paid etc.', 'access CiviPledge', 'a:27:{s:6:"fields";a:4:{s:9:"sort_name";s:1:"1";s:10:"country_id";s:1:"1";s:6:"amount";s:1:"1";s:9:"status_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:27:"pledge_create_date_relative";s:1:"0";s:23:"pledge_create_date_from";s:0:"";s:21:"pledge_create_date_to";s:0:"";s:17:"pledge_amount_min";s:0:"";s:17:"pledge_amount_max";s:0:"";s:16:"pledge_amount_op";s:3:"lte";s:19:"pledge_amount_value";s:0:"";s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:13:"Pledge Report";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviPledge";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Pledge Summary Report', 'Pledge Summary Report', 'access CiviPledge', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Pledged But not Paid Report', 'pledge/pbnp', 'Pledged but not Paid Report', 'access CiviPledge', 'a:17:{s:6:"fields";a:5:{s:9:"sort_name";s:1:"1";s:18:"pledge_create_date";s:1:"1";s:6:"amount";s:1:"1";s:14:"scheduled_date";s:1:"1";s:10:"country_id";s:1:"1";}s:27:"pledge_create_date_relative";s:1:"0";s:23:"pledge_create_date_from";s:0:"";s:21:"pledge_create_date_to";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:27:"Pledged but not Paid Report";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviPledge";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Pledged But not Paid Report', 'Pledged But not Paid Report', 'access CiviPledge', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Bookkeeping Transactions Report', 'contribute/bookkeeping', 'Shows Bookkeeping Transactions Report', 'access CiviContribute', 'a:25:{s:6:"fields";a:10:{s:9:"sort_name";s:1:"1";s:12:"receive_date";s:1:"1";s:12:"total_amount";s:1:"1";s:20:"contribution_type_id";s:1:"1";s:7:"trxn_id";s:1:"1";s:10:"invoice_id";s:1:"1";s:12:"check_number";s:1:"1";s:21:"payment_instrument_id";s:1:"1";s:22:"contribution_status_id";s:1:"1";s:2:"id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:1:{i:0;s:1:"1";}s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:11:"description";s:37:"Shows Bookkeeping Transactions Report";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:21:"access CiviContribute";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -775,7 +775,7 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Membership Report (Summary)', 'member/summary', 'Provides a summary of memberships by type and join date.', 'access CiviMember', 'a:18:{s:6:"fields";a:2:{s:18:"membership_type_id";s:1:"1";s:12:"total_amount";s:1:"1";}s:18:"join_date_relative";s:1:"0";s:14:"join_date_from";s:0:"";s:12:"join_date_to";s:0:"";s:21:"membership_type_id_op";s:2:"in";s:24:"membership_type_id_value";a:0:{}s:12:"status_id_op";s:2:"in";s:15:"status_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:0:{}s:9:"group_bys";a:2:{s:9:"join_date";s:1:"1";s:18:"membership_type_id";s:1:"1";}s:14:"group_bys_freq";a:1:{s:9:"join_date";s:5:"MONTH";}s:11:"description";s:56:"Provides a summary of memberships by type and join date.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviMember";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -787,19 +787,19 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Membership Report (Detail)', 'member/detail', 'Provides a list of members along with their membership status and membership details (Join Date, Start Date, End Date). Can also display contributions (payments) associated with each membership.', 'access CiviMember', 'a:28:{s:6:"fields";a:5:{s:9:"sort_name";s:1:"1";s:18:"membership_type_id";s:1:"1";s:21:"membership_start_date";s:1:"1";s:19:"membership_end_date";s:1:"1";s:4:"name";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:18:"join_date_relative";s:1:"0";s:14:"join_date_from";s:0:"";s:12:"join_date_to";s:0:"";s:23:"owner_membership_id_min";s:0:"";s:23:"owner_membership_id_max";s:0:"";s:22:"owner_membership_id_op";s:3:"lte";s:25:"owner_membership_id_value";s:0:"";s:6:"tid_op";s:2:"in";s:9:"tid_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:119:"Provides a list of members along with their membership status and membership details (Join Date, Start Date, End Date).";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviMember";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Membership Report (Detail)', 'Membership Report (Detail)', 'access CiviMember', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; -- contribution and membership report INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Contribution and Membership Details', 'member/contributionDetail', 'Contribution details for any type of contribution, plus associated membership information for contributions which are in payment for memberships.', '', 'a:67:{s:6:"fields";a:12:{s:9:"sort_name";s:1:"1";s:5:"email";s:1:"1";s:5:"phone";s:1:"1";s:20:"contribution_type_id";s:1:"1";s:12:"receive_date";s:1:"1";s:12:"total_amount";s:1:"1";s:18:"membership_type_id";s:1:"1";s:21:"membership_start_date";s:1:"1";s:19:"membership_end_date";s:1:"1";s:9:"join_date";s:1:"1";s:22:"membership_status_name";s:1:"1";s:10:"country_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:24:"payment_instrument_id_op";s:2:"in";s:27:"payment_instrument_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:0:{}s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:13:"ordinality_op";s:2:"in";s:16:"ordinality_value";a:0:{}s:18:"join_date_relative";s:1:"0";s:14:"join_date_from";s:0:"";s:12:"join_date_to";s:0:"";s:30:"membership_start_date_relative";s:1:"0";s:26:"membership_start_date_from";s:0:"";s:24:"membership_start_date_to";s:0:"";s:28:"membership_end_date_relative";s:1:"0";s:24:"membership_end_date_from";s:0:"";s:22:"membership_end_date_to";s:0:"";s:23:"owner_membership_id_min";s:0:"";s:23:"owner_membership_id_max";s:0:"";s:22:"owner_membership_id_op";s:3:"lte";s:25:"owner_membership_id_value";s:0:"";s:6:"tid_op";s:2:"in";s:9:"tid_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a: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:12:"county_id_op";s:2:"in";s:15:"county_id_value";a: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:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:35:"Contribution and Membership Details";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:1:"0";s:9:"domain_id";i:1;}{s:6:"fields";a:12:{s:9:"sort_name";s:1:"1";s:5:"email";s:1:"1";s:5:"phone";s:1:"1";s:20:"contribution_type_id";s:1:"1";s:12:"receive_date";s:1:"1";s:12:"total_amount";s:1:"1";s:18:"membership_type_id";s:1:"1";s:21:"membership_start_date";s:1:"1";s:19:"membership_end_date";s:1:"1";s:9:"join_date";s:1:"1";s:22:"membership_status_name";s:1:"1";s:10:"country_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:21:"receive_date_relative";s:1:"0";s:17:"receive_date_from";s:0:"";s:15:"receive_date_to";s:0:"";s:23:"contribution_type_id_op";s:2:"in";s:26:"contribution_type_id_value";a:0:{}s:24:"payment_instrument_id_op";s:2:"in";s:27:"payment_instrument_id_value";a:0:{}s:25:"contribution_status_id_op";s:2:"in";s:28:"contribution_status_id_value";a:0:{}s:16:"total_amount_min";s:0:"";s:16:"total_amount_max";s:0:"";s:15:"total_amount_op";s:3:"lte";s:18:"total_amount_value";s:0:"";s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:13:"ordinality_op";s:2:"in";s:16:"ordinality_value";a:0:{}s:18:"join_date_relative";s:1:"0";s:14:"join_date_from";s:0:"";s:12:"join_date_to";s:0:"";s:30:"membership_start_date_relative";s:1:"0";s:26:"membership_start_date_from";s:0:"";s:24:"membership_start_date_to";s:0:"";s:28:"membership_end_date_relative";s:1:"0";s:24:"membership_end_date_from";s:0:"";s:22:"membership_end_date_to";s:0:"";s:23:"owner_membership_id_min";s:0:"";s:23:"owner_membership_id_max";s:0:"";s:22:"owner_membership_id_op";s:3:"lte";s:25:"owner_membership_id_value";s:0:"";s:6:"tid_op";s:2:"in";s:9:"tid_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a: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:12:"county_id_op";s:2:"in";s:15:"county_id_value";a: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:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:35:"Contribution and Membership Details";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:1:"0";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation @@ -810,67 +810,67 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Membership Report (Lapsed)', 'member/lapse', 'Provides a list of memberships that lapsed or will lapse before the date you specify.', 'access CiviMember', 'a:16:{s:6:"fields";a:5:{s:9:"sort_name";s:1:"1";s:18:"membership_type_id";s:1:"1";s:19:"membership_end_date";s:1:"1";s:4:"name";s:1:"1";s:10:"country_id";s:1:"1";}s:6:"tid_op";s:2:"in";s:9:"tid_value";a:0:{}s:28:"membership_end_date_relative";s:1:"0";s:24:"membership_end_date_from";s:0:"";s:22:"membership_end_date_to";s:0:"";s:6:"gid_op";s:2:"in";s:9:"gid_value";a:0:{}s:8:"tagid_op";s:2:"in";s:11:"tagid_value";a:0:{}s:11:"description";s:85:"Provides a list of memberships that lapsed or will lapse before the date you specify.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviMember";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Membership Report (Lapsed)', 'Membership Report (Lapsed)', 'access CiviMember', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Event Participant Report (List)', 'event/participantListing', 'Provides lists of participants for an event.', 'access CiviEvent', 'a:27:{s:6:"fields";a:4:{s:9:"sort_name";s:1:"1";s:8:"event_id";s:1:"1";s:9:"status_id";s:1:"1";s:7:"role_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:8:"email_op";s:3:"has";s:11:"email_value";s:0:"";s:11:"event_id_op";s:2:"in";s:14:"event_id_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:6:"rid_op";s:2:"in";s:9:"rid_value";a:0:{}s:34:"participant_register_date_relative";s:1:"0";s:30:"participant_register_date_from";s:0:"";s:28:"participant_register_date_to";s:0:"";s:6:"eid_op";s:2:"in";s:9:"eid_value";a:0:{}s:11:"custom_4_op";s:2:"in";s:14:"custom_4_value";a:0:{}s:16:"blank_column_end";s:0:"";s:11:"description";s:44:"Provides lists of participants for an event.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviEvent";s:6:"groups";s:0:"";s:7:"options";N;s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Event Participant Report (List)', 'Event Participant Report (List)', 'access CiviEvent', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Event Income Report (Summary)', 'event/summary', 'Provides an overview of event income. You can include key information such as event ID, registration, attendance, and income generated to help you determine the success of an event.', 'access CiviEvent', 'a:18:{s:6:"fields";a:2:{s:5:"title";s:1:"1";s:13:"event_type_id";s:1:"1";}s:5:"id_op";s:2:"in";s:8:"id_value";a:0:{}s:16:"event_type_id_op";s:2:"in";s:19:"event_type_id_value";a:0:{}s:25:"event_start_date_relative";s:1:"0";s:21:"event_start_date_from";s:0:"";s:19:"event_start_date_to";s:0:"";s:23:"event_end_date_relative";s:1:"0";s:19:"event_end_date_from";s:0:"";s:17:"event_end_date_to";s:0:"";s:11:"description";s:181:"Provides an overview of event income. You can include key information such as event ID, registration, attendance, and income generated to help you determine the success of an event.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviEvent";s:6:"charts";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Event Income Report (Summary)', 'Event Income Report (Summary)', 'access CiviEvent', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Event Income Report (Detail)', 'event/income', 'Helps you to analyze the income generated by an event. The report can include details by participant type, status and payment method.', 'access CiviEvent', 'a:7:{s:5:"id_op";s:2:"in";s:8:"id_value";N;s:11:"description";s:133:"Helps you to analyze the income generated by an event. The report can include details by participant type, status and payment method.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviEvent";}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Event Income Report (Detail)', 'Event Income Report (Detail)', 'access CiviEvent', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Attendee List', 'event/participantListing', 'Provides lists of event attendees.', 'access CiviEvent', 'a:27:{s:6:"fields";a:4:{s:9:"sort_name";s:1:"1";s:8:"event_id";s:1:"1";s:9:"status_id";s:1:"1";s:7:"role_id";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:8:"email_op";s:3:"has";s:11:"email_value";s:0:"";s:11:"event_id_op";s:2:"in";s:14:"event_id_value";a:0:{}s:6:"sid_op";s:2:"in";s:9:"sid_value";a:0:{}s:6:"rid_op";s:2:"in";s:9:"rid_value";a:0:{}s:34:"participant_register_date_relative";s:1:"0";s:30:"participant_register_date_from";s:0:"";s:28:"participant_register_date_to";s:0:"";s:6:"eid_op";s:2:"in";s:9:"eid_value";a:0:{}s:11:"custom_4_op";s:2:"in";s:14:"custom_4_value";a:0:{}s:16:"blank_column_end";s:0:"";s:11:"description";s:44:"Provides lists of participants for an event.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviEvent";s:6:"groups";s:0:"";s:7:"options";N;s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID(); INSERT INTO civicrm_navigation ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES +VALUES ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Attendee List', 'Attendee List', 'access CiviEvent', '', @reportlastID, '1', NULL, @instanceID+2 ); UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID; INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Grant Report (Detail)', 'grant/detail', 'Grant Report Detail', 'access CiviGrant', 'a:40:{s:6:"fields";a:2:{s:9:"sort_name";s:1:"1";s:25:"application_received_date";s:1:"1";}s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:12:"gender_id_op";s:2:"in";s:15:"gender_id_value";a:0:{}s:6:"id_min";s:0:"";s:6:"id_max";s:0:"";s:5:"id_op";s:3:"lte";s:8:"id_value";s:0:"";s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:20:"state_province_id_op";s:2:"in";s:23:"state_province_id_value";a:0:{}s:13:"grant_type_op";s:2:"in";s:16:"grant_type_value";a:0:{}s:12:"status_id_op";s:2:"in";s:15:"status_id_value";a:0:{}s:18:"amount_granted_min";s:0:"";s:18:"amount_granted_max";s:0:"";s:17:"amount_granted_op";s:3:"lte";s:20:"amount_granted_value";s:0:"";s:20:"amount_requested_min";s:0:"";s:20:"amount_requested_max";s:0:"";s:19:"amount_requested_op";s:3:"lte";s:22:"amount_requested_value";s:0:"";s:34:"application_received_date_relative";s:1:"0";s:30:"application_received_date_from";s:0:"";s:28:"application_received_date_to";s:0:"";s:28:"money_transfer_date_relative";s:1:"0";s:24:"money_transfer_date_from";s:0:"";s:22:"money_transfer_date_to";s:0:"";s:23:"grant_due_date_relative";s:1:"0";s:19:"grant_due_date_from";s:0:"";s:17:"grant_due_date_to";s:0:"";s:11:"description";s:19:"Grant Report Detail";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:16:"access CiviGrant";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID( ); INSERT INTO civicrm_navigation @@ -882,7 +882,7 @@ UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @ INSERT INTO `civicrm_report_instance` ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`) -VALUES +VALUES ( @domainID, 'Grant Report (Statistics)', 'grant/statistics', 'Grant Report Statistics', 'access CiviGrant', 'a:42:{s:6:"fields";a:2:{s:18:"summary_statistics";s:1:"1";s:13:"grant_type_id";s:1:"1";}s:34:"application_received_date_relative";s:1:"0";s:30:"application_received_date_from";s:0:"";s:28:"application_received_date_to";s:0:"";s:22:"decision_date_relative";s:1:"0";s:18:"decision_date_from";s:0:"";s:16:"decision_date_to";s:0:"";s:28:"money_transfer_date_relative";s:1:"0";s:24:"money_transfer_date_from";s:0:"";s:22:"money_transfer_date_to";s:0:"";s:23:"grant_due_date_relative";s:1:"0";s:19:"grant_due_date_from";s:0:"";s:17:"grant_due_date_to";s:0:"";s:13:"grant_type_op";s:2:"in";s:16:"grant_type_value";a:0:{}s:12:"status_id_op";s:2:"in";s:15:"status_id_value";a:0:{}s:20:"amount_requested_min";s:0:"";s:20:"amount_requested_max";s:0:"";s:19:"amount_requested_op";s:3:"lte";s:22:"amount_requested_value";s:0:"";s:18:"amount_granted_min";s:0:"";s:18:"amount_granted_max";s:0:"";s:17:"amount_granted_op";s:3:"lte";s:20:"amount_granted_value";s:0:"";s:24:"grant_report_received_op";s:2:"eq";s:27:"grant_report_received_value";s:0:"";s:12:"gender_id_op";s:2:"in";s:15:"gender_id_value";a:0:{}s:15:"contact_type_op";s:2:"in";s:18:"contact_type_value";a:0:{}s:12:"region_id_op";s:2:"in";s:15:"region_id_value";a:0:{}s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:11:"description";s:23:"Grant Report Statistics";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:1:"0";s:9:"parent_id";s:0:"";s:9:"domain_id";i:1;}'); SET @instanceID:=LAST_INSERT_ID( ); INSERT INTO civicrm_navigation From d551d3d6abd6baebd5df4b44edaa119d439b4157 Mon Sep 17 00:00:00 2001 From: Seamus Lee <seamuslee001@gmail.com> Date: Tue, 8 Sep 2020 11:35:40 +1000 Subject: [PATCH 16/16] dev/core#1486 Remove Foreign Keys relating to contacts from ACL Cache tables and replace one with an index on contact_id Create index on upgrade --- CRM/ACL/DAO/ACLCache.php | 12 +++++++++--- CRM/Contact/DAO/ACLContactCache.php | 18 +----------------- CRM/Core/BAO/SchemaHandler.php | 4 ++-- CRM/Core/DAO/AllCoreTables.data.php | 10 +++++----- CRM/Upgrade/Incremental/php/FiveThirtyOne.php | 8 ++++++++ xml/schema/ACL/Cache.xml | 6 ++++++ xml/schema/Contact/ACLContactCache.xml | 1 + 7 files changed, 32 insertions(+), 27 deletions(-) diff --git a/CRM/ACL/DAO/ACLCache.php b/CRM/ACL/DAO/ACLCache.php index 671354acb388..4418878c769b 100644 --- a/CRM/ACL/DAO/ACLCache.php +++ b/CRM/ACL/DAO/ACLCache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/ACL/ACLCache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:cec3d7c7aced95902840b72829550156) + * (GenCodeChecksum:7faa5879056a56b463304bd81829afda) */ /** @@ -85,7 +85,6 @@ public static function getEntityTitle($plural = FALSE) { public static function getReferenceColumns() { if (!isset(Civi::$statics[__CLASS__]['links'])) { Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'acl_id', 'civicrm_acl', 'id'); CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); } @@ -123,7 +122,6 @@ public static function &fields() { 'entity' => 'ACLCache', 'bao' => 'CRM_ACL_DAO_ACLCache', 'localizable' => 0, - 'FKClassName' => 'CRM_Contact_DAO_Contact', 'html' => [ 'type' => 'EntityRef', ], @@ -231,6 +229,14 @@ public static function &export($prefix = FALSE) { */ public static function indices($localize = TRUE) { $indices = [ + 'index_contact_id' => [ + 'name' => 'index_contact_id', + 'field' => [ + 0 => 'contact_id', + ], + 'localizable' => FALSE, + 'sig' => 'civicrm_acl_cache::0::contact_id', + ], 'index_acl_id' => [ 'name' => 'index_acl_id', 'field' => [ diff --git a/CRM/Contact/DAO/ACLContactCache.php b/CRM/Contact/DAO/ACLContactCache.php index d5383fbc1d58..eb34f360002d 100644 --- a/CRM/Contact/DAO/ACLContactCache.php +++ b/CRM/Contact/DAO/ACLContactCache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/ACLContactCache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:ff86d1eed99d09ea6768d93b3cc39973) + * (GenCodeChecksum:4eaf1e99ce247c430fc280cc6ce68538) */ /** @@ -76,21 +76,6 @@ public static function getEntityTitle($plural = FALSE) { return $plural ? ts('ACLContact Caches') : ts('ACLContact Cache'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - if (!isset(Civi::$statics[__CLASS__]['links'])) { - Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * @@ -135,7 +120,6 @@ public static function &fields() { 'entity' => 'ACLContactCache', 'bao' => 'CRM_Contact_DAO_ACLContactCache', 'localizable' => 0, - 'FKClassName' => 'CRM_Contact_DAO_Contact', 'add' => '3.1', ], 'operation' => [ diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index a6c9845a224d..5a8d4fa93fa9 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -365,9 +365,9 @@ public static function changeUniqueToIndex($tableName, $dropUnique = TRUE) { * * @param $tables * Tables to create index for in the format: - * array('civicrm_entity_table' => 'entity_id') + * ['civicrm_entity_table' => ['entity_id']] * OR - * array('civicrm_entity_table' => array('entity_id', 'entity_table')) + * 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 diff --git a/CRM/Core/DAO/AllCoreTables.data.php b/CRM/Core/DAO/AllCoreTables.data.php index fcf35a9eed48..fdbda3a704c3 100644 --- a/CRM/Core/DAO/AllCoreTables.data.php +++ b/CRM/Core/DAO/AllCoreTables.data.php @@ -77,6 +77,11 @@ 'class' => 'CRM_ACL_DAO_ACL', 'table' => 'civicrm_acl', ], + 'CRM_ACL_DAO_ACLCache' => [ + 'name' => 'ACLCache', + 'class' => 'CRM_ACL_DAO_ACLCache', + 'table' => 'civicrm_acl_cache', + ], 'CRM_ACL_DAO_EntityRole' => [ 'name' => 'EntityRole', 'class' => 'CRM_ACL_DAO_EntityRole', @@ -392,11 +397,6 @@ 'class' => 'CRM_Core_DAO_StatusPreference', 'table' => 'civicrm_status_pref', ], - 'CRM_ACL_DAO_ACLCache' => [ - 'name' => 'ACLCache', - 'class' => 'CRM_ACL_DAO_ACLCache', - 'table' => 'civicrm_acl_cache', - ], 'CRM_Contact_DAO_Group' => [ 'name' => 'Group', 'class' => 'CRM_Contact_DAO_Group', diff --git a/CRM/Upgrade/Incremental/php/FiveThirtyOne.php b/CRM/Upgrade/Incremental/php/FiveThirtyOne.php index 50c35a60e80c..0f4ba135ebcf 100644 --- a/CRM/Upgrade/Incremental/php/FiveThirtyOne.php +++ b/CRM/Upgrade/Incremental/php/FiveThirtyOne.php @@ -73,6 +73,7 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { public function upgrade_5_31_alpha1($rev) { $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev); $this->addTask('Remove Eway Single Currency Payment Processor type if not used or install the new extension for it', 'enableEwaySingleExtension'); + $this->addTask('dev/core#1486 Remove FKs from ACL Cache tables', 'removeFKsFromACLCacheTables'); } public static function enableEwaySingleExtension(CRM_Queue_TaskContext $ctx) { @@ -106,4 +107,11 @@ public static function enableEwaySingleExtension(CRM_Queue_TaskContext $ctx) { return TRUE; } + public static function removeFKsFromACLCacheTables(CRM_Queue_TaskContext $ctx) { + CRM_Core_BAO_SchemaHandler::safeRemoveFK('civicrm_acl_contact_cache', 'FK_civicrm_acl_contact_cache_contact_id'); + CRM_Core_BAO_SchemaHandler::safeRemoveFK('civicrm_acl_cache', 'FK_civicrm_acl_cache_contact_id'); + CRM_Core_BAO_SchemaHandler::createIndexes(['civicrm_acl_cache' => ['contact_id']]); + return TRUE; + } + } diff --git a/xml/schema/ACL/Cache.xml b/xml/schema/ACL/Cache.xml index 869eadb96189..8b54897737ae 100644 --- a/xml/schema/ACL/Cache.xml +++ b/xml/schema/ACL/Cache.xml @@ -33,8 +33,14 @@ <table>civicrm_contact</table> <key>id</key> <add>1.6</add> + <drop>5.31</drop> <onDelete>CASCADE</onDelete> </foreignKey> + <index> + <name>index_contact_id</name> + <fieldName>contact_id</fieldName> + <add>5.31</add> + </index> <field> <name>acl_id</name> <title>Cache ACL</title> diff --git a/xml/schema/Contact/ACLContactCache.xml b/xml/schema/Contact/ACLContactCache.xml index 450b56b693eb..75603bdf57a9 100644 --- a/xml/schema/Contact/ACLContactCache.xml +++ b/xml/schema/Contact/ACLContactCache.xml @@ -38,6 +38,7 @@ <table>civicrm_contact</table> <key>id</key> <add>3.1</add> + <drop>5.31</drop> <onDelete>CASCADE</onDelete> </foreignKey> <field>