Exemple #1
0
 public function pre_menu()
 {
     if (class_exists('module_finance', false)) {
         if (module_finance::is_enabled()) {
             $holder_module = 'finance';
             $holder_module_page = 'finance';
         } else {
             $this->links[] = array("name" => "Reports", "p" => "statistic_list", "args" => array('statistic_id' => false));
             $holder_module = 'statistic';
             $holder_module_page = 'statistic_list';
         }
         // the link within Finance
         if ($this->can_i('view', 'Staff Report')) {
             $this->links[] = array("name" => "Staff Report", "p" => "statistic_staff", "args" => array('statistic_id' => false), 'holder_module' => $holder_module, 'holder_module_page' => $holder_module_page, 'menu_include_parent' => 0, 'position' => 10, 'allow_nesting' => 1);
         }
         if ($this->can_i('view', 'Job Report')) {
             $this->links[] = array("name" => "Job Report", "p" => "statistic_job", "args" => array('statistic_id' => false), 'holder_module' => $holder_module, 'holder_module_page' => $holder_module_page, 'menu_include_parent' => 0, 'position' => 11, 'allow_nesting' => 1);
         }
         if ($this->can_i('view', 'Tax Report')) {
             $this->links[] = array("name" => "Tax Report", "p" => "statistic_tax", "args" => array('statistic_id' => false), 'holder_module' => $holder_module, 'holder_module_page' => $holder_module_page, 'menu_include_parent' => 0, 'position' => 12, 'allow_nesting' => 1);
         }
         if (class_exists('module_subscription', false) && $this->can_i('view', 'Subscription Report')) {
             $this->links[] = array("name" => "Subscription Report", "p" => "statistic_subscription", "args" => array('statistic_id' => false), 'holder_module' => $holder_module, 'holder_module_page' => $holder_module_page, 'menu_include_parent' => 0, 'position' => 13, 'allow_nesting' => 1);
         }
     }
     if (class_exists('module_ticket', false)) {
         if (is_file('includes/plugin_statistic/pages/ticket_report_staff.php') && $this->can_i('view', 'Ticket Staff Report')) {
             $this->links[] = array("name" => "Ticket Staff Report", 'm' => 'ticket', 'p' => 'ticket_report_staff', 'holder_module' => 'ticket', 'holder_module_page' => 'ticket_settings', 'order' => 11, 'menu_include_parent' => 1, 'allow_nesting' => 1, 'args' => array('ticket_account_id' => false));
         }
     }
     /* if(module_security::has_feature_access(array(
     				'name' => 'Settings',
     				'module' => 'config',
     				'category' => 'Config',
     				'view' => 1,
     				'description' => 'view',
     		)) && is_file('includes/plugin_statistic/pages/statistic.php')){
     			$this->links[] = array(
     				"name"=>"Statistic",
     				"p"=>"statistic_settings",
     				"icon"=>"icon.png",
     				"args"=>array('statistic_id'=>false),
     				'holder_module' => 'config', // which parent module this link will sit under.
     				'holder_module_page' => 'config_admin',  // which page this link will be automatically added to.
     				'menu_include_parent' => 0,
     			);
     		}*/
 }
</a>
                                    </td>
                                </tr>
                        <?php 
    }
    ?>

                        </tbody>
					</table>
                        </div>

                        <?php 
    $fieldset_data = array('heading' => array('title' => _l('Invoice Payment History'), 'type' => 'h3'), 'elements_before' => ob_get_clean());
    echo module_form::generate_fieldset($fieldset_data);
    unset($fieldset_data);
    if (class_exists('module_finance', false) && module_finance::is_plugin_enabled() && module_finance::can_i('view', 'Finance') && module_finance::is_enabled() && is_file('includes/plugin_finance/pages/finance_invoice_edit.php') && module_config::c('invoice_show_finances', 1)) {
        include 'includes/plugin_finance/pages/finance_invoice_edit.php';
    }
}
// invoice_id check
hook_handle_callback('layout_column_half', 'end');
$form_actions = array('class' => 'action_bar action_bar_left', 'elements' => array(array('type' => 'save_button', 'name' => 'butt_save', 'onclick' => "\$('#form_redirect').val('" . (!$invoice_id && isset($_REQUEST['job_id']) && (int) $_REQUEST['job_id'] > 0 ? module_job::link_open($_REQUEST['job_id']) : module_invoice::link_open(false)) . "');", 'value' => _l('Save and Return')), array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Save'))));
if ((int) $invoice_id) {
    if ($invoice['date_paid'] && $invoice['date_paid'] != '0000-00-00') {
        $form_actions['elements'][] = array('type' => 'save_button', 'class' => 'submit_button', 'name' => 'butt_email', 'value' => _l('Email Receipt'));
    } else {
        $form_actions['elements'][] = array('type' => 'submit', 'class' => 'submit_button', 'name' => 'butt_email', 'value' => _l('Email Invoice'));
    }
    if (function_exists('convert_html2pdf')) {
        if (!module_invoice::can_i('edit', 'Invoices')) {
            $form_actions['elements'][] = array('type' => 'button', 'class' => 'submit_button no_permissions', 'name' => 'butt_print', 'value' => _l('Print PDF'), 'onclick' => "window.location.href='" . module_invoice::link_public_print($invoice_id) . "';");
        ?>

                    </tbody>
                </table>
                <?php 
    }
    ?>

                    </div>
                    <?php 
    $fieldset_data = array('heading' => array('title' => 'Job Invoices:', 'type' => 'h3'), 'elements_before' => ob_get_clean());
    if (module_invoice::can_i('create', 'Invoices')) {
        $fieldset_data['heading']['button'] = array('title' => _l('Create New Invoice'), 'url' => '#', 'id' => 'job_generate_invoice_button');
    }
    echo module_form::generate_fieldset($fieldset_data);
}
if (class_exists('module_finance', false) && module_finance::is_plugin_enabled() && module_finance::can_i('view', 'Finance') && (int) $job_id > 0 && module_finance::is_enabled() && is_file('includes/plugin_finance/pages/finance_job_edit.php')) {
    include 'includes/plugin_finance/pages/finance_job_edit.php';
}
?>


</form>
<?php 
// run the custom data hook to display items in this particular hook location
hook_handle_callback('custom_data_hook_location', _CUSTOM_DATA_HOOK_LOCATION_JOB_FOOTER, 'job', $job_id, $job);
hook_handle_callback('layout_column_half', 'end');
?>