diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 7c9c8aa2ef1..e0a4bc85f0e 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -46,17 +46,20 @@ $boxes = array(); */ if ($action == 'addconst') - { dolibarr_set_const($db, "MAIN_BOXES_MAXLINES",$_POST["MAIN_BOXES_MAXLINES"],'',0,'',$conf->entity); } -if ($action == 'add') { +if ($action == 'add') +{ $error=0; $db->begin(); - if (isset($_POST['boxid']) && is_array($_POST['boxid'])) { - foreach($_POST['boxid'] as $boxid) { - if ($boxid['active']=='on') { + if (isset($_POST['boxid']) && is_array($_POST['boxid'])) + { + foreach($_POST['boxid'] as $boxid) + { + if (is_numeric($boxid['pos']) && $boxid['pos'] >= 0) // 0=Home, 1=... + { $pos = $boxid['pos']; // Initialize distinct fkuser with all already existing values of fk_user (user that use a personalized view of boxes for page "pos") @@ -330,7 +333,7 @@ print ''; print ''.$langs->trans("Box").''; print ''.$langs->trans("Note").'/'.$langs->trans("Parameters").''; print ''.$langs->trans("SourceFile").''; -print ''.$langs->trans("ActivateOn").''; +print ''.$langs->trans("ActivateOn").''; print "\n"; $var=true; foreach($boxtoadd as $box) @@ -363,17 +366,17 @@ foreach($boxtoadd as $box) // Pour chaque position possible, on affiche un lien d'activation si boite non deja active pour cette position print ''; - print $form->selectarray("boxid[".$box->box_id."][pos]",$pos_name,0,0,0,0,'',1)."\n"; + print $form->selectarray("boxid[".$box->box_id."][pos]", $pos_name, 0, 1, 0, 0, '', 1)."\n"; print ''."\n"; - print ''."\n"; + //print ''."\n"; print ''; print ''."\n"; } print ''."\n"; -print '
'; -print ''; +print '
'; +print ''; print '
'."\n"; print ''; print "\n".''."\n";