Exemple #1
0
/**
 * Sub-function to collect events 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
 * @author Andrew Eddie <*****@*****.**>
 */
function getEventLinks($startPeriod, $endPeriod, &$links, $strMaxLen, $minical = false)
{
    global $event_filter;
    $events = CEvent::getEventsForPeriod($startPeriod, $endPeriod, $event_filter);
    $cwd = explode(',', w2PgetConfig('cal_working_days'));
    // assemble the links for the events
    foreach ($events as $row) {
        $start = new CDate($row['event_start_date']);
        $end = new CDate($row['event_end_date']);
        $date = $start;
        for ($i = 0, $i_cmp = $start->dateDiff($end); $i <= $i_cmp; $i++) {
            // the link
            // optionally do not show events on non-working days
            if ($row['event_cwd'] && in_array($date->getDayOfWeek(), $cwd) || !$row['event_cwd']) {
                if ($minical) {
                    $link = array();
                } else {
                    $url = '?m=calendar&a=view&event_id=' . $row['event_id'];
                    $link['href'] = '';
                    $link['alt'] = '';
                    $link['text'] = w2PtoolTip($row['event_title'], getEventTooltip($row['event_id']), true) . w2PshowImage('event' . $row['event_type'] . '.png', 16, 16, '', '', 'calendar') . '</a>&nbsp;' . '<a href="' . $url . '"><span class="event">' . $row['event_title'] . '</span></a>' . w2PendTip();
                }
                $links[$date->format(FMT_TIMESTAMP_DATE)][] = $link;
            }
            $date = $date->getNextDay();
        }
    }
}
 public function buildRow($rowData, $customLookups = array())
 {
     if (!$this->showRow($rowData)) {
         return '';
     }
     $this->stageRowData($rowData);
     $class = w2pFindTaskComplete($rowData['task_start_date'], $rowData['task_end_date'], $rowData['task_percent_complete']);
     $row = '<tr class="' . $class . '">';
     $row .= $this->_buildCells(array('edit' => 'task_id', 'pin' => 'task_id', 'log' => 'task_id'));
     foreach ($this->_fieldKeys as $column) {
         if ('task_name' == $column) {
             $prefix = $suffix = '';
             if ($rowData['depth'] > 1) {
                 $prefix .= str_repeat('&nbsp;', ($rowData['depth'] - 1) * 4) . '<img src="' . w2PfindImage('corner-dots.gif') . '" />';
             }
             if ($rowData['children'] > 0) {
                 $prefix .= '<img src="' . w2PfindImage('icons/collapse.gif') . '" />&nbsp;';
             }
             if ('' != $rowData['task_description']) {
                 $prefix .= w2PtoolTip($this->_AppUI->_('Task Description'), $rowData['task_description']);
                 $suffix .= w2PendTip();
             }
             if ($rowData['task_milestone']) {
                 $suffix .= '&nbsp;' . '<img src="' . w2PfindImage('icons/milestone.gif') . '" />';
             }
             if (1 == $rowData['task_dynamic'] || $rowData['task_milestone']) {
                 $rowData[$column] = '<b>' . $rowData[$column] . '</b>';
             }
             $rowData[$column] = $prefix . $rowData[$column] . $suffix;
         }
         if ('task_assignees' == $column) {
             $parsed = array();
             $assignees = $this->task->assignees($rowData['task_id']);
             foreach ($assignees as $assignee) {
                 $parsed[] = '<a href="?m=users&a=view&user_id=' . $assignee['user_id'] . '">' . $assignee['contact_name'] . '</a>';
             }
             $rowData[$column] = implode(', ', $parsed);
         }
         $row .= $this->createCell($column, $rowData[$column], $customLookups);
     }
     if ('projectdesigner' == $this->module) {
         $row .= '<td class="data"><input type="checkbox" name="selected_task[]" value="' . $rowData['task_id'] . '"/></td>';
     }
     $row .= '</tr>';
     return $row;
 }
