<?php /** * 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_invoice::can_i('edit', 'Invoice Settings', 'Config')) { redirect_browser(_BASE_HREF); } ob_start(); $templates = module_template::get_templates(); $invoice_templates = array(); $invoice_templates['external_invoice'] = 1; $invoice_templates['credit_note_external'] = 1; $invoice_templates['invoice_payment_receipt'] = 1; $invoice_templates['invoice_print'] = 1; $invoice_templates['invoice_print_basic'] = 1; $invoice_templates['invoice_task_list'] = 1; $invoice_templates['credit_note_pdf'] = 1; $invoice_templates['invoice_email_due'] = 1; $invoice_templates['invoice_email_overdue'] = 1; $invoice_templates['invoice_email_paid'] = 1; $invoice_templates['credit_note_email'] = 1; foreach ($templates as $template) { if (stripos($template['template_key'], 'invoice')) { $invoice_templates[$template['template_key']] = 1;
<form action="" method="post"> <input type="hidden" name="_process" value="save_data_type" /> <input type="hidden" name="_redirect" value="<?php echo $module->link("", array("saved" => true, "data_type_id" => (int) $data_type_id ? $data_type_id : '')); ?> " /> <input type="hidden" name="data_type_id" value="<?php echo $data_type_id; ?> " /> <?php $templates = array(); foreach (module_template::get_templates() as $template) { $templates[$template['template_key']] = $template['template_key'] . ' (' . $template['description'] . ')'; } $header_buttons = array(); $fieldset_data = array('heading' => array('main' => true, 'type' => 'h2', 'title' => 'Data Settings', 'button' => $header_buttons), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array('name' => array('title' => _l('Name'), 'field' => array('type' => 'text', 'name' => 'data_type_name', 'value' => isset($data_type['data_type_name']) ? htmlspecialchars($data_type['data_type_name']) : '')), 'hook' => array('title' => _l('Display Location'), 'field' => array('type' => 'select', 'name' => 'data_type_menu', 'options' => module_data::get_menu_locations(), 'blank' => false, 'value' => isset($data_type['data_type_menu']) ? htmlspecialchars($data_type['data_type_menu']) : '', 'help' => 'This is where your custom data type will display within the system. Main will put it in the main menu. Customer will put it underneath a customer menu. None will hide this from the menu system all together')), 'icon' => array('title' => _l('Icon'), 'field' => array('type' => 'text', 'name' => 'data_type_icon', 'value' => isset($data_type['data_type_icon']) ? htmlspecialchars($data_type['data_type_icon']) : '', 'help' => 'Type the icon name from http://fontawesome.io/icons/ (eg: bell). Compatible with the Metis theme.')), 'max_entries' => array('title' => _l('Single or Multiple'), 'field' => array('type' => 'select', 'name' => 'max_entries', 'value' => isset($data_type['max_entries']) ? (int) $data_type['max_entries'] : 0, 'blank' => false, 'options' => array(0 => _l('Multiple Entries (default)'), 1 => _l('Single Entry Only')), 'help' => 'Here you can allow a single form entry or multiple entries. A single form entry can be used to record some information against a customer, the single entry will be displayed straight away instead of the list of multiple entries.')), 'print_pdf_template' => array('title' => _l('Allow PDF'), 'field' => array('type' => 'select', 'name' => 'print_pdf_template', 'value' => isset($data_type['print_pdf_template']) ? $data_type['print_pdf_template'] : '', 'options' => $templates, 'blank' => _l(' - disable Print to PDF - '), 'help' => 'These are all the available templates in the system. Create your own ( Settings > Templates ) and select it here. A Print PDF button will be available for each data record.')), 'email_template' => array('title' => _l('Allow Email'), 'field' => array('type' => 'select', 'name' => 'email_template', 'value' => isset($data_type['email_template']) ? $data_type['email_template'] : '', 'options' => $templates, 'blank' => _l(' - disable Email - '), 'help' => 'These are all the available templates in the system. Create your own ( Settings > Templates ) and select it here. An email button will be available for each data record.')))); echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); $form_actions = array('class' => 'action_bar action_bar_center action_bar_single', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save Settings')), array('type' => 'delete_button', 'name' => 'butt_del', 'value' => _l('Delete'), 'onclick' => "return confirm('Really delete?');"), array('type' => 'button', 'name' => 'cancel', 'value' => _l('Cancel'), 'class' => 'submit_button', 'onclick' => "window.location.href='" . $module->link() . "';"))); echo module_form::generate_form_actions($form_actions); ?> <p> </p> <?php if ($data_type_id && $data_type_id != 'new') { $data_field_groups = $module->get_data_field_groups($data_type_id);
module_form::generate_form_element($element); echo '<br/>'; $element = array('type' => 'checkbox', 'name' => 'renew_email', 'value' => isset($invoice['renew_email']) && $invoice['renew_email'], 'label' => 'Automatically Email', 'help' => 'When this Invoice is renewed it will be automatically emailed to the customer.'); module_form::generate_form_element($element); } } })); } else { $fieldset_data['elements'][] = array('title' => 'Renewal Date', 'fields' => array('(recurring invoices available in <a href="http://codecanyon.net/item/ultimate-client-manager-pro-edition/2621629?ref=dtbaker" target="_blank">UCM Pro Edition</a>)')); } $fieldset_data['elements'][] = array('title' => 'Cancel Date', 'hidden' => !((int) $invoice_id > 0), 'fields' => array(array('type' => 'date', 'name' => 'date_cancel', 'value' => print_date($invoice['date_cancel']), 'help' => 'If the invoice has been cancelled set the date here. Payment reminders for this invoice will no longer be generated.'))); $find_other_templates = 'invoice_print'; $current_template = isset($invoice['invoice_template_print']) && strlen($invoice['invoice_template_print']) ? $invoice['invoice_template_print'] : module_config::c('invoice_template_print_default', 'invoice_print'); if (function_exists('convert_html2pdf') && isset($find_other_templates) && strlen($find_other_templates) && isset($current_template) && strlen($current_template)) { $other_templates = array(); foreach (module_template::get_templates() as $possible_template) { if (strpos($possible_template['template_key'], $find_other_templates) !== false) { // found another one! $other_templates[$possible_template['template_key']] = $possible_template['template_key']; //$possible_template['description']; } } if (count($other_templates) > 1) { $fieldset_data['elements'][] = array('title' => 'PDF Template', 'field' => array('type' => 'select', 'options' => $other_templates, 'name' => 'invoice_template_print', 'value' => $current_template, 'help' => 'Choose the default template for PDF printing and PDF emailing. Name your custom templates invoice_print_SOMETHING for them to appear in this listing.')); } } if (class_exists('module_company', false) && module_company::is_enabled() && defined('COMPANY_UNIQUE_CONFIG') && COMPANY_UNIQUE_CONFIG && module_company::can_i('view', 'Company') && $invoice['customer_id'] > 0) { $company_list = module_company::get_companys_by_customer($invoice['customer_id']); if (count($company_list) > 1) { $fieldset_data['elements'][] = array('title' => 'Company', 'fields' => array(array('type' => 'select', 'name' => 'set_manual_company_id', 'options' => $company_list, 'blank' => _l('Default'), 'options_array_id' => 'name', 'value' => isset($invoice['company_id']) ? $invoice['company_id'] : 0))); }
<?php /** * 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_config::can_i('view', 'Settings')) { redirect_browser(_BASE_HREF); } $search = isset($_REQUEST['search']) ? $_REQUEST['search'] : array(); $templates = module_template::get_templates($search); print_heading(array('title' => 'System Templates', 'type' => 'h2', 'main' => true, 'button' => array('url' => module_template::link_open('new'), 'title' => 'Add New', 'type' => 'add'))); ?> <form action="" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_rows"> <thead> <tr class="title"> <th><?php echo _l('Template Name'); ?> </th> <th><?php