From 9968834f0d0f46246509a372d29abb8b353562bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Oct 2007 13:45:08 +0000 Subject: [PATCH] Normalisation nom table --- htdocs/societe.class.php | 24 ++++++++++++++++++- mysql/migration/2.1.0-2.2.0.sql | 12 ++++++++++ ...x_socstatutlog.sql => llx_societe_log.sql} | 11 +++++---- 3 files changed, 42 insertions(+), 5 deletions(-) rename mysql/tables/{llx_socstatutlog.sql => llx_societe_log.sql} (71%) diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 44f100c2bc2..ad7e0413cbf 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -1836,7 +1836,29 @@ class Societe } return -1; } - + + + + function set_status($id_status) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_log (datel, fk_soc, fk_statut, fk_user, author, label)"; + $sql.= " VALUES ('$dateaction', $socid, $id_status,"; + $sql.= "'".$user->id."',"; + $sql.= "'".addslashes($user->login)."',"; + $sql.= "'Change statut from $oldstcomm to $stcommid'"; + $sql.= ")"; + $result = $db->query($sql); + if ($result) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=$stcommid WHERE rowid=".$socid; + $result = $db->query($sql); + } + else + { + $errmesg = $db->error; + } + } + } ?> diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index 1066eab3d9b..3c38d913c3f 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -949,3 +949,15 @@ update llx_propal set total_ht = price where total_ht = 0 and total > 0; insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (102,'commande','external', 'SHIPPING', 'Contact client livraison commande', 1); +-- Uniformisation du nom. Rem: Cette table n'est pas utilise en lecture a ce jour +drop table llx_socstatutlog; +create table llx_societe_log +( + id integer AUTO_INCREMENT PRIMARY KEY, + datel datetime, + fk_soc integer, + fk_statut integer, + fk_user integer, + author varchar(30), + label varchar(128) +)type=innodb; diff --git a/mysql/tables/llx_socstatutlog.sql b/mysql/tables/llx_societe_log.sql similarity index 71% rename from mysql/tables/llx_socstatutlog.sql rename to mysql/tables/llx_societe_log.sql index 9994243efb3..e92490d12ad 100644 --- a/mysql/tables/llx_socstatutlog.sql +++ b/mysql/tables/llx_societe_log.sql @@ -1,5 +1,6 @@ -- ======================================================================== -- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2007 Laurent Destailleur -- -- $Id$ -- $Source$ @@ -20,11 +21,13 @@ -- -- ======================================================================== -create table llx_socstatutlog +create table llx_societe_log ( id integer AUTO_INCREMENT PRIMARY KEY, datel datetime, - fk_soc integer, - fk_statut integer, - author varchar(30) + fk_soc integer, -- Ne pas mettre de controle d'integrite sur les tables de logs + fk_statut integer, -- Ne pas mettre de controle d'integrite sur les tables de logs + fk_user integer, -- Ne pas mettre de controle d'integrite sur les tables de logs + author varchar(30), + label varchar(128) )type=innodb;