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


PHP bestColor函数代码示例

本文整理汇总了PHP中bestColor函数的典型用法代码示例。如果您正苦于以下问题:PHP bestColor函数的具体用法?PHP bestColor怎么用?PHP bestColor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: 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 w2p_Utilities_Date($AppUI->formatTZAwareTime($row['task_start_date'], '%Y-%m-%d %T'));
        $end = $row['task_end_date'] ? new w2p_Utilities_Date($AppUI->formatTZAwareTime($row['task_end_date'], '%Y-%m-%d %T')) : 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();
                    $temp['text'] .= '<a href="?m=tasks&amp;a=view&amp;task_id=' . $row['task_id'] . '&amp;tab=1&amp;date=' . $AppUI->formatTZAwareTime($row['task_end_date'], '%Y%m%d') . '">' . w2PtoolTip('Add Log', 'create a new log record against this task') . w2PshowImage('edit_add.png') . w2PendTip() . '</a>';
                }
            }
            $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();
                        $temp['text'] .= '<a href="?m=tasks&amp;a=view&amp;task_id=' . $row['task_id'] . '&amp;tab=1&amp;date=' . $AppUI->formatTZAwareTime($row['task_start_date'], '%Y%m%d') . '">' . w2PtoolTip('Add Log', 'create a new log record against this task') . w2PshowImage('edit_add.png') . w2PendTip() . '</a>';
                    }
                }
                $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();
                        $temp['text'] .= '<a href="?m=tasks&amp;a=view&amp;task_id=' . $row['task_id'] . '&amp;tab=1&amp;date=' . $AppUI->formatTZAwareTime($row['task_end_date'], '%Y%m%d') . '">' . w2PtoolTip('Add Log', 'create a new log record against this task') . w2PshowImage('edit_add.png') . w2PendTip() . '</a>';
                    }
                }
                $links[$end->format(FMT_TIMESTAMP_DATE)][] = $temp;
            }
        }
    }
}
开发者ID:eureka2,项目名称:web2project,代码行数:79,代码来源:links_tasks.php

