* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/projet/tasks/document.php * \ingroup project * \brief Page de gestion des documents attachees a une tache d'un projet * \version $Id$ */ require('../../main.inc.php'); require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); $langs->load('projects'); $langs->load('other'); $action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action']) : $_GET['action']; $mine = $_REQUEST['mode']=='mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects $id = isset($_GET["id"])?$_GET["id"]:''; // Security check $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; //$result=restrictedArea($user,'projet',$id,''); if (!$user->rights->projet->lire) accessforbidden(); // Get parameters $page=$_GET["page"]; $sortorder=$_GET["sortorder"]; $sortfield=$_GET["sortfield"]; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; if ($page == -1) { $page = 0 ; } $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; $id = $_GET['id']; $ref= $_GET['ref']; $task = new Task($db); if ($task->fetch($id,$ref) > 0) { $projectstatic = new Project($db); $projectstatic->fetch($task->fk_project); if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($task->ref); } else { dol_print_error($db); } /* * Actions */ // Envoi fichier if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) { require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php"); if (create_exdir($upload_dir) >= 0) { $resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0,0,$_FILES['userfile']['error']); if (is_numeric($resupload) && $resupload > 0) { $mesg = '
| '; print $langs->trans("Ref"); print ' | '; $projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); $task->next_prev_filter=" fk_projet in (".$projectsListId.")"; print $form->showrefnav($task,'id','',1,'rowid','ref','',''); print ' | '; print '||
| '.$langs->trans("Label").' | '.$task->label.' | ||
| '.$langs->trans("Project").' | '; print $projectstatic->getNomUrl(1); print ' | '.$langs->trans("Company").' | '; if ($projectstatic->societe->id) print $projectstatic->societe->getNomUrl(1); else print ' '; print ' | '; // Files infos print '
| '.$langs->trans("NbOfAttachedFiles").' | '.sizeof($filearray).' | ||
| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' | ||