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 a1f3d8773b7..3e995d780be 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -326,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").''; @@ -340,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)) @@ -359,7 +359,7 @@ if ($action == 'edit' || $action == 'updateedit') // Note $var=!$var; print '
'.$langs->trans("Note").''; - print '
'; @@ -396,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 { @@ -412,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 { @@ -428,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 { @@ -444,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 { @@ -460,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 { @@ -476,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 { @@ -490,7 +490,7 @@ if ($action == 'edit' || $action == 'updateedit') // TVA Intra $var=!$var; print ''.$langs->trans("VATIntra").''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 14b16f69f49..1150949c7c6 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -33,9 +33,11 @@ $langs->load("contracts"); $langs->load("bills"); $langs->load("banks"); -if (!$user->admin) accessforbidden(); +if (! $user->admin) accessforbidden(); -if ( (isset($_POST["action"]) && $_POST["action"] == 'update')) +$action=GETPOST('action','alpha'); + +if ($action == 'update') { //Conversion des jours en secondes if ($_POST["ActionsToDo"]) dolibarr_set_const($db, "MAIN_DELAY_ACTIONS_TODO",$_POST["ActionsToDo"],'chaine',0,'',$conf->entity); @@ -71,7 +73,7 @@ $form = new Form($db); $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) +if ($action == 'edit') { print '
'; print ''; @@ -82,7 +84,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceBeforeWarning").''.$langs->trans("Value").''; // - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { $var=!$var; print ''; @@ -90,7 +92,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceActionsToDo").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { $var=!$var; print ''; @@ -98,7 +100,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceOrdersToProcess").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ''; @@ -106,7 +108,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceSuppliersOrdersToProcess").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $var=!$var; print ''; @@ -114,7 +116,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfTolerancePropalsToClose").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $var=!$var; print ''; @@ -122,7 +124,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfTolerancePropalsToBill").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { $var=!$var; print ''; @@ -130,7 +132,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceNotActivatedServices").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { $var=!$var; print ''; @@ -138,7 +140,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceRunningServices").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { $var=!$var; print ''; @@ -146,7 +148,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceCustomerBillsUnpaid").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ''; @@ -154,7 +156,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceSupplierBillsToPay").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { $var=!$var; print ''; @@ -167,7 +169,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) print ''.$langs->trans("DelaysOfToleranceChequesToDeposit").''; print ' ' . $langs->trans("days") . ''; } - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $var=!$var; print ''; @@ -186,7 +188,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')) $var=!$var; print ''; - print ''.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',$conf->global->MAIN_DISABLE_METEO,1) . ''; + print ''.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',(isset($conf->global->MAIN_DISABLE_METEO)?1:0),1) . ''; print ''; @@ -209,14 +211,14 @@ else $var=!$var; - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { print ''; print ''.img_object('','action').''; print ''.$langs->trans("DelaysOfToleranceActionsToDo").'' . ($conf->global->MAIN_DELAY_ACTIONS_TODO+0) . ' ' . $langs->trans("days") . ''; } - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { $var=!$var; print ''; @@ -224,7 +226,7 @@ else print ''.$langs->trans("DelaysOfToleranceOrdersToProcess").'' . ($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS+0) . ' ' . $langs->trans("days") . ''; } - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ''; @@ -232,7 +234,7 @@ else print ''.$langs->trans("DelaysOfToleranceSuppliersOrdersToProcess").'' . ($conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS+0) . ' ' . $langs->trans("days") . ''; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $var=!$var; print ''; @@ -240,7 +242,7 @@ else print ''.$langs->trans("DelaysOfTolerancePropalsToClose").'' . ($conf->global->MAIN_DELAY_PROPALS_TO_CLOSE+0). ' ' . $langs->trans("days") . ''; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $var=!$var; print ''; @@ -248,7 +250,7 @@ else print ''.$langs->trans("DelaysOfTolerancePropalsToBill").'' . ($conf->global->MAIN_DELAY_PROPALS_TO_BILL+0) . ' ' . $langs->trans("days") . ''; } - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { $var=!$var; print ''; @@ -256,7 +258,7 @@ else print ''.$langs->trans("DelaysOfToleranceNotActivatedServices").'' . ($conf->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES+0) . ' ' . $langs->trans("days") . ''; } - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { $var=!$var; print ''; @@ -264,7 +266,7 @@ else print ''.$langs->trans("DelaysOfToleranceRunningServices").'' . ($conf->global->MAIN_DELAY_RUNNING_SERVICES+0). ' ' . $langs->trans("days") . ''; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { $var=!$var; print ''; @@ -272,7 +274,7 @@ else print ''.$langs->trans("DelaysOfToleranceCustomerBillsUnpaid").'' . ($conf->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED+0) . ' ' . $langs->trans("days") . ''; } - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ''; @@ -280,7 +282,7 @@ else print ''.$langs->trans("DelaysOfToleranceSupplierBillsToPay").'' . ($conf->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY+0) . ' ' . $langs->trans("days") . ''; } - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { $var=!$var; print ''; @@ -293,7 +295,7 @@ else print ''.$langs->trans("DelaysOfToleranceChequesToDeposit").'' . ($conf->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT+0) . ' ' . $langs->trans("days") . ''; } - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $var=!$var; print ''; @@ -368,7 +370,7 @@ print ''; print ''; -$db->close(); llxFooter(); +$db->close(); ?> diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 3be1da76b8b..eccc9ccdcad 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -208,7 +208,7 @@ if ($action == 'edit') // Edit print ''; print ' '; print ''; - + // Hide unauthorized button $var=!$var; print ''.$langs->trans("ButtonHideUnauthorized").''; @@ -238,7 +238,7 @@ if ($action == 'edit') // Edit print ''.$langs->trans("MessageLogin").''; // Editeur wysiwyg require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); - $doleditor=new DolEditor('main_home',$conf->global->MAIN_HOME,'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90); + $doleditor=new DolEditor('main_home',(isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''),'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90); $doleditor->Create(); print ''."\n"; @@ -246,7 +246,7 @@ if ($action == 'edit') // Edit $var=!$var; print ''.$langs->trans("MessageOfDay").''; require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); - $doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90); + $doleditor=new DolEditor('main_motd',(isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''),'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90); $doleditor->Create(); print ''."\n"; @@ -366,35 +366,37 @@ else // Show print ''; print ' '; print ''; - + // Hide unauthorized button $var=!$var; print ''.$langs->trans("ButtonHideUnauthorized").''; - print yn($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED,1); + print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1); print ''; // Link to help center $var=!$var; print ''.$langs->trans("DisableLinkToHelpCenter").''; - print yn($conf->global->MAIN_HELPCENTER_DISABLELINK,1); + print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1); print ''; // Link to wiki help $var=!$var; - print ''.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img//helpdoc.png','',1)).''; - print yn($conf->global->MAIN_HELP_DISABLELINK,1); + print ''.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).''; + print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1); print ''; // Message login $var=!$var; print ''.$langs->trans("MessageLogin").''; - print dol_htmlcleanlastbr($conf->global->MAIN_HOME); + if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME); + else print ' '; print ''."\n"; // Message of the day $var=!$var; print ''.$langs->trans("MessageOfDay").''; - print dol_htmlcleanlastbr($conf->global->MAIN_MOTD); + if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD); + else print ' '; print ''."\n"; /* @@ -415,7 +417,6 @@ else // Show } -$db->close(); - llxFooter(); -?> +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 914d4e66abb..bfc9a74ac97 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -37,7 +37,7 @@ $langs->load("users"); $langs->load("other"); // Security check -if (!$user->admin) accessforbidden(); +if (! $user->admin) accessforbidden(); $dirstandard = array(); $dirsmartphone = array(); @@ -48,6 +48,9 @@ foreach($dirmenus as $dirmenu) $dirsmartphone[]=$dirmenu.'smartphone'; } +$error=0; +$errmsgs=array(); + // Cette page peut etre longue. On augmente le delai autorise. // Ne fonctionne que si on est pas en safe_mode. @@ -80,7 +83,6 @@ if ($action == 'update' && empty($_POST["cancel"])) if (isset($_POST["MAIN_MENUFRONT_SMARTPHONE"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENUFRONT_SMARTPHONE"])]=1; // Initialize menu handlers - $error=0; $errmsgs=array(); foreach ($listofmenuhandler as $key => $val) { // Load sql init_menu_handler.sql file @@ -154,7 +156,7 @@ print $langs->trans("MenusDesc")."
\n"; print "
\n"; -if (isset($_GET["action"]) && $_GET["action"] == 'edit') +if ($action == 'edit') { print ''; print ''; @@ -240,8 +242,8 @@ else print ''; $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED)); print $filelib; - if (preg_match('/smartphone/',$conf->global->MAIN_MENU_SMARTPHONE_FORCED) - || (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/',$conf->global->MAIN_MENU_SMARTPHONE))) + if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE_FORCED) + || (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/',$conf->global->MAIN_MENU_SMARTPHONE))) { print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme")); } @@ -249,8 +251,8 @@ else print ''; $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)); print $filelib; - if (preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) - || (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE))) + if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) + || (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE))) { print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme")); } @@ -266,7 +268,7 @@ print ''; dol_htmloutput_errors('',$errmsgs); -if (! isset($_GET["action"]) || $_GET["action"] != 'edit') +if ($action != 'edit') { print '
'; print ''.$langs->trans("Modify").''; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 193247fe8da..7dd3a5e805d 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2007-2012 Laurent Destailleur - * Copyright (C) 2009-2011 Regis Houssin + * Copyright (C) 2009-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 @@ -41,7 +41,9 @@ foreach($dirmenus as $dirmenu) $dirsmartphone[]=$dirmenu.'smartphone'; } -$mesg=$_GET["mesg"]; +$action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); +$mesg=GETPOST('mesg'); $menu_handler_top=$conf->global->MAIN_MENU_STANDARD; $menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE; @@ -52,15 +54,15 @@ $menu_handler_smartphone=preg_replace('/_frontoffice.php/i','',$menu_handler_sma $menu_handler=$menu_handler_top; -if ($_REQUEST["handler_origine"]) $menu_handler=$_REQUEST["handler_origine"]; -if ($_REQUEST["menu_handler"]) $menu_handler=$_REQUEST["menu_handler"]; +if (isset($_REQUEST["handler_origine"])) $menu_handler=$_REQUEST["handler_origine"]; +if (isset($_REQUEST["menu_handler"])) $menu_handler=$_REQUEST["menu_handler"]; /* * Actions */ -if (isset($_GET["action"]) && ($_GET["action"] == 'up')) +if ($action == 'up') { $current=array(); $previous=array(); @@ -116,7 +118,7 @@ if (isset($_GET["action"]) && ($_GET["action"] == 'up')) $db->query($sql); } -if (isset($_GET["action"]) && $_GET["action"] == 'down') +elseif ($action == 'down') { $current=array(); $next=array(); @@ -172,7 +174,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'down') $db->query($sql); } -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') +elseif ($action == 'confirm_delete' && $confirm == 'yes') { $db->begin(); @@ -191,7 +193,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') $db->rollback(); $reload = 0; - $_GET["action"]=''; + $action=''; } } @@ -237,7 +239,7 @@ print "
\n"; // Confirmation for remove menu entry -if ($_GET["action"] == 'delete') +if ($action == 'delete') { $sql = "SELECT m.titre"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; @@ -341,8 +343,8 @@ else print '
'.$langs->trans("ErrorFeatureNeedJavascript").'
'; } -$db->close(); - print '
'; -llxFooter(); \ No newline at end of file +llxFooter(); +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index cd4d6153bb5..41168160d31 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-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 @@ -28,33 +28,35 @@ $langs->load("users"); $langs->load("admin"); $langs->load("other"); -if (!$user->admin) accessforbidden(); +if (! $user->admin) accessforbidden(); + +$action=GETPOST('action','alpha'); /* * Actions */ -if ($_GET["action"] == 'activate_hidemenu') +if ($action == 'activate_hidemenu') { dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1','chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]); exit; } -else if ($_GET["action"] == 'disable_hidemenu') +else if ($action == 'disable_hidemenu') { dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]); exit; } -if ($_GET["action"] == 'activate_layoutmenu') +if ($action == 'activate_layoutmenu') { dolibarr_set_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT", '1','chaine',0,'',$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]); exit; } -else if ($_GET["action"] == 'disable_layoutmenu') +else if ($action == 'disable_layoutmenu') { dolibarr_del_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT",$conf->entity); Header("Location: ".$_SERVER["PHP_SELF"]); @@ -106,11 +108,11 @@ $var=!$var; print ""; print ''.$langs->trans("HideUnauthorizedMenu").''; print ''; -if ($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED == 0) +if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } -if($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED == 1) +else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } @@ -118,17 +120,17 @@ print ""; print ''; // Use a flip-hide menu -if ($conf->global->MAIN_FEATURES_LEVEL > 0) +if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0) { $var=!$var; print ""; print ''.$langs->trans("MenuUseLayout").''; print ''; - if ($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT == 0) + if (empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) { print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } - if($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT == 1) + else { print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } @@ -138,7 +140,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print ''; -$db->close(); llxFooter(); -?> +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 419ac40dd20..da6ee0cf31b 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2004-2012 Laurent Destailleur + * 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 @@ -32,6 +33,15 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" var $error=''; var $max=5; + var $rowid; + var $id; + var $position; + var $box_order; + var $fk_user; + var $sourcefile; + var $box_id; + var $note; + /** * Constructor diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 8999341513e..35c86f236b3 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -271,9 +271,8 @@ class FormCompany $i++; } } - $noselect.=$out; - if (!empty($htmlname)) $out.= ''; - if (!empty($htmlname) && $user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); + if (! empty($htmlname)) $out.= ''; + if (! empty($htmlname) && $user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); } else { diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index c20336291d5..5884a15156b 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.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 @@ -93,11 +93,11 @@ class InfoBox $box=new $boxname($db,$obj->note); // box properties - $box->rowid=$obj->rowid; - $box->id=$obj->box_id; - $box->position=$obj->position; - $box->box_order=$obj->box_order; - $box->fk_user=$obj->fk_user; + $box->rowid = (! empty($obj->rowid) ? $obj->rowid : ''); + $box->id = (! empty($obj->box_id) ? $obj->box_id : ''); + $box->position = (! empty($obj->position) ? $obj->position : ''); + $box->box_order = (! empty($obj->box_order) ? $obj->box_order : ''); + $box->fk_user = (! empty($obj->fk_user) ? $obj->fk_user : ''); $box->sourcefile=$relsourcefile; if ($mode == 'activated' && (! $user->id || ! $user->conf->$confuserzone)) { @@ -108,11 +108,11 @@ class InfoBox } } // box_def properties - $box->box_id=$obj->box_id; - $box->note=$obj->note; + $box->box_id = (! empty($obj->box_id) ? $obj->box_id : ''); + $box->note = (! empty($obj->note) ? $obj->note : ''); $enabled=true; - if ($box->depends && count($box->depends) > 0) + if (isset($box->depends) && count($box->depends) > 0) { foreach($box->depends as $module) { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index ddcbc7cf668..6a3d45892bf 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010 Regis Houssin +/* Copyright (C) 2006-2012 Laurent Destailleur + * Copyright (C) 2010-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 @@ -159,7 +159,11 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { global $conf,$langs,$bc; - $dirthemes=array_merge(array($conf->global->MAIN_FORCETHEMEDIR.'/theme'),(array) $conf->modules_parts['themes']); + $forcethemedir=(! empty($conf->global->MAIN_FORCETHEMEDIR) ? $conf->global->MAIN_FORCETHEMEDIR : ''); + $dirthemes=array($forcethemedir.'/theme'); + if (! empty($conf->modules_parts['themes'])) { + $dirthemes=array_merge(array($forcethemedir.'/theme'),(array) $conf->modules_parts['themes']); + } $selected_theme=$conf->global->MAIN_THEME; if (! empty($fuser)) $selected_theme=$fuser->conf->MAIN_THEME; @@ -206,7 +210,12 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { print ''; print ''.$langs->trans("ThemeDir").''; - print ''.$dirtheme.''; + print ''; + foreach($dirthemes as $dirtheme) + { + echo '"'.$dirtheme.'" '; + } + print ''; print ''; } @@ -214,14 +223,14 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; print ''; - + $i=0; - + foreach($dirthemes as $dir) { $dirtheme=dol_buildpath($dir,0); $urltheme=dol_buildpath($dir,1); - + if (is_dir($dirtheme)) { $handle=opendir($dirtheme); @@ -234,12 +243,12 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) { // Disable not stable themes //if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/bureau2crea/i',$subdir)) continue; - + if ($i % $thumbsbyrow == 0) { print ''; } - + print '
'; $file=$dirtheme."/".$subdir."/thumb.png"; $url=$urltheme."/".$subdir."/thumb.png"; @@ -260,16 +269,16 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ' '.$subdir; } print '
'; - + $i++; - + if ($i % $thumbsbyrow == 0) print ''; } } } } } - + if ($i % $thumbsbyrow != 0) { while ($i % $thumbsbyrow != 0)