示例2: CDate

    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;
    } else {
        $start = $page - $pages_per_side;
开发者ID:slawekmikula,项目名称:dotproject,代码行数:31,代码来源:list.php

示例3: foreach

    </tr>

<?php 
$none = true;
foreach ($projects as $row) {
    // We dont check the percent_completed == 100 because some projects
    // were being categorized as completed because not all the tasks
    // have been created (for new projects)
    if ($proFilter == -1 || $row['project_status'] == $proFilter || $proFilter == -2 && $row['project_status'] != 3 || $proFilter == -3 && $row['project_active'] != 0) {
        $project->project_id = $row['project_id'];
        $none = false;
        $start_date = intval($row['project_start_date']) ? new w2p_Utilities_Date($row['project_start_date']) : null;
        $end_date = intval($row['project_end_date']) ? new w2p_Utilities_Date($row['project_end_date']) : null;
        $actual_end_date = intval($row['project_actual_end_date']) ? new w2p_Utilities_Date($row['project_actual_end_date']) : null;
        $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
        $s = '<tr><td width="65" align="right" style="border: outset #eeeeee 1px;background-color:#' . $row['project_color_identifier'] . '"><font color="' . bestColor($row['project_color_identifier']) . '">' . sprintf('%.1f%%', $row['project_percent_complete']) . '</font></td>';
        $s .= '<td align="center">';
        if ($row['project_priority'] < 0) {
            $s .= '<img src="' . w2PfindImage('icons/priority-' . -$row['project_priority'] . '.gif') . '" width="13" height="16" alt="">';
        } elseif ($row['project_priority'] > 0) {
            $s .= '<img src="' . w2PfindImage('icons/priority+' . $row['project_priority'] . '.gif') . '"  width="13" height="16" alt="">';
        }
        $s .= '</td><td width="40%"><a href="?m=projects&a=view&project_id=' . $row['project_id'] . '" ><span title="' . (nl2br(htmlspecialchars($row['project_description'])) ? htmlspecialchars($row['project_name'], ENT_QUOTES) . '::' . nl2br(htmlspecialchars($row['project_description'])) : '') . '" >' . htmlspecialchars($row['project_name'], ENT_QUOTES) . '</span></a></td>';
        $s .= '<td width="30%"><a href="?m=companies&a=view&company_id=' . $row['project_company'] . '" ><span title="' . (nl2br(htmlspecialchars($row['company_description'])) ? htmlspecialchars($row['company_name'], ENT_QUOTES) . '::' . nl2br(htmlspecialchars($row['company_description'])) : '') . '" >' . htmlspecialchars($row['company_name'], ENT_QUOTES) . '</span></a></td>';
        $s .= '<td nowrap="nowrap" align="center">' . ($start_date ? $start_date->format($df) : '-') . '</td>';
        $s .= '<td nowrap="nowrap" align="right">' . $project->getTotalProjectHours() . $AppUI->_('h') . '</td>';
        $s .= '<td nowrap="nowrap" align="center" nowrap="nowrap" style="background-color:' . $priority[$row['project_priority']]['color'] . '">';
        $s .= $end_date ? $end_date->format($df) : '-';
        $s .= '</td><td nowrap="nowrap" align="center">';
        $s .= $actual_end_date ? '<a href="?m=tasks&a=view&task_id=' . $row['critical_task'] . '">' : '';
        $s .= $actual_end_date ? '<span ' . $style . '>' . $actual_end_date->format($df) . '</span>' : '-';
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:departments_tab.view.projects.php

示例4: bestColor

<form name="frmDelete" action="./index.php?m=projects" method="post">
	<input type="hidden" name="dosql" value="do_project_aed" />
	<input type="hidden" name="del" value="1" />
	<input type="hidden" name="project_id" value="<?php 
echo $project_id;
?>
" />
</form>

<tr>
	<td style="border: outset #d1d1cd 1px;background-color:#<?php 
echo $obj->project_color_identifier;
?>
" colspan="2">
	<?php 
echo '<font color="' . bestColor($obj->project_color_identifier) . '"><strong>' . $obj->project_name . '<strong></font>';
?>
	</td>
</tr>

<tr>
	<td width="50%" valign="top">
		<strong><?php 
echo $AppUI->_('Details');
?>
</strong>
		<table cellspacing="1" cellpadding="2" border="0" width="100%">
		<tr>
			<td align="right" nowrap><?php 
echo $AppUI->_('Company');
?>
开发者ID:magsilva,项目名称:dotproject,代码行数:31,代码来源:view.php

示例5: 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

示例6: bestColor

<form name="frmDelete" action="./index.php?m=projects" method="post">
	<input type="hidden" name="dosql" value="do_project_aed" />
	<input type="hidden" name="del" value="1" />
	<input type="hidden" name="project_id" value="<?php 
echo $project_id;
?>
" />
</form>

<tr>
	<td style="border: outset #d1d1cd 1px;background-color:#<?php 
echo $obj->project_color_identifier;
?>
" colspan="2">
	<?php 
echo '<span style="color:' . bestColor($obj->project_color_identifier) . '; font-weight:bold">' . $obj->project_name . '</span>';
?>
	</td>
</tr>

<tr>
	<td width="50%" valign="top">
		<strong><?php 
echo $AppUI->_('Details');
?>
</strong>
		<table cellspacing="1" cellpadding="2" border="0" width="100%">
		<tr>
			<td align="right" nowrap><?php 
echo $AppUI->_('Company');
?>
开发者ID:kaz190,项目名称:dotproject,代码行数:31,代码来源:view.php

示例7: showtask


//.........这里部分代码省略.........
    }
    $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
    /*
    $alt = ((mb_strlen($a['task_description']) > 80) 
    		? (mb_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);
    */
    $alt = !empty($a['task_description']) ? 'onmouseover="javascript:return overlib(' . "'" . htmlspecialchars('<div><p>' . str_replace(array("\r\n", "\n", "\r"), '</p><p>', addslashes($a['task_description'])), ENT_QUOTES) . '</p></div>' . "', CAPTION, '" . $AppUI->_('Description') . "'" . ', CENTER);" onmouseout="nd();"' : ' ';
    if ($a['task_milestone'] > 0) {
        $s .= '&nbsp;<a href="./index.php?m=tasks&amp;a=view&amp;task_id=' . $a['task_id'] . '" ' . $alt . '>' . '<b>' . $a['task_name'] . '</b></a>' . '<img src="./images/icons/milestone.gif" border="0" alt="Milestone" /></td>';
    } else {
        if ($a['task_dynamic'] == 1 || count($task_obj->getChildren())) {
            if (!($today_view || $hideOpenCloseLink)) {
                $s .= '<a href="index.php' . $query_string . ($is_opened ? '&close_task_id=' . $a['task_id'] . '"><img src="images/icons/collapse.gif" align="center"' : '&open_task_id=' . $a['task_id'] . '"><img src="images/icons/expand.gif"') . ' border="0" alt="" /></a>';
            }
            $s .= '&nbsp;<a href="./index.php?m=tasks&amp;a=view&amp;task_id=' . $a['task_id'] . '" ' . $alt . '>' . ($a['task_dynamic'] == 1 ? '<b><i>' : '') . $a['task_name'] . ($a['task_dynamic'] == 1 ? '</i></b>' : '') . '</a></td>';
        } else {
            $s .= '&nbsp;<a href="./index.php?m=tasks&amp;a=view&amp;task_id=' . $a['task_id'] . '" ' . $alt . '>' . $a['task_name'] . '</a></td>';
        }
    }
    if ($today_view) {
        // Show the project name
        $s .= '<td width="50%"><a href="?m=projects&amp;a=view&amp;project_id=' . $a['task_project'] . '">' . '<span style="padding:2px;background-color:#' . $a['project_color_identifier'] . ';color:' . bestColor($a['project_color_identifier']) . '">' . $a['project_name'] . '</span>' . '</a></td>';
    }
    // task owner
    if (!$today_view) {
        $s .= '<td nowrap="nowrap" align="center">' . '<a href="?m=admin&amp;a=viewuser&amp;user_id=' . $a['user_id'] . '">' . $a['user_username'] . '</a>' . '</td>';
    }
    // $s .= '<td nowrap="nowrap" align="center">' . $a['user_username'] . '</td>';
    if (isset($a['task_assigned_users']) && ($assigned_users = $a['task_assigned_users'])) {
        $a_u_tmp_array = array();
        if ($show_all_assignees) {
            $s .= '<td align="center">';
            foreach ($assigned_users as $val) {
                /*
                $a_u_tmp_array[] = ('<a href="mailto:' . $val['user_email'] . '">' 
                					. $val['user_username'] . '</a>'); 
                */
                $a_u_tmp_array[] = '<a href="?m=admin&amp;a=viewuser&amp;user_id=' . $val['user_id'] . '"' . 'title="' . $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$val['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$val['user_id']]['freeCapacity'] . '%' . '">' . $val['user_username'] . ' (' . $val['perc_assignment'] . '%)</a>';
            }
            $s .= join(', ', $a_u_tmp_array) . '</td>';
        } else {
            $s .= '<td align="center" nowrap="nowrap">' . '<a href="?m=admin&amp;a=viewuser&amp;user_id=' . $assigned_users[0]['user_id'] . '" title="' . $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$assigned_users[0]['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$assigned_users[0]['user_id']]['freeCapacity'] . '%">' . $assigned_users[0]['user_username'] . ' (' . $assigned_users[0]['perc_assignment'] . '%)</a>';
            if ($a['assignee_count'] > 1) {
                $s .= ' <a href="javascript: void(0);" onclick="javascript:toggle_users(' . "'users_" . $a['task_id'] . "'" . ');" title="' . join(', ', $a_u_tmp_array) . '">(+' . ($a['assignee_count'] - 1) . ')</a>' . '<span style="display: none" id="users_' . $a['task_id'] . '">';
                $a_u_tmp_array[] = $assigned_users[0]['user_username'];
                for ($i = 1, $xi = count($assigned_users); $i < $xi; $i++) {
                    $a_u_tmp_array[] = $assigned_users[$i]['user_username'];
                    $s .= '<br /><a href="?m=admin&amp;a=viewuser&amp;user_id=' . $assigned_users[$i]['user_id'] . '" title="' . $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$assigned_users[$i]['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$assigned_users[$i]['user_id']]['freeCapacity'] . '%">' . $assigned_users[$i]['user_username'] . ' (' . $assigned_users[$i]['perc_assignment'] . '%)</a>';
                }
                $s .= '</span>';
            }
            $s .= '</td>';
        }
    } else {
        if (!$today_view) {
            // No users asigned to task
            $s .= '<td align="center">-</td>';
        }
    }
    // duration or milestone
    $s .= '<td nowrap="nowrap" align="center" style="' . $style . '">' . ($start_date ? $start_date->format($df) : '-') . '</td>' . '<td align="center" nowrap="nowrap" style="' . $style . '">' . $a['task_duration'] . ' ' . $AppUI->_($durnTypes[$a['task_duration_type']]) . '</td>' . '<td nowrap="nowrap" align="center" style="' . $style . '">' . ($end_date ? $end_date->format($df) : '-') . '</td>';
    if ($today_view) {
        $s .= '<td nowrap="nowrap" align="center" style="' . $style . '">' . $a['task_due_in'] . '</td>';
    } else {
        if ($AppUI->isActiveModule('history') && getPermission('history', 'view')) {
            $s .= '<td nowrap="nowrap" align="center" style="' . $style . '">' . ($last_update ? $last_update->format($df) : '-') . '</td>';
        }
    }
    // Assignment checkbox
    if ($showEditCheckbox) {
        $s .= "\n\t" . '<td align="center">' . '<input type="checkbox" name="selected_task[' . $a['task_id'] . ']" value="' . $a['task_id'] . '"/></td>';
    }
    $s .= '</tr>';
    echo $s;
}
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:101,代码来源:tasks.class.php

示例8: createCell


//.........这里部分代码省略.........
         // The above are all contact/user display names, the below are numbers.
         case '_count':
         case '_hours':
             $cell = $value;
             break;
         case '_duration':
             $durnTypes = w2PgetSysVal('TaskDurationType');
             $cell = $value . ' ' . $this->AppUI->_($durnTypes[$this->tableRowData['task_duration_type']]);
             break;
         case '_size':
             $cell = file_size($value);
             break;
         case '_budget':
             $cell = w2PgetConfig('currency_symbol');
             $cell .= formatCurrency($value, $this->AppUI->getPref('CURRENCYFORM'));
             break;
         case '_url':
             $value = str_replace(array('"', '"', '<', '>'), '', $value);
             $cell = w2p_url($value);
             break;
         case '_email':
             $cell = w2p_email($value);
             break;
         case '_birthday':
         case '_date':
             $myDate = intval($value) ? new w2p_Utilities_Date($value) : null;
             $cell = $myDate ? $myDate->format($this->df) : '-';
             break;
         case '_actual':
             $end_date = intval($this->tableRowData['project_end_date']) ? new w2p_Utilities_Date($this->tableRowData['project_end_date']) : null;
             $actual_end_date = intval($this->tableRowData['project_actual_end_date']) ? new w2p_Utilities_Date($this->tableRowData['project_actual_end_date']) : null;
             $style = $actual_end_date < $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
             if ($actual_end_date) {
                 $cell = '<a href="?m=tasks&a=view&task_id=' . $this->tableRowData['project_last_task'] . '" ' . $style . '>' . $actual_end_date->format($this->df) . '</a>';
             } else {
                 $cell = '-';
             }
             break;
         case '_created':
         case '_datetime':
         case '_update':
         case '_updated':
             $myDate = intval($value) ? new w2p_Utilities_Date($this->AppUI->formatTZAwareTime($value, '%Y-%m-%d %T')) : null;
             $cell = $myDate ? $myDate->format($this->dtf) : '-';
             break;
         case '_description':
             $cell = w2p_textarea($value);
             break;
         case '_priority':
             $mod = $value > 0 ? '+' : '-';
             $image = '<img src="' . w2PfindImage('icons/priority' . $mod . abs($value) . '.gif') . '" width="13" height="16" alt="">';
             $cell = $value != 0 ? $image : '';
             break;
         case '_complete':
         case '_assignment':
         case '_allocated':
         case '_allocation':
             $cell = round($value) . '%';
             break;
         case '_password':
             $cell = '(' . $this->AppUI->_('hidden') . ')';
             break;
         case '_version':
             $value = (int) (100 * $value);
             $cell = number_format($value / 100, 2);
             break;
         case '_identifier':
             $additional = 'style="background-color:#' . $value . '; color:' . bestColor($value) . '" ';
             $cell = $this->tableRowData['project_percent_complete'] . '%';
             break;
         case '_project':
             $module = substr($suffix, 1);
             $class = 'C' . ucfirst($module);
             $obj = new $class();
             $obj->load($value);
             $color = $obj->project_color_identifier;
             $link = '?m=' . w2p_pluralize($module) . '&a=view&' . $module . '_id=' . $value;
             $cell = '<span style="background-color:#' . $color . '; padding: 3px"><a href="' . $link . '" style="color:' . bestColor($color) . '">' . $obj->{"{$module}" . '_name'} . '</a></span>';
             $suffix .= ' _name';
             break;
         case '_assignees':
             $cell = $value;
             break;
         case '_problem':
             if ($value) {
                 $cell = '<a href="?m=tasks&a=index&f=all&project_id=' . $this->tableRowData['project_id'] . '">';
                 $cell .= w2PshowImage('icons/dialog-warning5.png', 16, 16, 'Problem', 'Problem');
                 $cell .= '</a>';
             } else {
                 $cell = '-';
             }
             break;
         default:
             $value = isset($custom[$fieldName]) ? $custom[$fieldName][$value] : $value;
             $cell = htmlspecialchars($value, ENT_QUOTES);
     }
     $begin = '<td ' . $additional . 'class="' . $suffix . '">';
     $end = '</td>';
     return $begin . $cell . $end;
 }
开发者ID:illuminate3,项目名称:web2project,代码行数:101,代码来源:HTMLHelper.class.php

示例9: displayTask

function displayTask($list, $task, $level, $display_week_hours, $fromPeriod, $toPeriod, $user_id, $canEditINA)
{
    global $AppUI, $df, $durnTypes, $log_userfilter_users, $priority, $system_users, $z, $zi, $x, $userAlloc;
    $zi++;
    $users = $task->task_assigned_users;
    $task->userPriority = $task->getUserSpecificTaskPriority($user_id);
    $projects = $task->getProject();
    $tmp = "<tr>";
    $tmp .= "<td align=\"center\" nowrap=\"nowrap\">";
    $tmp .= "<input type=\"checkbox\" name=\"selected_task[{$task->task_id}]\" value=\"{$task->task_id}\"/>";
    $tmp .= "</td>";
    /*ina
     */
    $tmp .= "<td>";
    for ($i = 0; $i < $level; $i++) {
        $tmp .= "&#160";
    }
    if ($task->task_milestone == true) {
        $tmp .= "<B>";
    }
    if ($level >= 1) {
        $tmp .= dPshowImage(dPfindImage('corner-dots.gif', 'tasks'), 16, 12, 'Subtask') . "&nbsp;";
    }
    $tmp .= "<a href='?m=tasks&a=view&task_id={$task->task_id}'>" . $task->task_name . "</a>";
    if ($task->task_milestone == true) {
        $tmp .= "</B>";
    }
    if ($task->task_priority < 0) {
        $tmp .= "&nbsp;(<img src=\"./images/icons/priority-" . -$task->task_priority . ".gif\" width=13 height=16>)";
    } elseif ($task->task_priority > 0) {
        $tmp .= "&nbsp;(<img src=\"./images/icons/priority+" . $task->task_priority . ".gif\" width=13 height=16>)";
    }
    $tmp .= "</td>";
    $tmp .= "<td align=\"center\">";
    $tmp .= "<a href='?m=projects&a=view&project_id={$task->task_project}' style='background-color:#" . @$projects["project_color_identifier"] . "; color:" . bestColor(@$projects['project_color_identifier']) . "'>" . $projects['project_short_name'] . "</a>";
    $tmp .= "</td>";
    $tmp .= "<td align=\"center\" nowrap=\"nowrap\">";
    $tmp .= $task->task_duration . "&nbsp;" . $AppUI->_($durnTypes[$task->task_duration_type]);
    $tmp .= "</td>";
    $tmp .= "<td align=\"center\" nowrap=\"nowrap\">";
    $dt = new CDate($task->task_start_date);
    $tmp .= $dt->format($df);
    $tmp .= "&#160&#160&#160</td>";
    $tmp .= "<td align=\"center\" nowrap=\"nowrap\">";
    $ed = new CDate($task->task_end_date);
    $now = new CDate();
    $dt = $now->dateDiff($ed);
    $sgn = $now->compare($ed, $now);
    $tmp .= $dt * $sgn;
    $tmp .= "</td>";
    if ($display_week_hours) {
        $tmp .= displayWeeks($list, $task, $level, $fromPeriod, $toPeriod);
    }
    $tmp .= "<td>";
    $sep = $us = "";
    foreach ($users as $row) {
        if ($row["user_id"]) {
            if ($canEditINA) {
                $us .= "<a href='?m=admin&a=viewuser&user_id={$row['0']}'>" . $sep . $row['contact_last_name'] . "&nbsp;\n                        \t(" . $row['perc_assignment'] . "%)</a>";
            } else {
                $us .= $sep . $row['contact_last_name'] . "&nbsp;(" . $row['perc_assignment'] . "%)";
            }
            /*ina*/
            $sep = ", ";
        }
    }
    $tmp .= $us;
    $tmp .= "</td>";
    // create the list of possible assignees
    if ($zi == 1) {
        //  selectbox may not have a size smaller than 2, use 5 here as minimum
        $zz = $z < 5 ? 5 : $z * 1.5;
        if (sizeof($users) >= 7) {
            $zz = $zz * 2;
        }
        $zm1 = $z - 2;
        if ($zm1 == 0) {
            $zm1 = 1;
        }
        $assUser = $userAlloc[$user_id]['userFC'];
        if ($user_id == 0) {
            // need to handle orphaned tasks different from tasks with existing assignees
            $zm1++;
        }
        if ($canEditINA) {
            $tmp .= "<td valign=\"top\" align=\"center\" nowrap=\"nowrap\" rowspan=\"{$zm1}\">";
            $tmp .= '<select name="add_users" style="width:200px" size="' . ($zz - 1) . '" class="text" multiple="multiple" ondblclick="javascript:chAssignment(' . $user_id . ', 0, false)">';
            foreach ($userAlloc as $v => $u) {
                $tmp .= "\n\t<option value=\"" . $u['user_id'] . "\">" . dPformSafe($u['userFC']) . "</option>";
            }
            $tmp .= '</select>';
            //$tmp.= arraySelect( $user_list, 'add_users', 'class="text" STYLE="width: 200px" size="'.($zz-1).'" multiple="multiple"',NULL );
            $tmp .= "</td>";
        }
    }
    $tmp .= "</tr>\n";
    return $tmp;
}
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:98,代码来源:tasksperuser_sub.php

示例10: bestColor

</th>
</tr>
<?php 
$fp = -1;
$id = 0;
for ($i = ($page - 1) * $xpg_pagesize; $i < $page * $xpg_pagesize && $i < $xpg_totalrecs; $i++) {
    $row = $links[$i];
    if ($fp != $row['link_project']) {
        if (!$row['project_name']) {
            $row['project_name'] = $AppUI->_('No Project Specified');
            $row['project_color_identifier'] = 'f4efe3';
        }
        if ($showProject) {
            $s = '<tr>';
            $s .= '<td colspan="10" style="background-color:#' . $row['project_color_identifier'] . '" style="border: outset 2px #eeeeee">';
            $s .= '<font color="' . bestColor($row['project_color_identifier']) . '">';
            if ($row['link_project'] > 0) {
                $s .= '<a href="?m=projects&a=view&project_id=' . $row['link_project'] . '">' . $row['project_name'] . '</a>';
            } else {
                $s .= $row['project_name'];
            }
            $s .= '</font>';
            $s .= '</td></tr>';
            echo $s;
        }
    }
    $fp = $row['link_project'];
    ?>
<tr>
	<td nowrap="nowrap" width="20">
	<?php 
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:index_table.php

示例11: intval

$start_date = intval($forum["forum_create_date"]) ? new CDate($forum["forum_create_date"]) : null;
//20090907 KSen@Itsutsubashi
$project_id = $forum['forum_project'];
// setup the title block
$titleBlock = new CTitleBlock('Forum', 'support.png', $m, "{$m}.{$a}");
$titleBlock->addCell(arraySelect($filters, 'f', 'size="1" class="text" onchange="document.filterFrm.submit();"', $f, true), '', '<form action="?m=forums&a=viewer&forum_id=' . $forum_id . '" method="post" name="filterFrm">', '</form>');
$titleBlock->show();
?>
<table width="100%" cellspacing="0" cellpadding="2" border="0" class="std">
<tr>
	<td height="20" colspan="3" style="border: outset #D1D1CD 1px;background-color:#<?php 
echo $forum["project_color_identifier"];
?>
">
		<font size="2" color=<?php 
echo bestColor($forum["project_color_identifier"]);
?>
><strong><?php 
echo @$forum["forum_name"];
?>
</strong></font>
	</td>
</tr>
<tr>
	<td align="left" nowrap><?php 
echo $AppUI->_('Related Project');
?>
:</td>
	<td nowrap="nowrap"><strong><a href="./index.php?m=projects&a=view&project_id=<?php 
echo $forum['forum_project'];
?>
开发者ID:kaz190,项目名称:dotproject,代码行数:31,代码来源:viewer.php

示例12: bestColor

			<td nowrap="nowrap" colspan="2"><strong><?php 
echo $AppUI->_('Details');
?>
</strong></td>
		</tr>
		<tr>
			<td align="right" nowrap="nowrap"><?php 
echo $AppUI->_('Project');
?>
:</td>
			<td style="border: outset #d1d1cd 1px;background-color:#<?php 
echo $obj->project_color_identifier;
?>
">
				<?php 
echo '<span style="color:' . bestColor($obj->project_color_identifier) . '; font-weight:bold">' . htmlspecialchars($obj->project_name) . '</span>';
?>
			</td>
		</tr>
		<tr>
			<td align="right" nowrap="nowrap"><?php 
echo $AppUI->_('Task');
?>
:</td>
			<td class="hilite"><strong><?php 
echo htmlspecialchars(@$obj->task_name);
?>
</strong></td>
		</tr>
		<?php 
if ($obj->task_parent != $obj->task_id) {
开发者ID:hightechcompany,项目名称:dotproject,代码行数:31,代码来源:view.php

示例13: addBar

 public function addBar(array $columnValues, $caption = '', $height = '0.6', $barcolor = 'FFFFFF', $active = true, $progress = 0, $identifier = 0)
 {
     foreach ($columnValues as $name => $value) {
         switch ($name) {
             case 'start_date':
                 $start = $value;
                 $startDate = new w2p_Utilities_Date($value);
                 $rowValues[] = $startDate->format($this->df);
                 break;
             case 'end_date':
                 $endDate = new w2p_Utilities_Date($value);
                 $rowValues[] = $endDate->format($this->df);
                 break;
             case 'actual_end':
                 if ('' == $value) {
                     $actual_end = $columnValues['end_date'];
                     $rowValues[] = $value;
                 } else {
                     $actual_end = $value;
                     $actual_endDate = new w2p_Utilities_Date($value);
                     $rowValues[] = $actual_endDate->format($this->df);
                 }
                 break;
             default:
                 $rowValues[] = $value;
         }
     }
     $bar = new GanttBar($this->rowCount++, $rowValues, $start, $actual_end, $caption, $height);
     $this->rowMap[$identifier] = $this->rowCount;
     $bar->progress->Set(min($progress / 100, 1));
     $bar->title->SetFont(FF_CUSTOM, FS_NORMAL, 10);
     $bar->title->SetColor(bestColor('#ffffff', '#' . $barcolor, '#000000'));
     $bar->SetFillColor('#' . $barcolor);
     $bar->SetPattern(BAND_SOLID, '#' . $barcolor);
     if (0.1 == $height) {
         $bar->rightMark->Show();
         $bar->rightMark->SetType(MARK_RIGHTTRIANGLE);
         $bar->rightMark->SetWidth(3);
         $bar->rightMark->SetColor('black');
         $bar->rightMark->SetFillColor('black');
         $bar->leftMark->Show();
         $bar->leftMark->SetType(MARK_LEFTTRIANGLE);
         $bar->leftMark->SetWidth(3);
         $bar->leftMark->SetColor('black');
         $bar->leftMark->SetFillColor('black');
         $bar->SetPattern(BAND_SOLID, 'black');
         $bar->title->SetFont(FF_CUSTOM, FS_BOLD, 9);
     }
     //adding captions
     $bar->caption = new TextProperty($caption);
     $bar->caption->Align('left', 'center');
     if (is_file(TTF_DIR . 'FreeSans.ttf')) {
         $bar->caption->SetFont(FF_CUSTOM, FS_NORMAL, 8);
     }
     // gray out templates, completes, on ice, on hold
     if (!$active) {
         $bar->caption->SetColor('darkgray');
         $bar->title->SetColor('darkgray');
         $bar->SetColor('darkgray');
         $bar->SetFillColor('gray');
         $bar->progress->SetFillColor('darkgray');
         $bar->progress->SetPattern(BAND_SOLID, 'darkgray', 98);
     }
     $this->graph->Add($this->addDependencies($bar, $identifier));
 }
开发者ID:illuminate3,项目名称:web2project,代码行数:65,代码来源:GanttRenderer.class.php

示例14: array

    } else {
        $graph->scale->actinfo->SetColTitles(array($AppUI->_('Task name', UI_OUTPUT_RAW), $AppUI->_('Project name', UI_OUTPUT_RAW), $AppUI->_('Dur.', UI_OUTPUT_RAW), $AppUI->_('Start', UI_OUTPUT_RAW), $AppUI->_('Finish', UI_OUTPUT_RAW)), array(180, 50, 60, 60, 60));
    }
} else {
    if ($showWork == '1') {
        $graph->scale->actinfo->SetColTitles(array($AppUI->_('Task name', UI_OUTPUT_RAW), $AppUI->_('Work', UI_OUTPUT_RAW), $AppUI->_('Start', UI_OUTPUT_RAW), $AppUI->_('Finish', UI_OUTPUT_RAW)), array(210, 45, 75, 75));
    } else {
        $graph->scale->actinfo->SetColTitles(array($AppUI->_('Task name', UI_OUTPUT_RAW), $AppUI->_('Dur.', UI_OUTPUT_RAW), $AppUI->_('Start', UI_OUTPUT_RAW), $AppUI->_('Finish', UI_OUTPUT_RAW)), array(210, 45, 75, 75));
    }
}
$graph->scale->tableTitle->Set($projects[$project_id]['project_name']);
// Use TTF font if it exists
// try commenting out the following two lines if gantt charts do not display
$graph->scale->tableTitle->SetFont(FF_CUSTOM, FS_BOLD, 12);
$graph->scale->SetTableTitleBackground('#' . $projects[$project_id]['project_color_identifier']);
$font_color = bestColor('#' . $projects[$project_id]['project_color_identifier']);
$graph->scale->tableTitle->SetColor($font_color);
$graph->scale->tableTitle->Show(true);
//-----------------------------------------
// nice Gantt image
// if diff(end_date,start_date) > 90 days it shows only
//week number
// if diff(end_date,start_date) > 240 days it shows only
//month number
//-----------------------------------------
if ($start_date && $end_date) {
    $min_d_start = new CDate($start_date);
    $max_d_end = new CDate($end_date);
    $graph->SetDateRange($start_date, $end_date);
} else {
    // find out DateRange from gant_arr
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:31,代码来源:gantt.php

示例15: displayFiles


//.........这里部分代码省略.........
		<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 
开发者ID:slawekmikula,项目名称:dotproject,代码行数:67,代码来源:folders_table.php


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