From 8824be02607e8a74523cac79c26c7d5ff9b39e9a Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 9 Nov 2012 16:04:30 +0100 Subject: [PATCH 1/2] Fix : proposal warning was based on proposal date instead of proposal end validity on commercial home page --- htdocs/comm/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index e3df88ec3ce..d290ec43a75 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -473,7 +473,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $langs->load("propal"); - $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp"; + $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -513,7 +513,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print $propalstatic->getNomUrl(1); print ''; print ''; - if ($db->jdate($obj->dp) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ''; print ''; $filename=dol_sanitizeFileName($obj->ref); From 54d466176983e22b3140403eb37f34ca327e1766 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 10 Nov 2012 16:08:26 +0100 Subject: [PATCH 2/2] Fix: missing action type for hookmanager --- htdocs/adherents/class/adherent.class.php | 17 +++++++++-------- htdocs/contact/class/contact.class.php | 7 ++++--- htdocs/product/class/product.class.php | 5 +++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3b9c2d448da..1e8f6dadc18 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2009 Regis Houssin +/* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2009-2012 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 @@ -318,7 +318,7 @@ class Adherent extends CommonObject $this->ref=$id; // Update minor fields - $result=$this->update($user,1,1); // nosync is 1 to avoid update data of user + $result=$this->update($user,1,1,0,0,'add'); // nosync is 1 to avoid update data of user if ($result < 0) { $this->db->rollback(); @@ -390,9 +390,10 @@ class Adherent extends CommonObject * @param int $nosyncuser 0=Synchronize linked user (standard info), 1=Do not synchronize linked user * @param int $nosyncuserpass 0=Synchronize linked user (password), 1=Do not synchronize linked user * @param int $nosyncthirdparty 0=Synchronize linked thirdparty (standard info), 1=Do not synchronize linked thirdparty + * @param string $action Current action for hookmanager * @return int <0 if KO, >0 if OK */ - function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0) + function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0,$action='update') { global $conf, $langs; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d9e7ecda956..0f9758cd427 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -148,7 +148,7 @@ class Contact extends CommonObject if (! $error) { - $result=$this->update($this->id, $user, 1); + $result=$this->update($this->id, $user, 1, 'add'); if ($result < 0) { $error++; @@ -203,10 +203,11 @@ class Contact extends CommonObject * * @param int $id Id of contact/address to update * @param User $user Objet user making change - * @param int $notrigger 0=no, 1=yesi + * @param int $notrigger 0=no, 1=yes + * @param string $action Current action for hookmanager * @return int <0 if KO, >0 if OK */ - function update($id, $user=0, $notrigger=0) + function update($id, $user=0, $notrigger=0, $action='update') { global $conf, $langs; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ba412053ccf..698e4794678 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -326,7 +326,7 @@ class Product extends CommonObject $result = $this->_log_price($user); if ($result > 0) { - if ($this->update($id, $user, true) > 0) + if ($this->update($id, $user, true, 'add') > 0) { // FIXME: not use here /* @@ -404,9 +404,10 @@ class Product extends CommonObject * @param int $id Id of product * @param User $user Object user making update * @param int $notrigger Disable triggers + * @param string $action Current action for hookmanager * @return int 1 if OK, -1 if ref already exists, -2 if other error */ - function update($id, $user, $notrigger=false) + function update($id, $user, $notrigger=false, $action='update') { global $langs, $conf;