예제 #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
 * 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',
예제 #3
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);
?>
예제 #4
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',
            ),
        ),
예제 #5
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));
?>
예제 #6
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])) {
예제 #7
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');
}
예제 #8
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'));
    ?>