diff --git a/views/bootstrap/class.Charts.php b/views/bootstrap/class.Charts.php index 06eed4d2d..679e227e9 100644 --- a/views/bootstrap/class.Charts.php +++ b/views/bootstrap/class.Charts.php @@ -173,7 +173,7 @@ if(in_array($type, array('docspermonth'))) { getKeyValue($type, $rec).'", data: [[1,'.$rec['total'].']]},'."\n"; } } ?> @@ -245,7 +245,31 @@ $(document).ready( function() { return true; } /* }}} */ - protected function getSearchUrl($type, $item) { + protected function getKeyValue($type, $item) { /* {{{ */ + switch ($type) { + case 'docspersizerange': + return htmlspecialchars('< '.SeedDMS_Core_File::format_filesize(pow(10, $item['key']+1), ['Bytes', 'KB', 'MB', 'GB'], 10, 1000).', >= '.SeedDMS_Core_File::format_filesize(pow(10, $item['key']), ['Bytes', 'KB', 'MB', 'GB'], 10, 1000)); + break; + case 'docsaccumulated': + return getReadableDate($item['key']/1000); + break; + default: + return htmlspecialchars($item['key']); + } + } /* }}} */ + + protected function getTotalValue($type, $total) { /* {{{ */ + switch ($type) { + case 'sizeperuser': + case 'sizepermonth': + return htmlspecialchars(SeedDMS_Core_File::format_filesize($total)); + break; + default: + return htmlspecialchars($total); + } + } /* }}} */ + + protected function getSearchUrl($type, $item) { /* {{{ */ $dms = $this->params['dms']; $settings = $this->params['settings']; @@ -270,6 +294,11 @@ $(document).ready( function() { $endmonth = date('Y-m-t', strtotime($startmonth)); $searchurl = $settings->_httpRoot.'out/out.Search.php?fullsearch=0&query=&mode=1&orderby=&resultmode=1&created%5Bfrom%5D='.$startmonth.'&created%5Bto%5D='.$endmonth; break; + case 'docspersizerange': + $filesizestart = pow(10, $item['key']); + $filesizeend = pow(10, $item['key']+1)-1; + $searchurl = $settings->_httpRoot.'out/out.Search.php?fullsearch=0&query=&mode=1&orderby=&resultmode=1&filesize%5Bfrom%5D='.$filesizestart.'&filesize%5Bto%5D='.$filesizeend; + break; case 'docspermimetype': $searchurl = $settings->_httpRoot.'out/out.Search.php?fullsearch=0&query=&mode=1&orderby=&resultmode=1&mimetype%5B%5D='.urlencode($item['key']); break; @@ -280,7 +309,7 @@ $(document).ready( function() { break; } return $searchurl; - } + } /* }}} */ public function show() { /* {{{ */ $dms = $this->params['dms']; @@ -306,7 +335,7 @@ $(document).ready( function() { $this->columnStart(3); $this->contentHeading(getMLText("chart_selection")); $this->contentContainerStart(); - foreach(array('docsperuser', 'foldersperuser', 'sizeperuser', 'sizepermonth','docspermimetype', 'docspercategory', 'docsperstatus', 'docspermonth', 'docsaccumulated') as $atype) { + foreach(array('docsperuser', 'foldersperuser', 'sizeperuser', 'sizepermonth','docspersizerange', 'docspermimetype', 'docspercategory', 'docsperstatus', 'docspermonth', 'docsaccumulated') as $atype) { if($this->showChart($atype)) echo "
\n"; } @@ -349,7 +378,7 @@ $(document).ready( function() { $oldtotal = 0; foreach($data as $item) { echo "