Exemple #3
0
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;
    }
    if ($arr['task_milestone'] > 0) {
        $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $arr['task_id'] . '" ><b>' . $arr['task_name'] . '</b></a> <img src="' . w2PfindImage('icons/milestone.gif') . '" border="0" /></td>';
    } elseif ($arr['task_dynamic'] == '1' || $is_parent) {
        if (!$today_view) {
            $s .= $open_link;
        }
        if ($arr['task_dynamic'] == '1') {
            $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $arr['task_id'] . '" ><b><i>' . $arr['task_name'] . '</i></b></a></td>';
        } else {
            $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $arr['task_id'] . '" >' . $arr['task_name'] . '</a></td>';
        }
    } else {
        $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $arr['task_id'] . '" >' . $arr['task_name'] . '</a></td>';
    }
    if ($arr['task_description']) {
        $s .= w2PendTip();
    }
    if ($today_view) {
        // Show the project name
        $s .= '<td width="50%"><a href="./index.php?m=projects&a=view&project_id=' . $arr['task_project'] . '">' . '<span style="padding:2px;background-color:#' . $arr['project_color_identifier'] . ';color:' . bestColor($arr['project_color_identifier']) . '">' . $arr['project_name'] . '</span>' . '</a></td>';
    }
    // task owner
    if (!$today_view) {
        $s .= '<td nowrap="nowrap" align="center">' . '<a href="?m=admin&a=viewuser&user_id=' . $arr['user_id'] . '">' . $arr['owner'] . '</a>' . '</td>';
    }
    if (isset($arr['task_assigned_users']) && ($assigned_users = $arr['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="?m=admin&a=viewuser&user_id=' . $val['user_id'] . '"' . 'title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$val['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$val['user_id']]['freeCapacity'] . '%' : '') . '">' . $val['assignee'] . ' (' . $val['perc_assignment'] . '%)</a>';
            }
            $s .= join(', ', $a_u_tmp_array) . '</td>';
        } else {
            $s .= '<td align="center" nowrap="nowrap">' . '<a href="?m=admin&a=viewuser&user_id=' . $assigned_users[0]['user_id'] . '" title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$assigned_users[0]['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$assigned_users[0]['user_id']]['freeCapacity'] . '%' : '') . '">' . $assigned_users[0]['assignee'] . ' (' . $assigned_users[0]['perc_assignment'] . '%)</a>';
            if ($arr['assignee_count'] > 1) {
                $s .= ' <a href="javascript: void(0);" onclick="toggle_users(' . "'users_" . $arr['task_id'] . "'" . ');" title="' . join(', ', $a_u_tmp_array) . '">(+' . ($arr['assignee_count'] - 1) . ')</a>' . '<span style="display: none" id="users_' . $arr['task_id'] . '">';
                $a_u_tmp_array[] = $assigned_users[0]['assignee'];
                for ($i = 1, $i_cmp = count($assigned_users); $i < $i_cmp; $i++) {
                    $a_u_tmp_array[] = $assigned_users[$i]['assignee'];
                    $s .= '<br /><a href="?m=admin&a=viewuser&user_id=' . $assigned_users[$i]['user_id'] . '" title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$assigned_users[$i]['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$assigned_users[$i]['user_id']]['freeCapacity'] . '%' : '') . '">' . $assigned_users[$i]['assignee'] . ' (' . $assigned_users[$i]['perc_assignment'] . '%)</a>';
                }
                $s .= '</span>';
            }
            $s .= '</td>';
        }
    } elseif (!$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($fdf) : '-') . '</td>' . '<td align="right" nowrap="nowrap" style="' . $style . '">' . $arr['task_duration'] . ' ' . mb_substr($AppUI->_($durnTypes[$arr['task_duration_type']]), 0, 1) . '</td>' . '<td nowrap="nowrap" align="center" style="' . $style . '">' . ($end_date ? $end_date->format($fdf) : '-') . '</td>';
    if ($today_view) {
        $s .= '<td nowrap="nowrap" align="center" style="' . $style . '">' . $arr['task_due_in'] . '</td>';
    } elseif ($history_active) {
        $s .= '<td nowrap="nowrap" align="center" style="' . $style . '">' . ($last_update ? $last_update->format($fdf) : '-') . '</td>';
    }
    // Assignment checkbox
    if ($showEditCheckbox) {
        $s .= '<td align="center">' . '<input type="checkbox" name="selected_task[' . $arr['task_id'] . ']" value="' . $arr['task_id'] . '"/></td>';
    }
    $s .= '</tr>';
    echo $s;
}
            if (strpos($c['config_name'], '_pass') !== false) {
                $c['config_type'] = 'password';
                $value = str_repeat('x', strlen($value));
                $entry = '<input class="text" type="password" name="w2Pcfg[' . $c['config_name'] . ']" value="' . $value . '" ' . $extra . ' onClick="document.getElementById(\'' . $c['config_name'] . '_mod\').value=\'1\';" />';
                $entry .= '<input type="hidden" name="' . $c['config_name'] . '_mod" id="' . $c['config_name'] . '_mod" value="" />';
            } else {
                $entry = '<input class="text" type="' . $c['config_type'] . '" name="w2Pcfg[' . $c['config_name'] . ']" id="w2Pcfg[' . $c['config_name'] . ']" value="' . $value . '" ' . $extra . '/>';
            }
            break;
    }
    if ($c['config_group'] != $last_group) {
        $output .= '<tr><td colspan="2"><b>' . $AppUI->_($c['config_group'] . '_group_title') . '</b></td></tr>';
        $last_group = $c['config_group'];
    }
    $output .= '<tr>
                    <td class="item" width="20%"><a name="' . $c['config_name'] . '"> </a>' . $AppUI->_($c['config_name'] . '_title') . '</td>' . '<td align="left" width="5%">' . $entry . '<input class="button" type="hidden"  name="w2PcfgId[' . $c['config_name'] . ']" value="' . $c['config_id'] . '" />' . '</td>' . '<td align="left" width="16">' . w2PtoolTip($AppUI->_($c['config_name'] . '_title'), $tooltip, true) . w2PshowImage('log-info.gif') . w2PendTip() . '</td>
                    <td align="left" width="100%">&nbsp;</td>
                </tr>';
}
?>
<form name="cfgFrm" action="index.php?m=system&a=systemconfig" method="post" accept-charset="utf-8">
	<input type="hidden" name="dosql" value="do_systemconfig_aed" />
	<table cellspacing="0" cellpadding="3" border="0" class="std" width="100%" align="center">
		<tr><td colspan="4"><?php 
echo $AppUI->_('syscfg_intro');
?>
</td></tr>
		<?php 
