diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 5e0a8b1ffc4..36bdb3f5d59 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2005-2012 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 @@ -29,10 +29,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); $langs->load("admin"); -if (!$user->admin) accessforbidden(); +if (! $user->admin) accessforbidden(); $rowid = GETPOST('rowid','int'); -$action = GETPOST('action'); +$action = GETPOST('action','alpha'); +$errmesg=''; // Definition des positions possibles pour les boites $pos_array = array(0); // Positions possibles pour une boite (0,1,2,...) @@ -396,7 +397,7 @@ foreach($boxactivated as $key => $box) print ''; print ''.img_object("",$logo).' '.$box->boxlabel.''; print '' . ($box->note?$box->note:' ') . ''; - print '' . $pos_name[$box->position] . ''; + print '' . (isset($pos_name[$box->position])?$pos_name[$box->position]:'') . ''; $hasnext=($key < (count($boxactivated)-1)); $hasprevious=($key != 0); print ''.($key+1).''; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 1cb0eb49773..3e995d780be 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -39,7 +39,9 @@ $action=GETPOST('action'); $langs->load("admin"); $langs->load("companies"); -if (!$user->admin) accessforbidden(); +if (! $user->admin) accessforbidden(); + +$message=''; /* @@ -324,7 +326,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''."\n"; // Barcode - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { $var=!$var; print ''.$langs->trans("Gencod").''; @@ -338,7 +340,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; + print ''; print ''; print '
'; print ''; print ''; - if ($mysoc->logo_mini) + if (! empty($mysoc->logo_mini)) { print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) @@ -357,7 +359,7 @@ if ($action == 'edit' || $action == 'updateedit') // Note $var=!$var; print '
'.$langs->trans("Note").''; - print '
'; @@ -394,9 +396,9 @@ if ($action == 'edit' || $action == 'updateedit') { $var=!$var; print ''.$langs->transcountry("ProfId1",$mysoc->country_code).''; - if ($mysoc->country_code) + if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -410,9 +412,9 @@ if ($action == 'edit' || $action == 'updateedit') { $var=!$var; print ''.$langs->transcountry("ProfId2",$mysoc->country_code).''; - if ($mysoc->country_code) + if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -426,9 +428,9 @@ if ($action == 'edit' || $action == 'updateedit') { $var=!$var; print ''.$langs->transcountry("ProfId3",$mysoc->country_code).''; - if ($mysoc->country_code) + if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -442,9 +444,9 @@ if ($action == 'edit' || $action == 'updateedit') { $var=!$var; print ''.$langs->transcountry("ProfId4",$mysoc->country_code).''; - if ($mysoc->country_code) + if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -458,9 +460,9 @@ if ($action == 'edit' || $action == 'updateedit') { $var=!$var; print ''.$langs->transcountry("ProfId5",$mysoc->country_code).''; - if ($mysoc->country_code) + if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -474,9 +476,9 @@ if ($action == 'edit' || $action == 'updateedit') { $var=!$var; print ''.$langs->transcountry("ProfId6",$mysoc->country_code).''; - if ($mysoc->country_code) + if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -488,7 +490,7 @@ if ($action == 'edit' || $action == 'updateedit') // TVA Intra $var=!$var; print ''.$langs->trans("VATIntra").''; - print ''; + print ''; print ''; print ''; @@ -683,7 +685,7 @@ else print ''.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . ''; // Barcode - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { $var=!$var; print ''.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . ''; @@ -715,7 +717,7 @@ else print ''; $var=!$var; - print ''.$langs->trans("Note").'' . nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) . ''; + print ''.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . ''; print ''; @@ -746,10 +748,12 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId1",$mysoc->country_code).''; - if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_SIREN)) { print $conf->global->MAIN_INFO_SIREN; - if ($conf->global->MAIN_INFO_SIREN && $mysoc->country_code == 'FR') print '   '.$langs->trans("Check").''; + if ($mysoc->country_code == 'FR') print '   '.$langs->trans("Check").''; + } else { + print ' '; } print ''; } @@ -759,9 +763,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId2",$mysoc->country_code).''; - if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_SIRET)) { print $conf->global->MAIN_INFO_SIRET; + } else { + print ' '; } print ''; } @@ -771,9 +777,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId3",$mysoc->country_code).''; - if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_APE)) { print $conf->global->MAIN_INFO_APE; + } else { + print ' '; } print ''; } @@ -783,9 +791,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId4",$mysoc->country_code).''; - if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_RCS)) { print $conf->global->MAIN_INFO_RCS; + } else { + print ' '; } print ''; } @@ -795,9 +805,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId5",$mysoc->country_code).''; - if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_PROFID5)) { print $conf->global->MAIN_INFO_PROFID5; + } else { + print ' '; } print ''; } @@ -807,9 +819,11 @@ else { $var=!$var; print ''.$langs->transcountry("ProfId6",$mysoc->country_code).''; - if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') + if (! empty($conf->global->MAIN_INFO_PROFID6)) { print $conf->global->MAIN_INFO_PROFID6; + } else { + print ' '; } print ''; } @@ -818,7 +832,7 @@ else $var=!$var; print ''.$langs->trans("VATIntra").''; print ''; - if ($conf->global->MAIN_INFO_TVAINTRA) + if (! empty($conf->global->MAIN_INFO_TVAINTRA)) { $s=''; $s.=$conf->global->MAIN_INFO_TVAINTRA; @@ -826,7 +840,7 @@ else if (empty($conf->global->MAIN_DISABLEVATCHECK)) { $s.='   '; - if ($conf->use_javascript_ajax) + if (! empty($conf->use_javascript_ajax)) { print "\n"; print '