<?PHP
// Pushok's SEMA (Small Enterprise Management Application)
//
// Copyright (C) 2004 Pushok Software http://www.pushok.com
//
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
/*
subscription: contain more information about some note.
*/
$nIdNote = 0;
if ( isset($_GET['idnote']) && $_GET['idnote']>0 )
$nIdNote = $_GET['idnote'];
else
web_RedirectRelative("sema.php");
class web_Note extends web_Layout
{
function Info()
{
global $nIdNote;
$oIn = array('idcontact_current' => $_SESSION['iduser'], 'id' => $nIdNote);
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_NOTE_SEARCH", $oIn, $arNote);
if (count($arNote))
{
$arNoteInfo = $arNote['notes'];
// check can we show parent object name as link to it
$sParentTitle = "";
if (isset($arNoteInfo[$nIdNote]['parent_object']) && $arNoteInfo[$nIdNote]['parent_object']>0) {
$_oIn = array('idcontact'=>$_SESSION['iduser'], 'idobject'=>$arNoteInfo[$nIdNote]['parent_object'], 'mask'=>'R');
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_HAS_MASK", $_oIn, $_oOut=array());
if (isset($_oOut['result']) && $_oOut['result'])
$sParentTitle = $this->singleItem("link", $arNoteInfo[$nIdNote]['parent_title'], array('href'=> "?page=/web/object_view.php&id=".$arNoteInfo[$nIdNote]['parent_object']));
else
$sParentTitle = $this->singleItem("string", $arNoteInfo[$nIdNote]['parent_title']);
$sParentTitle = $sParentTitle." -> ";
}
$this->formStart($sParentTitle.$arNoteInfo[$nIdNote]['title']." (".$nIdNote.")");
$this->formItem(_LW("Title"),"string",$arNoteInfo[$nIdNote]['title']);
$text = web_ChangeObject2Link($arNoteInfo[$nIdNote]['body']);
$this->formItem(_LW("Body"),"memo",$text);
$oIn = array('idparent' => $nIdNote, 'idcontact_current' => $_SESSION['iduser'], 'layout' => &$this);
$GLOBALS['WEB_DISPATCHER']->ProcessMessage("WM_NOTE_VIEW_SHOW", $oIn, $oOut);
$this->formEnd();
}
else
web_PageError(_LW("Access denied, or object deleted !"));
?>
<?PHP
}
}
$oPage = new web_Note;
$oPage->m_windowHeader = _LW("Note info");
$oPage->WebStack("note_view.php", $oPage->m_windowHeader, $oPage->m_windowHeader, web_GetPageGetParams());
if ( !isset($_SESSION['iduser']) )
web_RedirectRelative("sema.php");
$oPage->idobject = $nIdNote;
$oPage->object_type = ID_SEMA_NOTE;
$oPage->m_menuFLvl = "Notes";
$oPage->RenderPage();
?>