当前位置: 首页>>代码示例>>PHP>>正文


PHP CDate::after方法代码示例

本文整理汇总了PHP中CDate::after方法的典型用法代码示例。如果您正苦于以下问题:PHP CDate::after方法的具体用法?PHP CDate::after怎么用?PHP CDate::after使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDate的用法示例。


在下文中一共展示了CDate::after方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CDate

    if ($tsd->before(new CDate($start_min))) {
        $start_min = $row['task_start_date'];
    }
    //Check if end date exists, if not try giving it the start date.
    //If the start date does not exist then set it for today.
    //This avoids jpgraphs internal errors that render the gantt completely useless
    if ($row['task_end_date'] == '0000-00-00 00:00:00') {
        if ($row['task_duration']) {
            $row['task_end_date'] = db_unix2dateTime(db_dateTime2unix($row['task_start_date']) + SECONDS_PER_DAY * convert2days($row['task_duration'], $row['task_duration_type']));
        } else {
            $todaydate = new CDate();
            $row['task_end_date'] = $todaydate->format(FMT_TIMESTAMP_DATE);
        }
    }
    $ted = new CDate($row['task_end_date']);
    if ($ted->after(new CDate($end_max))) {
        $end_max = $row['task_end_date'];
    }
    if ($ted->after(new CDate($projects[$row['task_project']]['project_end_date'])) || $projects[$row['task_project']]['project_end_date'] == '') {
        $projects[$row['task_project']]['project_end_date'] = $row['task_end_date'];
    }
    $projects[$row['task_project']]['tasks'][] = $row;
}
$q->clear();
unset($proTasks);
//consider critical (concerning end date) tasks as well
if ($caller != 'todo') {
    $start_min = $projects[$project_id]['project_start_date'];
    $end_max = $projects[$project_id]['project_end_date'] > $criticalTasks[0]['task_end_date'] ? $projects[$project_id]['project_end_date'] : $criticalTasks[0]['task_end_date'];
}
$width = min(w2PgetParam($_GET, 'width', 600), 1400);
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:gantt.php

示例2: displayWeeks

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 .= '&nbsp;</td>';
        $sd->addSeconds(7 * 24 * 3600);
        //add one week
    }
    return $row;
}
开发者ID:srinivasulurao,项目名称:jonel,代码行数:44,代码来源:tasksperuser_sub.php

示例3: getTaskLinks

/**
* 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 <eddieajau@users.sourceforge.net>
*/
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);
        }
    }
}
开发者ID:klr2003,项目名称:sourceread,代码行数:81,代码来源:links_tasks.php

示例4: showtask

