From 66cf1419ca0e265175fc0182e5f9d8bb5bcdfcc0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Nov 2012 17:48:27 +0100 Subject: [PATCH 1/3] Fix: llx_c_paper_format dictionnary was not up to date. --- .../install/mysql/migration/3.2.0-3.3.0.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index db3968df5d6..d0c921a2584 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -804,5 +804,35 @@ ALTER TABLE llx_c_typent DROP INDEX code, ADD UNIQUE uk_c_typent (code); ALTER TABLE llx_c_effectif DROP INDEX code, ADD UNIQUE uk_c_effectif (code); ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code); + +-- Update dictionnary of table llx_c_paper_format +DELETE FROM llx_c_paper_format; + +-- Europe +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (1, 'EU4A0', 'Format 4A0', '1682', '2378', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (2, 'EU2A0', 'Format 2A0', '1189', '1682', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (3, 'EUA0', 'Format A0', '840', '1189', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (4, 'EUA1', 'Format A1', '594', '840', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (5, 'EUA2', 'Format A2', '420', '594', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (6, 'EUA3', 'Format A3', '297', '420', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (7, 'EUA4', 'Format A4', '210', '297', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (8, 'EUA5', 'Format A5', '148', '210', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (9, 'EUA6', 'Format A6', '105', '148', 'mm', 1); + +-- US +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (100, 'USLetter', 'Format Letter (A)', '216', '279', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (105, 'USLegal', 'Format Legal', '216', '356', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (110, 'USExecutive', 'Format Executive', '190', '254', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (115, 'USLedger', 'Format Ledger/Tabloid (B)', '279', '432', 'mm', 1); + +-- Canadian +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (200, 'CAP1', 'Format Canadian P1', '560', '860', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (205, 'CAP2', 'Format Canadian P2', '430', '560', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (210, 'CAP3', 'Format Canadian P3', '280', '430', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (215, 'CAP4', 'Format Canadian P4', '215', '280', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (220, 'CAP5', 'Format Canadian P5', '140', '215', 'mm', 1); +INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (225, 'CAP6', 'Format Canadian P6', '107', '140', 'mm', 1); + + -- increase field size ALTER TABLE llx_bank_account MODIFY COLUMN code_banque varchar(8); \ No newline at end of file From 6a11016a21e30f8e3200ffd5ac8907510110912d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Nov 2012 18:45:52 +0100 Subject: [PATCH 2/3] Fix: var_dump must be commented --- htdocs/exports/export.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index f96eb57d648..c96ce410864 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -353,7 +353,7 @@ if ($step == 4 && $action == 'submitFormField') if (is_array($objexport->array_export_TypeFields[0])) { $_SESSION["export_FilterValue_fields"]=array(); - var_dump($_POST); + //var_dump($_POST); foreach($objexport->array_export_TypeFields[0] as $code => $type) // $code: s.fieldname $value: Text|Boolean|List:ccc { $newcode=(string) preg_replace('/\./','_',$code); @@ -362,7 +362,7 @@ if ($step == 4 && $action == 'submitFormField') if (! isset($_POST[$newcode]) || $_POST[$newcode] == '') $filterqualified=0; elseif (preg_match('/^List/',$type) && $_POST[$newcode] <= 0) $filterqualified=0; if ($filterqualified) - { + { //print 'Filter on '.$newcode.' type='.$type.' value='.$_POST[$newcode]."\n"; $objexport->array_export_FilterValue[0][$code] = $_POST[$newcode]; } @@ -739,7 +739,7 @@ if ($step == 3 && $datatoexport) print ''; print $form->textwithpicto($text,$htmltext); print ''; - + // Filter value print ''; if (! empty($Typefieldsarray[$code])) @@ -847,7 +847,7 @@ if ($step == 4 && $datatoexport) $list=''; foreach($array_filtervalue as $code=>$value) { - if (isset($objexport->array_export_fields[0][$code])) + if (isset($objexport->array_export_fields[0][$code])) { $list.=($list?', ':''); $list.=$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code])?$array_filtervalue[$code]:'')."'"; @@ -1079,7 +1079,7 @@ if ($step == 5 && $datatoexport) $list=''; foreach($array_filtervalue as $code=>$value) { - if (isset($objexport->array_export_fields[0][$code])) + if (isset($objexport->array_export_fields[0][$code])) { $list.=($list?', ':''); $list.=$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code])?$array_filtervalue[$code]:'')."'"; From 06a8ba2be2fd608383c5d994a32597cf6566d860 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Nov 2012 18:51:49 +0100 Subject: [PATCH 3/3] Fix: for combo list that use text key. --- htdocs/exports/export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index c96ce410864..6eec105a832 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -360,7 +360,7 @@ if ($step == 4 && $action == 'submitFormField') //print 'xxx'.$code."=".$newcode."=".$type."=".$_POST[$newcode]."\n
"; $filterqualified=1; if (! isset($_POST[$newcode]) || $_POST[$newcode] == '') $filterqualified=0; - elseif (preg_match('/^List/',$type) && $_POST[$newcode] <= 0) $filterqualified=0; + elseif (preg_match('/^List/',$type) && (is_numeric($_POST[$newcode]) && $_POST[$newcode] <= 0)) $filterqualified=0; if ($filterqualified) { //print 'Filter on '.$newcode.' type='.$type.' value='.$_POST[$newcode]."\n";