echo $output;
?>
		<tr>
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 w2p_Utilities_Date();
    $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 w2p_Utilities_Date($AppUI->formatTZAwareTime($a['task_start_date'], '%Y-%m-%d %T')) : null;
    $end_date = intval($a['task_end_date']) ? new w2p_Utilities_Date($AppUI->formatTZAwareTime($a['task_end_date'], '%Y-%m-%d %T')) : null;
    $last_update = isset($a['last_update']) && intval($a['last_update']) ? new w2p_Utilities_Date($AppUI->formatTZAwareTime($a['last_update'], '%Y-%m-%d %T')) : null;
    // prepare coloured highlight of task time information
    $sign = 1;
    $style = '';
    if ($start_date) {
        if (!$end_date) {
            $end_date = new w2p_Utilities_Date('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;
    }
    $jsTaskId = 'task_proj_' . $a['task_project'] . '_level-' . $level . '-task_' . $a['task_id'] . '_';
    if ($expanded) {
        $s = '<tr id="' . $jsTaskId . '" onmouseover="highlight_tds(this, true, ' . $a['task_id'] . ')" onmouseout="highlight_tds(this, false, ' . $a['task_id'] . ')" onclick="select_box(\'selected_task\', \'' . $a['task_id'] . '\', \'' . $jsTaskId . '\',\'frm_tasks\')">';
        // edit icon
    } else {
        $s = '<tr id="' . $jsTaskId . '" onmouseover="highlight_tds(this, true, ' . $a['task_id'] . ')" onmouseout="highlight_tds(this, false, ' . $a['task_id'] . ')" onclick="select_box(\'selected_task\', \'' . $a['task_id'] . '\', \'' . $jsTaskId . '\',\'frm_tasks\')" ' . ($level ? 'style="display:none"' : '') . '>';
        // edit icon
    }
    $s .= '<td>';
    $canEdit = $a['task_represents_project'] ? false : true;
    $canViewLog = true;
    if ($canEdit) {
        $s .= '<a href="?m=tasks&a=addedit&task_id=' . $a['task_id'] . '">' . w2PtoolTip('edit tasks panel', 'click to edit this task') . w2PshowImage('icons/pencil.gif', 12, 12) . w2PendTip() . '</a>';
    }
    $s .= '</td>';
    // percent complete
    $s .= '<td align="right">' . (int) $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" alt="" />';
    } elseif ($a['task_priority'] > 0) {
        $s .= '<img src="' . w2PfindImage('icons/priority+' . $a['task_priority'] . '.gif') . '" width="13" height="16" alt="" />';
    }
    $s .= '</td><td align="center" nowrap="nowrap">';
    if ($a['user_task_priority'] < 0) {
        $s .= '<img src="' . w2PfindImage('icons/priority-' . -$a['user_task_priority'] . '.gif') . '" alt="" />';
    } elseif ($a['user_task_priority'] > 0) {
        $s .= '<img src="' . w2PfindImage('icons/priority+' . $a['user_task_priority'] . '.gif') . '" alt="" />';
    }
    $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 && 0 == $a['task_represents_project']) {
        $s .= '<a href="?m=tasks&a=view&tab=1&project_id=' . $a['task_project'] . '&task_id=' . $a['task_id'] . '">' . w2PtoolTip('tasks', 'add work log to this task') . w2PshowImage('edit_add.png') . w2PendTip() . '</a>';
    }
    $s .= '</td>';
    // dots
    if ($today_view) {
        $s .= '<td>';
    } else {
        $s .= '<td width="20%">';
    }
    for ($y = 0; $y < $level; $y++) {
        if ($y + 1 == $level) {
            $image = w2PfindImage('corner-dots.gif', $m);
        } else {
            $image = w2PfindImage('shim.gif', $m);
        }
        $s .= '<img src="' . $image . '" width="16" height="12"  border="0" alt="" />';
    }
    // name link
    if ($a['task_description']) {
        $s .= w2PtoolTip('Task Description', $a['task_description'], true);
    }
    $jsTaskId = 'task_proj_' . $a['task_project'] . '_level-' . $level . '-task_' . $a['task_id'] . '_';
    $open_link = '<a href="javascript: void(0);"><img onclick="expand_collapse(\'' . $jsTaskId . '\', \'tblProjects\',\'\',' . ($level + 1) . ');" id="' . $jsTaskId . '_collapse" src="' . w2PfindImage('icons/collapse.gif', $m) . '" border="0" align="center" ' . (!$expanded ? 'style="display:none"' : '') . ' alt="" /><img onclick="expand_collapse(\'' . $jsTaskId . '\', \'tblProjects\',\'\',' . ($level + 1) . ');" id="' . $jsTaskId . '_expand" src="' . w2PfindImage('icons/expand.gif', $m) . '" border="0" align="center" ' . ($expanded ? 'style="display:none"' : '') . ' alt="" /></a>';
    $taskObj = new CTask();
    $taskObj->load($a['task_id']);
    if (count($taskObj->getChildren())) {
        $is_parent = true;
    } else {
        $is_parent = false;
    }
    if ($a['task_milestone'] > 0) {
        $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $a['task_id'] . '" ><b>' . $a['task_name'] . '</b></a> <img src="' . w2PfindImage('icons/milestone.gif', $m) . '" border="0" alt="" /></td>';
    } elseif ($a['task_dynamic'] == '1' || $is_parent) {
        $s .= $open_link;
        if ($a['task_dynamic'] == '1') {
            $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $a['task_id'] . '" ><b><i>' . $a['task_name'] . '</i></b></a></td>';
        } else {
            $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $a['task_id'] . '" >' . $a['task_name'] . '</a></td>';
        }
    } else {
        $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $a['task_id'] . '" >' . $a['task_name'] . '</a></td>';
    }
    if ($a['task_description']) {
        $s .= w2PendTip();
    }
    // task description
    if ($PROJDESIGN_CONFIG['show_task_descriptions']) {
        $s .= '<td align="justified">' . $a['task_description'] . '</td>';
    }
    // task owner
    $s .= '<td align="left">' . '<a href="?m=admin&a=viewuser&user_id=' . $a['user_id'] . '">' . $a['contact_first_name'] . ' ' . $a['contact_last_name'] . '</a></td>';
    $s .= '<td id="ignore_td_' . $a['task_id'] . '" nowrap="nowrap" align="center" style="' . $style . '">' . ($start_date ? $start_date->format($df . ' ' . $tf) : '-') . '</td>';
    // duration or milestone
    $s .= '<td id="ignore_td_' . $a['task_id'] . '" align="right" nowrap="nowrap" style="' . $style . '">';
    $s .= $a['task_duration'] . ' ' . mb_substr($AppUI->_($durnTypes[$a['task_duration_type']]), 0, 1);
    $s .= '</td>';
    $s .= '<td id="ignore_td_' . $a['task_id'] . '" nowrap="nowrap" align="center" style="' . $style . '">' . ($end_date ? $end_date->format($df . ' ' . $tf) : '-') . '</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="left">';
            foreach ($assigned_users as $val) {
                $aInfo = '<a href="?m=admin&a=viewuser&user_id=' . $val['user_id'] . '"';
                $aInfo .= 'title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$val['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$val['user_id']]['freeCapacity'] . '%' : '') . '">';
                $aInfo .= $val['contact_first_name'] . ' ' . $val['contact_last_name'] . ' (' . $val['perc_assignment'] . '%)</a>';
                $a_u_tmp_array[] = $aInfo;
            }
            $s .= join(', ', $a_u_tmp_array);
            $s .= '</td>';
        } else {
            $s .= '<td align="left" nowrap="nowrap">';
            $s .= '<a href="?m=admin&a=viewuser&user_id=' . $assigned_users[0]['user_id'] . '"';
            $s .= 'title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$assigned_users[0]['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$assigned_users[0]['user_id']]['freeCapacity'] . '%' : '') . '">';
            $s .= $assigned_users[0]['contact_first_name'] . ' ' . $assigned_users[0]['contact_last_name'] . ' (' . $assigned_users[0]['perc_assignment'] . '%)</a>';
            if ($a['assignee_count'] > 1) {
                $id = $a['task_id'];
                $s .= '<a href="javascript: void(0);"  onclick="toggle_users(\'users_' . $id . '\');" title="' . join(', ', $a_u_tmp_array) . '">(+' . ($a['assignee_count'] - 1) . ')</a>';
                $s .= '<span style="display: none" id="users_' . $id . '">';
                $a_u_tmp_array[] = $assigned_users[0]['user_username'];
                for ($i = 1, $i_cmp = count($assigned_users); $i < $i_cmp; $i++) {
                    $a_u_tmp_array[] = $assigned_users[$i]['user_username'];
                    $s .= '<br /><a href="?m=admin&a=viewuser&user_id=';
                    $s .= $assigned_users[$i]['user_id'] . '" title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$assigned_users[$i]['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$assigned_users[$i]['user_id']]['freeCapacity'] . '%' : '') . '">';
                    $s .= $assigned_users[$i]['contact_first_name'] . ' ' . $assigned_users[$i]['contact_last_name'] . ' (' . $assigned_users[$i]['perc_assignment'] . '%)</a>';
                }
                $s .= '</span>';
            }
            $s .= '</td>';
        }
    } else {
        // No users asigned to task
        $s .= '<td align="center">-</td>';
    }
    // Assignment checkbox
    if ($showEditCheckbox && 0 == $a['task_represents_project']) {
        $s .= '<td align="center"><input type="checkbox" onclick="select_box(\'selected_task\', ' . $a['task_id'] . ',\'project_' . $a['task_project'] . '_level-' . $level . '-task_' . $a['task_id'] . '_\',\'frm_tasks\')" onfocus="is_check=true;" onblur="is_check=false;" id="selected_task_' . $a['task_id'] . '" name="selected_task[' . $a['task_id'] . ']" value="' . $a['task_id'] . '"/></td>';
    }
    $s .= '</tr>';
    return $s;
}
Exemple #6
0
    </tr>
    <?php 
