} //(int)$ticket_id > 0 && if (file_exists(dirname(__FILE__) . '/../inc/ticket_extras_sidebar.php')) { include dirname(__FILE__) . '/../inc/ticket_extras_sidebar.php'; } if (file_exists(dirname(__FILE__) . '/../inc/ticket_billing.php')) { include dirname(__FILE__) . '/../inc/ticket_billing.php'; } if ((int) $ticket_id > 0 && file_exists(dirname(__FILE__) . '/../inc/ticket_priority_sidebar.php')) { //if($ticket['priority'] == _TICKET_PRIORITY_STATUS_ID || (isset($ticket['invoice_id']) && $ticket['invoice_id'])){ include dirname(__FILE__) . '/../inc/ticket_priority_sidebar.php'; // } } if (isset($ticket['ticket_id']) && (int) $ticket['ticket_id'] > 0 && module_ticket::can_edit_tickets()) { if (class_exists('module_note', false) && module_note::is_plugin_enabled() && module_config::c('ticket_enable_notes', 1)) { module_note::display_notes(array('title' => 'Ticket Notes', 'owner_table' => 'ticket', 'owner_id' => $ticket_id, 'view_link' => module_ticket::link_open($ticket['ticket_id']))); } if (class_exists('module_group', false) && module_config::c('ticket_enable_groups', 1)) { module_group::display_groups(array('title' => 'Ticket Groups', 'owner_table' => 'ticket', 'owner_id' => $ticket['ticket_id'], 'view_link' => module_ticket::link_open($ticket['ticket_id']))); } } if (module_ticket::can_edit_tickets()) { /** RELATED TO */ $responsive_summary = array(); $responsive_summary[] = module_customer::link_open($ticket['customer_id'], true); $fieldset_data = array('heading' => array('title' => _l('Related to'), 'type' => 'h3', 'responsive' => array('summary' => implode(', ', $responsive_summary))), 'elements' => array()); $fieldset_data['elements'][] = array('title' => _l('Customer'), 'fields' => array(function () use($ticket_id, $ticket, $done_in_ticket_billing) { // moved to ticket billing..? if (module_ticket::can_edit_tickets() && !isset($done_in_ticket_billing)) { $c = array(); $res = module_customer::get_customers();
$user_temp = module_user::get_user($invoice['user_id'], false); $c[$invoice['user_id']] = $user_temp['name'] . ' ' . $user_temp['last_name'] . ' ' . _l('(under different customer)'); } $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');
module_form::prevent_exit(array('valid_exits' => array('.submit_button'))); module_form::set_required(array('fields' => array('name' => 'Name', 'email' => 'Email'))); hook_handle_callback('layout_column_half', 1); $title = 'User Details'; include module_theme::include_ucm('includes/plugin_user/pages/contact_admin_form.php'); if (module_config::c('users_have_address', 0)) { ob_start(); handle_hook("address_block", $module, "physical", "user", "user_id"); $fieldset_data = array('heading' => array('type' => 'h3', 'title' => 'Address'), 'elements_before' => ob_get_clean()); echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); } if ((int) $user_id > 0) { //handle_hook("note_list",$module,"user","user_id",$user_id); if (class_exists('module_note', false) && module_note::is_plugin_enabled()) { module_note::display_notes(array('title' => 'User Notes', 'owner_table' => 'user', 'owner_id' => $user_id, 'view_link' => $module->link_open($user_id))); } if (class_exists('module_group', false) && module_group::is_plugin_enabled()) { module_group::display_groups(array('title' => 'User Groups', 'owner_table' => 'user', 'owner_id' => $user_id, 'view_link' => module_user::link_open($user_id))); } } hook_handle_callback('layout_column_half', 2); if (is_file('includes/plugin_user/pages/user_admin_edit_login.php')) { include module_theme::include_ucm('includes/plugin_user/pages/user_admin_edit_login.php'); } if (is_file('includes/plugin_user/pages/user_admin_edit_staff.php')) { include module_theme::include_ucm('includes/plugin_user/pages/user_admin_edit_staff.php'); } if (is_file('includes/plugin_user/pages/user_admin_edit_company.php')) { include module_theme::include_ucm('includes/plugin_user/pages/user_admin_edit_company.php'); }
if (count($res) <= 1 && $widget['customer_id'] && isset($c[$widget['customer_id']])) { $fieldset_data['elements']['change'] = array('title' => _l('Change Customer'), 'fields' => array(htmlspecialchars($c[$widget['customer_id']]), array('type' => 'hidden', 'name' => 'customer_id', 'value' => $widget['customer_id']))); } else { $fieldset_data['elements']['change'] = array('title' => _l('Change Customer'), 'fields' => array(array('type' => 'select', 'name' => 'customer_id', 'options' => $c, 'value' => $widget['customer_id'], 'help' => 'Changing a customer will also change all the current linked jobs and invoices across to this new customer.'))); } echo module_form::generate_fieldset($fieldset_data); } if ((int) $widget_id > 0) { if (class_exists('module_group', false)) { module_group::display_groups(array('title' => 'Widget' . ' Groups', 'owner_table' => 'widget', 'owner_id' => $widget_id, 'view_link' => module_widget::link_open($widget_id))); } // and a hook for our new change request plugin hook_handle_callback('widget_sidebar', $widget_id); } hook_handle_callback('layout_column_half', 2, 65); if ((int) $widget_id > 0) { if (class_exists('module_note', false)) { module_note::display_notes(array('title' => 'Widget' . ' Notes', 'owner_table' => 'widget', 'owner_id' => $widget_id, 'view_link' => module_widget::link_open($widget_id))); } // and a hook for our new change request plugin hook_handle_callback('widget_main', $widget_id); } hook_handle_callback('layout_column_half', 'end'); $form_actions = array('class' => 'action_bar action_bar_center', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save ' . 'Widget')), array('ignore' => !((int) $widget_id && module_widget::can_i('delete', 'Widgets')), 'type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete')), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . module_widget::link_open(false) . "';"))); echo module_form::generate_form_actions($form_actions); ?> </form>
} } } // now find any subscription invoices that are linked to this website. if (class_exists('module_subscription', false)) { $members_subscriptions = module_subscription::get_subscriptions_by('website', $website_id); foreach ($members_subscriptions as $subscription_id => $subscription_info) { $history = module_subscription::get_subscription_history($subscription_id, 'website', $website_id); foreach ($history as $h) { if (is_array($h) && isset($h['invoice_id']) && $h['invoice_id']) { $note_summary_owners['invoice'][$h['invoice_id']] = $h['invoice_id']; } } } } module_note::display_notes(array('title' => module_config::c('project_name_single', 'Website') . ' Notes', 'owner_table' => 'website', 'owner_id' => $website_id, 'view_link' => module_website::link_open($website_id), 'display_summary' => true, 'summary_owners' => $note_summary_owners)); } if (class_exists('module_quote', false) && module_quote::is_plugin_enabled() && module_quote::can_i('view', 'Quotes')) { // show the jobs linked to this website. $quotes = module_quote::get_quotes(array('website_id' => $website_id)); if (count($quotes) || module_quote::can_i('create', 'Quotes')) { $h = array('type' => 'h3', 'title' => module_config::c('project_name_single', 'Website') . ' Quotes'); if (module_quote::can_i('create', 'Quotes')) { $h['button'] = array('title' => 'New Quote', 'url' => module_quote::link_generate('new', array('arguments' => array('website_id' => $website_id)))); } $fieldset_data = array('heading' => $h); if (count($quotes)) { $c = 0; ob_start(); ?>
$fieldset_data = array('heading' => array('title' => _l('Job Description'), 'type' => 'h3'), 'class' => 'tableclass tableclass_form tableclass_full'); if (module_job::can_i('edit', 'Jobs')) { $fieldset_data['elements'] = array(array('field' => array('type' => 'wysiwyg', 'name' => 'description', 'value' => $job['description']))); } else { $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. '));
</td> </tr> </tbody> </table> <?php } ?> <?php 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 module_note::display_notes(array('title' => 'Invoice Notes', 'owner_table' => 'invoice', 'owner_id' => $invoice_id, 'view_link' => module_invoice::link_open($invoice_id))); } ?> <?php if ((int) $invoice_id > 0 && (!$invoice['date_sent'] || $invoice['date_sent'] == '0000-00-00') && module_security::is_page_editable()) { ?> <h3 class="error_text"><?php _e('Send Invoice'); ?> </h3> <div class="tableclass_form content">
$note_summary_owners['website'][] = $val['website_id']; } } if(class_exists('module_job',false) && module_job::is_plugin_enabled()){ foreach(module_job::get_jobs(array('vendor_id'=>$vendor_id)) as $val){ $note_summary_owners['job'][] = $val['job_id']; foreach(module_invoice::get_invoices(array('job_id'=>$val['job_id'])) as $val){ $note_summary_owners['invoice'][$val['invoice_id']] = $val['invoice_id']; } } } if(class_exists('module_invoice',false) && module_invoice::is_plugin_enabled()){ foreach(module_invoice::get_invoices(array('vendor_id'=>$vendor_id)) as $val){ $note_summary_owners['invoice'][$val['invoice_id']] = $val['invoice_id']; } }*/ if (class_exists('module_note', false) && module_note::is_plugin_enabled()) { module_note::display_notes(array('title' => 'All ' . $page_type_single . ' Notes', 'owner_table' => 'vendor', 'owner_id' => $vendor_id, 'view_link' => $module->link_open($vendor_id), 'display_summary' => true, 'summary_owners' => $note_summary_owners)); } } hook_handle_callback('vendor_edit', $vendor_id); hook_handle_callback('layout_column_half', 'end'); $form_actions = array('class' => 'action_bar action_bar_center', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'onclick' => "\$('#form_redirect').val('" . $module->link_open(false) . "');", 'value' => _l('Save and Return')), array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save')), array('ignore' => !(module_vendor::can_i('delete', 'Companies') && $vendor_id > 0), 'type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete')), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $module->link_open(false) . "';"))); echo module_form::generate_form_actions($form_actions); ?> </form>
$fieldset_data = array('heading' => array('title' => _l('Quote Description'), 'type' => 'h3'), 'class' => 'tableclass tableclass_form tableclass_full'); if (module_quote::can_i('edit', 'Quotes')) { $fieldset_data['elements'] = array(array('field' => array('type' => 'wysiwyg', 'name' => 'description', 'value' => $quote['description']))); } else { $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.')));