* Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * * 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. * * $Id$ * $Source$ */ /** \file htdocs/admin/barcode.php \ingroup barcode \brief Page d'administration/configuration du module Code barre \version $Revision$ */ require("./pre.inc.php"); $langs->load("admin"); if (!$user->admin) accessforbidden(); if ($_POST["action"] == 'setcoder') { $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type"; $sqlp.= " SET coder = " . $_POST["coder"]; $sqlp.= " WHERE rowid = ". $_POST["code_id"]; $resql=$db->query($sqlp); } else if ($_POST["action"] == 'setgenbarcodelocation') { dolibarr_set_const($db, "GENBARCODE_LOCATION",$_POST["genbarcodelocation"]); Header("Location: barcode.php"); exit; } else if ($_POST["action"] == 'setproductusebarcode') { dolibarr_set_const($db, "PRODUIT_USE_BARCODE",$_POST["value"]); Header("Location: barcode.php"); exit; } $html = new Form($db); llxHeader('',$langs->trans("BarcodeSetup"),'BarcodeConfiguration'); print_fiche_titre($langs->trans("BarcodeSetup"),'','setup'); /* * CHOIX ENCODAGE */ print '
'; print_titre($langs->trans("BarcodeEncodeModule")); print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; $sql = "SELECT rowid, code, libelle, coder, example"; $sql .= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; $var=true; while ($i < $num) { $obj = $db->fetch_object($resql); print ''; // Affiche exemple print ''; print '\n"; $var=!$var; $i++; } } print "
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("CodeBarGenerator").'
'; print $obj->libelle; print "\n"; print $langs->trans('BarcodeDesc'.$obj->code); //print "L'EAN se compose de 8 caractères, 7 chiffres plus une clé de contrôle.
"; //print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement auprès d'organisme tel que GENCOD.
"; //print "Codes numériques utilisés exclusivement à l'identification des produits susceptibles d'être vendus au grand public."; print '
'; if ($obj->coder) { $url=dol_genbarcode($obj->example,$obj->code,$obj->coder); if ($url) print ''; else print $langs->trans("FormatNotSupportedByGenerator"); } else { print $langs->trans("ChooseABarCode"); } print ''; print $html->setBarcodeEncoder($obj->coder,$obj->rowid,'form'.$i); print "
\n"; print "
"; /* * Autres options * */ print_titre($langs->trans("OtherOptions")); $var=true; print ''; print ''; print ''; print ''; print ''; print ''; // Chemin du binaire genbarcode sous linux if (!isset($_ENV['windir']) && !file_exists($_ENV['windir'])) { $var=!$var; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; } // Module produits if ($conf->produit->enabled) { $var=!$var; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; } print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'.$langs->trans("GenbarcodeLocation").''; print ''; print '
'.$langs->trans("UseBarcodeInProductModule").''; print $html->selectyesno('value',$conf->global->PRODUIT_USE_BARCODE,1); print '
'; /* //EAN13 $var=!$var; print ''; print "EAN13"; print "\n"; print "L'EAN se compose de 13 caractères, 12 chiffres plus une clé de contrôle. Il fonctionne de la même manière que l'UPC, avec lequel il est compatible.
"; print "L'utilisation des symbologies EAN13 impose la souscription et l'abonnement auprès d'organisme tel que GENCOD.
"; print "Codes numériques utilisés exclusivement à l'identification des produits susceptibles d'être vendus au grand public."; print ''; // Affiche exemple print ''; print ''; print $html->setBarcodeEncoder('EAN13','form'.$i); print "\n"; $i++; //UPC $var=!$var; print ''; print "UPC"; print "\n"; print "L'UPC est l'équivalent de l'EAN8/13 pour des pays codificateurs autre que l'Europe.
"; print "Il ne comporte que 11 chiffres plus la clé.
"; print "C'est en réalité un code EAN13 dont le premier chiffre serait zéro et dont la présentation serait légérement différente.
"; print "Codes numériques utilisés exclusivement à l'identification des produits susceptibles d'être vendus au grand public."; print ''; // Affiche exemple print ''; print ''; print $html->setBarcodeEncoder('UPC','form'.$i); print "\n"; $i++; //ISBN $var=!$var; print ''; print "ISBN"; print "\n"; print "Le code ISBN est un code dédié au milieu de la presse écrite."; print ''; // Affiche exemple print ''; print ''; print $html->setBarcodeEncoder('ISBN','form'.$i); print "\n"; $i++; //code 39 $var=!$var; print ''; print "Code 39"; print "\n"; print "Premier code alpha numérique utilisé massivement dans l'Industrie pour sa capacité d'encodage (chiffres et lettres)
"; print "ainsi que par son degré de sécurité à l'encodage (clef de contrôle).
"; print "Il met a disposition les 10 chiffres, les 26 lettres de l'alphabet et sept symboles.
"; print "l'astérisque (*) sert de caractère de bornage. La lecture est bidirectionnelle.
"; print "La longueur est variable mais en général ne dépasse pas 32 caractères."; print ''; // Affiche exemple print ''; print ''; print $html->setBarcodeEncoder('C39','form'.$i); print "\n"; $i++; //code 128 $var=!$var; print ''; print "Code 128"; print "\n"; print "Ce code \"dernière génération\" alpha numérique est susceptible d'encoder les 128 caractères de la table ASCII ( chiffres + lettres + symboles ).
"; print "Le code 128 possède des algorithmes de cryptage sécurisés assez avancés.
"; print "C'est le plus complet des codes à barres, il propose 3 jeux de 128 caractères.
"; print "La lecture est bidirectionnelle.
"; print "La longueur est variable mais en général ne dépasse pas 20 caractères."; print ''; // Affiche exemple print ''; print ''; print $html->setBarcodeEncoder('C128','form'.$i); print "\n"; $i++; //I25 $var=!$var; print ''; print "I25"; print "\n"; print "information"; print ''; // Affiche exemple print ''; print ''; print $html->setBarcodeEncoder('I25','form'.$i); print "\n"; $i++; */ print "
"; $db->close(); llxFooter('$Date$ - $Revision$'); ?>