Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some weights to menu link items #26241

Merged
merged 3 commits into from May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CRM/ACL/Page/ACL.php
Expand Up @@ -54,17 +54,20 @@ public function &links() {
'name' => ts('Disable'),
'ref' => 'crm-enable-disable',
'title' => ts('Disable ACL'),
'weight' => 40,
],
CRM_Core_Action::ENABLE => [
'name' => ts('Enable'),
'ref' => 'crm-enable-disable',
'title' => ts('Enable ACL'),
'weight' => 30,
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => 'civicrm/acl',
'qs' => 'reset=1&action=delete&id=%%id%%',
'title' => ts('Delete ACL'),
'weight' => 100,
],
];
}
Expand Down
1 change: 1 addition & 0 deletions CRM/ACL/Page/EntityRole.php
Expand Up @@ -54,6 +54,7 @@ public function &links() {
'name' => ts('Disable'),
'ref' => 'crm-enable-disable',
'title' => ts('Disable ACL Role Assignment'),
'weight' => 40,
],
CRM_Core_Action::ENABLE => [
'name' => ts('Enable'),
Expand Down
3 changes: 3 additions & 0 deletions CRM/Activity/Selector/Activity.php
Expand Up @@ -206,6 +206,7 @@ public static function actionLinks(
'url' => $url,
'qs' => $qsView,
'title' => ts('View Activity'),
'weight' => -20,
],
];
}
Expand All @@ -226,6 +227,7 @@ public static function actionLinks(
'url' => $updateUrl,
'qs' => $qsUpdate,
'title' => ts('Update Activity'),
'weight' => -10,
],
];
}
Expand Down Expand Up @@ -257,6 +259,7 @@ public static function actionLinks(
'url' => $delUrl,
'qs' => $qsDelete,
'title' => ts('Delete Activity'),
'weight' => 100,
],
];
}
Expand Down
5 changes: 5 additions & 0 deletions CRM/Admin/Page/RelationshipType.php
Expand Up @@ -53,28 +53,33 @@ public function &links() {
'url' => 'civicrm/admin/reltype/edit',
'qs' => 'action=view&id=%%id%%&reset=1',
'title' => ts('View Relationship Type'),
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
'url' => 'civicrm/admin/reltype/edit',
'qs' => 'action=update&id=%%id%%&reset=1',
'title' => ts('Edit Relationship Type'),
'weight' => -10,
],
CRM_Core_Action::DISABLE => [
'name' => ts('Disable'),
'ref' => 'crm-enable-disable',
'title' => ts('Disable Relationship Type'),
'weight' => 40,
],
CRM_Core_Action::ENABLE => [
'name' => ts('Enable'),
'ref' => 'crm-enable-disable',
'title' => ts('Enable Relationship Type'),
'weight' => 30,
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => 'civicrm/admin/reltype/edit',
'qs' => 'action=delete&id=%%id%%',
'title' => ts('Delete Reletionship Type'),
'weight' => 100,
],
];
}
Expand Down
3 changes: 3 additions & 0 deletions CRM/Case/Selector/Search.php
Expand Up @@ -624,6 +624,7 @@ public static function actionLinks() {
'title' => ts('View'),
'accessKey' => '',
'ref' => 'View',
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
Expand All @@ -633,6 +634,7 @@ public static function actionLinks() {
'icon' => 'fa-pencil',
'accessKey' => '',
'ref' => 'Edit',
'weight' => -10,
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
Expand All @@ -642,6 +644,7 @@ public static function actionLinks() {
'icon' => 'fa-trash',
'accessKey' => '',
'ref' => 'Delete',
'weight' => 100,
],
CRM_Core_Action::RENEW => [
'name' => ts('Restore'),
Expand Down
6 changes: 6 additions & 0 deletions CRM/Contact/Page/View/Note.php
Expand Up @@ -236,12 +236,14 @@ public static function links() {
'url' => 'civicrm/contact/view/note',
'qs' => 'action=view&reset=1&cid=%%cid%%&id=%%id%%&selectedChild=note',
'title' => ts('View Note'),
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
'url' => 'civicrm/contact/view/note',
'qs' => 'action=update&reset=1&cid=%%cid%%&id=%%id%%&selectedChild=note',
'title' => ts('Edit Note'),
'weight' => -10,
],
CRM_Core_Action::ADD => [
'name' => ts('Comment'),
Expand All @@ -254,6 +256,7 @@ public static function links() {
'url' => 'civicrm/contact/view/note',
'qs' => 'action=delete&reset=1&cid=%%cid%%&id=%%id%%&selectedChild=note',
'title' => ts('Delete Note'),
'weight' => 100,
],
];
}
Expand All @@ -270,18 +273,21 @@ public static function commentLinks() {
'url' => 'civicrm/contact/view/note',
'qs' => 'action=view&reset=1&cid=%%cid%%&id={id}&selectedChild=note',
'title' => ts('View Comment'),
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
'url' => 'civicrm/contact/view/note',
'qs' => 'action=update&reset=1&cid=%%cid%%&id={id}&parentId=%%pid%%&selectedChild=note',
'title' => ts('Edit Comment'),
'weight' => -10,
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => 'civicrm/contact/view/note',
'qs' => 'action=delete&reset=1&cid=%%cid%%&id={id}&selectedChild=note',
'title' => ts('Delete Comment'),
'weight' => 100,
],
];
}
Expand Down
5 changes: 5 additions & 0 deletions CRM/Contact/Page/View/Relationship.php
Expand Up @@ -258,28 +258,33 @@ public static function &links() {
'url' => 'civicrm/contact/view/rel',
'qs' => 'action=view&reset=1&cid=%%cid%%&id=%%id%%&rtype=%%rtype%%&selectedChild=rel',
'title' => ts('View Relationship'),
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
'url' => 'civicrm/contact/view/rel',
'qs' => 'action=update&reset=1&cid=%%cid%%&id=%%id%%&rtype=%%rtype%%',
'title' => ts('Edit Relationship'),
'weight' => -10,
],
CRM_Core_Action::ENABLE => [
'name' => ts('Enable'),
'ref' => 'crm-enable-disable',
'title' => ts('Enable Relationship'),
'weight' => 30,
],
CRM_Core_Action::DISABLE => [
'name' => ts('Disable'),
'ref' => 'crm-enable-disable',
'title' => ts('Disable Relationship'),
'weight' => 40,
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => 'civicrm/contact/view/rel',
'qs' => 'action=delete&reset=1&cid=%%cid%%&id=%%id%%&rtype=%%rtype%%',
'title' => ts('Delete Relationship'),
'weight' => 100,
],
// FIXME: Not sure what to put as the key.
// We want to use it differently later anyway (see CRM_Contact_BAO_Relationship::getRelationship). NONE should make it hidden by default.
Expand Down
6 changes: 6 additions & 0 deletions CRM/Contact/Selector.php
Expand Up @@ -262,6 +262,7 @@ public static function &links() {
'qs' => "reset=1&cid=%%id%%{$searchContext}{$extraParams}",
'title' => ts('View Contact Details'),
'ref' => 'view-contact',
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
Expand All @@ -270,6 +271,7 @@ public static function &links() {
'qs' => "reset=1&action=update&cid=%%id%%{$searchContext}{$extraParams}",
'title' => ts('Edit Contact Details'),
'ref' => 'edit-contact',
'weight' => -10,
],
];

