119 lines
10 KiB
PHP
119 lines
10 KiB
PHP
<?php
|
|
/** \file scripts\page\menu_lance.php
|
|
* \brief DI webinterface menu lances script.
|
|
* \author Rob Schalken, Core|Vision
|
|
* \version 1.0
|
|
* \date 17-10-2008
|
|
*
|
|
* This file contains the menu lances script. This file creates the lances menu.
|
|
* Here the user can select multiple lances actions (create/delete/search/change)/
|
|
*/
|
|
|
|
//== Required settings ======================
|
|
if( is_valid_action("service_repair_overview") ) {
|
|
$_PAGE_INFO['page_title'] = _("service and repair menu");
|
|
|
|
$_PAGE_INFO['history_menu_buttons'] = array(_("Project overview"), $_PAGE_INFO['HIST_MAIN'], _("Equipment maintenance"));
|
|
$_PAGE_INFO['history_menu_links'] = array("page/project", "page/menu", "page/menu_lance");
|
|
$_PAGE_INFO['menu_items'] = array( array(_("Service registration"), "page/menu_lance_search&action=workorder_registration", "menu:service:inschrijven" ),
|
|
NULL,
|
|
array(_("Change status"), "page/menu_lance_search&action=lance_change_status_di", "menu:service:productie" ),
|
|
array(_("Service in-take"), "page/menu_lance_search&action=workorder_intake", "menu:service:opname" ),
|
|
array(_("Production supervision"), "page/menu_lance_search&action=workorder_production", "menu:service:productie" ),
|
|
array(_("Service, repair or production"), "page/menu_lance_search&action=workorder_process", "menu:service:productie" ),
|
|
array(_("Change workorder"), "page/menu_lance_workorder_search&action=workorder_change", "menu:service:manager,menu:service:wijzigen" ),
|
|
array(_("Client receipt"), "page/menu_cust_search&action=workorder_receipt", "menu:service:productie" ),
|
|
array(_("Add elektronics test"), "page/menu_lance_search&action=lance_calibration", "menu:service:test" ),
|
|
array(_("View workorder"), "page/menu_lance_workorder_search&action=workorder_info","menu:service" ),
|
|
NULL,
|
|
array(_("Add functional test"), "page/menu_lance_search&action=lance_endcontrol", "menu:service:test" ),
|
|
NULL,
|
|
NULL,
|
|
NULL,
|
|
array(_("Workorder summary"), "page/menu_lance_workorder&action=workorder_list", "menu:service:manager,menu:service:administratie,menu:service:wijzigen" ),
|
|
array(_("Repair summary"), "page/menu_lance_workorder&action=workorder_repair_list","menu:service:manager,menu:service:administratie" ),
|
|
array(_("Service limits"), "page/menu_cust_search&action=service_limits", "menu:service:manager,menu:service:administratie" )
|
|
// array(_("Generate invoice"), FALSE, "menu:service:administratie" )
|
|
// array(_("Maintenance prediction"), FALSE, FALSE )
|
|
);
|
|
// Count the number of workorders in each state
|
|
$wo_count = db_count_workorders("status");
|
|
if( $wo_count ) {
|
|
$menu_extra_info = array( array( 'text' => FALSE ), // registration
|
|
array( 'text' => FALSE ), // (empty space)
|
|
array( 'text' => FALSE ), // change status
|
|
array( 'text' => $wo_count['inschrijving'], 'tip' => _("Number of lances ready for in-take") ), // in-take
|
|
array( 'text' => FALSE ), // production supervision
|
|
array( 'text' => $wo_count['bezig'] + $wo_count['goedgekeurd'], 'tip' => _("Number of lances waiting to be repaired") ), // repair process
|
|
array( 'text' => FALSE ), // awaiting approval (so must be changed)
|
|
array( 'text' => FALSE ), // client receipt
|
|
array( 'text' => $wo_count['gereedgemeld'], 'tip' => _("Number of lances waiting for calibration") ), // ready => must be calibrated
|
|
array( 'text' => FALSE ), // view workorder
|
|
array( 'text' => FALSE ), // (empty space)
|
|
array( 'text' => $wo_count['elek. test'], 'tip' => _("Number of lances waiting for endcontrol") ), // calibration successful => endcontrol testing
|
|
array( 'text' => FALSE ), // (empty space)
|
|
array( 'text' => FALSE ), // (empty space)
|
|
array( 'text' => FALSE ), // (empty space)
|
|
array( 'text' => FALSE ), // workorder list
|
|
array( 'text' => FALSE ), // repair summary
|
|
array( 'text' => FALSE )); // service limits
|
|
|
|
|
|
}
|
|
|
|
$menu_title = _("Service and repair");
|
|
}
|
|
else {
|
|
$_PAGE_INFO['page_title'] = _("equipment menu");
|
|
|
|
$_PAGE_INFO['history_menu_buttons'] = array(_("Project overview"), $_PAGE_INFO['HIST_MAIN']);
|
|
$_PAGE_INFO['history_menu_links'] = array("page/project", "page/menu");
|
|
//===========================================
|
|
//Button text //Page (including next action) // Rights needed
|
|
$_PAGE_INFO['menu_items'] = array( array(_("Last known status") , "page/menu_lance_search&action=lance_info" , "menu:lansen:root,menu:lansen&menu:lansen:offline_status,menu:service:productie" ),
|
|
array(_("Add equipment") , "page/menu_lance_search&action=lance_new" , "menu:lansen:root,menu:service:productie" ),
|
|
array(_("Change equipment") , "page/menu_lance_search&action=lance_change" , "menu:lansen:root,menu:service:productie" ),
|
|
array(_("Delete equipment") , "page/menu_lance_search&action=lance_delete" , "menu:lansen:root" ),
|
|
array(_("Service and repair") , "page/menu_lance&action=service_repair_overview" , "menu:lansen:root,menu:service:productie" ),
|
|
array(_("Maintenance report") , "page/menu_lance_search&action=lance_main_report" , "menu:lansen:root,menu:lansen&menu:lansen:onderhoudsrapporten,menu:service" ),
|
|
array(_("Equipment documentation"), "page/menu_lance_search&action=lance_doc" , "menu:lansen:root,menu:lansen&menu:lansen:onderhoudsrapporten,menu:service" ),
|
|
array(_("Change status") , "page/menu_lance_search&action=lance_change_status", "menu:lansen:root,menu:lansen,menu:service:productie" ),
|
|
array(_("Emergency numbers") , "page/menu_lance_search&action=lance_alarmnr" , "menu:lansen:root,menu:lansen&menu:lansen:alarmnummers,menu:service:productie" ),
|
|
array(_("Design location") , "" , "menu:lansen:root,menu:lansen&menu:lansen:ontwerp" ));
|
|
$menu_title = _("Equipment maintenance");
|
|
}
|
|
|
|
// Clear previous session info
|
|
unset($_SESSION[$_PAGE_INFO['id']]['action']);
|
|
unset($_SESSION[$_PAGE_INFO['id']]['recall']);
|
|
|
|
// Verify project/rights and log
|
|
if (Ver_Rights_Project_Log("menu:lansen:root,menu:lansen,menu:service:productie,menu:lansen&administratie", "menu:lansen", $_SESSION[$_PAGE_INFO['id']]['login']['project']['name'])) {
|
|
// Store title
|
|
$_SESSION[$_PAGE_INFO['id']]['title'] = $menu_title;
|
|
|
|
// Show page header
|
|
print_page_header();
|
|
|
|
// Collect menu items
|
|
for ($i = 0; $i < (sizeof($_PAGE_INFO['menu_items'])); $i++) {
|
|
// Retrieve button text
|
|
$menu_items[$i] = $_PAGE_INFO['menu_items'][$i][0];
|
|
// Verify menu rights and available link => enable/disable
|
|
if ((db_ver_rights_user_one_valid($_SESSION[$_PAGE_INFO['id']]['login']['user']['id'], $_PAGE_INFO['menu_items'][$i][2])) && (!empty($_PAGE_INFO['menu_items'][$i][1]))) {
|
|
$menu_rights[$i] = 1;
|
|
}
|
|
else {
|
|
$menu_rights[$i] = 0;
|
|
}
|
|
// Retrieve button link
|
|
$menu_links[$i] = "?id=" . $_PAGE_INFO['id'] . "&href=" . $_PAGE_INFO['menu_items'][$i][1];
|
|
}
|
|
|
|
// Display main menu
|
|
print_menu($menu_title, $menu_items, $menu_links, $menu_rights, array('extra_info' => $menu_extra_info));
|
|
|
|
// Show page footer
|
|
print_page_footer();
|
|
}
|
|
?>
|