Browse Source

FIX add POST key on print link (avoid action in case of)
in order to keep filter on list and other case

Alexis Algoud 9 years ago
parent
commit
97eedb866b
1 changed files with 6 additions and 1 deletions
  1. 6 1
      htdocs/main.inc.php

+ 6 - 1
htdocs/main.inc.php

@@ -1480,7 +1480,12 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
 	    if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && empty($conf->browser->phone))
 	    {
 	        $qs=$_SERVER["QUERY_STRING"];
-	        $qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
+	        
+			foreach($_POST as $key=>$value) {
+				if($key!=='action')$qs.='&'.$key.'='.urlencode($value);
+			} 
+			
+			$qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
 	        $text ='<a href="'.$_SERVER["PHP_SELF"].'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">';
 	        $text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
 	        $text.='</a>';