/**
  * Draws table rows for ajax call
  *
  *
  * @since 0.1
  *
  */
 static function ajax_table_rows($wp_settings = false)
 {
     include WP_CRM_Path . '/core/class_user_list_table.php';
     //** Get the paramters we care about */
     $sEcho = $_REQUEST['sEcho'];
     $per_page = $_REQUEST['iDisplayLength'];
     $iDisplayStart = $_REQUEST['iDisplayStart'];
     $iColumns = $_REQUEST['iColumns'];
     //** Parse the serialized filters array */
     parse_str($_REQUEST['wp_crm_filter_vars'], $wp_crm_filter_vars);
     $wp_crm_search = $wp_crm_filter_vars['wp_crm_search'];
     //* Init table object */
     $wp_list_table = new CRM_User_List_Table("ajax=true&per_page={$per_page}&iDisplayStart={$iDisplayStart}&iColumns={$iColumns}");
     $wp_list_table->prepare_items($wp_crm_search);
     if ($wp_list_table->has_items()) {
         foreach ($wp_list_table->items as $count => $item) {
             $data[] = $wp_list_table->single_row($item);
         }
     } else {
         $data[] = $wp_list_table->no_items();
     }
     return json_encode(array('sEcho' => $sEcho, 'iTotalRecords' => count($wp_list_table->all_items), 'iTotalDisplayRecords' => count($wp_list_table->all_items), 'user_ids' => $wp_list_table->user_ids, 'page_user_ids' => $wp_list_table->page_user_ids, 'aaData' => $data));
 }
Beispiel #2
0
 /**
  * Draws table rows for ajax call
  *
  *
  * @since 0.1
  *
  */
 static function ajax_table_rows($wp_settings = false)
 {
     global $wp_crm;
     include WP_CRM_Path . '/core/class_user_list_table.php';
     //** Get the paramters we care about */
     $sEcho = $_REQUEST['sEcho'];
     $per_page = $_REQUEST['iDisplayLength'];
     $iDisplayStart = $_REQUEST['iDisplayStart'];
     $iColumns = $_REQUEST['iColumns'];
     //** */
     $args = array();
     if (!empty($_REQUEST['sSortDir_0'])) {
         $args['sort_order'] = $_REQUEST['sSortDir_0'];
     }
     if ((!empty($_REQUEST['iSortCol_0']) || $_REQUEST['iSortCol_0'] == '0') && !empty($_REQUEST['sColumns'])) {
         $sColumns = explode(',', $_REQUEST['sColumns']);
         if (!empty($sColumns[$_REQUEST['iSortCol_0']])) {
             $order_by = $sColumns[$_REQUEST['iSortCol_0']];
             $order_by = str_replace('wp_crm_', '', $order_by);
             if (key_exists($order_by, $wp_crm['data_structure']['attributes'])) {
                 $args['order_by'] = $order_by;
             }
         }
     }
     //** Parse the serialized filters array */
     parse_str($_REQUEST['wp_crm_filter_vars'], $wp_crm_filter_vars);
     $wp_crm_search = $wp_crm_filter_vars['wp_crm_search'];
     //* Init table object */
     $wp_list_table = new CRM_User_List_Table("ajax=true&per_page={$per_page}&iDisplayStart={$iDisplayStart}&iColumns={$iColumns}");
     $wp_list_table->prepare_items($wp_crm_search, $args);
     if ($wp_list_table->has_items()) {
         foreach ($wp_list_table->items as $count => $item) {
             $data[] = $wp_list_table->single_row($item);
         }
     } else {
         $data[] = $wp_list_table->no_items();
     }
     return json_encode(array('sEcho' => $sEcho, 'iTotalRecords' => count($wp_list_table->all_items), 'iTotalDisplayRecords' => count($wp_list_table->all_items), 'user_ids' => $wp_list_table->user_ids, 'page_user_ids' => $wp_list_table->page_user_ids, 'aaData' => $data));
 }
Beispiel #3
0
<?php

if (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'user_deleted') {
    WP_CRM_F::add_message(__('User has been deleted and all associated posts have been trashed.', ud_get_wp_crm()->domain));
}
if (!empty($_REQUEST['message']) && $_REQUEST['message'] == 'plugin_updated') {
    WP_CRM_F::add_message(__('WP-CRM has been updated.', ud_get_wp_crm()->domain));
}
include ud_get_wp_crm()->path("lib/class_user_list_table.php", 'dir');
$wp_list_table = new CRM_User_List_Table("per_page=25");
$wp_list_table->prepare_items();
$wp_list_table->data_tables_script();
?>
<div class="wp_crm_overview_wrapper wrap">
<div class="wp_crm_ajax_result"></div>
    <?php 
screen_icon();
?>
    <h2><?php 
_e('CRM - All People', ud_get_wp_crm()->domain);
?>
 <?php 
if (current_user_can('WP-CRM: View Profiles') && (current_user_can('create_users') || current_user_can('add_users'))) {
    ?>
<a href="<?php 
    echo admin_url('admin.php?page=wp_crm_add_new');
    ?>
" class="button add-new-h2"><?php 
    _e('Add New', ud_get_wp_crm()->domain);
    ?>
</a><?php