From db37d72853ecebe85b08b49ce3c63013c7f12c56 Mon Sep 17 00:00:00 2001 From: colemanw Date: Sat, 24 Jun 2023 20:53:18 -0500 Subject: [PATCH] Switch to autoLinks for MailSettings page --- CRM/Admin/Page/MailSettings.php | 35 -------------------------------- CRM/Core/DAO/MailSettings.php | 15 ++++++++++++-- xml/schema/Core/MailSettings.xml | 6 ++++++ 3 files changed, 19 insertions(+), 37 deletions(-) diff --git a/CRM/Admin/Page/MailSettings.php b/CRM/Admin/Page/MailSettings.php index 28844d6078..8495f708e5 100644 --- a/CRM/Admin/Page/MailSettings.php +++ b/CRM/Admin/Page/MailSettings.php @@ -22,13 +22,6 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic { public $useLivePageJS = TRUE; - /** - * The action links that we need to display for the browse screen. - * - * @var array - */ - public static $_links = NULL; - /** * Get BAO Name. * @@ -39,34 +32,6 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic { return 'CRM_Core_BAO_MailSettings'; } - /** - * Get action Links. - * - * @return array - * (reference) of action links - */ - public function &links() { - if (!(self::$_links)) { - // helper variable for nicer formatting - self::$_links = [ - CRM_Core_Action::UPDATE => [ - 'name' => ts('Edit'), - 'url' => 'civicrm/admin/mailSettings', - 'qs' => 'action=update&id=%%id%%&reset=1', - 'title' => ts('Edit Mail Settings'), - ], - CRM_Core_Action::DELETE => [ - 'name' => ts('Delete'), - 'url' => 'civicrm/admin/mailSettings', - 'qs' => 'action=delete&id=%%id%%', - 'title' => ts('Delete Mail Settings'), - ], - ]; - } - - return self::$_links; - } - /** * Browse all mail settings. */ diff --git a/CRM/Core/DAO/MailSettings.php b/CRM/Core/DAO/MailSettings.php index b933a5d07d..943b3c9caf 100644 --- a/CRM/Core/DAO/MailSettings.php +++ b/CRM/Core/DAO/MailSettings.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/MailSettings.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7b41fb2c318a3f0200a697026fcede90) + * (GenCodeChecksum:f78519e347dec6f6fde41e14b7da4370) */ /** @@ -30,6 +30,17 @@ class CRM_Core_DAO_MailSettings extends CRM_Core_DAO { */ public static $_log = FALSE; + /** + * Paths for accessing this entity in the UI. + * + * @var string[] + */ + protected static $_paths = [ + 'add' => 'civicrm/admin/mailSettings/edit?action=add&reset=1', + 'update' => 'civicrm/admin/mailSettings/edit?action=update&id=[id]&reset=1', + 'delete' => 'civicrm/admin/mailSettings/edit?action=delete&id=[id]&reset=1', + ]; + /** * primary key * @@ -196,7 +207,7 @@ class CRM_Core_DAO_MailSettings extends CRM_Core_DAO { * Whether to return the plural version of the title. */ public static function getEntityTitle($plural = FALSE) { - return $plural ? ts('Mail Settingses') : ts('Mail Settings'); + return $plural ? ts('Mail Accounts') : ts('Mail Account'); } /** diff --git a/xml/schema/Core/MailSettings.xml b/xml/schema/Core/MailSettings.xml index 30b9da7dfb..009c2c6b57 100644 --- a/xml/schema/Core/MailSettings.xml +++ b/xml/schema/Core/MailSettings.xml @@ -4,6 +4,12 @@ civicrm_mail_settings Various email accounts for use by CiviMail (and its processor) 2.2 + Mail Account + + civicrm/admin/mailSettings/edit?action=add&reset=1 + civicrm/admin/mailSettings/edit?action=update&id=[id]&reset=1 + civicrm/admin/mailSettings/edit?action=delete&id=[id]&reset=1 + id Mail Settings ID -- 2.25.1