Ajout d'une vérification de désactivation
This commit is contained in:
parent
135394a941
commit
923e6d8db1
@ -3516,17 +3516,26 @@ class Form
|
|||||||
*/
|
*/
|
||||||
function setBarcodeEncoder($selected=0,$code_id,$idForm='formbarcode')
|
function setBarcodeEncoder($selected=0,$code_id,$idForm='formbarcode')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$disable = '';
|
||||||
|
|
||||||
|
// On vérifie si le code de barre est déjà sélectionné par défaut dans le module produit
|
||||||
|
if ($conf->produit->enabled && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id)
|
||||||
|
{
|
||||||
|
$disable = 'disabled="disabled"';
|
||||||
|
}
|
||||||
|
|
||||||
$select_encoder = '<form action="barcode.php" method="post" id="'.$idForm.'">';
|
$select_encoder = '<form action="barcode.php" method="post" id="'.$idForm.'">';
|
||||||
$select_encoder.= '<input type="hidden" name="action" value="update">';
|
$select_encoder.= '<input type="hidden" name="action" value="update">';
|
||||||
$select_encoder.= '<input type="hidden" name="code_id" value="'.$code_id.'">';
|
$select_encoder.= '<input type="hidden" name="code_id" value="'.$code_id.'">';
|
||||||
$select_encoder.= '<select class="flat" name="coder" onChange="barcode_coder_save(\''.$idForm.'\')">';
|
$select_encoder.= '<select class="flat" name="coder" onChange="barcode_coder_save(\''.$idForm.'\')">';
|
||||||
$select_encoder.= '<option value="0"'.($selected==0?' selected="true"':'').'>'.$langs->trans('Disable').'</option>';
|
$select_encoder.= '<option value="0"'.($selected==0?' selected="true"':'').' '.$disable.'>'.$langs->trans('Disable').'</option>';
|
||||||
$select_encoder.= '<option value="-1" disabled="disabled">--------------------</option>';
|
$select_encoder.= '<option value="-1" disabled="disabled">--------------------</option>';
|
||||||
$select_encoder.= '<option value="1"'.($selected==1?' selected="true"':'').'>PHP-Barcode</option>';
|
$select_encoder.= '<option value="1"'.($selected==1?' selected="true"':'').'>PHP-Barcode</option>';
|
||||||
$select_encoder.= '<option value="2"'.($selected==2?' selected="true"':'').'>PI_Barcode</option>';
|
$select_encoder.= '<option value="2"'.($selected==2?' selected="true"':'').'>PI_Barcode</option>';
|
||||||
$select_encoder.= '</select></form>';
|
$select_encoder.= '</select></form>';
|
||||||
|
|
||||||
return $select_encoder;
|
return $select_encoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user