From b22a77cde48ee87d9676dc94aa6d753f6922a3c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Feb 2008 17:15:48 +0000 Subject: [PATCH] Fix: A lot of fixes. --- htdocs/actioncomm.class.php | 27 +++++++++++++-------------- htdocs/comm/action/fiche.php | 9 ++++----- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 9f70a3d9152..a6553274b6e 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -2,9 +2,6 @@ /* Copyright (C) 2002-2004 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * - * $Id$ - * $Source$ - * * 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 2 of the License, or @@ -52,8 +49,9 @@ class ActionComm var $usermod; // User that modified action var $datep; // Date action planifie debut (datep) - var $datef; // Date action planifie fin - var $date; // Date action realise completement (datea) + var $datef; // Date action planifie fin (datep2) + var $date; // Date action realise debut (datea) + var $dateend; // Date action realise fin (datea2) var $priority; var $usertodo; // User that must do action @@ -125,7 +123,8 @@ class ActionComm $sql.= "(datec,"; if ($this->datep) $sql.= "datep,"; if ($this->date) $sql.= "datea,"; - $sql.= "fk_action,fk_soc,note,fk_contact,"; + $sql.= "fk_action,fk_soc,note,"; + $sql.= "fk_contact,"; $sql.= "fk_user_author,"; $sql.= "fk_user_action,"; $sql.= "fk_user_done,"; @@ -135,10 +134,10 @@ class ActionComm if ($this->datep) $sql.= "'".$this->db->idate($this->datep)."',"; if ($this->date) $sql.= "'".$this->db->idate($this->date)."',"; $sql.= "'".$this->type_id."', '".$this->societe->id."' ,'".addslashes($this->note)."',"; - $sql.= ($this->contact->id?$this->contact->id:"null").","; + $sql.= ($this->contact->id > 0?"'".$this->contact->id."'":"null").","; $sql.= "'".$author->id."',"; - $sql.= ($this->usertodo->id?"'".$this->usertodo->id."'":"null").","; - $sql.= ($this->userdone->id?"'".$this->userdone->id."'":"null").","; + $sql.= ($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").","; + $sql.= ($this->userdone->id > 0?"'".$this->userdone->id."'":"null").","; $sql.= "'".addslashes($this->label)."','".$this->percentage."','".$this->priority."',"; $sql.= ($this->facid?$this->facid:"null").","; $sql.= ($this->propalrowid?$this->propalrowid:"null").","; @@ -296,15 +295,15 @@ class ActionComm $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; $sql.= " SET percent='".$this->percentage."'"; - if ($this->label) $sql.= ", label = '".addslashes($this->label)."'"; + $sql.= ", label = ".($this->label ? "'".addslashes($this->label)."'":"null"); $sql.= ", datep = ".($this->datep ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql.= ", datea = ".($this->date ? "'".$this->db->idate($this->date)."'" : 'null'); - if ($this->note) $sql.= ", note = '".addslashes($this->note)."'"; - if ($this->contact->id) $sql.= ", fk_contact =". $this->contact->id; + $sql.= ", note = ".($this->note ? "'".addslashes($this->note)."'":"null"); + $sql.= ", fk_contact =". ($this->contact->id > 0 ? "'".$this->contact->id."'":"null"); $sql.= ", priority = '".$this->priority."'"; $sql.= ", fk_user_mod = '".$user->id."'"; - $sql.= ", fk_user_action=".($this->usertodo->id > 0?"'".$this->usertodo->id."'":"null"); - $sql.= ", fk_user_done=".($this->userdone->id > 0?"'".$this->userdone->id."'":"null"); + $sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null"); + $sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null"); $sql.= " WHERE id=".$this->id; dolibarr_syslog("ActionComm::update sql=".$sql); diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 750d78e13fb..dcd108f98be 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -683,10 +683,10 @@ if ($_GET["id"]) print ''; - // Etat + // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").'%'; - // Objet li� + // Object linked if ($act->objet_url) { print ''.$langs->trans("LinkedObject").''; @@ -751,13 +751,12 @@ if ($_GET["id"]) // Affecte a print ''.$langs->trans("ActionAffectedTo").''; - if ($act->usertodo->id) print $act->usertodo->getNomUrl(1); + if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1); print ''; // Realise par print ''.$langs->trans("ActionDoneBy").''; - print $act->userdone->id; - if ($act->userdone->id) print $act->userdone->getNomUrl(1); + if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); print ''; // Date planification