function isHoliday($date = 0) { // Query database for settings $holiday_manual = db_loadResult('SELECT holiday_manual FROM holiday_settings'); $holiday_auto = db_loadResult('SELECT holiday_auto FROM holiday_settings'); $holiday_driver = db_loadResult('SELECT holiday_driver FROM holiday_settings'); if (!$date) { $date = new CDate(); } if ($holiday_manual) { // Check whether the date is blacklisted $sql = "SELECT * FROM holiday "; $sql .= "WHERE ( date(holiday_start_date) <= '"; $sql .= $date->format('%Y-%m-%d'); $sql .= "' AND date(holiday_end_date) >= '"; $sql .= $date->format('%Y-%m-%d'); $sql .= "' AND holiday_white=0 ) "; $sql .= "OR ( "; $sql .= " DATE_FORMAT(holiday_start_date, '%m-%d') <= '"; $sql .= $date->format('%m-%d'); $sql .= "' AND DATE_FORMAT(holiday_end_date, '%m-%d') >= '"; $sql .= $date->format('%m-%d'); $sql .= "' AND holiday_annual=1"; $sql .= " AND holiday_white=0 ) "; if (db_loadResult($sql)) { return 0; } // Check if we have a whitelist item for this date $sql = "SELECT * FROM holiday "; $sql .= "WHERE ( date(holiday_start_date) <= '"; $sql .= $date->format('%Y-%m-%d'); $sql .= "' AND date(holiday_end_date) >= '"; $sql .= $date->format('%Y-%m-%d'); $sql .= "' AND holiday_white=1 ) "; $sql .= "OR ( "; $sql .= " DATE_FORMAT(holiday_start_date, '%m-%d') <= '"; $sql .= $date->format('%m-%d'); $sql .= "' AND DATE_FORMAT(holiday_end_date, '%m-%d') >= '"; $sql .= $date->format('%m-%d'); $sql .= "' AND holiday_annual=1"; $sql .= " AND holiday_white=1 ) "; if (db_loadResult($sql)) { return 1; } } if ($holiday_auto) { // Still here? Ok, lets poll the automatic system $drivers_alloc = Date_Holidays::getInstalledDrivers(); $driver_object = Date_Holidays::factory($drivers_alloc[$holiday_driver]['title'], $date->getYear(), 'en_EN'); if (!Date_Holidays::isError($driver_object)) { if ($driver_object->getHolidayForDate($date)) { return 1; } } } // No hits, must be a working day return 0; }
function showchilddept_maintenance(&$a, $level = 0) { global $AppUI, $df, $rownum; if (strlen($a["dept_batching_maintenance"]) == 0) { $batching_expire_date = null; } else { $batching_expire_date = new CDate($a["dept_batching_maintenance"]); } $s .= '<td><a href="?m=departments&a=view&dept_id=' . $a['dept_id'] . '">' . $a['dept_name'] . '</a>'; $s .= '<input type="hidden" name="dept_id[]" id="dept_id' . $rownum . '" value="' . $a['dept_id'] . '" />'; $s .= '</td>'; $s .= '<td> <input type="text" class="text" name="batching_maintenance[]" id="batching_maintenance' . $rownum . '" disabled="disabled" value="' . ($batching_expire_date ? $batching_expire_date->format($df) : '') . '"/>'; $s .= '<input type="hidden" name="dept_batching_maintenance[]" id="dept_batching_maintenance' . $rownum . '" value="' . ($batching_expire_date ? $batching_expire_date->format(FMT_TIMESTAMP_DATE) : '') . '" />'; $s .= '<a href="#" onclick="javascript:popCalendar(getRow(event))"> <img src="./images/calendar.gif" name="img_expiredate" width="24" height="12" alt="' . $AppUI->_('Calendar') . '" border="0" /></a>'; $s .= '</td>'; $dept_checked = time() > strtotime($a['dept_batching_maintenance']) ? "checked='checked'" : ""; //checked for expired dept. $s .= "<td align='center'><input type='checkbox' value='{$a['dept_id']}' {$dept_checked} name='select_dept[]'></td>"; echo '<tr>' . $s . '</tr>'; $rownum = $rownum + 1; }
function showchilddept_maintenance(&$a, $level = 0) { global $AppUI, $df, $rownum; if (strlen($a["dept_batching_maintenance"]) == 0) { $batching_expire_date = null; } else { $batching_expire_date = new CDate($a["dept_batching_maintenance"]); } $s .= '<td align="center"><a href="?m=departments&a=view&dept_id=' . $a['dept_id'] . '">' . $a['dept_name'] . '</a>'; $s .= '<input type="hidden" name="dept_id[]" id="dept_id' . $rownum . '" value="' . $a['dept_id'] . '" />'; $s .= '</td>'; $s .= '<td align="center"> <input type="text" class="text" name="batching_maintenance[]" id="batching_maintenance' . $rownum . '" disabled="disabled" value="' . ($batching_expire_date ? $batching_expire_date->format($df) : '') . '"/>'; $s .= '<input type="hidden" name="dept_batching_maintenance[]" id="dept_batching_maintenance' . $rownum . '" value="' . ($batching_expire_date ? $batching_expire_date->format(FMT_TIMESTAMP_DATE) : '') . '" />'; $s .= '<a href="#" onclick="javascript:popCalendar(getRow(event))"> <img src="./images/calendar.gif" name="img_expiredate" width="24" height="12" alt="' . $AppUI->_('Calendar') . '" border="0" /></a>'; $s .= '</td>'; $calAdder = '<a href="javascript:void(0)" onclick="javascript:popCalendarAccept(getRow(event))"> <img src="./images/calendar.gif" name="img_expiredate2" width="24" height="12" alt="' . $AppUI->_('Calendar') . '" border="0" /></a>'; $last_report_generation_date = $a['last_report_generation_date'] == "0000-00-00 00:00:00" ? "Not Generated Yet" : date("d/M/Y", strtotime($a['last_report_generation_date'])); $last_report_accept_date = date("d/M/Y", strtotime($a['last_report_accept_date'])); $last_report_accept_date_hidden = date("Ymd", strtotime($a['last_report_accept_date'])); $s .= "<td align='center'>{$last_report_generation_date}</td><td align='center'><input class='text' id='last_report_accept_date_hidden{$rownum}' name='last_report_accept_date_hidden[]' value='{$last_report_accept_date_hidden}' type='hidden'><input type='text' name='last_report_accept_date[]' id='last_report_accept_date{$rownum}' class='text' value='{$last_report_accept_date}' disabled>{$calAdder}</td>"; echo '<tr>' . $s . '</tr>'; $rownum = $rownum + 1; }
function addHelpDeskTaskLog() { global $AppUI, $helpdesk_available; if ($helpdesk_available && $this->file_helpdesk_item != 0) { // create task log with information about the file that was uploaded $task_log = new CHDTaskLog(); $task_log->task_log_help_desk_id = $this->_hditem->item_id; if ($this->_message != 'deleted') { $task_log->task_log_name = 'File ' . $this->file_name . ' uploaded'; } else { $task_log->task_log_name = 'File ' . $this->file_name . ' deleted'; } $task_log->task_log_description = $this->file_description; $task_log->task_log_creator = $AppUI->user_id; $date = new CDate(); $task_log->task_log_date = $date->format(FMT_DATETIME_MYSQL); if ($msg = $task_log->store()) { $AppUI->setMsg($msg, UI_MSG_ERROR); } } return NULL; }
} require_once $AppUI->getSystemClass('CustomFields'); //一些转化 // convert dates to SQL format first if ($obj->project_start_date) { $date = new CDate($obj->project_start_date); $obj->project_start_date = $date->format(FMT_DATETIME_MYSQL); } if ($obj->project_end_date) { $date = new CDate($obj->project_end_date); $date->setTime(23, 59, 59); $obj->project_end_date = $date->format(FMT_DATETIME_MYSQL); } if ($obj->project_actual_end_date) { $date = new CDate($obj->project_actual_end_date); $obj->project_actual_end_date = $date->format(FMT_DATETIME_MYSQL); } // let's check if there are some assigned departments to project //部门分配 if (!dPgetParam($_POST, "project_departments", 0)) { //返回一个部门的id $obj->project_departments = implode(",", dPgetParam($_POST, "dept_ids", array())); } $del = dPgetParam($_POST, 'del', 0); // prepare (and translate) the module name ready for the suffix if ($del) { $project_id = dPgetParam($_POST, 'project_id', 0); $canDelete = $obj->canDelete($msg, $project_id); if (!$canDelete) { $AppUI->setMsg($msg, UI_MSG_ERROR); $AppUI->redirect();
$s .= $CR . '<td width="99%"><a href="?m=helpdesk&a=view&item_id=' . $row["item_id"] . '">' . $row["item_title"] . '</a></td>'; $s .= $CR . "<td nowrap align=\"center\">"; if ($row["assigned_email"]) { $s .= $CR . "<a href=\"mailto:" . $row["assigned_email"] . "\">" . $row['assigned_fullname'] . "</a>"; } else { $s .= $CR . $row['assigned_fullname']; } $s .= $CR . "</td>"; $s .= $CR . '<td align="center" nowrap>' . $AppUI->_($ist[@$row["item_status"]]) . '</td>'; $s .= $CR . '<td align="center" nowrap>' . $AppUI->_($ipr[@$row["item_priority"]]) . '</td>'; //Lets retrieve the updated date // $sql = "SELECT MAX(status_date) status_date FROM helpdesk_item_status WHERE status_item_id =".$row['item_id']; // $sdrow = db_loadList( $sql ); // $dateu = new CDate( $sdrow[0]['status_date'] ); $dateu = new CDate($row['item_updated']); $s .= $CR . '<td align="center" nowrap>' . @$dateu->format($format) . '</td>'; if ($row['project_id']) { $s .= $CR . '<td align="center" style="background-color: #' . $row['project_color_identifier'] . ';" nowrap><a href="./index.php?m=projects&a=view&project_id=' . $row['project_id'] . '" style="color: ' . bestColor(@$row["project_color_identifier"]) . ';">' . $row['project_name'] . '</a></td>'; } else { $s .= $CR . '<td align="center">-</td>'; } $s .= $CR . '</tr></form>'; } print "{$s}\n"; // Pagination $pages = 0; if ($total_results > $items_per_page) { $pages_per_side = $HELPDESK_CONFIG['pages_per_side']; $pages = ceil($total_results / $items_per_page) - 1; if ($page < $pages_per_side) { $start = 0;
/** * Sub-function to collect tasks within a period * * @param Date the starting date of the period * @param Date the ending date of the period * @param array by-ref an array of links to append new items to * @param int the length to truncate entries by * @param int the company id to filter by * @author Andrew Eddie <*****@*****.**> */ function getTaskLinks($startPeriod, $endPeriod, &$links, $strMaxLen, $company_id = 0) { global $a, $AppUI, $dPconfig; $tasks = CTask::getTasksForPeriod($startPeriod, $endPeriod, $company_id, $AppUI->user_id, true); $durnTypes = dPgetSysVal('TaskDurationType'); $link = array(); $sid = 3600 * 24; // assemble the links for the tasks foreach ($tasks as $row) { // the link $link['href'] = "?m=tasks&a=view&task_id=" . $row['task_id']; $link['alt'] = $row['project_name'] . ":\n" . $row['task_name']; // the link text if (strlen($row['task_name']) > $strMaxLen) { $row['task_name'] = substr($row['task_name'], 0, $strMaxLen) . '...'; } $link['text'] = '<span style="color:' . bestColor($row['color']) . ';background-color:#' . $row['color'] . '">' . $row['task_name'] . '</span>'; // determine which day(s) to display the task $start = new CDate($row['task_start_date']); $end = $row['task_end_date'] ? new CDate($row['task_end_date']) : null; $durn = $row['task_duration']; $durnType = $row['task_duration_type']; if (($start->after($startPeriod) || $start->equals($startPeriod)) && ($start->before($endPeriod) || $start->equals($endPeriod))) { $temp = $link; $temp['alt'] = "START [" . $row['task_duration'] . ' ' . $AppUI->_($durnTypes[$row['task_duration_type']]) . "]\n" . $link['alt']; if ($a != 'day_view') { $temp['text'] = dPshowImage(dPfindImage('block-start-16.png')) . $temp['text']; } $links[$start->format(FMT_TIMESTAMP_DATE)][] = $temp; } if ($end && $end->after($startPeriod) && $end->before($endPeriod) && $start->before($end)) { $temp = $link; $temp['alt'] = "FINISH\n" . $link['alt']; if ($a != 'day_view') { $temp['text'] .= dPshowImage(dPfindImage('block-end-16.png')); } $links[$end->format(FMT_TIMESTAMP_DATE)][] = $temp; } // convert duration to days if ($durnType < 24.0) { if ($durn > $dPconfig['daily_working_hours']) { $durn /= $dPconfig['daily_working_hours']; } else { $durn = 0.0; } } else { $durn *= $durnType / 24.0; } // fill in between start and finish based on duration // notes: // start date is not in a future month, must be this or past month // start date is counted as one days work // business days are not taken into account $target = $start; $target->addSeconds($durn * $sid); if (Date::compare($target, $startPeriod) < 0) { continue; } if (Date::compare($start, $startPeriod) > 0) { $temp = $start; $temp->addSeconds($sid); } else { $temp = $startPeriod; } // Optimised for speed, AJD. while (Date::compare($endPeriod, $temp) > 0 && Date::compare($target, $temp) > 0 && ($end == null || $temp->before($end))) { $links[$temp->format(FMT_TIMESTAMP_DATE)][] = $link; $temp->addSeconds($sid); } } }
/** * Document::db_dateTime2locale() * * { Description } * */ function db_dateTime2locale($dateTime, $format) { if (intval($dateTime)) { $date = new CDate($dateTime); return $date->format($format); } else { return null; } }
/** * CMonthCalendar::_drawMain() * * { Description } * */ function _drawMain() { global $AppUI; $today = new CDate(); $today = $today->format('%Y%m%d%w'); $date = $this->this_month; $this_day = intval($date->getDay()); $this_month = intval($date->getMonth()); $this_year = intval($date->getYear()); setlocale(LC_TIME, 'en_AU'); $cal = Date_Calc::getCalendarMonth($this_month, $this_year, '%Y%m%d%w', LOCALE_FIRST_DAY); setlocale(LC_ALL, $AppUI->user_lang); $df = $AppUI->getPref('SHDATEFORMAT'); $html = ''; foreach ($cal as $week) { $html .= "\n<tr>"; if ($this->showWeek) { $html .= "\n\t" . '<td class="week">'; $html .= $this->dayFunc ? '<a href="javascript:' . $this->weekFunc . "('" . $week[0] . "')" . '">' : ''; $html .= dPshowImage(dPfindImage('view.week.gif'), 16, 15, $AppUI->_('Week View')); $html .= $this->dayFunc ? '</a>' : ''; $html .= "</td>"; } foreach ($week as $day) { $this_day = new CDate($day); $y = intval(substr($day, 0, 4)); $m = intval(substr($day, 4, 2)); $d = intval(substr($day, 6, 2)); $dow = intval(substr($day, 8, 1)); if ($m != $this_month) { $class = 'empty'; } else { if ($day == $today) { $class = 'today'; } else { if ($dow == 0 || $dow == 6) { $class = 'weekend'; } else { $class = 'day'; } } } $day = substr($day, 0, 8); $html .= "\n\t" . '<td class="' . $class . '"'; if ($this->showHighlightedDays && isset($this->highlightedDays[$day])) { $html .= ' style="border: 1px solid ' . $this->highlightedDays[$day] . '"'; } $html .= ' onclick="' . $this->dayFunc . "('" . $day . "','" . $this_day->format($df) . "')" . '">'; if ($m == $this_month) { if ($this->dayFunc) { $html .= '<a href="javascript:' . $this->dayFunc . "('" . $day . "','" . $this_day->format($df) . "')" . '" class="' . $class . '">'; } $html .= $d . ($this->dayFunc ? '</a>' : ''); if ($this->showEvents) { $html .= $this->_drawEvents(substr($day, 0, 8)); } } $html .= "</td>"; } $html .= "\n</tr>"; } return $html; }
/** * Called by the Event Queue processor to process a reminder * on a task. * @access public * @param string $module Module name (not used) * @param string $type Type of event (not used) * @param integer $id ID of task being reminded * @param integer $owner Originator of event * @param mixed $args event-specific arguments. * @return mixed true, dequeue event, false, event stays in queue. -1, event is destroyed. */ function remind($module, $type, $id, $owner, &$args) { global $locale_char_set, $AppUI; $q = new DBQuery(); $df = $AppUI->getPref('SHDATEFORMAT'); $tf = $AppUI->getPref('TIMEFORMAT'); // If we don't have preferences set for these, use ISO defaults. if (!$df) { $df = '%Y-%m-%d'; } if (!$tf) { $tf = '%H:%m'; } $df .= ' ' . $tf; // At this stage we won't have an object yet if (!$this->load($id)) { return -1; // No point it trying again later. } $this->htmlDecode(); // Only remind on working days. $today = new CDate(); if (!$today->isWorkingDay()) { return true; } // Check if the task is completed if ($this->task_percent_complete == 100) { return -1; } // Grab the assignee list $q->addTable('user_tasks', 'ut'); $q->leftJoin('users', 'u', 'u.user_id = ut.user_id'); $q->leftJoin('contacts', 'c', 'c.contact_id = u.user_contact'); $q->addQuery('c.contact_id, contact_first_name, contact_last_name, contact_email'); $q->addWhere('ut.task_id = ' . $id); $contacts = $q->loadHashList('contact_id'); $q->clear(); // Now we also check the owner of the task, as we will need // to notify them as well. $owner_is_not_assignee = false; $q->addTable('users', 'u'); $q->leftJoin('contacts', 'c', 'c.contact_id = u.user_contact'); $q->addQuery('c.contact_id, contact_first_name, contact_last_name, contact_email'); $q->addWhere('u.user_id = ' . $this->task_owner); if ($q->exec(ADODB_FETCH_NUM)) { list($owner_contact, $owner_first_name, $owner_last_name, $owner_email) = $q->fetchRow(); if (!isset($contacts[$owner_contact])) { $owner_is_not_assignee = true; $contacts[$owner_contact] = array('contact_id' => $owner_contact, 'contact_first_name' => $owner_first_name, 'contact_last_name' => $owner_last_name, 'contact_email' => $owner_email); } } $q->clear(); // build the subject line, based on how soon the // task will be overdue. $starts = new CDate($this->task_start_date); $expires = new CDate($this->task_end_date); $now = new CDate(); $diff = $expires->dateDiff($now); $prefix = $AppUI->_('Task Due', UI_OUTPUT_RAW); if ($diff == 0) { $msg = $AppUI->_('TODAY', UI_OUTPUT_RAW); } else { if ($diff == 1) { $msg = $AppUI->_('TOMORROW', UI_OUTPUT_RAW); } else { if ($diff < 0) { $msg = $AppUI->_(array('OVERDUE', abs($diff), 'DAYS')); $prefix = $AppUI->_('Task', UI_OUTPUT_RAW); } else { $msg = $AppUI->_(array($diff, 'DAYS')); } } } $q->addTable('projects'); $q->addQuery('project_name'); $q->addWhere('project_id = ' . $this->task_project); $project_name = htmlspecialchars_decode($q->loadResult()); $q->clear(); $subject = $prefix . ' ' . $msg . ' ' . $this->task_name . '::' . $project_name; $body = $AppUI->_('Task Due', UI_OUTPUT_RAW) . ': ' . $msg . "\n" . $AppUI->_('Project', UI_OUTPUT_RAW) . ': ' . $project_name . "\n" . $AppUI->_('Task', UI_OUTPUT_RAW) . ': ' . $this->task_name . "\n" . $AppUI->_('Start Date', UI_OUTPUT_RAW) . ': ' . $starts->format($df) . "\n" . $AppUI->_('Finish Date', UI_OUTPUT_RAW) . ': ' . $expires->format($df) . "\n" . $AppUI->_('URL', UI_OUTPUT_RAW) . ': ' . DP_BASE_URL . '/index.php?m=tasks&a=view&task_id=' . $this->task_id . '&reminded=1' . "\n\n" . $AppUI->_('Resources', UI_OUTPUT_RAW) . ":\n"; foreach ($contacts as $contact) { if ($owner_is_not_assignee || $contact['contact_id'] != $owner_contact) { $body .= $contact['contact_first_name'] . ' ' . $contact['contact_last_name'] . ' <' . $contact['contact_email'] . ">\n"; } } $body .= "\n" . $AppUI->_('Description', UI_OUTPUT_RAW) . ":\n" . $this->task_description . "\n"; $mail = new Mail(); foreach ($contacts as $contact) { if ($mail->ValidEmail($contact['contact_email'])) { $mail->To($contact['contact_email']); } } $mail->From('"' . $owner_first_name . ' ' . $owner_last_name . '" <' . $owner_email . '>'); $mail->Subject($subject, $locale_char_set); $mail->Body($body, $locale_char_set); return $mail->Send(); }
echo $AppUI->_('Internal Division'); ?> </td> <td width="100%" nowrap="nowrap" colspan="2"> <?php echo arraySelect($companies_internal, 'project_company_internal', 'class="text" size="1"', $row->project_company_internal); ?> </td> </tr> <tr> <td align="right" nowrap="nowrap"><?php echo $AppUI->_('Start Date'); ?> </td> <td nowrap="nowrap"> <input type="hidden" name="project_start_date" value="<?php echo $start_date->format(FMT_TIMESTAMP_DATE); ?> " /> <input type="text" class="text" name="start_date" id="date1" value="<?php echo $start_date->format($df); ?> " class="text" disabled="disabled" /> <a href="#" onClick="popCalendar('start_date', 'start_date');"> <img src="./images/calendar.gif" width="24" height="12" alt="<?php echo $AppUI->_('Calendar'); ?> " border="0" /> </a> </td> <td rowspan="6" valign="top">
$upd_task = new CTask(); $upd_task->load($key); if ($upd_task->task_id) { $upd_task->removeAssigned($bulk_task_unassign); } } //Action: Other Actions if (isset($_POST['bulk_task_other']) && $bulk_task_other != '') { if ($upd_task->task_id) { //Option 1 - Mark as finished if ($bulk_task_other == '1') { $upd_task->task_percent_complete = 100; if (!$upd_task->task_end_date || $upd_task->task_end_date == '0000-00-00 00:00:00') { $end_date = null; $end_date = new CDate(); $upd_task->task_end_date = $end_date->format(FMT_DATETIME_MYSQL); } $upd_task->store(); //Option 2 - Mark as milestone } elseif ($bulk_task_other == '2') { $upd_task->task_milestone = 1; $upd_task->store(); //Option 3 - Mark as non milestone } elseif ($bulk_task_other == '3') { $upd_task->task_milestone = 0; $upd_task->store(); //Option 4 - Mark as dynamic } elseif ($bulk_task_other == '4') { $upd_task->task_dynamic = 1; $upd_task->store(); //Option 5 - Mark as non dynamic
function displayFiles($folder_id) { global $AppUI, $m, $a, $tab, $page; global $current_uri; global $canAccess, $canRead, $canEdit, $canAuthor, $canDelete; global $canAccess_folders, $canRead_folders, $canEdit_folders; global $canAuthor_folders, $canDelete_folders; global $company_id, $project_id, $task_id; global $allowedCompanies, $allowedProjects, $allowedTasks, $allowedFolders; global $showProject, $cfObj, $dPconfig; $df = $AppUI->getPref('SHDATEFORMAT'); $tf = $AppUI->getPref('TIMEFORMAT'); $file_types = dPgetSysVal('FileType'); $xpg_pagesize = 30; //TODO?: Set by System Config Value ... $xpg_totalrecs = countFiles($folder_id); //get file count for folder $xpg_total_pages = $xpg_totalrecs > $xpg_pagesize ? ceil($xpg_totalrecs / $xpg_pagesize) : 1; $xpg_min = $xpg_pagesize * ($page - 1); // This is where we start our record set from $q = new DBQuery(); // most recent version info per file_project and file_version_id $q->createTemp('files_count_max' . $folder_id); $q->addTable('files', 'f'); $q->addQuery('DISTINCT count(f.file_id) as file_versions' . ', max(f.file_version) as file_lastversion' . ', file_version_id, f.file_project'); $q->addJoin('projects', 'p', 'p.project_id = f.file_project'); $q->addJoin('tasks', 't', 't.task_id = f.file_task'); $q->addJoin('file_folders', 'ff', 'ff.file_folder_id = f.file_folder'); $q->addWhere('f.file_folder = ' . $folder_id); if (count($allowedProjects)) { $q->addWhere('((' . implode(' AND ', $allowedProjects) . ') OR f.file_project = 0)'); } if (count($allowedTasks)) { $q->addWhere('((' . implode(' AND ', $allowedTasks) . ') OR f.file_task = 0)'); } if (count($allowedFolders)) { $q->addWhere('((' . implode(' AND ', $allowedFolders) . ') OR f.file_folder = 0)'); } if ($company_id) { $q->innerJoin('companies', 'co', 'co.company_id = p.project_company'); $q->addWhere('co.company_id = ' . $company_id); if (count($allowedCompanies)) { $q->addWhere('(' . implode(' AND ', $allowedCompanies) . ')'); } } $q->addGroup('f.file_version_id'); $q->addGroup('f.file_project'); $file_version_max_counts = $q->exec(); $q->clear(); // most recent version $q->addTable('files', 'f'); $q->addQuery('f.*, fmc.file_versions, round(fmc.file_lastversion, 2) as file_lastversion' . ', u.user_username as file_owner, ff.file_folder_name' . ', ff.file_folder_id, ff.file_folder_name, p.project_name' . ', p.project_color_identifier, p.project_owner, c.contact_first_name' . ', c.contact_last_name, t.task_name, u.user_username as file_owner' . ', cc.contact_first_name as checkout_first_name' . ', cc.contact_last_name as checkout_last_name'); $q->addJoin('files_count_max' . $folder_id, 'fmc', '(fmc.file_lastversion=f.file_version AND fmc.file_version_id=f.file_version_id' . ' AND fmc.file_project=f.file_project)', 'inner'); $q->addJoin('projects', 'p', 'p.project_id = f.file_project'); $q->addJoin('users', 'u', 'u.user_id = f.file_owner'); $q->addJoin('contacts', 'c', 'c.contact_id = u.user_contact'); $q->addJoin('tasks', 't', 't.task_id = f.file_task'); $q->addJoin('file_folders', 'ff', 'ff.file_folder_id = f.file_folder'); $q->leftJoin('users', 'cu', 'cu.user_id = f.file_checkout'); $q->leftJoin('contacts', 'cc', 'cc.contact_id = cu.user_contact'); $q->addWhere('f.file_folder = ' . $folder_id); if (count($allowedProjects)) { $q->addWhere('((' . implode(' AND ', $allowedProjects) . ') OR f.file_project = 0)'); } if (count($allowedTasks)) { $q->addWhere('((' . implode(' AND ', $allowedTasks) . ') OR f.file_task = 0)'); } if (count($allowedFolders)) { $q->addWhere('((' . implode(' AND ', $allowedFolders) . ') OR f.file_folder = 0)'); } if ($project_id) { $q->addWhere('f.file_project = ' . $project_id); } if ($task_id) { $q->addWhere('f.file_task = ' . $task_id); } if ($company_id) { $q->innerJoin('companies', 'co', 'co.company_id = p.project_company'); $q->addWhere('co.company_id = ' . $company_id); if (count($allowedCompanies)) { $q->addWhere('(' . implode(' AND ', $allowedCompanies) . ')'); } } $q->addOrder('p.project_name'); $q->setLimit($xpg_pagesize, $xpg_min); $files_sql = $q->prepare(); $q->clear(); // all versions $q->addTable('files', 'f'); $q->addQuery('f.*, ff.file_folder_id, ff.file_folder_name, p.project_name' . ', p.project_color_identifier, p.project_owner, c.contact_first_name' . ', c.contact_last_name, t.task_name, u.user_username as file_owner'); $q->addJoin('projects', 'p', 'p.project_id = f.file_project'); $q->addJoin('users', 'u', 'u.user_id = f.file_owner'); $q->addJoin('contacts', 'c', 'c.contact_id = u.user_contact'); $q->addJoin('tasks', 't', 't.task_id = f.file_task'); $q->addJoin('file_folders', 'ff', 'ff.file_folder_id = f.file_folder'); $q->addWhere('f.file_folder = ' . $folder_id); if (count($allowedProjects)) { $q->addWhere('((' . implode(' AND ', $allowedProjects) . ') OR f.file_project = 0)'); } if (count($allowedTasks)) { $q->addWhere('((' . implode(' AND ', $allowedTasks) . ') OR f.file_task = 0)'); } if (count($allowedFolders)) { $q->addWhere('((' . implode(' AND ', $allowedFolders) . ') OR f.file_folder = 0)'); } if ($project_id) { $q->addWhere('f.file_project = ' . $project_id); } if ($task_id) { $q->addWhere('f.file_task = ' . $task_id); } if ($company_id) { $q->innerJoin('companies', 'co', 'co.company_id = p.project_company'); $q->addWhere('co.company_id = ' . $company_id); if (count($allowedCompanies)) { $q->addWhere('(' . implode(' AND ', $allowedCompanies) . ')'); } } $file_versions_sql = $q->prepare(); $q->clear(); //file arrays $files = array(); $file_versions = array(); if ($canRead) { $files = db_loadList($files_sql); $file_versions = db_loadHashList($file_versions_sql, 'file_id'); } $q->dropTemp('files_count_max' . $folder_id); $q->exec(); if ($files == array()) { return; } ?> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"> <tr> <th nowrap="nowrap"><?php echo $AppUI->_('File Name'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Description'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Versions'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Category'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Task Name'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Owner'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Size'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Date'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('co Reason'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('co'); ?> </th> <th nowrap width="1"></th> <th nowrap width="1"></th> </tr> <?php $fp = -1; $file_date = new CDate(); $id = 0; foreach ($files as $row) { $file_date = new CDate($row['file_date']); $canEdit_file = getPermission('files', 'edit', $row['file_id']); //single file if ($fp != $row['file_project']) { if (!$row['file_project']) { $row['project_name'] = $AppUI->_('Not associated to projects'); $row['project_color_identifier'] = 'f4efe3'; } if ($showProject) { $style = 'background-color:#' . $row['project_color_identifier'] . ';color:' . bestColor($row['project_color_identifier']); ?> <tr> <td colspan="20" style="border: outset 2px #eeeeee;<?php echo $style; ?> "> <a href="?m=projects&a=view&project_id=<?php echo $row['file_project']; ?> "> <span style="<?php echo $style; ?> "><?php echo $row['project_name']; ?> </span></a> </td> </tr> <?php } } $fp = $row['file_project']; ?> <form name="frm_remove_file_<?php echo $row['file_id']; ?> " action="?m=files" method="post"> <input type="hidden" name="dosql" value="do_file_aed" /> <input type="hidden" name="del" value="1" /> <input type="hidden" name="file_id" value="<?php echo $row['file_id']; ?> " /> <input type="hidden" name="redirect" value="<?php echo $current_uri; ?> " /> </form> <form name="frm_duplicate_file_<?php echo $row['file_id']; ?> " action="?m=files" method="post"> <input type="hidden" name="dosql" value="do_file_aed" /> <input type="hidden" name="duplicate" value="1" /> <input type="hidden" name="file_id" value="<?php echo $row['file_id']; ?> " /> <input type="hidden" name="redirect" value="<?php echo $current_uri; ?> " /> </form> <tr> <td nowrap="8%"> <?php $file_icon = getIcon($row['file_type']); ?> <a href="./fileviewer.php?file_id=<?php echo $row['file_id']; ?> " title="<?php echo $row['file_description']; ?> "> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/' . $file_icon, '16', '16'); ?> <?php echo $row['file_name']; ?> </a> </td> <td width="20%"><?php echo $row['file_description']; ?> </td> <td width="5%" nowrap="nowrap" align="center"> <?php $hidden_table = ''; echo $row['file_lastversion']; if ($row['file_versions'] > 1) { ?> <a href="#" onClick="expand('versions_<?php echo $row['file_id']; ?> ');"> (<?php echo $row['file_versions']; ?> ) </a> <?php } ?> </td> <td width="10%" nowrap="nowrap" align="center"> <?php echo $file_types[$row['file_category']]; ?> </td> <td width="5%" align="center"> <a href="./index.php?m=tasks&a=view&task_id=<?php echo $row['file_task']; ?> "> <?php echo $row['task_name']; ?> </a> </td> <td width="15%" nowrap="nowrap"> <?php echo $row["contact_first_name"] . ' ' . $row["contact_last_name"]; ?> </td> <td width="5%" nowrap="nowrap" align="right"> <?php echo file_size(intval($row['file_size'])); ?> </td> <td width="15%" nowrap="nowrap" align="right"> <?php echo $file_date->format($df . ' ' . $tf); ?> </td> <td width="10%"><?php echo $row['file_co_reason']; ?> </td> <td nowrap="nowrap" align="center"> <?php if ($canEdit && empty($row['file_checkout'])) { ?> <a href="?m=files&a=co&file_id=<?php echo $row['file_id']; ?> "> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/up.png', '16', '16', 'checkout', 'checkout file'); ?> </a> <?php } else { if ($row['file_checkout'] == $AppUI->user_id) { ?> <a href="?m=files&a=addedit&ci=1&file_id=<?php echo $row['file_id']; ?> "> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/down.png', '16', '16', 'checkin', 'checkin file'); ?> </a> <?php } else { if ($file['file_checkout'] == 'final') { echo ' ' . $AppUI->_('final'); } else { echo ' ' . $row['checkout_first_name'] . ' ' . $row['checkout_last_name'] . '<br />(' . $row['co_user'] . ')'; } } } ?> </td> <td nowrap="nowrap" align="right" width="48"> <?php if (empty($row['file_checkout']) || $row['file_checkout'] == 'final') { // Edit File if ($canEdit || $row['project_owner'] == $AppUI->user_id) { ?> <a href="./index.php?m=files&a=addedit&file_id=<?php echo $row['file_id']; ?> "> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/kedit.png', '16', '16', 'edit file', 'edit file'); ?> </a> <?php } // Duplicate File if ($canAuthor || $row['project_owner'] == $AppUI->user_id) { ?> <a href="#" onclick="document.frm_duplicate_file_<?php echo $row['file_id']; ?> .submit()"> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/duplicate.png', '16', '16', 'duplicate file', 'duplicate file'); ?> </a> <?php } // Delete File if ($canDelete || $row['project_owner'] == $AppUI->user_id) { ?> <a href="#" onclick="if (confirm('Are you sure you want to delete this file?')) {document.frm_remove_file_<?php echo $row['file_id']; ?> .submit()}"> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/remove.png', '16', '16', 'delete file', 'delete file'); ?> </a> <?php } } ?> </td> <td nowrap="nowrap" align="center" width="1"> <?php if ((empty($row['file_checkout']) || $row['file_checkout'] == 'final') && ($canEdit || $row['project_owner'] == $AppUI->user_id)) { $bulk_op = 'onchange="(this.checked) ? addBulkComponent(' . $row['file_id'] . ') : removeBulkComponent(' . $row['file_id'] . ')"'; ?> <input type="checkbox" <?php echo $bulk_op; ?> name="chk_sub_sel_file_<?php echo $file_row['file_id']; ?> " /> <?php } ?> </td> </tr> <?php if ($row['file_versions'] > 1) { ?> <tr><td colspan="20"> <table style="display: none" id="versions_<?php echo $row['file_id']; ?> " width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"> <tr> <th nowrap="nowrap"><?php echo $AppUI->_('File Name'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Description'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Versions'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Category'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Task Name'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Owner'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Size'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Type'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Date'); ?> </th> <th nowrap="nowrap"width="1"> </th> <th nowrap="nowrap"width="1"> </th> </tr> <?php foreach ($file_versions as $file) { if ($file['file_version_id'] == $row['file_version_id']) { $file_icon = getIcon($file['file_type']); $file_version_date = new Date($file['file_date']); ?> <form name="frm_delete_sub_file_<?php echo $file['file_id']; ?> " action="?m=files" method="post"> <input type="hidden" name="dosql" value="do_file_aed" /> <input type="hidden" name="del" value="1" /> <input type="hidden" name="file_id" value="<?php echo $file['file_id']; ?> " /> <input type="hidden" name="redirect" value="<?php echo $current_uri; ?> " /> </form> <form name="frm_duplicate_sub_file_<?php echo $file['file_id']; ?> " action="?m=files" method="post"> <input type="hidden" name="dosql" value="do_file_aed" /> <input type="hidden" name="duplicate" value="1" /> <input type="hidden" name="file_id" value="<?php echo $file['file_id']; ?> " /> <input type="hidden" name="redirect" value="<?php echo $current_uri; ?> " /> </form> <tr> <td nowrap="8%"> <a href="./fileviewer.php?file_id=<?php echo $file['file_id']; ?> " title="<?php echo $file['file_description']; ?> "> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/' . $file_icon, '16', '16'); ?> <?php echo $file['file_name']; ?> </a> </td> <td width="20%"><?php echo $file['file_description']; ?> </td> <td width="5%" nowrap="nowrap" align="center"><?php echo $file['file_version']; ?> </td> <td width="10%" nowrap="nowrap" align="center"> <?php echo $file_types[$file['file_category']]; ?> </td> <td width="5%" align="center"> <a href="./index.php?m=tasks&a=view&task_id=<?php echo $file['file_task']; ?> "> <?php echo $file['task_name']; ?> </a> </td> <td width="15%" nowrap="nowrap"> <?php echo $file["contact_first_name"] . ' ' . $file["contact_last_name"]; ?> </td> <td width="5%" nowrap="nowrap" align="right"> <?php echo file_size(intval($file['file_size'])); ?> </td> <td nowrap="nowrap"> <?php echo $row['file_type']; ?> </td> <td width="15%" nowrap="nowrap" align="right"> <?php echo $file_version_date->format($df . ' ' . $tf); ?> </td> <td nowrap="nowrap" align="right" width="48"> <?php if (empty($file['file_checkout']) || $file['file_checkout'] == 'final') { // Edit File if ($canEdit || $row['project_owner'] == $AppUI->user_id) { ?> <a href="./index.php?m=files&a=addedit&file_id=<?php echo $row['file_id']; ?> "> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/kedit.png', '16', '16', 'edit file', 'edit file'); ?> </a> <?php } // Duplicate File if ($canAuthor) { ?> <a href="#" onclick="document.frm_duplicate_file_<?php echo $row['file_id']; ?> .submit()"> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/duplicate.png', '16', '16', 'duplicate file', 'duplicate file'); ?> </a> <?php } // Delete File if ($canDelete) { ?> <a href="#" onclick="if (confirm('<?php echo $AppUI->_('Are you sure you want to delete this file?'); ?> ')) {document.frm_remove_file_<?php echo $row['file_id']; ?> .submit()}"> <?php echo dPshowImage(DP_BASE_URL . '/modules/files/images/remove.png', '16', '16', 'delete file', $AppUI->_('delete file')); ?> </a> <?php } } ?> </td> <td nowrap="nowrap" align="center" width="1"> <?php if ((empty($row['file_checkout']) || $row['file_checkout'] == 'final') && ($canEdit || $row['project_owner'] == $AppUI->user_id)) { $bulk_op = 'onchange="(this.checked) ? addBulkComponent(' . $row['file_id'] . ') : removeBulkComponent(' . $row['file_id'] . ')"'; ?> <input type="checkbox" <?php echo $bulk_op; ?> name="chk_sub_sel_file_<?php echo $file_row['file_id']; ?> " /> <?php } ?> </td> </tr> <?php } } ?> </table> </td></tr> <?php } } ?> </table> <?php shownavbar($xpg_totalrecs, $xpg_pagesize, $xpg_total_pages, $page, $folder_id); echo "<br />"; }
/** * CMonthCalendar::_drawMain() * * { Description } * */ function _drawMain() { global $AppUI; $today = new CDate(); $today = $today->format("%Y%m%d%w"); $date = $this->this_month; $this_day = intval($date->getDay()); $this_month = intval($date->getMonth()); $this_year = intval($date->getYear()); $cal = Date_Calc::getCalendarMonth($this_month, $this_year, "%Y%m%d%w", LOCALE_FIRST_DAY); $df = $AppUI->getPref('SHDATEFORMAT'); $html = ''; foreach ($cal as $week) { $html .= "\n<tr>"; if ($this->showWeek) { $html .= "\n\t<td class=\"week\">"; $html .= $this->dayFunc ? "<a href=\"javascript:{$this->weekFunc}('{$week['0']}')\">" : ''; $html .= '<img src="./images/view.week.gif" width="16" height="15" border="0" alt="Week View" /></a>'; $html .= $this->dayFunc ? "</a>" : ''; $html .= "\n\t</td>"; } foreach ($week as $day) { $this_day = new CDate($day); $y = intval(substr($day, 0, 4)); $m = intval(substr($day, 4, 2)); $d = intval(substr($day, 6, 2)); $dow = intval(substr($day, 8, 1)); if ($m != $this_month) { $class = 'empty'; } else { if ($day == $today) { $class = 'today'; } else { if ($dow == 0 || $dow == 6) { $class = 'weekend'; } else { $class = 'day'; } } } $day = substr($day, 0, 8); $html .= "\n\t<td class=\"{$class}\""; if ($this->showHighlightedDays && isset($this->highlightedDays[$day])) { $html .= " style=\"border: 1px solid " . $this->highlightedDays[$day] . "\""; } $html .= ">"; if ($m == $this_month) { if ($this->dayFunc) { $html .= "<a href=\"javascript:{$this->dayFunc}('{$day}','" . $this_day->format($df) . "')\" class=\"{$class}\">"; $html .= "{$d}"; $html .= "</a>"; } else { $html .= "{$d}"; } if ($this->showEvents) { $html .= $this->_drawEvents(substr($day, 0, 8)); } } $html .= "\n\t</td>"; } $html .= "\n</tr>"; } return $html; }
<?php $total_sum += $sum_project; } ?> <tr> <td> </th> <td style="text-align:center; font-weight:bold;"><?php echo $AppUI->_('Total'); ?> :</td> <?php $date = new CDate($start_report); for ($i = 1; $i <= $start_report->getDaysInMonth(); $i++) { ?> <td style="text-align:center; font-weight:bold; "><?php echo sprintf("%.1f", $user_by_day[$date->format('%Y-%m-%d')]); ?> </td> <?php $date->addDays(1); } ?> <td style="text-align:center;"><strong> <?php echo sprintf("%.1f", $total_sum); ?> </strong></td> </tr> </table>
echo "?m=holiday&a=addedit&holiday_id=" . $row["holiday_id"]; ?> '><img src="./images/icons/pencil.gif" title="<?php echo $AppUI->_('Edit holiday'); ?> " border="0" width="12" height="12"></a></td> <td><?php echo $row["holiday_description"]; ?> </td> <td width=100 nowrap="nowrap"><?php echo $tmp_start_date->format($AppUI->getPref('SHDATEFORMAT')); ?> </td> <td width=100 nowrap="nowrap"><?php echo $tmp_end_date->format($AppUI->getPref('SHDATEFORMAT')); ?> </td> <td width="100" nowrap="nowrap"><?php echo $row["holiday_annual"] ? 'Yes' : 'No'; ?> </td> </tr> <?php } ?> </table> <table width="100%" border="0" cellpadding="3" cellspacing="1"> <tr valign="top"> <td align="left"><?php echo $AppUI->_('Blacklist items allows you to ignore holidays not viable in your region');
if (!$log_all) { $sql .= "\n\tAND task_log_date >= '" . $start_date->format(FMT_DATETIME_MYSQL) . "'" . "\n\tAND task_log_date <= '" . $end_date->format(FMT_DATETIME_MYSQL) . "'"; } if ($log_ignore) { $sql .= "\n\tAND task_log_hours > 0"; } if ($log_userfilter) { $sql .= "\n\tAND task_log_creator = {$log_userfilter}"; } echo $sql; $proj =& new CProject(); $allowedProjects = $proj->getAllowedSQL($AppUI->user_id, 'task_project'); if (count($allowedProjects)) { $sql .= "\n AND " . implode(" AND ", $allowedProjects); } $sql .= " ORDER BY task_log_date"; //echo "<pre>$sql</pre>"; $logs = db_loadList($sql); echo db_error(); $hours = 0.0; $pdfdata = array(); foreach ($logs as $log) { $date = new CDate($log['task_log_date']); $hours += $log['task_log_hours']; $pdfdata[] = array($log['creator'], $log['task_log_name'], $log['task_log_description'], $date->format($df), sprintf("%.2f", $log['task_log_hours']), $log['task_log_costcode']); echo $date->format($df); printf("%.2f", $log['task_log_hours']); } $pdfdata[] = array('', '', '', $AppUI->_('Total Hours') . ':', sprintf("%.2f", $hours), ''); echo " Total de Horas"; printf("%.2f", $hours);
while ($row = db_fetch_assoc($res)) { $resources[$row['task_id']][$row['resource_id']] = $row['resource_name'] . " [" . $row['percent_allocated'] . "%]"; } $q->clear(); } // Build the data columns foreach ($tasks as $task_id => $detail) { $row =& $pdfdata[]; $row[] = $detail['task_name']; $row[] = $detail['user_username']; $row[] = implode("\n", $assigned_users[$task_id]); if ($hasResources) { $row[] = implode("\n", $resources[$task_id]); } $end_date = new CDate($detail['task_end_date']); $row[] = $end_date->format($df); } // --------------------------------------------------------- //Tcpdf Report Output [Itsutsubashi-K.Sen-200808-17] //Itsutsubashi-K.Sen-20090814 require_once DP_BASE_DIR . '/lib/tcpdf/config/lang/jpn.php'; require_once DP_BASE_DIR . '/lib/tcpdf/tcpdf.php'; //Define Placement Parameters $header_w = 30; $header_h = 4; $header_line_gap = 5; $str_pad = 5; $l_gap = 0; $cell_height = 7; $width = 20; $x_start = PDF_MARGIN_LEFT;
function build_date_list(&$date_array, $row) { global $tracked_dynamics, $project; // if this task_dynamic is not tracked, set end date to proj start date if (!in_array($row['task_dynamic'], $tracked_dynamics)) { $date = new CDate($project->project_start_date); } elseif ($row['task_milestone'] == 0) { $date = new CDate($row['task_end_date']); } else { $date = new CDate($row['task_start_date']); } $sdate = $date->format("%d/%m/%Y"); $shour = $date->format("%H"); $smin = $date->format("%M"); $date_array[$row['task_id']] = array($row['task_name'], $sdate, $shour, $smin); }
$other_users = false; $no_modify = false; $start_date = new CDate('0000-00-00 00:00:00'); $end_date = new CDate('9999-12-31 23:59:59'); // assemble the links for the events $events = CEvent::getEventsForPeriod($start_date, $end_date, 'all', 0, 0, $company_id); $start_hour = w2PgetConfig('cal_day_start'); $end_hour = w2PgetConfig('cal_day_end'); $tf = $AppUI->getPref('TIMEFORMAT'); $df = $AppUI->getPref('SHDATEFORMAT'); $types = w2PgetSysVal('EventType'); $html = '<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">'; $html .= '<tr><th>' . $AppUI->_('Date') . '</th><th>' . $AppUI->_('Type') . '</th><th>' . $AppUI->_('Event') . '</th></tr>'; foreach ($events as $row) { $html .= '<tr>'; $start = new CDate($row['event_start_date']); $end = new CDate($row['event_end_date']); $html .= '<td width="25%" nowrap="nowrap">' . $start->format($df . ' ' . $tf) . ' - '; $html .= $end->format($df . ' ' . $tf) . '</td>'; $href = '?m=calendar&a=view&event_id=' . $row['event_id']; $alt = $row['event_description']; $html .= '<td width="10%" nowrap="nowrap">'; $html .= w2PshowImage('event' . $row['event_type'] . '.png', 16, 16, '', '', 'calendar'); $html .= ' <b>' . $AppUI->_($types[$row['event_type']]) . '</b><td>'; $html .= $href ? '<a href="' . $href . '" class="event" title="' . $alt . '">' : ''; $html .= $row['event_title']; $html .= $href ? '</a>' : ''; $html .= '</td></tr>'; } $html .= '</table>'; echo $html;
echo $AppUI->_('Progress'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Hours Worked'); ?> </th> <th nowrap="nowrap"> </th> </tr> <tr valign="top"> <?php $log_date = new CDate($obj->task_log_date); ?> <td> <input type="hidden" name="task_log_date" value="<?php echo $log_date->format(FMT_DATETIME_MYSQL); ?> "> <input type="text" name="log_date" size="10" value="<?php echo $log_date->format($df); ?> " class="text" disabled="disabled"> <a href="#" onClick="popCalendar('log_date')"> <img src="./images/calendar.gif" width="24" height="12" alt="<?php echo $AppUI->_('Calendar'); ?> " border="0" /> </a> </td> <td> <?php
<?php if (!defined('DP_BASE_DIR')) { die('You should not call this file directly.'); } require_once $AppUI->getSystemClass('ui'); require_once $AppUI->getSystemClass('date'); $df = $AppUI->getPref('SHDATEFORMAT'); $date = dPgetCleanParam($_GET, 'date'); $field = dPgetCleanParam($_GET, 'field'); $this_day = new CDate($date); $formatted_date = $this_day->format($df); ?> <script language="JavaScript" type="text/javascript"> <!-- window.parent.document.<?php echo $field; ?> .value = '<?php echo $formatted_date; ?> '; //--> </script>
function displayWeeks($list, $task, $level, $fromPeriod, $toPeriod) { //start of week $sd = new CDate($fromPeriod); $days_from_start = $sd->getDayOfWeek(); for ($i = 0; $i < $days_from_start; $i++) { $stmp = $sd->getPrevDay(); $sd = new CDate($stmp->format('%Y-%m-%d 00:00:00')); } //end of week $ed = new CDate($toPeriod); $days_spent = $ed->getDayOfWeek(); for ($i = 6 - $days_spent; $i > 0; $i--) { $etmp = $ed->getNextDay(); $ed = new CDate($etmp->format('%Y-%m-%d 23:59:59')); } $st = new CDate($task->task_start_date); $et = new CDate($task->task_end_date); $row = ''; while ($sd->before($ed)) { $sd_end = new CDate($sd->format('%Y-%m-%d 00:00:00')); $sd_end->addSeconds(7 * 24 * 3600); //add one week if ($sd->after($st) && $sd_end->before($et) || $st->before($sd_end) && !$st->before($sd) || $et->after($sd) && !$et->after($sd_end)) { /* * generate visually distiguishable colors for up to 12 task levels * Color will just be blue (#0000FF) for levels 12th and up. */ $red_key = 12 - floor($level / 3) * 3; $red_key = $red_key > 15 ? 15 : ($red_key < 0 ? 0 : $red_key); $green_key_1 = $red_key + 4 - $level % 3 * 4; $green_key_1 = $green_key_1 > 15 ? 15 : ($green_key_1 < 0 ? 0 : $green_key_1); $green_key_2 = $green_key_1 == $red_key ? 0 : $green_key_1; $color_hex = mb_strtoupper('#' . dechex($red_key) . '0' . dechex($green_key_1) . dechex($green_key_2) . 'FF'); $row .= '<td nowrap="nowrap" style="background:' . $color_hex . ';" >'; } else { $row .= '<td nowrap="nowrap">'; } $row .= ' </td>'; $sd->addSeconds(7 * 24 * 3600); //add one week } return $row; }
function formatTime($uts) { global $AppUI; $date = new CDate(); $date->setDate($uts, DATE_FORMAT_UNIXTIME); return $date->format($AppUI->getPref('SHDATEFORMAT')); }
if (!$end) { $end = $start; $caption .= $AppUI->_('(no end date)'); } else { $cap = ''; } if ($showLabels) { $caption .= $t['project_name'] . ' (' . $t['perc_assignment'] . '%)'; /* $caption .= (($p['project_status']) != 7 ? $AppUI->_('active') : $AppUI->_('inactive')); */ } if ($t['task_milestone'] != 1) { $enddate = new CDate($end); $startdate = new CDate($start); $bar = new GanttBar($row++, array($name, $startdate->format($df), $enddate->format($df), ' '), $start, $actual_end, $cap, $t['task_dynamic'] == 1 ? 0.1 : 0.6); if (is_file(TTF_DIR . 'FreeSans.ttf')) { $bar->title->SetFont(FF_CUSTOM, FS_NORMAL, 10); } $bar->SetFillColor('#' . $t['project_color_identifier']); $bar->SetPattern(BAND_SOLID, '#' . $t['project_color_identifier']); //adding captions $bar->caption = new TextProperty($caption); $bar->caption->Align('left', 'center'); } else { $bar = new MileStone($row++, $name, $start, substr($start, 0, 10)); $bar->title->SetColor('#CC0000'); } $graph2->Add($bar); // If showAllGant checkbox is checked }
<a href="javascript: void(0);" onclick="expand_collapse(\'component'+li+'_desc\', \'tblProjects\')"><img id="component'+li+'_desc_expand" src="<?php echo w2PfindImage('icons/expand.gif', $m); ?> " width="12" height="12" border="0"><img id="component'+li+'_desc_collapse" src="<?php echo w2PfindImage('icons/collapse.gif', $m); ?> " width="12" height="12" border="0" style="display:none"></a><?php echo w2PendTip(); ?> '; oCell.innerHTML =htmltxt; newtr.appendChild(oCell); oCell = document.createElement('td'); htmltxt = ''; htmltxt +='<input type="hidden" id="add_task_start_date_'+line_nr+'" name="add_task_start_date_'+line_nr+'" value="<?php echo $today->format(FMT_TIMESTAMP); ?> " />'; htmltxt +='<input type="text" onchange="setDate(\'editFrm\', \'start_date_'+line_nr+'\');" class="text" style="width:130px;" id="start_date_'+line_nr+'" name="start_date_'+line_nr+'" value="<?php echo $today->format($cf); ?> " />'; htmltxt +='<a href="javascript: void(0);" onclick="return showCalendar(\'start_date_'+line_nr+'\', \'<?php echo $cf; ?> \', \'editFrm\', \'<?php echo strpos($cf, '%p') !== false ? '12' : '24'; ?> \', true)" >'; htmltxt +=' <img src="<?php echo w2PfindImage('calendar.gif', $m);
$bar->setColor('darkgray'); $bar->SetFillColor('darkgray'); $bar->SetPattern(BAND_SOLID, 'gray'); $bar->progress->SetFillColor('darkgray'); $bar->progress->SetPattern(BAND_SOLID, 'gray', 98); } $q = new DBQuery(); $q->addTable('task_dependencies'); $q->addQuery('dependencies_task_id'); $q->addWhere('dependencies_req_task_id=' . (int) $a['task_id']); $query = $q->loadList(); foreach ($query as $dep) { // find row num of dependencies for ($d = 0, $d_cmp = count($gantt_arr); $d < $d_cmp; $d++) { if ($gantt_arr[$d][0]['task_id'] == $dep['dependencies_task_id']) { $bar->SetConstrain($d, CONSTRAIN_ENDSTART); } } } unset($query); $q->clear(); $graph->Add($bar); } unset($gantt_arr); $today = new CDate(); $vline = new GanttVLine($today->format(FMT_TIMESTAMP_DATE), $AppUI->_('Today', UI_OUTPUT_RAW)); if (is_file(TTF_DIR . 'FreeSans.ttf')) { $vline->title->SetFont(FF_CUSTOM, FS_BOLD, 10); } $graph->Add($vline); $graph->Stroke();
function displayFiles($folder) { global $m, $a, $tab, $AppUI, $xpg_min, $xpg_pagesize; global $deny1, $deny2, $project_id, $task_id, $showProject, $file_types, $cfObj; global $xpg_totalrecs, $xpg_total_pages, $page; global $company_id, $allowed_companies, $current_uri, $dPconfig; $canEdit = !getDenyEdit($m, $folder); $canRead = !getDenyRead($m, $folder); $df = $AppUI->getPref('SHDATEFORMAT'); $tf = $AppUI->getPref('TIMEFORMAT'); // SETUP FOR FILE LIST $q = new DBQuery(); $q->addTable('files'); $q->addQuery('files.*,count(file_version) as file_versions,round(max(file_version), 2) as file_lastversion,file_folder_id, file_folder_name,project_name, project_color_identifier,contact_first_name, contact_last_name,task_name,task_id'); $q->addJoin('projects', 'p', 'p.project_id = file_project'); $q->addJoin('users', 'u', 'u.user_id = file_owner'); $q->addJoin('contacts', 'c', 'c.contact_id = u.user_contact'); $q->addJoin('tasks', 't', 't.task_id = file_task'); $q->addJoin('file_folders', 'ff', 'ff.file_folder_id = file_folder'); $q->addWhere('file_folder = ' . $folder); if (count($deny1) > 0) { $q->addWhere('file_project NOT IN (' . implode(',', $deny1) . ')'); } if (count($deny2) > 0) { $q->addWhere('file_task NOT IN (' . implode(',', $deny2) . ')'); } if ($project_id) { $q->addWhere('file_project = ' . $project_id); } if ($task_id) { $q->addWhere('file_task = ' . $task_id); } if ($company_id) { $q->innerJoin('companies', 'co', 'co.company_id = p.project_company'); $q->addWhere('company_id = ' . $company_id); $q->addWhere('company_id IN (' . $allowed_companies . ')'); } $q->addGroup('file_folder'); $q->addGroup('project_name'); $q->addGroup('file_name'); $q->addOrder('file_folder'); $q->addOrder('project_name'); $q->addOrder('file_name'); $q->setLimit($xpg_pagesize, $xpg_min); $files_sql = $q->prepare(); $q->clear(); $q = new DBQuery(); $q->addTable('files'); $q->addQuery('files.file_id, file_version, file_project, file_name, file_task, file_description, user_username as file_owner, file_size, file_category, file_type, file_date, file_folder_name'); $q->addJoin('projects', 'p', 'p.project_id = file_project'); $q->addJoin('users', 'u', 'u.user_id = file_owner'); $q->addJoin('tasks', 't', 't.task_id = file_task'); $q->addJoin('file_folders', 'ff', 'ff.file_folder_id = file_folder'); $q->addWhere('file_folder = ' . $folder); if ($project_id) { $q->addWhere('file_project = ' . $project_id); } if ($task_id) { $q->addWhere('file_task = ' . $task_id); } if ($company_id) { $q->innerJoin('companies', 'co', 'co.company_id = p.project_company'); $q->addWhere('company_id = ' . $company_id); $q->addWhere('company_id IN (' . $allowed_companies . ')'); } $file_versions_sql = $q->prepare(); $q->clear(); $files = array(); $file_versions = array(); if ($canRead) { $files = db_loadList($files_sql); $file_versions = db_loadList($file_versions_sql); } if ($files === array()) { return 0; } ?> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"> <tr> <th nowrap="nowrap"><?php echo $AppUI->_('File Name'); ?> </th> <th><?php echo $AppUI->_('Description'); ?> </th> <th><?php echo $AppUI->_('Versions'); ?> </th> <th><?php echo $AppUI->_('Category'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('Task Name'); ?> </th> <th><?php echo $AppUI->_('Owner'); ?> </th> <th><?php echo $AppUI->_('Size'); ?> </th> <th><?php echo $AppUI->_('Type'); ?> </a></th> <th><?php echo $AppUI->_('Date'); ?> </th> <th nowrap="nowrap"><?php echo $AppUI->_('co Reason'); ?> </th> <th><?php echo $AppUI->_('co'); ?> </th> <th nowrap width="1"></th> <th nowrap width="1"></th> </tr> <?php $fp = -1; $file_date = new CDate(); $id = 0; foreach ($files as $row) { $file_date = new CDate($row['file_date']); if ($fp != $row["file_project"]) { if (!$row["project_name"]) { $row["project_name"] = $AppUI->_('All Projects'); $row["project_color_identifier"] = 'f4efe3'; } if ($showProject) { $s = '<tr>'; $s .= '<td colspan="20" style="background-color:#' . $row["project_color_identifier"] . '">'; $s .= '<font color="' . bestColor($row["project_color_identifier"]) . '">'; if ($row['file_project'] > 0) { $href = './index.php?m=projects&a=view&project_id=' . $row['file_project']; } else { $href = './index.php?m=projects'; } $s .= '<a href="' . $href . '">' . $row["project_name"] . '</a>'; $s .= '</font></td></tr>'; echo $s; } } $fp = $row["file_project"]; if ($row['file_versions'] > 1) { $file = last_file($file_versions, $row['file_name'], $row['file_project']); } else { $file = $row; } ?> <form name="frm_remove_file_<?php echo $file['file_id']; ?> " action="?m=files" method="post"> <input type="hidden" name="dosql" value="do_file_aed" /> <input type="hidden" name="del" value="1" /> <input type="hidden" name="file_id" value="<?php echo $file['file_id']; ?> " /> <input type="hidden" name="redirect" value="<?php echo $current_uri; ?> " /> </form> <form name="frm_duplicate_file_<?php echo $file['file_id']; ?> " action="?m=files" method="post"> <input type="hidden" name="dosql" value="do_file_aed" /> <input type="hidden" name="duplicate" value="1" /> <input type="hidden" name="file_id" value="<?php echo $file['file_id']; ?> " /> <input type="hidden" name="redirect" value="<?php echo $current_uri; ?> " /> </form> <tr> <td nowrap="8%"> <?php $file_icon = getIcon($row['file_type']); echo "<a href=\"./fileviewer.php?file_id={$file['file_id']}\" title=\"{$file['file_description']}\"><img border=\"0\" width=\"16\" heigth=\"16\" src=\"" . DP_BASE_URL . "/modules/files/images/{$file_icon}\" /> {$row['file_name']}</a>"; ?> </td> <td width="20%"><?php echo $file['file_description']; ?> </td> <td width="5%" nowrap="nowrap" align="center"> <?php $hidden_table = ''; echo $row['file_lastversion']; if ($row['file_versions'] > 1) { echo ' <a href="#" onClick="expand(\'versions_' . $file['file_id'] . '\'); ">(' . $row['file_versions'] . ')</a>'; $hidden_table = '<tr><td colspan="20"> <table style="display: none" id="versions_' . $file['file_id'] . '" width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl"> <tr> <th nowrap="nowrap">' . $AppUI->_('File Name') . '</th> <th>' . $AppUI->_('Description') . '</th> <th>' . $AppUI->_('Versions') . '</th> <th>' . $AppUI->_('Category') . '</th> <th nowrap="nowrap">' . $AppUI->_('Task Name') . '</th> <th>' . $AppUI->_('Owner') . '</th> <th>' . $AppUI->_('Size') . '</th> <th>' . $AppUI->_('Type') . '</a></th> <th>' . $AppUI->_('Date') . '</th> <th nowrap="nowrap">' . $AppUI->_('co Reason') . '</th> <th>' . $AppUI->_('co') . '</th> <th nowrap width="1"></th> <th nowrap width="1"></th> </tr> '; foreach ($file_versions as $file_row) { if ($file_row['file_name'] == $row['file_name'] && $file_row['file_project'] == $row['file_project']) { $file_icon = getIcon($file_row['file_type']); $file_date = new CDate($file_row['file_date']); $hidden_table .= ' <form name="frm_delete_sub_file_' . $file_row['file_id'] . '" action="?m=files" method="post"> <input type="hidden" name="dosql" value="do_file_aed" /> <input type="hidden" name="del" value="1" /> <input type="hidden" name="file_id" value="' . $file_row['file_id'] . '" /> <input type="hidden" name="redirect" value="' . $current_uri . '" /> </form>'; $hidden_table .= ' <form name="frm_duplicate_sub_file_' . $file_row['file_id'] . '" action="?m=files" method="post"> <input type="hidden" name="dosql" value="do_file_aed" /> <input type="hidden" name="duplicate" value="1" /> <input type="hidden" name="file_id" value="' . $file_row['file_id'] . '" /> <input type="hidden" name="redirect" value="' . $current_uri . '" /> </form>'; $hidden_table .= ' <tr> <td nowrap="8%"><a href="./fileviewer.php?file_id=' . $file_row['file_id'] . '" title="' . $file_row['file_description'] . '">' . "<img border=\"0\" width=\"16\" heigth=\"16\" src=\"" . DP_BASE_URL . "/modules/files/images/{$file_icon}\" /> " . $file_row['file_name'] . ' </a></td> <td width="20%">' . $file_row['file_description'] . '</td> <td width="5%" nowrap="nowrap" align="center">' . $file_row['file_version'] . '</td> <td width="10%" nowrap="nowrap" align="center"><a href="./index.php?m=' . $m . '&a=' . $a . '&tab=' . ($file_row['file_category'] + 1) . '">' . $file_types[$file_row['file_category'] + 1] . '</a></td> <td width="5%" align="center"><a href="./index.php?m=tasks&a=view&task_id=' . $file_row["file_task"] . '">' . $row["task_name"] . '</a></td> <td width="15%" nowrap="nowrap">' . $row["contact_first_name"] . ' ' . $row["contact_last_name"] . '</td> <td width="5%" nowrap="nowrap" align="right">' . intval($file_row['file_size'] / 1024) . 'kb </td> <td width="15%" nowrap="nowrap">' . $file_row['file_type'] . '</td> <td width="15%" nowrap="nowrap" align="right">' . $file_date->format("{$df} {$tf}") . '</td> <td width="10%">' . $row['file_co_reason'] . '</td> <td nowrap="nowrap" align="center">'; if ($canEdit && empty($file_row['file_checkout'])) { $hidden_table .= '<a href="?m=files&a=co&file_id=' . $file_row['file_id'] . '">' . dPshowImage('./modules/files/images/up.png', '16', '16', 'checkout', 'checkout file') . '</a>'; } else { if ($row['file_checkout'] == $AppUI->user_id) { $hidden_table .= '<a href="?m=files&a=addedit&ci=1&file_id=' . $file_row['file_id'] . '">' . dPshowImage('./modules/files/images/down.png', '16', '16', 'checkin', 'checkin file') . '</a>'; } else { if ($file_row['file_checkout'] == 'final') { $hidden_table .= 'final'; } else { $q4 = new DBQuery(); $q4->addQuery("file_id, file_checkout, user_username as co_user, contact_first_name, contact_last_name"); $q4->addTable('files'); $q4->leftJoin('users', 'cu', 'cu.user_id = file_checkout'); $q4->leftJoin('contacts', 'co', 'co.contact_id = cu.user_contact'); $q4->addWhere('file_id = ' . $file_row['file_id']); $co_user = array(); $co_user = $q4->loadList(); $co_user = $co_user[0]; $q4->clear(); $hidden_table .= $co_user['contact_first_name'] . ' ' . $co_user['contact_last_name'] . '<br>(' . $co_user['co_user'] . ')'; } } } $hidden_table .= '</td>'; $hidden_table .= '<td nowrap="nowrap" align="right" width="48">'; if ($canEdit && (empty($file_row['file_checkout']) || $file_row['file_checkout'] == 'final' && ($canEdit || $row['project_owner'] == $AppUI->user_id))) { $hidden_table .= '<a href="./index.php?m=files&a=addedit&file_id=' . $file_row["file_id"] . '">' . dPshowImage('./modules/files/images/kedit.png', '16', '16', 'edit file', 'edit file') . "</a>" . '<a href="#" onclick="document.frm_duplicate_sub_file_' . $file_row['file_id'] . '.submit()">' . dPshowImage('./modules/files/images/duplicate.png', '16', '16', 'duplicate file', 'duplicate file') . "</a>" . '<a href="#" onclick="if (confirm(\'Are you sure you want to delete this file?\')) {document.frm_delete_sub_file_' . $file_row['file_id'] . '.submit()}">' . dPshowImage('./modules/files/images/remove.png', '16', '16', 'delete file', 'delete file') . "</a>"; } $hidden_table .= '</td>'; $hidden_table .= '<td nowrap="nowrap" align="right" width="1">'; if ($canEdit && (empty($row['file_checkout']) || $row['file_checkout'] == 'final' && ($canEdit || $row['project_owner'] == $AppUI->user_id))) { $bulk_op = 'onchange="(this.checked) ? addBulkComponent(' . $file_row['file_id'] . ') : removeBulkComponent(' . $file_row['file_id'] . ')"'; $hidden_table .= '<input type="checkbox" ' . $bulk_op . ' name="chk_sub_sel_file_' . $file_row['file_id'] . '" />'; } $hidden_table .= '</td>'; $hidden_table .= '</tr>'; } } $hidden_table .= '</table>'; //$hidden_table .= '</span>'; } ?> </td> <td width="10%" nowrap="nowrap" align="center"><a href="./index.php?m=<?php echo $m; ?> &a=<?php echo $a; ?> &view=categories&tab=<?php echo $file['file_category']; ?> "><?php echo $file_types[$file["file_category"]]; ?> </a></td> <td width="5%" align="center"><a href="./index.php?m=tasks&a=view&task_id=<?php echo $file["task_id"]; ?> "><?php echo $file["task_name"]; ?> </a></td> <td width="15%" nowrap="nowrap"><?php echo $file["contact_first_name"] . ' ' . $file["contact_last_name"]; ?> </td> <td width="5%" nowrap="nowrap" align="right"><?php echo intval($file["file_size"] / 1024); ?> kb</td> <td width="15%" nowrap="nowrap"><?php echo $file["file_type"]; ?> </td> <td width="15%" nowrap="nowrap" align="right"><?php echo $file_date->format("{$df} {$tf}"); ?> </td> <td width="10%"><?php echo $file['file_co_reason']; ?> </td> <td nowrap="nowrap" align="center"> <?php if ($canEdit && empty($row['file_checkout'])) { ?> <a href="?m=files&a=co&file_id=<?php echo $file['file_id']; ?> "><?php echo dPshowImage('./modules/files/images/up.png', '16', '16', 'checkout', 'checkout file'); ?> </a> <?php } else { if ($row['file_checkout'] == $AppUI->user_id) { ?> <a href="?m=files&a=addedit&ci=1&file_id=<?php echo $file['file_id']; ?> "><?php echo dPshowImage('./modules/files/images/down.png', '16', '16', 'checkin', 'checkin file'); ?> </a> <?php } else { if ($file['file_checkout'] == 'final') { echo 'final'; } else { $q4 = new DBQuery(); $q4->addQuery("file_id, file_checkout, user_username as co_user, contact_first_name, contact_last_name"); $q4->addTable('files'); $q4->leftJoin('users', 'cu', 'cu.user_id = file_checkout'); $q4->leftJoin('contacts', 'co', 'co.contact_id = cu.user_contact'); $q4->addWhere('file_id = ' . $file['file_id']); $co_user = array(); $co_user = $q4->loadList(); $co_user = $co_user[0]; $q4->clear(); echo $co_user['contact_first_name'] . ' ' . $co_user['contact_last_name'] . '<br>(' . $co_user['co_user'] . ')'; } } } ?> </td> <td nowrap="nowrap" align="center" width="48"> <?php if ($canEdit && (empty($file['file_checkout']) || $file['file_checkout'] == 'final' && ($canEdit || $file['project_owner'] == $AppUI->user_id))) { echo '<a href="./index.php?m=files&a=addedit&file_id=' . $file["file_id"] . '">'; echo dPshowImage('./modules/files/images/kedit.png', '16', '16', 'edit file', 'edit file'); echo "</a>"; echo '<a href="#" onclick="document.frm_duplicate_file_' . $file['file_id'] . '.submit()">' . dPshowImage('./modules/files/images/duplicate.png', '16', '16', 'duplicate file', 'duplicate file') . '</a>'; echo '<a href="#" onclick="if (confirm(\'Are you sure you want to delete this file?\')) {document.frm_remove_file_' . $file['file_id'] . '.submit()}">' . dPshowImage('./modules/files/images/remove.png', '16', '16', 'delete file', 'delete file') . '</a>'; } ?> <td nowrap="nowrap" align="center" width="1"> <?php if ($canEdit && (empty($file['file_checkout']) || $file['file_checkout'] == 'final' && ($canEdit || $file['project_owner'] == $AppUI->user_id))) { $bulk_op = 'onchange="(this.checked) ? addBulkComponent(' . $file['file_id'] . ') : removeBulkComponent(' . $file['file_id'] . ')"'; echo '<input type="checkbox" ' . $bulk_op . ' name="chk_sel_file_' . $file['file_id'] . '" />'; } ?> </td> </tr> <?php echo $hidden_table; ?> <?php $hidden_table = ''; } ?> </table> <?php if ($xpg_totalrecs > $xpg_pagesize) { showfnavbar($xpg_totalrecs, $xpg_pagesize, $xpg_total_pages, $page, $folder); } echo "<br />"; }
$q->addQuery('DISTINCT t.task_id, t.task_name, t.task_start_date, t.task_end_date' . ', t.task_milestone, t.task_dynamic'); $q->addJoin('projects', 'p', 'p.project_id = t.task_project'); $q->addWhere('p.project_id = ' . $p['project_id']); $q->addOrder($sortTasksByName ? 't.task_name' : 't.task_end_date ASC'); $tasks = $q->loadList(); $q->clear(); foreach ($tasks as $t) { if ($t['task_end_date'] == null) { $t['task_end_date'] = $t['task_start_date']; } $tStart = $t['task_start_date'] > '0000-00-00 00:00:00' ? $t['task_start_date'] : $start; $tEnd = $t['task_end_date'] > '0000-00-00 00:00:00' ? $t['task_end_date'] : $end; $tStartObj = new CDate($tStart); $tEndObj = new CDate($tEnd); if ($t['task_milestone'] != 1) { $bar2 = new GanttBar($row++, array(mb_substr(' --' . $t['task_name'], 0, 20) . '...', $tStartObj->format($df), $tEndObj->format($df), ' '), $tStart, $tEnd, ' ', $t['task_dynamic'] == 1 ? 0.1 : 0.6); $bar2->title->SetColor(bestColor('#ffffff', '#' . $p['project_color_identifier'], '#000000')); $bar2->title->SetFont(FF_CUSTOM, FS_NORMAL, 9); $bar2->SetFillColor('#' . $p['project_color_identifier']); $graph->Add($bar2); } else { $bar2 = new MileStone($row++, '-- ' . $t['task_name'], $t['task_start_date'], $tStartObj->format($df)); $bar2->title->SetFont(FF_CUSTOM, FS_NORMAL, 9); $bar2->title->SetColor('#CC0000'); $graph->Add($bar2); } //Insert workers for each task into Gantt Chart $q->addTable('user_tasks', 't'); $q->addQuery('DISTINCT user_username, t.task_id'); $q->addJoin('users', 'u', 'u.user_id = t.user_id'); $q->addWhere('t.task_id = ' . $t['task_id']);
echo $AppUI->_('Event'); ?> </th> </tr> <?php foreach ($events as $row) { $start = new CDate($row['event_start_date']); $end = new CDate($row['event_end_date']); ?> <tr> <td width="25%" nowrap="nowrap"> <?php echo $start->format($df . ' ' . $tf); ?> - <?php echo $end->format($df . ' ' . $tf); ?> </td> <td width="10%" nowrap="nowrap"> <?php echo dPshowImage(dPfindImage('event' . $row['event_type'] . '.png', 'calendar'), 16, 16, ''); ?> <b><?php echo $AppUI->_($types[$row['event_type']]); ?> </b> <td> <a href="?m=calendar&a=view&event_id=<?php echo $row['event_id']; ?> " class="event" title="<?php