} if (!module_quote::can_i('edit', 'Quotes')) { die('no perms'); } $quote_id = (int) $_REQUEST['quote_id']; $quote = module_quote::get_quote($quote_id); // template for sending emails. // are we sending the paid one? or the dueone. //$template_name = 'quote_email'; $template_name = isset($_REQUEST['template_name']) ? $_REQUEST['template_name'] : 'quote_email'; $template = module_template::get_template_by_key($template_name); $quote['total_amount_print'] = dollar($quote['total_amount'], true, $quote['currency_id']); $quote['total_amount_due_print'] = dollar($quote['total_amount_due'], true, $quote['currency_id']); $quote['quote_name'] = $quote['name']; $quote['from_name'] = module_security::get_loggedin_name(); $quote['quote_url'] = module_quote::link_public($quote_id); ob_start(); include module_theme::include_ucm('includes/plugin_quote/template/quote_task_list.php'); $public_html = ob_get_clean(); $quote['task_list'] = $public_html; /*ob_start(); $quote_data = $quote; $ignore_task_hook=true; $for_email=true; include('quote_public.php'); $quote['quote_tasks'] = ob_get_clean();*/ // generate the PDF ready for sending. $pdf = module_quote::generate_pdf($quote_id); // find available "to" recipients. // customer contacts. $to_select = false;
</div> </div> <?php $fieldset_data = array('heading' => array('title' => _l('Quote Has Been Approved'), 'type' => 'h3'), 'elements_before' => ob_get_clean()); echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); } if ($quote['date_approved'] == '0000-00-00') { ob_start(); ?> <div class="tableclass_form content"> <div style="text-align: center"> <?php $form_actions = array('class' => 'custom_actions action_bar_single', 'elements' => array(array('type' => 'button', 'name' => 'butt_convert_to_job', 'value' => _l('Approve this Quote'), 'onclick' => "window.location.href='" . module_quote::link_public($quote_id) . "'; return false;"))); echo module_form::generate_form_actions($form_actions); ?> </div> </div> <?php $fieldset_data = array('heading' => array('title' => _l('Quote Requires Approval'), 'type' => 'h3'), 'elements_before' => ob_get_clean()); echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); } } if (module_quote::can_i('edit', 'Quote Tasks') || module_quote::can_i('view', 'Quote Tasks')) { $header = array('title_final' => _l('Quote Tasks %s', $quote['total_percent_complete'] > 0 ? _l('(%s%% completed)', $quote['total_percent_complete'] * 100) : ''), 'button' => array(), 'type' => 'h3'); ob_start(); ?>
public static function quote_html($quote_id, $quote_data, $mode = 'html') { if ($quote_id && $quote_data) { // spit out the quote html into a file, then pass it to the pdf converter // to convert it into a PDF. $quote = $quote_data; if (class_exists('module_company', false) && isset($quote_data['company_id']) && (int) $quote_data['company_id'] > 0) { module_company::set_current_company_id($quote_data['company_id']); } $quote_template = isset($quote_data['quote_template_print']) && strlen($quote_data['quote_template_print']) ? $quote_data['quote_template_print'] : module_config::c('quote_template_print_default', 'quote_pdf'); $quote_template_suffix = ''; if ($quote_template != 'quote_pdf') { $quote_template_suffix = str_replace('quote_pdf', '', $quote_template); } ob_start(); include module_theme::include_ucm('includes/plugin_quote/template/quote_task_list.php'); $task_list_html = ob_get_clean(); $replace = self::get_replace_fields($quote_id, $quote_data); $replace['task_list'] = $task_list_html; $replace['quote_link'] = module_quote::link_public($quote_id); $replace['external_quote_template_html'] = ''; $external_quote_template = module_template::get_template_by_key('quote_pdf'); $external_quote_template->assign_values($replace); $replace['external_quote_template_html'] = $external_quote_template->replace_content(); ob_start(); $template = module_template::get_template_by_key($quote_template); $template->assign_values($replace); echo $template->render('html'); $quote_html = ob_get_clean(); return $quote_html; } return false; }
* IP Address: 67.79.165.254 */ if ($ticket_id > 0 && module_config::c('ticket_allow_billing', 1) && module_ticket::can_edit_tickets()) { $done_in_ticket_billing = true; $responsive_summary = array(); $quotes = array(); if (class_exists('module_quote', false) && module_quote::is_plugin_enabled()) { $quotes = module_quote::get_quotes(array('ticket_id' => $ticket_id)); foreach ($quotes as $quote) { $responsive_summary[] = module_quote::link_open($quote['quote_id'], true, $quote); } } $fieldset_data = array('heading' => array('type' => 'h3', 'title' => 'Ticket Billing', 'responsive' => array('summary' => implode(', ', $responsive_summary))), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array()); $c = array(); $res = module_customer::get_customers(); while ($row = array_shift($res)) { $c[$row['customer_id']] = $row['customer_name']; } if ($ticket['customer_id'] < 0) { $ticket['customer_id'] = false; } $fieldset_data['elements'][] = array('title' => _l('Customer'), 'fields' => array(array('type' => 'select', 'name' => 'change_customer_id', 'value' => $ticket['customer_id'], 'options' => $c), array('type' => 'button', 'name' => 'new_customer', 'value' => _l('New'), 'onclick' => "window.location.href='" . module_customer::link_open('new', false) . "&move_user_id=" . $ticket['user_id'] . "';"))); if (class_exists('module_quote', false) && module_quote::is_plugin_enabled()) { $quote_list = ''; foreach ($quotes as $quote) { $quote_list .= module_quote::link_open($quote['quote_id'], true, $quote) . ' (<a href="#" onclick="ucm.ticket.add_to_message($(this).data(\'link\'));return false;" data-link="<a href=\'' . module_quote::link_public($quote['quote_id']) . '\'>View Quote</a>">insert link</a>) <br/>'; } $fieldset_data['elements'][] = array('title' => _l('Quotes'), 'fields' => array($quote_list, array('type' => 'button', 'name' => 'new_quote', 'value' => _l('New'), 'onclick' => "window.location.href='" . module_quote::link_open('new', false) . "&ticket_id=" . $ticket_id . "';"))); } echo module_form::generate_fieldset($fieldset_data); }