if ($_SESSION['profilSession'] == 1 or $_SESSION['profilSession'] == 5 or $_SESSION['idSession'] == $listTaskTimes->tim_owner[$i]) { $block2->openRow($listTaskTimes->tim_id[$i]); $block2->checkboxRow($listTaskTimes->tim_id[$i], 'true'); $block2->cellRow($listTaskTimes->tim_mem_name[$i]); $block2->cellRow($listTaskTimes->tim_date[$i]); $block2->cellRow($listTaskTimes->tim_hours[$i]); $block2->cellRow($listTaskTimes->tim_created[$i]); $block2->cellRow($listTaskTimes->tim_modified[$i]); // truncate large comments to keep the display clean $comments = $listTaskTimes->tim_comments[$i]; $lenComm = 40; if (strLen($comments) > $lenComm) { $comments = substr($listTaskTimes->tim_comments[$i], 0, $lenComm) . ' ...'; } $block2->cellRow($comments); $block2->closeRow(); } } $block2->closeResults(); $block2->bornesFooter("1", $blockPage->bornesNumber, "", "id={$id}"); } else { $block2->noresults(); } $block2->closeFormResults(); $block2->block_close(); $block2->closeForm(); $block2->openPaletteScript(); $block2->paletteScript(0, "remove", "../tasks/deletetasktime.php?task={$id}", "false,true,true", $strings["delete"]); $block2->paletteScript(1, "edit", "../tasks/edittasktime.php?task={$id}", "false,true,false", $strings["edit"]); $block2->closePaletteScript($comptListTaskTimes, $listTaskTimes->tim_id); require_once "../themes/" . THEME . "/footer.php";
//--- assigned to ----- if ($listTasks->tas_assigned_to[$i] == '0') { $block10->cellRow($strings['unassigned']); } else { $block10->cellRow(buildLink($listTasks->tas_mem_email_work[$i], $listTasks->tas_mem_login[$i], LINK_MAIL)); } //---- published ------ if ($sitePublish == 'true') { $block10->cellRow($statusPublish[$idPublish]); } $block10->closeRow(); } $block10->closeResults(); $block10->bornesFooter('1', $blockPage->bornesNumber, '../tasks/listtasks.php?project=' . $id, 'id=' . $id); } else { $block10->noresults(); } $block10->closeToggle(); $block10->closeFormResults(); $block10->openPaletteScript(); if ($teamMember == 'true' || $_SESSION['profilSession'] == '5') { $block10->paletteScript(0, 'add', '../tasks/edittask.php?project=' . $projectDetail->pro_id[0], 'true,false,false', $strings['add']); $block10->paletteScript(1, 'remove', '../tasks/deletetasks.php?project=' . $projectDetail->pro_id[0], 'false,true,true', $strings['delete']); $block10->paletteScript(2, 'copy', '../tasks/edittask.php?project=' . $projectDetail->pro_id[0] . '&cpy=true', 'false,true,false', $strings['copy']); // $block10->paletteScript(3,'export','../projects/exportproject.php','false,true,true',$strings['export']); if ($sitePublish == 'true') { $block10->paletteScript(4, 'add_projectsite', '../projects/viewproject.php?addToSiteTask=true&project=' . $projectDetail->pro_id[0] . '&action=publish', 'false,true,true', $strings['add_project_site']); $block10->paletteScript(5, 'remove_projectsite', '../projects/viewproject.php?removeToSiteTask=true&project=' . $projectDetail->pro_id[0] . '&action=publish', 'false,true,true', $strings['remove_project_site']); } } $block10->paletteScript(6, 'info', '../tasks/viewtask.php', 'false,true,false', $strings['view']);
function prj_displayMyProjectTasks(&$blockPage) { global $_TABLES, $_CONF, $_USER, $_COOKIE, $subTaskImg, $progress, $priority, $strings, $labels, $_PRJCONF; $limitbase = $_COOKIE['alltasksmin']; if ($limitbase == '') { $limitbase = 0; } $useThisTIDforAjax = 0; $filterCSV = COM_applyFilter($_COOKIE['filterTasks']); if ($blockPage == NULL or $blockPage == '') { $blockPage = new block(); } $block2 = new block(); if ($msg != "") { require_once "includes/messages.php"; $blockPage->messagebox($msgLabel); } if (!isset($_USER['uid']) or $_USER['uid'] == "") { $uid = 1; } else { $uid = $_USER['uid']; } //my tasks $blockPage->bornesNumber = "2"; $block2 = new block(); $block2->form = "taP"; $block2->openForm($_CONF['site_url'] . "/nexproject/index.php?" . "#" . $block2->form . "Anchor"); $headingTitle = $strings['my_tasks']; $headingStatusArea = '<span id="ajaxstatus_tasks" class="pluginInfo" style="display:none"> </span>'; $block2->headingToggle($headingTitle, $headingStatusArea); $block2->borne = $blockPage->returnBorne("2"); $block2->rowsLimit = $_PRJCONF['task_block_rows']; $lim = $limitbase * $block2->rowsLimit; echo '<!--startMyTasks-->'; echo '<div id="divMyTasks">'; $sql = "SELECT {$_TABLES['prj_tasks']}.tid FROM {$_TABLES['prj_tasks']}, {$_TABLES['prj_task_users']}, {$_TABLES['users']} "; $sql .= "WHERE {$_TABLES['prj_task_users']}.uid={$uid} AND {$_TABLES['prj_task_users']}.tid={$_TABLES['prj_tasks']}.tid "; $sql .= "AND {$_TABLES['prj_task_users']}.uid={$_TABLES['users']}.uid AND {$_TABLES['prj_task_users']}.uid={$uid} "; $sql .= "AND {$_TABLES['prj_task_users']}.role='o' AND {$_TABLES['prj_tasks']}.status_id in (0,3) "; $result = DB_query($sql); $block2->recordsTotal = DB_numrows($result); $lim = $limitbase * $block2->rowsLimit; $sql = "SELECT {$_TABLES['prj_tasks']}.tid,{$_TABLES['prj_tasks']}.progress_id, {$_TABLES['prj_projects']}.name, "; $sql .= "{$_TABLES['prj_tasks']}.priority_id, {$_TABLES['prj_tasks']}.name, {$_TABLES['prj_tasks']}.estimated_end_date, "; $sql .= "{$_TABLES['prj_tasks']}.start_date, {$_TABLES['prj_tasks']}.pid FROM {$_TABLES['prj_tasks']}, "; $sql .= "{$_TABLES['prj_task_users']}, {$_TABLES['users']}, {$_TABLES['prj_projects']} "; $sql .= "WHERE {$_TABLES['prj_task_users']}.uid={$uid} AND {$_TABLES['prj_task_users']}.tid={$_TABLES['prj_tasks']}.tid "; $sql .= "AND {$_TABLES['prj_task_users']}.uid={$_TABLES['users']}.uid AND {$_TABLES['prj_task_users']}.role='o' "; $sql .= "AND {$_TABLES['prj_task_users']}.uid={$uid} AND {$_TABLES['prj_tasks']}.pid={$_TABLES['prj_projects']}.pid "; $sql .= "AND {$_TABLES['prj_tasks']}.status_id in (0,3) "; if ($filterCSV != '') { $sql .= "AND {$_TABLES['prj_tasks']}.pid in ({$filterCSV})"; } $sql .= " ORDER BY {$_TABLES['prj_tasks']}.estimated_end_date "; $sql .= " LIMIT {$lim}, {$block2->rowsLimit} "; $result = DB_query($sql, true); $comptListTasks = DB_numrows($result); if ($result == FALSE) { //remove the filterCSV as there might be a cookie issue with it... $sql = "SELECT {$_TABLES['prj_tasks']}.tid,{$_TABLES['prj_tasks']}.progress_id, {$_TABLES['prj_projects']}.name, "; $sql .= "{$_TABLES['prj_tasks']}.priority_id, {$_TABLES['prj_tasks']}.name, {$_TABLES['prj_tasks']}.estimated_end_date, "; $sql .= "{$_TABLES['prj_tasks']}.start_date, {$_TABLES['prj_tasks']}.pid FROM {$_TABLES['prj_tasks']}, "; $sql .= "{$_TABLES['prj_task_users']}, {$_TABLES['users']}, {$_TABLES['prj_projects']} "; $sql .= "WHERE {$_TABLES['prj_task_users']}.uid={$uid} AND {$_TABLES['prj_task_users']}.tid={$_TABLES['prj_tasks']}.tid "; $sql .= "AND {$_TABLES['prj_task_users']}.uid={$_TABLES['users']}.uid AND {$_TABLES['prj_task_users']}.role='o' "; $sql .= "AND {$_TABLES['prj_task_users']}.uid={$uid} AND {$_TABLES['prj_tasks']}.pid={$_TABLES['prj_projects']}.pid "; $sql .= "AND {$_TABLES['prj_tasks']}.status_id in (0,3) "; $sql .= " ORDER BY {$_TABLES['prj_tasks']}.estimated_end_date "; $sql .= " LIMIT {$lim}, {$block2->rowsLimit} "; $result = DB_query($sql); $comptListTasks = DB_numrows($result); } if ($comptListTasks != "0") { $block2->openResults(false); $block2->labels($labels = array(0 => $strings["task"], 1 => $strings["priority"], 2 => $strings["project"], 3 => $strings["start_date"], 4 => $strings["estimated_end_date"]), "true"); for ($i = 0; $i < DB_numrows($result); $i++) { list($tid, $idProgress, $projectname, $idPriority, $taskname, $estenddate, $startdate, $pid) = DB_fetchArray($result); $full_projectname = $projectname; $full_taskname = $taskname; if (strlen($taskname) > 25) { $taskname = substr($taskname, 0, 25) . "...."; } if (strlen($projectname) > 20) { $projectname = substr($projectname, 0, 20) . "...."; } $block2->openRow(); //$block2->checkboxRow($pid); $block2->cellProgress($progress[$idProgress]); $block2->cellRow($blockPage->buildLink("{$_CONF['site_url']}/nexproject/viewproject.php?mode=view&id={$tid}", $taskname, "mytaskcontext", $full_taskname, '', $tid)); $block2->cellRow($priority[$idPriority]); $block2->cellRow($blockPage->buildLink("{$_CONF['site_url']}/nexproject/viewproject.php?pid={$pid}", $projectname, "context", $full_projectname, $pid)); $block2->cellRow(strftime("%Y/%m/%d", $startdate)); $block2->cellRow(strftime("%Y/%m/%d", $estenddate)); $block2->closeRow(); } $block2->closeResults(); $pages = intval($block2->recordsTotal / $block2->rowsLimit); if (fmod($block2->recordsTotal, $block2->rowsLimit) > 0) { $pages += 1; } if ($pages > 1) { for ($pagecntr = 0; $pagecntr < $pages; $pagecntr++) { echo '<span style="text-decoration:underline;cursor: hand" onclick=\'setCookie("alltasksmin","'; echo $pagecntr; echo '","","");prj_getMyTasks("myprj_refresh", "' . $useThisTIDforAjax . '" )\'>'; if ($limitbase == $pagecntr) { echo '<span style="color:red">'; echo $pagecntr + 1; echo '</span>'; } else { echo $pagecntr + 1; } echo '</span> '; } echo ' <span style="text-decoration:underline;cursor: hand" TITLE="Return to page 1" onclick=\'setCookie("alltasksmin","","","");prj_getMyTasks("myprj_refresh", "' . $useThisTIDforAjax . '" )\'>'; echo '<<</span>'; } } else { $block2->noresults(); } echo '</div>'; echo '<!--endMyTasks-->'; echo '<input type=hidden name=pid value=' . $pid . '>'; $block2->closeToggle(); $block2->closeFormResults(); }
} $comptPri = count($priority); for ($rp = 0; $rp < $comptPri; $rp++) { if ($listRequests->sr_priority[$i] == $rp) { $requestPriority = $priority[$rp]; } } $block1->openRow(); $block1->checkboxRow($listRequests->sr_id[$i]); $block1->cellRow($listRequests->sr_id[$i]); $block1->cellRow($blockPage->buildLink("../support/viewrequest.php?id=" . $listRequests->sr_id[$i], $listRequests->sr_subject[$i], in)); $block1->cellRow($requestPriority); $block1->cellRow($currentStatus); $block1->cellRow($listRequests->sr_date_open[$i]); $block1->cellRow($listRequests->sr_date_close[$i]); $block1->closeRow(); } $block1->closeResults(); } else { $block1->noresults(); } $block1->closeFormResults(); if ($teamMember == "true" || $profilSession == "0") { $block1->openPaletteScript(); //$block1->paletteScript(0,"add","addsupport.php?","true,true,true",$strings["add"]); $block1->paletteScript(1, "edit", "../support/addpost.php?action=status", "false,true,false", $strings["edit_status"]); $block1->paletteScript(2, "remove", "../support/deleterequests.php?action=deleteR", "false,true,true", $strings["delete"]); $block1->paletteScript(3, "info", "../support/viewrequest.php?", "false,true,false", $strings["view"]); $block1->closePaletteScript($comptListRequests, $listRequests->sr_id); } include '../themes/' . THEME . '/footer.php';
for ($i = 0; $i < $comptListMembers; $i++) { $block3->openRow($listMembers->mem_id[$i]); $block3->checkboxRow($listMembers->mem_id[$i]); $block3->cellRow(buildLink('../users/viewclientuser.php?id=' . $listMembers->mem_id[$i] . "&organization={$id}", $listMembers->mem_name[$i], LINK_INSIDE)); $block3->cellRow($listMembers->mem_login[$i]); $block3->cellRow(buildLink($listMembers->mem_email_work[$i], $listMembers->mem_email_work[$i], LINK_MAIL)); $block3->cellRow($listMembers->mem_phone_work[$i]); $z = '(Client on project site)'; if ($listMembers->mem_log_connected[$i] > $dateunix - 5 * 60) { $block3->cellRow($strings['yes'] . ' ' . $z); } else { $block3->cellRow($strings['no']); } } $block3->closeResults(); } else { $block3->noresults(); } $block3->closeToggle(); $block3->closeFormResults(); $block3->openPaletteScript(); if ($_SESSION['profilSession'] == '0' || $_SESSION['profilSession'] == '1' || $_SESSION['profilSession'] == '5') { $block3->paletteScript(0, 'add', '../users/addclientuser.php?organization=' . $id, 'true,true,true', $strings['add']); $block3->paletteScript(1, 'remove', '../users/deleteclientusers.php?organization=' . $id, 'false,true,true', $strings['delete']); } $block3->paletteScript(2, 'info', '../users/viewclientuser.php?organization=' . $id, 'false,true,false', $strings['view']); if ($_SESSION['profilSession'] == '0' || $_SESSION['profilSession'] == '1' || $_SESSION['profilSession'] == '5') { $block3->paletteScript(3, 'edit', '../users/updateclientuser.php?organization=' . $id, 'false,true,false', $strings['edit']); } $block3->closePaletteScript($comptListMembers, $listMembers->mem_id); require_once '../themes/' . THEME . '/footer.php';
$listReports = new request(); $listReports->openReports($tmpquery); $comptListReports = count($listReports->rep_id); $block4->headingToggle($strings["my_reports"] . " <span class=addition>({$comptListReports})</span>"); $block4->openPaletteIcon(); $block4->paletteIcon(0, "add", $strings["new"]); $block4->paletteIcon(1, "remove", $strings["delete"]); $block4->paletteIcon(2, "info", $strings["view"]); $block4->closePaletteIcon(); if ($comptListReports != "0") { $block4->openResults(); $block4->labels($labels = array(0 => $strings["name"], 1 => $strings["created"]), "false"); for ($i = 0; $i < $comptListReports; $i++) { $block4->openRow($listReports->rep_id[$i]); $block4->checkboxRow($listReports->rep_id[$i]); $block4->cellRow(buildLink("../reports/resultsreport.php?id=" . $listReports->rep_id[$i], $listReports->rep_name[$i], LINK_INSIDE), "31"); $block4->cellRow(createDate($listReports->rep_created[$i], $_SESSION['timezoneSession'])); $block4->closeRow(); } $block4->closeResults(); } else { $block4->noresults(); } $block4->closeToggle(); $block4->closeFormResults(); $block4->openPaletteScript(); $block4->paletteScript(0, "add", "../reports/createreport.php", "true,true,true", $strings["new"]); $block4->paletteScript(1, "remove", "../reports/deletereports.php", "false,true,true", $strings["delete"]); $block4->paletteScript(2, "info", "../reports/resultsreport.php", "false,true,true", $strings["view"]); $block4->closePaletteScript($comptListReports, $listReports->rep_id); require_once "../themes/" . THEME . "/footer.php";
if ($comptTopic != '0') { $block6->cellRow($topicNote[$listNotes->note_topic[$i]]); } $block6->cellRow($listNotes->note_date[$i]); $block6->cellRow(buildLink($listNotes->note_mem_email_work[$i], $listNotes->note_mem_login[$i], LINK_MAIL)); if ($sitePublish == 'true') { $block6->cellRow($statusPublish[$idPublish]); } else { $block6->cellRow(' '); } $block6->closeRow(); } $block6->closeResults(); $block6->bornesFooter('4', $blockPage->bornesNumber, '../notes/listnotes.php?project=' . $id, 'id=' . $id); } else { $block6->noresults(); } $block6->closeToggle(); $block6->closeFormResults(); $block6->openPaletteScript(); if ($teamMember == 'true' || $_SESSION['profilSession'] == '5') { $block6->paletteScript(0, 'add', '../notes/editnote.php?project=' . $projectDetail->pro_id[0], 'true,true,true', $strings['add']); $block6->paletteScript(1, 'remove', '../notes/deletenotes.php?project=' . $projectDetail->pro_id[0], 'false,true,true', $strings['delete']); // $block6->paletteScript(2,'export','../projects/exportproject.php','false,true,true',$strings['export']); if ($sitePublish == 'true') { $block6->paletteScript(3, 'add_projectsite', '../projects/viewproject.php?addToSiteNote=true&project=' . $projectDetail->pro_id[0] . '&action=publish', 'false,true,true', $strings['add_project_site']); $block6->paletteScript(4, 'remove_projectsite', '../projects/viewproject.php?removeToSiteNote=true&project=' . $projectDetail->pro_id[0] . '&action=publish', 'false,true,true', $strings['remove_project_site']); } } $block6->paletteScript(5, 'info', '../notes/viewnote.php', 'false,true,false', $strings['view']); if ($teamMember == 'true' || $_SESSION['profilSession'] == '5') {
$block5->openResults(); $block5->labels($labels = array(0 => $strings["Subject"], 1 => $strings["Author"], 2 => $strings["lastUpdated"], 3 => $strings["Replies"]), "true"); for ($i = 0; $i < $comptListTasks; $i++) { list($listForum->topic[$i], $parent, $listForum->subject[$i], $listForum->author[$i], $listForum->date[$i], $listForum->replies[$i]) = DB_fetchArray($result); $block5->openRow(); $block5->checkboxRow($listForum->topic[$i]); $block5->cellRow($blockPage->buildLink($_CONF['site_url'] . "/forum/viewtopic.php?forum=" . $A[fid] . "&showtopic=" . $listForum->topic[$i], $listForum->subject[$i], "in", 'Click to View Discussion')); $block5->cellRow($listForum->author[$i]); $block5->cellRow(strftime("%Y/%m/%d %H:%M", $listForum->date[$i])); $block5->cellRow($listForum->replies[$i]); $block5->closeRow(); } $block5->closeResults(); $block5->bornesFooter("5", $blockPage->bornesNumber, "", "pid={$pid}"); } else { $block5->noresults(); } echo '<input type="hidden" name="pid" value="' . $pid . '">'; $block5->closeToggle(); $block5->closeFormResults(); if ($membertoken != 0) { $block5->openPaletteScript(); $block5->paletteScript(0, "export", $_CONF['site_url'] . "/forum/createtopic.php?method=postreply&forum=" . $A[fid], "false,true,false", $strings["reply"]); $block5->paletteScript(1, "add", $_CONF['site_url'] . "/forum/createtopic.php?method=newtopic&forum=" . $A[fid], "true,true,false", $strings["add"]); $block5->closePaletteScript($comptListTasks, $listForum->topic); } } if ($temptoken['teammember'] == '1') { $p = new Template($_CONF['path_layout'] . 'nexproject/javascript'); $p->set_file('contextmenu', 'taskblock_contextmenu.thtml'); $p->set_var('site_url', $_CONF['site_url']);
$comptUncompleteTasks = $comptUncompleteTasks + 1; } } } $block7->openRow(); $block7->checkboxRow($listPhases->pha_id[$i]); $block7->cellRow($listPhases->pha_order_num[$i]); $block7->cellRow($blockPage->buildLink("../phases/viewphase.php?id=" . $listPhases->pha_id[$i], $listPhases->pha_name[$i], in)); $block7->cellRow($comptlistTasksRow); $block7->cellRow($comptUncompleteTasks); $block7->cellRow($phaseStatus[$listPhases->pha_status[$i]]); $block7->cellRow($listPhases->pha_date_start[$i]); $block7->cellRow($listPhases->pha_date_end[$i]); $block7->closeRow(); } $block7->closeResults(); } else { $block7->noresults(); } $block7->closeToggle(); $block7->closeFormResults(); $block7->openPaletteScript(); $block7->paletteScript(0, "info", "../phases/viewphase.php?", "false,true,true", $strings["view"]); if ($teamMember == "true" || $profilSession == "5") { if ($idSession == $projectDetail->pro_owner[0] || $profilSession == "0" || $profilSession == "5") { $block7->paletteScript(1, "edit", "../phases/editphase.php?", "false,true,true", $strings["edit"]); } } $block7->closePaletteScript($comptListPhases, $listPhases->pha_id); } include '../themes/' . THEME . '/footer.php';