Plugin Directory

Changeset 3138174


Ignore:
Timestamp:
08/20/2024 12:06:56 PM (18 months ago)
Author:
wpfeedback
Message:

updated to 4.0.4

Location:
atarim-visual-collaboration
Files:
210 added
11 edited

Legend:

Unmodified
Added
Removed
  • atarim-visual-collaboration/trunk/atarim-visual-collaboration.php

    r3133163 r3138174  
    33 * Plugin Name: Atarim: Visual Website Collaboration, Feedback & Workflow Management
    44 * Description: Atarim Visual Collaboration makes it easy and efficient to collaborate on websites with your clients, internal team, contractors…anyone! It’s used by nearly 10,000 agencies and freelancers worldwide on over 120,000 websites.
    5  * Version: 4.0.3
     5 * Version: 4.0.4
    66 * Requires at least: 5.0
    77 * Require PHP: 7.4
     
    3030}
    3131if ( ! defined( 'WPF_VERSION' ) ) {
    32     define( 'WPF_VERSION', '4.0.3' );
     32    define( 'WPF_VERSION', '4.0.4' );
    3333}
    3434
     
    9393add_action( 'upgrader_process_complete', 'wpf_plugins_update_completed', 10, 2 );
    9494
    95 function wpb_admin_notice_warn() {
    96     $hide = false;
    97     $wpf_user_type = wpf_user_type();
    98     $is_notice = get_option('wp_feedback_notice', 'true');
    99     if ( ! $hide && current_user_can( 'administrator' ) && $wpf_user_type == 'advisor' && $is_notice == 'true' && ! isset( $_GET['page'] ) ) {
    100     ?>
    101         <div class="notice notice-warning wpf_admin_notice wpf-gftool-notice is-dismissible">
    102                 <div class="wpf_admin_notice_icon">
    103                     <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1080 1080">
    104                         <defs>
    105                             <style>
    106                                 .cls-1 {
    107                                     fill: #fff;
    108                                 }
    109                                 .cls-2 {
    110                                     fill: #052055;
    111                                 }
    112                             </style>
    113                         </defs>
    114                         <title><?php _e( 'Atarim Logo Inverted', 'atarim-visual-collaboration' ); ?></title>
    115                         <g>
    116                             <g>
    117                                 <polygon class="cls-1" points="937.344 785.955 746.1 856.215 851.972 1060.257 1080 1059.991 937.344 785.955"/>
    118                                 <polygon class="cls-1" points="539.938 19.669 0 1059.991 228.152 1059.991 539.873 458.766 652.263 675.369 843.507 605.108 539.938 19.669"/>
    119                             </g>
    120                             <polygon class="cls-2" points="227.659 1060.331 373.967 778.521 1055.074 519.371 227.659 1060.331"/>
    121                         </g>
    122                     </svg>
    123                 </div>
    124                 <div class="wpf_admin_notice_content">
    125                     <h4><?php _e( 'This is the title of the advance notice.', 'atarim-visual-collaboration' ); ?></h4>
    126                     <p><?php _e( 'Please note that in the next update <b>This is the description</b>.', 'atarim-visual-collaboration' ); ?></p>
    127                     <ul>
    128                         <li>Point 1</li>
    129                         <li>Point 2</li>
    130                         <li>Point 3</li>                    </ul>
    131                     <p class="admin_notice_footer"><i><?php _e( '* This notice is shown to you as the Webmaster.', 'atarim-visual-collaboration' ); ?></i></p>
    132                 </div>
    133             </div>
    134         <?php
    135     }
    136 }
    137 //add_action( 'admin_notices', 'wpb_admin_notice_warn' );
    138 
    13995function wpf_plugin_update_message( $plugin_data, $new_data ) {
    14096    if( isset( $plugin_data['upgrade_notice'] ) ) {
     
    152108
    153109
    154 add_action( 'admin_menu', 'wp_feedback_admin_menu' );
    155110/**
    156111 * Create the admin menu.
     
    167122    $selected_roles = explode( ',', $selected_roles );
    168123
    169     $main_menu_id = 'collaboration_page_tasks';
     124    $main_menu_id = 'collaboration_task_center';
    170125
    171126    if ( array_intersect( $current_user->roles, $selected_roles ) || current_user_can( 'administrator' ) ) {
     
    184139        );
    185140        add_submenu_page(
    186             $main_menu_id, __( 'Tasks Center', 'atarim-visual-collaboration' ), __( 'Tasks Center', 'atarim-visual-collaboration' ), 'read', 'collaboration_page_tasks', 'collaboration_page_tasks'
     141            $main_menu_id, __( 'Tasks Center', 'atarim-visual-collaboration' ), __( 'Tasks Center', 'atarim-visual-collaboration' ), 'read', 'collaboration_task_center', 'collaboration_task_center'
    187142        );
    188143        if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) {
     
    196151            );
    197152        }
    198         if ( $wpf_user_type == 'advisor' ) {
    199             add_submenu_page(
    200                 $main_menu_id, __( 'Integrations', 'atarim-visual-collaboration' ), __( 'Integrations', 'atarim-visual-collaboration' ), 'read', 'collaboration_page_integrate', 'collaboration_page_integrate'
    201             );
    202         }
    203 
    204153        if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) {
    205154            add_submenu_page(
    206                 $main_menu_id, __( 'Support', 'atarim-visual-collaboration' ), __( 'Support', 'atarim-visual-collaboration' ), 'read', 'https://atarim.io/support-reachout'
     155                $main_menu_id, __( 'Support', 'atarim-visual-collaboration' ), __( 'Support', 'atarim-visual-collaboration' ), 'read', 'https://atarim.io/help'
    207156            );
    208             add_submenu_page(
    209                 $main_menu_id, __( 'Upgrade', 'atarim-visual-collaboration' ), __( 'Upgrade', 'atarim-visual-collaboration' ), 'read', WPF_MAIN_SITE_URL.'/upgrade'
    210             );
    211         }
    212     }
    213 }
    214 
    215 
    216 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wpf_setting_action_links' );
     157        }
     158    }
     159}
     160add_action( 'admin_menu', 'wp_feedback_admin_menu' );
     161
    217162/*
    218163 * This function is used to set the link for the "Settings" menu item.
     
    222167 */
    223168function wpf_setting_action_links( $links ) {
    224     $links[] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=collaboration_page_settings&wpf_setting=1' ) ) . '">' . __( 'Settings', 'atarim-visual-collaboration' ) . '</a>';
     169    $links[] = '<a href="' . esc_url( get_admin_url( null, 'admin.php?page=collaboration_page_settings' ) ) . '">' . __( 'Settings', 'atarim-visual-collaboration' ) . '</a>';
    225170    return $links;
    226171}
     172add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'wpf_setting_action_links' );
    227173
    228174/*
     
    235181    global $current_user;
    236182    $initial_setup = get_site_data_by_key( 'wpf_initial_setup_complete' );
    237     //update_option("wpf_initial_setup_complete", 'yes');
    238183    if ( $initial_setup != 'yes' ) {
    239184        require_once( WPF_PLUGIN_DIR . 'inc/admin/wpf_backend_initial_setup.php' );
     
    249194 * @return NULL
    250195 */
    251 function collaboration_page_tasks() {
     196function collaboration_task_center() {
    252197    global $current_user;
    253     require_once( WPF_PLUGIN_DIR . 'inc/admin/page-settings.php' );
    254 }
    255 
    256 /*
    257  * This function is used used to include the page-settings template for the integration menu.
    258  *
    259  * @input NULL
    260  * @return NULL
    261  */
    262 function collaboration_page_integrate() {
    263     global $current_user;
    264     require_once( WPF_PLUGIN_DIR . 'inc/admin/page-settings.php' );
    265 }
    266 
    267 /*
    268  * This function is used used to include the page-settings template for the support menu.
    269  *
    270  * @input NULL
    271  * @return NULL
    272  */
    273 function collaboration_page_support() {
    274     global $current_user;
    275     require_once( WPF_PLUGIN_DIR . 'inc/admin/page-settings.php' );
     198    require_once( WPF_PLUGIN_DIR . 'inc/admin/task-center.php' );
    276199}
    277200
     
    296219require_once( WPF_PLUGIN_DIR . 'inc/admin/wpf_admin_function.php' );
    297220require_once( WPF_PLUGIN_DIR . 'inc/wpf_api.php' );
     221require_once( WPF_PLUGIN_DIR . 'inc/wpf_class.php' );
    298222
    299223// Create cookie for invited user to allow collaboration (share verison 2) by Pratap.
     
    376300    }
    377301}
    378 add_action( 'init','session_for_invited_user' );
    379 
    380 add_action( 'init','new_license_activation' );
     302add_action( 'init', 'session_for_invited_user' );
     303
    381304function new_license_activation() {
    382305   
     
    430353        }
    431354    }
    432 
    433 }
     355}
     356add_action( 'init', 'new_license_activation' );
    434357
    435358/*
     
    439362function update_default_site_data() {
    440363    $options = array();
    441    
    442364    array_push( $options, ['name' => 'wpf_initial_setup_complete', 'value' => 'yes'] );
    443365    array_push( $options, ['name' => 'enabled_wpfeedback', 'value' => 'yes'] );
     
    499421function wpfeedback_add_stylesheet_frontend() {
    500422    $wpf_check_page_builder_active = wpf_check_page_builder_active();
    501     /* =====Start Check customize.php==== */
    502     /*if ( $wpf_check_page_builder_active == 0 ) {
    503         if ( is_customize_preview() ) {
    504             $wpf_check_page_builder_active = 1;
    505         } else {
    506             $wpf_check_page_builder_active = 0;
    507         }
    508     }*/
    509     /* =====END check customize.php==== */
    510423    if ( $wpf_check_page_builder_active == 0 ) {
    511424        $enabled_wpfeedback = wpf_check_if_enable();
     
    551464            wp_enqueue_script( 'wpf_jquery_script' );
    552465
    553             //wp_register_script( 'pickr', WPF_PLUGIN_URL . 'js/pickr.min.js', null, null, true );
    554             //wp_enqueue_script( 'pickr' );
    555 
    556             //wp_register_style( 'pickr_monolith', WPF_PLUGIN_URL . 'css/monolith.min.css' );
    557             //wp_enqueue_style( 'pickr_monolith' );
    558466            if ( $wpf_check_page_builder_active == 0 ) {
    559 
    560                 wp_register_script( 'wpf_jquery_ui_script', WPF_PLUGIN_URL . 'js/atarim-ui.js', array(), WPF_VERSION, true );
    561                 //wp_enqueue_script( 'wpf_jquery_ui_script' );
    562467
    563468                wp_register_script( 'wpf_touch_mouse_script', WPF_PLUGIN_URL . 'js/atarim.ui.mouse.min.js', array(), WPF_VERSION, true );
     
    665570add_action('wp_enqueue_scripts', 'wpfeedback_add_stylesheet_frontend');
    666571
    667 add_filter( 'script_loader_tag', 'add_attributes_to_script', 10, 3 );
    668572/**
    669573 *
     
    680584    return $tag;
    681585}
    682 
     586add_filter( 'script_loader_tag', 'add_attributes_to_script', 10, 3 );
    683587
    684588
     
    689593 * @return String
    690594 */
    691 
    692595function wpf_wp_create_nonce() {
    693596    global $post;
     
    701604    }
    702605    if ( is_user_logged_in() || $wpf_allow_guest == 'yes' ) {
    703         $wpf_nonce = wp_create_nonce( 'wpfeedback-script-nonce' );
    704         return $wpf_nonce;
    705     }
    706     if ( get_query_var( 'is_graphic_page' ) && ! is_user_logged_in() && $wpf_allow_guest != 'yes' ) {
    707606        $wpf_nonce = wp_create_nonce( 'wpfeedback-script-nonce' );
    708607        return $wpf_nonce;
     
    765664
    766665    if ( isset( $_REQUEST['page'] ) ) {
    767         if ( $_REQUEST['page'] == 'collaboration_page_settings' || $_REQUEST['page'] == 'collaboration_page_tasks' || $_REQUEST['page'] == 'collaboration_page_integrate' || $_REQUEST['page'] == 'collaboration_page_upgrade' || $_REQUEST['page'] == 'collaboration_page_support' || $_REQUEST['page'] == 'collaboration_page_permissions' ) {
     666        if ( $_REQUEST['page'] == 'collaboration_task_center' ) {
    768667            ?>
    769668            <script type='text/javascript'>
     
    14381337                return quill.getText().trim().length === 0
    14391338            }
    1440 
    1441             jQuery(document).ready(function ($) {
    1442                 var wpfeedback_page = getParameterByName('page');
    1443                 if ( wpfeedback_page == "collaboration_page_tasks" ) {
    1444                     jQuery("button.wpf_tab_item.wpf_tasks").trigger('click');
    1445                 }
    1446                 if ( wpfeedback_page == "collaboration_page_settings" ) {
    1447                     jQuery("button.wpf_tab_item.wpf_settings").trigger('click');
    1448                 }
    1449                 if ( wpfeedback_page == "collaboration_page_integrate" ) {
    1450                     jQuery("button.wpf_tab_item.wpf_addons").trigger('click');
    1451                 }
    1452                 if ( wpfeedback_page == "collaboration_page_support" ) {
    1453                     jQuery("button.wpf_tab_item.wpf_support").trigger('click');
    1454                 }
    1455                 if ( wpfeedback_page == "collaboration_page_permissions" ) {
    1456                     jQuery("button.wpf_tab_item.wpf_misc").trigger('click');
    1457                 }
    1458             });
    14591339            </script>
    14601340            <?php
     
    16371517        $wpf_check_page_builder_active = wpf_check_page_builder_active();
    16381518
    1639         /* =====Start Check customize.php==== */
    1640         /*if ( $wpf_check_page_builder_active == 0 ) {
    1641             if ( is_customize_preview() ) {
    1642                 $wpf_check_page_builder_active = 1;
    1643             } else {
    1644                 $wpf_check_page_builder_active = 0;
    1645             }
    1646         }*/
    1647         /* =====END check customize.php==== */
    1648 
    16491519        /* =====Start filter sidebar HTML Structure==== */
    16501520        $is_site_archived                  = get_site_data_by_key( 'wpf_site_archived' );
     
    17391609    }
    17401610}
    1741 
    17421611add_action( 'wp_footer', 'show_wpf_comment_button' );
     1612
    17431613function wpf_check_permission() {
    17441614    $currnet_user_information = wpf_get_current_user_information();
     
    18211691}
    18221692add_filter( 'admin_head', 'add_sticker_permission_to_head' );
    1823 
    1824 
    1825 /*
    1826  * This function is used to remove the backend menu for the wpfeedback post type so they are not accessible by backend users.
    1827  *
    1828  * @input NULL
    1829  * @return NULL
    1830  */
    1831 function wpf_disable_comments_admin_menu() {
    1832     remove_menu_page( 'edit.php?post_type=wpfeedback' );
    1833 }
    1834 add_action( 'admin_menu', 'wpf_disable_comments_admin_menu' );
    1835 
    1836 
    1837 /*
    1838  * This function is used to disabled the Atarim features on Atarim pages.
    1839  *
    1840  * @input NULL
    1841  * @return NULL
    1842  */
    1843 function wpf_exclude_comments( $query ) {
    1844     if ( $query->query_vars['type'] !== 'wp_feedback' ) {
    1845         $query->query_vars['type__not_in'] = array_merge( (array) $query->query_vars['type__not_in'], array('wp_feedback') );
    1846     }
    1847 }
    1848 //add_action( 'pre_get_comments', 'wpf_exclude_comments' );
    1849 
    1850 
    1851 /*
    1852  * This function is used to set the redirect of Upgrade menu item.
    1853  *
    1854  * @input NULL
    1855  * @return NULL
    1856  */
    1857 function wpf_upgrade_menu_page_redirect() {
    1858     $wpf_license   = get_option( 'wpf_license' );
    1859     $wpf_user_type = wpf_user_type();
    1860     if ( $wpf_license != 'valid' ) {
    1861     ?>
    1862     <style type="text/css">
    1863         div#wpf_tasks {
    1864         position: relative;
    1865         }
    1866     </style>
    1867     <?php
    1868     }
    1869     if ( $wpf_user_type == 'advisor' ) {
    1870     ?>
    1871     <script type="text/javascript">
    1872         jQuery(document).ready(function ($) {
    1873         jQuery('#toplevel_page_wp_feedback ul li').last().find('a').attr('target', '_blank');
    1874         });
    1875     </script>
    1876     <?php
    1877     }
    1878 }
    1879 add_action( 'admin_head', 'wpf_upgrade_menu_page_redirect' );
    1880 
    1881 require_once( WPF_PLUGIN_DIR . 'inc/wpf_class.php' );
    18821693
    18831694/*
     
    19831794
    19841795/*
    1985  * This function is used to identify if certain themes/plugins are so that jquery UI can be de registered.
    1986  *
    1987  * @input NULL
    1988  * @return Boolean
    1989  */
    1990 function wpf_remove_ui_script() {
    1991     $response = 1;
    1992     if ( function_exists( 'get_field' ) ) {
    1993         $response = 0;
    1994     }
    1995     if ( class_exists( 'PMXI_Plugin' ) ) {
    1996         $response = 0;
    1997     }
    1998     if ( class_exists( 'Avada' ) ) {
    1999         $response = 0;
    2000     }
    2001     if ( class_exists( 'WooCommerce' ) ) {
    2002         $response = 0;
    2003     }
    2004     if ( class_exists( 'The7_Less_Functions' ) ) {
    2005         $response = 0;
    2006     }
    2007     if ( class_exists( 'iHomefinderAutoloader' ) ) {
    2008         $response = 0;
    2009     }
    2010     return $response;
    2011 }
    2012 
    2013 
    2014 /*
    20151796 * function is used to get last task no
    20161797 */
     
    22302011
    22312012/*
    2232  * function is used to get site settings data
    2233  * and stored in session
    2234  */
    2235 function get_user_data() {
    2236     if ( ! session_id() ) {
    2237         session_start();
    2238     }
    2239 
    2240     if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { /* it's an Ajax call */
    2241     } else if ( get_option( 'wpf_license' ) != 'valid' ) {
    2242     } else {
    2243         $wpf_site_id = get_option( 'wpf_site_id' );
    2244         if ( is_user_logged_in() ) {
    2245             $userid = get_current_user_id();
    2246             $args   = array(
    2247                 'wpf_site_id' => $wpf_site_id,
    2248                 'wpf_user_id' => $userid
    2249             );
    2250             $url         = WPF_CRM_API . 'wp-api/wpfuser/getWpfUser';
    2251             $sendtocloud = wp_json_encode( $args );
    2252             $res_data    = wpf_send_remote_post( $url, $sendtocloud );
    2253             if ( isset( $res_data['status'] ) && $res_data['status'] == '200' && isset( $res_data['data'] ) ) {
    2254                 $user_data = $res_data['data'];
    2255                 if ( isset( $_SESSION['site_' . $wpf_site_id]["user_data"] ) ) {
    2256                     unset( $_SESSION['site_'.$wpf_site_id]["user_data"] );
    2257                 }
    2258                 $_SESSION['site_'.$wpf_site_id]['user_data'] = $user_data;
    2259             } else {
    2260                 if ( isset( $_SESSION['site_'.$wpf_site_id]["user_data"] ) ) {
    2261                     unset( $_SESSION['site_'.$wpf_site_id]["user_data"] );
    2262                 }
    2263             }
    2264         } else {
    2265             if ( isset( $_SESSION['site_' . $wpf_site_id]["user_data"] ) ) {
    2266                 unset( $_SESSION['site_'.$wpf_site_id]["user_data"] );
    2267             }
    2268         }
    2269     }
    2270 }
    2271 
    2272 /*
    2273  * function is used to get site filter
    2274  * data and store in session
    2275  */
    2276 function get_site_filter_data() {
    2277     $ret = 0;
    2278     if ( ! is_user_logged_in() ) {
    2279         if( ! get_option( 'enabled_wpfeedback' ) == 'yes' ) {
    2280             $ret = 1;
    2281         } else {
    2282             if ( ! get_option( 'wpf_allow_guest' ) == 'yes' ) {
    2283                 $ret = 1;
    2284             } else {
    2285                 $ret = 0;
    2286             }
    2287         }
    2288     }
    2289 
    2290     if ( $ret == 1 ) {
    2291         return;
    2292     }
    2293 
    2294     if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { /* it's an Ajax call */
    2295     } else if( get_option( 'wpf_license' ) != 'valid' ) {
    2296     } else {
    2297         $wpf_site_id            = get_option( 'wpf_site_id' );
    2298         $url                    = WPF_CRM_API . 'wp-api/site/get-wp-filter-data';
    2299         $sendarr                = array();
    2300         $sendarr["wpf_site_id"] = $wpf_site_id;
    2301         $sendtocloud            = wp_json_encode( $sendarr );
    2302         $response               = wpf_send_remote_post( $url, $sendtocloud );
    2303         if ( isset( $response['status'] ) && $response['status'] == '1' ) {
    2304             update_option( 'filter_data', $response['data'], 'no' );
    2305         }
    2306     }
    2307 }
    2308 
    2309 /*
    2310  * function is used to clear the session
    2311  */
    2312 function clear_session() {
    2313     $wpf_site_id = get_option( 'wpf_site_id' );
    2314     if ( isset( $_SESSION['site_' . $wpf_site_id]["site_data"] ) ) {
    2315         unset( $_SESSION['site_' . $wpf_site_id]["site_data"] );
    2316     }
    2317 
    2318     if ( isset( $_SESSION['site_' . $wpf_site_id]["notify_users"] ) ) {
    2319         unset( $_SESSION['site_' . $wpf_site_id]["notify_users"] );
    2320     }
    2321 
    2322     if ( isset( $_SESSION['site_' . $wpf_site_id]["user_data"] ) ) {
    2323         unset( $_SESSION['site_' . $wpf_site_id]["user_data"] );
    2324     }
    2325 }
    2326 
    2327 /*
    23282013 * function is used to get site settings data by key
    23292014 */
    23302015function get_site_data_by_key( $key ) {
    23312016    $str = get_option( $key );
    2332     return $str;
    2333 }
    2334 
    2335 function get_site_data_by_key_api( $option_name ) {
    2336     $args = array(
    2337         'wpf_site_id' => get_option( 'wpf_site_id' ),
    2338         'option_name' => $option_name
    2339     );
    2340     $url         = WPF_CRM_API . 'get-site-data-by-key';
    2341     $sendtocloud = wp_json_encode( $args );
    2342     $res_data    = wpf_send_remote_post( $url, $sendtocloud );
    2343     $str         = '';
    2344     if ( $res_data['status'] == '200' && isset( $res_data['data'] ) ) {
    2345         $str = $res_data['data'];
    2346     }
    23472017    return $str;
    23482018}
     
    23832053    }
    23842054}
    2385 
    2386 
    2387 function formatTimeString( $time ) {
    2388     $monday                       = strtotime( "last monday" );
    2389     $monday                       = date( 'w', $monday ) == date( 'w' ) ? $monday + 7*86400 : $monday;
    2390     $sunday                       = strtotime( date( "Y-m-d 23:59:59", $monday ) . " +6 days" );
    2391     $this_week_sd                 = strtotime( date( "Y-m-d 00:00:01", $monday ) . " -7 days" );
    2392     $this_week_ed                 = strtotime( date( "Y-m-d 23:59:59", $sunday ) . " -7 days" );
    2393     $number_of_days_in_this_month = date( 't' );
    2394     $first_day_this_month         = strtotime( date( 'Y-m-01 00:00:01' ) . " -${number_of_days_in_this_month} days" ); // hard-coded '01' for first day
    2395     $last_day_this_month          = strtotime( date( 'Y-m-t 23:59:59' ) . " -${number_of_days_in_this_month} days" );
    2396     $first_day_of_year            = strtotime( 'first day of january this year' );
    2397     $last_day_of_year             = strtotime('last day of december this year');
    2398 
    2399     if ( $time >= strtotime( date( 'Y-m-d 00:00:01' ) ) && $time <= strtotime( date( 'Y-m-d 23:59:59' ) ) ) {
    2400         return "today";
    2401     }
    2402 
    2403     if ( $time >= strtotime( date( "Y-m-d 00:00:01" ) . " -1 days" ) && $time <= strtotime( date( 'Y-m-d 23:59:59' ) . " -1 days" ) ) {
    2404         return 'yesterday';
    2405     }
    2406 
    2407     if ( $time >= $this_week_sd && $time <= $this_week_ed ) {
    2408         return "this_week";
    2409     }
    2410 
    2411     if ( $time >= $first_day_this_month && $time <= $last_day_this_month ) {
    2412         return "this_month";
    2413     }
    2414 
    2415     if ( $time >= $first_day_of_year && $time <= $last_day_of_year ) {
    2416         return "year";
    2417     }
    2418     return "other";
    2419 }
    2420 
    2421 /*
    2422  * Move the site data to wpf when
    2423  * plugin 2.0 updated
    2424  */
    2425  function move_all_old_data_api_call() {
    2426     if( isset( $_GET['move_wpf_data'] ) && $_GET['move_wpf_data'] == 1 ) {
    2427         echo "Data moved!!";
    2428         exit;
    2429     }
    2430 }
    2431 
    2432 
    2433 /*function prefix_plugin_update_message( $data, $response ) {
    2434     if( isset( $data['upgrade_notice'] ) ) {
    2435         printf(
    2436             '<div class="update-message">%s</div>',
    2437             wpautop( $data['upgrade_notice'] )
    2438         );
    2439     }
    2440 }
    2441 add_action( 'atarim-client-interface-plugin/wpfeedback.php', 'prefix_plugin_update_message', 10, 2 );*/
    2442 
    2443 
    2444 /*function prefix_plugin_update_message_fallback( $data, $response ) {
    2445     if ( ! function_exists( 'prefix_plugin_update_message' ) ) {
    2446         printf(
    2447             '<div class="update-message"><p><strong>%s</strong></p></div>',
    2448             __( 'Version 2.0 is a major update. You should take a backup before you upgrade.', 'text-domain' )
    2449         );
    2450     }
    2451 }
    2452 add_action( 'atarim-client-interface-plugin/wpfeedback.php', 'prefix_plugin_update_message_fallback', 10, 2 );*/
    2453    
    2454 
    2455 /**
    2456  * This function is used to register the terms for taxonomy "Task Priority" on the website where it is installed.
    2457  *
    2458  * @input NULL
    2459  * @return NULL
    2460  */
    2461 if ( ! function_exists( 'wp_feedback_register_task_priority_terms' ) ) {
    2462     function wp_feedback_register_task_priority_terms() {
    2463         $taxonomy = 'task_priority';
    2464         $terms    = array(
    2465             '0' => array(
    2466                 'name'        => 'Low',
    2467                 'slug'        => 'low',
    2468                 'description' => '',
    2469             ),
    2470             '1' => array(
    2471                 'name'        => 'Medium',
    2472                 'slug'        => 'medium',
    2473                 'description' => '',
    2474             ),
    2475             '2' => array(
    2476                 'name'        => 'High',
    2477                 'slug'        => 'high',
    2478                 'description' => '',
    2479             ),
    2480             '3' => array(
    2481                 'name'        => 'Critical',
    2482                 'slug'        => 'critical',
    2483                 'description' => '',
    2484             ),
    2485         );
    2486    
    2487         foreach ( $terms as $term_key => $term ) {
    2488             if ( ! term_exists( $term['slug'], 'task_priority' ) ) {
    2489                 wp_insert_term(
    2490                     $term['name'],
    2491                     $taxonomy,
    2492                     array(
    2493                         'description' => $term['description'],
    2494                         'slug'        => $term['slug'],
    2495                     )
    2496                 );
    2497             }
    2498         }
    2499     }
    2500 }
    2501 //add_action( 'wp_loaded', 'wp_feedback_register_task_priority_terms', 0 );
    2502    
    2503 /*
    2504  * This function is used to register the terms for taxonomy "Task Status" on the website where it is installed.
    2505  *
    2506  * @input NULL
    2507  * @return NULL
    2508  */
    2509 if ( ! function_exists( 'wp_feedback_register_task_status_terms' ) ) {
    2510     function wp_feedback_register_task_status_terms() {
    2511         $taxonomy = 'task_status';
    2512         $terms    = array(
    2513             '0' => array(
    2514                 'name'        => 'Open',
    2515                 'slug'        => 'open',
    2516                 'description' => '',
    2517             ),
    2518             '1' => array(
    2519                 'name'        => 'In Progress',
    2520                 'slug'        => 'in-progress',
    2521                 'description' => '',
    2522             ),
    2523             '2' => array(
    2524                 'name'        => 'Pending Review',
    2525                 'slug'        => 'pending-review',
    2526                 'description' => '',
    2527             ),
    2528             '3' => array(
    2529                 'name'        => 'Complete',
    2530                 'slug'        => 'complete',
    2531                 'description' => '',
    2532             ),
    2533         );
    2534    
    2535         foreach ( $terms as $term_key => $term ) {
    2536             if ( ! term_exists( $term['slug'], 'task_status' ) ) {
    2537                 wp_insert_term(
    2538                     $term['name'],
    2539                     $taxonomy,
    2540                     array(
    2541                         'description' => $term['description'],
    2542                         'slug'        => $term['slug'],
    2543                     )
    2544                 );
    2545             }
    2546         }
    2547     }
    2548 }
    2549 //add_action( 'wp_loaded', 'wp_feedback_register_task_status_terms', 0 );
    25502055
    25512056/*
     
    28402345}
    28412346
    2842 add_action('init', 'add_custom_cookie_admin');
    28432347function add_custom_cookie_admin() {
    28442348    global $current_user;
     
    28532357    }
    28542358}
     2359add_action('init', 'add_custom_cookie_admin');
    28552360
    28562361// Adding side bar interface isnide Visual Composer editor
  • atarim-visual-collaboration/trunk/css/admin.css

    r3133163 r3138174  
    6464    border-radius: 0 5px 5px 5px;
    6565    background-color: #fff !important;
     66    position: relative;
    6667}
    6768
     
    23102311    height: 100%;
    23112312    left: -20px;
     2313    top: 3px;
    23122314    padding-top: 5%;
    23132315    font-size: 30px;
     
    28302832 }
    28312833
    2832  .toplevel_page_collaboration_page_tasks .wp-menu-image img {
     2834 .toplevel_page_collaboration_task_center .wp-menu-image img {
    28332835    padding: 5px 0 0 0 !important;
    28342836    opacity: .6;
  • atarim-visual-collaboration/trunk/css/wpf-common.css

    r3133163 r3138174  
    13491349    z-index: -1;
    13501350}
    1351 /*.sidebar_open {
    1352     right: 30px;
    1353     top: 10%;
    1354 }*/
    13551351.wpf_sidebar_container p {
    13561352    margin: 0 !important;
  • atarim-visual-collaboration/trunk/inc/admin/page-settings-permissions.php

    r3133163 r3138174  
    2828    <!-- ================= TOP TABS ================-->
    2929    <div class="wpf_tabs_container" id="wpf_tabs_container">
    30         <button class="wpf_tab_item wpf_tasks active" onclick="location.href='admin.php?page=collaboration_page_tasks'" style="background-color: #efefef;"><?php esc_attr_e( 'Tasks', 'atarim-visual-collaboration' ); ?></button>
     30        <button class="wpf_tab_item wpf_tasks" onclick="location.href='admin.php?page=collaboration_task_center'">
     31            <?php esc_attr_e( 'Tasks', 'atarim-visual-collaboration' ); ?>
     32        </button>
    3133        <?php
    3234        if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) { ?>
    33             <button class="wpf_tab_item wpf_settings" onclick="location.href='admin.php?page=collaboration_page_settings'" style="background-color: #efefef;"><?php esc_attr_e( 'Settings', 'atarim-visual-collaboration' ); ?></button>
     35            <button class="wpf_tab_item wpf_settings" onclick="location.href='admin.php?page=collaboration_page_settings'">
     36                <?php esc_attr_e( 'Settings', 'atarim-visual-collaboration' ); ?>
     37            </button>
    3438        <?php }
    3539        if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) { ?>
    36             <button class="wpf_tab_item wpf_misc" onclick="opensettingTab('wpf_misc')" style="background-color: #efefef;"><?php esc_attr_e( 'Permissions', 'atarim-visual-collaboration' ); ?></button>
    37         <?php }
    38         if ( $wpf_user_type == 'advisor' ) { ?>
    39             <button class="wpf_tab_item wpf_addons" onclick="location.href='admin.php?page=collaboration_page_integrate'" style="background-color: #efefef;"><?php esc_attr_e( 'Integrate', 'atarim-visual-collaboration' ); ?></button>
    40         <?php }
    41         if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) { ?>
    42             <a href="https://atarim.io/support-reachout" target="_blank" class="wpf_tab_item wpf_support" style="background-color: #efefef;">
    43                 <button><?php esc_attr_e( 'Support', 'atarim-visual-collaboration' ); ?></button>
    44             </a>
    45             <a href="<?php echo WPF_MAIN_SITE_URL; ?>/upgrade" target="_blank" class="wpf_tab_item" style="background-color: #efefef;">
    46                 <button><?php esc_attr_e( 'Upgrade', 'atarim-visual-collaboration' ); ?></button>
    47             </a>
     40            <button class="wpf_tab_item wpf_misc active">
     41                <?php esc_attr_e( 'Permissions', 'atarim-visual-collaboration' ); ?>
     42            </button>
    4843        <?php } ?>
    4944    </div>
     
    5247    <?php
    5348    if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) { ?>
    54         <div id="wpf_misc" class="wpf_container" style="display:none">
     49        <div id="wpf_misc" class="wpf_container">
    5550            <div class="wpf_section_title"><?php esc_attr_e( 'Permissions', 'atarim-visual-collaboration' ); ?></div>
    5651            <form method="post" action="admin-post.php" id="wpf_form_site_permission" >
     
    9388                                    ?>                               
    9489                                </div>
    95                                 <span><?php esc_attr_e( "If you ran out of website slots, <a href='https://atarim.io/upgrade/' target='_blank'>Please click here to increase your resources</a>", 'atarim-visual-collaboration' ); ?></span>
     90                                <span><?php printf( esc_html__( 'If you ran out of website slots, Please click %shere%s to increase your resources', 'atarim-visual-collaboration' ), '<a href="' . esc_url( 'https://app.atarim.io/billing' ) . '" target="_blank">', '</a>' ); ?></span>
    9691                                <?php
    9792                                $wpf_check_license_site = get_option( 'wpf_license' );
  • atarim-visual-collaboration/trunk/inc/admin/page-settings.php

    r3133163 r3138174  
    7575
    7676    <div class="wpf_tabs_container" id="wpf_tabs_container">
    77         <button class="wpf_tab_item wpf_tasks active" onclick="opensettingTab( 'wpf_tasks' )">
     77        <button class="wpf_tab_item wpf_tasks" onclick="location.href='admin.php?page=collaboration_task_center'">
    7878            <?php esc_attr_e( 'Tasks', 'atarim-visual-collaboration' ); ?>
    7979        </button>
    8080        <?php if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) { ?>
    81             <button class="wpf_tab_item wpf_settings" onclick="opensettingTab( 'wpf_settings' )">
     81            <button class="wpf_tab_item wpf_settings active">
    8282                <?php esc_attr_e( 'Settings', 'atarim-visual-collaboration' ); ?>
    8383            </button>
     
    8787                <?php esc_attr_e( 'Permissions', 'atarim-visual-collaboration' ); ?>
    8888            </button>
    89         <?php }
    90         if ( $wpf_user_type == 'advisor' ) { ?>
    91             <button class="wpf_tab_item wpf_addons" onclick="opensettingTab( 'wpf_addons' )">
    92                 <?php esc_attr_e( 'Integrate', 'atarim-visual-collaboration' ); ?>
    93             </button>
    94         <?php }
    95         if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) { ?>
    96             <a href="https://atarim.io/support-reachout" target="_blank" class="wpf_tab_item wpf_support">
    97                 <button><?php esc_attr_e( 'Support', 'atarim-visual-collaboration' ); ?></button>
    98             </a>
    99             <a href="<?php echo WPF_MAIN_SITE_URL; ?>/upgrade" target="_blank" class="wpf_tab_item" >
    100                 <button><?php esc_attr_e( 'Upgrade', 'atarim-visual-collaboration' ); ?></button>
    101             </a>
    10289        <?php } ?>
    10390    </div>
    104    
    105     <!-- ================= TASKS PAGE ================-->
    10691    <?php
    10792    $wpf_daily_report  = get_site_data_by_key( 'wpf_daily_report' );
    10893    $wpf_weekly_report = get_site_data_by_key( 'wpf_weekly_report' );
    109     ?>
    110     <div id="wpf_tasks" class="wpf_container <?php if ( ! is_feature_enabled( 'task_center' ) ) { ?> blocked <?php } ?>">
    111         <?php
    112         $wpf_license = get_option( 'wpf_license' );
    113         if ( $wpf_license != 'valid' ) {
    114         ?>
    115         <div id="wpf_tasks_overlay">
    116             <div class="wpf_welcome_wrap">
    117                 <div class="wpf_welcome_title"><?php esc_attr_e( 'Welcome to Atarim', 'atarim-visual-collaboration' ); ?> </div>
    118                 <div class="wpf_welcome_note"><?php esc_attr_e( "It's good to have you here", 'atarim-visual-collaboration' ); ?> <?php esc_attr_e( $wpf_user_name, 'atarim-visual-collaboration' ); ?>! ❤</div>
    119                 <div class="wpf_welcome_image"><img alt="" src="<?php echo WPF_PLUGIN_URL.'images/WPF-welcome_720.png'; ?>"/></div>
    120                 <div class="wpf_welcome_note"><?php esc_attr_e( 'Please click on the', 'atarim-visual-collaboration' ); ?> <u onclick="location.href='admin.php?page=collaboration_page_permissions'"><?php esc_attr_e( 'Permissions tab', 'atarim-visual-collaboration' ); ?></u> <?php esc_attr_e( 'and verify your license to start using the plugin', 'atarim-visual-collaboration' ); ?></div>
    121             </div>
    122         </div>
    123         <?php } ?>
    124         <div class="wpf_section_title">
    125             <?php esc_attr_e( 'Tasks Center', 'atarim-visual-collaboration' ); ?>
    126             <div class="wpf_report_buttons">
    127                 <span class="wpf_search_box">
    128                     <i class="gg-search"></i>
    129                     <input onchange="wp_feedback_filter()" type="text" name="wpf_search_title" class="wpf_search_title" value="" id="wpf_search_title" placeholder="<?php esc_attr_e( 'Search by task title', 'atarim-visual-collaboration' ); ?>">
    130                 </span>
    131                 <span id="wpf_back_report_sent_span" class="wpf_hide text-success"><?php esc_attr_e( 'Your report was sent', 'atarim-visual-collaboration' ); ?></span>
    132                 <span id="wpf_restore_orphan_tasks_span" class="wpf_hide text-success"><?php esc_attr_e( 'All Orphan tasks are restored', 'atarim-visual-collaboration' ); ?></span>
    133                 <span id="wpf_no_orphan_tasks_span" class="wpf_hide text-success"><?php esc_attr_e( 'There are no Orphan tasks', 'atarim-visual-collaboration' ); ?></span>
    134                 <?php
    135                     if ( $wpf_daily_report == 'yes' ) {
    136                         ?>
    137                         <a href="javascript:wpf_send_report('daily_report')">
    138                             <i class="gg-mail"></i> <?php esc_attr_e( 'Daily Report', 'atarim-visual-collaboration' ); ?>
    139                         </a>
    140                         <?php
    141                     }
    142                     if ( $wpf_weekly_report == 'yes' ) {
    143                         ?>
    144                         <a href="javascript:wpf_send_report('weekly_report')">
    145                             <i class="gg-mail"></i> <?php esc_attr_e( 'Weekly Report', 'atarim-visual-collaboration' ); ?>
    146                         </a>
    147                         <?php
    148                     }
    149                  ?>
    150                 <a href="javascript:wpf_restore_orphan()">
    151                     <i class="gg-sync"></i> <?php esc_attr_e( 'Restore Orphan Tasks', 'atarim-visual-collaboration' ); ?>
    152                 </a>
    153             </div>
    154         </div>
    155         <div class="wpf_flex_wrap">
    156             <div class="wpf_filter_col wpf_gen_col">
    157                 <div class="wpf_filter_status wpf_icon_box">
    158                     <div class="wpf_title"><?php esc_attr_e( 'Filter Tasks', 'atarim-visual-collaboration' ); ?></div>
    159                     <form method="post" action="#" id="wpf_filter_form">
    160                         <div class="wpf_task_status_title wpf_icon_title"><i class="gg-screen"></i> <?php esc_attr_e( 'Task Types', 'atarim-visual-collaboration' ); ?></div>
    161                          <div>
    162                             <ul class="wp_feedback_filter_checkbox task_type">
    163                                 <li><input onclick="wp_feedback_filter()" type="checkbox" name="task_types_meta" value="general" class="wp_feedback_task_type" id="wpf_task_type_general"><label for="wpf_task_type_general"><?php esc_attr_e( 'General', 'atarim-visual-collaboration' ); ?></label></li>                               
    164                                 <li><input onclick="wp_feedback_filter()" type="checkbox" name="task_types" value="wpf_admin" class="wp_feedback_task_type" id="wpf_task_type_admin"><label for="wpf_task_type_admin"><?php esc_attr_e( 'Admin', 'atarim-visual-collaboration' ); ?></label></li>
    165                                 <li><input onclick="wp_feedback_filter()" type="checkbox" name="task_types" value="publish" class="wp_feedback_task_type" id="wpf_task_type_page"><label for="wpf_task_type_page"><?php esc_attr_e( 'Page', 'atarim-visual-collaboration' ); ?></label></li>
    166                                 <li><input onclick="wp_feedback_filter()" type="checkbox" name="task_types_meta" value="email" class="wp_feedback_task_type" id="wpf_task_type_email"><label for="wpf_task_type_email"><?php esc_attr_e( 'Email', 'atarim-visual-collaboration' ); ?></label></li>
    167                                 <li><input onclick="wp_feedback_filter()" type="checkbox" name="task_types_meta" value="internal" class="wp_feedback_task_type" id="wpf_task_type_internal"><label for="wpf_task_type_internal"><?php esc_attr_e( 'Internal', 'atarim-visual-collaboration' ); ?></label></li>
    168                             </ul>
    169                         </div>
    170                         <div class="wpf_task_status_title wpf_icon_title"><?php echo get_wpf_status_icon(); ?><?php esc_attr_e( 'Task Status', 'atarim-visual-collaboration' ); ?></div>
    171                         <input type="hidden" name="page" value="collaboration_page_settings">
    172                         <div><?php echo wp_feedback_get_texonomy( 'task_status' ); ?></div>
    173                         <div class="wpf_task_priority_title wpf_icon_title"><?php echo get_wpf_priority_icon(); ?><?php esc_attr_e( 'Task Urgency', 'atarim-visual-collaboration' ); ?></div>
    174                         <div><?php echo wp_feedback_get_texonomy( 'task_priority' ); ?></div>
    175                         <div class="wpf_user_title wpf_icon_title"><?php echo get_wpf_user_icon();?> <?php esc_attr_e( 'By Users', 'atarim-visual-collaboration' ); ?></div>
    176                         <div><?php echo do_shortcode('[wpf_user_list]'); ?></div>
    177                     </form>
    178                 </div>
    179             </div>
    180             <div class="wpf_loader_admin hidden"></div>
    181             <div class="wpf_tasks_col wpf_gen_col">
    182                 <div class="wpf_top_found">
    183                     <div class="wpf_title" id="wpf_task_tab_title"><?php esc_attr_e( 'Tasks Found', 'atarim-visual-collaboration' ); ?></div>
    184                     <a href="javascript:wpf_general_comment();" title="Click to give your feedback!" data-placement="left" class="wpf_general_comment_btn" id="wpf_add_general_task"><i class="gg-add"></i> <?php esc_attr_e( 'General', 'atarim-visual-collaboration' ); ?></a>
    185                     <div class="wpf_display_all_taskmeta_div"></div>
    186                 </div>
    187                 <div class="wpf_tasks_tabs_wrap">
    188                     <label><input type="checkbox" name="wpf_task_bulk_tab" class="wpf_task_bulk_tab" id="wpf_task_bulk_tab" onclick="wpf_tasks_tabs('bulk')" /><?php esc_attr_e( 'Bulk Action', 'atarim-visual-collaboration' ); ?></label>
    189                 </div>
    190                 <div id="wpf_bulk_select_task_checkbox" style="display: none;">
    191                     <label><input type="checkbox" name="wpf_select_all_task" id="wpf_select_all_task" class="wpf_select_all_task"><?php esc_attr_e( 'Edit All', 'atarim-visual-collaboration' ); ?></label>
    192                 </div>
    193                 <?php
    194                 $tasks = wpfeedback_get_post_list();
    195                 ?>
    196                 <div class="wpf_tasks-list">
    197                     <?php echo $tasks[0]; ?>
    198                     <div class="wpf_loading">Loading...</div>
    199                 </div>
    200             </div>
    201             <div class="wpf_chat_col wpf_gen_col" id="wpf_task_details">
    202                 <div class="wpf_chat_top">
    203                     <div class="wpf_task_num_top"></div>
    204                     <div class="wpf_task_main_top">
    205                         <div class="wpf_task_title_top"></div>
    206                         <a href="javascript:void(0)" onclick="wpf_edit_title()" id="wpf_edit_title"><i class="gg-pen"></i></a>
    207                         <div id="wpf_edit_title_box" class="wpf_hide">
    208                             <input type="text" name="wpf_edit_title" value="" id="wpf_title_val" >
    209                             <button id="wpf_title_update_btn" onclick="wpf_update_title()" class="submit wpf_button submit"><i class="gg-check"></i></button>
    210                         </div>
    211                         <div class="wpf_task_details_top"></div>
    212                     </div>
    213                     <a href="#" id="wpfb_attr_task_page_link" target="_blank" class="wpf_button"><i class="gg-external"></i>
    214                         <input type="button" name="wp_feedback_task_page" class="wpf_button_inner" value="<?php esc_attr_e( 'Open Task Page', 'atarim-visual-collaboration' ); ?>"></a>
    215                 </div>             
    216                 <?php
    217                 if ( $tasks == '<div class="wpf_no_tasks_found"><i class="gg-info"></i> No tasks found</div>' ) {
    218                     ?>
    219                     <div class="wpf_chat_box" id="wpf_message_content">
    220                         <p class="wpf_no_task_message"><b><?php esc_attr_e( 'No Tasks found.', 'atarim-visual-collaboration' ); ?></b><br/>
    221                     </div>
    222                     <?php
    223                 } else {
    224                     ?>
    225                     <div class="wpf_chat_box" id="wpf_message_content">
    226                         <ul id="wpf_message_list"></ul>
    227                     </div>
    228                 <?php } ?>
    229                 <div class="wpf_chat_reply" id="wpf_message_form"></div>
    230             </div>
    231             <div class="wpf_attributes_col wpf_gen_col" id="wpf_attributes_content">
    232                 <div class="wpf_task_attr wpf_task_title">
    233                     <div class="wpf_title"><?php esc_attr_e( 'Task Attributes', 'atarim-visual-collaboration' ); ?></div>
    234                     <div class="wpf_icon_title at_fill_color at_att_screenshot"><?php echo get_wpf_screenshot_icon(); ?><?php esc_attr_e( 'Auto Screenshot', 'atarim-visual-collaboration' ); ?></div>
    235                     <a href="#" id="wpf_task_screenshot_link" target="_blank">
    236                         <img src="" id="wpf_task_screenshot" alt="task screenshot">
    237                     </a>
    238                 </div>
    239                 <div class="wpf_task_attr wpf_task_page">
    240                 <?php
    241                 if ( $wpf_tab_permission_information == 'yes' ) {
    242                     ?>
    243                     <div class="wpf_icon_title at_fill_color at_att_info"><?php echo get_wpf_info_icon(); ?><?php esc_attr_e( 'Additional Information', 'atarim-visual-collaboration' ); ?></div>
    244                     <div id="additional_information"></div>
    245                 <?php } ?>
    246                 </div>
    247                 <div class="wpf_task_attr">
    248                     <?php
    249                     if ( $wpf_user_type == 'advisor' ) {
    250                         ?>
    251                         <div class="wpf_task_tags">
    252                             <div class="wpf_icon_title at_fill_color at_att_tags"><i class="gg-tag"></i> <?php esc_attr_e( 'Custom Tags', 'atarim-visual-collaboration' ); ?></div>
    253                             <div class="wpf_tag_autocomplete">
    254                                 <input type="text" name="wpfeedback_tags" class="wpf_tag" value="" id="wpf_tags" onkeydown="wpf_search_tags(this)" >
    255                                 <button class="wpf_tag_submit_btn" onclick="wpf_add_tag_admin(this)"><i class="gg-corner-down-left"></i></button>
    256                             </div>
    257                             <div id="all_tag_list"></div>
    258                         </div>
    259                     <?php } ?>
    260                     <?php
    261                     if ( $wpf_tab_permission_status == 'yes' ) {
    262                         ?>
    263                         <div class="wpf_task_status at_fill_color at_att_status">
    264                             <div class="wpf_icon_title"><?php echo get_wpf_status_icon(); ?> <?php esc_attr_e( 'Task Status', 'atarim-visual-collaboration' ); ?></div>
    265                             <?php echo wp_feedback_get_texonomy_selectbox( 'task_status' ); ?>
    266                         </div>
    267                     <?php } ?>
    268                     <?php
    269                     if ( $wpf_tab_permission_priority == 'yes' ) {
    270                         ?>
    271                         <div class="wpf_task_urgency at_fill_color at_att_priority">
    272                             <div class="wpf_icon_title"><?php echo get_wpf_priority_icon(); ?> <?php esc_attr_e( 'Task Urgency', 'atarim-visual-collaboration' ); ?></div>
    273                             <?php echo wp_feedback_get_texonomy_selectbox( 'task_priority' ); ?>
    274                         </div>
    275                     <?php } ?>
    276                     <?php
    277                     if ( $wpf_tab_permission_delete_task == 'yes' ) {
    278                         ?>
    279                         <div class="wpf_task_attr wpf_task_title" id="wpf_delete_task_container"></div>
    280                         <?php
    281                     } else {
    282                         ?>
    283                         <div class="wpf_task_attr wpf_task_title" id="wpf_delete_task_container"></div>
    284                     <?php } ?>
    285                 </div>
    286                 <div class="wpf_task_attr wpf_task_users at_att_users">
    287                     <?php
    288                     if ( $wpf_tab_permission_user == 'yes' ) {
    289                         ?>
    290                         <div class="wpf_icon_title"><?php echo get_wpf_user_icon();?> <?php esc_attr_e( 'Notify Users', 'atarim-visual-collaboration' ); ?></div>
    291                         <div class="wpf_att_users"><?php echo do_shortcode('[wpf_user_list_task]'); ?></div>
    292                     <?php } ?>
    293                 </div>
    294             </div>
    295             <div class="wpf_bulk_update_col wpf_gen_col" id="wpf_bulk_update_content" style="display: none;">
    296                 <div class="wpf_task_options">
    297                     <div class="wpf_task_status">
    298                         <div class="wpf_icon_title"><?php echo get_wpf_status_icon(); ?> <?php esc_attr_e( 'Task Status', 'atarim-visual-collaboration' ); ?></div>
    299                         <?php echo wpf_bulk_update_get_texonomy_selectbox( 'task_status' ); ?>
    300                     </div>
    301                     <div class="wpf_task_urgency">
    302                         <div class="wpf_icon_title"><?php echo get_wpf_priority_icon();?> <?php esc_attr_e( 'Task Urgency', 'atarim-visual-collaboration' ); ?></div>
    303                         <?php echo wpf_bulk_update_get_texonomy_selectbox( 'task_priority' ); ?>
    304                     </div>
    305                     <div class="wpf_task_attr wpf_task_title" id="wpf_bulk_delete_task_container">
    306                         <a href="javascript:void(0)" class="wpf_bulk_task_delete_btn">
    307                             <i class="gg-trash"></i> <?php esc_attr_e( 'Delete ticket','atarim-visual-collaboration' ); ?>
    308                         </a>
    309                         <p class="wpf_hide" id="wpf_bulk_task_delete"><?php esc_attr_e( 'Are you sure you want to delete?', 'atarim-visual-collaboration' ); ?> <a href="javascript:void(0);" class="wpf_bulk_task_delete">Yes</a></p>
    310                     </div>
    311                     <input type="button" value="<?php esc_attr_e( 'Save Bulk Changes', 'atarim-visual-collaboration' ); ?>" class="wpf_button" onclick="wpf_bulk_update()">
    312                 </div>
    313             </div>
    314         </div>
    315     </div>
    316 
    317     <!-- ================= SETTINGS PAGE ================-->
    318     <?php
    31994    if ( $wpf_user_type == 'advisor' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) {
    32095        ?>
    321         <div id="wpf_settings" class="wpf_container" style="display:none">
     96        <div id="wpf_settings" class="wpf_container">
    32297            <div class="wpf_loader_admin hidden"></div>
    32398            <div id="wpf_global_settings_overlay" <?php if ( get_site_data_by_key( 'wpf_global_settings' ) != 'yes' ) { echo "class='wpf_hide'"; } ?> >
     
    573348        </div>
    574349    <?php } ?>
    575     <!-- ================= ADD-ONS PAGE ================-->
    576     <?php if ( $wpf_user_type == 'advisor' || $wpf_user_type == 'king' || ( $wpf_user_type == '' && current_user_can( 'administrator' ) ) ) { ?>
    577         <div id="wpf_addons" class="wpf_container" style="display:none">
    578             <div class="wpf_inner_container wpf_integrations_container">
    579                 <div class="wpf_integration_content">
    580                     <div class="wpf_integration_title"><?php esc_attr_e( 'Connect Atarim To Your Existing Workflow', 'atarim-visual-collaboration' ); ?></div>
    581                     <p><?php esc_attr_e( 'Integrate Atarim into your existing workflow using native integrations, webhooks & APIs', 'atarim-visual-collaboration' ); ?></p>
    582                     <a href="https://atarim.io/integrations/" target="_blank" class="wpf_integration_button"><?php esc_attr_e( 'Explore Integrations', 'atarim-visual-collaboration' ); ?></a>
    583                 </div>
    584                 <a href="https://atarim.io/integrations/" target="_blank"><img alt="Atarim Integrations" class="wpf_integration_image" src="<?php echo WPF_PLUGIN_URL . 'images/integrations-image.png'; ?>"/></a>
    585             </div>
    586         </div>
    587     <?php }
    588     echo "<script>var wpf_orphan_tasks=" . wp_json_encode( $tasks[1] ) . ";</script>";
    589 ?>
     350</div>
  • atarim-visual-collaboration/trunk/inc/admin/wpf_admin_function.php

    r3133163 r3138174  
    363363            }
    364364
    365             $wpf_exclude_page = array( "wp-feedback_page_collaboration_page_tasks", "wp-feedback_page_collaboration_page_settings", "wp-feedback_page_collaboration_page_permissions", "wp-feedback_page_collaboration_page_support" );
     365            $wpf_exclude_page = array( "wp-feedback_page_collaboration_task_center", "wp-feedback_page_collaboration_page_settings", "wp-feedback_page_collaboration_page_permissions" );
    366366            if ( $enabled_wpfeedback == 1 && $wpf_allow_backend_commenting != 'yes' && ( ! $is_site_archived ) ) {
    367367                if ( ! in_array( $wpf_current_screen_id, $wpf_exclude_page ) ) {
  • atarim-visual-collaboration/trunk/inc/wpf_ajax_functions.php

    r3133163 r3138174  
    806806                'wpf_site_id'      => get_option( 'wpf_site_id' ),
    807807                'url'              => WPF_HOME_URL,
    808                 'task_types'       => ['general','email','page'],
     808                'task_types'       => [],
    809809                'sort'             => ['task_title', 'created_at'],
    810810                'sort_by'          => 'asc',
     
    818818                'wpf_site_id'        => get_option( 'wpf_site_id' ),
    819819                'wpf_current_screen' => $current_screen,
    820                 'task_types'         => ['general','page'],
    821                 "sort"               =>  ["task_title", "created_at"],
     820                'task_types'         => [],
     821                "sort"               => ["task_title", "created_at"],
    822822                "sort_by"            => "asc",
    823823                'url'                => WPF_HOME_URL,
     
    13301330add_action( 'wp_ajax_wpfb_delete_task_image', 'wpfb_delete_task_image' );
    13311331add_action( 'wp_ajax_nopriv_wpfb_delete_task_image', 'wpfb_delete_task_image' );
     1332
     1333/*
     1334 * This function is used to upload the files for the task. This function is used on Backend Tasks Center.
     1335 *
     1336 * @input Array ( $_POST and $_FILES)
     1337 * @return JSON
     1338 */
     1339if ( ! function_exists( 'wpf_upload_file' ) ) {
     1340    function wpf_upload_file() {
     1341        global $wpdb, $current_user;
     1342        wpf_security_check();
     1343        if ( $current_user->ID == 0 ) {
     1344            $user_id = get_site_data_by_key( 'wpf_website_client' );
     1345        } else {
     1346            $user_id = $current_user->ID;
     1347        }
     1348        $user_name = $current_user->display_name;
     1349
     1350        $wpf_taskid = sanitize_text_field( $_POST['wpf_taskid'] );
     1351        if ( ! empty( $_FILES ) ) {
     1352            foreach ( $_FILES as $file ) {
     1353                if ( is_array( $file ) ) {
     1354                    $wpf_allowed_filetypes = array( "jpg", "jpeg", "png", "gif", "pdf", "doc", "docx", "xlsx", "xls", "mp4", "webm", "mov", "wmv", "avi", "ttf", "txt", "psd", "svg" );
     1355                    $temp_wpf_file_name    = $_FILES["wpf_upload_file"]["name"];
     1356                    $temp_wpf_file_type    = $_FILES["wpf_upload_file"]["type"];
     1357                    $tmp_f                 = explode( ".", $temp_wpf_file_name );
     1358                    $temp_wpf_file_ext     = strtolower( end( $tmp_f ) );
     1359                    $fname                 = explode( ".", $temp_wpf_file_name );
     1360                    $temp_name             = $_FILES['wpf_upload_file']['tmp_name'];
     1361                    $data                  = file_get_contents( $temp_name );
     1362                    if ( $temp_wpf_file_ext == 'xlsx' || $temp_wpf_file_ext == 'xls' || $temp_wpf_file_ext == 'docx' || $temp_wpf_file_ext == 'doc' || $temp_wpf_file_ext == 'avi' || $temp_wpf_file_ext = "psd" ) {
     1363                        $invalid = 0;
     1364                    } else {
     1365                        $invalid = wpf_verify_file_upload( $_SERVER, $data );
     1366                        $invalid = wpf_verify_file_upload_type( $_SERVER, $temp_wpf_file_type );
     1367                    }
     1368
     1369                    $file_path = '';
     1370                    if ( $invalid == 0 ) {
     1371                        if ( ! in_array( $temp_wpf_file_ext, $wpf_allowed_filetypes ) ) {
     1372                            $invalid = 1;
     1373                        }
     1374                    }
     1375
     1376                    if ( $invalid == 0 ) {
     1377                        $file_type = 0;
     1378                        if ( in_array( $temp_wpf_file_type, array( 'image/jpeg', 'image/png', 'image/gif' ) ) ) {
     1379                            $file_type = 1;
     1380                        } else {
     1381                            $file_type = 2;
     1382                        }
     1383
     1384                        $file                    = $_FILES['wpf_upload_file'];
     1385                        $base64_image            = 'data:' . $temp_wpf_file_type . ';base64,' . base64_encode( $data );
     1386                        $args                    = [];
     1387                        $args['task_id']         = $wpf_taskid;
     1388                        $args['comment_content'] = $base64_image;
     1389                        $args['user_id']         = "";
     1390                        $args['wpf_user_id']     = $user_id;
     1391                        $args['file_upload']     = ! empty( $_FILES['wpf_upload_file'] ) ? 1 : 0;
     1392                        $args['file_name']       = str_replace( ' ', '_', trim( $fname[0] ) );
     1393                        $args['type']            = $temp_wpf_file_type;
     1394                        $url                     = WPF_CRM_API . 'wp-api/comment/create';
     1395                        $sendtocloud             = json_encode( $args );
     1396                        $res                     = wpf_send_remote_post( $url, $sendtocloud );
     1397
     1398                        if ( $res['status'] == 200 ) {
     1399                            $response = array(
     1400                                'status'     => 1,
     1401                                'type'       => $file_type,
     1402                                'message'    => $res['data']['comment_content'],
     1403                                'comment_id' => $res['data']['id'],
     1404                                'author'     => $user_name,
     1405                            );
     1406                        } else {
     1407                            $response = array(
     1408                                'status'  => 0,
     1409                                'message' => 'invalid'
     1410                            );
     1411                        }
     1412                        echo json_encode( $response );
     1413                        die();
     1414                    } else {
     1415                        $response = array(
     1416                            'status'  => 0,
     1417                            'message' => 'invalid'
     1418                        );
     1419                    }
     1420                }
     1421            }
     1422        }
     1423        echo json_encode( $response );
     1424        die();
     1425    }
     1426}
     1427add_action( 'wp_ajax_wpf_upload_file', 'wpf_upload_file' );
     1428add_action( 'wp_ajax_nopriv_wpf_upload_file', 'wpf_upload_file' );
    13321429
    13331430/*
  • atarim-visual-collaboration/trunk/inc/wpf_function.php

    r3133163 r3138174  
    23662366        $wpf_current_screen = get_current_screen();
    23672367        $wpf_current_screen = $wpf_current_screen->id;
    2368         if ( $wpf_current_screen == 'collaborate_page_collaboration_page_permissions' || $wpf_current_screen == 'collaborate_page_collaboration_page_settings' || $wpf_current_screen == 'toplevel_page_collaboration_page_tasks' || $wpf_current_screen == 'collaborate_page_collaboration_page_integrate' ) {
     2368        if ( $wpf_current_screen == 'collaborate_page_collaboration_page_permissions' || $wpf_current_screen == 'collaborate_page_collaboration_page_settings' || $wpf_current_screen == 'toplevel_page_collaboration_task_center' ) {
    23692369            return true;
    23702370        }
  • atarim-visual-collaboration/trunk/js/admin.js

    r3133163 r3138174  
    326326    }
    327327});
    328 
    329 function opensettingTab(wpfTab) {
    330     var i;
    331     var x = document.getElementsByClassName("wpf_container");
    332     for (i = 0; i < x.length; i++) {
    333         x[i].style.display = "none";
    334     }
    335     document.getElementById(wpfTab).style.display = "block";
    336 }
    337 
    338 /*Showing active tab*/
    339 var btnContainer = document.getElementById("wpf_tabs_container");
    340 if(btnContainer!=null){
    341     var btns = btnContainer.getElementsByClassName("wpf_tab_item");
    342     for (var i = 0; i < btns.length; i++) {
    343         btns[i].addEventListener("click", function () {
    344             var current = document.getElementsByClassName("active");
    345             current[0].className = current[0].className.replace(" active", "");
    346             this.className += " active";
    347         });
    348     }
    349 }
    350328
    351329/*Reset Setting*/
  • atarim-visual-collaboration/trunk/js/wpf_common_functions.js

    r3133163 r3138174  
    28592859jQuery_WPF('.wpf_sidebar_left').on('click', function() {
    28602860    jQuery_WPF(this).toggleClass('down');
    2861     jQuery_WPF('.sidebar_open').toggleClass('left30');
    28622861});
    28632862jQuery_WPF('.wpf_task_tab').on('click', function() {
     
    29862985            parentSelector += ":eq(" + position + ")";
    29872986        }
    2988         area = 'body > :not(' + parentSelector + ')';
     2987        area = 'body > ' + parentSelector + ' > :not(' + not_comment_cursor + ')';
    29892988    }
    29902989}
     
    41984197// Hide sidebar on small device by Pratap.
    41994198jQuery_WPF(document).on('click', '.wpf_hide_sidebar', function() {
    4200     jQuery_WPF('.wpf_sidebar_container.sidebar_open').animate({'right': '-300px'});
    4201 });
     4199    jQuery_WPF('.wpf_sidebar_container').animate({'right': '-300px'});
     4200});
  • atarim-visual-collaboration/trunk/readme.txt

    r3133163 r3138174  
    44Requires at least: 5.0
    55Tested up to: 6.6
    6 Stable tag: 4.0.3
     6Stable tag: 4.0.4
    77Requires PHP: 7.4
    88License: GPLv3 or later
     
    375375
    376376== Changelog ==
     377
     378= 4.0.4 =
     379* **Task Center Attachment Issue** - Fixed issue with uploading attachments in the task center.
     380* **Elementor Compatibility** - Added support for the latest Elementor structure changes to the collaboration tool.
     381* **Menu Cleanup** - Removed unnecessary plugin menus: Integration and Support.
     382* **Responsive Sidebar Issue** - Fixed issue with closing the sidebar in responsive mode.
     383* **Frontend Task Loading Issue** - Fixed issue with tasks not loading on the frontend for some projects.
     384* **Performance Optimization** - Optimized plugin setting code to enhance performance and speed.
    377385
    378386= 4.0.3 =
Note: See TracChangeset for help on using the changeset viewer.