예제 #1
0
 public function enable_table_sorting($options)
 {
     if (class_exists('module_table_sort', false)) {
         if (count($this->extra_fields)) {
             foreach ($this->extra_fields as $extra) {
                 if ($extra['type'] && $extra['owner_id']) {
                     $options['sortable']['extra_' . $extra['type']] = array('extra_sort' => true, 'owner_table' => $extra['type'], 'owner_id' => $extra['owner_id']);
                 }
             }
         }
         module_table_sort::enable_pagination_hook($options);
     }
 }
예제 #2
0
 public static function enable_pagination_hook($sort_data = array())
 {
     if (get_display_mode() != 'mobile') {
         foreach ($sort_data['sortable'] as $column_id => $options) {
             if (isset($options['extra_sort']) && $options['extra_sort'] && $options['owner_table']) {
                 // find all the visible extra fields for this item and add sorting buttons to them.
                 $defaults = module_extra::get_defaults($options['owner_table']);
                 $column_headers = array();
                 foreach ($defaults as $default) {
                     if (isset($default['display_type']) && $default['display_type'] == _EXTRA_DISPLAY_TYPE_COLUMN) {
                         $column_headers[$default['key']] = $default;
                     }
                 }
                 unset($sort_data['sortable'][$column_id]);
                 foreach ($column_headers as $column_header) {
                     $sort_data['sortable']['extra_header_' . $column_header['extra_default_id']] = array('extra_sort' => true, 'field' => $column_header['key'], 'default_field_id' => $column_header['extra_default_id'], 'owner_table' => $options['owner_table'], 'owner_id' => $options['owner_id'], 'field_type' => isset($column_header['field_type']) ? $column_header['field_type'] : false);
                 }
             }
         }
         self::$table_sort_options = $sort_data;
     }
 }
