Where is the info tab of project ?

This commit is contained in:
Laurent Destailleur 2016-07-09 15:30:42 +02:00
parent a258663175
commit bfb48ecce9
3 changed files with 123 additions and 0 deletions

View File

@ -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;

View File

@ -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);
}
}
}

69
htdocs/projet/info.php Normal file
View File

@ -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&oacute;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();