Expand Down Expand Up @@ -777,6 +779,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
'qs' => 'reset=1&cid=%%id%%',
'class' => 'no-popup',
'title' => ts('View Contact Details'),
'weight' => -20,
],
[
'name' => ts('Restore'),
Expand All @@ -791,6 +794,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
'url' => 'civicrm/contact/view/delete',
'qs' => 'reset=1&cid=%%id%%&skip_undelete=1',
'title' => ts('Permanently Delete Contact'),
'weight' => 100,
];
}
$row['action'] = CRM_Core_Action::formLink(
Expand Down Expand Up @@ -952,6 +956,7 @@ public function addActions(&$rows) {
'qs' => 'reset=1&cid=%%id%%',
'class' => 'no-popup',
'title' => ts('View Contact Details'),
'weight' => -20,
],
[
'name' => ts('Restore'),
Expand All @@ -966,6 +971,7 @@ public function addActions(&$rows) {
'url' => 'civicrm/contact/view/delete',
'qs' => 'reset=1&cid=%%id%%&skip_undelete=1',
'title' => ts('Permanently Delete Contact'),
'weight' => 100,
];
}
$row['action'] = CRM_Core_Action::formLink(
Expand Down
1 change: 1 addition & 0 deletions CRM/Contribute/BAO/ContributionSoft.php
Expand Up @@ -405,6 +405,7 @@ public static function getSoftContributionList($contact_id, ?int $membershipID =
'url' => 'civicrm/contact/view/contribution',
'qs' => 'reset=1&id=%%contributionid%%&cid=%%contactId%%&action=view&context=contribution&selectedChild=contribute',
'title' => ts('View related contribution'),
'weight' => -20,
],
];

Expand Down
4 changes: 4 additions & 0 deletions CRM/Contribute/Page/Tab.php
Expand Up @@ -55,6 +55,7 @@ public static function recurLinks(int $recurID, $context = 'contribution') {
'title' => ts('View Recurring Payment'),
'url' => 'civicrm/contact/view/contributionrecur',
'qs' => "reset=1&id=%%crid%%&cid=%%cid%%&context={$context}",
'weight' => -20,
],
];

