<?php /* $Id: vw_log_update.php,v 1.12 2005/12/28 20:03:33 theideaman Exp $ */ global $AppUI, $hditem, $ist, $HELPDESK_CONFIG; $item_id = dPgetParam($_GET, 'item_id', 0); // check permissions //$canEdit = !getDenyEdit( 'tasks', $item_id ); //if (!$canEdit) { // $AppUI->redirect( "m=public&a=access_denied" ); //} $users = getAllowedUsers(); $task_log_id = intval(dPgetParam($_GET, 'task_log_id', 0)); $log = new CHDTaskLog(); if ($task_log_id) { $log->load($task_log_id); //Prevent users from editing other ppls timecards. $can_edit_task_logs = $HELPDESK_CONFIG['minimum_edit_level'] >= $AppUI->user_type; if (!$can_edit_task_logs) { if ($log->task_log_creator != $AppUI->user_id) { $AppUI->redirect("m=public&a=access_denied"); } } } else { $log->task_log_help_desk_id = $item_id; $log->task_log_name = $hditem['item_title']; } // Lets check cost codes $q = new DBQuery(); $q->addTable('billingcode'); $q->addQuery('billingcode_id, billingcode_name'); $q->addWhere('billingcode_status=0');
break; case 'tasks': $task_project = dPgetParam($_GET, 'task_project', 0); $title = 'Task'; $select = 'task_id,task_name'; $order = 'task_name'; $where = $task_project ? "task_project = {$task_project}" : ''; break; case 'users': $title = 'User'; /* $select = "user_id,CONCAT_WS(' ',user_first_name,user_last_name)"; $order = 'user_last_name, user_first_name'; $where = getCompanyPerms("user_company", NULL, PERM_EDIT); */ $templist = getAllowedUsers(); foreach ($templist as $key => $value) { $list[$key] = $value; } break; case 'contacts': /* // Contact selection not implemented properly $title = 'Contacts'; $templist = getAllowedUsers(); foreach($templist as $key=>$value){ $list[$key]=$value; } break; */ /*