From 136c606f04eab81f602b23a741b7f3b395f31ed7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Sep 2011 12:28:00 +0000 Subject: [PATCH] Qual: Add more phpunit tests --- htdocs/core/ajaxrow.php | 10 ++-- htdocs/core/class/genericobject.class.php | 47 ------------------- .../install/mysql/migration/3.0.0-3.1.0.sql | 4 +- 3 files changed, 7 insertions(+), 54 deletions(-) delete mode 100755 htdocs/core/class/genericobject.class.php diff --git a/htdocs/core/ajaxrow.php b/htdocs/core/ajaxrow.php index 9556a9d3668..89cab9ee45a 100644 --- a/htdocs/core/ajaxrow.php +++ b/htdocs/core/ajaxrow.php @@ -28,7 +28,7 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); require('../main.inc.php'); -require_once(DOL_DOCUMENT_ROOT."/core/class/genericobject.class.php"); +require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); /* @@ -49,7 +49,7 @@ if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['tabl && (isset($_GET['fk_element']) && !empty($_GET['fk_element'])) && (isset($_GET['element_id']) && !empty($_GET['element_id'])) ) { $roworder = explode(',',$_GET['roworder']); - + foreach($roworder as $value) { if (!empty($value)) @@ -57,12 +57,12 @@ if((isset($_GET['roworder']) && !empty($_GET['roworder'])) && (isset($_GET['tabl $newroworder[] = $value; } } - + $roworder = implode(',',$newroworder); - + dol_syslog("AjaxRow roworder=".$_GET['roworder']." neworder=".$roworder." element=".$_GET['element'], LOG_DEBUG); - $row=new GenericObject($db); + $row=new CommonObject($db); $row->table_element_line = $_GET['table_element_line']; $row->fk_element = $_GET['fk_element']; $row->id = $_GET['element_id']; diff --git a/htdocs/core/class/genericobject.class.php b/htdocs/core/class/genericobject.class.php deleted file mode 100755 index 0849f31b0e5..00000000000 --- a/htdocs/core/class/genericobject.class.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/core/class/genericobject.class.php - * \ingroup core - * \brief File of class of generic business class - */ -require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); - - -/** - * \class GenericObject - * \brief Class of a generic business object - */ - -class GenericObject extends CommonObject -{ - var $db; - - /** - * Class constructor - * - * @param DoliDB $db Data base handler access - */ - function GenericObject($db) - { - $this->db=$db; - } - -} - -?> diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql index 1de2e5617aa..efeef1a0df6 100755 --- a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql +++ b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql @@ -58,6 +58,8 @@ ALTER TABLE llx_facture_fourn ADD COLUMN ref_ext varchar(30) AFTER entity; ALTER TABLE llx_commande_fournisseur ADD COLUMN ref_ext varchar(30) AFTER entity; ALTER TABLE llx_adherent ADD COLUMN ref_ext varchar(30) after entity; +ALTER TABLE llx_commande ADD COLUMN fk_demand_reason integer AFTER fk_availability; + ALTER TABLE llx_facturedet DROP INDEX uk_fk_remise_except; ALTER TABLE llx_facturedet ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_except, fk_facture); @@ -111,8 +113,6 @@ INSERT INTO llx_c_availability (rowid,code,label,active) VALUES (2, 'AV_1W', '1 INSERT INTO llx_c_availability (rowid,code,label,active) VALUES (3, 'AV_2W', '2 weeks', 1); INSERT INTO llx_c_availability (rowid,code,label,active) VALUES (4, 'AV_3W', '3 weeks', 1); -ALTER TABLE llx_commande ADD COLUMN fk_demand_reason integer AFTER fk_availability; - ALTER TABLE llx_propaldet ADD INDEX idx_propaldet_fk_product (fk_product); ALTER TABLE llx_commandedet ADD INDEX idx_commandedet_fk_product (fk_product); ALTER TABLE llx_facturedet ADD INDEX idx_facturedet_fk_product (fk_product);