diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index d665d70da56..abbdc7b7c71 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -222,13 +222,14 @@ class box_graph_invoices_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfBillsByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index efd7de41e5a..53d9ce08059 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -219,13 +219,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfBillsByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 699f2db902b..05a0ff498ec 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -218,13 +218,14 @@ class box_graph_orders_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfOrdersByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index f49f38c1228..e88ed46be72 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -217,13 +217,14 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfOrdersByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 69a09e8aad2..39a7a3984d2 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -338,6 +338,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; if (! empty($conf->facture->enabled) || ! empty($user->rights->facture->lire)) { @@ -355,7 +356,7 @@ class box_graph_product_distribution extends ModeleBoxes } $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.='
'; $stringtoshow.='
'; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 50e3cbe9bf8..bddf4a27e64 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -219,13 +219,14 @@ class box_graph_propales_permonth extends ModeleBoxes $stringtoshow.='
'; // hideobject is to start hidden $stringtoshow.='
'; $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=' '.$langs->trans("NumberOfProposalsByMonth"); $stringtoshow.='   '; $stringtoshow.=' '.$langs->trans("AmountOfProposalsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index a303f78eb15..a0bbad11518 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -131,16 +131,29 @@ if ($conf->browser->layout != 'phone') ' . "\n"; } +// Code to manage reposition print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n"; print ' jQuery(document).ready(function() { /* If page_y set, we set scollbar with it */ - page_y=getParameterByName(\'page_y\', 0); if (page_y > 0) $(\'html, body\').scrollTop(page_y); - /* Set handler to add page_y param on some a href links */ + page_y=getParameterByName(\'page_y\', 0); /* search in GET parameter */ + if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */ + console.log("page_y found is "+page_y); + if (page_y > 0) $(\'html, body\').scrollTop(page_y); + + /* Set handler to add page_y param on output (click on href links or submit button) */ jQuery(".reposition").click(function() { var page_y = $(document).scrollTop(); - this.href=this.href+\'&page_y=\'+page_y; - console.log("We click on tag with .reposition class. this.ref is now "+this.href) + if (this.ref) + { + this.href=this.href+\'&page_y=\'+page_y; + console.log("We click on tag with .reposition class. this.ref is now "+this.href); + } + else + { + console.log("We click on tag with .reposition class but element is not an html tag, so we try to update form field page_y with value "+page_y); + jQuery("input[type=hidden][name=page_y]").val(page_y); + } }); });'."\n"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8c60dcf8424..2faf8082056 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6888,6 +6888,10 @@ function printCommonFooter($zone='private') if ($zone == 'private') print "\n".''."\n"; else print "\n".''."\n"; + // A div to store page_y POST parameter so we can read it using javascript + print "\n\n"; + print ''."\n"; + $parameters=array(); $reshook=$hookmanager->executeHooks('printCommonFooter',$parameters); // Note that $action and $object may have been modified by some hooks if (empty($reshook))