Expand Down Expand Up @@ -138,6 +139,7 @@ public static function selfServiceRecurLinks(int $recurID): array {
'title' => ts('Cancel'),
// Only display on-site links in a popup.
'class' => (stripos($url, 'http') !== FALSE) ? 'no-popup' : '',
'weight' => -50,
];
}

Expand All @@ -151,6 +153,7 @@ public static function selfServiceRecurLinks(int $recurID): array {
'url' => $url,
// Only display on-site links in a popup.
'class' => (stripos($url, 'http') !== FALSE) ? 'no-popup' : '',
'weight' => -15,
];
}

Expand All @@ -165,6 +168,7 @@ public static function selfServiceRecurLinks(int $recurID): array {
'url' => $url,
// Only display on-site links in a popup.
'class' => (stripos($url, 'http') !== FALSE) ? 'no-popup' : '',
'weight' => -10,
];
}
return $links;
Expand Down
4 changes: 4 additions & 0 deletions CRM/Custom/Page/Option.php
Expand Up @@ -68,22 +68,26 @@ public static function &actionLinks() {
'url' => 'civicrm/admin/custom/group/field/option',
'qs' => 'action=view&id=%%id%%&fid=%%fid%%',
'title' => ts('View Multiple Choice Option'),
'weight' => -20,
],
CRM_Core_Action::DISABLE => [
'name' => ts('Disable'),
'ref' => 'crm-enable-disable',
'title' => ts('Disable Multiple Choice Option'),
'weight' => 40,
],
CRM_Core_Action::ENABLE => [
'name' => ts('Enable'),
'ref' => 'crm-enable-disable',
'title' => ts('Enable Multiple Choice Option'),
'weight' => 30,
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => 'civicrm/admin/custom/group/field/option',
'qs' => 'action=delete&id=%%id%%&fid=%%fid%%',
'title' => ts('Delete Multiple Choice Option'),
'weight' => 100,
],
];
}
Expand Down
3 changes: 3 additions & 0 deletions CRM/Event/Selector/Search.php
Expand Up @@ -215,18 +215,21 @@ public static function &links($qfKey = NULL, $context = NULL, $compContext = NUL
'url' => 'civicrm/contact/view/participant',
'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=view&context=%%cxt%%&selectedChild=event' . $extraParams,
'title' => ts('View Participation'),
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
'url' => 'civicrm/contact/view/participant',
'qs' => 'reset=1&action=update&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams,
'title' => ts('Edit Participation'),
'weight' => -10,
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => 'civicrm/contact/view/participant',
'qs' => 'reset=1&action=delete&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams,
'title' => ts('Delete Participation'),
'weight' => 100,
],
];
}
Expand Down
4 changes: 4 additions & 0 deletions CRM/Member/Selector/Search.php
Expand Up @@ -195,6 +195,7 @@ public static function &links(
'url' => 'civicrm/contact/view/membership',
'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=view&context=%%cxt%%&selectedChild=member' . $extraParams,
'title' => ts('View Membership'),
'weight' => -20,
],
];
}
Expand All @@ -205,12 +206,14 @@ public static function &links(
'url' => 'civicrm/contact/view/membership',
'qs' => 'reset=1&action=update&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams,
'title' => ts('Edit Membership'),
'weight' => -10,
],
CRM_Core_Action::DELETE => [
'name' => ts('Delete'),
'url' => 'civicrm/contact/view/membership',
'qs' => 'reset=1&action=delete&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams,
'title' => ts('Delete Membership'),
'weight' => 100,
],
CRM_Core_Action::RENEW => [
'name' => ts('Renew'),
Expand Down Expand Up @@ -240,6 +243,7 @@ public static function &links(
'url' => 'civicrm/contribute/unsubscribe',
'qs' => 'reset=1&mid=%%id%%&context=%%cxt%%' . $extraParams,
'title' => ts('Cancel Auto Renew Subscription'),
'weight' => 40,
];
}
elseif (isset(self::$_links['all'][CRM_Core_Action::DISABLE])) {
Expand Down
3 changes: 3 additions & 0 deletions ext/civigrant/CRM/Grant/Selector/Search.php
Expand Up @@ -174,12 +174,14 @@ public static function &links($key = NULL) {
'url' => 'civicrm/contact/view/grant',
'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=view&context=%%cxt%%&selectedChild=grant' . $extraParams,
'title' => ts('View Grant'),
'weight' => -20,
],
CRM_Core_Action::UPDATE => [
'name' => ts('Edit'),
'url' => 'civicrm/contact/view/grant',
'qs' => 'reset=1&action=update&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams,
'title' => ts('Edit Grant'),
'weight' => -10,
],
];

