* Copyright (C) 2004-2005 Laurent Destailleur * Copyright (C) 2005 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"); $langs->load("bills"); if (!$user->admin) accessforbidden(); $barcode_encode_type_set = BARCODE_ENCODE_TYPE; $typeconst=array('yesno','texte','chaine'); if ($_GET["action"] == 'settype' && $user->admin) { if (dolibarr_set_const($db, "BARCODE_ENCODE_TYPE",$_GET["value"])) $barcode_encode_type_set = $_GET["value"]; } /* $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'BARCODE_ENCODE_TYPE';"; $db->query($sql); $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible) VALUES ('BARCODE_ENCODE_TYPE','".$_POST["host"]."',0);"; $db->query($sql); } */ llxHeader('',$langs->trans("BarcodeSetup"),'BarcodeConfiguration'); print_titre($langs->trans("BarcodeSetup")); /* * CHOIX ENCODAGE */ print '
'; print_titre($langs->trans("BarcodeEncodeModule")); print ''; //print ''; //print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; clearstatcache(); $var=true; //EAN13 $var=!$var; print ''; // Affiche example print ''; print '\n"; //UPC $var=!$var; print ''; // Affiche example print ''; print '\n"; //ISBN $var=!$var; print ''; // Affiche example print ''; print '\n"; //code 39 $var=!$var; print ''; // Affiche example print ''; print '\n"; //code 128 $var=!$var; print ''; // Affiche example print ''; print '\n"; //I25 $var=!$var; print ''; // Affiche example print ''; print '\n"; /* print ''; print ''; print "\n"; print ''; print '\n"; print ''; print '\n"; print ''; */ print "
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Default").'
'; print "EAN13"; print "\n"; print "information"; print ''; if ($barcode_encode_type_set == "EAN13") { print img_tick(); } else { print ''.$langs->trans("Default").''; } print "
'; print "UPC"; print "\n"; print "information"; print ''; if ($barcode_encode_type_set == "UPC") { print img_tick(); } else { print ''.$langs->trans("Default").''; } print "
'; print "ISBN"; print "\n"; print "information"; print ''; if ($barcode_encode_type_set == "ISBN") { print img_tick(); } else { print ''.$langs->trans("Default").''; } print "
'; print "Code 39"; print "\n"; print "information"; print ''; if ($barcode_encode_type_set == "code39") { print img_tick(); } else { print ''.$langs->trans("Default").''; } print "
'; print "Code 128"; print "\n"; print "information"; print ''; if ($barcode_encode_type_set == "code128") { print img_tick(); } else { print ''.$langs->trans("Default").''; } print "
'; print "I25"; print "\n"; print "information"; print ''; if ($barcode_encode_type_set == "I25") { print img_tick(); } else { print ''.$langs->trans("Default").''; } print "
'.$langs->trans('Name').''.$langs->trans('Description').'
'.$langs->trans('OptionModeTrue').''.nl2br($langs->trans('OptionModeTrueDesc'))."
'.$langs->trans('OptionModeVirtual').''.$langs->trans('OptionModeVirtualDesc')."
\n"; /* * FORMAT PAPIER */ /* print_titre($langs->trans("PaperFormatModule")); $def = array(); $sql = "SELECT nom FROM ".MAIN_DB_PREFIX."barcode_format_paper_model_pdf"; $resql=$db->query($sql); if ($resql) { $i = 0; $num_rows=$db->num_rows($resql); while ($i < $num_rows) { $array = $db->fetch_array($resql); array_push($def, $array[0]); $i++; } } else { dolibarr_print_error($db); } $dir = "../includes/modules/formatpaper/"; print "\n"; print "\n"; print " \n"; print " \n"; print ' \n"; print ' \n"; print "\n"; clearstatcache(); $handle=opendir($dir); $var=true; while (($file = readdir($handle))!==false) { if (substr($file, strlen($file) -12) == '.modules.php' && substr($file,0,12) == 'pdf_paper_') { $name = substr($file, 12, strlen($file) - 24); $classname = substr($file, 0, strlen($file) -12); $var=!$var; print "\n \n \n \n \n \n '; } } closedir($handle); print '
".$langs->trans("Name")."".$langs->trans("Description")."'.$langs->trans("Activated")."'.$langs->trans("Default")."
"; print "$name"; print "\n"; require_once($dir.$file); $obj = new $classname($db); print $obj->description; print "\n"; if (in_array($name, $def)) { print img_tick(); print ""; print ''.$langs->trans("Disable").''; } else { print " "; print ""; print ''.$langs->trans("Activate").''; } print ""; if ($barcode_addon_var_pdf == "$name") { print img_tick(); } else { print ''.$langs->trans("Activate").''; } print '
'; */ print "
"; $db->close(); llxFooter('$Date$ - $Revision$'); ?>