<?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 history information about some object.
*/
$nIdObject = 0;
if ( isset($_GET['idobject']) && $_GET['idobject']>0 )
$nIdObject = $_GET['idobject'];
else
web_RedirectRelative("sema.php");
$nIdObjectType = 0;
if ( isset($_GET['idobject_type']) && $_GET['idobject_type']>0 )
$nIdObjectType = $_GET['idobject_type'];
else
web_RedirectRelative("sema.php");
class web_History extends web_Layout
{
function Info()
{
global $nIdObject, $nIdObjectType;
$oIn = array('idcontact'=>$_SESSION['iduser'], 'idobject'=>$nIdObject, 'type'=>$nIdObjectType, 'mask'=>'R');
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_HAS_MASK", $oIn, $oOut = array());
if ( isset($oOut['result']) && $oOut['result'] )
{
$oIn = array('idcontact_current'=>$_SESSION['iduser'], 'idobject'=>$nIdObject, 'idobject_type'=>$nIdObjectType);
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_OBJECT_INFO", $oIn, $oOut = array());
$sTitle = "";
if ( isset($oOut['object']) && count($oOut['object']) )
$sTitle = $oOut['object']['title'];
// project data
$this->tableStart();
$arHeader = array(
array('value'=>_LW('Object'), 'colspan'=>3, 'align'=>'left')
);
$this->tableHeader($arHeader);
$this->tableRow();
$this->tableCol($sTitle, "left", 3);
$this->tableRow();
$arHeader = array(
array('value'=>_LW('Event'), 'colspan'=>0, 'align'=>'left'),
array('value'=>_LW('Date'), 'colspan'=>0, 'align'=>'left'),
array('value'=>_LW('Contact'), 'colspan'=>0, 'align'=>'left'),
);
$this->tableHeader($arHeader);
$oIn = array('idcontact_current' => $_SESSION['iduser'], 'idobject' => $nIdObject);
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_OBJECT_HISTORY_SEARCH", $oIn, $arHistory);
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_SHORTINFO", $oIn, $arContacts);
if ( isset($arHistory['history']) && count($arHistory['history']) )
{
foreach ( $arHistory['history'] as $key => $val )
{
$this->tableRow();
$this->tableCol($val['event']);
$this->tableCol($val['date']);
$this->tableCol($arContacts['contacts'][$val['idcontact']]);
}
}
$this->tableEnd();
}
?>
<?PHP
}
}
$oPage = new web_History;
$oPage->m_windowHeader = _LW("History");
$oPage->WebStack("history_view.php", $oPage->m_windowHeader, $oPage->m_windowHeader, web_GetPageGetParams());
if ( !isset($_SESSION['iduser']) )
web_RedirectRelative("sema.php");
$oPage->m_menuFLvl = "History";
$oPage->RenderPage();
?>