diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index fecead20822e0ffce450bbddf3fc4f66907bd48b..602f45db67d77f8f4a82fac7bb61132cc226e268 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -110,6 +110,11 @@ function project_prepare_head($object) $h++; } + $head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$object->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + complete_head_from_modules($conf,$langs,$object,$head,$h,'project','remove'); return $head; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 86548031d8bf9158abfdede8966042721198aeff..ef4d4d7d20f459990545808f52b5eaf6f6ee8a9e 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1728,5 +1728,54 @@ class Project extends CommonObject return $this->datee < ($now - $conf->projet->warning_delay); } + + /** + * Charge les informations d'ordre info dans l'objet commande + * + * @param int $id Id of order + * @return void + */ + function info($id) + { + $sql = 'SELECT c.rowid, datec as datec, tms as datem,'; + $sql.= ' date_close as datecloture,'; + $sql.= ' fk_user_creat as fk_user_author, fk_user_close as fk_use_cloture'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'projet as c'; + $sql.= ' WHERE c.rowid = '.$id; + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) + { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + + if ($obj->fk_user_cloture) + { + $cluser = new User($this->db); + $cluser->fetch($obj->fk_user_cloture); + $this->user_cloture = $cluser; + } + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_cloture = $this->db->jdate($obj->datecloture); + } + + $this->db->free($result); + + } + else + { + dol_print_error($this->db); + } + } + } diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php new file mode 100644 index 0000000000000000000000000000000000000000..c2e45560f74457af8d7088e04e26c207ef99ad53 --- /dev/null +++ b/htdocs/projet/info.php @@ -0,0 +1,69 @@ +<?php +/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> + * + * 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 3 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, see <http://www.gnu.org/licenses/>. + */ + +/** + * \file htdocs/projet/info.php + * \ingroup commande + * \brief Page with info on project + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; + +if (!$user->rights->projet->lire) accessforbidden(); + +$langs->load("projects"); + +// Security check +$socid=0; +$id = GETPOST("id",'int'); +if ($user->societe_id) $socid=$user->societe_id; +$result=restrictedArea($user,'projet',$id,''); + + + +/* + * View + */ + +$title=$langs->trans("Project").' - '.$object->ref.' '.$object->name; +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref.' '.$object->name.' - '.$langs->trans("Info"); +$help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; +llxHeader("",$title,$help_url); + +$projet = new Project($db); +$projet->fetch($id); +$projet->info($id); +$soc = new Societe($db); +$soc->fetch($projet->socid); + +$head = project_prepare_head($projet); + +dol_fiche_head($head, 'info', $langs->trans("Project"), 0, ($object->public?'projectpub':'project')); + + +print '<table width="100%"><tr><td>'; +dol_print_object_info($projet); +print '</td></tr></table>'; + +print '</div>'; + +llxFooter(); +$db->close();