// do the modules that are installed on the system
foreach ($modules as $row) {
    // clear the file system entry
    if (isset($modFiles[$row['mod_directory']])) {
        $modFiles[$row['mod_directory']] = '';
    }
    $query_string = '?m=' . $m . '&a=domodsql&mod_id=' . $row['mod_id'];
    $s = '';
    $s .= '<td width="64" align="center">';
    if ($canEdit) {
        $s .= w2PtoolTip('', 'Move to First') . '<a href="' . $query_string . '&cmd=movefirst"><img src="' . w2PfindImage('icons/2uparrow.png') . '" border="0" alt=""/></a>' . w2PendTip();
        $s .= w2PtoolTip('', 'Move Up') . '<a href="' . $query_string . '&cmd=moveup"><img src="' . w2PfindImage('icons/1uparrow.png') . '" border="0" alt=""/></a>' . w2PendTip();
        $s .= w2PtoolTip('', 'Move Down') . '<a href="' . $query_string . '&cmd=movedn"><img src="' . w2PfindImage('icons/1downarrow.png') . '" border="0" alt=""/></a>' . w2PendTip();
        $s .= w2PtoolTip('', 'Move to Last') . '<a href="' . $query_string . '&cmd=movelast"><img src="' . w2PfindImage('icons/2downarrow.png') . '" border="0" alt=""/></a>' . w2PendTip();
    }
    $s .= '</td>';
    $s .= '<td width="1%" nowrap="nowrap">' . $AppUI->_($row['mod_name']) . '</td>';
    $s .= '<td>';
    $s .= '<img src="' . w2PfindImage('obj/dot' . ($row['mod_active'] ? 'green' : 'yellowanim') . '.gif') . '" alt="" />&nbsp;';
    if ($canEdit) {
        $s .= '<a href="' . $query_string . '&cmd=toggle&">';
    }
    $s .= $row['mod_active'] ? $AppUI->_('active') : $AppUI->_('disabled');
    if ($canEdit) {
        $s .= '</a>';
    }
    if ($row['mod_type'] != 'core' && $canEdit) {
        $s .= ' | <a href="' . $query_string . '&cmd=remove" onclick="return window.confirm(' . "'" . $AppUI->_('This will delete all data associated with the module!') . "\\n\\n" . $AppUI->_('Are you sure?') . "\\n" . "'" . ');">' . $AppUI->_('remove') . '</a>';
    }
function showtask_pd_ed(&$arr, $level = 0, $today_view = false)
{
    global $AppUI, $w2Pconfig, $done, $userAlloc, $showEditCheckbox;
    global $task_access, $PROJDESIGN_CONFIG, $m, $expanded;
    $durnTypes = w2PgetSysVal('TaskDurationType');
    //Check for Tasks Access
    $tmpTask = new CTask();
    $tmpTask->load($arr['task_id']);
    $canAccess = $tmpTask->canAccess();
    if (!$canAccess) {
        return false;
    }
    $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
    $htmlHelper->df .= ' ' . $AppUI->getPref('TIMEFORMAT');
    $htmlHelper->stageRowData($arr);
    $types = w2Pgetsysval('TaskType');
    $show_all_assignees = $w2Pconfig['show_all_task_assignees'] ? true : false;
    $done[] = $arr['task_id'];
    // prepare coloured highlight of task time information
    $class = w2pFindTaskComplete($arr['task_start_date'], $arr['task_end_date'], $arr['task_percent_complete']);
    $jsTaskId = 'task_proj_' . $arr['task_project'] . '_level-' . $level . '-task_' . $arr['task_id'] . '_';
    if ($expanded) {
        $s = '<tr id="' . $jsTaskId . '" class="' . $class . '" onclick="select_row(\'selected_task\', \'' . $arr['task_id'] . '\', \'frm_tasks\')">';
        // edit icon
    } else {
        $s = '<tr id="' . $jsTaskId . '" class="' . $class . '" onclick="select_row(\'selected_task\', \'' . $arr['task_id'] . '\', \'frm_tasks\')" ' . ($level ? 'style="display:none"' : '') . '>';
        // edit icon
    }
    $s .= '<td class="data _edit">';
    $canEdit = $arr['task_represents_project'] ? false : true;
    if ($canEdit) {
        $s .= '<a href="?m=tasks&a=addedit&task_id=' . $arr['task_id'] . '">' . w2PshowImage('icons/pencil.gif', 12, 12) . '</a>';
    }
    $s .= '</td>';
    $s .= $htmlHelper->createCell('task_percent_complete', $arr['task_percent_complete']);
    $s .= $htmlHelper->createCell('task_priority', $arr['task_priority']);
    $s .= $htmlHelper->createCell('user_task_priority', $arr['user_task_priority']);
    $s .= $htmlHelper->createCell('other', mb_substr($task_access[$arr['task_access']], 0, 3));
    $s .= $htmlHelper->createCell('other', mb_substr($types[$arr['task_type']], 0, 3));
    // reminders set
    $s .= $htmlHelper->createCell('other', $arr['queue_id'] ? 'Yes' : '');
    $s .= $htmlHelper->createCell('other', $arr['task_status'] == -1 ? 'Yes' : '');
    // add log
    $s .= '<td align="center" nowrap="nowrap">';
    if ($arr['task_dynamic'] != 1 && 0 == $arr['task_represents_project']) {
        $s .= '<a href="?m=tasks&a=view&tab=1&project_id=' . $arr['task_project'] . '&task_id=' . $arr['task_id'] . '">' . w2PtoolTip('tasks', 'add work log to this task') . w2PshowImage('edit_add.png') . w2PendTip() . '</a>';
    }
    $s .= '</td>';
    // dots
    $s .= '<td style="width: ' . ($today_view ? '20%' : '50%') . '" class="data _name">';
    for ($y = 0; $y < $level; $y++) {
        if ($y + 1 == $level) {
            $image = w2PfindImage('corner-dots.gif', $m);
        } else {
            $image = w2PfindImage('shim.gif', $m);
        }
        $s .= '<img src="' . $image . '" width="16" height="12"  border="0" alt="" />';
    }
    // name link
    if ($arr['task_description']) {
        $s .= w2PtoolTip('Task Description', $arr['task_description'], true);
    }
    $jsTaskId = 'task_proj_' . $arr['task_project'] . '_level-' . $level . '-task_' . $arr['task_id'] . '_';
    $open_link = '<a href="javascript: void(0);" onclick="selected_task_' . $arr['task_id'] . '.checked=true"><img onclick="expand_collapse(\'' . $jsTaskId . '\', \'tblProjects\',\'\',' . ($level + 1) . ');" id="' . $jsTaskId . '_collapse" src="' . w2PfindImage('icons/collapse.gif', $m) . '" border="0" align="center" ' . (!$expanded ? 'style="display:none"' : '') . ' alt="" /><img onclick="expand_collapse(\'' . $jsTaskId . '\', \'tblProjects\',\'\',' . ($level + 1) . ');" id="' . $jsTaskId . '_expand" src="' . w2PfindImage('icons/expand.gif', $m) . '" border="0" align="center" ' . ($expanded ? 'style="display:none"' : '') . ' alt="" /></a>';
    $taskObj = new CTask();
    $taskObj->load($arr['task_id']);
    if (count($taskObj->getChildren())) {
        $is_parent = true;
    } else {
        $is_parent = false;
    }
    if ($arr['task_milestone'] > 0) {
        $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $arr['task_id'] . '" ><b>' . $arr['task_name'] . '</b></a> <img src="' . w2PfindImage('icons/milestone.gif', $m) . '" border="0" alt="" /></td>';
    } elseif ($arr['task_dynamic'] == '1' || $is_parent) {
        $s .= $open_link;
        if ($arr['task_dynamic'] == '1') {
            $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $arr['task_id'] . '" ><b><i>' . $arr['task_name'] . '</i></b></a></td>';
        } else {
            $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $arr['task_id'] . '" >' . $arr['task_name'] . '</a></td>';
        }
    } else {
        $s .= '&nbsp;<a href="./index.php?m=tasks&a=view&task_id=' . $arr['task_id'] . '" >' . $arr['task_name'] . '</a></td>';
    }
    if ($arr['task_description']) {
        $s .= w2PendTip();
    }
    // task description
    if ($PROJDESIGN_CONFIG['show_task_descriptions']) {
        $s .= '<td align="justified">' . $arr['task_description'] . '</td>';
    }
    // task owner
    $s .= $htmlHelper->createCell('task_owner', $arr['contact_name']);
    $s .= $htmlHelper->createCell('task_start_datetime', $arr['task_start_date']);
    // duration or milestone
    $s .= $htmlHelper->createCell('task_duration', $arr['task_duration'] . ' ' . mb_substr($AppUI->_($durnTypes[$arr['task_duration_type']]), 0, 1));
    $s .= $htmlHelper->createCell('task_end_datetime', $arr['task_end_date']);
    if (isset($arr['task_assigned_users']) && ($assigned_users = $arr['task_assigned_users'])) {
        $a_u_tmp_array = array();
        if ($show_all_assignees) {
            $s .= '<td align="left">';
            foreach ($assigned_users as $val) {
                $aInfo = '<a href="?m=users&a=view&user_id=' . $val['user_id'] . '"';
                $aInfo .= 'title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$val['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$val['user_id']]['freeCapacity'] . '%' : '') . '">';
                $aInfo .= $val['contact_name'] . ' (' . $val['perc_assignment'] . '%)</a>';
                $a_u_tmp_array[] = $aInfo;
            }
            $s .= join(', ', $a_u_tmp_array);
            $s .= '</td>';
        } else {
            $s .= '<td align="left" nowrap="nowrap">';
            $s .= '<a href="?m=users&a=view&user_id=' . $assigned_users[0]['user_id'] . '"';
            $s .= 'title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$assigned_users[0]['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$assigned_users[0]['user_id']]['freeCapacity'] . '%' : '') . '">';
            $s .= $assigned_users[0]['contact_name'] . ' (' . $assigned_users[0]['perc_assignment'] . '%)</a>';
            if ($arr['assignee_count'] > 1) {
                $id = $arr['task_id'];
                $s .= '<a href="javascript: void(0);"  onclick="toggle_users(\'users_' . $id . '\');" title="' . join(', ', $a_u_tmp_array) . '">(+' . ($arr['assignee_count'] - 1) . ')</a>';
                $s .= '<span style="display: none" id="users_' . $id . '">';
                $a_u_tmp_array[] = $assigned_users[0]['user_username'];
                for ($i = 1, $i_cmp = count($assigned_users); $i < $i_cmp; $i++) {
                    $a_u_tmp_array[] = $assigned_users[$i]['user_username'];
                    $s .= '<br /><a href="?m=users&a=view&user_id=';
                    $s .= $assigned_users[$i]['user_id'] . '" title="' . (w2PgetConfig('check_overallocation') ? $AppUI->_('Extent of Assignment') . ':' . $userAlloc[$assigned_users[$i]['user_id']]['charge'] . '%; ' . $AppUI->_('Free Capacity') . ':' . $userAlloc[$assigned_users[$i]['user_id']]['freeCapacity'] . '%' : '') . '">';
                    $s .= $assigned_users[$i]['contact_name'] . ' (' . $assigned_users[$i]['perc_assignment'] . '%)</a>';
                }
                $s .= '</span>';
            }
            $s .= '</td>';
        }
    } else {
        // No users asigned to task
        $s .= '<td class="data">-</td>';
    }
    // Assignment checkbox
    if ($showEditCheckbox && 0 == $arr['task_represents_project']) {
        $s .= '<td class="data"><input type="checkbox" onclick="select_box(\'multi_check\', ' . $arr['task_id'] . ',\'project_' . $arr['task_project'] . '_level-' . $level . '-task_' . $arr['task_id'] . '_\',\'frm_tasks\')" onfocus="is_check=true;" onblur="is_check=false;" id="selected_task_' . $arr['task_id'] . '" name="selected_task" value="' . $arr['task_id'] . '"/></td>';
    }
    $s .= '</tr>';
    return $s;
}
Exemple #8
0
    $html .= '<td width="1%" align="right" nowrap="nowrap">' . ($this_day->getMinute() ? $tm : '<b>' . $tm . '</b>') . '</td>';
    $timeStamp = $this_day->format('%H%M%S');
    if (isset($events2[$timeStamp])) {
        $count = count($events2[$timeStamp]);
        for ($j = 0; $j < $count; $j++) {
            $row = $events2[$timeStamp][$j];
            $et = new CDate($row['event_end_date']);
            $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 .= '<td class="event" rowspan="' . $rows . '" valign="top">';
            $html .= '<table cellspacing="0" cellpadding="0" border="0"><tr>';
            $html .= '<td>' . w2PshowImage('event' . $row['event_type'] . '.png', 16, 16, '', '', 'calendar');
            $html .= '</td><td>&nbsp;<b>' . $AppUI->_($types[$row['event_type']]) . '</b></td></tr></table>';
            $html .= w2PtoolTip($row['event_title'], getEventTooltip($row['event_id']), true);
            $html .= $href ? '<a href="' . $href . '" class="event">' : '';
            $html .= $row['event_title'];
            $html .= $href ? '</a>' : '';
            $html .= w2PendTip();
            $html .= '</td>';
        }
    } else {
        if (--$rows <= 0) {
            $html .= '<td></td>';
        }
    }
    $html .= '</tr>';
    $this_day->addSeconds(60 * $inc);
}
$html .= '</table>';
echo $html;
Exemple #9
0
 if ($level) {
     $s .= str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level - 1);
     $s .= '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0">&nbsp;';
     $s .= '<a href="./index.php?m=projects&a=view&project_id=' . $row["project_id"] . '">';
     $s .= nl2br($row['project_description']) ? w2PtoolTip($row['project_name'], nl2br($row['project_description']), true) : w2PtoolTip($row['project_name'], $AppUI->_('No information available'), true);
     $s .= $row["project_name"] . (nl2br($row['project_description']) ? w2PendTip() : '') . '</a>';
 } elseif ($count_projects > 0 && !$level) {
     $s .= w2PtoolTip($row["project_name"], nl2br($row['project_description']) . '<br />' . '<i>' . $AppUI->_('this project is a parent on a multi-project structure') . '</i><br />' . '<i>' . $AppUI->_('click to show/hide its children') . '</i>');
     $s .= '<a href="javascript: void(0);" onclick="expand_collapse(\'multiproject_tr_' . $row["project_id"] . '_\', \'tblProjects\')">';
     $s .= '<img id="multiproject_tr_' . $row["project_id"] . '__expand" src="' . w2PfindImage('icons/expand.gif') . '" width="12" height="12" border="0">';
     $s .= '<img id="multiproject_tr_' . $row["project_id"] . '__collapse" src="' . w2PfindImage('icons/collapse.gif') . '" width="12" height="12" border="0" style="display:none"></a>&nbsp;';
     $s .= '<a href="./index.php?m=projects&a=view&project_id=' . $row["project_id"] . '">' . (nl2br($row['project_description']) ? w2PtoolTip($row['project_name'], nl2br($row['project_description']), true) : '') . $row['project_name'] . (nl2br($row['project_description']) ? w2PendTip() : '') . '</a>' . w2PendTip();
 } else {
     $s .= '<a href="./index.php?m=projects&a=view&project_id=' . $row["project_id"] . '">';
     $s .= nl2br($row['project_description']) ? w2PtoolTip($row['project_name'], nl2br($row['project_description']), true) : w2PtoolTip($row['project_name'], $AppUI->_('No information available'), true);
     $s .= $row["project_name"] . (nl2br($row['project_description']) ? w2PendTip() : '') . '</a>';
 }
 $s .= '</td><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="center">' . ($end_date ? $end_date->format($df) : '-') . '</td>';
 $s .= '<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>' : '-';
 $s .= $actual_end_date ? '</a>' : '';
 $s .= '</td><td align="center">';
 $s .= $row['task_log_problem'] ? '<a href="?m=tasks&a=index&f=all&project_id=' . $row['project_id'] . '">' : '';
 $s .= $row['task_log_problem'] ? w2PshowImage('icons/dialog-warning5.png', 16, 16, 'Problem', 'Problem') : '-';
 $s .= $row['task_log_problem'] ? '</a>' : '';
 $s .= '</td><td nowrap="nowrap">' . htmlspecialchars($row['owner_name'], ENT_QUOTES) . '</td><td align="center" nowrap="nowrap">';
 $s .= $row['project_task_count'] . ($row['my_tasks'] ? ' (' . $row['my_tasks'] . ')' : '');
 $s .= '</td><td align="center"><input type="checkbox" name="project_id[]" value="' . $row['project_id'] . '" /></td>';
