From: Coleman Watts Date: Fri, 26 Oct 2018 14:08:20 +0000 (-0400) Subject: Add icons to contact summary tabs X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b04115b439ce337bbc3e918f9b64f29120678a17;p=civicrm-core.git Add icons to contact summary tabs --- diff --git a/CRM/Campaign/Info.php b/CRM/Campaign/Info.php index 85f5761664..cd2d38d417 100644 --- a/CRM/Campaign/Info.php +++ b/CRM/Campaign/Info.php @@ -130,6 +130,14 @@ class CRM_Campaign_Info extends CRM_Core_Component_Info { return NULL; } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-star-o'; + } + /** * @inheritDoc * @return null diff --git a/CRM/Case/Info.php b/CRM/Case/Info.php index 259a530911..9ffe50d5ca 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -176,6 +176,14 @@ class CRM_Case_Info extends CRM_Core_Component_Info { ); } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-folder-open-o'; + } + /** * @inheritDoc * @return array diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index a881bbc5b6..f6df10137b 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -316,40 +316,47 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { 'url' => '#contact-summary', 'title' => ts('Summary'), 'weight' => 0, + 'icon' => 'crm-i fa-address-card-o' ], [ 'id' => 'activity', 'title' => ts('Activities'), 'class' => 'livePage', 'weight' => 70, + 'icon' => 'crm-i fa-tasks', ], [ 'id' => 'rel', 'title' => ts('Relationships'), 'class' => 'livePage', 'weight' => 80, + 'icon' => 'crm-i fa-handshake-o', ], [ 'id' => 'group', 'title' => ts('Groups'), 'class' => 'ajaxForm', 'weight' => 90, + 'icon' => 'crm-i fa-users', ], [ 'id' => 'note', 'title' => ts('Notes'), 'class' => 'livePage', 'weight' => 100, + 'icon' => 'crm-i fa-sticky-note-o', ], [ 'id' => 'tag', 'title' => ts('Tags'), 'weight' => 110, + 'icon' => 'crm-i fa-tags', ], [ 'id' => 'log', 'title' => ts('Change Log'), 'weight' => 120, + 'icon' => 'crm-i fa-history', ], ]; } @@ -391,6 +398,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { 'weight' => $elem['weight'], 'count' => CRM_Contact_BAO_Contact::getCountComponent($u, $this->_contactId), 'class' => 'livePage', + 'icon' => $component->getIcon(), ]; } } @@ -431,6 +439,7 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { 'count' => CRM_Contact_BAO_Contact::getCountComponent($id, $this->_contactId, $group['table_name']), 'hideCount' => !$group['is_multiple'], 'class' => 'livePage', + 'icon' => 'crm-i fa-gear', ]; $weight += 10; } diff --git a/CRM/Contribute/Info.php b/CRM/Contribute/Info.php index 41f03e46b4..4fa48a9c98 100644 --- a/CRM/Contribute/Info.php +++ b/CRM/Contribute/Info.php @@ -164,6 +164,14 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { ); } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-credit-card'; + } + /** * @inheritDoc * Provides information about advanced search pane diff --git a/CRM/Core/Component/Info.php b/CRM/Core/Component/Info.php index 00c228ef64..76a390c90b 100644 --- a/CRM/Core/Component/Info.php +++ b/CRM/Core/Component/Info.php @@ -198,6 +198,15 @@ abstract class CRM_Core_Component_Info { */ abstract public function registerTab(); + /** + * Get icon font class representing this component. + * + * @return string + */ + public function getIcon() { + return 'crm-i fa-puzzle-piece'; + } + /** * Provides information about advanced search pane * offered by this component. diff --git a/CRM/Event/Info.php b/CRM/Event/Info.php index afd957c157..5d578b94ee 100644 --- a/CRM/Event/Info.php +++ b/CRM/Event/Info.php @@ -143,6 +143,14 @@ class CRM_Event_Info extends CRM_Core_Component_Info { ); } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-calendar'; + } + /** * @inheritDoc * @return array diff --git a/CRM/Grant/Info.php b/CRM/Grant/Info.php index 1bf6045ff2..cfd14fd40f 100644 --- a/CRM/Grant/Info.php +++ b/CRM/Grant/Info.php @@ -121,6 +121,14 @@ class CRM_Grant_Info extends CRM_Core_Component_Info { ); } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-money'; + } + /** * @inheritDoc * @return array diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index 0a2d8cca86..f8a1fa6726 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -276,6 +276,14 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info { ); } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-envelope-o'; + } + /** * @inheritDoc * @return array diff --git a/CRM/Member/Info.php b/CRM/Member/Info.php index 504c51d0a6..4c5674a9ab 100644 --- a/CRM/Member/Info.php +++ b/CRM/Member/Info.php @@ -150,6 +150,14 @@ class CRM_Member_Info extends CRM_Core_Component_Info { ); } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-id-badge'; + } + /** * @inheritDoc * Provides information about advanced search pane diff --git a/CRM/Pledge/Info.php b/CRM/Pledge/Info.php index 475b85fe27..fbc603711d 100644 --- a/CRM/Pledge/Info.php +++ b/CRM/Pledge/Info.php @@ -136,6 +136,14 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { ); } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-paper-plane'; + } + /** * @inheritDoc * Provides information about advanced search pane diff --git a/CRM/Report/Info.php b/CRM/Report/Info.php index 8d8c429a5d..054090303b 100644 --- a/CRM/Report/Info.php +++ b/CRM/Report/Info.php @@ -164,6 +164,14 @@ class CRM_Report_Info extends CRM_Core_Component_Info { return NULL; } + /** + * @inheritDoc + * @return string + */ + public function getIcon() { + return 'crm-i fa-table'; + } + /** * @inheritDoc * Provides information about advanced search pane diff --git a/templates/CRM/Contact/Page/View/Summary.tpl b/templates/CRM/Contact/Page/View/Summary.tpl index 52fb8d38ff..e3ed5d3e42 100644 --- a/templates/CRM/Contact/Page/View/Summary.tpl +++ b/templates/CRM/Contact/Page/View/Summary.tpl @@ -126,6 +126,7 @@ {foreach from=$allTabs key=tabName item=tabValue}
  • + {$tabValue.title} {if empty($tabValue.hideCount)}{$tabValue.count}{/if}