From 31d08569e3c35b0b9fabd077fffa75647f678d4a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 17 May 2023 10:32:20 +1200 Subject: [PATCH] Add some weights --- CRM/ACL/Page/ACL.php | 3 +++ CRM/ACL/Page/EntityRole.php | 1 + CRM/Activity/Selector/Activity.php | 3 +++ CRM/Admin/Page/RelationshipType.php | 5 +++++ CRM/Case/Selector/Search.php | 3 +++ CRM/Contact/Page/View/Note.php | 6 ++++++ CRM/Contact/Page/View/Relationship.php | 5 +++++ CRM/Contact/Selector.php | 6 ++++++ CRM/Contribute/BAO/ContributionSoft.php | 1 + CRM/Contribute/Page/Tab.php | 1 + CRM/Custom/Page/Option.php | 4 ++++ CRM/Event/Selector/Search.php | 3 +++ CRM/Member/Selector/Search.php | 3 +++ ext/civigrant/CRM/Grant/Selector/Search.php | 3 +++ 14 files changed, 47 insertions(+) diff --git a/CRM/ACL/Page/ACL.php b/CRM/ACL/Page/ACL.php index 62ce735f4e..5e4e6e971a 100644 --- a/CRM/ACL/Page/ACL.php +++ b/CRM/ACL/Page/ACL.php @@ -54,17 +54,20 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic { '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, ], ]; } diff --git a/CRM/ACL/Page/EntityRole.php b/CRM/ACL/Page/EntityRole.php index f52ac442e4..bd1c374013 100644 --- a/CRM/ACL/Page/EntityRole.php +++ b/CRM/ACL/Page/EntityRole.php @@ -54,6 +54,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { 'name' => ts('Disable'), 'ref' => 'crm-enable-disable', 'title' => ts('Disable ACL Role Assignment'), + 'weight' => 40, ], CRM_Core_Action::ENABLE => [ 'name' => ts('Enable'), diff --git a/CRM/Activity/Selector/Activity.php b/CRM/Activity/Selector/Activity.php index fff4d57ed9..c78186f7c0 100644 --- a/CRM/Activity/Selector/Activity.php +++ b/CRM/Activity/Selector/Activity.php @@ -206,6 +206,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C 'url' => $url, 'qs' => $qsView, 'title' => ts('View Activity'), + 'weight' => -20, ], ]; } @@ -226,6 +227,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C 'url' => $updateUrl, 'qs' => $qsUpdate, 'title' => ts('Update Activity'), + 'weight' => -10, ], ]; } @@ -257,6 +259,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C 'url' => $delUrl, 'qs' => $qsDelete, 'title' => ts('Delete Activity'), + 'weight' => 100, ], ]; } diff --git a/CRM/Admin/Page/RelationshipType.php b/CRM/Admin/Page/RelationshipType.php index 312d2942e2..e1b7f6ae53 100644 --- a/CRM/Admin/Page/RelationshipType.php +++ b/CRM/Admin/Page/RelationshipType.php @@ -53,28 +53,33 @@ class CRM_Admin_Page_RelationshipType extends CRM_Core_Page_Basic { '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, ], ]; } diff --git a/CRM/Case/Selector/Search.php b/CRM/Case/Selector/Search.php index d2f958f194..696a8d05c0 100644 --- a/CRM/Case/Selector/Search.php +++ b/CRM/Case/Selector/Search.php @@ -624,6 +624,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { 'title' => ts('View'), 'accessKey' => '', 'ref' => 'View', + 'weight' => -20, ], CRM_Core_Action::UPDATE => [ 'name' => ts('Edit'), @@ -633,6 +634,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { 'icon' => 'fa-pencil', 'accessKey' => '', 'ref' => 'Edit', + 'weight' => -10, ], CRM_Core_Action::DELETE => [ 'name' => ts('Delete'), @@ -642,6 +644,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { 'icon' => 'fa-trash', 'accessKey' => '', 'ref' => 'Delete', + 'weight' => 100, ], CRM_Core_Action::RENEW => [ 'name' => ts('Restore'), diff --git a/CRM/Contact/Page/View/Note.php b/CRM/Contact/Page/View/Note.php index 0caffd6f31..ae4a351488 100644 --- a/CRM/Contact/Page/View/Note.php +++ b/CRM/Contact/Page/View/Note.php @@ -236,12 +236,14 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { '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'), @@ -254,6 +256,7 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { 'url' => 'civicrm/contact/view/note', 'qs' => 'action=delete&reset=1&cid=%%cid%%&id=%%id%%&selectedChild=note', 'title' => ts('Delete Note'), + 'weight' => 100, ], ]; } @@ -270,18 +273,21 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { '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, ], ]; } diff --git a/CRM/Contact/Page/View/Relationship.php b/CRM/Contact/Page/View/Relationship.php index 1740059051..f0d6e4d804 100644 --- a/CRM/Contact/Page/View/Relationship.php +++ b/CRM/Contact/Page/View/Relationship.php @@ -258,28 +258,33 @@ class CRM_Contact_Page_View_Relationship extends CRM_Core_Page { '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. diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index fa8d2da1f6..888554112b 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -262,6 +262,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se 'qs' => "reset=1&cid=%%id%%{$searchContext}{$extraParams}", 'title' => ts('View Contact Details'), 'ref' => 'view-contact', + 'weight' => -20, ], CRM_Core_Action::UPDATE => [ 'name' => ts('Edit'), @@ -270,6 +271,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se 'qs' => "reset=1&action=update&cid=%%id%%{$searchContext}{$extraParams}", 'title' => ts('Edit Contact Details'), 'ref' => 'edit-contact', + 'weight' => -10, ], ]; @@ -777,6 +779,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se 'qs' => 'reset=1&cid=%%id%%', 'class' => 'no-popup', 'title' => ts('View Contact Details'), + 'weight' => -20, ], [ 'name' => ts('Restore'), @@ -791,6 +794,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se '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( @@ -952,6 +956,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se 'qs' => 'reset=1&cid=%%id%%', 'class' => 'no-popup', 'title' => ts('View Contact Details'), + 'weight' => -20, ], [ 'name' => ts('Restore'), @@ -966,6 +971,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se '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( diff --git a/CRM/Contribute/BAO/ContributionSoft.php b/CRM/Contribute/BAO/ContributionSoft.php index 8c7160f944..5843115465 100644 --- a/CRM/Contribute/BAO/ContributionSoft.php +++ b/CRM/Contribute/BAO/ContributionSoft.php @@ -405,6 +405,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio '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, ], ]; diff --git a/CRM/Contribute/Page/Tab.php b/CRM/Contribute/Page/Tab.php index b898677d78..06c1221d49 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -55,6 +55,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { 'title' => ts('View Recurring Payment'), 'url' => 'civicrm/contact/view/contributionrecur', 'qs' => "reset=1&id=%%crid%%&cid=%%cid%%&context={$context}", + 'weight' => -20, ], ]; diff --git a/CRM/Custom/Page/Option.php b/CRM/Custom/Page/Option.php index 855ed99b9e..030061f59e 100644 --- a/CRM/Custom/Page/Option.php +++ b/CRM/Custom/Page/Option.php @@ -68,22 +68,26 @@ class CRM_Custom_Page_Option extends CRM_Core_Page { '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, ], ]; } diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php index 156caf5e73..b7f6967f6b 100644 --- a/CRM/Event/Selector/Search.php +++ b/CRM/Event/Selector/Search.php @@ -215,18 +215,21 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co '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, ], ]; } diff --git a/CRM/Member/Selector/Search.php b/CRM/Member/Selector/Search.php index 91f1f5e4db..cfdd03aabe 100644 --- a/CRM/Member/Selector/Search.php +++ b/CRM/Member/Selector/Search.php @@ -195,6 +195,7 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C '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, ], ]; } @@ -205,12 +206,14 @@ class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_C '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'), diff --git a/ext/civigrant/CRM/Grant/Selector/Search.php b/ext/civigrant/CRM/Grant/Selector/Search.php index 565d6ce8bf..b3187e1096 100644 --- a/ext/civigrant/CRM/Grant/Selector/Search.php +++ b/ext/civigrant/CRM/Grant/Selector/Search.php @@ -174,12 +174,14 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co '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, ], ]; @@ -190,6 +192,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co '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; -- 2.25.1