Expand All @@ -190,6 +192,7 @@ public static function &links($key = NULL) {
'url' => 'civicrm/contact/view/grant',
'qs' => 'action=delete&reset=1&cid=%%cid%%&id=%%id%%&selectedChild=grant' . $extraParams,
'title' => ts('Delete Grant'),
'weight' => 100,
],
];
self::$_links = self::$_links + $delLink;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php
Expand Up @@ -34,7 +34,7 @@ public function setUp(): void {
'receipt_from_name' => 'Pachamama',
'is_email_receipt' => TRUE,
]);
$this->_contributionPageID = $contributionPage['id'];
$this->_contributionPageID = $this->ids['ContributionPage'][0] = $contributionPage['id'];
}

public function tearDown(): void {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php
Expand Up @@ -119,7 +119,7 @@ public function testInvoiceSentOnIPNPaymentSuccess(): void {
* @throws \Civi\API\Exception\UnauthorizedException
*/
public function testIPNPaymentRecurSuccess(): void {
$this->setupRecurringPaymentProcessorTransaction([], ['total_amount' => '15.00', 'contribution_page_id' => $this->_contributionPageID]);
$this->setupRecurringPaymentProcessorTransaction([], ['total_amount' => '15.00', 'contribution_page_id' => $this->ids['ContributionPage'][0] ?? NULL]);
$mut = new CiviMailUtils($this, TRUE);
$paypalIPN = new CRM_Core_Payment_PayPalIPN($this->getPaypalRecurTransaction());
$paypalIPN->main();
Expand Down