Skip to content
Snippets Groups Projects
Commit 3ab1c569 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: project id is lost

parent c17d4059
No related branches found
No related tags found
No related merge requests found
<?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
*
* 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 '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';
$numprojet=select_projects($societe->id,$projetid,'projetidp');
$numprojet=select_projects($societe->id,$_POST["projectid"],'projectid');
if ($numprojet==0)
{
print ' &nbsp; <a href="../projet/fiche.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
......@@ -573,11 +573,11 @@ elseif ($fichinterid)
print '</td><td colspan="3">';
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 '</td>';
print '</tr>';
......@@ -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)
{
......
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
*
* 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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment