/* $Id: view.php 1923 2011-05-10 06:02:37Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/tags/version2.4/modules/departments/view.php $ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } global $department, $min_view; $dept_id = (int) w2PgetParam($_GET, 'dept_id', 0); $tab = $AppUI->processIntState('DeptVwTab', $_GET, 'tab', 0); // check permissions $canRead = canView($m, $dept_id); $canEdit = canEdit($m, $dept_id); if (!$canRead) { $AppUI->redirect('m=public&a=access_denied'); } $department = new CDepartment(); $department->loadFull($AppUI, $dept_id); if (!$department) { $AppUI->setMsg('Department'); $AppUI->setMsg('invalidID', UI_MSG_ERROR, true); $AppUI->redirect(); } else { $AppUI->savePlace(); } $countries = w2PgetSysVal('GlobalCountries'); $types = w2PgetSysVal('DepartmentType'); $titleBlock = new CTitleBlock('View Department', 'departments.png', $m, $m . '.' . $a); if ($canEdit) { $titleBlock->addCell(); $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new department') . '">', '', '<form action="?m=departments&a=addedit&company_id=' . $department->dept_company . '&dept_parent=' . $dept_id . '" method="post" accept-charset="utf-8">', '</form>'); } $titleBlock->addCrumb('?m=departments', 'department list');
/* $Id$ $URL$ */ if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } global $department, $min_view; $dept_id = (int) w2PgetParam($_GET, 'dept_id', 0); $tab = $AppUI->processIntState('DeptVwTab', $_GET, 'tab', 0); // check permissions $canRead = canView($m, $dept_id); $canEdit = canEdit($m, $dept_id); if (!$canRead) { $AppUI->redirect('m=public&a=access_denied'); } $department = new CDepartment(); $department->loadFull(null, $dept_id); if (!$department) { $AppUI->setMsg('Department'); $AppUI->setMsg('invalidID', UI_MSG_ERROR, true); $AppUI->redirect(); } else { $AppUI->savePlace(); } $countries = w2PgetSysVal('GlobalCountries'); $types = w2PgetSysVal('DepartmentType'); $titleBlock = new w2p_Theme_TitleBlock('View Department', 'departments.png', $m, $m . '.' . $a); if ($canEdit) { $titleBlock->addCell(); $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new department') . '">', '', '<form action="?m=departments&a=addedit&company_id=' . $department->dept_company . '&dept_parent=' . $dept_id . '" method="post" accept-charset="utf-8">', '</form>'); } $titleBlock->addCrumb('?m=departments', 'department list');