diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index afef8f26794..f1f45da3d37 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2010 Regis Houssin * * 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 @@ -138,7 +138,7 @@ if ($_POST["action"] == 'add') $fichinter->socid = $_POST["socid"]; $fichinter->duree = $_POST["duree"]; - $fichinter->projet_id = $_POST["projetidp"]; + $fichinter->project_id = $_POST["projectid"]; $fichinter->author = $user->id; $fichinter->description = $_POST["description"]; $fichinter->ref = $_POST["ref"]; @@ -170,7 +170,7 @@ if ($_POST["action"] == 'update') $fichinter = new Fichinter($db); $fichinter->socid = $_POST["socid"]; - $fichinter->projet_id = $_POST["projetidp"]; + $fichinter->project_id = $_POST["projectid"]; $fichinter->author = $user->id; $fichinter->description = $_POST["description"]; $fichinter->ref = $_POST["ref"]; @@ -212,7 +212,7 @@ if ($_POST['action'] == 'classin') { $fichinter = new Fichinter($db); $fichinter->fetch($_GET['id']); - $result=$fichinter->setProject($_POST['projetid']); + $result=$fichinter->setProject($_POST['projectid']); if ($result < 0) dol_print_error($db,$fichinter->error); } @@ -453,7 +453,7 @@ if ($_GET["action"] == 'create') $langs->load("project"); print ''.$langs->trans("Project").''; - $numprojet=select_projects($societe->id,$projetid,'projetidp'); + $numprojet=select_projects($societe->id,$_POST["projectid"],'projectid'); if ($numprojet==0) { print '   '.$langs->trans("AddProject").''; @@ -573,11 +573,11 @@ elseif ($fichinterid) print ''; if ($_GET['action'] == 'classin') { - $html->form_project($_SERVER['PHP_SELF'].'?id='.$fichinter->id, $fichinter->socid, $fichinter->projetidp,'projetid'); + $html->form_project($_SERVER['PHP_SELF'].'?id='.$fichinter->id, $fichinter->socid, $fichinter->project_id,'projetid'); } else { - $html->form_project($_SERVER['PHP_SELF'].'?id='.$fichinter->id, $fichinter->socid, $fichinter->projetidp,'none'); + $html->form_project($_SERVER['PHP_SELF'].'?id='.$fichinter->id, $fichinter->socid, $fichinter->project_id,'none'); } print ''; print ''; @@ -622,12 +622,12 @@ elseif ($fichinterid) /* * Lignes d'intervention */ - $sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang'; $sql.= ', '.$db->pdate('ft.date').' as date_intervention'; $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft'; $sql.= ' WHERE ft.fk_fichinter = '.$fichinterid; $sql.= ' ORDER BY ft.rang ASC, ft.rowid'; + $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php index 259196bb8ab..76f89900c46 100644 --- a/htdocs/fichinter/fichinter.class.php +++ b/htdocs/fichinter/fichinter.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2010 Regis Houssin * * 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 @@ -54,7 +54,7 @@ class Fichinter extends CommonObject var $description; var $note_private; var $note_public; - var $projet_id; + var $project_id; var $modelpdf; var $lignes = array(); @@ -122,7 +122,7 @@ class Fichinter extends CommonObject $sql.= ", ".$this->author; $sql.= ", '".addslashes($this->description)."'"; $sql.= ", '".$this->modelpdf."'"; - $sql.= ", ".($this->projet_id ? $this->projet_id : 0); + $sql.= ", ".($this->project_id ? $this->project_id : 0); $sql.= ")"; dol_syslog("Fichinter::create sql=".$sql); @@ -152,9 +152,9 @@ class Fichinter extends CommonObject global $conf; if (! is_numeric($this->duree)) { $this->duree = 0; } - if (! strlen($this->projet_id)) + if (! strlen($this->project_id)) { - $this->projet_id = 0; + $this->project_id = 0; } /* @@ -163,7 +163,7 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET "; $sql.= ", description = '".addslashes($this->description)."'"; $sql.= ", duree = ".$this->duree; - $sql.= ", fk_projet = ".$this->projet_id; + $sql.= ", fk_projet = ".$this->project_id; $sql.= " WHERE rowid = ".$id; $sql.= " AND entity = ".$conf->entity; @@ -211,8 +211,7 @@ class Fichinter extends CommonObject $this->datec = $this->db->jdate($obj->datec); $this->datev = $this->db->jdate($obj->datev); $this->datem = $this->db->jdate($obj->datem); - $this->projetidp = $obj->fk_projet; - $this->projet_id = $obj->fk_projet; + $this->project_id = $obj->fk_projet; $this->note_public = $obj->note_public; $this->note_private = $obj->note_private; $this->modelpdf = $obj->model_pdf;