CRM-16415 - Convert action menu icons
authorColeman Watts <coleman@civicrm.org>
Thu, 15 Oct 2015 19:50:30 +0000 (15:50 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 16 Oct 2015 02:44:10 +0000 (22:44 -0400)
CRM/Case/Form/CaseView.php
CRM/Contact/Form/GroupContact.php
CRM/Core/Form/Search.php
CRM/Report/Form.php
ang/crmCaseType.js
ang/crmMailing/BlockPreview.html
ang/crmMailing/Token.js
css/civicrm.css
js/Common.js
templates/CRM/Activity/Form/ActivityLinks.tpl
templates/CRM/Mailing/Form/InsertTokens.tpl

index dc8d0fac6f640305c9b1e55864930d6360e889cc..76bbe9a53bc3609ecc71bdc496c9df740ea009f7 100644 (file)
@@ -269,17 +269,17 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
       $activityLinks[$url] = $label;
     }
 
-    $this->add('select', 'add_activity_type_id', '', $activityLinks, FALSE, array('class' => 'crm-select2 crm-action-menu action-icon-plus twenty'));
+    $this->add('select', 'add_activity_type_id', '', $activityLinks, FALSE, array('class' => 'crm-select2 crm-action-menu fa-calendar-check-o twenty'));
     if ($this->_hasAccessToAllCases) {
       $this->add('select', 'report_id', '',
         array('' => ts('Activity Audit')) + $reports,
         FALSE,
-        array('class' => 'crm-select2 crm-action-menu action-icon-clipboard')
+        array('class' => 'crm-select2 crm-action-menu fa-list-alt')
       );
       $this->add('select', 'timeline_id', '',
         array('' => ts('Add Timeline')) + $reports,
         FALSE,
-        array('class' => 'crm-select2 crm-action-menu action-icon-play')
+        array('class' => 'crm-select2 crm-action-menu fa-list-ol')
       );
     }
     $this->addElement('submit', $this->getButtonName('next'), ' ', array('class' => 'hiddenElement'));
index 64e83e772cb56b6163f4da5ad091a4fd5833f0e3..c8832320425563102576a6dd769eddd5df3d6208 100644 (file)
@@ -113,7 +113,7 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
         $msg = ts('Add to a group');
       }
 
