mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-30 20:51:22 +00:00 
			
		
		
		
	get total number of hits, some code formating
This commit is contained in:
		
							parent
							
								
									f2dbe4c18b
								
							
						
					
					
						commit
						a4bb363799
					
				|  | @ -127,6 +127,7 @@ function typeahead() { /* {{{ */ | |||
| 		$dms = $this->params['dms']; | ||||
| 		$user = $this->params['user']; | ||||
| 		$fullsearch = $this->params['fullsearch']; | ||||
| 		$total = $this->params['total']; | ||||
| 		$totaldocs = $this->params['totaldocs']; | ||||
| 		$totalfolders = $this->params['totalfolders']; | ||||
| 		$attrdefs = $this->params['attrdefs']; | ||||
|  | @ -139,6 +140,7 @@ function typeahead() { /* {{{ */ | |||
| 		$enableclipboard = $this->params['enableclipboard']; | ||||
| 		$attributes = $this->params['attributes']; | ||||
| 		$categories = $this->params['categories']; | ||||
| 		$category = $this->params['category']; | ||||
| 		$mimetype = $this->params['mimetype']; | ||||
| 		$owner = $this->params['owner']; | ||||
| 		$startfolder = $this->params['startfolder']; | ||||
|  | @ -152,6 +154,7 @@ function typeahead() { /* {{{ */ | |||
| 		$expirationdate = $this->params['expirationdate']; | ||||
| 		$statusdate = $this->params['statusdate']; | ||||
| 		$status = $this->params['status']; | ||||
| 		$record_type = $this->params['recordtype']; | ||||
| 		$this->query = $this->params['query']; | ||||
| 		$orderby = $this->params['orderby']; | ||||
| 		$entries = $this->params['searchhits']; | ||||
|  | @ -331,8 +334,8 @@ function typeahead() { /* {{{ */ | |||
| 			$tmpcatids[] = $tmpcat->getID(); | ||||
| 		$options = array(); | ||||
| 		$allcategories = $dms->getDocumentCategories(); | ||||
| 		foreach($allcategories as $category) { | ||||
| 			$options[] = array($category->getID(), $category->getName(), in_array($category->getId(), $tmpcatids)); | ||||
| 		foreach($allcategories as $acategory) { | ||||
| 			$options[] = array($acategory->getID(), $acategory->getName(), in_array($acategory->getId(), $tmpcatids)); | ||||
| 		} | ||||
| 		$this->formField( | ||||
| 			getMLText("categories"), | ||||
|  | @ -471,8 +474,8 @@ function typeahead() { /* {{{ */ | |||
| 					$tmpcatids[] = $tmpcat->getID(); | ||||
| 				$options = array(); | ||||
| 				$allcategories = $dms->getDocumentCategories(); | ||||
| 			foreach($allcategories as $category) { | ||||
| 				$options[] = array($category->getID(), $category->getName(), in_array($category->getId(), $tmpcatids)); | ||||
| 				foreach($allcategories as $acategory) { | ||||
| 					$options[] = array($acategory->getID(), $acategory->getName(), in_array($acategory->getId(), $tmpcatids)); | ||||
| 				} | ||||
| 				$this->formField( | ||||
| 					getMLText("category_filter"), | ||||
|  | @ -486,6 +489,7 @@ function typeahead() { /* {{{ */ | |||
| 					) | ||||
| 				); | ||||
| 			} | ||||
| 			if(!isset($facets['status'])) { | ||||
| 				$options = array(); | ||||
| 				if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') { | ||||
| 					if($workflowmode == 'traditional') {  | ||||
|  | @ -510,16 +514,49 @@ function typeahead() { /* {{{ */ | |||
| 						'options'=>$options | ||||
| 					) | ||||
| 				); | ||||
| 			} | ||||
| 
 | ||||
| 			if($facets) { | ||||
| 				foreach($facets as $facetname=>$values) { | ||||
| 					$multiple = true; | ||||
| //					if(in_array($facetname, ['owner', 'status', 'mimetype']))
 | ||||
| //						$multiple = false;
 | ||||
| 					$options = array(); | ||||
| 					if($facetname == 'owner') { | ||||
| 						foreach($values as $v=>$c) { | ||||
| 							$uu = $dms->getUserByLogin($v); | ||||
| 							if($uu) { | ||||
| 								$option = array($uu->getId(), $v.' ('.$c.')'); | ||||
| 								if(isset(${$facetname}) && in_array($uu->getId(), ${$facetname})) | ||||
| 									$option[] = true; | ||||
| 								$options[] = $option; | ||||
| 							} | ||||
| 						} | ||||
| 					} elseif($facetname == 'category') { | ||||
| 						foreach($values as $v=>$c) { | ||||
| 							$cat = $dms->getDocumentCategoryByName($v); | ||||
| 							if($cat) { | ||||
| 								$option = array($cat->getId(), $v.' ('.$c.')'); | ||||
| 								if(isset(${$facetname}) && in_array($cat->getId(), ${$facetname})) | ||||
| 									$option[] = true; | ||||
| 								$options[] = $option; | ||||
| 							} | ||||
| 						} | ||||
| 					} elseif($facetname == 'status') { | ||||
| 						foreach($values as $v=>$c) { | ||||
| 								$option = array($v, getOverallStatusText($v).' ('.$c.')'); | ||||
| 								if(isset(${$facetname}) && in_array($v, ${$facetname})) | ||||
| 									$option[] = true; | ||||
| 								$options[] = $option; | ||||
| 						} | ||||
| 					} else { | ||||
| 						foreach($values as $v=>$c) { | ||||
| 							$option = array($v, $v.' ('.$c.')'); | ||||
| 							if(isset(${$facetname}) && in_array($v, ${$facetname})) | ||||
| 								$option[] = true; | ||||
| 							$options[] = $option; | ||||
| 						} | ||||
| 					} | ||||
| 					$this->formField( | ||||
| 						getMLText($facetname), | ||||
| 						array( | ||||
|  | @ -527,9 +564,9 @@ foreach($facets as $facetname=>$values) { | |||
| 							'id'=>$facetname, | ||||
| 							'name'=>$facetname."[]", | ||||
| 							'class'=>'chzn-select', | ||||
| 			'attributes'=>array(array('data-placeholder', getMLText('select_'.$facetname))), | ||||
| 							'attributes'=>array(array('data-placeholder', getMLText('select_'.$facetname)), array('data-allow-clear', 'true')), | ||||
| 							'options'=>$options, | ||||
| 			'multiple'=>true | ||||
| 							'multiple'=>$multiple | ||||
| 						) | ||||
| 					); | ||||
| 				} | ||||
|  | @ -562,7 +599,7 @@ foreach($facets as $facetname=>$values) { | |||
| 				} | ||||
| 			} | ||||
| 			 */ | ||||
| 			echo $this->infoMsg(getMLText("search_report", array("doccount" => $totaldocs, "foldercount" => $totalfolders, 'searchtime'=>$searchTime))); | ||||
| 			echo $this->infoMsg(getMLText("search_report", array("count"=>$total, "doccount" => $totaldocs, "foldercount" => $totalfolders, 'searchtime'=>$searchTime))); | ||||
| 			$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $urlparams); | ||||
| //			$this->contentContainerStart();
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann