Update phone numbers to use the phone filter from main plugin.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 22 Feb 2017 16:37:05 +0000 (11:37 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 22 Feb 2017 16:37:05 +0000 (11:37 -0500)
This will format the phone numbers to be the same across our plugins.
Applies a filter to format the number from a management setting.
Dot, Dash or US

index.php
models/front/events/list.php
views/front/events/detail.html

index a63a1d8..80926c4 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Database Events
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Gaslight Media Members Database.
- * Version: 1.6.9
+ * Version: 1.6.10
  * Author: Chuck Scott
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -20,7 +20,7 @@
  * @package glmMembersDatabaseEventsAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.6.9
+ * @version 1.6.10
  */
 
 /*
@@ -38,7 +38,7 @@
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.9');
+define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.6.10');
 define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.1.1');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index 27284eb..16da235 100644 (file)
@@ -485,7 +485,7 @@ class GlmMembersFront_events_list extends GlmMembersFront_events_baseAction
                     // check for phone, url or email to output
                     $contactInfo = array();
                     if ( $event['contact_phone'] ) {
-                        $contactInfo[] = $event['contact_phone'];
+                        $contactInfo[] = apply_filters( 'glm_associate_phone_filter', $event['contact_phone'] );
                     }
                     if ( $event['contact_email'] ) {
                         $contactInfo[] = $event['contact_email'];
index 26f679f..05dfcb7 100644 (file)
@@ -75,7 +75,7 @@
                                     {if $event.locations.address} {$event.locations.address}<br> {/if}
                                     {if $event.locations.city.name}{$event.locations.city.name}{/if}{if $event.locations.state.value}, {$event.locations.state.value} {/if}
                                     {if $event.locations.zip} {$event.locations.zip} {/if}
-                                    {if $event.locations.phone} {$event.locations.phone} {/if}
+                                    {if $event.locations.phone} {apply_filters('glm_associate_phone_filter', $event.locations.phone)} {/if}
                                     </div>
                                 {elseif $event.use_member_location.value || $event.other_ref_dest}
                                     <div id="glm-event-detail-location">
@@ -83,7 +83,7 @@
                                     {if $event.member.addr1} {$event.member.addr1}<br> {/if}
                                     {if $event.member.city}{$event.member.city}{/if}{if $event.member.state.value}, {$event.member.state.value}{/if}
                                     {if $event.member.zip} {$event.member.zip} {/if}
-                                    {if $event.member.phone} {$event.member.phone} {/if}
+                                    {if $event.member.phone} {apply_filters('glm_associate_phone_filter', $event.member.phone)} {/if}
                                     </div>
                                 {/if}
                             {/if}
                                 {if $event.url}<a href="{$event.url}" target="_blank">{$event.url}</a><br>{/if}
                                 {if $event.contact_name}Contact: {$event.contact_name}<br>{/if}
                                 {if $event.contact_email}Email: <a href="mailto: {$event.contact_email}">{$event.contact_email}</a><br>{/if}
-                                {if $event.contact_phone}<span class="glm-event-detail-contact-phone"><span class="glm-field-title">Phone: </span><span class="glm-field-value">{$event.contact_phone}</span></span><br>{/if}
+                                {if $event.contact_phone}
+                                    <span class="glm-event-detail-contact-phone">
+                                        <span class="glm-field-title">Phone: </span>
+                                        <span class="glm-field-value">{apply_filters('glm_associate_phone_filter', $event.contact_phone)}</span>
+                                    </span><br>
+                                {/if}
                                 {if $event.file1}
                                 <div>File:
                                     <a href="{$filePathUrl}{$event.file1}">{if $event.file1_descr}{$event.file1_descr}{else}{$event.file1}{/if}</a>
 
         // Replace the phone separation character with whatever is set in the management
         {if $settings.phone_infix}
-            var processedPhone = $('.glm-event-detail-contact-phone .glm-field-value').text().trim().replace(/[^a-zA-Z0-9 ]/g, '{$settings.phone_infix}');
-            $('.glm-event-detail-contact-phone .glm-field-value').text(processedPhone);
+            //var processedPhone = $('.glm-event-detail-contact-phone .glm-field-value').text().trim().replace(/[^a-zA-Z0-9 ]/g, '{$settings.phone_infix}');
+            //$('.glm-event-detail-contact-phone .glm-field-value').text(processedPhone);
         {/if}
     });
 </script>