-      $this->addField('group_id', array('class' => 'crm-action-menu action-icon-plus', 'placeholder' => $msg, 'options' => $groupSelect));
+      $this->addField('group_id', array('class' => 'crm-action-menu fa-plus', 'placeholder' => $msg, 'options' => $groupSelect));
 
       $this->addButtons(array(
           array(
index 6d83b1c7316856c9d00e5d148cb2d9ea7710edc1..78b28418cbfa63f172d448be7296fcf0e1e98dbf 100644 (file)
@@ -146,7 +146,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form {
   public function addTaskMenu($tasks) {
     if (is_array($tasks) && !empty($tasks)) {
       $tasks = array('' => ts('Actions')) + $tasks;
-      $this->add('select', 'task', NULL, $tasks, FALSE, array('class' => 'crm-select2 crm-action-menu huge crm-search-result-actions'));
+      $this->add('select', 'task', NULL, $tasks, FALSE, array('class' => 'crm-select2 crm-action-menu fa-check-circle-o huge crm-search-result-actions'));
       $this->add('submit', $this->_actionButtonName, ts('Go'), array('class' => 'hiddenElement crm-search-go-button'));
 
       // Radio to choose "All items" or "Selected items only"
index 5d5899a934494bde9462c09e0d34ab715cf8d68a..71d350778d7ac229fdf62763e81fa2af92cec1e3 100644 (file)
@@ -1417,7 +1417,7 @@ class CRM_Report_Form extends CRM_Core_Form {
       $this->addElement('select', 'groups', ts('Group'),
         array('' => ts('Add Contacts to Group')) +
         CRM_Core_PseudoConstant::nestedGroup(),
-        array('class' => 'crm-select2 crm-action-menu action-icon-plus huge')
+        array('class' => 'crm-select2 crm-action-menu fa-plus huge')
       );
       $this->assign('group', TRUE);
     }
index 3e23ac1d3f075bc4f5df110b1a076751a74cec67..e5aae2a3516ab068056a6c2f620bcf4fca969282 100644 (file)
@@ -82,7 +82,7 @@
   crmCaseType.directive('crmAddName', function() {
     return {
       restrict: 'AE',
-      template: '<input class="add-activity crm-action-menu action-icon-plus" type="hidden" />',
+      template: '<input class="add-activity crm-action-menu fa-plus" type="hidden" />',
       link: function(scope, element, attrs) {
         /// Format list of options for select2's "data"
         var getFormattedOptions = function() {
index 71d7ff0baaa0bc67214268867099fe61195a601d..c7d86f94ccc252f9a63a904d05532cbb95d6d053 100644 (file)
@@ -46,11 +46,11 @@ Vars: mailing:obj, testContact:obj, testGroup:obj, crmMailing:FormController
     <div>
       <select
         name="preview_test_group"
-        ui-jq="select2"
+        ui-jq="crmSelect2"
         ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Select Group')}"
         ng-model="testGroup.gid"
         ng-options="group.id as group.title for group in crmMailingConst.groupNames|orderBy:'title'"
-        class="crm-action-menu action-icon-mail-closed"
+        class="crm-action-menu fa-envelope-o"
         >
         <option value=""></option>
       </select>
index f5d94a5967ee527a3ff54f861292ae4e84927694..71131d21b7583a299f9923c3f6cfdb41a8936dfd 100644 (file)
@@ -9,7 +9,7 @@
       },
       template: '<input type="text" class="crmMailingToken" />',
       link: function(scope, element, attrs, crmUiIdCtrl) {
-        $(element).addClass('crm-action-menu action-icon-token').select2({
+        $(element).addClass('crm-action-menu fa-code').crmSelect2({
           width: "12em",
           dropdownAutoWidth: true,
           data: CRM.crmMailing.mailTokens,
index 3c89beb28b88adea975aafba78394840eeba9f65..cd7742647c7a618391649b0b18f5bc5f33442dce 100644 (file)
@@ -3264,31 +3264,6 @@ div.m ul#civicrm-menu,
 .crm-container .crm-action-menu .select2-default span.select2-chosen {
   color: #2786C2;
 }
-.crm-container .crm-action-menu .select2-default span.select2-chosen:before {
-  background: url("../i/icons/jquery-ui-2786C2.png") no-repeat scroll -64px -112px;
-  content: "";
-  display: inline-block;
-  height: 16px;
-  width: 16px;
-  margin-right: 3px;
-  position: relative;
-  top: 3px;
-}
-.crm-container .crm-action-menu.action-icon-plus .select2-default span.select2-chosen:before {
-  background-position: 0 -192px;
-}
-.crm-container .crm-action-menu.action-icon-play .select2-default span.select2-chosen:before {
-  background-position: -48px -192px;
-}
-.crm-container .crm-action-menu.action-icon-clipboard .select2-default span.select2-chosen:before {
-  background-position: -160px -128px;
-}
-.crm-container .crm-action-menu.action-icon-token .select2-default span.select2-chosen:before {
-  background-position: -144px 0;
-}
-.crm-container .crm-action-menu.action-icon-mail-closed .select2-default span.select2-chosen:before {
-  background-position: -80px -96px;
-}
 /* Restore this property otherwise our css overrides it */
 .select2-search input {
   box-sizing: border-box;
index 41634344ea509784f6d03cb96456583d4f5ff8e1..107981b9fe4ac4153bcc5e960eb7ab5a2e73cb60 100644 (file)
@@ -373,6 +373,7 @@ if (!CRM.vars) CRM.vars = {};
     return $(this).each(function () {
       var
         $el = $(this),
+        iconClass,
         settings = {allowClear: !$el.hasClass('required')};
       // quickform doesn't support optgroups so here's a hack :(
       $('option[value^=crm_optgroup]', this).each(function () {
@@ -384,6 +385,12 @@ if (!CRM.vars) CRM.vars = {};
       // add disabled property for option values
       $('option[value^=crm_disabled_opt]', this).attr('disabled', 'disabled');
 
+      // Placeholder icon
+      if ($el.is('[class*=fa-]')) {
+        iconClass = $el.attr('class').match(/(fa-\S*)/)[1];
+        $el.removeClass(iconClass);
+      }
+
       // Defaults for single-selects
       if ($el.is('select:not([multiple])')) {
         settings.minimumResultsForSearch = 10;
@@ -396,6 +403,11 @@ if (!CRM.vars) CRM.vars = {};
         $el.addClass('crm-ajax-select');
       }
       $el.select2(settings);
+      if (iconClass) {
+        window.setTimeout(function() {
+          $el.select2('container').find('span.select2-chosen').prepend('<i class="crm-i ' + iconClass + '"></i>&nbsp;');
+        }, 10);
+      }
     });
   };
 
index 1e6cb720d2203006e042ba2398a959d8f05cd6f7..140a84869e3961a4dd808451a658bce5a875d339 100644 (file)
@@ -30,7 +30,7 @@
 {/if}
 
 {if $as_select} {* on 3.2, the activities can be either a drop down select (on the activity tab) or a list (on the action menu) *}
-<select name="other_activity" class="crm-form-select crm-select2 crm-action-menu action-icon-plus">
+<select name="other_activity" class="crm-form-select crm-select2 crm-action-menu fa-plus">
   <option value="">{ts}New Activity{/ts}</option>
 {foreach from=$activityTypes key=k item=link}
   <option value="{$urls.$k}">{$link}</option>
index 6a3f14324206916e9a2d899ecdcea2341bbf111a..7ce110ea68f1295c9eb47fae382cf1090bc546b9 100644 (file)
@@ -244,7 +244,7 @@ CRM.$(function($) {
   // Initialize token selector widgets
   var form = $('form.{/literal}{$form.formClass}{literal}');
   $('input.crm-token-selector', form)
-    .addClass('crm-action-menu action-icon-token')
+    .addClass('crm-action-menu fa-code')
     .change(insertToken)
     .crmSelect2({
       data: form.data('tokens'),