function showtask(&$arr, $level = 0, $is_opened = true, $today_view = false, $hideOpenCloseLink = false, $allowRepeat = false)
{
    global $AppUI, $query_string, $durnTypes, $userAlloc, $showEditCheckbox;
    global $m, $a, $history_active, $expanded;
    //Check for Tasks Access
    $canAccess = canTaskAccess($arr['task_id'], $arr['task_access'], $arr['task_owner']);
    if (!$canAccess) {
        return false;
    }
    $now = new CDate();
    $tf = $AppUI->getPref('TIMEFORMAT');
    $df = $AppUI->getPref('SHDATEFORMAT');
    $perms =& $AppUI->acl();
    $fdf = $df . ' ' . $tf;
    $show_all_assignees = w2PgetConfig('show_all_task_assignees', false);
    $start_date = intval($arr['task_start_date']) ? new CDate($arr['task_start_date']) : null;
    $end_date = intval($arr['task_end_date']) ? new CDate($arr['task_end_date']) : null;
    $last_update = isset($arr['last_update']) && intval($arr['last_update']) ? new CDate($arr['last_update']) : null;
    // prepare coloured highlight of task time information
    $sign = 1;
    $style = '';
    if ($start_date) {
        if (!$end_date) {
            /*
             ** end date calc has been moved to calcEndByStartAndDuration()-function
             ** called from array_csort and tasks.php
             ** perhaps this fallback if-clause could be deleted in the future,
             ** didn't want to remove it shortly before the 2.0.2
             */
            $end_date = new CDate('0000-00-00 00:00:00');
        }
        if ($now->after($start_date) && $arr['task_percent_complete'] == 0) {
            $style = 'background-color:#ffeebb';
        } elseif ($now->after($start_date) && $arr['task_percent_complete'] < 100) {
            $style = 'background-color:#e6eedd';
        }
        if ($now->after($end_date)) {
            $sign = -1;
            $style = 'background-color:#cc6666;color:#ffffff';
        }
        if ($arr['task_percent_complete'] == 100) {
            $style = 'background-color:#aaddaa; color:#00000';
        }
        $days = $now->dateDiff($end_date) * $sign;
    }
    //     $s = "\n<tr id=\"project_".$arr['task_project'].'_level>'.$level.'<task_'.$arr['task_id']."_\" ".((($level>0 && !($m=='tasks' && $a=='view')) || ($m=='tasks' && ($a=='' || $a=='index'))) ? 'style="display:none"' : '').'>';
    if ($expanded) {
        $s = '<tr id="project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '_" >';
    } else {
        $s = '<tr id="project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '_" ' . ($level > 0 && !($m == 'tasks' && $a == 'view') ? 'style="display:none"' : '') . '>';
    }
    // edit icon
    $s .= '<td align="center">';
    $canEdit = true;
    $canViewLog = true;
    if ($canEdit) {
        $s .= w2PtoolTip('edit task', 'click to edit this task') . '<a href="?m=tasks&a=addedit&task_id=' . $arr['task_id'] . '">' . w2PshowImage('icons/pencil.gif', 12, 12) . '</a>' . w2PendTip();
    }
    $s .= '</td>';
    // pinned
    $pin_prefix = $arr['task_pinned'] ? '' : 'un';
    $s .= '<td align="center"><a href="?m=tasks&pin=' . ($arr['task_pinned'] ? 0 : 1) . '&task_id=' . $arr['task_id'] . '">' . w2PtoolTip('Pin', 'pin/unpin task') . '<img src="' . w2PfindImage('icons/' . $pin_prefix . 'pin.gif') . '" border="0" />' . w2PendTip() . '</a></td>';
    // New Log
    if ($arr['task_log_problem'] > 0) {
        $s .= '<td align="center" valign="middle"><a href="?m=tasks&a=view&task_id=' . $arr['task_id'] . '&tab=0&problem=1">' . w2PshowImage('icons/dialog-warning5.png', 16, 16, 'Problem', 'Problem!') . '</a></td>';
    } elseif ($canViewLog && $arr['task_dynamic'] != 1) {
        $s .= '<td align="center"><a href="?m=tasks&a=view&task_id=' . $arr['task_id'] . '&tab=1">' . w2PtoolTip('Add Log', 'create a new log record against this task') . w2PshowImage('edit_add.png') . w2PendTip() . '</a></td>';
    } else {
        $s .= '<td align="center">' . $AppUI->_('-') . '</td>';
    }
    // percent complete and priority
    $s .= '<td align="right">' . intval($arr['task_percent_complete']) . '%</td><td align="center" nowrap="nowrap">';
    if ($arr['task_priority'] < 0) {
        $s .= '<img src="' . w2PfindImage('icons/priority-' . -$arr['task_priority'] . '.gif') . '" />';
    } elseif ($arr['task_priority'] > 0) {
        $s .= '<img src="' . w2PfindImage('icons/priority+' . $arr['task_priority'] . '.gif') . '" />';
    }
    $s .= ($arr['file_count'] > 0 ? '<img src="' . w2PfindImage('clip.png') . '" alt="F" />' : '') . '</td>';
    // dots
    $s .= '<td width="' . ($today_view ? '50%' : '90%') . '">';
    //level
    if ($level == -1) {
        $s .= '...';
    }
    for ($y = 0; $y < $level; $y++) {
        if ($y + 1 == $level) {
            $s .= '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0">';
        } else {
            $s .= '<img src="' . w2PfindImage('shim.gif') . '" width="16" height="12"  border="0">';
        }
    }
    if ($arr['task_description']) {
        $s .= w2PtoolTip('Task Description', $arr['task_description'], true);
    }
    $open_link = '<a href="javascript: void(0);"><img onclick="expand_collapse(\'project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '_\', \'tblProjects\',\'\',' . ($level + 1) . ');" id="project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '__collapse" src="' . w2PfindImage('icons/collapse.gif') . '" border="0" align="center" ' . (!$expanded ? 'style="display:none"' : '') . ' /><img onclick="expand_collapse(\'project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '_\', \'tblProjects\',\'\',' . ($level + 1) . ');" id="project_' . $arr['task_project'] . '_level>' . $level . '<task_' . $arr['task_id'] . '__expand" src="' . w2PfindImage('icons/expand.gif') . '" border="0" align="center" ' . ($expanded ? 'style="display:none"' : '') . ' /></a>';
    if ($arr['task_nr_of_children']) {
        $is_parent = true;
    } else {
        $is_parent = false;
    }
//.........这里部分代码省略.........
开发者ID:joly,项目名称:web2project,代码行数:101,代码来源:tasks.class.php

示例5: showtask

function showtask(&$a, $level = 0, $is_opened = true, $today_view = false, $hideOpenCloseLink = false, $allowRepeat = false)
{
    global $AppUI, $done, $query_string, $durnTypes, $userAlloc, $showEditCheckbox;
    global $tasks_opened, $tasks_closed, $user_id;
    $tasks_closed = $tasks_closed ? $tasks_closed : array();
    $tasks_opened = $tasks_opened ? $tasks_opened : array();
    $done = $done ? $done : array();
    $now = new CDate();
    $df = $AppUI->getPref('SHDATEFORMAT');
    $df .= ' ' . $AppUI->getPref('TIMEFORMAT');
    $show_all_assignees = dPgetConfig('show_all_task_assignees', false);
    if (!isset($done[$a['task_id']])) {
        $done[$a['task_id']] = 1;
    } else {
        if (!$allowRepeat) {
            //by default, we shouldn't allow repeat displays of the same task
            return;
        }
    }
    $task_obj = new CTask();
    $task_obj->peek($a['task_id']);
    if (!$task_obj->canAccess($user_id ? $user_id : $AppUI->user_id)) {
        //don't show tasks that we can't access
        return;
    }
    if ($is_opened) {
        openClosedTask($a);
    } else {
        closeOpenedTask($a);
    }
    $start_date = intval($a['task_start_date']) ? new CDate($a['task_start_date']) : null;
    $end_date = intval($a['task_end_date']) ? new CDate($a['task_end_date']) : null;
    $last_update = isset($a['last_update']) && intval($a['last_update']) ? new CDate($a['last_update']) : null;
    // prepare coloured highlight of task time information
    $style = '';
    if ($start_date) {
        if ($now->after($start_date) && $a['task_percent_complete'] == 0) {
            $style = 'background-color:#ffeebb';
        } else {
            if ($now->after($start_date) && $a['task_percent_complete'] < 100) {
                $style = 'background-color:#e6eedd';
            }
        }
        if (!empty($end_date) && $now->after($end_date)) {
            $style = 'background-color:#cc6666;color:#ffffff';
        }
        if (!$end_date) {
            /*
             ** end date calc has been moved to calcEndByStartAndDuration()-function
             ** called from array_csort and tasks.php 
             ** perhaps this fallback if-clause could be deleted in the future, 
             ** didn't want to remove it shortly before the 2.0.2
             */
            $end_date = new CDate('0000-00-00 00:00:00');
        }
        if ($a['task_percent_complete'] == 100) {
            $style = 'background-color:#aaddaa; color:#00000';
        }
        $days = $end_date->dateDiff($now);
    }
    $s = "\n<tr>";
    // edit icon
    $s .= "\n\t<td>";
    $canEdit = getPermission('tasks', 'edit', $a['task_id']);
    $canViewLog = getPermission('task_log', 'view', $a['task_id']);
    if ($canEdit) {
        $s .= "\n\t\t" . '<a href="?m=tasks&amp;a=addedit&amp;task_id=' . $a['task_id'] . '">' . "\n\t\t\t" . '<img src="./images/icons/pencil.gif" alt="' . $AppUI->_('Edit Task') . '" border="0" width="12" height="12" />' . "\n\t\t</a>";
    }
    $s .= "\n\t</td>";
    // pinned
    $pin_prefix = $a['task_pinned'] ? '' : 'un';
    $s .= "\n\t<td>\n\t\t" . '<a href="?m=tasks&amp;pin=' . ($a['task_pinned'] ? 0 : 1) . '&task_id=' . $a['task_id'] . '">' . "\n\t\t\t" . '<img src="./images/icons/' . $pin_prefix . 'pin.gif" alt="' . $AppUI->_($pin_prefix . 'pin Task') . '" border="0" width="12" height="12" />' . "\n\t\t</a>\n\t</td>";
    // New Log
    $s .= "\n\t" . '<td align="center">';
    if ($canViewLog && $a['task_dynamic'] != 1) {
        $s .= '<a href="?m=tasks&amp;a=view&amp;task_id=' . $a['task_id'] . '&tab=1">' . $AppUI->_('Log') . '</a>';
    } else {
        $s .= $AppUI->_('-');
    }
    $s .= '</td>';
    // percent complete and priority
    $s .= "\n\t" . '<td align="right">' . intval($a['task_percent_complete']) . '%</td>' . "\n\t" . '<td align="center" nowrap="nowrap">';
    if (@$a['task_log_problem'] > 0) {
        $s .= '<a href="?m=tasks&amp;a=view&amp;task_id=' . $a['task_id'] . '&amp;tab=0&amp;problem=1">' . dPshowImage('./images/icons/dialog-warning5.png', 16, 16, 'Problem', 'Problem!') . '</a>';
    } else {
        if ($a['task_priority'] != 0) {
            $s .= "\n\t\t" . dPshowImage('./images/icons/priority' . ($a['task_priority'] > 0 ? '+' : '-') . abs($a['task_priority']) . '.gif', 13, 16, '', '');
        }
    }
    $s .= (@$a['file_count'] > 0 ? '<img src="./images/clip.png" alt="F" />' : '') . '</td>';
    // dots
    $s .= '<td width="' . ($today_view ? '50%' : '90%') . '">';
    //level
    if ($level == -1) {
        $s .= '...';
    }
    for ($y = 0; $y < $level; $y++) {
        $s .= '<img src="' . ($y + 1 == $level ? './images/corner-dots.gif' : './images/shim.gif') . '" width="16" height="12" border="0" alt="" />';
    }
    // name link
//.........这里部分代码省略.........
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:101,代码来源:tasks.class.php

示例6: count

$html .= $cal->_drawBirthdays($this_day->format('%Y%m%d'));
$html .= '<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">';
$this_day->setTime($start, 0, 0);
for ($i = 0, $n = ($end - $start) * 60 / $inc; $i < $n; $i++) {
    $html .= "\n<tr>";
    $tm = $this_day->format($tf);
    $html .= "\n\t" . '<td width="1%" align="right" nowrap="nowrap">' . ($this_day->getMinute() ? $tm : '<b>' . $tm . '</b>') . '</td>';
    $timeStamp = $this_day->format('%H%M%S');
    if (@$events2[$timeStamp]) {
        $count = count($events2[$timeStamp]);
        for ($j = 0; $j < $count; $j++) {
            $row = $events2[$timeStamp][$j];
            $et = new CDate($row['event_end_date']);
            $et_date = new CDate($row['event_end_date']);
            $et_date->setTime(0, 0, 0);
            if ($et_date->after($this_day)) {
                $rows = $n - $i;
            } else {
                $rows = ($et->getHour() * 60 + $et->getMinute() - ($this_day->getHour() * 60 + $this_day->getMinute())) / $inc;
            }
            $href = "?m=calendar&a=view&event_id=" . $row['event_id'];
            $alt = $row['event_description'];
            $html .= "\n\t" . '<td class="event" rowspan="' . $rows . '" valign="top">';
            $html .= "\n" . '<table cellspacing="0" cellpadding="0" border="0"><tr>';
            $html .= "\n<td>" . dPshowImage(dPfindImage('event' . $row['event_type'] . '.png', 'calendar'), 16, 16, '');
            $html .= "</td>\n<td>&nbsp;<b>" . $AppUI->_($types[$row['event_type']]) . '</b></td></tr></table>';
            $html .= $href ? "\n\t\t" . '<a href="' . htmlspecialchars($href) . '" class="event" title="' . htmlspecialchars($alt) . '">' : '';
            $html .= "\n\t\t" . htmlspecialchars($row['event_title']);
            $html .= $href ? "\n\t\t</a>" : '';
            $html .= "\n\t</td>";
        }
开发者ID:slawekmikula,项目名称:dotproject,代码行数:31,代码来源:vw_day_events.php

示例7: date

        $row['task_start_date'] = date('Y-m-d H:i:s');
    }
    $tsd = new CDate($row['task_start_date']);
    if ($tsd->before(new CDate($start_min))) {
        $start_min = $row['task_start_date'];
    }
    // calculate or set blank task_end_date if unset
    if ($row['task_end_date'] == '0000-00-00 00:00:00') {
        if ($row['task_duration']) {
            $row['task_end_date'] = db_unix2dateTime(db_dateTime2unix($row['task_start_date']) + SECONDS_PER_DAY * convert2days($row['task_duration'], $row['task_duration_type']));
        } else {
            $row['task_end_date'] = '';
        }
    }
    $ted = new CDate($row['task_end_date']);
    if ($ted->after(new CDate($end_max))) {
        $end_max = $row['task_end_date'];
    }
    $projects[$row['task_project']]['tasks'][] = $row;
}
$q->clear();
$width = dPgetParam($_GET, 'width', 600);
//consider critical (concerning end date) tasks as well
if ($caller != 'todo') {
    //	$start_min = $projects[$project_id]['project_start_date'];
    $start_min = substr($criticalTasksInverted[0]['task_start_date'], 0, 10);
    //	$end_max = ($projects[$project_id]['project_end_date'] > $criticalTasks[0]['task_end_date']) ? $projects[$project_id]['project_end_date'] : $criticalTasks[0]['task_end_date'];
    $end_max = substr($criticalTasks[0]['task_end_date'], 0, 10);
}
$start_date = dPgetParam($_GET, 'start_date', $start_min);
$end_date = dPgetParam($_GET, 'end_date', $end_max);
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:31,代码来源:gantt.php

示例8: CDate

	<th width="0">&nbsp;</th>
</tr>

<?php 
/*** Tasks listing ***/
$now = new CDate();
$df = $AppUI->getPref('SHDATEFORMAT');
foreach ($tasks as $task) {
    $sign = 1;
    $start = intval(@$task["task_start_date"]) ? new CDate($task["task_start_date"]) : null;
    $end = intval(@$task["task_end_date"]) ? new CDate($task["task_end_date"]) : null;
    if (!$end && $start) {
        $end = $start;
        $end->addSeconds(@$task["task_duration"] * $task["task_duration_type"] * SEC_HOUR);
    }
    if ($end && $now->after($end)) {
        $sign = -1;
    }
    $days = $end ? $now->dateDiff($end) * $sign : null;
    $task['task_due_in'] = $days;
    showtask($task, 0, false, true);
}
?>
<tr>
	<td colspan="9" align="right" height="30">
		<input type="submit" class="button" value="<?php 
echo $AppUI->_('update task');
?>
">
	</td>
	<td colspan="3" align="center">
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:31,代码来源:todo_tasks_sub.php

示例9: getRecurrentEventforPeriod

 /**
 * Calculating if an recurrent date is in the given period
 * @param Date Start date of the period
 * @param Date End date of the period
 * @param Date Start date of the Date Object
 * @param Date End date of the Date Object
 * @param integer Type of Recurrence
 * @param integer Times of Recurrence
 * @param integer Time of Recurrence
 * @return array Calculated Start and End Dates for the recurrent Event for the given Period
 */
 function getRecurrentEventforPeriod($start_date, $end_date, $event_start_date, $event_end_date, $event_recurs, $event_times_recuring, $j)
 {
     //this array will be returned
     $transferredEvent = array();
     //create Date Objects for Event Start and Event End
     $eventStart = new CDate($event_start_date);
     $eventEnd = new CDate($event_end_date);
     //Time of Recurence = 0 (first occurence of event) has to be checked, too.
     if ($j > 0) {
         switch ($event_recurs) {
             case 1:
                 $eventStart->addSpan(new Date_Span(3600 * $j));
                 $eventEnd->addSpan(new Date_Span(3600 * $j));
                 break;
             case 2:
                 $eventStart->addDays($j);
                 $eventEnd->addDays($j);
                 break;
             case 3:
                 $eventStart->addDays(7 * $j);
                 $eventEnd->addDays(7 * $j);
                 break;
             case 4:
                 $eventStart->addDays(14 * $j);
                 $eventEnd->addDays(14 * $j);
                 break;
             case 5:
                 $eventStart->addMonths($j);
                 $eventEnd->addMonths($j);
                 break;
             case 6:
                 $eventStart->addMonths(3 * $j);
                 $eventEnd->addMonths(3 * $j);
                 break;
             case 7:
                 $eventStart->addMonths(6 * $j);
                 $eventEnd->addMonths(6 * $j);
                 break;
             case 8:
                 $eventStart->addMonths(12 * $j);
                 $eventEnd->addMonths(12 * $j);
                 break;
             default:
                 break;
         }
     }
     if ($eventStart->before($end_date) && $eventEnd->after($start_date)) {
         // add temporarily moved Event Start and End dates to returnArray
         $transferredEvent = array($eventStart, $eventEnd);
     }
     // return array with event start and end dates for given period (positive case)
     // or an empty array (negative case)
     return $transferredEvent;
 }
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:65,代码来源:calendar.class.php

示例10: showtask_pd

function showtask_pd(&$a, $level = 0, $is_opened = true, $today_view = false)
{
    global $AppUI, $dPconfig, $done, $query_string, $durnTypes, $userAlloc, $showEditCheckbox;
    global $task_access, $task_priority, $PROJDESIGN_CONFIG;
    $types = dPgetsysval('TaskType');
    $now = new CDate();
    $tf = $AppUI->getPref('TIMEFORMAT');
    $df = $AppUI->getPref('SHDATEFORMAT');
    $fdf = $df . " " . $tf;
    $perms =& $AppUI->acl();
    $show_all_assignees = @$dPconfig['show_all_task_assignees'] ? true : false;
    $done[] = $a['task_id'];
    $start_date = intval($a["task_start_date"]) ? new CDate($a["task_start_date"]) : null;
    $end_date = intval($a["task_end_date"]) ? new CDate($a["task_end_date"]) : null;
    $last_update = isset($a['last_update']) && intval($a['last_update']) ? new CDate($a['last_update']) : null;
    // prepare coloured highlight of task time information
    $sign = 1;
    $style = "";
    if ($start_date) {
        if (!$end_date) {
            /*
             ** end date calc has been moved to calcEndByStartAndDuration()-function
             ** called from array_csort and tasks.php 
             ** perhaps this fallback if-clause could be deleted in the future, 
             ** didn't want to remove it shortly before the 2.0.2
             */
            $end_date = new CDate('0000-00-00 00:00:00');
        }
        if ($now->after($start_date) && $a["task_percent_complete"] == 0) {
            $style = 'background-color:#ffeebb';
        } else {
            if ($now->after($start_date) && $a["task_percent_complete"] < 100) {
                $style = 'background-color:#e6eedd';
            }
        }
        if ($now->after($end_date)) {
            $sign = -1;
            $style = 'background-color:#cc6666;color:#ffffff';
        }
        if ($a["task_percent_complete"] == 100) {
            $style = 'background-color:#aaddaa; color:#00000';
        }
        $days = $now->dateDiff($end_date) * $sign;
    }
    $s = "\n<tr id=\"row" . $a['task_id'] . "\" onmouseover=\"highlight_tds(this, true, " . $a['task_id'] . ")\" onmouseout=\"highlight_tds(this, false, " . $a['task_id'] . ")\" onclick=\"select_box('selected_task', " . $a['task_id'] . ",'frm_tasks')\">";
    // edit icon
    $s .= "\n\t<td>";
    $canEdit = !getDenyEdit('tasks', $a["task_id"]);
    $canViewLog = $perms->checkModuleItem('task_log', 'view', $a['task_id']);
    if ($canEdit) {
        $s .= "\n\t\t<a href=\"?m=tasks&a=addedit&task_id={$a['task_id']}\">" . "\n\t\t\t" . '<img src="./images/icons/pencil.gif" alt="' . $AppUI->_('Edit Task') . '" border="0" width="12" height="12">' . "\n\t\t</a>";
    }
    $s .= "\n\t</td>";
    // pinned
    /*        $pin_prefix = $a['task_pinned']?'':'un';
            $s .= "\n\t<td>";
            $s .= "\n\t\t<a href=\"?m=tasks&pin=" . ($a['task_pinned']?0:1) . "&task_id={$a['task_id']}\">"
                    . "\n\t\t\t".'<img src="./images/icons/' . $pin_prefix . 'pin.gif" alt="'.$AppUI->_( $pin_prefix . 'pin Task' ).'" border="0" width="12" height="12">'
                    . "\n\t\t</a>";
            $s .= "\n\t</td>";*/
    // New Log
    /*        if (@$a['task_log_problem']>0) {
                    $s .= '<td align="center" valign="middle"><a href="?m=tasks&a=view&task_id='.$a['task_id'].'&tab=0&problem=1">';
                    $s .= dPshowImage( './images/icons/dialog-warning5.png', 16, 16, 'Problem', 'Problem!' );
                    $s .='</a></td>';
            } else if ($canViewLog) {
                    $s .= "\n\t<td><a href=\"?m=tasks&a=view&task_id=" . $a['task_id'] . '&tab=1">' . $AppUI->_('Log') . '</a></td>';
            } else {
                    $s .= "\n\t<td></td>";
                                    }*/
    // percent complete
    $s .= "\n\t<td align=\"right\">" . intval($a["task_percent_complete"]) . '%</td>';
    // priority
    $s .= "\n\t<td align='center' nowrap='nowrap'>";
    if ($a["task_priority"] < 0) {
        $s .= "\n\t\t<img src=\"./images/icons/priority-" . -$a["task_priority"] . '.gif" width=13 height=16>';
    } else {
        if ($a["task_priority"] > 0) {
            $s .= "\n\t\t<img src=\"./images/icons/priority+" . $a["task_priority"] . '.gif" width=13 height=16>';
        }
    }
    $s .= @$a["file_count"] > 0 ? "<img src=\"./images/clip.png\" alt=\"F\">" : "";
    $s .= "</td>";
    // access
    $s .= "\n\t<td nowrap='nowrap'>";
    $s .= '<abbr title="' . $task_access[$a['task_access']] . '">' . substr($task_access[$a["task_access"]], 0, 3) . '</abbr>';
    $s .= "</td>";
    // type
    $s .= "\n\t<td nowrap='nowrap'>";
    $s .= '<abbr title="' . $types[$a['task_type']] . '">' . substr($types[$a["task_type"]], 0, 3) . '</abbr>';
    $s .= "</td>";
    // type
    $s .= "\n\t<td nowrap='nowrap'>";
    $s .= $a["queue_id"] ? 'Yes' : '';
    $s .= "</td>";
    // inactive
    $s .= "\n\t<td nowrap='nowrap'>";
    $s .= $a["task_status"] == '-1' ? 'Yes' : '';
    $s .= "</td>";
    // add log
//.........这里部分代码省略.........
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:101,代码来源:projectdesigner.class.php

示例11: showtask

function showtask(&$a, $level = 0, $is_opened = true, $today_view = false)
{
    global $AppUI, $dPconfig, $done, $query_string, $durnTypes, $userAlloc, $showEditCheckbox;
    $now = new CDate();
    $df = $AppUI->getPref('SHDATEFORMAT');
    $df .= " " . $AppUI->getPref('TIMEFORMAT');
    $perms =& $AppUI->acl();
    $show_all_assignees = @$dPconfig['show_all_task_assignees'] ? true : false;
    $done[] = $a['task_id'];
    $start_date = intval($a["task_start_date"]) ? new CDate($a["task_start_date"]) : null;
    $end_date = intval($a["task_end_date"]) ? new CDate($a["task_end_date"]) : null;
    $last_update = isset($a['last_update']) && intval($a['last_update']) ? new CDate($a['last_update']) : null;
    // prepare coloured highlight of task time information
    $sign = 1;
    $style = "";
    if ($start_date) {
        if (!$end_date) {
            $end_date = $start_date;
            $end_date->addSeconds(@$a["task_duration"] * $a["task_duration_type"] * SEC_HOUR);
        }
        if ($now->after($start_date) && $a["task_percent_complete"] == 0) {
            $style = 'background-color:#ffeebb';
        } else {
            if ($now->after($start_date) && $a["task_percent_complete"] < 100) {
                $style = 'background-color:#e6eedd';
            }
        }
        if ($now->after($end_date)) {
            $sign = -1;
            $style = 'background-color:#cc6666;color:#ffffff';
        }
        if ($a["task_percent_complete"] == 100) {
            $style = 'background-color:#aaddaa; color:#00000';
        }
        $days = $now->dateDiff($end_date) * $sign;
    }
    $s = "\n<tr>";
    // edit icon
    $s .= "\n\t<td>";
    $canEdit = !getDenyEdit('tasks', $a["task_id"]);
    $canViewLog = $perms->checkModuleItem('task_log', 'view', $a['task_id']);
    if ($canEdit) {
        $s .= "\n\t\t<a href=\"?m=tasks&a=addedit&task_id={$a['task_id']}\">" . "\n\t\t\t" . '<img src="./images/icons/pencil.gif" alt="' . $AppUI->_('Edit Task') . '" border="0" width="12" height="12">' . "\n\t\t</a>";
    }
    $s .= "\n\t</td>";
    // pinned
    $pin_prefix = $a['task_pinned'] ? '' : 'un';
    $s .= "\n\t<td>";
    $s .= "\n\t\t<a href=\"?m=tasks&pin=" . ($a['task_pinned'] ? 0 : 1) . "&task_id={$a['task_id']}\">" . "\n\t\t\t" . '<img src="./images/icons/' . $pin_prefix . 'pin.gif" alt="' . $AppUI->_($pin_prefix . 'pin Task') . '" border="0" width="12" height="12">' . "\n\t\t</a>";
    $s .= "\n\t</td>";
    // New Log
    if (@$a['task_log_problem'] > 0) {
        $s .= '<td align="center" valign="middle"><a href="?m=tasks&a=view&task_id=' . $a['task_id'] . '&tab=0&problem=1">';
        $s .= dPshowImage('./images/icons/dialog-warning5.png', 16, 16, 'Problem', 'Problem!');
        $s .= '</a></td>';
    } else {
        if ($canViewLog) {
            $s .= "\n\t<td><a href=\"?m=tasks&a=view&task_id=" . $a['task_id'] . '&tab=1">' . $AppUI->_('Log') . '</a></td>';
        } else {
            $s .= "\n\t<td></td>";
        }
    }
    // percent complete
    $s .= "\n\t<td align=\"right\">" . intval($a["task_percent_complete"]) . '%</td>';
    // priority
    $s .= "\n\t<td align='center' nowrap='nowrap'>";
    if ($a["task_priority"] < 0) {
        $s .= "\n\t\t<img src=\"./images/icons/priority-" . -$a["task_priority"] . '.gif" width=13 height=16>';
    } else {
        if ($a["task_priority"] > 0) {
            $s .= "\n\t\t<img src=\"./images/icons/priority+" . $a["task_priority"] . '.gif" width=13 height=16>';
        }
    }
    $s .= @$a["file_count"] > 0 ? "<img src=\"./images/clip.png\" alt=\"F\">" : "";
    $s .= "</td>";
    // dots
    if ($today_view) {
        $s .= '<td width="50%">';
    } else {
        $s .= '<td width="90%">';
    }
    for ($y = 0; $y < $level; $y++) {
        if ($y + 1 == $level) {
            $s .= '<img src="./images/corner-dots.gif" width="16" height="12" border="0">';
        } else {
            $s .= '<img src="./images/shim.gif" width="16" height="12"  border="0">';
        }
    }
    // name link
    $alt = strlen($a['task_description']) > 80 ? substr($a["task_description"], 0, 80) . '...' : $a['task_description'];
    // instead of the statement below
    $alt = str_replace("\"", "&quot;", $alt);
    //	$alt = htmlspecialchars($alt);
    $alt = str_replace("\r", ' ', $alt);
    $alt = str_replace("\n", ' ', $alt);
    $open_link = $is_opened ? "<a href='index.php{$query_string}&close_task_id=" . $a["task_id"] . "'><img src='images/icons/collapse.gif' border='0' align='center' /></a>" : "<a href='index.php{$query_string}&open_task_id=" . $a["task_id"] . "'><img src='images/icons/expand.gif' border='0' /></a>";
    if ($a["task_milestone"] > 0) {
        $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $a["task_id"] . '" title="' . $alt . '"><b>' . $a["task_name"] . '</b></a> <img src="./images/icons/milestone.gif" border="0"></td>';
    } else {
        if ($a["task_dynamic"] == '1') {
//.........这里部分代码省略.........
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:tasks.class.php

示例12: showtask_pd

function showtask_pd(&$a, $level = 0, $today_view = false)
{
    global $AppUI, $w2Pconfig, $done, $query_string, $durnTypes, $userAlloc, $showEditCheckbox;
    global $task_access, $task_priority, $PROJDESIGN_CONFIG, $m, $expanded;
    $types = w2Pgetsysval('TaskType');
    $now = new CDate();
    $tf = $AppUI->getPref('TIMEFORMAT');
    $df = $AppUI->getPref('SHDATEFORMAT');
    $fdf = $df . ' ' . $tf;
    $perms =& $AppUI->acl();
    $show_all_assignees = $w2Pconfig['show_all_task_assignees'] ? true : false;
    $done[] = $a['task_id'];
    $start_date = intval($a['task_start_date']) ? new CDate($a['task_start_date']) : null;
    $end_date = intval($a['task_end_date']) ? new CDate($a['task_end_date']) : null;
    $last_update = isset($a['last_update']) && intval($a['last_update']) ? new CDate($a['last_update']) : null;
    // prepare coloured highlight of task time information
    $sign = 1;
    $style = '';
    if ($start_date) {
        if (!$end_date) {
            $end_date = new CDate('0000-00-00 00:00:00');
        }
        if ($now->after($start_date) && $a['task_percent_complete'] == 0) {
            $style = 'background-color:#ffeebb';
        } elseif ($now->after($start_date) && $a['task_percent_complete'] < 100) {
            $style = 'background-color:#e6eedd';
        }
        if ($now->after($end_date)) {
            $sign = -1;
            $style = 'background-color:#cc6666;color:#ffffff';
        }
        if ($a['task_percent_complete'] == 100) {
            $style = 'background-color:#aaddaa; color:#00000';
        }
        $days = $now->dateDiff($end_date) * $sign;
    }
    if ($expanded) {
        $s = '<tr id="project_' . $a['task_project'] . '_level>' . $level . '<task_' . $a['task_id'] . '_" onmouseover="highlight_tds(this, true, ' . $a['task_id'] . ')" onmouseout="highlight_tds(this, false, ' . $a['task_id'] . ')" onclick="select_box(\'selected_task\', \'' . $a['task_id'] . '\', \'project_' . $a['task_project'] . '_level>' . $level . '<task_' . $a['task_id'] . '_\',\'frm_tasks\')">';
        // edit icon
    } else {
        $s = '<tr id="project_' . $a['task_project'] . '_level>' . $level . '<task_' . $a['task_id'] . '_" onmouseover="highlight_tds(this, true, ' . $a['task_id'] . ')" onmouseout="highlight_tds(this, false, ' . $a['task_id'] . ')" onclick="select_box(\'selected_task\', \'' . $a['task_id'] . '\', \'project_' . $a['task_project'] . '_level>' . $level . '<task_' . $a['task_id'] . '_\',\'frm_tasks\')" ' . ($level ? 'style="display:none"' : '') . '>';
        // edit icon
    }
    $s .= '<td>';
    $canEdit = true;
    $canViewLog = true;
    if ($canEdit) {
        $s .= w2PtoolTip('edit tasks panel', 'click to edit this task') . '<a href="?m=tasks&a=addedit&task_id=' . $a['task_id'] . '"><img src="' . w2PfindImage('icons/pencil.gif') . '" border="0" width="12" height="12" /></a>' . w2PendTip();
    }
    $s .= '</td>';
    // percent complete
    $s .= '<td align="right">' . intval($a['task_percent_complete']) . '%</td>';
    // priority
    $s .= '<td align="center" nowrap="nowrap">';
    if ($a['task_priority'] < 0) {
        $s .= '<img src="' . w2PfindImage('icons/priority-' . -$a['task_priority'] . '.gif') . '" width="13" height="16" />';
    } elseif ($a['task_priority'] > 0) {
        $s .= '<img src="' . w2PfindImage('icons/priority+' . $a['task_priority'] . '.gif') . '" width="13" height="16" />';
    }
    $s .= $a['file_count'] > 0 ? '<img src="' . w2PfindImage('clip.png') . '" alt="' . $AppUI->_('Files') . '" />' : '';
    $s .= '</td>';
    // access
    $s .= '<td nowrap="nowrap">';
    $s .= mb_substr($task_access[$a['task_access']], 0, 3);
    $s .= '</td>';
    // type
    $s .= '<td nowrap="nowrap">';
    $s .= mb_substr($types[$a['task_type']], 0, 3);
    $s .= '</td>';
    // type
    $s .= '<td nowrap="nowrap">';
    $s .= $a['queue_id'] ? 'Yes' : '';
    $s .= '</td>';
    // inactive
    $s .= '<td nowrap="nowrap">';
    $s .= $a['task_status'] == '-1' ? 'Yes' : '';
    $s .= '</td>';
    // add log
    $s .= '<td align="center" nowrap="nowrap">';
    if ($a['task_dynamic'] != 1) {
        $s .= w2PtoolTip('tasks', 'add work log to this task') . '<a href="?m=tasks&a=view&tab=1&project_id=' . $a['task_project'] . '&task_id=' . $a['task_id'] . '"><img src="' . w2PfindImage('add.png', $m) . '" border="0" width="16" height="16" /></a>' . w2PendTip();
    }
    $s .= '</td>';
    // dots
    if ($today_view) {
        $s .= '<td>';
    } else {
        $s .= '<td width="20%">';
    }
    for ($y = 0; $y < $level; $y++) {
        if ($y + 1 == $level) {
            $s .= '<img src="' . w2PfindImage('corner-dots.gif', $m) . '" width="16" height="12" border="0" />';
        } else {
            $s .= '<img src="' . w2PfindImage('shim.gif', $m) . '" width="16" height="12"  border="0" />';
        }
    }
    // name link
    if ($a['task_description']) {
        $s .= w2PtoolTip('Task Description', $a['task_description'], true);
    }
//.........这里部分代码省略.........
开发者ID:joly,项目名称:web2project,代码行数:101,代码来源:projectdesigner.class.php

示例13: showtask

function showtask(&$a, $level = 0, $is_opened = true, $today_view = false)
{
    global $AppUI, $dPconfig, $done, $query_string, $isProjectManager;
    $now = new CDate();
    $show_all_assignees = $dPconfig['show_all_task_assignees'] ? true : false;
    $done[] = $id = $a['task_id'];
    $start_date = intval($a['task_start_date']) ? new CDate($a['task_start_date']) : null;
    $end_date = intval($a['task_end_date']) ? new CDate($a['task_end_date']) : null;
    // prepare coloured highlight of task time information
    $sign = 1;
    $style = '';
    if ($start_date) {
        if (!$end_date) {
            /*
             ** end date calc has been moved to calcEndByStartAndDuration()-function
             ** called from array_csort and tasks.php
             ** perhaps this fallback if-clause could be deleted in the future,
             ** didn't want to remove it shortly before the 2.0.2
             */
            $end_date = new CDate('0000-00-00 00:00:00');
        }
        if ($now->after($start_date) && $a['task_percent_complete'] == 0) {
            $style = 'background-color:#ffeebb';
        } else {
            if ($now->after($start_date) && $a['task_percent_complete'] < 100) {
                $style = 'background-color:#e6eedd';
            }
        }
        if ($now->after($end_date)) {
            $sign = -1;
            $style = 'background-color:#cc6666;color:#ffffff';
        }
        if ($a['task_percent_complete'] == 100) {
            $style = 'background-color:#aaddaa; color:#00000';
        }
        $days = $now->dateDiff($end_date) * $sign;
    }
    $s = '<tr class="second">';
    // edit icon
    $s .= '<td align="center">';
    if ($isProjectManager || $AppUI->user_id == $a['task_owner']) {
        $s .= '<a href="?m=tasks&a=simpleaddedit&task_id=' . $id . '">' . '<img src="images/edit_task.gif" title="' . $AppUI->_('Edit') . '"></a>';
    } else {
        $s .= '<img src="images/noedit_task.gif" title="' . $AppUI->_('No edit') . '">';
    }
    $s .= '</td>';
    // pinned
    if ($a['task_pinned']) {
        $pin_image = 'green.png';
        $pin_text = 'Unpin task';
    } else {
        $pin_image = 'gray.png';
        $pin_text = 'Pin task';
    }
    $s .= '<td align="center">';
    $s .= createIconLink('images/' . $pin_image, 'js:pinTask(this,' . $id . ')', $pin_text);
    $s .= '</td>';
    $mytask = false;
    $members = $a['task_assigned_users'];
    if (!$isProjectManager && isset($members)) {
        foreach ($members as $u) {
            if ($u['user_id'] == $AppUI->user_id) {
                $mytask = true;
                break;
            }
        }
    }
    // New Log
    if ($a['task_log_problem'] > 0) {
        $s .= '<td align="center"><a href="?m=tasks&a=view&task_id=' . $id . '&tab=0&problem=1">';
        $s .= '<img src="images/problem.gif" title="Problem!">';
        $s .= '</a></td>';
    } else {
        if ($isProjectManager || $mytask) {
            $s .= '<td align="center"><a href="?m=tasks&a=view&task_id=' . $id . '&tab=1">';
            $s .= '<img src="images/add_log.gif" title="Add log">';
            $s .= '</a></td>';
        } else {
            $s .= '<td align="center"><a href="?m=tasks&a=view&task_id=' . $id . '&tab=0">' . '<img src="images/log.gif" title="View log">' . '</a></td>';
        }
    }
    // percent complete
    $s .= '<td align="right">' . intval($a['task_percent_complete']) . '%</td>';
    // priority
    $s .= '<td align="center" nowrap="nowrap">';
    if ($a['task_milestone'] > 0) {
        $s .= '<img src="images/milestone.gif" title="Milestone">';
    } else {
        if ($a['task_priority'] < 0) {
            $s .= '<img src="images/icons/priority-' . -$a['task_priority'] . '.gif">';
        } else {
            if ($a['task_priority'] > 0) {
                $s .= '<img src="images/icons/priority+' . $a['task_priority'] . '.gif">';
            }
        }
    }
    $s .= $a['file_count'] > 0 ? '<img src="images/clip.png">' : '';
    $s .= '</td>';
    // dots
    $s .= '<td width="' . ($today_view ? 50 : 90) . '%">';
//.........这里部分代码省略.........
开发者ID:n2i,项目名称:xvnkb,代码行数:101,代码来源:tasks.class.php

示例14: getTaskLinks

/**
 * 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 <eddieajau@users.sourceforge.net>
 */
function getTaskLinks($startPeriod, $endPeriod, &$links, $strMaxLen, $company_id = 0, $minical = false)
{
    global $a, $AppUI, $w2Pconfig;
    $tasks = CTask::getTasksForPeriod($startPeriod, $endPeriod, $company_id, 0);
    $df = $AppUI->getPref('SHDATEFORMAT');
    $tf = $AppUI->getPref('TIMEFORMAT');
    //subtract one second so we don't have to compare the start dates for exact matches with the startPeriod which is 00:00 of a given day.
    $startPeriod->subtractSeconds(1);
    $link = array();
    $sid = 3600 * 24;
    // assemble the links for the tasks
    foreach ($tasks as $row) {
        // the link
        $link['task'] = true;
        if (!$minical) {
            $link['href'] = '?m=tasks&a=view&task_id=' . $row['task_id'];
            // the link text
            if (mb_strlen($row['task_name']) > $strMaxLen) {
                $row['short_name'] = mb_substr($row['task_name'], 0, $strMaxLen) . '...';
            } else {
                $row['short_name'] = $row['task_name'];
            }
            $link['text'] = '<span style="color:' . bestColor($row['color']) . ';background-color:#' . $row['color'] . '">' . $row['short_name'] . ($row['task_milestone'] ? '&nbsp;' . w2PshowImage('icons/milestone.gif') : '') . '</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;
        // First we test if the Tasks Starts and Ends are on the same day, if so we don't need to go any further.
        if ($start->after($startPeriod) && ($end && $end->after($startPeriod) && $end->before($endPeriod) && !$start->dateDiff($end))) {
            if ($minical) {
                $temp = array('task' => true);
            } else {
                $temp = $link;
                if ($a != 'day_view') {
                    $temp['text'] = w2PtoolTip($row['task_name'], getTaskTooltip($row['task_id'], true, true, $tasks), true) . w2PshowImage('block-start-16.png') . $start->format($tf) . ' ' . $temp['text'] . ' ' . $end->format($tf) . w2PshowImage('block-end-16.png') . w2PendTip();
                }
            }
            $links[$end->format(FMT_TIMESTAMP_DATE)][] = $temp;
        } else {
            // If they aren't, we will now need to see if the Tasks Start date is between the requested period
            if ($start->after($startPeriod) && $start->before($endPeriod)) {
                if ($minical) {
                    $temp = array('task' => true);
                } else {
                    $temp = $link;
                    if ($a != 'day_view') {
                        $temp['text'] = w2PtoolTip($row['task_name'], getTaskTooltip($row['task_id'], true, false, $tasks), true) . w2PshowImage('block-start-16.png') . $start->format($tf) . ' ' . $temp['text'] . w2PendTip();
                    }
                }
                $links[$start->format(FMT_TIMESTAMP_DATE)][] = $temp;
            }
            // And now the Tasks End date is checked if it is between the requested period too.
            if ($end && $end->after($startPeriod) && $end->before($endPeriod) && $start->before($end)) {
                if ($minical) {
                    $temp = array('task' => true);
                } else {
                    $temp = $link;
                    if ($a != 'day_view') {
                        $temp['text'] = w2PtoolTip($row['task_name'], getTaskTooltip($row['task_id'], false, true, $tasks), true) . ' ' . $temp['text'] . ' ' . $end->format($tf) . w2PshowImage('block-end-16.png') . w2PendTip();
                    }
                }
                $links[$end->format(FMT_TIMESTAMP_DATE)][] = $temp;
            }
        }
    }
}
开发者ID:joly,项目名称:web2project,代码行数:76,代码来源:links_tasks.php


注:本文中的CDate::after方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。