Exemple #10
0
            $extra = $c['config_value'] == 'true' ? 'checked="checked"' : '';
            $value = 'true';
            // allow to fallthrough
        // allow to fallthrough
        default:
            if (!$value) {
                $value = $c['config_value'];
            }
            $entry = '<input class="text" type="' . $c['config_type'] . '" name="w2Pcfg[' . $c['config_name'] . ']" value="' . $value . '" ' . $extra . '/>';
            break;
    }
    if ($c['config_group'] != $last_group) {
        $output .= '<tr><td colspan="2"><b>' . $AppUI->_($c['config_group'] . '_group_title') . '</b></td></tr>';
        $last_group = $c['config_group'];
    }
    $output .= '<tr><td class="item" width="20%">' . $AppUI->_($c['config_name'] . '_title') . '</td><td align="left">' . $entry . w2PtoolTip($AppUI->_($c['config_name'] . '_title'), $tooltip, true) . w2PshowImage('log-info.gif') . w2PendTip() . '
				<input class="button" type="hidden"  name="w2PcfgId[' . $c['config_name'] . ']" value="' . $c['config_id'] . '" />
			</td>
        </tr>
	';
}
?>
<form name="cfgFrm" action="index.php?m=system&a=systemconfig" method="post" accept-charset="utf-8">
	<input type="hidden" name="dosql" value="do_systemconfig_aed" />
	<table cellspacing="0" cellpadding="3" border="0" class="std" width="100%" align="center">
		<tr><td colspan="2"><?php 
