diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index bece2e55c6f..ad7cbc0e29c 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -197,6 +197,12 @@ class box_graph_invoices_permonth extends ModeleBoxes } } + if (empty($conf->use_javascript_ajax)) + { + $langs->load("errors"); + $mesg=$langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); + } + if (! $mesg) { $stringtoshow=''; diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 4214a9a81b8..58d3a27f834 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -196,6 +196,12 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes } } + if (empty($conf->use_javascript_ajax)) + { + $langs->load("errors"); + $mesg=$langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); + } + if (! $mesg) { $stringtoshow=''; diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 7389c2c6b8b..81c9185c68f 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -197,6 +197,12 @@ class box_graph_orders_permonth extends ModeleBoxes } } + if (empty($conf->use_javascript_ajax)) + { + $langs->load("errors"); + $mesg=$langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); + } + if (! $mesg) { $stringtoshow=''; diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 788528b501f..98779836576 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -196,6 +196,12 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes } } + if (empty($conf->use_javascript_ajax)) + { + $langs->load("errors"); + $mesg=$langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); + } + if (! $mesg) { $stringtoshow=''; diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index a05c4baf5ad..0029866b75a 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -301,6 +301,12 @@ class box_graph_product_distribution extends ModeleBoxes } } + if (empty($conf->use_javascript_ajax)) + { + $langs->load("errors"); + $mesg=$langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); + } + if (! $mesg) { $stringtoshow=''; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index d80d40c64f2..61e83f3cd60 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -202,6 +202,12 @@ class box_graph_propales_permonth extends ModeleBoxes } } + if (empty($conf->use_javascript_ajax)) + { + $langs->load("errors"); + $mesg=$langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs"); + } + if (! $mesg) { $stringtoshow=''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index b6065909ade..fe1cd8ddb6b 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -927,6 +927,7 @@ class FormOther $arrayboxtoactivatelabel=array(); if (! empty($user->conf->$confuserzone)) { + $boxorder=''; $langs->load("boxes"); // Load label of boxes foreach($boxactivated as $box) { @@ -935,8 +936,23 @@ class FormOther if (preg_match('/graph/',$box->class)) $label.=' ('.$langs->trans("Graph").')'; $arrayboxtoactivatelabel[$box->id]=$label; // We keep only boxes not shown for user, to show into combo list } - // Class Form must have been already loaded - $selectboxlist=Form::selectarray('boxcombo', $arrayboxtoactivatelabel,'',1); + foreach($boxidactivatedforuser as $boxid) + { + if (empty($boxorder)) $boxorder.='A:'; + $boxorder.=$boxid.','; + } + + //var_dump($boxidactivatedforuser); + + // Class Form must have been already loaded + $selectboxlist.='
'; } // Javascript code for dynamic actions diff --git a/htdocs/index.php b/htdocs/index.php index 3b0cc3c5306..d18c05d4f12 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -46,6 +46,17 @@ if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_IN exit; } +if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax disabled) +{ + require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; + $zone=GETPOST('areacode'); + $userid=GETPOST('userid'); + $boxorder=GETPOST('boxorder'); + $boxorder.=GETPOST('boxcombo'); + + $result=InfoBox::saveboxorder($db,$zone,$boxorder,$userid); +} + /* diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 93defd10ed5..b874ef58f07 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -153,3 +153,4 @@ WarningCloseAlways=Warning, closing is done even if amount differs between sourc WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box. WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your user are not complete (see tab ClickToDial onto your user card). WarningNotRelevant=Irrelevant operation for this dataset +WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs=Feature disabled when display setup is optimized for blind person or text browsers. \ No newline at end of file diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index caddad9d997..9b8f06f262e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -674,6 +674,7 @@ SetDemandReason=Set source ViewPrivateNote=View notes XMoreLines=%s line(s) hidden PublicUrl=Public URL +AddBox=Add box # Week day Monday=Monday