Skip to content

Commit

Permalink
Merge pull request #4 from yogeshnipane/update_version
Browse files Browse the repository at this point in the history
"Filter changes for ukuugive version compatibility"
  • Loading branch information
yogeshnipane committed Feb 5, 2016
2 parents c050143 + fe3a39b commit 93f9194
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 4 deletions.
45 changes: 44 additions & 1 deletion includes/class-ukuupeople.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -1649,6 +1667,30 @@ function ukuu_custom_field_list_text( $column, $post_id ) {
echo "<div class='add_to_fav_star' style='float:left;'><div id='fav-star' class='remove-star'></div></div>";
}
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-- ) {
Expand Down Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions ukuupeople.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' );
Expand Down

0 comments on commit 93f9194

Please sign in to comment.