echo $AppUI->_('syscfg_intro');
?>
</td></tr>
		<?php 
echo $output;
Exemple #11
0
		  </tr>
		<?php 
}
?>
		</table>
	</td>
</tr>
<?php 
//lets add the subprojects table
$canReadMultiProjects = $perms->checkModule('admin', 'view');
if ($project->hasChildProjects() && $canReadMultiProjects) {
    ?>
		<tr>
			<td colspan="2">
				<?php 
    echo w2PtoolTip('Multiproject', 'Click to Show/Hide Structure', true) . '<a href="javascript: void(0);" onclick="expand_collapse(\'multiproject\', \'tblProjects\')"><img id="multiproject_expand" src="' . w2PfindImage('icons/expand.gif') . '" width="12" height="12" border="0"><img id="multiproject_collapse" src="' . w2PfindImage('icons/collapse.gif') . '" width="12" height="12" border="0" style="display:none"></a>&nbsp;' . w2PendTip();
    echo '<strong>' . $AppUI->_('This Project is Part of the Following Multi-Project Structure') . ':<strong>';
    ?>
			</td>
		</tr>
		<tr id="multiproject" style="visibility:collapse;display:none;">
			<td colspan="2" class="hilite">
				<?php 
    require w2PgetConfig('root_dir') . '/modules/projects/vw_sub_projects.php';
    ?>
			</td>
		</tr>
	<?php 
}
//here finishes the subproject structure
?>
$fieldNames = array('Company Name', 'Active Projects', 'Archived Projects', 'Type');
foreach ($fieldNames as $index => $name) {
    ?>
<th nowrap="nowrap">
                <a href="?m=companies&orderby=<?php 
    echo $fieldList[$index];
    ?>
" class="hdr">
                    <?php 
    echo $AppUI->_($fieldNames[$index]);
    ?>
                </a>
            </th><?php 
}
?>
    </tr>
    <?php 
