From fe3a39b3541bc333e754219bc1a2df265b2dc1b0 Mon Sep 17 00:00:00 2001 From: yogeshnipane Date: Fri, 5 Feb 2016 19:08:54 +0530 Subject: [PATCH] "Filter changes for ukuugive version compatibility" --- includes/class-ukuupeople.php | 45 ++++++++++++++++++++++++++++++++++- readme.txt | 2 +- ukuupeople.php | 4 ++-- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/includes/class-ukuupeople.php b/includes/class-ukuupeople.php index b0b9150..6d8b6c1 100644 --- a/includes/class-ukuupeople.php +++ b/includes/class-ukuupeople.php @@ -364,6 +364,24 @@ function ukuu_icons() { ?> function custom_human_info( $edit , $slug ) { wp_enqueue_script('jquery-ui-tabs'); $tab_filter = array(); + // version dependent code + $plugin_info = get_plugins(); + $plugin_exist = array_key_exists(UKUUGIVE_BASENAME,$plugin_info); + if ($plugin_exist){ + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + $plugin_active = is_plugin_active(UKUUGIVE_BASENAME); + if ($plugin_active){ + $plugin_version = $plugin_info[UKUUGIVE_BASENAME]['Version']; + if($plugin_version <= '1.0.2'){ + $tab_filter['contribution'] =array( + 'id' => 'donation-tab', + 'action' => 'ukuugive_tab_view', + 'icon' => 'ukuucontributions', + ); + } + } + } + // version dependent code $tab_filter = apply_filters( 'ukuupeople_view_tab_filter', $tab_filter ); if ( $slug == 'wp-type-org-contact' ) { $tab_filter['membership'] = array( @@ -1649,6 +1667,30 @@ function ukuu_custom_field_list_text( $column, $post_id ) { echo "
"; } break; + case 'ulm-inactive_days' : + $args = array('post_type' => 'wp-type-activity' , 'posts_per_page'=> -1, 'post_status' => array( 'publish', 'private' ) , + 'meta_query' => array( + 'relation' => 'AND', + array( + 'key' => '_wpcf_belongs_wp-type-activity_id', + 'value' => $post_id, + 'compare' => 'LIKE', + ), + )); + $loop = get_posts( $args ); + if(isset($loop[0]->ID)) { + $post_obj = get_post( $loop[0]->ID ); + $created_date = new DateTime($post_obj-> post_date); + $currentDateTime = new DateTime(date('Y-m-d H:i:s')); + $inactive_days = date_diff($currentDateTime,$created_date); + if ( $inactive_days->days > 100 ) { + echo "> 100"; + } + else { + echo $inactive_days->days; + } + } + break; case 'wp-type-activity': // Activity chart $monthsArray[date('Y')][date('n')] = date( 'n' ); for ( $i = 4; $i >= 0; $i-- ) { @@ -1724,7 +1766,8 @@ function ukku_contacts_custom_fields_list_view($defaults) { $defaults['wp-phone'] = __('Phone','UkuuPeople'); $defaults['wp-type-activity'] = __('TouchPoint','UkuuPeople'); $defaults['wp-favorites'] = __(''); - $Order = array( 'cb' ,'wp-color-code' , 'wp-contact-full-name' , 'wp-email' , 'wp-phone' , 'wp-type-activity','wp-favorites'); + $defaults['ulm-inactive_days'] = __('Inactive Days', 'UkuuPeople' ); + $Order = array( 'cb' ,'wp-color-code' , 'wp-contact-full-name' , 'wp-email' , 'wp-phone' , 'wp-type-activity','wp-favorites','ulm-inactive_days'); foreach ($Order as $colname){ $new[$colname] = $defaults[$colname]; } diff --git a/readme.txt b/readme.txt index 7222e93..1e78d2e 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate Link: http://ukuupeople.com Tags: crm, contact, customer, client, relationship manager, wordpress crm, nonprofit, mailchimp, marketing, sales, email, list building, fundraising, donations Requires at least: 3.8 Tested up to: 4.3 -Stable tag: 1.5.2 +Stable tag: 1.5.3 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html diff --git a/ukuupeople.php b/ukuupeople.php index 44791ce..e9fc869 100755 --- a/ukuupeople.php +++ b/ukuupeople.php @@ -11,7 +11,7 @@ Plugin URI: http://ukuupeople.com/ Description: Ukuu People is the premium plugin that helps you elegantly manage all of your human relationships. Ukuu People effortlessly ties all of your contact interactions and contact data collection tools together to form one authoritative master list of all of your contacts and a record of your interactions with them. - Version: 1.5.2 + Version: 1.5.3 Author: UKUU Logic Author URI: http://ukuulogic.com/ License: GPL 3 @@ -34,7 +34,7 @@ */ global $ukuupeople_db_version; -$ukuupeople_db_version = '1.5.2'; +$ukuupeople_db_version = '1.5.3'; register_activation_hook( __FILE__, 'on_activation' ); register_deactivation_hook( __FILE__, 'on_deactivation' );