summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fd749fe)
raw | patch | inline | side by side (parent: fd749fe)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Nov 2005 11:03:21 +0000 (11:03 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Nov 2005 11:03:21 +0000 (11:03 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2021 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions.inc | patch | blob | history | |
plugins/gofon/reports/class_fonreport.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index 6db14c0b861936585acd6939d10f85827a659f8e..20ab5ed8e2bb6a8280aa22fa2b4f1623e550131e 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
-function range_selector($dcnt,$start,$range=25)
+function range_selector($dcnt,$start,$range=25,$post_var=false)
{
/* Entries shown left and right from the selected entry */
if ($max_entries & 1){
$max_entries++;
}
+
+ if((!empty($post_var))&&(isset($_POST[$post_var]))){
+ $range= $_POST[$post_var];
+ }
/* Prevent output to start or end out of range */
if ($start < 0 ){
if(((int)($numpages))!=($numpages)){
$numpages = (int)$numpages + 1;
}
- if (((int)$numpages) <= 1 ){
+ if ((((int)$numpages) <= 1 )&&(!$post_var)){
return ("");
}
$ppage= (int)(($start / $range) + 0.5);
$begin= $end - $max_entries;
}
- $output.= "<div style='border:1px solid #E0E0E0; background-color:#FFFFFF;'>";
+ if($post_var){
+ $output.= "<div style='border:1px solid #E0E0E0; background-color:#FFFFFF;'>
+ <table width='100%'><tr><td width='200'></td><td style='align:center;'>";
+ }else{
+ $output.= "<div style='border:1px solid #E0E0E0; background-color:#FFFFFF;'>";
+ }
/* Draw decrement */
if ($start > 0 ) {
"<img alt=\"\" src=\"images/forward.png\" border=0 align=\"middle\"></a>";
}
- $output.= "</div>";
+ if($post_var){
+ $output.= "</td><td width='200'> "._("Entries per page")." : <select name='".$post_var."' onChange='javascript:document.mainform.submit()'>";
+ foreach(array(20,50,100,200,"all") as $num){
+ if($num == "all"){
+ $var = 10000;
+ }else{
+ $var = $num;
+ }
+ if($var == $range){
+ $output.="\n<option selected value='".$var."'>".$num."</option>";
+ }else{
+ $output.="\n<option value='".$var."'>".$num."</option>";
+ }
+ }
+ $output.= "</select></td></tr></table></div>";
+ }else{
+ $output.= "</div>";
+ }
return($output);
}
index a2ef80dcf3ffd31fb2eefd30996785d566a8b5e8..4a08c04cac148f37c0856b7bfa892e699c602c23 100644 (file)
var $userfilter= "";
var $ui= NULL;
var $fields= array("calldate", "src", "dst", "channel", "lastapp", "disposition", "duration");
+ var $range = 20;
/* attribute list for save action */
var $attributes= array();
/* Call parent execute */
plugin::execute();
+ if(isset($_POST['EntryPerPage'])){
+ $this->range = $_POST['EntryPerPage'];
+ }
+
/* Get template engine */
$smarty= get_smarty();
$fonfilter= get_global("fonfilter");
$mod++;
continue;
}
- if ($mod >= ($this->start + 20)){
+ if ($mod >= ($this->start + $this->range)){
$mod++;
break;
}
if ($output != ""){
$smarty->assign("search_result", $output);
- $smarty->assign("range_selector", range_selector(count($this->report_list), $this->start, 20));
+ $smarty->assign("range_selector", range_selector(count($this->report_list), $this->start,$this->range,"EntryPerPage"));
} else {
$smarty->assign("search_result", "");
}