if (count($companyList) > 0) {
    foreach ($companyList as $company) {
        echo '<tr>';
        echo '<td>' . (mb_trim($company['company_description']) ? w2PtoolTip($company['company_name'], $company['company_description']) : '') . '<a href="./index.php?m=companies&a=view&company_id=' . $company['company_id'] . '" >' . $company['company_name'] . '</a>' . (mb_trim($company['company_description']) ? w2PendTip() : '') . '</td>';
        echo '<td width="125" align="right" nowrap="nowrap">' . $company['countp'] . '</td>';
        echo '<td width="125" align="right" nowrap="nowrap">' . $company['inactive'] . '</td>';
        echo '<td align="left" nowrap="nowrap">' . $AppUI->_($types[$company['company_type']]) . '</td>';
        echo '</tr>';
    }
} else {
    echo '<tr><td colspan="5">' . $AppUI->_('No companies available') . '</td></tr>';
}
?>
</table>
Exemple #13
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, $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;
            }
        }
    }
}
     if ($level) {
         $s .= str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level - 1);
         $s .= '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0">&nbsp;';
         $s .= '<a href="./index.php?m=projects&a=view&project_id=' . $row["project_id"] . '">';
         $s .= nl2br($row['project_description']) ? w2PtoolTip($row[$field], nl2br($row['project_description']), true) : w2PtoolTip($row[$field], $AppUI->_('No information available'), true);
         $s .= $row[$field] . (nl2br($row['project_description']) ? w2PendTip() : '') . '</a>';
     } elseif ($count_projects > 0 && !$level) {
         $s .= w2PtoolTip($row[$field], nl2br($row['project_description']) . '<br />' . '<i>' . $AppUI->_('this project is a parent on a multi-project structure') . '</i><br />' . '<i>' . $AppUI->_('click to show/hide its children') . '</i>');
         $s .= '<a href="javascript: void(0);" onclick="expand_collapse(\'multiproject_tr_' . $row["project_id"] . '_\', \'tblProjects\')">';
         $s .= '<img id="multiproject_tr_' . $row["project_id"] . '__expand" src="' . w2PfindImage('icons/expand.gif') . '" width="12" height="12" border="0">';
         $s .= '<img id="multiproject_tr_' . $row["project_id"] . '__collapse" src="' . w2PfindImage('icons/collapse.gif') . '" width="12" height="12" border="0" style="display:none"></a>&nbsp;';
         $s .= '<a href="./index.php?m=projects&a=view&project_id=' . $row["project_id"] . '">' . (nl2br($row['project_description']) ? w2PtoolTip($row[$field], nl2br($row['project_description']), true) : '') . $row[$field] . (nl2br($row['project_description']) ? w2PendTip() : '') . '</a>' . w2PendTip();
     } else {
         $s .= '<a href="./index.php?m=projects&a=view&project_id=' . $row["project_id"] . '">';
         $s .= nl2br($row['project_description']) ? w2PtoolTip($row[$field], nl2br($row['project_description']), true) : w2PtoolTip($row[$field], $AppUI->_('No information available'), true);
         $s .= $row[$field] . (nl2br($row['project_description']) ? w2PendTip() : '') . '</a>';
     }
     $s .= '</td>';
     break;
 case 'project_company':
     $s .= '<td width="30%">';
     $s .= '<a href="?m=companies&a=view&company_id=' . $row['project_company'] . '" >';
     $s .= htmlspecialchars($row['company_name'], ENT_QUOTES);
     $s .= '</a>';
     $s .= '</td>';
     break;
 case 'project_color_identifier':
     $s .= '<td class="center" width="1" style="border: outset #eeeeee 1px;background-color:#' . $row['project_color_identifier'] . '">';
     $s .= '<font color="' . bestColor($row['project_color_identifier']) . '">' . sprintf('%.1f%%', $row['project_percent_complete']) . '</font>';
     $s .= '</td>';
     break;
Exemple #15
0
    ?>
<th nowrap="nowrap">
                <a href="?m=departments&orderby=<?php 
    echo $fieldList[$index];
    ?>
" class="hdr">
                    <?php 
    echo $AppUI->_($fieldNames[$index]);
    ?>
                </a>
            </th><?php 
}
?>
	</tr>
<?php 
if (count($deptList) > 0) {
    $displayList = array();
    foreach ($deptList as $dept) {
        if ($dept['dept_parent'] == 0) {
            findchilddept($deptList, $dept['dept_id']);
        }
        echo '<tr><td>' . (mb_trim($dept['dept_desc']) ? w2PtoolTip($dept['dept_name'], $dept['dept_desc']) : '') . '<a href="./index.php?m=departments&a=view&dept_id=' . $dept['dept_id'] . '" >' . $dept['dept_name'] . '</a>' . (mb_trim($dept['dept_desc']) ? w2PendTip() : '') . '</td>';
        echo '<td width="125" align="right" nowrap="nowrap">' . $dept['countp'] . '</td>';
        echo '<td width="125" align="right" nowrap="nowrap">' . $dept['inactive'] . '</td>';
        echo '<td align="left" nowrap="nowrap">' . $AppUI->_($types[$dept['dept_type']]) . '</td></tr>';
    }
} else {
    echo '<tr><td colspan="4">' . $AppUI->_('No data available') . '</td></tr>';
}
?>
</table>
Exemple #16
0
	newtr.appendChild(oCell);
	oCell = document.createElement('td');
	htmltxt = '';
	htmltxt +='<input type="hidden" id="add_task_line_'+line_nr+'" name="add_task_line_'+line_nr+'" value="'+line_nr+'" />';
	htmltxt +='<input type="text" class="text" style="width:200px;" name="add_task_name_'+line_nr+'" value="" />';
	htmltxt +='&nbsp;<?php 
    echo w2PtoolTip('add tasks panel', 'click here to add a description to this task and/or edit other available options.<br />click again to collapse it.');
    ?>