예제 #3
0
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!module_statistic::can_i('view', 'Staff Report')) {
    redirect_browser(_BASE_HREF);
}
$page_title = _l('Staff Report');
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : array('date_from' => print_date(date('Y-m-d', strtotime('-1 month'))), 'date_to' => print_date(date('Y-m-d')));
$staff_reports = module_statistic::get_statistics_staff($search);
if (class_exists('module_table_sort', false)) {
    module_table_sort::enable_pagination_hook(array('table_id' => 'statistic_list', 'sortable' => array('sort_date' => array('field' => 'transaction_date', 'current' => 2), 'sort_name' => array('field' => 'name'), 'sort_credit' => array('field' => 'credit'), 'sort_debit' => array('field' => 'debit'))));
}
/*

// hack to add a "export" option to the pagination results.
if(class_exists('module_import_export',false) && module_statistic::can_i('view','Export Statistic')){
    module_import_export::enable_pagination_hook(
    // what fields do we pass to the import_export module from this customers?
        array(
            'name' => 'Statistic Export',
            'parent_form' => 'statistic_form',
            'fields'=>array(
                'Date' => 'transaction_date',
                'Name' => 'name',
                'URL' => 'url',
                'Description' => 'description',
예제 #4
0
if (isset($_REQUEST['customer_id'])) {
    $search['customer_id'] = $_REQUEST['customer_id'];
}
if (!isset($search['completed'])) {
    $search['completed'] = module_config::c('quote_search_completed_default', 1);
}
$quotes = module_quote::get_quotes($search);
if (class_exists('module_table_sort', false)) {
    // get full quote data.
    // todo: only grab data if we're sorting by something
    // that isn't in the default invoice listing.
    foreach ($quotes as $quote_id => $quote) {
        $quotes[$quote_id] = array_merge($quote, module_quote::get_quote($quote['quote_id']));
        $quotes[$quote_id]['website_name'] = $quote['website_name'];
    }
    module_table_sort::enable_pagination_hook(array('table_id' => 'quote_list', 'sortable' => array('quote_title' => array('field' => 'name', 'current' => 1), 'quote_start_date' => array('field' => 'date_create'), 'quote_completed_date' => array('field' => 'date_approved'), 'quote_website' => array('field' => 'website_name'), 'quote_customer' => array('field' => 'customer_name'), 'quote_type' => array('field' => 'type'), 'quote_status' => array('field' => 'status'), 'quote_progress' => array('field' => 'total_percent_complete'), 'quote_total' => array('field' => 'total_amount'), 'quote_total_amount_invoiced' => array('field' => 'total_amount_invoiced'), 'quote_group' => array('group_sort' => true, 'owner_table' => 'quote', 'owner_id' => 'quote_id'))));
}
// hack to add a "export" option to the pagination results.
if (class_exists('module_import_export', false) && module_quote::can_i('view', 'Export Quotes')) {
    module_import_export::enable_pagination_hook(array('name' => 'Quote Export', 'fields' => array('Quote ID' => 'quote_id', 'Quote Title' => 'name', 'Hourly Rate' => 'hourly_rate', 'Start Date' => 'date_create', 'Completed Date' => 'date_approved', module_config::c('project_name_single', 'Website') . ' Name' => 'website_name', 'Customer Name' => 'customer_name', 'Type' => 'type', 'Status' => 'status', 'Staff Member' => 'staff_member', 'Tax Name' => 'total_tax_name', 'Tax Percent' => 'total_tax_rate', 'Renewal Date' => 'date_renew'), 'extra' => array('owner_table' => 'quote', 'owner_id' => 'quote_id')));
}
$header = array('title' => _l('Customer Quotes'), 'main' => true, 'button' => array());
if (module_quote::can_i('create', 'Quotes')) {
    $header['button'][] = array('url' => module_quote::link_open('new'), 'title' => 'Add New Quote', 'type' => 'add');
}
if (class_exists('module_import_export', false) && module_quote::can_i('view', 'Import Quotes')) {
    $link = module_import_export::import_link(array('callback' => 'module_quote::handle_import', 'callback_preview' => 'module_quote::handle_import_row_debug', 'name' => 'Quotes', 'return_url' => $_SERVER['REQUEST_URI'], 'group' => 'quote', 'fields' => array('Quote Title' => 'name', 'Hourly Rate' => 'hourly_rate', 'Start Date' => 'date_create', 'Completed Date' => 'date_approved', module_config::c('project_name_single', 'Website') . ' Name' => 'website_name', 'Customer Name' => 'customer_name', 'Type' => 'type', 'Status' => 'status', 'Staff Member' => 'staff_member', 'Tax Name' => 'total_tax_name', 'Tax Percent' => 'total_tax_rate', 'Renewal Date' => 'date_renew'), 'extra' => array('owner_table' => 'quote', 'owner_id' => 'quote_id')));
    $header['button'][] = array('url' => $link, 'title' => 'Import Quotes', 'type' => 'add');
}
print_heading($header);
?>
예제 #5
0
    case 'total':
    default:
        $ticket_count = module_ticket::get_total_ticket_count();
        break;
}
if ($ticket_count > 0) {
    $module->page_title = _l('Tickets (%s)', $ticket_count);
} else {
    $module->page_title = _l('Tickets');
}
// hack to add a "group" option to the pagination results.
if (class_exists('module_group', false) && module_config::c('ticket_enable_groups', 1)) {
    module_group::enable_pagination_hook(array('fields' => array('owner_id' => 'ticket_id', 'owner_table' => 'ticket'), 'bulk_actions' => array('delete' => array('label' => 'Delete selected tickets', 'type' => 'delete', 'callback' => 'module_ticket::bulk_handle_delete'), 'unread' => array('label' => 'Mark selected tickets as unread', 'type' => 'button', 'callback' => 'module_ticket::bulk_handle_unread'), 'read' => array('label' => 'Mark selected tickets as read', 'type' => 'button', 'callback' => 'module_ticket::bulk_handle_read'), 'status_resolved' => array('label' => 'Change status to:', 'type' => 'form', 'callback' => 'module_ticket::bulk_handle_status', 'elements' => array(array('type' => 'select', 'name' => 'bulk_change_status_id', 'options' => module_ticket::get_statuses()))), 'change_assigned' => array('label' => 'Change Assigned:', 'type' => 'form', 'callback' => 'module_ticket::bulk_handle_staff_change', 'elements' => array(array('type' => 'select', 'name' => 'bulk_change_staff_id', 'options' => module_ticket::get_ticket_staff_rel(), 'blank' => _l(' - Unassigned - ')))))));
}
if (class_exists('module_table_sort', false)) {
    module_table_sort::enable_pagination_hook(array('table_id' => 'ticket_list', 'sortable' => array()));
}
/*module_form::enable_pagination_bulk_operations(
    array(
        'callback' => 'module_ticket::process_bulk_operation',
        'options' => array(
            'delete' => array(
                'label' => 'Delete selected tickets',
            ),
            'unread' => array(
                'label' => 'Mark selected tickets as unread',
            ),
            'read' => array(
                'label' => 'Mark selected tickets as read',
            ),
        ),
예제 #6
0
function process_pagination($rows, $per_page = 20, $page_number = 0, $table_id = 'table')
{
    $data = array();
    $data['rows'] = array();
    $data['links'] = '';
    if ($per_page !== false && $per_page <= 0) {
        $per_page = 20;
    }
    hook_handle_callback('pagination_hook_init');
    if (isset($GLOBALS['pagination_group_hack'])) {
        module_group::run_pagination_hook($rows);
    }
    if (isset($GLOBALS['pagination_import_export_hack'])) {
        module_import_export::run_pagination_hook($rows);
    }
    if (class_exists('module_table_sort', false)) {
        module_table_sort::run_pagination_hook($rows, $per_page);
    }
    $db_resource = false;
    if (is_resource($rows)) {
        // have the db handle for the sql query
        $db_resource = $rows;
        unset($rows);
        $total = mysql_num_rows($db_resource);
    } else {
        if (is_array($rows)) {
            // we have the rows in an array.
            $total = count($rows);
        } else {
            print_header_message();
            echo 'Pagination failed. Please try going to Settings > Update and click the Manual Update button. If that does not fix this error please report this bug.';
            exit;
        }
    }
    // pagination hooks
    ob_start();
    if ($total > 0) {
        // group hack addition
        hook_handle_callback('pagination_hook_display');
        if (isset($GLOBALS['pagination_group_hack']) && module_group::groups_enabled()) {
            module_group::display_pagination_hook();
        }
        if (get_display_mode() != 'mobile') {
            // export hack addition
            if (isset($GLOBALS['pagination_import_export_hack'])) {
                module_import_export::display_pagination_hook();
            }
            if (class_exists('module_table_sort', false)) {
                module_table_sort::display_pagination_hook($per_page);
            }
        }
    }
    $pagination_hooks = ob_get_clean();
    // default summary/links content
    ob_start();
    echo '<div class="pagination_summary"><p>';
    if ($total > 0) {
        _e('Showing records %s to %s of %s', $page_number * $per_page + 1, $total, $total);
        echo $pagination_hooks;
    } else {
        _e('No results found');
    }
    echo '</p></div>';
    $data['summary'] = ob_get_clean();
    ob_start();
    echo '<div class="pagination_links">';
    //echo "\n<p>";
    echo _l('Page %s of %s', 1, 1);
    //echo '</p>';
    echo '</div>';
    $data['links'] = ob_get_clean();
    $data['page_numbers'] = 1;
    if ($per_page === false || $total <= $per_page) {
        if ($db_resource) {
            $rows = array();
            //if($per_page !== false && $total<=$per_page){
            // pull out all records.
            while ($row = mysql_fetch_assoc($db_resource)) {
                $rows[] = $row;
            }
            if (mysql_num_rows($db_resource) > 0) {
                mysql_data_seek($db_resource, 0);
            }
            //}
        }
        $data['rows'] = $rows;
    } else {
        if (isset($_REQUEST['pg' . $table_id])) {
            $page_number = $_REQUEST['pg' . $table_id];
        }
        if ($table_id && $table_id != 'table' && $total > $per_page) {
            // we remember the last page number we were on.
            if (!isset($_SESSION['_table_page_num'])) {
                $_SESSION['_table_page_num'] = array();
            }
            if (!isset($_SESSION['_table_page_num'][$table_id])) {
                $_SESSION['_table_page_num'][$table_id] = array('total_count' => 0, 'page_number' => 0);
            }
            $_SESSION['_table_page_num'][$table_id]['total_count'] = $total;
            if (isset($_REQUEST['pg' . $table_id])) {
                $page_number = $_REQUEST['pg' . $table_id];
            } else {
                if ($_SESSION['_table_page_num'][$table_id]['total_count'] == $total) {
                    $page_number = $_SESSION['_table_page_num'][$table_id]['page_number'];
                }
            }
            $_SESSION['_table_page_num'][$table_id]['page_number'] = $page_number;
            //echo $table_id.' '.$total . ' '.$per_page.' '.$page_number; print_r($_SESSION['_table_page_num']);
        }
        $page_number = min(ceil($total / $per_page) - 1, $page_number);
        // slice up the result into the number of rows requested.
        if ($db_resource) {
            // do the the mysql way:
            mysql_data_seek($db_resource, $page_number * $per_page);
            $x = 0;
            while ($x < $per_page) {
                $row_data = mysql_fetch_assoc($db_resource);
                if ($row_data) {
                    $data['rows'][] = $row_data;
                }
                $x++;
            }
            unset($row_data);
        } else {
            // the old array way.
            $data['rows'] = array_slice($rows, $page_number * $per_page, $per_page);
        }
        $data['summary'] = '';
        $data['links'] = '';
        $request_uri = preg_replace('/[&?]pg' . preg_quote($table_id) . '=\\d+/', '', $_SERVER['REQUEST_URI']);
        $request_uri .= preg_match('/\\?/', $request_uri) ? '&' : '?';
        $request_uri = htmlspecialchars($request_uri);
        if (count($data['rows'])) {
            $page_count = ceil($total / $per_page);
            // group into ranges with cute little .... around the numbers if there's too many.
            $rangestart = max(0, $page_number - 5);
            $rangeend = min($page_count - 1, $page_number + 5);
            ob_start();
            echo '<div class="pagination_summary">';
            echo '<p>';
            _e('Showing records %s to %s of %s', $page_number * $per_page + 1, $page_number * $per_page + count($data['rows']), $total);
            //echo 'Showing records ' . (($page_number*$per_page)+1) . ' to ' . (($page_number*$per_page)+count($data['rows'])) .' of ' . $total . '</p>';
            echo $pagination_hooks;
            echo '</p>';
            echo '</div>';
            $data['summary'] = ob_get_clean();
            ob_start();
            echo '<div class="pagination_links">';
            //echo "\n<p>";
            echo '<span>';
            if ($page_number > 0) {
                ?>
			    <a href="<?php 
                echo $request_uri;
                ?>
pg<?php 
                echo $table_id;
                ?>
=<?php 
                echo $page_number - 1;
                ?>
#t_<?php 
                echo $table_id;
                ?>
" rel="<?php 
                echo $page_number - 1;
                ?>
"><?php 
                _e('&laquo; Prev');
                ?>
</a> |
			<?php 
            } else {
                ?>
			    <?php 
                _e('&laquo; Prev');
                ?>
 |
			<?php 
            }
            echo '</span>';
            if ($rangestart > 0) {
                ?>
 <span><a href="<?php 
                echo $request_uri;
                ?>
pg<?php 
                echo $table_id;
                ?>
=0#t_<?php 
                echo $table_id;
                ?>
" rel="0" class="">1</a></span> <?php 
                if ($rangestart > 1) {
                    echo ' ... ';
                }
            }
            for ($x = $rangestart; $x <= $rangeend; $x++) {
                if ($x == $page_number) {
                    ?>
					<span><a href="<?php 
                    echo $request_uri;
                    ?>
pg<?php 
                    echo $table_id;
                    ?>
=<?php 
                    echo $x;
                    ?>
#t_<?php 
                    echo $table_id;
                    ?>
" rel="<?php 
                    echo $x;
                    ?>
" class="current"><?php 
                    echo $x + 1;
                    ?>
</a></span>
					<?php 
                } else {
                    ?>
					<span><a href="<?php 
                    echo $request_uri;
                    ?>
pg<?php 
                    echo $table_id;
                    ?>
=<?php 
                    echo $x;
                    ?>
#t_<?php 
                    echo $table_id;
                    ?>
" rel="<?php 
                    echo $x;
                    ?>
" class=""><?php 
                    echo $x + 1;
                    ?>
</a></span>
					<?php 
                }
            }
            if ($rangeend < $page_count - 1) {
                if ($rangeend < $page_count - 2) {
                    echo ' ... ';
                }
                ?>
 <span><a href="<?php 
                echo $request_uri;
                ?>
pg<?php 
                echo $table_id;
                ?>
=<?php 
                echo $page_count - 1;
                ?>
#t_<?php 
                echo $table_id;
                ?>
" rel="<?php 
                echo $page_count - 1;
                ?>
" class=""><?php 
                echo $page_count;
                ?>
</a></span> <?php 
            }
            if ($page_number < $page_count - 1) {
                ?>
			    | <span><a href="<?php 
                echo $request_uri;
                ?>
pg<?php 
                echo $table_id;
                ?>
=<?php 
                echo $page_number + 1;
                ?>
#t_<?php 
                echo $table_id;
                ?>
" rel="<?php 
                echo $page_number + 1;
                ?>
"><?php 
                _e('Next &raquo;');
                ?>
</a></span>
			<?php 
            } else {
                ?>
			    | <span><?php 
                _e('Next &raquo;');
                ?>
</span>
			<?php 
            }
            //echo '</p>';
            echo '</div>';
            ?>
			<script type="text/javascript">
				$(function(){
					$('.pagination_links a').each(function(){
						// make the links post the search bar on pagination.
						$(this).click(function(){
							// see if there's a search bar to post.
							var search_form = false;
							search_form = $('.search_form')[0];
							$('.search_bar').each(function(){
								var form = $(this).parents('form');
								if(typeof form != 'undefined'){
									search_form = form;
								}
							});
							if(typeof search_form == 'object'){
								$(search_form).append('<input type="hidden" name="pg<?php 
            echo $table_id;
            ?>
" value="'+$(this).attr('rel')+'">');
								search_form = search_form[0];
								if(typeof search_form.submit == 'function'){
									search_form.submit();
								}else{
									$('[name=submit]',search_form).click();
								}
								return false;
							}
						});
					});
				});
			</script>
			<?php 
            $data['links'] = ob_get_clean();
            $data['page_numbers'] = $page_count;
        }
    }
    return $data;
}
예제 #7
0
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
$search = isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array();
if (isset($_REQUEST['customer_id'])) {
    $search['customer_id'] = $_REQUEST['customer_id'];
}
$websites = module_website::get_websites($search);
// hack to add a "group" option to the pagination results.
if (class_exists('module_group', false)) {
    module_group::enable_pagination_hook(array('fields' => array('owner_id' => 'website_id', 'owner_table' => 'website', 'name' => 'name', 'email' => '')));
}
if (class_exists('module_table_sort', false)) {
    module_table_sort::enable_pagination_hook(array('table_id' => 'website_list', 'sortable' => array('website_name' => array('field' => 'name', 'current' => 1), 'website_url' => array('field' => 'url'), 'website_customer' => array('field' => 'customer_name'), 'website_status' => array('field' => 'status'), 'website_group' => array('group_sort' => true, 'owner_table' => 'website', 'owner_id' => 'website_id'))));
}
// hack to add a "export" option to the pagination results.
if (class_exists('module_import_export', false) && module_website::can_i('view', 'Export ' . module_config::c('project_name_plural', 'Websites'))) {
    module_import_export::enable_pagination_hook(array('name' => module_config::c('project_name_single', 'Website') . ' Export', 'fields' => array(module_config::c('project_name_single', 'Website') . ' ID' => 'website_id', 'Customer Name' => 'customer_name', 'Customer Contact First Name' => 'customer_contact_fname', 'Customer Contact Last Name' => 'customer_contact_lname', 'Customer Contact Email' => 'customer_contact_email', module_config::c('project_name_single', 'Website') . ' Name' => 'name', 'URL' => 'url', module_config::c('project_name_single', 'Website') . ' Status' => 'status'), 'extra' => array('owner_table' => 'website', 'owner_id' => 'website_id')));
}
$header_buttons = array();
if (module_website::can_i('create', 'Websites')) {
    $header_buttons[] = array('url' => module_website::link_open('new'), 'type' => 'add', 'title' => _l('Add New ' . module_config::c('project_name_single', 'Website')));
}
if (class_exists('module_import_export', false) && module_website::can_i('view', 'Import ' . module_config::c('project_name_plural', 'Websites'))) {
    $link = module_import_export::import_link(array('callback' => 'module_website::handle_import', 'callback_preview' => 'module_website::handle_import_row_debug', 'name' => module_config::c('project_name_plural', 'Websites'), 'return_url' => $_SERVER['REQUEST_URI'], 'group' => 'website', 'fields' => array(module_config::c('project_name_single', 'Website') . ' ID' => 'website_id', 'Customer Name' => 'customer_name', 'Customer Contact First Name' => 'customer_contact_fname', 'Customer Contact Last Name' => 'customer_contact_lname', 'Customer Contact Email' => 'customer_contact_email', module_config::c('project_name_single', 'Website') . ' Name' => 'name', 'URL' => 'url', module_config::c('project_name_single', 'Website') . ' Status' => 'status', 'Notes' => 'notes'), 'options' => array('duplicates' => array('label' => _l('Duplicates'), 'form_element' => array('name' => 'duplicates', 'type' => 'select', 'blank' => false, 'value' => 'ignore', 'options' => array('ignore' => _l('Skip Duplicates'), 'overwrite' => _l('Overwrite/Update Duplicates'))))), 'extra' => array('owner_table' => 'website', 'owner_id' => 'website_id')));
    $header_buttons[] = array('url' => $link, 'type' => 'add', 'title' => _l("Import " . module_config::c('project_name_plural', 'Websites')));
}
print_heading(array('type' => 'h2', 'main' => true, 'title' => _l('Customer ' . module_config::c('project_name_plural', 'Websites')), 'button' => $header_buttons));
?>
예제 #8
0
    die('failed');
}
$search = isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array();
if (isset($_REQUEST['customer_id'])) {
    $search['customer_id'] = $_REQUEST['customer_id'];
}
$invoices = module_invoice::get_invoices($search);
$all_invoice_ids = array();
foreach ($invoices as $invoice) {
    $all_invoice_ids[] = $invoice['invoice_id'];
}
if (class_exists('module_table_sort', false) && module_table_sort::is_plugin_enabled()) {
    // get full invoice data.
    // todo: only grab data if we're sorting by something
    // that isn't in the default invoice listing.
    module_table_sort::enable_pagination_hook(array('table_id' => 'invoice_list', 'sortable' => array('invoice_number' => array('field' => 'name'), 'invoice_status' => array('field' => 'status'), 'invoice_create_date' => array('field' => 'date_create', 'current' => 2), 'invoice_due_date' => array('field' => 'date_due'), 'invoice_sent_date' => array('field' => 'date_sent'), 'invoice_paid_date' => array('field' => 'date_paid'), 'invoice_customer' => array('field' => 'customer_name'), 'c_invoice_total' => array('field' => 'cached_total'), 'c_invoice_total_due' => array('field' => 'total_amount_due'))));
    if (isset($_REQUEST['table_sort_column']) || isset($_SESSION['_table_sort']) && isset($_SESSION['_table_sort']['invoice_list']) && isset($_SESSION['_table_sort']['invoice_list'][0])) {
        // we're sorting by something!
        reset($invoices);
        $test = current($invoices);
        if ($test && $test['invoice_id']) {
            $column = isset($_REQUEST['table_sort_column']) ? $_REQUEST['table_sort_column'] : $_SESSION['_table_sort']['invoice_list'][0];
            if (isset(module_table_sort::$table_sort_options['sortable'][$column])) {
                $dbcolumn = module_table_sort::$table_sort_options['sortable'][$column]['field'];
                if (!isset($test[$dbcolumn])) {
                    $test = module_invoice::get_invoice($test['invoice_id']);
                    if (isset($test[$dbcolumn])) {
                        // load all invoice data (EEP!) so we can sort better
                        foreach ($invoices as $invoice_id => $invoice) {
                            $full_invoice = module_invoice::get_invoice($invoice['invoice_id']);
                            if (isset($full_invoice[$dbcolumn])) {
예제 #9
0
 * IP Address: 67.79.165.254
 */
