Пример #1
0
    // we are just showing a list of all customer contacts.
    $show_customer_details = true;
    // check they have permissions to view all customer contacts.
    if (class_exists('module_security', false)) {
        // if they are not allowed to "edit" a page, but the "view" permission exists
        // then we automatically grab the page and regex all the crap out of it that they are not allowed to change
        // eg: form elements, submit buttons, etc..
        module_security::check_page(array('category' => $contact_type, 'page_name' => 'All ' . $contact_type_permission . ' Contacts', 'module' => $contact_module_name, 'feature' => 'view'));
    }
    //throw new Exception('Please create a user correctly');
} else {
    $show_customer_details = false;
}
$users = module_user::get_contacts($search, true, false);
if (class_exists('module_group', false)) {
    module_group::enable_pagination_hook(array('fields' => array('owner_id' => 'user_id', 'owner_table' => 'user', 'name' => 'name', 'email' => 'email')));
}
// hack to add a "export" option to the pagination results.
if (class_exists('module_import_export', false) && module_user::can_i('view', 'Export ' . $contact_type_permission . ' Contacts')) {
    if (isset($_REQUEST['import_export_go'])) {
        $users = query_to_array($users);
        foreach ($users as $user_id => $user) {
            $users[$user_id]['is_primary'] = $user['is_primary'] == $user['user_id'] ? _l('Yes') : _l('No');
        }
    }
    module_import_export::enable_pagination_hook(array('name' => $contact_type_permission . ' Contact Export', 'fields' => array($contact_type_permission . ' Contact ID' => 'user_id', 'First Name' => 'name', 'Last Name' => 'last_name', $contact_type_permission . ' ID' => $contact_module_name . '_id', $contact_type_permission . ' Name' => $contact_module_name . '_name', 'Primary Contact' => 'is_primary', 'Phone' => 'phone', 'Email' => 'email', 'Fax' => 'fax', 'Mobile' => 'mobile'), 'extra' => array('owner_table' => 'user', 'owner_id' => 'user_id'), 'group' => array(array('title' => 'Contact Group', 'owner_table' => 'user', 'owner_id' => 'user_id'))));
}
$heading = array('main' => true, 'type' => 'h2', 'title' => _l(($show_customer_details ? 'All ' : '') . $contact_type_permission . ' Contacts'), 'button' => array());
if (isset($search[$use_master_key]) && $search[$use_master_key] && module_user::can_i('create', 'Contacts', $contact_type_permission)) {
    $heading['button'][] = array('title' => 'Add New Contact', 'url' => module_user::link_generate('new', array('type' => 'contact', $use_master_key => isset($search[$use_master_key]) ? $search[$use_master_key] : false)), 'type' => 'add');
}
Пример #2
0
    $search['customer_id'] = $_REQUEST['customer_id'];
}
if (isset($_REQUEST['job_id']) && (int) $_REQUEST['job_id'] > 0) {
    $search['job_id'] = (int) $_REQUEST['job_id'];
    //$job = module_job::get_job($search['job_id'],false);
}
if (isset($_REQUEST['quote_id']) && (int) $_REQUEST['quote_id'] > 0) {
    $search['quote_id'] = (int) $_REQUEST['quote_id'];
    //$job = module_job::get_job($search['job_id'],false);
}
$search['bucket_parent_file_id'] = 0;
$files = module_file::get_files($search);
$module->page_title = _l('Files');
// hack to add a "group" option to the pagination results.
if (class_exists('module_group', false)) {
    module_group::enable_pagination_hook(array('bulk_actions' => array('delete' => array('label' => 'Delete selected files', 'type' => 'delete', 'callback' => 'module_file::bulk_handle_delete'))));
}
$header = array('title' => _l('Customer Files'), 'type' => 'h2', 'main' => true, 'button' => array());
if (module_file::can_i('create', 'Files')) {
    $header['button'][] = array('url' => module_file::link_open('new'), 'title' => _l('Add New File'), 'type' => 'add');
    $header['button'][] = array('url' => module_file::link_open_bucket('new'), 'title' => _l('Add New Bucket'), 'type' => 'add');
}
print_heading($header);
?>



<form action="" method="post">

    <?php 
module_form::print_form_auth();
Пример #3
0
    case 'unread':
        $ticket_count = module_ticket::get_unread_ticket_count();
        break;
    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(
Пример #4
0
 * 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
 */
$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : array();
$members = module_member::get_members($search);
// hack to add a "group" option to the pagination results.
if (class_exists('module_group', false)) {
    $hook = array('fields' => array('owner_id' => 'member_id', 'owner_table' => 'member'), 'bulk_actions' => array('delete' => array('label' => 'Delete these members', 'type' => 'delete', 'callback' => 'module_member::handle_bulk_delete')));
    if (class_exists('module_newsletter', false)) {
        $hook['bulk_actions']['delete_double_optin'] = array('label' => 'Delete failed double-opt-in members', 'type' => 'delete', 'callback' => 'module_member::handle_bulk_delete_double_optin');
    }
    module_group::enable_pagination_hook($hook);
}
// hack to add a "export" option to the pagination results.
if (class_exists('module_import_export', false) && module_member::can_i('view', 'Export Members')) {
    module_import_export::enable_pagination_hook(array('name' => 'Member Export', 'fields' => array('Member ID' => 'member_id', 'First Name' => 'first_name', 'Last Name' => 'last_name', 'Business Name' => 'business', 'Email' => 'email', 'Phone' => 'phone', 'Mobile' => 'mobile'), 'extra' => array('owner_table' => 'member', 'owner_id' => 'member_id')));
}
$header = array('title' => _l('Members'), 'type' => 'h2', 'main' => true, 'button' => array());
if (module_member::can_i('create', 'Members')) {
    $header['button'] = array(array('url' => module_member::link_open('new'), 'title' => _l('Create New Member'), 'type' => 'add'));
}
if (class_exists('module_import_export', false) && module_member::can_i('view', 'Import Members')) {
    $link = module_import_export::import_link(array('callback' => 'module_member::handle_import', 'name' => 'Members', 'return_url' => $_SERVER['REQUEST_URI'], 'group' => array('member', 'newsletter_subscription'), 'fields' => array('Member ID' => 'member_id', 'First Name' => 'first_name', 'Last Name' => 'last_name', 'Business Name' => 'business', 'Email' => 'email', 'Phone' => 'phone', 'Mobile' => 'mobile'), 'extra' => array('owner_table' => 'member', 'owner_id' => 'member_id')));
    $header['button'][] = array('url' => $link, 'title' => 'Import members', 'type' => 'add');
}
print_heading($header);
?>
Пример #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
 */
$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');
}
Пример #6
0
 public function enable_group_option($options)
 {
     if (class_exists('module_group', false)) {
         module_group::enable_pagination_hook($options);
     }
 }