src.dualinventive.com/mtinfo/dist/webroot/rc-4.05/scripts/page/menu_kb_info.php

72 lines
2.7 KiB
PHP

<?php
/** \file scripts\page\menu_kb_info.php
* \brief DI webinterface menu document script.
* \author Rob Schalken, Core|Vision
* \version $Revision: 26247 $
* \date $Date: 2016-02-29 10:40:22 +0100 (Mon, 29 Feb 2016) $
*
* This file contains the menu document info script. This file displays document info.
*/
//== Required settings ======================
if (is_valid_action("doc_new")) {
$_PAGE_INFO['page_title'] = "knowledge base document new menu";
$_PAGE_INFO['history_menu_buttons'] = array("Project overview", $_PAGE_INFO['HIST_MAIN'], "Knowledge Base");
$_PAGE_INFO['history_menu_links'] = array("page/project", "page/menu", "page/menu_kb");
$menu = "menu:documentatie:nieuw";
$rights = "menu:documentatie";
$title = "Add document";
}
else if (is_valid_action("doc_change")) {
$_PAGE_INFO['page_title'] = "knowledge base document change menu";
$_PAGE_INFO['history_menu_buttons'] = array("Project overview", $_PAGE_INFO['HIST_MAIN'], "Knowledge Base", "Document search (change)");
$_PAGE_INFO['history_menu_links'] = array("page/project", "page/menu", "page/menu_kb", "page/menu_kb_search");
$menu = "menu:documentatie:wijzigen";
$rights = "menu:documentatie";
$title = "Change document";
}
//===========================================
// Verify project/rights and log
if (Ver_Rights_Project_Log($rights, $menu)) {
// Check action
if (is_valid_action("doc_change")) {
// Check if this is a recall action
if (!$_SESSION[$_PAGE_INFO['id']]['recall_counter']) {
if (isset($_SESSION[$_PAGE_INFO['id']]['search']['kb']['id'])) {
// Retrieve lance data
$row_doc = db_fetch_file($_SESSION[$_PAGE_INFO['id']]['search']['kb']['id'], "klant_documenten");
if (is_array($row_doc)) {
$_SESSION[$_PAGE_INFO['id']]['doc_info'] = $row_doc;
}
else {
// ID not valid!!! => Redirect back to search menu
header("Location: ?id=" . $_PAGE_INFO['id'] . "&href=page/menu_kb_search");
}
}
else {
// ID not valid!!! => Redirect back to search menu
header("Location: ?id=" . $_PAGE_INFO['id'] . "&href=page/menu_kb_search");
}
}
}
// Store title
$_SESSION[$_PAGE_INFO['id']]['title'] = _($title);
// Show page header
$y_position = (isset($_SESSION[$_PAGE_INFO['id']]['doc_info']['y_position'])) ? ($_SESSION[$_PAGE_INFO['id']]['doc_info']['y_position']) : 0;
print_xml_header($y_position);
// Include info content
include("menu_kb_info_content.php");
// Show page footer
print_page_footer();
}
?>