Ajout des formats de papier dans le dictionnaire, il me reste complter les formats

This commit is contained in:
Regis Houssin 2007-09-30 17:55:29 +00:00
parent bb14d848c1
commit 6aa83901a1
5 changed files with 79 additions and 5 deletions

View File

@ -478,7 +478,7 @@ if ($_GET["id"])
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit ') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; }
if ($valuetoshow != '')
@ -540,7 +540,7 @@ if ($_GET["id"])
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit ') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; }
// Affiche nom du champ

View File

@ -2943,7 +2943,7 @@ class Form
{
print '<option value="'.($value_as_key?$value:$key).'"';
// Si il faut présélectionner une valeur
if ($id && $id == $key)
if ($id && ($id == $key || $id == $value))
{
print ' selected="true"';
}

View File

@ -1590,4 +1590,17 @@ INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (2, 'EAN
INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (3, 'UPC', 'UPC', 0, '123456789012');
INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (4, 'ISBN', 'ISBN', 0, '123456789');
INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (5, 'C39', 'Code 39', 0, '1234567890');
INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (6, 'C128', 'Code 128', 0, 'ABCD1234567890');
INSERT INTO llx_c_barcode (rowid, code, libelle, coder, example) VALUES (6, 'C128', 'Code 128', 0, 'ABCD1234567890');
--
-- Formats de papier
--
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (1, '4A0', 'Format 4A0', '1682', '2378', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (2, '2A0', 'Format 2A0', '1189', '1682', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (3, 'A0', 'Format A0', '840', '1189', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (4, 'A1', 'Format A1', '594', '840', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (5, 'A2', 'Format A2', '420', '594', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (6, 'A3', 'Format A3', '297', '420', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (7, 'A4', 'Format A4', '210', '297', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (8, 'A5', 'Format A5', '148', '210', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (9, 'A6', 'Format A6', '105', '148', 'mm', 1);

View File

@ -903,4 +903,25 @@ INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (6,
ALTER TABLE llx_product CHANGE gencode barcode varchar(255) DEFAULT NULL;
ALTER TABLE llx_product ADD COLUMN fk_barcode_type integer DEFAULT 0 after barcode;
INSERT INTO llx_const (name, value, type, note, visible) VALUES ('GENBARCODE_LOCATION','/usr/local/bin/genbarcode','chaine','location of genbarcode',0);
INSERT INTO llx_const (name, value, type, note, visible) VALUES ('GENBARCODE_LOCATION','/usr/local/bin/genbarcode','chaine','location of genbarcode',0);
create table llx_c_paper_format
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(16) NOT NULL,
label varchar(50) NOT NULL,
width float(6,2) DEFAULT 0,
height float(6,2) DEFAULT 0,
unit enum('mm','cm','point','inch') NOT NULL,
active tinyint DEFAULT 1 NOT NULL
)type=innodb;
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (1, '4A0', 'Format 4A0', '1682', '2378', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (2, '2A0', 'Format 2A0', '1189', '1682', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (3, 'A0', 'Format A0', '840', '1189', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (4, 'A1', 'Format A1', '594', '840', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (5, 'A2', 'Format A2', '420', '594', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (6, 'A3', 'Format A3', '297', '420', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (7, 'A4', 'Format A4', '210', '297', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (8, 'A5', 'Format A5', '148', '210', 'mm', 1);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (9, 'A6', 'Format A6', '105', '148', 'mm', 1);

View File

@ -0,0 +1,40 @@
-- ========================================================================
-- Copyright (C) 2007 Regis Houssin <regis.houssin@cap-networks.com>
--
-- $Id$
-- $Source$
--
-- 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, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--
-- ========================================================================
create table llx_c_paper_format
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
code varchar(16) NOT NULL,
label varchar(50) NOT NULL,
width float(6,2) DEFAULT 0, -- Largeur du papier
height float(6,2) DEFAULT 0, -- Hauteur du papier
unit enum('mm','cm','point','inch') NOT NULL, -- Unité de mesure
active tinyint DEFAULT 1 NOT NULL
)type=innodb;
--
-- Conversion
--
-- un inch = 2.54 cm
-- 1 point = 1cm * (72/2.54)
-- 1 point = 1mm * (72/25.4)
-- 1 point = 1in * 72