$page_type = 'Companies';
$page_type_single = 'Company';
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : array();
if (!module_vendor::can_i('view', $page_type)) {
    redirect_browser(_BASE_HREF);
}
$module->page_title = _l($page_type);
$vendors = module_vendor::get_vendors($search, array('as_resource' => true));
// hack to add a "group" option to the pagination results.
if (class_exists('module_group', false)) {
    module_group::enable_pagination_hook(array('fields' => array('owner_id' => 'vendor_id', 'owner_table' => 'vendor', 'title' => $page_type_single . ' Groups', 'name' => 'vendor_name', 'email' => 'primary_user_email')));
}
if (class_exists('module_table_sort', false)) {
    module_table_sort::enable_pagination_hook(array('table_id' => 'vendor_list', 'sortable' => array('vendor_name' => array('field' => 'vendor_name'), 'primary_contact_name' => array('field' => 'primary_user_name'), 'primary_contact_email' => array('field' => 'primary_user_email'), 'vendor_group' => array('group_sort' => true, 'owner_table' => 'vendor', 'owner_id' => 'vendor_id'))));
}
// hack to add a "export" option to the pagination results.
if (class_exists('module_import_export', false) && module_vendor::can_i('view', 'Export ' . $page_type)) {
    module_import_export::enable_pagination_hook(array('name' => $page_type_single . ' Export', 'fields' => array($page_type_single . ' ID' => 'vendor_id', $page_type_single . ' Name' => 'vendor_name', 'Credit' => 'credit', 'Address Line 1' => 'line_1', 'Address Line 2' => 'line_2', 'Address Suburb' => 'suburb', 'Address Country' => 'country', 'Address State' => 'state', 'Address Region' => 'region', 'Address Post Code' => 'post_code', 'Primary Contact First Name' => 'primary_user_name', 'Primary Contact Last Name' => 'primary_user_last_name', 'Primary Phone' => 'primary_user_phone', 'Primary Email' => 'primary_user_email', 'Primary Fax' => 'primary_user_fax', 'Primary Mobile' => 'primary_user_mobile', 'Primary Language' => 'primary_user_language', 'Invoice Prefix' => 'default_invoice_prefix', 'Tax Name' => 'default_tax_name', 'Tax Rate' => 'default_tax'), 'extra' => array(array('owner_table' => 'vendor', 'owner_id' => 'vendor_id'), array('owner_table' => 'user', 'owner_id' => 'primary_user_id')), 'group' => array(array('title' => $page_type_single . ' Group', 'owner_table' => 'vendor', 'owner_id' => 'vendor_id'))));
}
$header_buttons = array();
if (module_vendor::can_i('create', $page_type)) {
    $header_buttons[] = array('url' => module_vendor::link_open('new', false), 'title' => 'Create New ' . $page_type_single, 'type' => 'add');
}
if (class_exists('module_import_export', false) && module_vendor::can_i('view', 'Import ' . $page_type)) {
    $header_buttons[] = array('url' => module_import_export::import_link(array('callback' => 'module_vendor::handle_import', 'name' => $page_type, 'return_url' => $_SERVER['REQUEST_URI'], 'group' => 'vendor', 'fields' => array($page_type_single . ' ID' => 'vendor_id', $page_type_single . ' Name' => 'vendor_name', 'Credit' => 'credit', 'Address Line 1' => 'line_1', 'Address Line 2' => 'line_2', 'Address Suburb' => 'suburb', 'Address Country' => 'country', 'Address State' => 'state', 'Address Region' => 'region', 'Address Post Code' => 'post_code', 'Primary Contact First Name' => 'primary_user_name', 'Primary Contact Last Name' => 'primary_user_last_name', 'Primary Phone' => 'primary_user_phone', 'Primary Email' => 'primary_user_email', 'Primary Fax' => 'primary_user_fax', 'Primary Mobile' => 'primary_user_mobile', 'Primary Language' => 'primary_user_language', 'Invoice Prefix' => 'default_invoice_prefix', 'Tax Name' => 'default_tax_name', 'Tax Rate' => 'default_tax', 'Password' => 'password', 'User Role Name' => 'role'), 'extra' => array(array('owner_table' => 'vendor', 'owner_id' => 'vendor_id'), array('owner_table' => 'user', 'owner_id' => 'primary_user_id')))), 'title' => 'Import ' . $page_type, 'type' => 'add');
}
if (file_exists('includes/plugin_user/pages/contact_admin_list.php') && module_user::can_i('view', 'All ' . $page_type_single . ' Contacts', 'Vendor', 'vendor')) {
    $header_buttons[] = array('url' => module_user::link_open_contact(false, false, array('vendor_id' => 0)), 'title' => 'View All Contacts');
}
예제 #10
0
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 321 52e20b549dde146818983ece66d81a11
 * Envato: f2874e84-c8f9-4c6c-894f-2c79a77bf602
 * Package Date: 2012-05-29 04:20:08 
 * IP Address: 127.0.0.1
 */
