Skip to content
Snippets Groups Projects
Commit c9d27383 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: When option to use optimize display for text borwser and blin

person is on, box addon was broken.
parent 096a61d5
Branches
Tags
No related merge requests found
......@@ -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='';
......
......@@ -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='';
......
......@@ -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='';
......
......@@ -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='';
......
......@@ -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='';
......
......@@ -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='';
......
......@@ -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
}
foreach($boxidactivatedforuser as $boxid)
{
if (empty($boxorder)) $boxorder.='A:';
$boxorder.=$boxid.',';
}
//var_dump($boxidactivatedforuser);
// Class Form must have been already loaded
$selectboxlist=Form::selectarray('boxcombo', $arrayboxtoactivatelabel,'',1);
$selectboxlist.='<form name="addbox" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
$selectboxlist.='<input type="hidden" name="addbox" value="addbox">';
$selectboxlist.='<input type="hidden" name="userid" value="'.$user->id.'">';
$selectboxlist.='<input type="hidden" name="areacode" value="'.$areacode.'">';
$selectboxlist.='<input type="hidden" name="boxorder" value="'.$boxorder.'">';
$selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel,'',1);
if (empty($conf->use_javascript_ajax)) $selectboxlist.=' <input type="submit" class="button" value="'.$langs->trans("AddBox").'">';
$selectboxlist.='</form>';
}
// Javascript code for dynamic actions
......
......@@ -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);
}
/*
......
......@@ -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
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment