<?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 main information about contact(s).
*/
class web_Contact extends web_Layout
{
function Info()
{
$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_SEARCH", $oIn = array('idcontact_current'=>$_SESSION['iduser']), $arContacts);
$this->tableStart();
$arHeader = array(
array('value'=>_LW('First name'), 'colspan'=>0),
array('value'=>_LW('Middle name'), 'colspan'=>0),
array('value'=>_LW('Last name'), 'colspan'=>0),
array('value'=>_LW('Nick name'), 'colspan'=>0),
array('value'=>_LW('Work place'), 'colspan'=>0),
array('value'=>_LW('Action'), 'colspan'=>0),
);
$this->tableHeader($arHeader);
if ( count($arContacts['contacts']) )
{
foreach ( $arContacts['contacts'] as $nIdContact => $arContactInfo )
{
$this->tableRow("?page=/web/contact/contact_view.php&idcontact=$nIdContact");
$this->tableCol($this->singleItem("link",$arContactInfo['first_name'],
array("href" => "?page=/web/contact/contact_view.php&idcontact=$nIdContact")));
$this->tableCol($this->singleItem("string",$arContactInfo['middle_name']));
$this->tableCol($this->singleItem("string",$arContactInfo['last_name']));
$this->tableCol($this->singleItem("string",$arContactInfo['nick_name']));
$this->tableCol($this->singleItem("string",$arContactInfo['work_place']));
$sBigAction = "";
$_oIn=array('idobject'=>$nIdContact, 'type'=>ID_SEMA_CONTACT);
$GLOBALS['WEB_DISPATCHER']->ProcessMessage("WM_ACTION_MENU_CREATE", $_oIn, $_oOut=array());
$this->tableCol();
if ( count($_oOut) )
{
krsort($_oOut);
foreach ( $_oOut as $nPriority=>$arMenues)
foreach ( $arMenues as $sName => $arData )
echo $this->singleItem("action",$sName,$arData);
}
}
}
$this->tableEnd();
?>
<?PHP
}
}
$oPage = new web_Contact;
$oPage->m_windowHeader = _LW("Contacts");
$oPage->WebStack("contact_main.php", $oPage->m_windowHeader, $oPage->m_windowHeader, web_GetPageGetParams());
if ( !isset($_SESSION['iduser']) )
web_RedirectRelative("sema.php");
$oPage->m_menuFLvl = "Contacts";
$oPage->RenderPage();
?>