static function pdfMain(PluginPdfSimplePDF $pdf, SoftwareLicense $license, $main = true, $cpt = true) { global $DB; $ID = $license->getField('id'); $pdf->setColumnsSize(100); $entity = ''; if (Session::isMultiEntitiesMode() && !$main) { $entity = ' (' . Html::clean(Dropdown::getDropdownName('glpi_entities', $license->fields['entities_id'])) . ')'; } $pdf->displayTitle('<b><i>' . sprintf(__('%1$s: %2$s'), __('ID') . "</i>", $ID . "</b>" . $entity)); $pdf->setColumnsSize(50, 50); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), Software::getTypeName(1) . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_softwares', $license->fields['softwares_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Type') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_softwarelicensetypes', $license->fields['softwarelicensetypes_id'])))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Name') . '</i></b>', $license->fields['name']), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Serial number') . '</i></b>', $license->fields['serial'])); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Purchase version') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_softwareversions', $license->fields['softwareversions_id_buy']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Inventory number') . '</i></b>', $license->fields['otherserial'])); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Version in use') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_softwareversions', $license->fields['softwareversions_id_use']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Expiration') . '</i></b>', Html::convDate($license->fields['expire']))); $col2 = ''; if ($cpt) { $col2 = '<b><i>' . sprintf(__('%1$s: %2$s'), __('Affected computers') . '</i></b>', Computer_SoftwareLicense::countForLicense($ID)); } $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), _x('quantity', 'Number') . '</i></b>', $license->fields['number'] > 0 ? $license->fields['number'] : __('Unlimited')), $col2); $pdf->setColumnsSize(100); PluginPdfCommon::mainLine($pdf, $license, 'comment'); if ($main) { $pdf->displaySpace(); } }
function defineAllTabs($options = array()) { $onglets = parent::defineAllTabs($options); unset($onglets['Item_Problem$1']); // TODO add method to print linked Problems return $onglets; }
function defineAllTabs($options = array()) { $onglets = parent::defineAllTabs($options); unset($onglets['Software$1']); // Merge tab can't be exported unset($onglets['Item_Problem$1']); // TODO add method to print linked Problems return $onglets; }
function defineAllTabs($options = array()) { $onglets = parent::defineAllTabs($options); unset($onglets['PluginResourcesChoice####1']); unset($onglets['PluginResourcesReportConfig####1']); unset($onglets['Item_Problem$1']); // TODO add method to print linked Problems return $onglets; }
static function pdfMain(PluginPdfSimplePDF $pdf, SoftwareVersion $version) { global $DB; $ID = $version->getField('id'); $pdf->setColumnsSize(100); $pdf->displayTitle('<b><i>' . sprintf(__('%1$s: %2$s'), __('ID') . "</i>", $ID . "</b>")); $pdf->setColumnsSize(50, 50); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Name') . '</i></b>', $version->fields['name']), '<b><i>' . sprintf(__('%1$s: %2$s'), _n('Software', 'Software', 2) . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_softwares', $version->fields['softwares_id'])))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Status') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_states', $version->fields['states_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Operating system') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_operatingsystems', $version->fields['operatingsystems_id'])))); $pdf->setColumnsSize(100); PluginPdfCommon::mainLine($pdf, $version, 'comment'); $pdf->displaySpace(); }
static function pdfMain(PluginPdfSimplePDF $pdf, Peripheral $item) { PluginPdfCommon::mainTitle($pdf, $item); PluginPdfCommon::mainLine($pdf, $item, 'name-status'); PluginPdfCommon::mainLine($pdf, $item, 'location-type'); PluginPdfCommon::mainLine($pdf, $item, 'tech-manufacturer'); PluginPdfCommon::mainLine($pdf, $item, 'group-model'); PluginPdfCommon::mainLine($pdf, $item, 'contactnum-serial'); PluginPdfCommon::mainLine($pdf, $item, 'contact-otherserial'); PluginPdfCommon::mainLine($pdf, $item, 'user_management'); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Group') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_groups', $item->fields['groups_id'])))); $pdf->setColumnsSize(100); PluginPdfCommon::mainLine($pdf, $item, 'comment'); $pdf->displaySpace(); }
static function pdfMain(PluginPdfSimplePDF $pdf, NetworkEquipment $item) { PluginPdfCommon::mainTitle($pdf, $item); PluginPdfCommon::mainLine($pdf, $item, 'name-status'); PluginPdfCommon::mainLine($pdf, $item, 'location-type'); PluginPdfCommon::mainLine($pdf, $item, 'tech-manufacturer'); PluginPdfCommon::mainLine($pdf, $item, 'group-model'); PluginPdfCommon::mainLine($pdf, $item, 'contactnum-serial'); PluginPdfCommon::mainLine($pdf, $item, 'contact-otherserial'); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('User') . '</i></b>', getUserName($item->fields['users_id'])), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Network') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_networks', $item->fields['networks_id'])))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Group') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_groups', $item->fields['groups_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Domain') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_domains', $item->fields['domains_id'])))); $pdf->displayLine(__('The MAC address and the IP of the equipment are included in an aggregated network port')); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), _n('Firmware', 'Firmwares', 1) . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_networkequipmentfirmwares', $item->fields['networkequipmentfirmwares_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), sprintf(__('%1$s (%2$s)'), __('Memory'), __('Mio')) . '</i></b>', $item->fields['ram'])); $pdf->setColumnsSize(100); PluginPdfCommon::mainLine($pdf, $item, 'comment'); $pdf->displaySpace(); }
static function pdfMain(PluginPdfSimplePDF $pdf, Computer $computer) { global $DB; PluginPdfCommon::mainTitle($pdf, $computer); PluginPdfCommon::mainLine($pdf, $computer, 'name-status'); PluginPdfCommon::mainLine($pdf, $computer, 'location-type'); PluginPdfCommon::mainLine($pdf, $computer, 'tech-manufacturer'); PluginPdfCommon::mainLine($pdf, $computer, 'group-model'); PluginPdfCommon::mainLine($pdf, $computer, 'contactnum-serial'); PluginPdfCommon::mainLine($pdf, $computer, 'contact-otherserial'); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('User') . '</i></b>', getUserName($computer->fields['users_id'])), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Network') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_networks', $computer->fields['networks_id'])))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Group') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_groups', $computer->fields['groups_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Service pack') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_operatingsystemservicepacks', $computer->fields['operatingsystemservicepacks_id'])))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Domain') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_domains', $computer->fields['domains_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Version of the operating system') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_operatingsystemversions', $computer->fields['operatingsystemversions_id'])))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Operating system') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_operatingsystems', $computer->fields['operatingsystems_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Serial of the operating system') . '</i></b>', $computer->fields['os_license_number'])); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Product ID of the operating system') . '</i></b>', $computer->fields['os_licenseid']), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Update source') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_autoupdatesystems', $computer->fields['autoupdatesystems_id'])))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('UUID') . '</i></b>', $computer->fields['uuid'])); PluginPdfCommon::mainLine($pdf, $computer, 'comment'); $pdf->displaySpace(); }
static function pdfForItem(PluginPdfSimplePDF $pdf, CommonDBTM $item) { global $CFG_GLPI; $ID = $item->getField('id'); if (!Session::haveRight("infocom", "r")) { return false; } $ic = new Infocom(); $pdf->setColumnsSize(100); if ($ic->getFromDBforDevice(get_class($item), $ID)) { $pdf->displayTitle("<b>" . __('Financial and administrative information') . "</b>"); $pdf->setColumnsSize(50, 50); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Supplier') . "</i></b>", Html::clean(Dropdown::getDropdownName("glpi_suppliers", $ic->fields["suppliers_id"]))), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Budget') . "</i></b>", Html::clean(Dropdown::getDropdownName("glpi_budgets", $ic->fields["budgets_id"])))); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Order number') . "</i></b>", $ic->fields["order_number"]), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Order date') . "</i></b>", Html::convDate($ic->fields["order_date"]))); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Immobilization number') . "</i></b>", $ic->fields["immo_number"]), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Date of purchase') . "</i></b>", Html::convDate($ic->fields["buy_date"]))); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Invoice number') . "</i></b>", $ic->fields["bill"]), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Delivery date') . "</i></b>", Html::convDate($ic->fields["delivery_date"]))); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Delivery form') . "</i></b>", $ic->fields["delivery_number"]), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Startup date') . "</i></b>", Html::convDate($ic->fields["use_date"]))); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Value') . "</i></b>", Html::clean(Html::formatNumber($ic->fields["value"]))), "<b><i>" . sprintf(__('%1$s: %2$s'), _('Date of last physical inventory') . "</i></b>", Html::convDate($ic->fields["inventory_date"]))); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Warranty extension value') . "</i></b>", Html::clean(Html::formatNumber($ic->fields["warranty_value"]))), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Amortization duration') . "</i></b>", sprintf(__('%1$s (%2$s)'), sprintf(_n('%d year', '%d years', $ic->fields["sink_time"]), $ic->fields["sink_time"]), Infocom::getAmortTypeName($ic->fields["sink_type"])))); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Account net value') . "</i></b>", Infocom::Amort($ic->fields["sink_type"], $ic->fields["value"], $ic->fields["sink_time"], $ic->fields["sink_coeff"], $ic->fields["warranty_date"], $ic->fields["use_date"], $CFG_GLPI['date_tax'], "n")), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Amortization coefficient') . "</i></b>", $ic->fields["sink_coeff"])); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('TCO (value + tracking cost)') . "</i></b>", Html::clean(Infocom::showTco($item->getField('ticket_tco'), $ic->fields["value"]))), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Monthly TCO') . "</i></b>", Html::clean(Infocom::showTco($item->getField('ticket_tco'), $ic->fields["value"], $ic->fields["warranty_date"])))); PluginPdfCommon::mainLine($pdf, $ic, 'comment'); $pdf->setColumnsSize(100); $pdf->displayTitle("<b>" . __('Warranty information') . "</b>"); $pdf->setColumnsSize(50, 50); $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Start date of warranty') . "</i></b>", Html::convDate($ic->fields["warranty_date"])), "<b><i>" . sprintf(__('%1$s: %2$s'), __('Warranty duration') . "</i></b>", sprintf(__('%1$s - %2$s'), sprintf(_n('%d month', '%d months', $ic->fields["warranty_duration"]), $ic->fields["warranty_duration"]), sprintf(__('Valid to %s'), Infocom::getWarrantyExpir($ic->fields["buy_date"], $ic->fields["warranty_duration"]))))); $col1 = "<b><i>" . __('Alarms on financial and administrative information') . "</i></b>"; if ($ic->fields["alert"] == 0) { $col1 = sprintf(__('%1$s: %2$s'), $col1, __('No')); } else { if ($ic->fields["alert"] == 4) { $col1 = sprintf(__('%1$s: %2$s'), $col1, __('Warranty expiration date')); } } $pdf->displayLine("<b><i>" . sprintf(__('%1$s: %2$s'), __('Warranty information') . "</i></b>", $ic->fields["warranty_info"]), $col1); } else { $pdf->displayTitle("<b>" . __('No financial information', 'pdf') . "</b>"); } $pdf->displaySpace(); }
static function pdfMain(PluginPdfSimplePDF $pdf, Monitor $item) { PluginPdfCommon::mainTitle($pdf, $item); PluginPdfCommon::mainLine($pdf, $item, 'name-status'); PluginPdfCommon::mainLine($pdf, $item, 'location-type'); PluginPdfCommon::mainLine($pdf, $item, 'tech-manufacturer'); PluginPdfCommon::mainLine($pdf, $item, 'group-model'); PluginPdfCommon::mainLine($pdf, $item, 'contactnum-serial'); PluginPdfCommon::mainLine($pdf, $item, 'contact-otherserial'); PluginPdfCommon::mainLine($pdf, $item, 'user-management'); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Group') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_groups', $item->fields['groups_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Size') . '</i></b>', sprintf(__('%1$s %2$s'), $item->fields['size'], '"'))); $opts = array('have_micro' => __('Microphone'), 'have_speaker' => __('Speakers'), 'have_subd' => __('Sub-D'), 'have_bnc' => __('BNC'), 'have_dvi' => __('DVI'), 'have_pivot' => __('Pivot'), 'have_hdmi' => __('HDMI'), 'have_displayport' => __('DisplayPort')); foreach ($opts as $key => $val) { if (!$item->fields[$key]) { unset($opts[$key]); } } $pdf->setColumnsSize(100); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Flags') . '</i></b>', count($opts) ? implode(', ', $opts) : __('None'))); PluginPdfCommon::mainLine($pdf, $item, 'comment'); $pdf->displaySpace(); }
static function pdfMain(PluginPdfSimplePDF $pdf, Printer $printer) { PluginPdfCommon::mainTitle($pdf, $printer); PluginPdfCommon::mainLine($pdf, $printer, 'name-status'); PluginPdfCommon::mainLine($pdf, $printer, 'location-type'); PluginPdfCommon::mainLine($pdf, $printer, 'tech-manufacturer'); PluginPdfCommon::mainLine($pdf, $printer, 'group-model'); PluginPdfCommon::mainLine($pdf, $printer, 'contactnum-serial'); PluginPdfCommon::mainLine($pdf, $printer, 'contact-otherserial'); PluginPdfCommon::mainLine($pdf, $printer, 'user-management'); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Group') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_groups', $printer->fields['groups_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Network') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_networks', $printer->fields['networks_id'])))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Domain') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_domains', $printer->fields['domains_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Memory') . '</i></b>', $printer->fields['memory_size'])); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Initial page counter') . '</i></b>', $printer->fields['init_pages_counter']), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Current counter of pages') . '</i></b>', $printer->fields['last_pages_counter'])); $opts = array('have_serial' => __('Serial'), 'have_parallel' => __('Parallel'), 'have_usb' => __('USB'), 'have_ethernet' => __('Ethernet'), 'have_wifi' => __('Wifi')); foreach ($opts as $key => $val) { if (!$printer->fields[$key]) { unset($opts[$key]); } } $pdf->setColumnsSize(100); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), _n('Port', 'Ports', count($opts)) . '</i></b>', count($opts) ? implode(', ', $opts) : __('None'))); PluginPdfCommon::mainLine($pdf, $printer, 'comment'); $pdf->displaySpace(); }
static function pdfMain(PluginPdfSimplePDF $pdf, Phone $item) { PluginPdfCommon::mainTitle($pdf, $item); PluginPdfCommon::mainLine($pdf, $item, 'name-status'); PluginPdfCommon::mainLine($pdf, $item, 'location-type'); PluginPdfCommon::mainLine($pdf, $item, 'tech-manufacturer'); PluginPdfCommon::mainLine($pdf, $item, 'group-model'); PluginPdfCommon::mainLine($pdf, $item, 'contactnum-serial'); PluginPdfCommon::mainLine($pdf, $item, 'contact-otherserial'); PluginPdfCommon::mainLine($pdf, $item, 'user-management'); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Group') . '</i></b>', Html::clean(Dropdown::getDropdownName('glpi_groups', $item->fields['groups_id']))), '<b><i>' . sprintf(__('%1$s: %2$s'), __('Power supply') . '</i></b>', Dropdown::getYesNo($item->fields['phonepowersupplies_id']))); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Brand') . '</i></b>', $item->fields['brand']), '<b><i>' . sprintf(__('%1$s: %2$s'), _x('quantity', 'Number of lines') . '</i></b>', $item->fields['number_line'])); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), _n('Firmware', 'Firmwares', 1) . '</i></b>', $item->fields['firmware'])); $opts = array('have_headset' => __('Headset'), 'have_hp' => __('Speaker')); foreach ($opts as $key => $val) { if (!$item->fields[$key]) { unset($opts[$key]); } } $pdf->setColumnsSize(100); $pdf->displayLine('<b><i>' . sprintf(__('%1$s: %2$s'), __('Flags') . '</i></b>', count($opts) ? implode(', ', $opts) : __('None'))); PluginPdfCommon::mainLine($pdf, $item, 'comment'); $pdf->displaySpace(); }
function defineAllTabs($options = array()) { $onglets = parent::defineAllTabs($options); if (Session::haveRight("show_full_ticket", "1")) { $onglets['_private_'] = __('Private'); } // unset($onglets['Problem$1']); // TODO add method to print linked Problems // unset($onglets['Change$1']); // TODO add method to print linked Changes return $onglets; }
function defineAllTabs($options = array()) { $onglets = parent::defineAllTabs($options); unset($onglets['NotificationTarget$1']); // TODO Notifications $onglets['_tree'] = __('Child groups'); $onglets['_user'] = __('Members equipment', 'pdf'); return $onglets; }
function defineAllTabs($options = array()) { $onglets = parent::defineAllTabs($options); unset($onglets['KnowbaseItem$1']); return $onglets; }