function display($p_filter_value) { plugin_push_current('CustomerManagement'); if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) { if (is_numeric($p_filter_value)) { $service = CustomerManagementDao::getService((int) $p_filter_value); return string_display_line($service['name']); } } plugin_pop_current(); }
public function display($p_bug, $p_columns_target) { plugin_push_current('CustomerManagement'); if (access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) { $bugData = CustomerManagementDao::getBugData($p_bug->id); if (count($bugData) > 0) { $isBillable = CustomerManagementDao::getService($bugData['is_billable']); echo string_display_line($isBillable ? lang_get('yes') : lang_get('no')); } } plugin_pop_current(); }
public function view_bug_details($p_event, $p_bug_id) { if (!access_has_global_level(plugin_config_get('view_customer_fields_threshold'))) { return; } $bug_data = CustomerManagementDao::getBugData($p_bug_id); if (!$bug_data) { return; } $class = helper_alternate_class(); $class2 = helper_alternate_class(); $customer_label = plugin_lang_get('customer'); $service_label = plugin_lang_get('service'); $is_billable_label = plugin_lang_get('is_billable'); $invoice_label = plugin_lang_get('invoice'); $show_invoice = bug_get_field($p_bug_id, 'status') >= plugin_config_get('display_invoice_field_status_threshold'); $customer = CustomerManagementDao::getCustomer($bug_data['customer_id']); $service = CustomerManagementDao::getService($bug_data['service_id']); $is_billable = $bug_data['is_billable'] ? lang_get('yes') : lang_get('no'); if ($bug_data) { $row = <<<EOD <tr {$class}> \t<td class="category">{$customer_label}</td> \t<td>{$customer['name']}</td> \t<td class="category">{$service_label}</td> \t<td>{$service['name']}</td> \t<td class="category">{$is_billable_label}</td> \t<td>{$is_billable}</td> </tr> EOD; if ($show_invoice) { $row .= <<<EOD <tr {$class}> \t<td class="category">{$invoice_label}</td> \t<td>{$bug_data['invoice']}</td> \t<td class="category"> </td> \t<td> </td> \t<td class="category"> </td> \t<td> </td> </tr>\t\t\t\t EOD; } echo $row; } }