} else { headerFunction("home.php?changeProject=true&" . session_name() . "=" . session_id()); } } $bouton[0] = "over"; $titlePage = $strings["welcome"] . " {$nameSession} " . $strings["your_projectsite"]; include "include_header.php"; if ($updateProject != "true" && $changeProject != "true") { $tmpquery = "WHERE org.id = '" . fixInt($projectDetail->pro_organization[0]) . "'"; $clientDetail = new request(); $clientDetail->openOrganizations($tmpquery); } $idStatus = $projectDetail->pro_status[0]; $idPriority = $projectDetail->pro_priority[0]; if ($projectSession == "" || $changeProject == "true") { $tmpquery = "WHERE tea.member = '" . fixInt($idSession) . "' AND pro.status IN(0,2,3) AND pro.published = '0' ORDER BY pro.name"; $listProjects = new request(); $listProjects->openTeams($tmpquery); $comptListProjects = count($listProjects->tea_id); $block1 = new block(); $block1->heading($strings["my_projects"]); if ($comptListProjects != "0") { echo "\t<table cellspacing='0' width='90%' border='0' cellpadding='3' cols='4' class='listing'>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='active'>" . $strings["name"] . "</th>\n\t\t\t\t\t<th>" . $strings["organization"] . "</th>\n\t\t\t\t\t<th>" . $strings["priority"] . "</th>\n\t\t\t\t\t<th>" . $strings["status"] . "</th>\n\t\t\t\t</tr>"; for ($i = 0; $i < $comptListProjects; $i++) { if (!($i % 2)) { $class = "odd"; $highlightOff = $block1->oddColor; } else { $class = "even"; $highlightOff = $block1->evenColor; }
$send = "false"; } } if ($filename != "" && $_FILES['upload']['size'] < $maxFileSize && $_FILES['upload']['size'] != 0 && $send != "false") { $docopy = "true"; } if ($docopy == "true") { $match = strstr($versionFile, "."); if ($match == "") { $versionFile = $versionFile . ".0"; } if ($versionFile == "") { $versionFile = "0.0"; } $c = convertData($c); $tmpquery = "INSERT INTO " . $tableCollab["files"] . "(owner,project,phase,task,comments,upload,published,status,vc_version,vc_parent) VALUES('{$idSession}','{$project}','" . fixInt($phase) . "','{$task}','{$c}','{$dateheure}','1','{$statusField}','{$versionFile}','0')"; connectSql("{$tmpquery}"); $tmpquery = $tableCollab["files"]; last_id($tmpquery); $num = $lastId[0]; unset($lastId); } if ($task != "0") { if ($docopy == "true") { uploadFile("files/{$project}/{$task}", $_FILES['upload']['tmp_name'], "{$num}--" . $filename); $size = file_info_size("../files/" . $project . "/" . $task . "/" . $num . "--" . $filename); //$dateFile = file_info_date("../files/".$project."/".$task."/".$num."--".$filename); $chaine = strrev("../files/" . $project . "/" . $task . "/" . $num . "--" . $filename); $tab = explode(".", $chaine); $extension = strtolower(strrev($tab[0])); }
$tmpquery = $tableCollab["tasks"]; last_id($tmpquery); $num = $lastId[0]; unset($lastId); if ($enableInvoicing == "true") { if ($st == "1") { $completeItem = "1"; } else { $completeItem = "0"; } $tmpquery = "WHERE project = '{$project}'"; $detailInvoice = new request(); $detailInvoice->openInvoices($tmpquery); if ($detailInvoice->inv_status[0] == "0") { //$tmpquery3 = "INSERT INTO ".$tableCollab["invoices_items"]." SET title='$task_name',description='$d',invoice='".$detailInvoice->inv_id[0]."',created='$dateheure',active='$invoicing',completed='$completeItem',mod_type='1',mod_value='$num',worked_hours='$worked_hours'"; $tmpquery3 = "INSERT INTO " . $tableCollab["invoices_items"] . " (title,description,invoice,created,active,completed,mod_type,mod_value,worked_hours) VALUES ('{$task_name}','{$d}','" . fixInt($detailInvoice->inv_id[0]) . "','{$dateheure}','{$invoicing}','{$completeItem}','1','{$num}','{$worked_hours}')"; connectSql($tmpquery3); } } if ($st == "1") { $tmpquery6 = "UPDATE " . $tableCollab["tasks"] . " SET complete_date='{$date}' WHERE id = '{$num}'"; connectSql($tmpquery6); } //recompute number of completed tasks of the project $projectDetail->pro_name[0] = projectComputeCompletion($projectDetail, $tableCollab["projects"]); //if assigned_to not blank, set assigned date if ($at != "0") { $tmpquery6 = "UPDATE " . $tableCollab["tasks"] . " SET assigned='{$dateheure}' WHERE id = '{$num}'"; connectSql($tmpquery6); } $tmpquery2 = "INSERT INTO " . $tableCollab["assignments"] . "(task,owner,assigned_to,assigned) VALUES('{$num}','{$idSession}','{$at}','{$dateheure}')";
} else { $block1->noresults(); } $block1->closeToggle(); $block1->closeFormResults(); $block1->openPaletteScript(); if ($profilSession == "0" || $profilSession == "1" || $profilSession == "5") { $block1->paletteScript(0, "add", "../newsdesk/editnews.php?", "true,true,true", $strings["add_newsdesk"]); $block1->paletteScript(1, "remove", "../newsdesk/editnews.php?action=remove&id={$id}", "true,false,true", $strings["del_newsdesk"]); $block1->paletteScript(3, "edit", "../newsdesk/editnews.php?id={$id}", "true,true,true", $strings["edit_newsdesk"]); } $block1->closePaletteScript($comptNewsDetail, $newsDetail->news_id); /////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////// comments block ////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// $tmpquery = "WHERE newscom.post_id = '" . fixInt($id) . "'"; $newsComments = new request(); $newsComments->openNewsDeskComments($tmpquery); $comptCommentsDetail = count($newsComments->newscom_id); $block2 = new block(); $block2->form = "clPrc"; $block2->openForm("../newsdesk/viewnews.php?" . session_name() . "=" . session_id() . "&id={$id}#" . $block2->form . "Anchor"); $block2->headingToggle($strings["comments"]); $block2->openPaletteIcon(); $block2->paletteIcon(0, "add", $strings["add_newsdesk_comment"]); $block2->paletteIcon(1, "edit", $strings["edit_newsdesk_comment"]); if ($profilSession == "0" || $profilSession == "1" || $profilSession == "5") { $block2->paletteIcon(2, "remove", $strings["del_newsdesk_comment"]); } $block2->closePaletteIcon(); $block1->borne = $blockPage->returnBorne("2");
$cn = convertData($cn); $add = convertData($add); $comments = convertData($comments); //test if name already exists $tmpquery = "WHERE org.name = '{$cn}'"; $existsClient = new request(); $existsClient->openOrganizations($tmpquery); $comptExistsClient = count($existsClient->org_id); if ($comptExistsClient != "0") { $error = $strings["organization_already_exists"]; } else { if ($hourly_rate == "") { $hourly_rate = 0.0; } //insert into organizations and redirect to new client organization detail (last id) $tmpquery1 = "INSERT INTO " . $tableCollab["organizations"] . "(name,address1,phone,url,email,comments,created,owner,hourly_rate) VALUES('{$cn}','{$add}','{$client_phone}','{$url}','{$email}','{$c}','{$dateheure}','" . fixInt($cown) . "','{$hourly_rate}')"; connectSql("{$tmpquery1}"); $tmpquery = $tableCollab["organizations"]; last_id($tmpquery); $num = $lastId[0]; unset($lastId); $extension = strtolower(substr(strrchr($upload_name, "."), 1)); if (@move_uploaded_file($upload, "../logos_clients/" . $num . ".{$extension}")) { chmod("../logos_clients/" . $num . ".{$extension}", 0666); $tmpquery = "UPDATE " . $tableCollab["organizations"] . " SET extension_logo='{$extension}' WHERE id='{$num}'"; connectSql("{$tmpquery}"); } headerFunction("../clients/viewclient.php?id={$num}&msg=add&" . session_name() . "=" . session_id()); } } }
$extractDay = substr("{$storedDate}", 8, 2); return date("Y-m-d H:i", mktime($extractHour + $gmtUser, $extractMinute, 0, $extractMonth, $extractDay, $extractYear)); } } else { return $storedDate; } } //update sorting table if query sort column if (!empty($sor_cible) && $sor_cible != "" && $sor_champs != "none") { $sor_champs = convertData($sor_champs); $sor_cible = convertData($sor_cible); $tmpquery = "UPDATE " . $tableCollab["sorting"] . " SET {$sor_cible}='{$sor_champs} {$sor_ordre}' WHERE member = '{$idSession}'"; connectSql("{$tmpquery}"); } //set all sorting values for logged user $tmpquery = "WHERE sor.member = '" . fixInt($idSession) . "'"; $sortingUser = new request(); $sortingUser->openSorting($tmpquery); /** * Convert insert data value in form * @param string $data Data to convert * @access public **/ function convertData($data) { global $databaseType; if ($databaseType == "sqlserver") { $data = str_replace('"', '"', $data); $data = str_replace("'", ''', $data); $data = str_replace('<', '<', $data); $data = str_replace('>', '>', $data);
$comptListTasksTime = count($listTasksTime->tas_id); if ($comptListTasksTime != "0") { for ($i = 0; $i < $comptListTasksTime; $i++) { $estimated_time = $estimated_time + $listTasksTime->tas_estimated_time[$i]; $actual_time = $actual_time + $listTasksTime->tas_actual_time[$i]; if ($listTasksTime->tas_complete_date[$i] != "" && $listTasksTime->tas_complete_date[$i] != "--" && $listTasksTime->tas_due_date[$i] != "--") { $diff = diff_date($listTasksTime->tas_complete_date[$i], $listTasksTime->tas_due_date[$i]); $diff_time = $diff_time + $diff; } } if ($diff_time > 0) { $diff_time = "<b>+{$diff_time}</b>"; } } $teamMember = "false"; $tmpquery = "WHERE tea.project = '{$id}' AND tea.member = '" . fixInt($idSession) . "'"; $memberTest = new request(); $memberTest->openTeams($tmpquery); $comptMemberTest = count($memberTest->tea_id); if ($comptMemberTest == "0") { $teamMember = "false"; } else { $teamMember = "true"; } if ($teamMember == "false" && $projectsFilter == "true") { header("Location:../general/permissiondenied.php?" . session_name() . "=" . session_id()); exit; } if ($enableHelpSupport == "true" && ($teamMember == "true" || $profilSession == "5")) { $tmpquery = "WHERE sr.status = '0' AND sr.project = '" . $projectDetail->pro_id[0] . "'"; $listNewRequests = new request();