2005-07-15 16:17:33 +02:00
< ? php
/* Copyright ( C ) 2003 - 2004 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2004 - 2005 Laurent Destailleur < eldy @ users . sourceforge . net >
2006-01-08 14:53:15 +01:00
* Copyright ( C ) 2005 - 2006 Regis Houssin < regis . houssin @ cap - networks . com >
2005-07-15 16:17:33 +02:00
*
* 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 ();
2005-07-15 18:35:08 +02:00
$barcode_encode_type_set = BARCODE_ENCODE_TYPE ;
2005-07-15 16:17:33 +02:00
$typeconst = array ( 'yesno' , 'texte' , 'chaine' );
if ( $_GET [ " action " ] == 'settype' && $user -> admin )
{
2005-07-15 18:35:08 +02:00
if ( dolibarr_set_const ( $db , " BARCODE_ENCODE_TYPE " , $_GET [ " value " ]))
$barcode_encode_type_set = $_GET [ " value " ];
}
/*
2005-07-15 16:17:33 +02:00
$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 );
}
2005-07-15 18:35:08 +02:00
*/
2005-07-15 16:17:33 +02:00
llxHeader ( '' , $langs -> trans ( " BarcodeSetup " ), 'BarcodeConfiguration' );
print_titre ( $langs -> trans ( " BarcodeSetup " ));
/*
* CHOIX ENCODAGE
*/
print '<br>' ;
print_titre ( $langs -> trans ( " BarcodeEncodeModule " ));
print '<table class="noborder" width="100%">' ;
2005-07-15 18:35:08 +02:00
//print '<form action="barcode.php" method="post">';
//print '<input type="hidden" name="action" value="settype">';
2005-07-15 16:17:33 +02:00
print '<tr class="liste_titre">' ;
2005-07-15 18:35:08 +02:00
print '<td>' . $langs -> trans ( " Name " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Description " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Example " ) . '</td>' ;
print '<td align="center" width="60">' . $langs -> trans ( " Default " ) . '</td>' ;
2005-07-15 16:17:33 +02:00
print " </tr> \n " ;
2005-07-15 18:35:08 +02:00
clearstatcache ();
2005-07-16 03:23:10 +02:00
$var = true ;
2005-07-15 18:35:08 +02:00
2006-01-08 15:11:31 +01:00
//EAN8
$var =! $var ;
print '<tr ' . $bc [ $var ] . '><td width="100">' ;
print " EAN8 " ;
print " </td><td> \n " ;
print " L'EAN se compose de 8 caract<63> res, 7 chiffres plus une cl<63> de contr<74> le.<br> " ;
print " L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupr<70> s d'organisme tel que GENCOD.<br> " ;
print " Codes num<75> riques utilis<69> s exclusivement <20> l'identification des produits susceptibles d'<27> tre vendus au grand public. " ;
print '</td>' ;
// Affiche example
print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=1234567&encoding=EAN&scale=1"></td>' ;
print '<td align="center">' ;
if ( $barcode_encode_type_set == " EAN8 " )
{
print img_tick ();
}
else
{
print '<a href="barcode.php?action=settype&value=EAN8">' . $langs -> trans ( " Default " ) . '</a>' ;
}
print " </td></tr> \n " ;
2005-07-15 18:35:08 +02:00
//EAN13
2005-07-16 03:23:10 +02:00
$var =! $var ;
2005-07-15 18:35:08 +02:00
print '<tr ' . $bc [ $var ] . '><td width="100">' ;
print " EAN13 " ;
print " </td><td> \n " ;
2006-01-08 14:53:15 +01:00
print " L'EAN se compose de 13 caract<63> res, 12 chiffres plus une cl<63> de contr<74> le. Il fonctionne de la m<> me mani<6E> re que l'UPC, avec lequel il est compatible.<br> " ;
2006-01-08 15:11:31 +01:00
print " L'utilisation des symbologies EAN13 impose la souscription et l'abonnement aupr<70> s d'organisme tel que GENCOD.<br> " ;
2006-01-08 14:53:15 +01:00
print " Codes num<75> riques utilis<69> s exclusivement <20> l'identification des produits susceptibles d'<27> tre vendus au grand public. " ;
2005-07-15 18:35:08 +02:00
print '</td>' ;
// Affiche example
print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=123456789012&encoding=EAN&scale=1"></td>' ;
print '<td align="center">' ;
if ( $barcode_encode_type_set == " EAN13 " )
{
print img_tick ();
}
else
{
print '<a href="barcode.php?action=settype&value=EAN13">' . $langs -> trans ( " Default " ) . '</a>' ;
}
print " </td></tr> \n " ;
//UPC
2005-07-16 03:23:10 +02:00
$var =! $var ;
print '<tr ' . $bc [ $var ] . '><td width="100">' ;
2005-07-15 18:35:08 +02:00
print " UPC " ;
print " </td><td> \n " ;
2006-01-08 14:53:15 +01:00
print " L'UPC est l'<27> quivalent de l'EAN8/13 pour des pays codificateurs autre que l'Europe.<br> " ;
2006-01-08 15:11:31 +01:00
print " Il ne comporte que 11 chiffres plus la cl<63> .<br> " ;
print " C'est en r<> alit<69> un code EAN13 dont le premier chiffre serait z<> ro et dont la pr<70> sentation serait l<> g<EFBFBD> rement diff<66> rente.<br> " ;
2006-01-08 14:53:15 +01:00
print " Codes num<75> riques utilis<69> s exclusivement <20> l'identification des produits susceptibles d'<27> tre vendus au grand public. " ;
2005-07-15 18:35:08 +02:00
print '</td>' ;
// Affiche example
print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=123456789012&encoding=UPC&scale=1"></td>' ;
print '<td align="center">' ;
if ( $barcode_encode_type_set == " UPC " )
{
print img_tick ();
}
else
{
print '<a href="barcode.php?action=settype&value=UPC">' . $langs -> trans ( " Default " ) . '</a>' ;
}
print " </td></tr> \n " ;
//ISBN
2005-07-16 03:23:10 +02:00
$var =! $var ;
2005-07-15 18:35:08 +02:00
print '<tr ' . $bc [ $var ] . '><td width="100">' ;
print " ISBN " ;
print " </td><td> \n " ;
2006-01-08 14:53:15 +01:00
print " Le code ISBN est un code d<> di<64> au milieu de la presse <20> crite. " ;
2005-07-15 18:35:08 +02:00
print '</td>' ;
// Affiche example
print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=123456789&encoding=ISBN&scale=1"></td>' ;
print '<td align="center">' ;
if ( $barcode_encode_type_set == " ISBN " )
{
print img_tick ();
}
else
{
print '<a href="barcode.php?action=settype&value=ISBN">' . $langs -> trans ( " Default " ) . '</a>' ;
}
print " </td></tr> \n " ;
//code 39
2005-07-16 03:23:10 +02:00
$var =! $var ;
print '<tr ' . $bc [ $var ] . '><td width="100">' ;
print " Code 39 " ;
2005-07-15 18:35:08 +02:00
print " </td><td> \n " ;
2006-01-08 14:53:15 +01:00
print " Premier code alpha num<75> rique utilis<69> massivement dans l'Industrie pour sa capacit<69> d'encodage (chiffres et lettres)<br> " ;
print " ainsi que par son degr<67> de s<> curit<69> <20> l'encodage (clef de contr<74> le).<br> " ;
print " Il met a disposition les 10 chiffres, les 26 lettres de l'alphabet et sept symboles.<br> " ;
print " l'ast<73> risque (*) sert de caract<63> re de bornage. La lecture est bidirectionnelle.<br> " ;
print " La longueur est variable mais en g<> n<EFBFBD> ral ne d<> passe pas 32 caract<63> res. " ;
2005-07-15 18:35:08 +02:00
print '</td>' ;
// Affiche example
print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=1234567890&encoding=39&scale=1"></td>' ;
print '<td align="center">' ;
if ( $barcode_encode_type_set == " code39 " )
{
print img_tick ();
}
else
{
print '<a href="barcode.php?action=settype&value=code39">' . $langs -> trans ( " Default " ) . '</a>' ;
}
print " </td></tr> \n " ;
//code 128
2005-07-16 03:23:10 +02:00
$var =! $var ;
2005-07-15 18:35:08 +02:00
print '<tr ' . $bc [ $var ] . '><td width="100">' ;
print " Code 128 " ;
print " </td><td> \n " ;
2006-01-08 14:53:15 +01:00
print " Ce code \" derni<EFBFBD> re g<> n<EFBFBD> ration \" alpha num<75> rique est susceptible d'encoder les 128 caract<63> res de la table ASCII ( chiffres + lettres + symboles ).<br> " ;
print " Le code 128 poss<73> de des algorithmes de cryptage s<> curis<69> s assez avanc<6E> s.<br> " ;
print " C'est le plus complet des codes <20> barres, il propose 3 jeux de 128 caract<63> res.<br> " ;
print " La lecture est bidirectionnelle.<br> " ;
print " La longueur est variable mais en g<> n<EFBFBD> ral ne d<> passe pas 20 caract<63> res. " ;
2005-07-15 18:35:08 +02:00
print '</td>' ;
// Affiche example
print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=ABCD1234567890&encoding=128&scale=1"></td>' ;
print '<td align="center">' ;
if ( $barcode_encode_type_set == " code128 " )
{
print img_tick ();
}
else
{
print '<a href="barcode.php?action=settype&value=code128">' . $langs -> trans ( " Default " ) . '</a>' ;
}
print " </td></tr> \n " ;
//I25
2005-07-16 03:23:10 +02:00
$var =! $var ;
print '<tr ' . $bc [ $var ] . '><td width="100">' ;
2005-07-15 18:35:08 +02:00
print " I25 " ;
print " </td><td> \n " ;
print " information " ;
print '</td>' ;
// Affiche example
print '<td><img src="http://ns32126.ovh.net/barcode/barcode.php?code=1234567890&encoding=I25&scale=1"></td>' ;
print '<td align="center">' ;
if ( $barcode_encode_type_set == " I25 " )
{
print img_tick ();
}
else
{
print '<a href="barcode.php?action=settype&value=I25">' . $langs -> trans ( " Default " ) . '</a>' ;
}
print " </td></tr> \n " ;
2005-07-15 16:17:33 +02:00
/*
2005-07-15 18:35:08 +02:00
print '<td>' . $langs -> trans ( 'Name' ) . '</td><td>' . $langs -> trans ( 'Description' ) . '</td>' ;
print '<td><input type="submit" value="' . $langs -> trans ( 'Modify' ) . '"></td>' ;
print " </tr> \n " ;
2005-07-15 16:17:33 +02:00
print '<tr ' . $bc [ false ] . '><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"' . ( $compta_mode != 'CREANCES-DETTES' ? ' checked' : '' ) . '> ' . $langs -> trans ( 'OptionModeTrue' ) . '</td>' ;
print '<td colspan="2">' . nl2br ( $langs -> trans ( 'OptionModeTrueDesc' )) . " </td></tr> \n " ;
print '<tr ' . $bc [ true ] . '><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"' . ( $compta_mode == 'CREANCES-DETTES' ? ' checked' : '' ) . '> ' . $langs -> trans ( 'OptionModeVirtual' ) . '</td>' ;
print '<td colspan="2">' . $langs -> trans ( 'OptionModeVirtualDesc' ) . " </td></tr> \n " ;
print '</form>' ;
2005-07-15 18:35:08 +02:00
*/
2005-07-15 16:17:33 +02:00
print " </table> \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 " <table class= \" noborder \" width= \" 100% \" > \n " ;
print " <tr class= \" liste_titre \" > \n " ;
print " <td width= \" 140 \" > " . $langs -> trans ( " Name " ) . " </td> \n " ;
print " <td> " . $langs -> trans ( " Description " ) . " </td> \n " ;
print ' <td align="center" width="60">' . $langs -> trans ( " Activated " ) . " </td> \n " ;
print ' <td align="center" width="60">' . $langs -> trans ( " Default " ) . " </td> \n " ;
print " </tr> \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 " <tr " . $bc [ $var ] . " > \n <td> " ;
print " $name " ;
print " </td> \n <td> \n " ;
require_once ( $dir . $file );
$obj = new $classname ( $db );
print $obj -> description ;
print " </td> \n <td align= \" center \" > \n " ;
if ( in_array ( $name , $def ))
{
print img_tick ();
print " </td> \n <td> " ;
print '<a href="barcode.php?action=del&value=' . $name . '">' . $langs -> trans ( " Disable " ) . '</a>' ;
}
else
{
print " " ;
print " </td> \n <td> " ;
print '<a href="barcode.php?action=set&value=' . $name . '">' . $langs -> trans ( " Activate " ) . '</a>' ;
}
print " </td> \n <td align= \" center \" > " ;
if ( $barcode_addon_var_pdf == " $name " )
{
print img_tick ();
}
else
{
print '<a href="barcode.php?action=setpdf&value=' . $name . '">' . $langs -> trans ( " Activate " ) . '</a>' ;
}
print '</td></tr>' ;
}
}
closedir ( $handle );
print '</table>' ;
*/
print " <br> " ;
$db -> close ();
llxFooter ( '$Date$ - $Revision$' );
?>