$search = isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array();
$reports = module_report::get_reports($search);
// hack to add a "group" option to the pagination results.
if (class_exists('module_group', false)) {
    module_group::enable_pagination_hook(array('fields' => array('owner_id' => 'report_id', 'owner_table' => 'report', 'name' => 'name', 'email' => '')));
}
if (class_exists('module_table_sort', false)) {
    module_table_sort::enable_pagination_hook(array('table_id' => 'report_list', 'sortable' => array('report_name' => array('field' => 'name', 'current' => 1), 'report_group' => array('group_sort' => true, 'owner_table' => 'report', 'owner_id' => 'report_id'))));
}
// hack to add a "export" option to the pagination results.
if (class_exists('module_import_export', false) && module_report::can_i('view', 'Export ' . _l('Reports'))) {
    module_import_export::enable_pagination_hook(array('name' => _l('Report') . ' Export', 'fields' => array(_l('Report') . ' ID' => 'report_id', 'Report Title' => 'report_title', 'Sql' => 'notes'), 'extra' => array('owner_table' => 'report', 'owner_id' => 'report_id')));
}
?>

<h2>
    <?php 
if (module_report::can_i('create', 'reports')) {
    ?>
	<span class="button">
		<?php 
    echo create_link("Add New " . _l('Report'), "add", module_report::link_open('new'));
    ?>