diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index c0f895d7b15..496c8bdca3d 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -153,7 +153,9 @@ llxHeader('', $langs->trans("Project"), "Project"); $html = new Form($db); $formcompany= new FormCompany($db); + $contactstatic=new Contact($db); +$userstatic=new User($db); /* *************************************************************************** */ @@ -172,14 +174,14 @@ if ($id > 0 || ! empty($ref)) if ( $project->fetch($id,$ref) > 0) { if ($project->societe->id > 0) $result=$project->societe->fetch($project->societe->id); - + // To verify role of users $userAccess = 0; foreach(array('internal','external') as $source) { $userRole = $project->liste_contact(4,$source); $num=sizeof($userRole); - + $i = 0; while ($i < $num) { @@ -217,6 +219,34 @@ if ($id > 0 || ! empty($ref)) else print ' '; print ''; + // Project leader + print '
| '.$langs->trans("DateEnd").' | '; print dol_print_date($project->date_end,'day'); print ' | '.$langs->trans("Description").' | '; print nl2br($project->description); diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index 1d609f0b36d..f5c234063c0 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -80,15 +80,17 @@ if ($_POST['action'] == 'update_private' && $user->rights->projet->creer) } - -/******************************************************************************/ -/* Affichage fiche */ -/******************************************************************************/ +/* + * View + */ llxHeader(); $html = new Form($db); +$userstatic=new User($db); + + $id = $_GET['id']; $ref= $_GET['ref']; if ($id > 0 || ! empty($ref)) @@ -99,18 +101,18 @@ if ($id > 0 || ! empty($ref)) $project = new Project($db); $userstatic = new User($db); - + if ($project->fetch($id, $ref)) { if ($project->societe->id > 0) $result=$project->societe->fetch($project->societe->id); - + // To verify role of users $userAccess = 0; foreach(array('internal','external') as $source) { $userRole = $project->liste_contact(4,$source); $num=sizeof($userRole); - + $i = 0; while ($i < $num) { @@ -121,7 +123,7 @@ if ($id > 0 || ! empty($ref)) $i++; } } - + $head = project_prepare_head($project); dol_fiche_head($head, 'note', $langs->trans('Project'), 0, 'project'); @@ -133,7 +135,7 @@ if ($id > 0 || ! empty($ref)) print ' |
| '.$langs->trans("Ref").' | '; print $html->showrefnav($project,'ref','',1,'ref','ref'); print ' | ||
| '.$langs->trans("Label").' | '.$project->title.' | ||
| '.$langs->trans("OfficerProject").' | '; $contact = $project->liste_contact(4,'internal'); @@ -168,6 +170,9 @@ if ($id > 0 || ! empty($ref)) } print ' | ||
| '.$langs->trans("Status").' | '.$project->getLibStatut(4).' | ||
| '.$langs->trans("NotePublic").' : | '; print ''; diff --git a/htdocs/projet/project.class.php b/htdocs/projet/project.class.php index fd7f5daaa6d..d2d97345bba 100644 --- a/htdocs/projet/project.class.php +++ b/htdocs/projet/project.class.php @@ -48,7 +48,8 @@ class Project extends CommonObject var $date_start; var $date_end; var $socid; - var $user_resp_id; + var $user_author_id; //!< Id of project creator. Not defined if shared project. + var $user_resp_id; //!< Id of project responsible. Not defined if shared project. var $note_private; var $note_public; @@ -68,7 +69,7 @@ class Project extends CommonObject $this->statuts=array(0=>'Draft',1=>'Validated',2=>'Closed'); } - /* + /** * \brief Cree un projet en base * \param user Id utilisateur qui cree * \return int <0 si ko, id du projet cree si ok @@ -97,7 +98,7 @@ class Project extends CommonObject $sql.= ", '".addslashes($this->title)."'"; $sql.= ", '".addslashes($this->description)."'"; $sql.= ", ".($this->socid > 0?$this->socid:"null"); - $sql.= ", ".($this->user_resp_id>0?$this->user_resp_id:'null'); + $sql.= ", ".$user->id; $sql.= ", ".($this->datec!=''?$this->db->idate($this->datec):'null'); $sql.= ", ".($this->dateo!=''?$this->db->idate($this->dateo):'null'); $sql.= ", ".($this->datee!=''?$this->db->idate($this->datee):'null'); | ||