Beispiel #1
0
/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
global $AppUI, $deny1, $canRead, $canEdit, $project_id, $task_id, $showProject, $tab;
if ($task_id && !$project_id) {
    $task = new CTask();
    $task->load($task_id);
    $project_id = $task->task_project;
}
// modified later by Pablo Roca (proca) in 18 August 2003 - added page support
// Files modules: index page re-usable sub-table
if ($canEdit && 'links' != $m) {
    $titleBlock = new w2p_Theme_TitleBlock('', '', $m, "{$m}.{$a}");
    $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new link') . '">', '', '<form action="?m=links&a=addedit&project_id=' . $project_id . '&task_id=' . $task_id . '" method="post" accept-charset="utf-8">', '</form>');
    $titleBlock->show();
}
$page = (int) w2PgetParam($_GET, 'page', 1);
$search = w2PgetParam($_POST, 'search', '');
if (!isset($project_id)) {
    $project_id = (int) w2PgetParam($_POST, 'project_id', 0);
}
if ($canRead) {
    $link = new CLink();
    $links = $link->getProjectTaskLinksByCategory(null, $project_id, $task_id, $tab - 1, $search);
} else {
    $AppUI->redirect('m=public&a=access_denied');
}
$xpg_pagesize = w2PgetConfig('page_size', 50);
$xpg_min = $xpg_pagesize * ($page - 1);
Beispiel #2
0
// Pull First Letters
$letters = CUser::getFirstLetters();
$letters = $letters . CContact::getFirstLetters($AppUI->user_id, true);
$a2z = '<table cellpadding="2" cellspacing="1" border="0"><tr>';
$a2z .= '<td width="100%" align="right">' . $AppUI->_('Show') . ': </td>';
$a2z .= '<td><a href="./index.php?m=admin&stub=0">' . $AppUI->_('All') . '</a></td>';
for ($c = 65; $c < 91; $c++) {
    $cu = chr($c);
    $cell = !(mb_strpos($letters, $cu) === false) ? '<a href="?m=admin&stub=' . $cu . '">' . $cu . '</a>' : '<font color="#999999">' . $cu . '</font>';
    $a2z .= '<td>' . $cell . '</td>';
}
$a2z .= '</tr></table>';
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('User Management', 'helix-setup-users.png', $m, "{$m}.{$a}");
$where = w2PformSafe($where, true);
$titleBlock->addCell('<input type="text" name="where" class="text" size="10" value="' . $where . '" />' . ' <input type="submit" value="' . $AppUI->_('search') . '" class="button" />', '', '<form action="index.php?m=admin" method="post" accept-charset="utf-8">', '</form>');
$titleBlock->addCell($a2z);
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
<?php 
// security improvement:
// some javascript functions may not appear on client side in case of user not having write permissions
// else users would be able to arbitrarily run 'bad' functions
if ($canDelete) {
    ?>
function delMe( x, y ) {
	if (confirm( "<?php 
    echo $AppUI->_('doDelete', UI_OUTPUT_JS) . ' ' . $AppUI->_('User', UI_OUTPUT_JS);
    ?>
 " + y + "?" )) {
Beispiel #3
0
    ob_end_clean();
    foreach ($locale as $k => $v) {
        if ($v != '0') {
            $trans[$k]['lang'] = $v;
        }
    }
}
ksort($trans);
$titleBlock = new w2p_Theme_TitleBlock('Translation Management', 'rdf2.png', $m, $m . '.' . $a);
/*
 * TODO: While this implementation is close, I'd rather use the normal setMsg
 *   functionality as it handles marking the message as an error and inserting
 *   linebreaks, etc.
 */
if (file_exists($localeFile) && !is_writable($localeFile)) {
    $titleBlock->addCell('', '', '<span class="error">' . $AppUI->_("Locales file ({$localeFile}) is not writable.") . '</span><br />', '');
}
$localeFolder = pathinfo($localeFile, PATHINFO_DIRNAME);
if (!is_writable($localeFolder)) {
    $titleBlock->addCell('', '', '<span class="warning">' . $AppUI->_("Locales folder ({$localeFolder}) is not writable.") . '</span>', '');
}
$titleBlock->addCell($AppUI->_('Module'), '', '<form action="?m=system&a=translate" method="post" name="modlang" accept-charset="utf-8">', '');
$titleBlock->addCell(arraySelect($modules, 'module', 'size="1" class="text" onchange="document.modlang.submit();"', $module));
$titleBlock->addCell($AppUI->_('Language'));
$temp = $AppUI->setWarning(false);
$titleBlock->addCell(arraySelect($locales, 'lang', 'size="1" class="text" onchange="document.modlang.submit();"', $lang, true), '', '', '</form>');
$AppUI->setWarning($temp);
$titleBlock->addCrumb('?m=system', 'system admin');
$titleBlock->show();
?>
Beispiel #4
0
// get the passed timestamp (today if none)
$date = w2PgetParam($_GET, 'date', '');
$today = new w2p_Utilities_Date();
$today = $today->format(FMT_TIMESTAMP_DATE);
// get the list of visible companies
$company = new CCompany();
$companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
$event_filter_list = array('my' => 'My Events', 'own' => 'Events I Created', 'all' => 'All Events');
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Yearly Calendar', 'icon.png', $m);
$titleBlock->addCrumb('?m=events&a=year_view&date=' . $date, 'year view');
$titleBlock->addCrumb('?m=events&date=' . $date, 'month view');
$titleBlock->addCrumb('?m=events&a=week_view&date=' . $date, 'week view');
$titleBlock->addCrumb('?m=events&a=day_view&date=' . $date, 'day view');
$titleBlock->addCell('<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickCompany" accept-charset="utf-8">' . arraySelect($companies, 'company_id', 'onChange="document.pickCompany.submit()" class="text"', $company_id) . '</form>');
$titleBlock->addCell($AppUI->_('Company') . ':');
$titleBlock->addCell(arraySelect($event_filter_list, 'event_filter', 'onChange="document.pickFilter.submit()" class="text"', $event_filter, true), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickFilter" accept-charset="utf-8">', '</form>');
$titleBlock->addCell($AppUI->_('Event Filter') . ':');
$titleBlock->addButton('New event', '?m=events&a=addedit&date=' . $today);
$titleBlock->show();
?>

<script language="javascript" type="text/javascript">
function clickDay( uts, fdate ) {
	window.location = './index.php?m=events&a=day_view&date='+uts;
}
function clickWeek( uts, fdate ) {
	window.location = './index.php?m=events&a=week_view&date='+uts;
}
</script>
Beispiel #5
0
 $worked_hours = $obj->project_worked_hours;
 $total_project_hours = $total_hours = $obj->getTotalProjectHours();
 // create Date objects from the datetime fields
 $start_date = intval($obj->project_start_date) ? new w2p_Utilities_Date($obj->project_start_date) : null;
 $end_date = intval($obj->project_end_date) ? new w2p_Utilities_Date($obj->project_end_date) : null;
 $actual_end_date = intval($criticalTasks[0]['task_end_date']) ? new w2p_Utilities_Date($criticalTasks[0]['task_end_date']) : null;
 $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
 $style = $obj->project_percent_complete < 99.98999999999999 && $today > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : $style;
 // setup the title block
 $ttl = 'ProjectDesigner';
 $titleBlock = new w2p_Theme_TitleBlock($ttl, 'projectdesigner.png', $m, $m . '.' . $a);
 $titleBlock->addCrumb('?m=projects', 'projects list');
 $titleBlock->addCrumb('?m=' . $m, 'select another project');
 $titleBlock->addCrumb('?m=projects&a=view&bypass=1&project_id=' . $project_id, 'normal view project');
 if ($canAddProject) {
     $titleBlock->addCell();
     $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new project') . '">', '', '<form action="?m=projects&a=addedit" method="post" accept-charset="utf-8">', '</form>');
 }
 if ($canAddTask) {
     $titleBlock->addCell();
     $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new task') . '">', '', '<form action="?m=tasks&a=addedit&task_project=' . $project_id . '" method="post" accept-charset="utf-8">', '</form>');
 }
 if ($canEditProject) {
     $titleBlock->addCell();
     $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new event') . '">', '', '<form action="?m=calendar&a=addedit&event_project=' . $project_id . '" method="post" accept-charset="utf-8">', '</form>');
     $titleBlock->addCell();
     $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new file') . '">', '', '<form action="?m=files&a=addedit&project_id=' . $project_id . '" method="post" accept-charset="utf-8">', '</form>');
     $titleBlock->addCrumb('?m=projects&a=addedit&project_id=' . $project_id, 'edit this project');
     if ($canDeleteProject) {
         $titleBlock->addCrumbDelete('delete project', $canDelete, $msg);
     }
Beispiel #6
0
} else {
    $search_string = $AppUI->getState('dept_search_string');
}
$search_string = w2PformSafe($search_string, true);
$perms =& $AppUI->acl();
$owner_list = array(0 => $AppUI->_('All', UI_OUTPUT_RAW)) + $perms->getPermittedUsers('departments');
$owner_combo = arraySelect($owner_list, 'owner_filter_id', 'class="text" onchange="javascript:document.searchform.submit()"', $owner_filter_id, false);
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Departments', 'departments.png', $m, $m . '.' . $a);
$titleBlock->addCell('<form name="searchform" action="?m=departments&amp;search_string=' . $search_string . '" method="post" accept-charset="utf-8">
		<table>
			<tr>
				<td>
					<strong>' . $AppUI->_('Search') . '</strong>
					<input class="text" type="text" name="search_string" value="' . $search_string . '" /><br />
					<a href="index.php?m=departments&search_string=-1">' . $AppUI->_('Reset search') . '</a>
				</td>
				<td valign="top">
					<strong>' . $AppUI->_('Owner filter') . '</strong> ' . $owner_combo . '
				</td>
			</tr>
		</table>
	</form>');
$titleBlock->show();
if (isset($_GET['tab'])) {
    $AppUI->setState('DeptIdxTab', w2PgetParam($_GET, 'tab', null));
}
$deptsTypeTab = defVal($AppUI->getState('DeptIdxTab'), 0);
$deptsType = $deptsTypeTab;
// load the department types
$deptTypes = w2PgetSysVal('DepartmentType');
$tabBox = new CTabBox('?m=departments', W2P_BASE_DIR . '/modules/departments/', $deptsTypeTab);
Beispiel #7
0
$oCompany = new CCompany();
$allowedCompanies[-1] = $AppUI->_('all');
$allowedCompanies += $oCompany->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$project_types = array(-1 => '(' . $AppUI->_('all') . ')') + w2PgetSysVal('ProjectType');
$user_list = array(0 => '(' . $AppUI->_('all') . ')') + CProject::getOwners();
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Projects', 'icon.png', $m);
//$titleBlock->addSearchCell($search_string);
$titleBlock->addFilterCell('Type', 'project_type', $project_types, $project_type);
$titleBlock->addFilterCell('Company', 'project_company', $allowedCompanies, $company_id);
$titleBlock->addFilterCell('Owner', 'project_owner', $user_list, $owner);
if ($canCreate) {
    $titleBlock->addButton('new project', '?m=projects&a=addedit');
}
$titleBlock->addCell('<span title="' . $AppUI->_('Projects') . '::' . $AppUI->_('Print projects list') . '.">' . '<a href="javascript: void(0);" onclick ="window.open(\'index.php?m=projects&a=printprojects&dialog=1&suppressHeaders=1&company_id=' . $company_id . '&project_type=' . $project_type . '&project_owner=' . $owner . '\', \'printprojects\',\'width=1200, height=600, menubar=1, scrollbars=1\')">
		<img src="' . w2PfindImage('printer.png') . '" />
		</a></span>');
$titleBlock->show();
$project_statuses = array();
$project_statuses = w2PgetSysVal('ProjectStatus');
$project_statuses[-2] = 'All Projects';
$project_statuses[-1] = 'All Active';
$project_statuses[] = 'Archived';
ksort($project_statuses);
$counts = $project->getProjectsByStatus($company_id);
$counts[-2] = count($project->loadAll(null, $company_id > 0 ? 'project_company = ' . $company_id : ''));
$counts[-1] = count($project->loadAll(null, 'project_active = 1' . ($company_id > 0 ? ' AND project_company = ' . $company_id : '')));
$counts[count($project_statuses) - 3] = $counts[-2] - $counts[-1];
$tabBox = new CTabBox('?m=projects', W2P_BASE_DIR . '/modules/projects/', $tab);
foreach ($project_statuses as $key => $project_status) {
    $tabname = $project_status . '(' . (int) $counts[$key] . ')';
Beispiel #8
0
if (isset($_REQUEST['owner_filter_id'])) {
    $AppUI->setState('dept_owner_filter_id', w2PgetParam($_REQUEST, 'owner_filter_id', null));
    $owner_filter_id = w2PgetParam($_REQUEST, 'owner_filter_id', null);
} else {
    $owner_filter_id = $AppUI->getState('dept_owner_filter_id');
    if (!isset($owner_filter_id)) {
        $owner_filter_id = 0;
        //By default show all companies instead of $AppUI->user_id current user.
        $AppUI->setState('dept_owner_filter_id', $owner_filter_id);
    }
}
$search_string = w2PgetParam($_POST, 'search_string', '');
$AppUI->setState($m . '_search_string', $search_string);
$search_string = w2PformSafe($search_string, true);
$perms =& $AppUI->acl();
$owner_list = array(0 => $AppUI->_('All', UI_OUTPUT_RAW)) + $perms->getPermittedUsers('departments');
$titleBlock = new w2p_Theme_TitleBlock('Departments', 'icon.png', $m);
$titleBlock->addSearchCell($search_string);
$titleBlock->addCell('<form name="searchform2" action="?m=departments" method="post" accept-charset="utf-8">' . arraySelect($owner_list, 'owner_filter_id', 'onChange="document.searchform2.submit()" size="1" class="text"', $owner_filter_id) . '</form>');
$titleBlock->addCell($AppUI->_('Owner filter') . ':');
$titleBlock->show();
// load the department types
$deptTypes = w2PgetSysVal('DepartmentType');
$tabBox = new CTabBox('?m=departments', W2P_BASE_DIR . '/modules/departments/', $tab);
if ($tabBox->isTabbed()) {
    array_unshift($deptTypes, $AppUI->_('All Departments', UI_OUTPUT_RAW));
}
foreach ($deptTypes as $deptType) {
    $tabBox->add('vw_depts', $deptType);
}
$tabBox->show();
Beispiel #9
0
$dept_id = (int) w2PgetParam($_GET, 'dept_id', 0);
$department_id = (int) w2PgetParam($_GET, 'department_id', 0);
$dept_id = max($dept_id, $department_id);
$tab = $AppUI->processIntState('DeptVwTab', $_GET, 'tab', 0);
$department = new CDepartment();
if (!$department->load($dept_id)) {
    $AppUI->redirect(ACCESS_DENIED);
}
$canEdit = $department->canEdit();
$canDelete = $department->canDelete();
$titleBlock = new w2p_Theme_TitleBlock('View Department', 'icon.png', $m);
$titleBlock->addCrumb('?m=companies', 'company list');
$titleBlock->addCrumb('?m=companies&a=view&company_id=' . $department->dept_company, 'view this company');
$titleBlock->addCrumb('?m=' . $m, $m . ' list');
if ($canEdit) {
    $titleBlock->addCell();
    $titleBlock->addButton('New department', '?m=departments&a=addedit&company_id=' . $department->dept_company . '&dept_parent=' . $dept_id);
    $titleBlock->addCrumb('?m=departments&a=addedit&dept_id=' . $dept_id, 'edit this department');
    if ($canDelete) {
        $titleBlock->addCrumbDelete('delete department', $canDelete, $msg);
    }
}
$titleBlock->show();
$view = new w2p_Controllers_View($AppUI, $department, 'Department');
$view->setDoSQL('do_dept_aed');
$view->addField('dept_company', $department->dept_company);
$view->setKey('dept_id');
echo $view->renderDelete();
$types = w2PgetSysVal('DepartmentType');
include $AppUI->getTheme()->resolveTemplate('departments/view');
// tabbed information boxes
Beispiel #10
0
// $department variable, and populate the $company_id variable.
if (!(strpos($department, $company_prefix) === false)) {
    $company_id = substr($department, strlen($company_prefix));
    $AppUI->setState('UsrProjIdxCompany', $company_id);
    unset($department);
}
$contact = new CContact();
$contact->contact_id = $user->user_contact;
$methods = $contact->getContactMethods();
$methodLabels = w2PgetSysVal('ContactMethods');
$countries = w2PgetSysVal('GlobalCountries');
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('View User', 'icon.png', $m);
$titleBlock->addCrumb('?m=' . $m, $m . ' list');
if ($canEdit || $user_id == $AppUI->user_id) {
    $titleBlock->addCell('<div class="crumb"><ul><li><a href="javascript: void(0);" onclick="popChgPwd();return false"><span>' . $AppUI->_('change password') . '</span></a></li></ul></div>');
    $titleBlock->addCrumb('?m=users&a=addedit&user_id=' . $user_id, 'edit this user');
    $titleBlock->addCrumb('?m=contacts&a=addedit&contact_id=' . $user->contact_id, 'edit this contact');
    $titleBlock->addCrumb('?m=system&a=addeditpref&user_id=' . $user_id, 'edit preferences');
}
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
    <?php 
// security improvement:
// some javascript functions may not appear on client side in case of user not having write permissions
// else users would be able to arbitrarily run 'bad' functions
if ($canEdit || $user_id == $AppUI->user_id) {
    ?>
    function popChgPwd() {
        window.open( './index.php?m=public&a=chpwd&dialog=1&user_id=<?php 
Beispiel #11
0
 $canDeleteProject = $obj->canDelete($msg, $project_id);
 $obj->load($project_id);
 if (!$obj) {
     $AppUI->setMsg('Project');
     $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
     $AppUI->redirect('m=' . $m);
 }
 // setup the title block
 $ttl = 'ProjectDesigner';
 $titleBlock = new w2p_Theme_TitleBlock($ttl, 'icon.png', $m);
 $titleBlock->addCrumb('?m=projects', 'projects list');
 $titleBlock->addCrumb('?m=' . $m, 'select another project');
 $titleBlock->addCrumb('?m=projects&a=view&bypass=1&project_id=' . $project_id, 'normal view project');
 $titleBlock->addButton('new link', '?m=links&a=addedit&project_id=' . $project_id);
 if ($canEditProject) {
     $titleBlock->addCell();
     $titleBlock->addButton('New event', '?m=events&a=addedit&event_project=' . $project_id);
     $titleBlock->addCell();
     $titleBlock->addButton('New file', '?m=files&a=addedit&project_id=' . $project_id);
     $titleBlock->addCrumb('?m=projects&a=addedit&project_id=' . $project_id, 'edit this project');
     if ($canDeleteProject) {
         $titleBlock->addCrumbDelete('delete project', false, $msg);
     }
 }
 if ($canAddTasks) {
     $titleBlock->addCell();
     $titleBlock->addButton('New task', '?m=tasks&a=addedit&task_project=' . $project_id);
 }
 $titleBlock->addCell();
 $titleBlock->addCell(w2PtoolTip($m, 'print project') . '<a href="javascript: void(0);" onclick ="window.open(\'index.php?m=projectdesigner&a=printproject&dialog=1&suppressHeaders=1&project_id=' . $project_id . '\', \'printproject\',\'width=1200, height=600, menubar=1, scrollbars=1\')">
   		<img src="' . w2PfindImage('printer.png') . '" />
if (isset($_POST['company_id'])) {
    $AppUI->setState('CompanyIdxFilter', $_POST['company_id']);
}
$company_id = $AppUI->getState('CompanyIdxFilter') ? $AppUI->getState('CompanyIdxFilter') : 'all';
$log_all_projects = true;
// show tasks for all projects
if (!isset($user_id)) {
    $user_id = $AppUI->user_id;
}
$task = new CTask();
$obj = $task;
$canAddEdit = $obj->canAddEdit();
$canAuthor = $obj->canCreate();
$canEdit = $obj->canEdit();
if (!$canEdit) {
    $AppUI->redirect(ACCESS_DENIED);
}
// get CCompany() to filter tasks by company
$comp = new CCompany();
$companies = $comp->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$compFilter = arrayMerge(array('all' => $AppUI->_('All Companies')), $companies);
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Tasks per User', 'icon.png', $m);
$titleBlock->addCell(arraySelect($compFilter, 'company_id', 'size="1" class="text" onChange="document.companyFilter.submit();"', $company_id, false), '', '<form action="?m=tasks&amp;a=tasksperuser" method="post" name="companyFilter" accept-charset="utf-8">', '</form>');
$titleBlock->addCell($AppUI->_('Company') . ':');
$titleBlock->addCrumb('?m=tasks', 'tasks list');
$titleBlock->addCrumb('?m=tasks&amp;a=todo&amp;user_id=' . $user_id, 'my todo');
$titleBlock->show();
// include the re-usable sub view
$min_view = false;
include W2P_BASE_DIR . '/modules/tasks/tasksperuser_sub.php';
Beispiel #13
0
            $trans[$k]['lang'] = $v;
        }
    }
}
ksort($trans);
/**
 * TODO: I don't like that this error is handled outside the normal flow but
 *   it's better than echo'ing which is what we had before.
 */
$localeFolder = pathinfo($localeFile, PATHINFO_DIRNAME);
if (file_exists($localeFile) && !is_writable($localeFile)) {
    $AppUI->setMsg($AppUI->_("Locales file ({$localeFile}) is not writable."), UI_MSG_ERROR);
}
echo '' != $AppUI->msg ? $AppUI->getMsg() : '';
$titleBlock = new w2p_Theme_TitleBlock('Translation Management', 'rdf2.png', $m);
$titleBlock->addCell(' ', '', '<form action="?m=system&a=translate" method="post" name="modlang" accept-charset="utf-8">', '');
$titleBlock->addCell(arraySelect($modules, 'module', 'size="1" class="text" onchange="document.modlang.submit();"', $module));
$titleBlock->addCell($AppUI->_('Module'));
$temp = $AppUI->setWarning(false);
$titleBlock->addCell(arraySelect($locales, 'lang', 'size="1" class="text" onchange="document.modlang.submit();"', $lang, true), '', '', '</form>');
$titleBlock->addCell($AppUI->_('Language'));
$AppUI->setWarning($temp);
$titleBlock->addCrumb('?m=system', 'system admin');
$titleBlock->show();
?>
<form action="?m=system&a=translate_save" method="post" name="editlang" accept-charset="utf-8">
    <input type="hidden" name="module" value="<?php 
echo $modules[$module];
?>
" />
    <input type="hidden" name="lang" value="<?php 
Beispiel #14
0
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Tasks', 'icon.png', $m);
$titleBlock->addSearchCell($search_string);
// Let's see if this user has admin privileges
if (canView('users')) {
    $user_list = array(0 => 'all users');
    $user_list += $perms->getPermittedUsers('tasks');
    $titleBlock->addFilterCell('User', 'user_id', $user_list, $user_id);
}
$titleBlock->addFilterCell('Company', 'f2', $filters2, $f2);
if (w2PgetParam($_GET, 'inactive', '') == 'toggle') {
    $AppUI->setState('inactive', $AppUI->getState('inactive') == -1 ? 0 : -1);
}
$in = $AppUI->getState('inactive') == -1 ? '' : 'in';
$titleBlock->showhelp = false;
$titleBlock->addCell('<form action="?m=tasks" method="post" name="taskFilter" accept-charset="utf-8">' . arraySelect($filters, 'f', 'size="1" class="text" onChange="document.taskFilter.submit();"', $f, true) . '</form>');
$titleBlock->addCell($AppUI->_('Task Filter') . ':');
$titleBlock->addCrumb('?m=tasks&amp;a=todo&amp;user_id=' . $user_id, 'my todo');
if (w2PgetParam($_GET, 'pinned') == 1) {
    $titleBlock->addCrumb('?m=tasks', 'all tasks');
} else {
    $titleBlock->addCrumb('?m=tasks&amp;pinned=1', 'my pinned tasks');
}
$titleBlock->addCrumb('?m=tasks&amp;inactive=toggle', 'show ' . $in . 'active tasks');
$titleBlock->addCrumb('?m=tasks&amp;a=tasksperuser', 'tasks per user');
$titleBlock->show();
$tabBox = new CTabBox('?m=tasks', W2P_BASE_DIR . '/modules/tasks/', $tab);
$tabBox->show();
// include the re-usable sub view
$min_view = false;
echo $AppUI->getTheme()->styleRenderBoxTop();
Beispiel #15
0
$last_time = clone $this_day;
$last_time->setTime(23, 59, 59);
$prev_day = new w2p_Utilities_Date(Date_calc::prevDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE));
$next_day = new w2p_Utilities_Date(Date_calc::nextDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE));
// get the list of visible companies
$company = new CCompany();
global $companies;
$companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Day View', 'myevo-appointments.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=calendar&a=year_view&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'year view');
$titleBlock->addCrumb('?m=calendar&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'month view');
$titleBlock->addCrumb('?m=calendar&a=week_view&date=' . $this_week, 'week view');
$titleBlock->addCrumb('?m=calendar&a=day_view&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'day view');
$titleBlock->addCell($AppUI->_('Company') . ':');
$titleBlock->addCell(arraySelect($companies, 'company_id', 'onChange="document.pickCompany.submit()" class="text"', $company_id), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickCompany" accept-charset="utf-8">', '</form>');
$titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new event') . '">', '', '<form action="?m=calendar&a=addedit&date=' . $this_day->format(FMT_TIMESTAMP_DATE) . '" method="post" accept-charset="utf-8">', '</form>');
$titleBlock->show();
?>
<script language="javascript">
function clickDay( idate, fdate ) {
        window.location = './index.php?m=calendar&a=day_view&date='+idate+'&tab=0';
}
</script>

<table class="std view" width="100%" cellspacing="0" cellpadding="4">
    <tr>
        <td valign="top">
            <table border="0" cellspacing="1" cellpadding="2" width="100%" class="motitle">
                <tr>
Beispiel #16
0
    $AppUI->setMsg('Forum');
    $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
    $AppUI->redirect('m=' . $m);
}
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Forum', 'icon.png', $m);
$titleBlock->addCrumb('?m=' . $m, $m . ' list');
if ($message_id) {
    $titleBlock->addCrumb('?m=forums&a=viewer&forum_id=' . $forum_id, 'topics for this forum');
}
if ($canEdit) {
    $titleBlock->addCrumb('?m=forums&a=addedit&forum_id=' . $forum_id, 'edit this forum');
    if ($canDelete) {
        $titleBlock->addCrumbDelete('delete forum', true, $msg);
    }
}
$titleBlock->addCell(arraySelect($filters, 'f', 'size="1" class="text" onchange="document.filterFrm.submit();"', $f, true), '', '<form action="?m=forums&a=viewer&forum_id=' . $forum_id . '" method="post" name="filterFrm" accept-charset="utf-8">', '</form>');
$titleBlock->show();
$view = new w2p_Controllers_View($AppUI, $forum, 'Forum');
echo $view->renderDelete();
include $AppUI->getTheme()->resolveTemplate('forums/view');
echo $AppUI->getTheme()->styleRenderBoxBottom();
if ($post_message) {
    include W2P_BASE_DIR . '/modules/forums/post_message.php';
} else {
    if ($message_id) {
        include W2P_BASE_DIR . '/modules/forums/view_messages.php';
    } else {
        include W2P_BASE_DIR . '/modules/forums/view_topics.php';
    }
}
Beispiel #17
0
    $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');
$titleBlock->addCrumb('?m=companies', 'company list');
$titleBlock->addCrumb('?m=companies&a=view&company_id=' . $department->dept_company, 'view this company');
if ($canEdit) {
    $titleBlock->addCrumb('?m=departments&a=addedit&dept_id=' . $dept_id, 'edit this department');
    if ($canDelete) {
        $titleBlock->addCrumbDelete('delete department', $canDelete, $msg);
    }
}
$titleBlock->show();
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
$htmlHelper->stageRowData((array) $department);
?>
Beispiel #18
0
    $titleBlock = new w2p_Theme_TitleBlock('Invalid User ID', 'helix-setup-user.png', $m, "{$m}.{$a}");
    $titleBlock->addCrumb('?m=admin', 'users list');
    $titleBlock->show();
} else {
    $countries = w2PgetSysVal('GlobalCountries');
    // setup the title block
    $titleBlock = new w2p_Theme_TitleBlock('View User', 'helix-setup-user.png', $m, "{$m}.{$a}");
    if ($canRead) {
        $titleBlock->addCrumb('?m=admin', 'users list');
    }
    if ($canEdit || $user_id == $AppUI->user_id) {
        $titleBlock->addCrumb('?m=admin&a=addedituser&user_id=' . $user_id, 'edit this user');
        $titleBlock->addCrumb('?m=contacts&a=addedit&contact_id=' . $user->contact_id, 'edit this contact');
        $titleBlock->addCrumb('?m=system&a=addeditpref&user_id=' . $user_id, 'edit preferences');
        $titleBlock->addCrumbRight('<div class="crumb"><ul style="float:right;"><li><a href="javascript: void(0);" onclick="popChgPwd();return false"><span>' . $AppUI->_('change password') . '</span></a></li></ul></div>');
        $titleBlock->addCell('<td align="right" width="100%"><input type="button" class=button value="' . $AppUI->_('add user') . '" onclick="javascript:window.location=\'./index.php?m=admin&a=addedituser\';" /></td>');
    }
    $titleBlock->show();
    ?>
<script language="javascript" type="text/javascript">
	<?php 
    // security improvement:
    // some javascript functions may not appear on client side in case of user not having write permissions
    // else users would be able to arbitrarily run 'bad' functions
    if ($canEdit || $user_id == $AppUI->user_id) {
        ?>
	function popChgPwd() {
		window.open( './index.php?m=public&a=chpwd&dialog=1&user_id=<?php 
        echo $user->user_id;
        ?>
', 'chpwd', 'top=250,left=250,width=350, height=220, scrollbars=no' );
Beispiel #19
0
    $AppUI->redirect('m=public&a=access_denied');
}
// Clear any reminders
if ($reminded) {
    $obj->clearReminder();
}
$tab = $AppUI->processIntState('TaskLogVwTab', $_GET, 'tab', 0);
//check permissions for the associated project
$canReadProject = canView('projects', $obj->task_project);
$users = $obj->getAssignedUsers($task_id);
$durnTypes = w2PgetSysVal('TaskDurationType');
$task_types = w2PgetSysVal('TaskType');
$billingCategory = w2PgetSysVal('BudgetCategory');
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('View Task', 'applet-48.png', $m, $m . '.' . $a);
$titleBlock->addCell();
if ($canEdit) {
    $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new task') . '">', '', '<form action="?m=tasks&a=addedit&task_project=' . $obj->task_project . '&task_parent=' . $task_id . '" method="post" accept-charset="utf-8">', '</form>');
    $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new file') . '">', '', '<form action="?m=files&a=addedit&project_id=' . $obj->task_project . '&file_task=' . $obj->task_id . '" method="post" accept-charset="utf-8">', '</form>');
}
$titleBlock->addCrumb('?m=tasks', 'tasks list');
if ($canReadProject) {
    $titleBlock->addCrumb('?m=projects&a=view&project_id=' . $obj->task_project, 'view this project');
}
if ($canEdit && 0 == $obj->task_represents_project) {
    $titleBlock->addCrumb('?m=tasks&a=addedit&task_id=' . $task_id, 'edit this task');
}
//$obj->task_represents_project
if ($obj->task_represents_project) {
    $titleBlock->addCrumb('?m=projects&a=view&project_id=' . $obj->task_represents_project, 'view subproject');
}
Beispiel #20
0
// load the event recurs types
$recurs = array('Never', 'Hourly', 'Daily', 'Weekly', 'Bi-Weekly', 'Every Month', 'Quarterly', 'Every 6 months', 'Every Year');
$assigned = $event->getAssigned();
$start_date = $event->event_start_date ? new w2p_Utilities_Date($event->event_start_date) : new w2p_Utilities_Date();
$end_date = $event->event_end_date ? new w2p_Utilities_Date($event->event_end_date) : new w2p_Utilities_Date();
if ($event->event_project) {
    $project = new CProject();
    $event_project = $project->load($event->event_project)->project_name;
}
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('View Event', 'icon.png', $m);
$titleBlock->addCrumb('?m=events&a=year_view&date=' . $start_date->format(FMT_TIMESTAMP_DATE), 'year view');
$titleBlock->addCrumb('?m=events&amp;date=' . $start_date->format(FMT_TIMESTAMP_DATE), 'month view');
$titleBlock->addCrumb('?m=events&a=week_view&date=' . $start_date->format(FMT_TIMESTAMP_DATE), 'week view');
$titleBlock->addCrumb('?m=events&amp;a=day_view&amp;date=' . $start_date->format(FMT_TIMESTAMP_DATE) . '&amp;tab=0', 'day view');
if ($canEdit) {
    $titleBlock->addCell();
    $titleBlock->addCell('
		<form action="?m=events&amp;a=addedit" method="post" accept-charset="utf-8">
			<input type="submit" class="button" value="' . $AppUI->_('New event') . '" />
		</form>', '', '', '');
    $titleBlock->addCrumb('?m=events&amp;a=addedit&amp;event_id=' . $event_id, 'edit this event');
    if ($canDelete) {
        $titleBlock->addCrumbDelete('delete event', $canDelete, $msg);
    }
}
$titleBlock->show();
$view = new w2p_Controllers_View($AppUI, $event, 'Event');
echo $view->renderDelete();
$types = w2PgetSysVal('EventType');
include $AppUI->getTheme()->resolveTemplate('events/view');
Beispiel #21
0
<?php

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$AppUI->savePlace();
$obj = new CResource();
$perms =& $AppUI->acl();
$canEdit = canEdit('resources');
$titleBlock = new w2p_Theme_TitleBlock('Resources', 'resources.png', $m, $m . '.' . $a);
if ($canEdit) {
    $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new resource') . '">', '', '<form action="?m=resources&a=addedit" method="post" accept-charset="utf-8">', '</form>');
}
$titleBlock->show();
if (isset($_GET['tab'])) {
    $AppUI->setState('ResourcesIdxTab', w2PgetParam($_GET, 'tab', null));
}
$resourceTab = $AppUI->getState('ResourcesIdxTab', 0);
$tabBox = new CTabBox('?m=resources', W2P_BASE_DIR . '/modules/resources/', $resourceTab);
$tabbed = $tabBox->isTabbed();
foreach ($obj->loadTypes() as $type) {
    if ($type['resource_type_id'] == 0 && !$tabbed) {
        continue;
    }
    $tabBox->add('vw_resources', $type['resource_type_name']);
}
$tabBox->show();
$event_filter = $AppUI->checkPrefState('CalIdxFilter', w2PgetParam($_REQUEST, 'event_filter', ''), 'EVENTFILTER', 'my');
// get the passed timestamp (today if none)
$date = w2PgetParam($_GET, 'date', '');
$today = new w2p_Utilities_Date();
$today = $today->format(FMT_TIMESTAMP_DATE);
// get the list of visible companies
$company = new CCompany();
$companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Yearly Calendar', 'myevo-appointments.png', $m, "{$m}.{$a}");
$titleBlock->addCrumb('?m=calendar&a=year_view&date=' . $date, 'year view');
$titleBlock->addCrumb('?m=calendar&date=' . $date, 'month view');
$titleBlock->addCrumb('?m=calendar&a=week_view&date=' . $date, 'week view');
$titleBlock->addCrumb('?m=calendar&a=day_view&date=' . $date, 'day view');
$titleBlock->addCell($AppUI->_('Company') . ':');
$titleBlock->addCell(arraySelect($companies, 'company_id', 'onChange="document.pickCompany.submit()" class="text"', $company_id), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickCompany" accept-charset="utf-8">', '</form>');
$titleBlock->addCell($AppUI->_('Event Filter') . ':');
$titleBlock->addCell(arraySelect($event_filter_list, 'event_filter', 'onChange="document.pickFilter.submit()" class="text"', $event_filter, true), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickFilter" accept-charset="utf-8">', '</form>');
$titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new event') . '">', '', '<form action="?m=calendar&a=addedit&date=' . $today . '" method="post" accept-charset="utf-8">', '</form>');
$titleBlock->show();
?>

<script language="javascript" type="text/javascript">
function clickDay( uts, fdate ) {
	window.location = './index.php?m=calendar&a=day_view&date='+uts;
}
function clickWeek( uts, fdate ) {
	window.location = './index.php?m=calendar&a=week_view&date='+uts;
}
</script>
Beispiel #23
0
}
$orderby = $AppUI->getState('UserIdxOrderby') ? $AppUI->getState('UserIdxOrderby') : 'user_username';
$orderby = $tab == 3 || $orderby != 'date_time_in' && $orderby != 'user_ip' ? $orderby : 'user_username';
// Pull First Letters
$letters = CUser::getFirstLetters();
$letters = $letters . CContact::getFirstLetters($AppUI->user_id, true);
$a2z = '<a href="./index.php?m=users&stub=0">' . $AppUI->_('All') . '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
for ($c = 65; $c < 91; $c++) {
    $cu = chr($c);
    $cell = !(mb_strpos($letters, $cu) === false) ? '<a href="?m=users&stub=' . $cu . '">' . $cu . '</a>' : '<font color="#999999">' . $cu . '</font>';
    $a2z .= $cell . '&nbsp;';
}
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('User Management', 'icon.png', $m);
$titleBlock->addSearchCell($where);
$titleBlock->addCell($a2z);
$titleBlock->addButton('New user', '?m=users&a=addedit');
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
<?php 
// security improvement:
// some javascript functions may not appear on client side in case of user not having write permissions
// else users would be able to arbitrarily run 'bad' functions
if ($canDelete) {
    ?>
function delMe( x, y ) {
	if (confirm( "<?php 
    echo $AppUI->_('doDelete', UI_OUTPUT_JS) . ' ' . $AppUI->_('User', UI_OUTPUT_JS);
    ?>
 " + y + "?" )) {
Beispiel #24
0
<?php

if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$tab = $AppUI->processIntState('ContactsIdxTab', $_GET, 'tab', 0);
$searchString = w2PgetParam($_POST, 'search_string', '');
$contact = new CContact();
$canCreate = $contact->canCreate();
$canAccess = $contact->canAccess();
if (!$canAccess) {
    $AppUI->redirect(ACCESS_DENIED);
}
$titleBlock = new w2p_Theme_TitleBlock('Contacts', 'icon.png', $m);
$titleBlock->addCell('<a href="./index.php?m=contacts&amp;tab=0">' . $AppUI->_('Reset search') . '</a>');
$titleBlock->addCell('<form action="index.php?m=contacts&tab=27" method="post" accept-charset="utf-8" name="searchform">' . '<input type="text" class="text" name="search_string" value="' . $searchString . '" /></form>');
$titleBlock->addCell($AppUI->_('Search') . ':');
if ($canCreate) {
    $titleBlock->addButton('New contact', '?m=contacts&a=addedit');
    $titleBlock->addCrumb('?m=contacts&a=csvexport&suppressHeaders=1', 'CSV Download');
    $titleBlock->addCrumb('?m=contacts&a=vcardimport&dialog=0', 'Import vCard');
}
$titleBlock->show();
$tabBox = new CTabBox('?m=contacts', W2P_BASE_DIR . '/modules/contacts/', $tab);
$tabBox->add('vw_idx_contacts', $AppUI->_('Recently Updated'));
for ($c = 65; $c < 91; $c++) {
    $tabBox->add('vw_idx_contacts', $AppUI->_(chr($c)));
}
$tabBox->add('vw_idx_contacts', $AppUI->_('All Contacts'));
$tabBox->show();
// TODO: Check to see that the Edit function is separated.
Beispiel #25
0
$titleBlock->addCell();
$titleBlock->addCell($AppUI->_('Company') . ':');
$titleBlock->addCell(arraySelect($filters2, 'f2', 'size="1" class="text" onChange="document.companyFilter.submit();"', $f2, false), '', '<form action="?m=tasks" method="post" name="companyFilter" accept-charset="utf-8">', '</form>');
$titleBlock->addCell();
if ($canEdit && $project_id) {
    $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new task') . '">', '', '<form action="?m=tasks&amp;a=addedit&amp;task_project=' . $project_id . '" method="post" accept-charset="utf-8">', '</form>');
}
$titleBlock->show();
if (w2PgetParam($_GET, 'inactive', '') == 'toggle') {
    $AppUI->setState('inactive', $AppUI->getState('inactive') == -1 ? 0 : -1);
}
$in = $AppUI->getState('inactive') == -1 ? '' : 'in';
// use a new title block (a new row) to prevent from oversized sites
$titleBlock = new w2p_Theme_TitleBlock('', 'shim.gif');
$titleBlock->showhelp = false;
$titleBlock->addCell('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $AppUI->_('Task Filter') . ':');
$titleBlock->addCell(arraySelect($filters, 'f', 'size="1" class="text" onChange="document.taskFilter.submit();"', $f, true), '', '<form action="?m=tasks" method="post" name="taskFilter" accept-charset="utf-8">', '</form>');
$titleBlock->addCell();
$titleBlock->addCrumb('?m=tasks&amp;a=todo&amp;user_id=' . $user_id, 'my todo');
if (w2PgetParam($_GET, 'pinned') == 1) {
    $titleBlock->addCrumb('?m=tasks', 'all tasks');
} else {
    $titleBlock->addCrumb('?m=tasks&amp;pinned=1', 'my pinned tasks');
}
$titleBlock->addCrumb('?m=tasks&amp;inactive=toggle', 'show ' . $in . 'active tasks');
$titleBlock->addCrumb('?m=tasks&amp;a=tasksperuser', 'tasks per user');
if (!$project_id) {
    if (!isset($query_string)) {
        $query_string = '';
    }
    $titleBlock->addCell('
Beispiel #26
0
    // let's see if the user has sys access
    $AppUI->redirect(ACCESS_DENIED);
}
$perms =& $AppUI->acl();
$avail_modules = $perms->getModuleList();
$modules = array('all' => 'All Modules');
foreach ($avail_modules as $avail_module) {
    $modules[$avail_module['value']] = $avail_module['value'];
}
$module = isset($modules[$module]) ? $module : 'all';
$actions = array('all' => 'All Actions', 'access' => 'access', 'add' => 'add', 'delete' => 'delete', 'edit' => 'edit', 'view' => 'view');
$action = isset($actions[$action]) ? $action : 'all';
$users = array('' => '(' . $AppUI->_('Select User') . ')') + w2PgetUsers();
$permissions = getPermissions($perms, $user_id, $module, $action);
$titleBlock = new w2p_Theme_TitleBlock('Permission Result Table', 'icon.png', $m);
$titleBlock->addCell('
    <form action="?m=system&a=acls_view" method="post" name="pickUser" accept-charset="utf-8">' . $AppUI->_('View Users Permissions') . ': ' . arraySelect($users, 'user', 'class="text" onchange="javascript:document.pickUser.submit()"', $user_id) . $AppUI->_('View by Module') . ': ' . arraySelect($modules, 'module', 'class="text" onchange="javascript:document.pickUser.submit()"', $module) . $AppUI->_('View by Action') . ': ' . arraySelect($actions, 'action', 'class="text" onchange="javascript:document.pickUser.submit()"', $action) . '</form>', '', '', '');
$titleBlock->addCrumb('?m=system', 'system admin');
$titleBlock->addCrumb('?m=system&u=roles', 'user roles');
$titleBlock->show();
$fieldNames = array('UserID', 'User', 'Display Name', 'Module', 'Item', 'Item Name', 'Action', 'Allow', 'ACL_ID');
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
?>
<table class="tbl list">
    <tr>
        <?php 
foreach ($fieldNames as $index => $name) {
    ?>
            <th><?php 
    echo $AppUI->_($fieldNames[$index]);
    ?>
</th>