<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 
Exemple #17
0
    $fieldNames = array('Name', 'Description', 'Type', 'Published', 'Order');
    $rows = $manager->getStructure($module['mod_name']);
    $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
    $s = '';
    if (count($rows)) {
        $s .= '<tr><th width="10"></th>';
        foreach ($fieldNames as $index => $name) {
            $s .= '<th>' . $AppUI->_($fieldNames[$index]) . '</th>';
        }
        $s .= '<th width="10"></th></tr>';
        foreach ($rows as $row) {
            $s .= '<tr><td class="hilite">';
            $s .= w2PtoolTip('', $AppUI->_('Click this icon to Edit this Custom Field.'), true);
            $s .= '<a href="?m=system&u=customfields&a=addedit&module=' . $module['mod_id'] . '&field_id=' . $row['field_id'] . '"><img src="' . w2PfindImage('icons/stock_edit-16.png') . '" /></a>';
            $s .= w2PendTip();
            $s .= $htmlHelper->createCell('na', $row['field_name']);
            $s .= $htmlHelper->createCell('field_description', $row['field_description']);
            $s .= '<td>' . $AppUI->_($manager->getType($row['field_htmltype'])) . '</td>';
            $s .= '<td>' . ($row['field_published'] ? $AppUI->_('Yes') : $AppUI->_('No')) . '</td>';
            $s .= $htmlHelper->createCell('field_order', $row['field_order']);
            $s .= '<td>';
            $s .= w2PtoolTip('', $AppUI->_('Click this icon to Delete this Custom Field.'), true);
            $s .= '<a href="javascript:delIt(' . $row['field_id'] . ');"><img src="' . w2PfindImage('icons/stock_delete-16.png') . '" /></a>';
            $s .= w2PendTip();
            $s .= '</td></tr>';
        }
        echo $s;
    }
}
?>
</table>
Exemple #18
0
        $df .= ' ' . $AppUI->getPref('TIMEFORMAT');
        $contact_updatekey = $carr[$z][$x]['contact_updatekey'];
        $contact_lastupdate = $carr[$z][$x]['contact_lastupdate'];
        $contact_updateasked = $carr[$z][$x]['contact_updateasked'];
        $last_ask = new w2p_Utilities_Date($contact_updateasked);
        $lastAskFormatted = $last_ask->format($df);
        if (count($projectList) > 0) {
            echo '<a href="" onclick="	window.open(\'./index.php?m=public&a=selector&dialog=1&callback=goProject&table=projects&user_id=' . $carr[$z][$x]['contact_id'] . '\', \'selector\', \'left=50,top=50,height=250,width=400,resizable\');return false;">' . w2PshowImage('projects.png', '', '', $m, 'click to view projects associated with this contact') . '</a>';
        }
        if ($contact_updateasked && (!$contact_lastupdate || $contact_lastupdate == 0) && $contact_updatekey) {
            echo w2PtoolTip('info', 'Waiting for Contact Update Information. (Asked on: ' . $lastAskFormatted . ')') . '<img src="' . w2PfindImage('log-info.gif') . '" style="float: right;">' . w2PendTip();
        } elseif ($contact_updateasked && (!$contact_lastupdate || $contact_lastupdate == 0) && !$contact_updatekey) {
            echo w2PtoolTip('info', 'Waiting for too long! (Asked on ' . $lastAskFormatted . ')') . '<img src="' . w2PfindImage('log-error.gif') . '" style="float: right;">' . w2PendTip();
        } elseif ($contact_updateasked && !$contact_updatekey) {
            $last_ask = new w2p_Utilities_Date($contact_lastupdate);
            echo w2PtoolTip('info', 'Update sucessfully done on: ' . $last_ask->format($df) . '') . '<img src="' . w2PfindImage('log-notice.gif') . '" style="float: right;">' . w2PendTip();
        }
        ?>
                                                    </span>
												</th>
											</table>
										</td>
									</tr>
									<tr>
										<?php 
        reset($showfields);
        $s = '';
        while (list($key, $val) = each($showfields)) {
            if (mb_strlen($carr[$z][$x][$key]) > 0) {
                if ($val == 'contact_email') {
                    $s .= '<td class="hilite" colspan="2">' . w2p_email($carr[$z][$x][$key]) . '</td></tr>';
Exemple #19
0
if (count($tasks) > 0) {
    foreach ($tasks as $row) {
        //add information about assigned users into the page output
        $assigned_users = __extract_from_tasks2($row);
        $row['task_assigned_users'] = $assigned_users;
        //pull the final task row into array
        $projects[$row['task_project']]['tasks'][] = $row;
    }
}
$showEditCheckbox = isset($canEdit) && $canEdit && w2PgetConfig('direct_edit_assignment') ? true : false;
$durnTypes = w2PgetSysVal('TaskDurationType');
$tempTask = new CTask();
$userAlloc = $tempTask->getAllocation('user_id');
global $expanded;
$expanded = $AppUI->getPref('TASKSEXPANDED');
$open_link = w2PtoolTip($m, 'click to expand/collapse all the tasks for this project.') . '<a href="javascript: void(0);"><img onclick="expand_collapse(\'task_proj_' . $project_id . '_\', \'tblProjects\',\'collapse\',0,2);" id="task_proj_' . $project_id . '__collapse" src="' . w2PfindImage('up22.png', $m) . '" class="center" ' . (!$expanded ? 'style="display:none"' : '') . ' /><img onclick="expand_collapse(\'task_proj_' . $project_id . '_\', \'tblProjects\',\'expand\',0,2);" id="task_proj_' . $project_id . '__expand" src="' . w2PfindImage('down22.png', $m) . '" class="center" ' . ($expanded ? 'style="display:none"' : '') . ' /></a>' . w2PendTip();
$module = new w2p_System_Module();
$fields = $module->loadSettings($m, 'tasklist');
if (0 == count($fields)) {
    // TODO: This is only in place to provide an pre-upgrade-safe
    //   state for versions earlier than v3.0
    //   At some point at/after v4.0, this should be deprecated
    $fieldList = array('task_percent_complete', 'task_priority', 'user_task_priority', 'task_name', 'task_owner', 'task_assignees', 'task_start_date', 'task_duration', 'task_end_date');
    $fieldNames = array('Percent', 'P', 'U', 'Task Name', 'Owner', 'Assignees', 'Start Date', 'Duration', 'Finish Date');
    $module->storeSettings($m, 'tasklist', $fieldList, $fieldNames);
    $fields = array_combine($fieldList, $fieldNames);
}
$fieldList = array_keys($fields);
$fieldNames = array_values($fields);
$tempTask = new CTask();
$listTable = new w2p_Output_HTML_TaskTable($AppUI, $tempTask);
Exemple #20
0
	</tr>
	<?php 
reset($projects);
if ($w2Pconfig['direct_edit_assignment']) {
    // get Users with all Allocation info (e.g. their freeCapacity)
    // but do it only when direct_edit_assignment is on and only once.
    $tempoTask = new CTask();
    $userAlloc = $tempoTask->getAllocation('user_id', null, true);
}
foreach ($projects as $k => $p) {
    $tnums = isset($p['tasks']) ? count($p['tasks']) : 0;
    if ($tnums > 0 || $project_id == $p['project_id']) {
        //echo '<pre>'; print_r($p); echo '</pre>';
        if (!$min_view) {
            // not minimal view
            $open_link = w2PtoolTip($m, 'Click to Expand/Collapse the Tasks for this Project.') . '<a href="javascript: void(0);"><img onclick="expand_collapse(\'project_' . $p['project_id'] . '_\', \'tblProjects\',\'collapse\',0,2);" id="project_' . $p['project_id'] . '__collapse" src="' . w2PfindImage('up22.png', $m) . '" border="0" width="22" height="22" align="center" ' . (!$expanded ? 'style="display:none"' : '') . ' alt="" /><img onclick="expand_collapse(\'project_' . $p['project_id'] . '_\', \'tblProjects\',\'expand\',0,2);" id="project_' . $p['project_id'] . '__expand" src="' . w2PfindImage('down22.png', $m) . '" border="0" width="22" height="22" align="center" ' . ($expanded ? 'style="display:none"' : '') . ' alt="" /></a>' . w2PendTip();
            ?>
					<tr>
					  <td>
							<form name="assFrm<?php 
            echo $p['project_id'];
            ?>
" action="index.php?m=<?php 
            echo $m;
            ?>
&amp;=<?php 
            echo $a;
            ?>
" method="post" accept-charset="utf-8">
							<input type="hidden" name="del" value="1" />
							<input type="hidden" name="rm" value="0" />
Exemple #21
0
/**
 *	Workaround removed due to problems in Opera and other issues
 *	with IE6.
 *	Workaround to display png images with alpha-transparency in IE6.0
 *	@param string The name of the image
 *	@param string The image width
 *	@param string The image height
 *	@param string The alt text for the image
 */
function w2PshowImage($src, $wid = '', $hgt = '', $alt = '', $title = '', $module = null)
{
    global $AppUI, $m;
    if ($src == '') {
        return '';
    } elseif ($module) {
        $src = w2PfindImage($src, $module);
    } else {
        $src = w2PfindImage($src, $m);
    }
    if (!$alt && !$title) {
        $result = '';
    } elseif ($alt && $title) {
        $result = w2PtoolTip($alt, $title);
    } elseif ($alt && !$title) {
        $result = w2PtoolTip($m, $alt);
    } elseif (!$alt && $title) {
        $result = w2PtoolTip($m, $title);
    }
    $result .= '<img src="' . $src . '" alt="" ';
    if ($wid) {
        $result .= ' width="' . $wid . '"';
    }
    if ($hgt) {
        $result .= ' height="' . $hgt . '"';
    }
    $result .= ' border="0" />';
    if (!$alt && !$title) {
        //do nothing
    } elseif ($alt && $title) {
        $result .= w2PendTip();
    } elseif ($alt && !$title) {
        $result .= w2PendTip();
    } elseif (!$alt && $title) {
        $result .= w2PendTip();
    }
    return $result;
}