Changeset 2426157
- Timestamp:
- 11/26/2020 01:41:27 AM (5 years ago)
- Location:
- follow-hook/trunk
- Files:
-
- 4 added
- 5 edited
-
a.log (added)
-
b.log (added)
-
cultivate.log (added)
-
eml.log (added)
-
execute_touchpoints.php (modified) (2 diffs)
-
follow-hook.php (modified) (5 diffs)
-
js/auto_fill_people_title.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
time.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
follow-hook/trunk/execute_touchpoints.php
r2167803 r2426157 211 211 //get the person's home and work phone numbers: 212 212 $person_home_no = get_post_meta($person_id, '_pph', true); 213 $person_work_no = get_post_meta($person_id, '_wph', true);213 //$person_work_no = get_post_meta($person_id, '_wph', true); 214 214 $touchpoint_id = $r->touchpoint_id;//touchpoint id 215 215 $TPtype = get_post_meta($touchpoint_id, '_interaction_type', true); … … 347 347 $subj = "A touchpoint phone call reminder"; 348 348 $name = $user_info->user_nicename; 349 $msg = "Dear $name\nThis is a reminder from the Follow Hook automated system. Please note that you are supposed to make a phone call to the following person to satisfy one of your touchpoints in the Follow Hook system:\n\nName: $person_to_call\nHome Phone: $person_home_no \nWork Phone: $person_work_no";349 $msg = "Dear $name\nThis is a reminder from the Follow Hook automated system. Please note that you are supposed to make a phone call to the following person to satisfy one of your touchpoints in the Follow Hook system:\n\nName: $person_to_call\nHome Phone: $person_home_no"; 350 350 Follow_Hook_log_debug("Sending email to $to User no. $assign_to(name: $name) reminding them to call $person_to_call....\n"); 351 351 wp_mail($to, $subj, $msg); -
follow-hook/trunk/follow-hook.php
r2408325 r2426157 91 91 'rewrite' => array('slug' => 'people'), 92 92 //you must enter all the fields below that you want to show up as options in wp-admin/Follow Hook/forms/associate fields: 93 'supports' => array( 'title','_firstname','_lastname', '_email','_pph','_ wph','_contact_method','_addy1', 'addy2','_city','_state','_zip','_country')93 'supports' => array( 'title','_firstname','_lastname', '_email','_pph','_contact_method','_addy1', 'addy2','_city','_state','_zip','_country') 94 94 ) 95 95 ); … … 398 398 399 399 $pph = get_post_meta($post->ID, '_pph', true); 400 $wph = get_post_meta($post->ID, '_wph', true);400 //$wph = get_post_meta($post->ID, '_wph', true); 401 401 $contact_method = get_post_meta($post->ID, '_contact_method', true);//array of checked values! 402 402 … … 465 465 466 466 <div class="follow-hook-clear"></div> 467 <div class="follow-hook-field">Email: <input type="text" name="_email" value="<?php echo $email; ?>" class="follow-hook-field" /></div>468 <div class="follow-hook-field"> Mobile Phone: <input type="text" name="_pph" value="<?php echo $pph; ?>" class="follow-hook-field" /></div>467 <div class="follow-hook-field">Email: <input type="text" id="_email" name="_email" value="<?php echo $email; ?>" class="follow-hook-field" /></div> 468 <div class="follow-hook-field">Phone: <input type="text" id="_pph" name="_pph" value="<?php echo $pph; ?>" class="follow-hook-field" /></div> 469 469 470 470 <div class="follow-hook-clear"></div> 471 < div class="follow-hook-field">Work Phone: <input type="text" name="_wph" value="<?php echo $wph; ?>" class="follow-hook-field" /></div>471 <?php /*?><div class="follow-hook-field">Work Phone: <input type="text" name="_wph" value="<?php echo $wph; ?>" class="follow-hook-field" /></div><?php */?> 472 472 473 473 <div class="follow-hook-clear-pad"></div> … … 749 749 update_post_meta($post_id, '_email', $_POST['_email']); 750 750 update_post_meta($post_id, '_pph', sanitize_text_field($_POST['_pph'])); 751 update_post_meta($post_id, '_wph', sanitize_text_field($_POST['_wph']));751 //update_post_meta($post_id, '_wph', sanitize_text_field($_POST['_wph'])); 752 752 update_post_meta($post_id, '_contact_method', sanitize_text_field($_POST['_contact_method'])); 753 753 update_post_meta($post_id, '_todo', sanitize_text_field($_POST['_todo'])); … … 1883 1883 1884 1884 1885 add_action( 'wp_ajax_fh_check_for_email_and_phone', 'fh_check_for_email_and_phone' ); 1886 1887 function fh_check_for_email_and_phone(){ 1888 1889 if( is_admin() ){ 1890 1891 global $wpdb; 1892 1893 $return_arr[ 'email_exists' ] = 0; 1894 $return_arr[ 'pph_exists' ] = 0; 1895 1896 if( !empty( $_POST['_email'] ) ){ 1897 1898 $email_exists = $wpdb->get_col($wpdb->prepare( 1899 "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_email' AND meta_value = %s AND post_id != %d", 1900 $_POST['_email'],$_POST['post_ID'] 1901 )); 1902 1903 1904 if( $email_exists ) 1905 $return_arr[ 'email_exists' ] = $email_exists[0]; 1906 1907 } 1908 1909 if( !empty( $_POST['_pph'] ) ){ 1910 1911 $pph_exists = $wpdb->get_col($wpdb->prepare( 1912 "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_pph' AND meta_value = %s AND post_id != %d", 1913 $_POST['_pph'],$_POST['post_ID'] 1914 )); 1915 1916 if( $pph_exists ) 1917 $return_arr[ 'pph_exists' ] = $pph_exists[0]; 1918 1919 } 1920 1921 echo json_encode($return_arr); 1922 1923 1924 die; 1925 } 1926 } 1927 1928 1885 1929 1886 1930 //added code to make the email field for People CPT unique: -
follow-hook/trunk/js/auto_fill_people_title.js
r2135129 r2426157 6 6 document.getElementById('title').value = t; 7 7 }//end auto_fill_people_title JS function by Ian L. of jafty.com 8 9 10 jQuery(document).ready(function($){ 11 $('#publish').click(function(){ 12 13 14 post_type = $('#post_type').val(); 15 16 post_ID = $('#post_ID').val(); 17 18 if( post_type == 'people' ){ 19 20 _email = $('#_email').val(); 21 _pph = $('#_pph').val(); 22 23 if( _email == '' && _pph == '' ){ 24 25 alert('Please enter email or phone'); 26 return false; 27 28 } 29 else{ 30 31 $('<span id="fhwait">Please wait while we are validating...</span>' ).insertBefore( $(this) ); 32 33 var data = { 34 action: 'fh_check_for_email_and_phone', 35 _email: _email, 36 _pph: _pph, 37 post_ID: post_ID 38 39 }; 40 41 jQuery.post(ajaxurl, data, function(response) { 42 43 $('#fhwait').remove(); 44 45 if( response.email_exists == 0 && response.pph_exists == 0 ){ 46 $('#post').submit(); 47 } 48 49 if( response.email_exists > 0 || response.pph_exists > 0 ){ 50 51 alert('Oops! The email or phone you have entered belongs to another person, please use another.'); 52 return false; 53 } 54 55 }, "json"); 56 57 return false; 58 59 } 60 $('#post').submit(); 61 } 62 63 }); 64 }); -
follow-hook/trunk/readme.txt
r2408325 r2426157 7 7 Author URI: https://followhook.com/ 8 8 Author: Kyler Boudreau and Ian Lincicome of Follow Hook 9 Requires at least: 5. 5.010 Tested up to: 5.5. 19 Requires at least: 5.1.0 10 Tested up to: 5.5.3 11 11 Stable tag: trunk 12 Version: 1.2.212 Version: 2.1.0 13 13 Requires PHP: 7.1 14 14 License URI: https://followhook.com/downloads/follow-hook/ -
follow-hook/trunk/time.txt
r2408325 r2426157 1 2020-1 0-28 13:41:171 2020-11-26 00:00:20
Note: See TracChangeset
for help on using the changeset viewer.