Exemplo n.º 1
0
    $fieldset_data['elements'][] = array('title' => 'Contact', 'field' => array('type' => 'select', 'name' => 'user_id', 'value' => $invoice['user_id'], 'options' => $c, 'blank' => false));
}
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
if ((int) $invoice_id > 0) {
    hook_handle_callback('invoice_sidebar', $invoice_id);
}
if ($invoice_id && $invoice_id != 'new') {
    $note_summary_owners = array();
    // generate a list of all possible notes we can display for this invoice.
    // display all the notes which are owned by all the sites we have access to
    if (class_exists('module_note', false) && module_note::is_plugin_enabled()) {
        module_note::display_notes(array('title' => 'Invoice Notes', 'owner_table' => 'invoice', 'owner_id' => $invoice_id, 'view_link' => module_invoice::link_open($invoice_id), 'public' => array('enabled' => true, 'title' => 'Public', 'text' => 'Yes, show this note in invoice', 'help' => 'If this is ticked then this note will be available to the customer and will be included in the {INVOICE_NOTES} shortcode in the invoice template.')));
    }
    if (module_invoice::can_i('edit', 'Invoices')) {
        module_email::display_emails(array('title' => 'Invoice Emails', 'search' => array('invoice_id' => $invoice_id)));
    }
}
if ((int) $invoice_id > 0 && (!$invoice['date_sent'] || $invoice['date_sent'] == '0000-00-00') && module_security::is_page_editable()) {
    ob_start();
    ?>


            <div class="tableclass_form content">

                <p style="text-align: center;">
                    <input type="submit" name="butt_email" id="butt_email2" value="<?php 
    echo _l('Email Invoice');
    ?>
" class="submit_button" />
                    <?php 
Exemplo n.º 2
0
}
$fieldset_data['elements'][] = array('title' => 'Staff', 'fields' => array(array('type' => 'hidden', 'name' => 'staff_ids_save', 'value' => 1), '<div id="staff_ids_holder" style="float:left;">', array('type' => 'select', 'name' => 'staff_ids[]', 'options' => $staff_member_rel, 'multiple' => 'staff_ids_holder', 'values' => $file['staff_ids']), '</div>', function () use(&$file) {
    if ($file['quote_id']) {
        echo ' ';
        echo '<a href="' . module_quote::link_open($file['quote_id'], false) . '">' . _l('Open Quote &raquo;') . '</a>';
    }
}, array('type' => 'html', 'value' => '', 'help' => 'Assign a staff member to this file. Staff members are users who have EDIT permissions on Job Tasks. Click the plus sign to add more staff members. You can apply the "Only Assigned Staff" permission in User Role settings to restrict staff members to these files.<br><br>If there are assigned staff members then those members will be the only ones to receive notifications when a change is made to the file. If no staff are assigned to this file then anyone with the "Receive Alerts" permission will receive file change/comment alerts.')));
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
hook_handle_callback('layout_column_half', 2);
$fieldset_data = array('heading' => array('title' => _l('Bucket Description'), 'type' => 'h3'), 'elements' => array(array('field' => array('type' => 'wysiwyg', 'name' => 'description', 'value' => $file['description']))));
echo module_form::generate_fieldset($fieldset_data);
unset($fieldset_data);
if ((int) $file_id > 0) {
    if (module_file::can_i('edit', 'Files')) {
        module_email::display_emails(array('title' => 'File Emails', 'search' => array('file_id' => $file_id)));
    }
    ob_start();
    $search = array();
    $search['bucket_parent_file_id'] = $file_id;
    $files = module_file::get_files($search);
    $table_manager = module_theme::new_table_manager();
    $columns = array();
    $columns['file_name'] = array('title' => 'File Name', 'callback' => function ($file) {
        echo module_file::link_open($file['file_id'], true);
        if (isset($file['file_url']) && strlen($file['file_url'])) {
            echo ' ';
            echo '<a href="' . htmlspecialchars($file['file_url']) . '">' . htmlspecialchars($file['file_url']) . '</a>';
        }
    }, 'cell_class' => 'row_action');
    $columns['file_description'] = array('title' => 'Description', 'callback' => function ($file) {
Exemplo n.º 3
0
            $fieldset_data['elements'] = array(array('fields' => array(module_security::purify_html($job['description']))));
        }
        echo module_form::generate_fieldset($fieldset_data);
        unset($fieldset_data);
    }
}
if ($job_id && $job_id != 'new') {
    $note_summary_owners = array();
    // generate a list of all possible notes we can display for this job.
    // display all the notes which are owned by all the sites we have access to
    if (class_exists('module_note', false) && module_note::is_plugin_enabled()) {
        module_note::display_notes(array('title' => 'Job Notes', 'owner_table' => 'job', 'owner_id' => $job_id, 'view_link' => module_job::link_open($job_id)));
    }
    if (class_exists('module_job', false) && module_job::is_plugin_enabled()) {
        if (module_job::can_i('edit', 'Jobs')) {
            module_email::display_emails(array('title' => 'Job Emails', 'search' => array('job_id' => $job_id)));
        }
    }
    if (class_exists('module_group', false) && module_group::is_plugin_enabled()) {
        module_group::display_groups(array('title' => 'Job Groups', 'owner_table' => 'job', 'owner_id' => $job_id, 'view_link' => $module->link_open($job_id)));
    }
}
if (module_job::can_i('view', 'Job Advanced')) {
    /***** JOB ADVANCED *****/
    $fieldset_data = array('heading' => array('type' => 'h3', 'title' => 'Advanced'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array(array('title' => 'Customer Link', 'field' => array('type' => 'html', 'value' => '<a href="' . module_job::link_public($job_id) . '" target="_blank">' . _l('Click to view external link') . '</a>', 'help' => 'You can send this link to the customer and they can view progress on their job. They can also view a list of any invoices attached to this job. This is VERY useful to stop customers asking you "how far along are you" with a job because they can see exactly where you have logged up to in the system.'))));
    if ((int) $job_id > 0 && module_job::can_i('edit', 'Jobs')) {
        $fieldset_data['elements'][] = array('title' => 'Email Job', 'field' => array('type' => 'html', 'value' => '<a href="' . module_job::link_generate($job_id, array('arguments' => array('email' => 1))) . '">' . _l('Email this Job to Customer') . '</a>', 'help' => 'You can email the customer a copy of this job. This can be a progress report or as an initial quote. '));
        $fieldset_data['elements'][] = array('title' => 'Email Staff', 'fields' => array(function () use(&$job_tasks, $job_id) {
            $allocated_staff_members = array();
            foreach ($job_tasks as $job_task) {
                if (!isset($allocated_staff_members[$job_task['user_id']])) {
Exemplo n.º 4
0
            $fieldset_data['elements'] = array(array('fields' => array(module_security::purify_html($quote['description']))));
        }
        echo module_form::generate_fieldset($fieldset_data);
        unset($fieldset_data);
    }
}
if ($quote_id && $quote_id != 'new') {
    $note_summary_owners = array();
    // generate a list of all possible notes we can display for this quote.
    // display all the notes which are owned by all the sites we have access to
    if (class_exists('module_note', false) && module_note::is_plugin_enabled()) {
        module_note::display_notes(array('title' => 'Quote Notes', 'owner_table' => 'quote', 'owner_id' => $quote_id, 'view_link' => module_quote::link_open($quote_id)));
    }
    if (class_exists('module_quote', false) && module_quote::is_plugin_enabled()) {
        if (module_quote::can_i('edit', 'Quotes')) {
            module_email::display_emails(array('title' => 'Quote Emails', 'search' => array('quote_id' => $quote_id)));
        }
    }
    if (class_exists('module_group', false) && module_group::is_plugin_enabled()) {
        module_group::display_groups(array('title' => 'Quote Groups', 'owner_table' => 'quote', 'owner_id' => $quote_id, 'view_link' => $module->link_open($quote_id)));
    }
}
if (module_quote::can_i('view', 'Quote Advanced')) {
    /***** QUOTE ADVANCED *****/
    $fieldset_data = array('id' => 'quote_advanced', 'heading' => array('type' => 'h3', 'title' => 'Advanced'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array());
    if ((int) $quote_id > 0 && module_quote::can_i('edit', 'Quotes')) {
        $fieldset_data['elements'][] = array('title' => 'Customer Link', 'fields' => array('<a href="' . module_quote::link_public($quote_id) . '" target="_blank">' . _l('Click to view external link') . '</a>', _hr('You can send this link to the customer and they can view progress on their quote. They can also view a list of any invoices attached to this quote. This is VERY useful to stop customers asking you "how far along are you" with a quote because they can see exactly where you have logged up to in the system.')));
        $fieldset_data['elements'][] = array('title' => 'Email Staff', 'fields' => array(function () use(&$quote_tasks, $quote_id) {
            $allocated_staff_members = array();
            foreach ($quote_tasks as $quote_task) {
                if (!isset($allocated_staff_members[$quote_task['user_id']])) {