From bf4bdd634b22c5cadcc9aed14f83dcd732411993 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 17 Oct 2007 14:55:55 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Le=20pourcentage=20avencement=20des=20ac?= =?UTF-8?q?tions=20n'=E9tait=20plus=20sauv=E9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/actioncomm.class.php | 2 +- htdocs/comm/action/fiche.php | 26 +++++++++++++------------- htdocs/comm/propal.php | 2 +- htdocs/commande/fiche.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/telephonie/client/facture.php | 2 +- mysql/migration/2.1.0-2.2.0.sql | 1 + 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index ca0bad58257..f0741ec4faa 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -128,7 +128,7 @@ class ActionComm $sql.= ($this->orderrowid?$this->orderrowid:"null"); $sql.= ")"; - dolibarr_syslog("ActionComm.class::add sql=".$sql); + dolibarr_syslog("ActionComm::add sql=".$sql); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 1c019f89da3..333a96044ff 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -237,37 +237,37 @@ if ($_POST["action"] == 'update') if ($_POST["adhour"] == -1) $_POST["adhour"]='0'; if ($_POST["admin"] == -1) $_POST["admin"]='0'; - $action = new Actioncomm($db); - $action->fetch($_POST["id"]); + $actioncomm = new Actioncomm($db); + $actioncomm->fetch($_POST["id"]); - $action->datep = @mktime($_POST["aphour"], + $actioncomm->datep = @mktime($_POST["aphour"], $_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); - $action->date = @mktime($_POST["adhour"], + $actioncomm->date = @mktime($_POST["adhour"], $_POST["admin"], 0, $_POST["admonth"], $_POST["adday"], $_POST["adyear"]); //print $_POST["apmonth"].",".$_POST["apday"].",".$_POST["apyear"].",".$_POST["aphour"].",".$_POST["apmin"]."
\n"; - //print $action->datep; - $action->label = $_POST["label"]; - $action->percentage = $_POST["percentage"]; - $action->contact->id = $_POST["contactid"]; - $action->note = $_POST["note"]; - if ($action->type_code == 'AC_RDV' && $action->percentage == 100 && ! $action->date) + //print $actioncomm->datep; + $actioncomm->label = $_POST["label"]; + $actioncomm->percentage = $_POST["percentage"]; + $actioncomm->contact->id = $_POST["contactid"]; + $actioncomm->note = $_POST["note"]; + if ($actioncomm->type_code == 'AC_RDV' && $actioncomm->percentage == 100 && ! $actioncomm->date) { - $action->date = $action->datep; + $actioncomm->date = $actioncomm->datep; } - $result=$action->update(); + $result=$actioncomm->update(); } if ($result < 0) { - $mesg='
'.$action->error.'
'; + $mesg='
'.$actioncomm->error.'
'; $_GET["id"]=$_POST["id"]; } else diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index c7926cd3f8b..1c2bf06e427 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -402,7 +402,7 @@ if ($_POST['action'] == 'send') $actioncomm->label = $actionmsg2; $actioncomm->note = $actionmsg; $actioncomm->date = time(); // L'action est faite maintenant - $actioncomm->percent = 100; + $actioncomm->percentage = 100; $actioncomm->contact = new Contact($db,$sendtoid); $actioncomm->societe = new Societe($db,$propal->socid); $actioncomm->user = $user; // User qui a fait l'action diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index b0af05ecfac..f5dacf0e1e3 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -662,7 +662,7 @@ if ($_POST['action'] == 'send') $actioncomm->label = $actionmsg2; $actioncomm->note = $actionmsg; $actioncomm->date = time(); // L'action est faite maintenant - $actioncomm->percent = 100; + $actioncomm->percentage = 100; $actioncomm->contact = new Contact($db,$sendtoid); $actioncomm->societe = new Societe($db,$commande->socid); $actioncomm->user = $user; // User qui a fait l'action diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d2bc1eb93c2..ea39fe18cca 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1027,7 +1027,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['c $actioncomm->label = $actionmsg2; $actioncomm->note = $actionmsg; $actioncomm->date = time(); // L'action est faite maintenant - $actioncomm->percent = 100; + $actioncomm->percentage = 100; $actioncomm->contact = new Contact($db,$sendtoid); $actioncomm->societe = new Societe($db,$fac->socid); $actioncomm->user = $user; // User qui a fait l'action diff --git a/htdocs/telephonie/client/facture.php b/htdocs/telephonie/client/facture.php index 9f41b4f0ac0..8bb9a03b3f2 100644 --- a/htdocs/telephonie/client/facture.php +++ b/htdocs/telephonie/client/facture.php @@ -142,7 +142,7 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') $actioncomm->label = $actionmsg2; $actioncomm->note = $actionmsg; $actioncomm->date = time(); - $actioncomm->percent = 100; + $actioncomm->percentage = 100; $actioncomm->contact = new Contact($db,$sendtoid); $actioncomm->societe = new Societe($db,$fac->socid); $actioncomm->user = $user; // User qui a fait l'action diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index 22401736fc0..a7449aaae7a 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -34,6 +34,7 @@ update llx_rights_def set libelle='Cr alter table llx_paiement drop column author; update llx_actioncomm set fk_action = 9 where fk_action = 10; +update llx_actioncomm set percent = 100 where percent = 0 and datea is not null; ALTER TABLE llx_cotisation ADD COLUMN datef date after dateadh; ALTER TABLE llx_cotisation modify datef date;