function showRow($id = 0, $name = '', $label = '') { global $canEdit, $syskey_id, $CR, $AppUI; $s = ''; if ($syskey_id == $id && $canEdit) { $s .= '<form name="sysKeyFrm" method="post" action="?m=system&u=syskeys&a=do_syskey_aed" accept-charset="utf-8">'; $s .= '<input type="hidden" name="del" value="0" />'; $s .= '<input type="hidden" name="syskey_id" value="' . $id . '" />'; $s .= '<tr>'; $s .= '<td> </td>'; $s .= '<td><input type="text" name="syskey_name" value="' . $name . '" class="text" /></td>'; $s .= '<td><textarea name="syskey_label" class="small" rows="2" cols="40">' . $label . '</textarea></td>'; $s .= '<td><input type="submit" value="' . $AppUI->_($id ? 'edit' : 'add') . '" class="button" /></td>'; $s .= '<td> </td>'; } else { $s .= '<tr>'; $s .= '<td width="12">'; if ($canEdit) { $s .= '<a href="?m=system&u=syskeys&a=keys&syskey_id=' . $id . '"><img src="' . w2PfindImage('icons/pencil.gif') . '" alt="edit" border="0"></a>'; $s .= '</td>' . $CR; } $s .= '<td>' . $name . '</td>' . $CR; $s .= '<td colspan="2">' . $label . '</td>' . $CR; $s .= '<td width="16">'; if ($canEdit) { $s .= '<a href="javascript:delIt(' . $id . ')"><img align="absmiddle" src="' . w2PfindImage('icons/trash.gif') . '" width="16" height="16" alt="' . $AppUI->_('delete') . '" border="0"></a>'; } $s .= '</td>' . $CR; } $s .= '</tr>' . $CR; return $s; }
public function showAddress($name, $object) { $countries = w2PgetSysVal('GlobalCountries'); $output = '<div style="margin-left: 11em;">'; $output .= '<a href="http://maps.google.com/maps?q=' . $object->{$name . '_address1'} . '+' . $object->{$name . '_address2'} . '+' . $object->{$name . '_city'} . '+' . $object->{$name . '_state'} . '+' . $object->{$name . '_zip'} . '+' . $object->{$name . '_country'} . '" target="_blank">'; $output .= '<img src="' . w2PfindImage('googlemaps.gif') . '" class="right" alt="Find It on Google" />'; $output .= '</a>'; $output .= $object->{$name . '_address1'} . ($object->{$name . '_address2'} ? '<br />' . $object->{$name . '_address2'} : '') . ($object->{$name . '_city'} ? '<br />' . $object->{$name . '_city'} : '') . ($object->{$name . '_state'} ? ' ' . $object->{$name . '_state'} : '') . ($object->{$name . '_zip'} ? ', ' . $object->{$name . '_zip'} : '') . ($object->{$name . '_country'} ? '<br />' . $countries[$object->{$name . '_country'}] : ''); $output .= '</div>'; echo $output; }
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(' ', ($rowData['depth'] - 1) * 4) . '<img src="' . w2PfindImage('corner-dots.gif') . '" />'; } if ($rowData['children'] > 0) { $prefix .= '<img src="' . w2PfindImage('icons/collapse.gif') . '" /> '; } if ('' != $rowData['task_description']) { $prefix .= w2PtoolTip($this->_AppUI->_('Task Description'), $rowData['task_description']); $suffix .= w2PendTip(); } if ($rowData['task_milestone']) { $suffix .= ' ' . '<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; }
function showchilddept_comp(&$a, $level = 0) { global $AppUI; $s = ' <td> <a href="./index.php?m=departments&a=addedit&dept_id=' . $a["dept_id"] . '" title="' . $AppUI->_('edit') . '"> ' . w2PshowImage('icons/stock_edit-16.png', 16, 16, '') . ' </td> <td>'; for ($y = 0; $y < $level; $y++) { if ($y + 1 == $level) { $s .= '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0" alt="">'; } else { $s .= '<img src="' . w2PfindImage('shim.gif') . '" width="16" height="12" border="0" alt="">'; } } $s .= '<a href="./index.php?m=departments&a=view&dept_id=' . $a['dept_id'] . '">' . $a['dept_name'] . '</a>'; $s .= '</td>'; $s .= '<td align="center">' . ($a['dept_users'] ? $a['dept_users'] : '') . '</td>'; echo '<tr>' . $s . '</tr>'; }
function showcodes(&$a) { global $AppUI, $company_id; $alt = htmlspecialchars($a['billingcode_desc']); $s = ' <tr> <td width=40> <a href="?m=system&a=billingcode&company_id=' . $company_id . '&billingcode_id=' . $a['billingcode_id'] . '" title="' . $AppUI->_('edit') . '"> <img src="' . w2PfindImage('icons/stock_edit-16.png') . '" border="0" alt="Edit" /></a>'; if ($a['billingcode_status'] == 0) { $s .= '<a href="javascript:delIt2(' . $a['billingcode_id'] . ');" title="' . $AppUI->_('delete') . '"> <img src="' . w2PfindImage('icons/stock_delete-16.png') . '" border="0" alt="Delete" /></a>'; } $s .= ' </td> <td align="left"> ' . $a['billingcode_name'] . ($a['billingcode_status'] == 1 ? ' (deleted)' : '') . '</td> <td nowrap="nowrap" align="center">' . $a['billingcode_value'] . '</td> <td nowrap="nowrap">' . $a['billingcode_desc'] . '</td> </tr>'; echo $s; }
$s .= $row['mod_ui_active'] ? $AppUI->_('visible') : $AppUI->_('hidden'); if ($canEdit) { $s .= '</a>'; } $s .= '</td>'; $s .= '<td align="right">' . $row['mod_ui_order'] . '</td>'; echo '<tr>' . $s . '</tr>'; } foreach ($modFiles as $v) { // clear the file system entry if ($v && !in_array($v, $hidden_modules)) { $s = ''; $s .= '<td></td>'; $s .= '<td>' . $AppUI->_($v) . '</td>'; $s .= '<td>'; $s .= '<img src="' . w2PfindImage('obj/dotgrey.gif') . '" alt="" /> '; if ($canEdit) { $s .= '<a href="?m=' . $m . '&a=domodsql&cmd=install&mod_directory=' . $v . '">'; } $s .= $AppUI->_('install'); if ($canEdit) { $s .= '</a>'; } $s .= '</td>'; echo '<tr>' . $s . '</tr>'; } } ?> <tr> <td colspan="9" style="text-align: center;"> <?php
echo $AppUI->_('Server time is') . ' ' . $AppUI->getTZAwareTime(); } ?> </td> </tr> </table> </td> <?php if ($AppUI->user_id > 0) { ?> <td width="170" valign="middle" nowrap="nowrap"><table><tr><td><form name="frm_search" action="?m=smartsearch" method="post" accept-charset="utf-8"> <?php if (canAccess('smartsearch')) { ?> <img src="<?php echo w2PfindImage('search.png'); ?> " style="border: 0;" alt="" /> <input class="text" size="20" type="text" id="keyword" name="keyword" value="<?php echo $AppUI->_('Global Search') . '...'; ?> " onclick="document.frm_search.keyword.value=''" onblur="document.frm_search.keyword.value='<?php echo $AppUI->_('Global Search') . '...'; ?> '" /> <?php } else { echo ' '; } ?> </form></td></tr></table> </td>
</td> <td> <input type="hidden" name="log_end_date" id="log_end_date" value="<?php echo $end_date ? $end_date->format(FMT_TIMESTAMP_DATE) : ''; ?> " /> <input type="text" name="end_date" id="end_date" onchange="setDate_new('editFrm', 'end_date');" value="<?php echo $end_date ? $end_date->format($df) : ''; ?> " class="text" /> <a href="javascript: void(0);" onclick="return showCalendar('end_date', '<?php echo $df; ?> ', 'editFrm', null, true, true)"> <img src="<?php echo w2PfindImage('calendar.gif'); ?> " alt="<?php echo $AppUI->_('Calendar'); ?> " /> </a> </td> <td> <?php echo $AppUI->_('Levels to display'); ?> <input type="text" name="max_levels" size="10" maxlength="3" <?php $max_levels; ?> />
</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; ?> &=<?php echo $a; ?> " method="post" accept-charset="utf-8"> <input type="hidden" name="del" value="1" /> <input type="hidden" name="rm" value="0" />
/** * The drawing function */ public function show() { global $AppUI, $a, $m, $tab, $infotab; $this->loadExtraCrumbs($m, $a); $uistyle = $AppUI->getPref('UISTYLE') ? $AppUI->getPref('UISTYLE') : $w2Pconfig['host_style']; if (!$uistyle) { $uistyle = 'web2project'; } $s = '<table width="100%" border="0" cellpadding="1" cellspacing="1"><tr>'; if ($this->icon) { $s .= '<td width="42">'; $s .= w2PshowImage($this->icon, '', '', '', '', $this->module); $s .= '</td>'; } $s .= '<td align="left" width="100%" nowrap="nowrap"><h1>' . $AppUI->_($this->title) . '</h1></td>'; foreach ($this->cells1 as $c) { $s .= $c[2] ? $c[2] : ''; $s .= '<td align="right" nowrap="nowrap"' . ($c[0] ? ' ' . $c[0] : '') . '>'; $s .= $c[1] ? $c[1] : ' '; $s .= '</td>'; $s .= $c[3] ? $c[3] : ''; } $s .= '</tr></table>'; if (count($this->crumbs) || count($this->cells2)) { $crumbs = array(); $class = 'crumb'; foreach ($this->crumbs as $k => $v) { $t = $v[1] ? '<img src="' . w2PfindImage($v[1], $this->module) . '" border="" alt="" /> ' : ''; $t .= $AppUI->_($v[0]); $crumbs[] = '<li><a href="' . $k . '"><span>' . $t . '</span></a></li>'; } $s .= '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'; $s .= '<td height="20" nowrap="nowrap"><div class="' . $class . '"><ul>'; $s .= implode('', $crumbs); $s .= '</ul></div></td>'; foreach ($this->cells2 as $c) { $s .= $c[2] ? $c[2] : ''; $s .= '<td align="right" nowrap="nowrap" ' . ($c[0] ? " {$c['0']}" : '') . '>'; $s .= $c[1] ? $c[1] : ' '; $s .= '</td>'; $s .= $c[3] ? $c[3] : ''; } $s .= '</tr></table>'; } echo '' . $s; if (($a != 'index' || $m == 'system' || $m == 'calendar' || $m == 'smartsearch') && !$AppUI->boxTopRendered && function_exists('styleRenderBoxTop')) { echo styleRenderBoxTop(); $AppUI->boxTopRendered = true; } }
function sort_by_item_title($title, $item_name, $item_type, $a = '') { global $AppUI, $project_id, $task_id, $min_view, $m; global $task_sort_item1, $task_sort_type1, $task_sort_order1; global $task_sort_item2, $task_sort_type2, $task_sort_order2; if ($task_sort_item2 == $item_name) { $item_order = $task_sort_order2; } if ($task_sort_item1 == $item_name) { $item_order = $task_sort_order1; } $s = ''; if (isset($item_order)) { $show_icon = true; } else { $show_icon = false; $item_order = SORT_DESC; } /* flip the sort order for the link */ $item_order = $item_order == SORT_ASC ? SORT_DESC : SORT_ASC; if ($m == 'tasks') { $s .= '<a href="./index.php?m=tasks' . ($task_id > 0 ? '&a=view&task_id=' . $task_id : $a); } elseif ($m == 'calendar') { $s .= '<a href="./index.php?m=calendar&a=day_view'; } else { $s .= '<a href="./index.php?m=projects&bypass=1' . ($project_id > 0 ? '&a=view&project_id=' . $project_id : ''); } $s .= '&task_sort_item1=' . $item_name; $s .= '&task_sort_type1=' . $item_type; $s .= '&task_sort_order1=' . $item_order; if ($task_sort_item1 == $item_name) { $s .= '&task_sort_item2=' . $task_sort_item2; $s .= '&task_sort_type2=' . $task_sort_type2; $s .= '&task_sort_order2=' . $task_sort_order2; } else { $s .= '&task_sort_item2=' . $task_sort_item1; $s .= '&task_sort_type2=' . $task_sort_type1; $s .= '&task_sort_order2=' . $task_sort_order1; } $s .= '" class="hdr">' . $AppUI->_($title); if ($show_icon) { $s .= ' <img src="' . w2PfindImage('arrow-' . ($item_order == SORT_ASC ? 'up' : 'down') . '.gif') . '" border="0" /></a>'; } echo $s; }
} } if ($row['visit_user'] != $AppUI->user_id) { $s .= '<br /> ' . w2PshowImage('icons/stock_new_small.png'); $new_messages[] = $row['message_id']; } $s .= '</td>'; $s .= '<td valign="top" style="' . $style . '">'; $s .= '<font size="2"><strong>' . $row['message_title'] . '</strong><hr size=1>'; $row['message_body'] = $bbparser->qparse($row['message_body']); $row['message_body'] = nl2br($row['message_body']); $s .= $row['message_body']; $s .= '</font></td>'; $s .= '</tr><tr>'; $s .= '<td valign="top" style="' . $style . '" nowrap="nowrap">'; $s .= '<img src="' . w2PfindImage('icons/posticon.gif', $m) . '" alt="date posted" border="0" width="14" height="11">' . $AppUI->formatTZAwareTime($row['message_date'], $df . ' ' . $tf) . '</td>'; $s .= '<td valign="top" align="right" style="' . $style . '">'; // in some weird permission cases // it can happen that the table gets opened but never closed, // or the other way around, thus breaking the layout // introducing these variables to help us out with proper // table tag opening and closing. $tableOpened = false; $tableClosed = false; //the following users are allowed to edit/delete a forum message: 1. the forum creator 2. a superuser with read-write access to 'all' 3. the message author if ($canEdit || $AppUI->user_id == $row['forum_moderated'] || $AppUI->user_id == $row['message_author'] || $canAdminEdit) { $tableOpened = true; $s .= '<table cellspacing="0" cellpadding="0" border="0"><tr>'; // edit message $s .= '<td><a href="./index.php?m=forums&a=viewer&post_message=1&forum_id=' . $row['message_forum'] . '&message_parent=' . $row['message_parent'] . '&message_id=' . $row["message_id"] . '" title="' . $AppUI->_('Edit') . ' ' . $AppUI->_('Message') . '">'; $s .= w2PshowImage('icons/stock_edit-16.png', '16', '16');
?> " border="0" /> </a> <?php echo arraySelect($sassign, 'bulk_task_user', 'style="width:130px" class="text"', ''); ?> <select name="bulk_task_assign_perc" class="text"> <?php for ($i = 5; $i <= 100; $i += 5) { echo '<option ' . ($i == 100 ? 'selected="true"' : '') . ' value="' . $i . '">' . $i . '%</option>'; } ?> </select><br /><br /> <a href="javascript: void(0);" onclick="removeUser(document.frm_bulk)"> <img src="<?php echo w2PfindImage('remove.png', $m); ?> " width="16" height="16" title="<?php echo $AppUI->_('Remove Assignment'); ?> " alt="<?php echo $AppUI->_('Remove Assignment'); ?> " border="0" /> </a> <select name="bulk_task_assign[]" id="bulk_task_assign" style="width:200px" size="6" class="text" multiple="multiple"> </select> </td> </tr> </table> </div>
function showtask_pr_ed(&$arr, $level = 0, $today_view = false) { global $AppUI, $done; //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'); $done[] = $arr['task_id']; $s = '<tr>'; // 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 $alt = mb_strlen($arr['task_description']) > 80 ? mb_substr($arr['task_description'], 0, 80) . '...' : $arr['task_description']; // instead of the statement below $alt = mb_str_replace('"', """, $alt); $alt = mb_str_replace("\r", ' ', $alt); $alt = mb_str_replace("\n", ' ', $alt); $open_link = w2PshowImage('collapse.gif'); if ($arr['task_milestone'] > 0) { $s .= ' <b>' . $arr["task_name"] . '</b><!--</a>--> <img src="' . w2PfindImage('icons/milestone.gif', $m) . '" border="0" alt="" />'; } elseif ($arr['task_dynamic'] == '1') { $s .= $open_link; $s .= '<strong>' . $arr['task_name'] . '</strong>'; } else { $s .= $arr['task_name']; } $s .= '</td>'; $s .= $htmlHelper->createCell('task_percent_complete', $arr['task_percent_complete']); $s .= $htmlHelper->createCell('task_start_date', $arr['task_start_date']); $s .= $htmlHelper->createCell('task_end_date', $arr['task_end_date']); $s .= $htmlHelper->createCell('last_update', $arr['last_update']); $s .= '</tr>'; return $s; }
$q->addTable('users', 'u'); $q->addTable('contacts', 'c'); $q->addQuery('contact_first_name, contact_last_name'); $q->addWhere('u.user_contact = c.contact_id'); $q->addWhere('user_id = ' . (int) $Task_User['user_id']); $sql_user_array = $q->exec(); $q->clear(); $user_list = db_fetch_assoc($sql_user_array); $users .= $user_list['contact_first_name'] . ' ' . $user_list['contact_last_name']; } $str = '<tr>'; if ($project_id == 0) { $str .= '<td>' . $Tasks['project_name'] . '</td>'; } $str .= '<td>'; $str .= $Tasks['task_id'] == $Tasks['task_parent'] ? '' : '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0" alt="" />'; $str .= ' <a href="?m=tasks&a=view&task_id=' . $Tasks['task_id'] . '">' . $Tasks['task_name'] . '</a></td>'; $str .= '<td>' . nl2br($Tasks['task_description']) . '</td>'; $str .= '<td>' . $users . '</td>'; $str .= '<td align="center">'; $start_date != ' ' ? $str .= $start_date->format($df) . '</td>' : ($str .= ' </td>'); $str .= '<td align="center">'; $end_date != ' ' ? $str .= $end_date->format($df) . '</td>' : ($str .= ' ' . '</td>'); $str .= '<td align="right">' . $Tasks['task_percent_complete'] . '%</td>'; $str .= '</tr>'; echo $str; if ($project_id == 0) { $pdfdata[] = array($Tasks['project_name'], $Tasks['task_name'], $Tasks['task_description'], $users, $start_date != ' ' ? $start_date->format($df) : ' ', $end_date != ' ' ? $end_date->format($df) : ' ', $Tasks['task_percent_complete'] . '%'); } else { $pdfdata[] = array($Tasks['task_name'], $Tasks['task_description'], $users, $start_date != ' ' ? $start_date->format($df) : ' ', $end_date != ' ' ? $end_date->format($df) : ' ', $Tasks['task_percent_complete'] . '%'); }
$projects = $myProject->getAllowedProjects($AppUI->user_id); $project_ids = array_keys($projects); } else { $project_ids = array($project_id); } $obj = new CTask(); foreach ($project_ids as $project_id) { $taskTree = $obj->getTaskTree($project_id, 0); foreach ($taskTree as $task) { $str = '<tr>'; if (count($project_ids) > 1) { $str .= '<td>' . $task['project_name'] . '</td>'; } $str .= '<td>'; $indent_count = substr_count($task['task_path_enumeration'], '/') * 3; $str .= $task['task_id'] == $task['task_parent'] ? '' : str_repeat(' ', $indent_count) . '<img src="' . w2PfindImage('corner-dots.gif') . '" />'; $str .= ' <a href="?m=tasks&a=view&task_id=' . $task['task_id'] . '">' . $task['task_name'] . '</a></td>'; $str .= '<td>' . nl2br($task['task_description']) . '</td>'; $users = array(); $assignees = $obj->assignees($task['task_id']); foreach ($assignees as $assignee) { $users[] = $assignee['contact_name']; } $str .= '<td>' . implode($users, ', ') . '</td>'; $str .= $htmlHelper->createCell('task_start_date', $task['task_start_date']); $str .= $htmlHelper->createCell('task_end_date', $task['task_end_date']); $str .= $htmlHelper->createCell('task_percent_complete', $task['task_percent_complete']); $str .= '</tr>'; echo $str; if ($project_id == 0) { $pdfdata[] = array($task['project_name'], $task['task_name'], $task['task_description'], $users, $start_date != ' ' ? $start_date->format($df) : ' ', $end_date != ' ' ? $end_date->format($df) : ' ', $task['task_percent_complete'] . '%');
?> +<?php echo $company->company_city; ?> +<?php echo $company->company_state; ?> +<?php echo $company->company_zip; ?> +<?php echo $company->company_country; ?> " target="_blank"> <img align="right" border="0" src="<?php echo w2PfindImage('googlemaps.gif'); ?> " width="55" height="22" alt="Find It on Google" /></a> <?php echo $company->company_address1 . ($company->company_address2 ? '<br />' . $company->company_address2 : '') . ($company->company_city ? '<br />' . $company->company_city : '') . ($company->company_state ? '<br />' . $company->company_state : '') . ($company->company_zip ? '<br />' . $company->company_zip : '') . ($company->company_country ? '<br />' . $countries[$company->company_country] : ''); ?> </td> </tr> <tr> <td align="right" nowrap="nowrap"><?php echo $AppUI->_('URL'); ?> :</td> <td class="hilite"><?php echo w2p_url($company->company_primary_url); ?>
<?php echo '<a href="javascript: void(0);" name="fbt" style="display:block" onclick="expand_collapse(\'files\', \'tblProjects\');update_workspace(\'files\');">'; ?> <?php echo '<strong>' . $AppUI->_('Files') . '<strong></font>'; ?> <?php echo '</a>'; ?> </td> <td width="12" align="right" colspan="1"> <?php echo '<a href="javascript: void(0);" name="fbt" style="display:block" onclick="expand_collapse(\'files\', \'tblProjects\');update_workspace(\'files\');">'; ?> <?php echo '<img id="files_expand" src="' . w2PfindImage('icons/expand.gif', $m) . '" width="12" height="12" border="0" ' . (isset($view_options[0]['pd_option_view_files']) ? $view_options[0]['pd_option_view_files'] ? 'style="display:none"' : 'style="display:"' : 'style="display:none"') . '><img id="files_collapse" src="' . w2PfindImage('icons/collapse.gif', $m) . '" width="12" height="12" border="0" ' . (isset($view_options[0]['pd_option_view_files']) ? $view_options[0]['pd_option_view_files'] ? 'style="display:"' : 'style="display:none"' : 'style="display:"') . '></a>'; ?> </td> </tr> <?php echo '</a>'; ?> </table> </td> </tr> <tr id="files" <?php echo isset($view_options[0]['pd_option_view_files']) ? $view_options[0]['pd_option_view_files'] ? 'style="visibility:visible;display:"' : 'style="visibility:collapse;display:none"' : 'style="visibility:visible;display:"'; ?> > <td colspan="2" class="hilite"> <?php
function show($extra = '', $js_tabs = false, $alignment = 'left', $opt_flat = true) { global $AppUI, $w2Pconfig, $currentTabId, $currentTabName, $m, $a; $this->loadExtras($m, $a); $uistyle = $AppUI->getPref('UISTYLE') ? $AppUI->getPref('UISTYLE') : $w2Pconfig['host_style']; if (!$uistyle) { $uistyle = 'web2project'; } if (($a == 'addedit' || $a == 'view' || $a == 'viewuser') && function_exists('styleRenderBoxBottom')) { echo styleRenderBoxBottom(); } reset($this->tabs); $s = ''; // tabbed / flat view options if ($AppUI->getPref('TABVIEW') == 0) { if ($opt_flat) { $s .= '<table border="0" cellpadding="2" cellspacing="0" width="100%">'; $s .= '<tr>'; $s .= '<td width="54" nowrap="nowrap">'; $s .= '<a class="button" href="' . $this->baseHRef . 'tab=0"><span>' . $AppUI->_('tabbed') . '</span></a>'; $s .= '</td>'; $s .= '<td nowrap="nowrap">'; $s .= '<a class="button" href="' . $this->baseHRef . 'tab=-1"><span>' . $AppUI->_('flat') . '</span></a>'; $s .= '</td>' . $extra . '</tr></table>'; echo $s; } } else { if ($extra) { echo '<table border="0" cellpadding="2" cellspacing="0" width="100%"><tr>' . $extra . '</tr>' . '</table>'; } else { # echo "<img src=\"".w2PfindImage('shim.gif')."\" height=\"10\" width=\"1\" alt=\"\" />"; } } if ($this->active < 0 || $AppUI->getPref('TABVIEW') == 2) { // flat view, active = -1 echo '<table border="0" cellpadding="2" cellspacing="0" width="100%">'; foreach ($this->tabs as $k => $v) { echo '<tr><td><strong>' . ($v[2] ? $v[1] : $AppUI->_($v[1])) . '</strong></td></tr><tr><td>'; $currentTabId = $k; $currentTabName = $v[1]; include $this->baseInc . $v[0] . '.php'; echo '</td></tr>'; } echo '</table>'; } else { // tabbed view $s = '<table width="100%" border="0" cellpadding="0" cellspacing="0">'; $s .= '<tr><td><table align="' . $alignment . '" border="0" cellpadding="0" cellspacing="0">'; if (count($this->tabs) - 1 < $this->active) { //Last selected tab is not available in this view. eg. Child tasks $this->active = 0; } foreach ($this->tabs as $k => $v) { $class = $k == $this->active ? 'tabon' : 'taboff'; $sel = $k == $this->active ? 'Selected' : ''; $s .= '<td valign="middle"><img src="./style/' . $uistyle . '/bar_top_' . $sel . 'left.gif" id="lefttab_' . $k . '" border="0" alt="" /></td>'; $s .= '<td id="toptab_' . $k . '" valign="middle" nowrap="nowrap" class="' . $class . '"> <a href="'; if ($this->javascript) { $s .= 'javascript:' . $this->javascript . '(' . $this->active . ', ' . $k . ')'; } elseif ($js_tabs) { $s .= 'javascript:show_tab(' . $k . ')'; } else { $s .= $this->baseHRef . 'tab=' . $k; } $s .= '">' . ($v[2] ? $v[1] : $AppUI->_($v[1])) . '</a> </td>'; $s .= '<td valign="middle" ><img id="righttab_' . $k . '" src="./style/' . $uistyle . '/bar_top_' . $sel . 'right.gif" border="0" alt="" /></td>'; $s .= '<td class="tabsp"><img src="' . w2PfindImage('shim.gif') . '"/></td>'; } $s .= '</table></td></tr>'; //round the right top of the tab box $s .= '<tr><td>'; $s .= '<table width="100%" cellspacing="0" cellpadding="0" border="0">'; $s .= '<tbody>'; $s .= '<tr>'; $s .= ' <td valign="bottom" width="100%" background="./style/' . $uistyle . '/tabbox_top.jpg" align="left">'; $s .= ' <img src="./style/' . $uistyle . '/tabbox_top.jpg"/>'; $s .= ' </td>'; $s .= '</tr>'; $s .= '</tbody>'; $s .= '</table>'; $s .= '</td></tr>'; $s .= '<tr><td width="100%" colspan="' . (count($this->tabs) * 4 + 1) . '" class="tabox">'; echo $s; //Will be null if the previous selection tab is not available in the new window eg. Children tasks if ($this->tabs[$this->active][0] != '') { $currentTabId = $this->active; $currentTabName = $this->tabs[$this->active][1]; if (!$js_tabs) { require $this->baseInc . $this->tabs[$this->active][0] . '.php'; } } if ($js_tabs) { foreach ($this->tabs as $k => $v) { echo '<div class="tab" id="tab_' . $k . '">'; $currentTabId = $k; $currentTabName = $v[1]; require $this->baseInc . $v[0] . '.php'; echo '</div>'; echo '<script language="JavaScript" type="text/javascript"> <!-- show_tab(' . $this->active . '); //--> </script>'; } } echo '</td></tr></table>'; } }
$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>';
<?php $options = array(); if ($object->contact_private) { $options['checked'] = 'checked'; } ?> <?php $form->showField('contact_private', $object->contact_private, $options); ?> </p> <p> <?php $form->showLabel('Contact Methods'); ?> <?php echo w2PtoolTip('Contact Method', 'add new', false, 'add_contact_method'); ?> <a href="javascript:addContactMethod();"><img src="<?php echo w2PfindImage('icons/edit_add.png'); ?> " style="border: 0;" alt="" /></a><?php echo w2PendTip(); ?> </p> <p id="custom_fields"></p> <?php $form->showSaveButton(); ?> </div> </div> </form>
function buildPaginationNav($AppUI, $m, $tab, $xpg_totalrecs, $xpg_pagesize, $page) { $xpg_total_pages = $xpg_totalrecs > $xpg_pagesize ? ceil($xpg_totalrecs / $xpg_pagesize) : 0; $xpg_break = false; $xpg_prev_page = $xpg_next_page = 0; $s = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr>'; if ($xpg_totalrecs > $xpg_pagesize) { $xpg_prev_page = $page - 1; $xpg_next_page = $page + 1; // left buttoms if ($xpg_prev_page > 0) { $s .= '<td align="left" width="15%"><a href="./index.php?m=' . $m . '&tab=' . $tab . '&page=1"><img src="' . w2PfindImage('navfirst.gif') . '" border="0" Alt="First Page"></a> '; $s .= '<a href="./index.php?m=' . $m . '&tab=' . $tab . '&page=' . $xpg_prev_page . '"><img src="' . w2PfindImage('navleft.gif') . '" border="0" Alt="Previous page (' . $xpg_prev_page . ')"></a></td>'; } else { $s .= '<td width="15%"> </td>'; } // central text (files, total pages, ...) $s .= '<td align="center" width="70%">'; $s .= $xpg_totalrecs . ' ' . $AppUI->_('Record(s)') . ' ' . $xpg_total_pages . ' ' . $AppUI->_('Page(s)'); // Page numbered list, up to 30 pages $s .= ' [ '; for ($n = $page > 16 ? $page - 16 : 1; $n <= $xpg_total_pages; $n++) { if ($n == $page) { $s .= '<b>' . $n . '</b></a>'; } else { $s .= '<a href="./index.php?m=' . $m . '&tab=' . $tab . '&page=' . $n . '">' . $n . '</a>'; } if ($n >= 30 + $page - 15) { $xpg_break = true; break; } elseif ($n < $xpg_total_pages) { $s .= ' | '; } } if (!isset($xpg_break)) { // are we supposed to break ? if ($n == $page) { $s .= '<' . $n . '</a>'; } else { $s .= '<a href="./index.php?m=' . $m . '&tab=' . $tab . '&page=' . $xpg_total_pages . '">' . $n . '</a>'; } } $s .= ' ] '; $s .= '</td>'; // right buttoms if ($xpg_next_page <= $xpg_total_pages) { $s .= '<td align="right" width="15%"><a href="./index.php?m=' . $m . '&tab=' . $tab . '&page=' . $xpg_next_page . '"><img src="' . w2PfindImage('navright.gif') . '" border="0" Alt="Next Page (' . $xpg_next_page . ')"></a> '; $s .= '<a href="./index.php?m=' . $m . '&tab=' . $tab . '&page=' . $xpg_total_pages . '"><img src="' . w2PfindImage('navlast.gif') . '" border="0" Alt="Last Page"></a></td>'; } else { $s .= '<td width="15%"> </td></tr>'; } } $s .= '</table>'; return $s; }
function showchilddept_comp(&$a, $level = 0) { trigger_error("The showchilddept_comp function has been deprecated and will be removed in v4.0. There is no replacement.", E_USER_NOTICE); global $AppUI; $s = ' <td> <a href="./index.php?m=departments&a=addedit&dept_id=' . $a["dept_id"] . '" title="' . $AppUI->_('edit') . '"> ' . w2PshowImage('icons/stock_edit-16.png', 16, 16, '') . ' </td> <td>'; for ($y = 0; $y < $level; $y++) { if ($y + 1 == $level) { $s .= '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0" alt="">'; } else { $s .= '<img src="' . w2PfindImage('shim.gif') . '" width="16" height="12" border="0" alt="">'; } } $s .= '<a href="./index.php?m=departments&a=view&dept_id=' . $a['dept_id'] . '">' . $a['dept_name'] . '</a>'; $s .= '</td>'; $s .= '<td align="center">' . ($a['dept_users'] ? $a['dept_users'] : '') . '</td>'; return '<tr>' . $s . '</tr>'; }
foreach ($st_projects_arr as $project) { $line = $project[0]; $level = $project[1]; if ($line['project_id']) { $s_project = new CProject(); $s_project->load($line['project_id']); $s_company = new CCompany(); $s_company->load($s_project->project_company); $start_date = intval($s_project->project_start_date) ? new CDate($s_project->project_start_date) : null; $end_date = intval($s_project->project_end_date) ? new CDate($s_project->project_end_date) : null; $actual_end_date = intval($s_project->project_actual_end_date) ? new CDate($s_project->project_actual_end_date) : null; $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : ''; $x++; $row_class = $x % 2 ? 'style="background:#fff;"' : 'style="background:#f0f0f0;"'; $row_classr = $x % 2 ? 'style="background:#fff;text-align:right;"' : 'style="background:#f0f0f0;text-align:right;"'; $s .= '<tr><td ' . $row_class . ' align="center"><a href="./index.php?m=projects&a=addedit&project_id=' . $line['project_id'] . '"><img src="' . w2PfindImage('icons/' . ($project_id == $line['project_id'] ? 'pin' : 'pencil') . '.gif') . '" border=0 /></b></a></td>'; $s .= '<td ' . $row_classr . ' nowrap="nowrap">' . $line['project_id'] . '</td>'; if ($level) { $sd = str_repeat(' ', $level - 1) . w2PshowImage('corner-dots.gif', 16, 12) . ' ' . '<a href="./index.php?m=projects&a=view&project_id=' . $line['project_id'] . '">' . $line['project_name'] . '</a>'; } else { $sd = '<a href="./index.php?m=projects&a=view&project_id=' . $line['project_id'] . '">' . $line['project_name'] . '</a>'; } $s .= '<td ' . $row_class . '>' . $sd . '</td>'; $s .= '<td ' . $row_class . '><a href="./index.php?m=companies&a=view&company_id=' . $s_project->project_company . '">' . $s_company->company_name . '</a></td>'; $s .= '<td ' . $row_class . ' align="center">' . ($start_date ? $start_date->format($df) : '-') . '</td>'; $s .= '<td ' . $row_class . ' align="center">' . ($end_date ? $end_date->format($df) : '-') . '</td>'; $s .= '<td ' . $row_class . ' align="center">' . $projectPriority[$s_project->project_priority] . '</td>'; $s .= '<td ' . $row_class . ' align="center">' . $projectStatus[$s_project->project_status] . '</td></tr>'; } } echo $s;
} elseif ($row['project_priority'] > 0) { $s .= '<img src="' . w2PfindImage('icons/priority+' . $row['project_priority'] . '.gif') . '" width=13 height=16>'; } $s .= '</td><td width="40%">'; $count_projects = $tmpProject->hasChildProjects($row['project_id']); if ($level) { $s .= str_repeat(' ', $level - 1); $s .= '<img src="' . w2PfindImage('corner-dots.gif') . '" width="16" height="12" border="0"> '; $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> '; $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'] . '">' : '';
</td> <td> <a href="./index.php?m=admin&a=viewuser&user_id=<?php echo $row['user_id']; ?> "><?php echo $row['user_username']; ?> </a> </td> <td> <a href="mailto:<?php echo $row['contact_email']; ?> "><img src="<?php echo w2PfindImage('obj/email.gif'); ?> " width="16" height="16" border="0" alt="email" /></a> <?php if ($row['contact_last_name'] || $row['contact_first_name']) { echo $row['contact_first_name'] . ' ' . $row['contact_last_name']; } else { echo '<span style="font-style: italic">unknown</span>'; } ?> </td> <td> <?php echo $utypes[$row['user_type']]; ?> </td>
// 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>' : '-'; $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>' : '';
$oCompany = new CCompany(); $allowedCompanies[-1] = $AppUI->_('all'); $allowedCompanies += $oCompany->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name'); $project_types = array(-1 => '(' . $AppUI->_('all') . ')') + w2PgetSysVal('ProjectType'); $user_list = array(0 => '(' . $AppUI->_('all') . ')') + CProject::getOwners(); // setup the title block $titleBlock = new w2p_Theme_TitleBlock('Projects', 'icon.png', $m); //$titleBlock->addSearchCell($search_string); $titleBlock->addFilterCell('Type', 'project_type', $project_types, $project_type); $titleBlock->addFilterCell('Company', 'project_company', $allowedCompanies, $company_id); $titleBlock->addFilterCell('Owner', 'project_owner', $user_list, $owner); if ($canCreate) { $titleBlock->addButton('new project', '?m=projects&a=addedit'); } $titleBlock->addCell('<span title="' . $AppUI->_('Projects') . '::' . $AppUI->_('Print projects list') . '.">' . '<a href="javascript: void(0);" onclick ="window.open(\'index.php?m=projects&a=printprojects&dialog=1&suppressHeaders=1&company_id=' . $company_id . '&project_type=' . $project_type . '&project_owner=' . $owner . '\', \'printprojects\',\'width=1200, height=600, menubar=1, scrollbars=1\')"> <img src="' . w2PfindImage('printer.png') . '" /> </a></span>'); $titleBlock->show(); $project_statuses = array(); $project_statuses = w2PgetSysVal('ProjectStatus'); $project_statuses[-2] = 'All Projects'; $project_statuses[-1] = 'All Active'; $project_statuses[] = 'Archived'; ksort($project_statuses); $counts = $project->getProjectsByStatus($company_id); $counts[-2] = count($project->loadAll(null, $company_id > 0 ? 'project_company = ' . $company_id : '')); $counts[-1] = count($project->loadAll(null, 'project_active = 1' . ($company_id > 0 ? ' AND project_company = ' . $company_id : ''))); $counts[count($project_statuses) - 3] = $counts[-2] - $counts[-1]; $tabBox = new CTabBox('?m=projects', W2P_BASE_DIR . '/modules/projects/', $tab); foreach ($project_statuses as $key => $project_status) { $tabname = $project_status . '(' . (int) $counts[$key] . ')';
?> "><img src="<?php echo w2PfindImage('prev.gif'); ?> " width="16" height="16" alt="pre" border="0"></a> </td> <th width="100%"> <?php echo $AppUI->_(htmlspecialchars($this_day->format('%A'), ENT_COMPAT, $locale_char_set)) . ', ' . $this_day->format($df); ?> </th> <td> <a href="<?php echo '?m=planner&date=' . $next_day->format(FMT_TIMESTAMP_DATE); ?> "><img src="<?php echo w2PfindImage('next.gif'); ?> " width="16" height="16" alt="next" border="0"></a> </td> </tr> </table> <?php $html = ' <form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickFilter" accept-charset="utf-8">'; $html .= $AppUI->_('Event Filter') . ':' . arraySelect($event_filter_list, 'event_filter', 'onChange="document.pickFilter.submit()" class="text"', $event_filter, true); if ($other_users) { $html .= $AppUI->_('Show Events for') . ':' . '<select name="show_user_events" onchange="document.pickFilter.submit()" class="text">'; if ($rows = w2PgetUsersList()) { foreach ($rows as $row) {
function clash_suggest(w2p_Core_CAppUI $AppUI, $cal_sdf) { global $m, $a; $obj = new CEvent(); $obj->bind($_SESSION['add_event_post']); $start_date = new w2p_Utilities_Date($obj->event_start_date); $end_date = new w2p_Utilities_Date($obj->event_end_date); $df = $AppUI->getPref('SHDATEFORMAT'); $start_secs = $start_date->getTime(); $end_secs = $end_date->getTime(); $duration = (int) (($end_secs - $start_secs) / 60); $titleBlock = new w2p_Theme_TitleBlock('Suggest Alternative Event Time', 'myevo-appointments.png', $m, $m . '.' . $a); $titleBlock->show(); $calurl = W2P_BASE_URL . '/index.php?m=calendar&a=clash&event_id=' . $obj->event_id; $times = array(); $t = new w2p_Utilities_Date(); $t->setTime(0, 0, 0); if (!defined('LOCALE_TIME_FORMAT')) { define('LOCALE_TIME_FORMAT', '%I:%M %p'); } for ($m = 0; $m < 60; $m++) { $times[$t->format('%H%M%S')] = $t->format(LOCALE_TIME_FORMAT); $t->addSeconds(1800); } /* TODO: This needs to be refactored to use the core setDate_new function. */ ?> <script language="javascript" type="text/javascript"> function setDate( frm_name, f_date ) { fld_date = eval( 'document.' + frm_name + '.' + f_date ); fld_real_date = eval( 'document.' + frm_name + '.' + 'event_' + f_date ); if (fld_date.value.length>0) { if ((parseDate(fld_date.value))==null) { alert('The Date/Time you typed does not match your prefered format, please retype.'); fld_real_date.value = ''; fld_date.style.backgroundColor = 'red'; } else { fld_real_date.value = formatDate(parseDate(fld_date.value), 'yyyyMMdd'); fld_date.value = formatDate(parseDate(fld_date.value), '<?php echo $cal_sdf; ?> '); fld_date.style.backgroundColor = ''; } } else { fld_real_date.value = ''; } } function set_clash_action(action) { document.editFrm.clash_action.value = action; document.editFrm.submit(); } </script> <form name="editFrm" method="post" action="<?php echo $calurl . '&clash_action=process'; ?> " accept-charset="utf-8"> <table width='100%' class='std addedit'> <tr> <td width='50%' align='right'><?php echo $AppUI->_('Earliest Date'); ?> :</td> <td width='50%' align='left' nowrap="nowrap"> <input type="hidden" name="event_start_date" id="event_start_date" value="<?php echo $start_date ? $start_date->format(FMT_TIMESTAMP_DATE) : ''; ?> " /> <input type="text" name="start_date" id="start_date" onchange="setDate('editFrm', 'start_date');" value="<?php echo $start_date ? $start_date->format($df) : ''; ?> " class="text" /> <a href="javascript: void(0);" onclick="return showCalendar('start_date', '<?php echo $df; ?> ', 'editFrm', null, true)"> <img src="<?php echo w2PfindImage('calendar.gif'); ?> " width="24" height="12" alt="<?php echo $AppUI->_('Calendar'); ?> " border="0" /> </a> </td> </tr> <tr> <td width='50%' align='right'><?php echo $AppUI->_('Latest Date'); ?> :</td> <td width='50%' align='left' nowrap="nowrap"> <input type="hidden" name="event_end_date" id="event_end_date" value="<?php echo $end_date ? $end_date->format(FMT_TIMESTAMP_DATE) : ''; ?> " /> <input type="text" name="end_date" id="end_date" onchange="setDate('editFrm', 'end_date');" value="<?php echo $end_date ? $end_date->format($df) : ''; ?> " class="text" /> <a href="javascript: void(0);" onclick="return showCalendar('end_date', '<?php echo $df; ?> ', 'editFrm', null, true)"> <img src="<?php echo w2PfindImage('calendar.gif'); ?> " width="24" height="12" alt="<?php echo $AppUI->_('Calendar'); ?> " border="0" /> </a> </td> </tr> <tr> <td width='50%' align='right'><?php echo $AppUI->_('Earliest Start Time'); ?> :</td> <td width='50%' align='left'> <?php echo arraySelect($times, 'start_time', 'size="1" class="text"', $start_date->format('%H%M%S')); ?> </td> </tr> <tr> <td width='50%' align='right'><?php echo $AppUI->_('Latest Finish Time'); ?> :</td> <td width='50%' align='left'> <?php echo arraySelect($times, 'end_time', 'size="1" class="text"', $end_date->format('%H%M%S')); ?> </td> </tr> <tr> <td width='50%' align='right'><?php echo $AppUI->_('Duration'); ?> :</td> <td width='50%' align='left'> <input type="text" class="text" size="5" name="duration" value="<?php echo $duration; ?> " /> <?php echo $AppUI->_('minutes'); ?> </td> </tr> <tr> <td><input type="button" value="<?php echo $AppUI->_('cancel'); ?> " class="button" onclick="set_clash_action('cancel');" /></td> <td align="right"><input type="button" value="<?php echo $AppUI->_('submit'); ?> " class="button" onclick="set_clash_action('process')" /></td> </tr> </table> <input type='hidden' name='clash_action' value='cancel' /> </form> <?php }