mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-30 20:51:22 +00:00 
			
		
		
		
	Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
		
						commit
						12a44b75a3
					
				|  | @ -175,6 +175,8 @@ class SeedDMS_SQLiteFTS_Indexer { | |||
| 		if($query) | ||||
| 			$sql .= " WHERE docs MATCH ".$this->_conn->quote($query); | ||||
| 		$res = $this->_conn->query($sql); | ||||
| 		if(!$res) | ||||
| 			return false; | ||||
| 		$row = $res->fetch(); | ||||
| 
 | ||||
| 		$sql = "SELECT ".$this->_rawid.", documentid FROM docs"; | ||||
|  |  | |||
|  | @ -79,11 +79,11 @@ class SeedDMS_SQliteFTS_Search { | |||
| 		if(!empty($fields['owner'])) { | ||||
| 			if(is_string($fields['owner'])) { | ||||
| 				if($querystr) | ||||
| 					$querystr .= ' '; | ||||
| 					$querystr .= ' AND '; | ||||
| 				$querystr .= 'owner:'.$fields['owner']; | ||||
| 			} elseif(is_array($fields['owner'])) { | ||||
| 				if($querystr) | ||||
| 					$querystr .= ' '; | ||||
| 					$querystr .= ' AND '; | ||||
| 				$querystr .= '(owner:'; | ||||
| 				$querystr .= implode(' OR owner:', $fields['owner']); | ||||
| 				$querystr .= ')'; | ||||
|  | @ -91,14 +91,14 @@ class SeedDMS_SQliteFTS_Search { | |||
| 		} | ||||
| 		if(!empty($fields['category'])) { | ||||
| 			if($querystr) | ||||
| 				$querystr .= ' '; | ||||
| 				$querystr .= ' AND '; | ||||
| 			$querystr .= '(category:'; | ||||
| 			$querystr .= implode(' OR category:', $fields['category']); | ||||
| 			$querystr .= ')'; | ||||
| 		} | ||||
| 		if(!empty($fields['status'])) { | ||||
| 			if($querystr) | ||||
| 				$querystr .= ' '; | ||||
| 				$querystr .= ' AND '; | ||||
| 			$status = array_map(function($v){return $v+10;}, $fields['status']); | ||||
| 			$querystr .= '(status:'; | ||||
| 			$querystr .= implode(' OR status:', $status); | ||||
|  | @ -106,21 +106,21 @@ class SeedDMS_SQliteFTS_Search { | |||
| 		} | ||||
| 		if(!empty($fields['user'])) { | ||||
| 			if($querystr) | ||||
| 				$querystr .= ' '; | ||||
| 				$querystr .= ' AND '; | ||||
| 			$querystr .= '(users:'; | ||||
| 			$querystr .= implode(' OR users:', $fields['user']); | ||||
| 			$querystr .= ')'; | ||||
| 		} | ||||
| 		if(!empty($fields['rootFolder']) && $fields['rootFolder']->getFolderList()) { | ||||
| 			if($querystr) | ||||
| 				$querystr .= ' '; | ||||
| 				$querystr .= ' AND '; | ||||
| 			$querystr .= '(path:'; | ||||
| 			$querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':'); | ||||
| 			$querystr .= ')'; | ||||
| 		} | ||||
| 		if(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) { | ||||
| 			if($querystr) | ||||
| 				$querystr .= ' '; | ||||
| 				$querystr .= ' AND '; | ||||
| 			$querystr .= '(path:'; | ||||
| 			$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':'); | ||||
| 			$querystr .= ')'; | ||||
|  |  | |||
|  | @ -64,15 +64,7 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext | |||
| 	$categories = array(); | ||||
| 	$categorynames = array(); | ||||
| 	if(isset($_GET['category']) && $_GET['category']) { | ||||
| 		foreach($_GET['category'] as $catname) { | ||||
| 			if($catname) { | ||||
| 				$cat = $dms->getDocumentCategoryByName($catname); | ||||
| 				$categories[] = $cat; | ||||
| 				$categorynames[] = $cat->getName(); | ||||
| 			} | ||||
| 		} | ||||
| 	} elseif(isset($_GET['categoryids']) && $_GET['categoryids']) { | ||||
| 		foreach($_GET['categoryids'] as $catid) { | ||||
| 		foreach($_GET['category'] as $catid) { | ||||
| 			if($catid) { | ||||
| 				$cat = $dms->getDocumentCategory($catid); | ||||
| 				$categories[] = $cat; | ||||
|  | @ -104,16 +96,18 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext | |||
| 	// Check to see if the search has been restricted to a particular
 | ||||
| 	// document owner.
 | ||||
| 	$owner = []; | ||||
| 	$ownernames = []; | ||||
| 	if (isset($_GET["owner"])) { | ||||
| 		$owner = $_GET['owner']; | ||||
| 		if (!is_array($_GET['owner'])) { | ||||
| 			if(!empty($_GET['owner']) && $o = $dms->getUserByLogin($_GET['owner'])) | ||||
| 				$owner[] = $o->getLogin(); | ||||
| 			if(!empty($_GET['owner']) && $o = $dms->getUser($_GET['owner'])) | ||||
| 				$ownernames[] = $o->getLogin(); | ||||
| 			else | ||||
| 				UI::exitError(getMLText("search"),getMLText("unknown_owner")); | ||||
| 		} else { | ||||
| 			foreach($_GET["owner"] as $l) { | ||||
| 				if($l && $o = $dms->getUserByLogin($l)) | ||||
| 					$owner[] = $o->getLogin(); | ||||
| 				if($l && $o = $dms->getUser($l)) | ||||
| 					$ownernames[] = $o->getLogin(); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | @ -134,34 +128,16 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext | |||
| 	} | ||||
| 
 | ||||
| 	// status
 | ||||
| 	$status = array(); | ||||
| 	if (isset($_GET["pendingReview"])){ | ||||
| 		$status[] = S_DRAFT_REV; | ||||
| 	} | ||||
| 	if (isset($_GET["pendingApproval"])){ | ||||
| 		$status[] = S_DRAFT_APP; | ||||
| 	} | ||||
| 	if (isset($_GET["inWorkflow"])){ | ||||
| 		$status[] = S_IN_WORKFLOW; | ||||
| 	} | ||||
| 	if (isset($_GET["released"])){ | ||||
| 		$status[] = S_RELEASED; | ||||
| 	} | ||||
| 	if (isset($_GET["rejected"])){ | ||||
| 		$status[] = S_REJECTED; | ||||
| 	} | ||||
| 	if (isset($_GET["obsolete"])){ | ||||
| 		$status[] = S_OBSOLETE; | ||||
| 	} | ||||
| 	if (isset($_GET["expired"])){ | ||||
| 		$status[] = S_EXPIRED; | ||||
| 	} | ||||
| 	if(isset($_GET['status'])) | ||||
| 		$status = $_GET['status']; | ||||
| 	else | ||||
| 		$status = array(); | ||||
| 
 | ||||
| 	// Check to see if the search has been restricted to a particular sub-tree in
 | ||||
| 	// the folder hierarchy.
 | ||||
| 	$startFolder = null; | ||||
| 	if (isset($_GET["targetid"]) && is_numeric($_GET["targetid"]) && $_GET["targetid"]>0) { | ||||
| 		$targetid = $_GET["targetid"]; | ||||
| 	if (isset($_GET["folderfullsearchid"]) && is_numeric($_GET["folderfullsearchid"]) && $_GET["folderfullsearchid"]>0) { | ||||
| 		$targetid = $_GET["folderfullsearchid"]; | ||||
| 		$startFolder = $dms->getFolder($targetid); | ||||
| 		if (!is_object($startFolder)) { | ||||
| 			UI::exitError(getMLText("search"),getMLText("invalid_folder_id")); | ||||
|  | @ -188,7 +164,7 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext | |||
| 		$index = $fulltextservice->Indexer(); | ||||
| 		if($index) { | ||||
| 			$lucenesearch = $fulltextservice->Search(); | ||||
| 			$searchresult = $lucenesearch->search($query, array('owner'=>$owner, 'status'=>$status, 'category'=>$categorynames, 'user'=>$user->isAdmin() ? [] : [$user->getLogin()], 'mimetype'=>$mimetype, 'startFolder'=>$startFolder, 'rootFolder'=>$rootFolder), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1)))); | ||||
| 			$searchresult = $lucenesearch->search($query, array('owner'=>$ownernames, 'status'=>$status, 'category'=>$categorynames, 'user'=>$user->isAdmin() ? [] : [$user->getLogin()], 'mimetype'=>$mimetype, 'startFolder'=>$startFolder, 'rootFolder'=>$rootFolder), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1)))); | ||||
| 			if($searchresult === false) { | ||||
| 				$session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('splash_invalid_searchterm'))); | ||||
| 				$dcount = 0; | ||||
|  | @ -314,132 +290,100 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext | |||
| 	$owner = array(); | ||||
| 	$ownerobjs = array(); | ||||
| 	if (isset($_GET["owner"])) { | ||||
| 		$owner = $_GET['owner']; | ||||
| 		if (!is_array($_GET['owner'])) { | ||||
| 			if(!empty($_GET['owner']) && $o = $dms->getUserByLogin($_GET['owner'])) { | ||||
| 			if(!empty($_GET['owner']) && $o = $dms->getUser($_GET['owner'])) { | ||||
| 				$ownerobjs[] = $o; | ||||
| 				$owner = $o->getLogin(); | ||||
| 			} else | ||||
| 				UI::exitError(getMLText("search"),getMLText("unknown_owner")); | ||||
| 		} else { | ||||
| 			foreach($_GET["owner"] as $l) { | ||||
| 				if($o = $dms->getUserByLogin($l)) { | ||||
| 				if($o = $dms->getUser($l)) { | ||||
| 					$ownerobjs[] = $o; | ||||
| 					$owner[] = $o->getLogin(); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// Is the search restricted to documents created between two specific dates?
 | ||||
| 	$startdate = array(); | ||||
| 	$stopdate = array(); | ||||
| 	if (isset($_GET["creationdate"]) && $_GET["creationdate"]!=null) { | ||||
| 		$creationdate = true; | ||||
| 	} else { | ||||
| 		$creationdate = false; | ||||
| 	/* Creation date {{{ */ | ||||
| 	$createstartdate = array(); | ||||
| 	$createenddate = array(); | ||||
| 	if(!empty($_GET["createstart"])) { | ||||
| 		$createstartts = makeTsFromDate($_GET["createstart"]); | ||||
| 		$createstartdate = array('year'=>(int)date('Y', $createstartts), 'month'=>(int)date('m', $createstartts), 'day'=>(int)date('d', $createstartts), 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 	} | ||||
| 
 | ||||
| 	if(isset($_GET["createstart"])) { | ||||
| 		$tmp = explode("-", $_GET["createstart"]); | ||||
| 		$startdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 	} else { | ||||
| 		if(isset($_GET["createstartyear"])) | ||||
| 			$startdate = array('year'=>$_GET["createstartyear"], 'month'=>$_GET["createstartmonth"], 'day'=>$_GET["createstartday"], 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 	} | ||||
| 	if ($startdate && !checkdate($startdate['month'], $startdate['day'], $startdate['year'])) { | ||||
| 	if ($createstartdate && !checkdate($createstartdate['month'], $createstartdate['day'], $createstartdate['year'])) { | ||||
| 		UI::exitError(getMLText("search"),getMLText("invalid_create_date_end")); | ||||
| 	} | ||||
| 	if(isset($_GET["createend"])) { | ||||
| 		$tmp = explode("-", $_GET["createend"]); | ||||
| 		$stopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>23, 'minute'=>59, 'second'=>59); | ||||
| 	} else { | ||||
| 		if(isset($_GET["createendyear"])) | ||||
| 			$stopdate = array('year'=>$_GET["createendyear"], 'month'=>$_GET["createendmonth"], 'day'=>$_GET["createendday"], 'hour'=>23, 'minute'=>59, 'second'=>59); | ||||
| 	if(!empty($_GET["createend"])) { | ||||
| 		$createendts = makeTsFromDate($_GET["createend"]); | ||||
| 		$createenddate = array('year'=>(int)date('Y', $createendts), 'month'=>(int)date('m', $createendts), 'day'=>(int)date('d', $createendts), 'hour'=>23, 'minute'=>59, 'second'=>59); | ||||
| 	} | ||||
| 	if ($stopdate && !checkdate($stopdate['month'], $stopdate['day'], $stopdate['year'])) { | ||||
| 	if ($createenddate && !checkdate($createenddate['month'], $createenddate['day'], $createenddate['year'])) { | ||||
| 		UI::exitError(getMLText("search"),getMLText("invalid_create_date_end")); | ||||
| 	} | ||||
| 	/* }}} */ | ||||
| 
 | ||||
| 	/* Revision date {{{ */ | ||||
| 	$revisionstartdate = array(); | ||||
| 	$revisionstopdate = array(); | ||||
| 	if (isset($_GET["revisiondate"]) && $_GET["revisiondate"]!=null) { | ||||
| 		$revisiondate = true; | ||||
| 	} else { | ||||
| 		$revisiondate = false; | ||||
| 	} | ||||
| 
 | ||||
| 	if(isset($_GET["revisionstart"]) && $_GET["revisionstart"]) { | ||||
| 		$tmp = explode("-", $_GET["revisionstart"]); | ||||
| 		$revisionstartdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 	$revisionenddate = array(); | ||||
| 	if(!empty($_GET["revisiondatestart"])) { | ||||
| 		$revisionstartts = makeTsFromDate($_GET["revisiondatestart"]); | ||||
| 		$revisionstartdate = array('year'=>(int)date('Y', $revisionstartts), 'month'=>(int)date('m', $revisionstartts), 'day'=>(int)date('d', $revisionstartts), 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 		if (!checkdate($revisionstartdate['month'], $revisionstartdate['day'], $revisionstartdate['year'])) { | ||||
| 			UI::exitError(getMLText("search"),getMLText("invalid_revision_date_start")); | ||||
| 		} | ||||
| 	} else { | ||||
| 		$revisionstartdate = array(); | ||||
| 	} | ||||
| 	if(isset($_GET["revisionend"]) && $_GET["revisionend"]) { | ||||
| 		$tmp = explode("-", $_GET["revisionend"]); | ||||
| 		$revisionstopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 		if (!checkdate($revisionstopdate['month'], $revisionstopdate['day'], $revisionstopdate['year'])) { | ||||
| 	if(!empty($_GET["revisiondateend"])) { | ||||
| 		$revisionendts = makeTsFromDate($_GET["revisiondateend"]); | ||||
| 		$revisionenddate = array('year'=>(int)date('Y', $revisionendts), 'month'=>(int)date('m', $revisionendts), 'day'=>(int)date('d', $revisionendts), 'hour'=>23, 'minute'=>59, 'second'=>59); | ||||
| 		if (!checkdate($revisionenddate['month'], $revisionenddate['day'], $revisionenddate['year'])) { | ||||
| 			UI::exitError(getMLText("search"),getMLText("invalid_revision_date_end")); | ||||
| 		} | ||||
| 	} else { | ||||
| 		$revisionstopdate = array(); | ||||
| 	} | ||||
| 	/* }}} */ | ||||
| 
 | ||||
| 	/* Status date {{{ */ | ||||
| 	$statusstartdate = array(); | ||||
| 	$statusstopdate = array(); | ||||
| 	if (isset($_GET["statusdate"]) && $_GET["statusdate"]!=null) { | ||||
| 		$statusdate = true; | ||||
| 	} else { | ||||
| 		$statusdate = false; | ||||
| 	$statusenddate = array(); | ||||
| 	if(!empty($_GET["statusdatestart"])) { | ||||
| 		$statusstartts = makeTsFromDate($_GET["statusdatestart"]); | ||||
| 		$statusstartdate = array('year'=>(int)date('Y', $statusstartts), 'month'=>(int)date('m', $statusstartts), 'day'=>(int)date('d', $statusstartts), 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 	} | ||||
| 
 | ||||
| 	if(isset($_GET["statusstart"])) { | ||||
| 		$tmp = explode("-", $_GET["statusstart"]); | ||||
| 		$statusstartdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 	if ($statusstartdate && !checkdate($statusstartdate['month'], $statusstartdate['day'], $statusstartdate['year'])) { | ||||
| 		UI::exitError(getMLText("search"),getMLText("invalid_status_date_start")); | ||||
| 	} | ||||
| 	if ($statusstartdate && !checkdate($statusstartdate['month'], $startdate['day'], $startdate['year'])) { | ||||
| 		UI::exitError(getMLText("search"),getMLText("invalid_status_date_end")); | ||||
| 	} | ||||
| 	if(isset($_GET["statusend"])) { | ||||
| 		$tmp = explode("-", $_GET["statusend"]); | ||||
| 		$statusstopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>23, 'minute'=>59, 'second'=>59); | ||||
| 	} | ||||
| 	if ($statusstopdate && !checkdate($statusstopdate['month'], $stopdate['day'], $stopdate['year'])) { | ||||
| 	if(!empty($_GET["statusdateend"])) { | ||||
| 		$statusendts = makeTsFromDate($_GET["statusdateend"]); | ||||
| 		$statusenddate = array('year'=>(int)date('Y', $statusendts), 'month'=>(int)date('m', $statusendts), 'day'=>(int)date('d', $statusendts), 'hour'=>23, 'minute'=>59, 'second'=>59); | ||||
| 	} | ||||
| 	if ($statusenddate && !checkdate($statusenddate['month'], $statusenddate['day'], $statusenddate['year'])) { | ||||
| 		UI::exitError(getMLText("search"),getMLText("invalid_status_date_end")); | ||||
| 	} | ||||
| 	/* }}} */ | ||||
| 
 | ||||
| 	/* Expiration date {{{ */ | ||||
| 	$expstartdate = array(); | ||||
| 	$expstopdate = array(); | ||||
| 	if (isset($_GET["expirationdate"]) && $_GET["expirationdate"]!=null) { | ||||
| 		$expirationdate = true; | ||||
| 	} else { | ||||
| 		$expirationdate = false; | ||||
| 	} | ||||
| 
 | ||||
| 	if(isset($_GET["expirationstart"]) && $_GET["expirationstart"]) { | ||||
| 		$tmp = explode("-", $_GET["expirationstart"]); | ||||
| 		$expstartdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 	$expenddate = array(); | ||||
| 	if(!empty($_GET["expirationstart"])) { | ||||
| 		$expstartts = makeTsFromDate($_GET["expirationstart"]); | ||||
| 		$expstartdate = array('year'=>(int)date('Y', $expstartts), 'month'=>(int)date('m', $expstartts), 'day'=>(int)date('d', $expstartts), 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 		if (!checkdate($expstartdate['month'], $expstartdate['day'], $expstartdate['year'])) { | ||||
| 			UI::exitError(getMLText("search"),getMLText("invalid_expiration_date_start")); | ||||
| 		} | ||||
| 	} else { | ||||
| //		$expstartdate = array('year'=>$_GET["expirationstartyear"], 'month'=>$_GET["expirationstartmonth"], 'day'=>$_GET["expirationstartday"], 'hour'=>0, 'minute'=>0, 'second'=>0);
 | ||||
| 		$expstartdate = array(); | ||||
| 	} | ||||
| 	if(isset($_GET["expirationend"]) && $_GET["expirationend"]) { | ||||
| 		$tmp = explode("-", $_GET["expirationend"]); | ||||
| 		$expstopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0); | ||||
| 		if (!checkdate($expstopdate['month'], $expstopdate['day'], $expstopdate['year'])) { | ||||
| 	if(!empty($_GET["expirationend"])) { | ||||
| 		$expendts = makeTsFromDate($_GET["expirationend"]); | ||||
| 		$expenddate = array('year'=>(int)date('Y', $expendts), 'month'=>(int)date('m', $expendts), 'day'=>(int)date('d', $expendts), 'hour'=>23, 'minute'=>59, 'second'=>59); | ||||
| 		if (!checkdate($expenddate['month'], $expenddate['day'], $expenddate['year'])) { | ||||
| 			UI::exitError(getMLText("search"),getMLText("invalid_expiration_date_end")); | ||||
| 		} | ||||
| 	} else { | ||||
| 		//$expstopdate = array('year'=>$_GET["expirationendyear"], 'month'=>$_GET["expirationendmonth"], 'day'=>$_GET["expirationendday"], 'hour'=>23, 'minute'=>59, 'second'=>59);
 | ||||
| 		$expstopdate = array(); | ||||
| 	} | ||||
| 	/* }}} */ | ||||
| 
 | ||||
| 	// status
 | ||||
| 	$status = isset($_GET['status']) ? $_GET['status'] : array(); | ||||
| 	/* | ||||
| 	$status = array(); | ||||
| 	if (isset($_GET["draft"])){ | ||||
| 		$status[] = S_DRAFT; | ||||
|  | @ -471,6 +415,7 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext | |||
| 	if (isset($_GET["needs_correction"])){ | ||||
| 		$status[] = S_NEEDS_CORRECTION; | ||||
| 	} | ||||
| 	 */ | ||||
| 
 | ||||
| 	$reception = array(); | ||||
| 	if (isset($_GET["reception"])){ | ||||
|  | @ -488,13 +433,10 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext | |||
| 
 | ||||
| 	// category
 | ||||
| 	$categories = array(); | ||||
| 	$categorynames = array(); | ||||
| 	if(isset($_GET['category']) && $_GET['category']) { | ||||
| 		foreach($_GET['category'] as $catname) { | ||||
| 			if($catname) { | ||||
| 				$cat = $dms->getDocumentCategoryByName($catname); | ||||
| 		foreach($_GET['category'] as $catid) { | ||||
| 			if($cat = $dms->getDocumentCategory($catid)) { | ||||
| 				$categories[] = $cat; | ||||
| 				$categorynames[] = $cat->getName(); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | @ -555,20 +497,20 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext | |||
| 		'startFolder'=>$startFolder, | ||||
| 		'owner'=>$ownerobjs, | ||||
| 		'status'=>$status, | ||||
| 		'creationstartdate'=>$creationdate ? $startdate : array(), | ||||
| 		'creationenddate'=>$creationdate ? $stopdate : array(), | ||||
| 		'creationstartdate'=>$createstartdate ? $createstartdate : array(), | ||||
| 		'creationenddate'=>$createenddate ? $createenddate : array(), | ||||
| 		'modificationstartdate'=>array(), | ||||
| 		'modificationenddate'=>array(), | ||||
| 		'categories'=>$categories, | ||||
| 		'attributes'=>$attributes, | ||||
| 		'mode'=>$resultmode, | ||||
| 		'expirationstartdate'=>$expirationdate ? $expstartdate : array(), | ||||
| 		'expirationenddate'=>$expirationdate ? $expstopdate : array(), | ||||
| 		'revisionstartdate'=>$revisiondate ? $revisionstartdate : array(), | ||||
| 		'revisionenddate'=>$revisiondate ? $revisionstopdate : array(), | ||||
| 		'expirationstartdate'=>$expstartdate ? $expstartdate : array(), | ||||
| 		'expirationenddate'=>$expenddate ? $expenddate : array(), | ||||
| 		'revisionstartdate'=>$revisionstartdate ? $revisionstartdate : array(), | ||||
| 		'revisionenddate'=>$revisionenddate ? $revisionenddate : array(), | ||||
| 		'reception'=>$reception, | ||||
| 		'statusstartdate'=>$statusdate ? $statusstartdate : array(), | ||||
| 		'statusenddate'=>$statusdate ? $statusstopdate : array(), | ||||
| 		'statusstartdate'=>$statusstartdate ? $statusstartdate : array(), | ||||
| 		'statusenddate'=>$statusenddate ? $statusenddate : array(), | ||||
| 		'orderby'=>$orderby | ||||
| 	)); | ||||
| 	$total = $resArr['totalDocs'] + $resArr['totalFolders']; | ||||
|  | @ -652,21 +594,20 @@ if($settings->_showSingleSearchHit && count($entries) == 1) { | |||
| 		$view->setParam('searchin', isset($searchin) ? $searchin : array()); | ||||
| 		$view->setParam('startfolder', isset($startFolder) ? $startFolder : null); | ||||
| 		$view->setParam('owner', $owner); | ||||
| 		$view->setParam('startdate', isset($startdate) ? $startdate : array()); | ||||
| 		$view->setParam('stopdate', isset($stopdate) ? $stopdate : array()); | ||||
| 		$view->setParam('revisionstartdate', isset($revisionstartdate) ? $revisionstartdate : array()); | ||||
| 		$view->setParam('revisionstopdate', isset($revisionstopdate) ? $revisionstopdate : array()); | ||||
| 		$view->setParam('expstartdate', isset($expstartdate) ? $expstartdate : array()); | ||||
| 		$view->setParam('expstopdate', isset($expstopdate) ? $expstopdate : array()); | ||||
| 		$view->setParam('statusstartdate', isset($statusstartdate) ? $statusstartdate : array()); | ||||
| 		$view->setParam('statusstopdate', isset($statusstopdate) ? $statusstopdate : array()); | ||||
| 		$view->setParam('createstartdate', $createstartdate ? getReadableDate($createstartts) : ''); | ||||
| 		$view->setParam('createenddate', $createenddate ? getReadableDate($createendts) : ''); | ||||
| 		$view->setParam('revisionstartdate', $revisionstartdate ? getReadableDate($revisionstartts) : ''); | ||||
| 		$view->setParam('revisionenddate', $revisionenddate ? getReadableDate($revisionendts) : ''); | ||||
| 		$view->setParam('expstartdate', $expstartdate ? getReadableDate($expstartts) : ''); | ||||
| 		$view->setParam('expenddate', $expenddate ? getReadableDate($expendts) : ''); | ||||
| 		$view->setParam('statusstartdate', $statusstartdate ? getReadableDate($statusstartts) : ''); | ||||
| 		$view->setParam('statusenddate', $statusenddate ? getReadableDate($statusendts) : ''); | ||||
| 		$view->setParam('creationdate', isset($creationdate) ? $creationdate : ''); | ||||
| 		$view->setParam('expirationdate', isset($expirationdate) ? $expirationdate: ''); | ||||
| 		$view->setParam('revisiondate', isset($revisiondate) ? $revisiondate: ''); | ||||
| 		$view->setParam('statusdate', isset($statusdate) ? $statusdate: ''); | ||||
| 		$view->setParam('status', isset($status) ? $status : array()); | ||||
| 		$view->setParam('categories', isset($categories) ? $categories : ''); | ||||
| 		$view->setParam('category', isset($categorynames) ? $categorynames : ''); | ||||
| 		$view->setParam('mimetype', isset($mimetype) ? $mimetype : ''); | ||||
| 		$view->setParam('attributes', isset($attributes) ? $attributes : ''); | ||||
| 		$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all)); | ||||
|  |  | |||
|  | @ -180,19 +180,18 @@ function typeahead() { /* {{{ */ | |||
| 		$enablefullsearch = $this->params['enablefullsearch']; | ||||
| 		$enableclipboard = $this->params['enableclipboard']; | ||||
| 		$attributes = $this->params['attributes']; | ||||
| 		$category = $this->params['category']; | ||||
| 		$categories = $this->params['categories']; | ||||
| 		$mimetype = $this->params['mimetype']; | ||||
| 		$owner = $this->params['owner']; | ||||
| 		$startfolder = $this->params['startfolder']; | ||||
| 		$startdate = $this->params['startdate']; | ||||
| 		$stopdate = $this->params['stopdate']; | ||||
| 		$createstartdate = $this->params['createstartdate']; | ||||
| 		$createenddate = $this->params['createenddate']; | ||||
| 		$expstartdate = $this->params['expstartdate']; | ||||
| 		$expstopdate = $this->params['expstopdate']; | ||||
| 		$expenddate = $this->params['expenddate']; | ||||
| 		$statusstartdate = $this->params['statusstartdate']; | ||||
| 		$statusstopdate = $this->params['statusstopdate']; | ||||
| 		$statusenddate = $this->params['statusenddate']; | ||||
| 		$revisionstartdate = $this->params['revisionstartdate']; | ||||
| 		$revisionstopdate = $this->params['revisionstopdate']; | ||||
| 		$revisionenddate = $this->params['revisionenddate']; | ||||
| 		$creationdate = $this->params['creationdate']; | ||||
| 		$expirationdate = $this->params['expirationdate']; | ||||
| 		$statusdate = $this->params['statusdate']; | ||||
|  | @ -229,8 +228,6 @@ function typeahead() { /* {{{ */ | |||
| //		if ($pageNumber != 'all')
 | ||||
| //			$entries = array_slice($entries, ($pageNumber-1)*$limit, $limit);
 | ||||
| 
 | ||||
| 		$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/bootbox/bootbox.min.js"></script>'."\n", 'js'); | ||||
| 
 | ||||
| 		$this->htmlStartPage(getMLText("search_results")); | ||||
| 		$this->globalNavigation(); | ||||
| 		$this->contentStart(); | ||||
|  | @ -240,7 +237,7 @@ function typeahead() { /* {{{ */ | |||
| 		$this->columnStart(4); | ||||
| //echo "<pre>";print_r($_GET);echo "</pre>";
 | ||||
| ?>
 | ||||
|   <ul class="nav nav-tabs" id="searchtab"> | ||||
|   <ul class="nav nav-pills" id="searchtab"> | ||||
| 	  <li class="nav-item <?php echo ($fullsearch == false) ? 'active' : ''; ?>"><a class="nav-link <?php echo ($fullsearch == false) ? 'active' : ''; ?>" data-target="#database" data-toggle="tab"><?php printMLText('databasesearch'); ?></a></li>
 | ||||
| <?php | ||||
| 		if($enablefullsearch) { | ||||
|  | @ -252,110 +249,98 @@ function typeahead() { /* {{{ */ | |||
| 	</ul> | ||||
| 	<div class="tab-content"> | ||||
| 	  <div class="tab-pane <?php echo ($fullsearch == false) ? 'active' : ''; ?>" id="database"> | ||||
| <form action="../out/out.Search.php" name="form1"> | ||||
| <form class="form-horizontal" action="../out/out.Search.php" name="form1"> | ||||
| <input type="hidden" name="fullsearch" value="0" /> | ||||
| <?php | ||||
| // Database search Form {{{
 | ||||
| 		$this->contentContainerStart(); | ||||
| ?>
 | ||||
| <table class="table-condensed"> | ||||
| <tr> | ||||
| <td><?php printMLText("search_query");?>:</td>
 | ||||
| <td> | ||||
| <input type="text" name="query" value="<?php echo htmlspecialchars($this->query); ?>" /> | ||||
| <select name="mode"> | ||||
| <option value="1" <?php echo ($mode=='AND') ? "selected" : ""; ?>><?php printMLText("search_mode_and");?>
 | ||||
| <option value="0"<?php echo ($mode=='OR') ? "selected" : ""; ?>><?php printMLText("search_mode_or");?>
 | ||||
| </select> | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("search_in");?>:</td>
 | ||||
| <td> | ||||
| <label class="checkbox" for="keywords"><input type="checkbox" id="keywords" name="searchin[]" value="1" <?php if(in_array('1', $searchin)) echo " checked"; ?>><?php printMLText("keywords");?> (<?php printMLText('documents_only'); ?>)</label>
 | ||||
| <label class="checkbox" for="searchName"><input type="checkbox" name="searchin[]" id="searchName" value="2" <?php if(in_array('2', $searchin)) echo " checked"; ?>><?php printMLText("name");?></label>
 | ||||
| <label class="checkbox" for="comment"><input type="checkbox" name="searchin[]" id="comment" value="3" <?php if(in_array('3', $searchin)) echo " checked"; ?>><?php printMLText("comment");?></label>
 | ||||
| <label class="checkbox" for="attributes"><input type="checkbox" name="searchin[]" id="attributes" value="4" <?php if(in_array('4', $searchin)) echo " checked"; ?>><?php printMLText("attributes");?></label>
 | ||||
| <label class="checkbox" for="id"><input type="checkbox" name="searchin[]" id="id" value="5" <?php if(in_array('5', $searchin)) echo " checked"; ?>><?php printMLText("id");?></label>
 | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("owner");?>:</td>
 | ||||
| <td> | ||||
| <select class="chzn-select" name="owner[]" data-allow-clear="true" data-placeholder="<?php printMLText('select_users'); ?>" data-no_results_text="<?php printMLText('unknown_owner'); ?>"> | ||||
| <option value=""></option> | ||||
| <?php | ||||
| 		foreach ($allUsers as $userObj) { | ||||
| 			if ($userObj->isGuest() || ($userObj->isHidden() && $userObj->getID() != $user->getID() && !$user->isAdmin())) | ||||
| 				continue; | ||||
| 			print "<option value=\"".$userObj->getLogin()."\" ".(in_array($userObj->getLogin(), $owner) ? "selected" : "").">" . htmlspecialchars($userObj->getLogin()." - ".$userObj->getFullName()) . "</option>\n"; | ||||
| 		} | ||||
| ?>
 | ||||
| </select> | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("search_resultmode");?>:</td>
 | ||||
| <td> | ||||
| <select name="resultmode" class="form-control"> | ||||
| <option value="1"<?php echo ($resultmode=='1') ? "selected" : ""; ?>><?php printMLText("search_mode_documents");?>
 | ||||
| <option value="2"<?php echo ($resultmode=='2') ? "selected" : ""; ?>><?php printMLText("search_mode_folders");?>
 | ||||
| <option value="3" <?php echo ($resultmode=='3') ? "selected" : ""; ?>><?php printMLText("search_resultmode_both");?>
 | ||||
| </select> | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("under_folder")?>:</td>
 | ||||
| <td><?php $this->printFolderChooserHtml("form1", M_READ, -1, $startfolder);?></td>
 | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("creation_date");?>:</td>
 | ||||
| <td> | ||||
|         <label class="checkbox inline"> | ||||
| 				  <input type="checkbox" name="creationdate" value="true" <?php if($creationdate) echo "checked"; ?>/><?php printMLText("between");?>
 | ||||
|         </label><br /> | ||||
|         <span class="input-append date" style="display: inline;" id="createstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> | ||||
|           <input class="span4" size="16" name="createstart" type="text" value="<?php if($startdate) printf("%04d-%02d-%02d", $startdate['year'], $startdate['month'], $startdate['day']); else echo date('Y-m-d'); ?>"> | ||||
|           <span class="add-on"><i class="fa fa-calendar"></i></span> | ||||
|         </span>  | ||||
| 				<?php printMLText("and"); ?>
 | ||||
|         <span class="input-append date" style="display: inline;" id="createenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> | ||||
|           <input class="span4" size="16" name="createend" type="text" value="<?php if($stopdate) printf("%04d-%02d-%02d", $stopdate['year'], $stopdate['month'], $stopdate['day']); else echo date('Y-m-d'); ?>"> | ||||
|           <span class="add-on"><i class="fa fa-calendar"></i></span> | ||||
|         </span> | ||||
| </td> | ||||
| </tr> | ||||
| 
 | ||||
| <?php | ||||
| 		$this->formField( | ||||
| 			getMLText("search_query"), | ||||
| 			array( | ||||
| 				'element'=>'input', | ||||
| 				'type'=>'text', | ||||
| 				'name'=>'query', | ||||
| 				'value'=>htmlspecialchars($this->query) | ||||
| 			) | ||||
| 		); | ||||
| 		$options = array(); | ||||
| 		$options[] = array('1', getMLText('search_mode_and'), $mode=='AND'); | ||||
| 		$options[] = array('0', getMLText('search_mode_or'), $mode=='OR'); | ||||
| 		$this->formField( | ||||
| 			getMLText("search_mode"), | ||||
| 			array( | ||||
| 				'element'=>'select', | ||||
| 				'name'=>'mode', | ||||
| 				'multiple'=>false, | ||||
| 				'options'=>$options | ||||
| 			) | ||||
| 		); | ||||
| 		$options = array(); | ||||
| 		$options[] = array('1', getMLText('keywords').' ('.getMLText('documents_only').')', in_array('1', $searchin)); | ||||
| 		$options[] = array('2', getMLText('name'), in_array('2', $searchin)); | ||||
| 		$options[] = array('3', getMLText('comment'), in_array('3', $searchin)); | ||||
| 		$options[] = array('4', getMLText('attributes'), in_array('4', $searchin)); | ||||
| 		$options[] = array('5', getMLText('id'), in_array('5', $searchin)); | ||||
| 		$this->formField( | ||||
| 			getMLText("search_in"), | ||||
| 			array( | ||||
| 				'element'=>'select', | ||||
| 				'name'=>'searchin[]', | ||||
| 				'class'=>'chzn-select', | ||||
| 				'multiple'=>true, | ||||
| 				'options'=>$options | ||||
| 			) | ||||
| 		); | ||||
| 		$options = array(); | ||||
| 		foreach ($allUsers as $currUser) { | ||||
| 			if($user->isAdmin() || (!$currUser->isGuest() && (!$currObj->isHidden() || $currObj->getID() == $user->getID()))) | ||||
| 				$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), in_array($currUser->getID(), $owner), array(array('data-subtitle', htmlspecialchars($currUser->getFullName())))); | ||||
| 		} | ||||
| 		$this->formField( | ||||
| 			getMLText("owner"), | ||||
| 			array( | ||||
| 				'element'=>'select', | ||||
| 				'name'=>'owner[]', | ||||
| 				'class'=>'chzn-select', | ||||
| 				'multiple'=>true, | ||||
| 				'options'=>$options | ||||
| 			) | ||||
| 		); | ||||
| 		$options = array(); | ||||
| 		$options[] = array('1', getMLText('search_mode_documents'), $resultmode==1); | ||||
| 		$options[] = array('2', getMLText('search_mode_folders'), $resultmode==2); | ||||
| 		$options[] = array('3', getMLText('search_resultmode_both'), $resultmode==3); | ||||
| 		$this->formField( | ||||
| 			getMLText("search_resultmode"), | ||||
| 			array( | ||||
| 				'element'=>'select', | ||||
| 				'name'=>'resultmode', | ||||
| 				'multiple'=>false, | ||||
| 				'options'=>$options | ||||
| 			) | ||||
| 		); | ||||
| 		$this->formField(getMLText("under_folder"), $this->getFolderChooserHtml("form1", M_READ, -1, $startfolder)); | ||||
| 		$this->formField( | ||||
| 			getMLText("creation_date")." (".getMLText('from').")", | ||||
| 			$this->getDateChooser($createstartdate, "createstart", $this->params['session']->getLanguage()) | ||||
| 		); | ||||
| 		$this->formField( | ||||
| 			getMLText("creation_date")." (".getMLText('to').")", | ||||
| 			$this->getDateChooser($createenddate, "createend", $this->params['session']->getLanguage()) | ||||
| 		); | ||||
| 		if($attrdefs) { | ||||
| 			foreach($attrdefs as $attrdef) { | ||||
| 				$attricon = ''; | ||||
| 				if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) { | ||||
| ?>
 | ||||
| <tr> | ||||
| 	<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
 | ||||
| 	<td> | ||||
| <?php | ||||
| 					if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) | ||||
| 						echo $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from').'  '.getMLText('to').' '.$this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to'); | ||||
| 					else | ||||
| 						$this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true) | ||||
| ?>
 | ||||
| 	</td> | ||||
| </tr> | ||||
| 
 | ||||
| <?php | ||||
| 					if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) { | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from')); | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to')); | ||||
| 					} else | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true)); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| ?>
 | ||||
| 
 | ||||
| <tr> | ||||
| <td></td><td><button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> <?php printMLText("search"); ?></button></td>
 | ||||
| </tr> | ||||
| 
 | ||||
| </table> | ||||
| <?php | ||||
| 		$this->formSubmit("<i class=\"fa fa-search\"></i> ".getMLText('search')); | ||||
| 		$this->contentContainerEnd(); | ||||
| 		// }}}
 | ||||
| 
 | ||||
|  | @ -366,14 +351,13 @@ function typeahead() { /* {{{ */ | |||
| 		$openfilterdlg = false; | ||||
| 		if($attrdefs) { | ||||
| 			foreach($attrdefs as $attrdef) { | ||||
| 				$attricon = ''; | ||||
| 				if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_document || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent) { | ||||
| 					if(!empty($attributes[$attrdef->getID()])) | ||||
| 						$openfilterdlg = true; | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		if($category) | ||||
| 		if($categories) | ||||
| 			$openfilterdlg = true; | ||||
| 		if($status) | ||||
| 			$openfilterdlg = true; | ||||
|  | @ -409,189 +393,120 @@ function typeahead() { /* {{{ */ | |||
|   </div> | ||||
| </div> | ||||
| <?php endif; ?>
 | ||||
| <div class="accordion" id="accordion2"> | ||||
|   <div class="accordion-group"> | ||||
|     <div class="accordion-heading"> | ||||
|       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne"> | ||||
|         <?php printMLText('filter_for_documents'); ?>
 | ||||
|       </a> | ||||
|     </div> | ||||
|     <div id="collapseOne" class="accordion-body <?php if(!$openfilterdlg) echo "collapse";?>"> | ||||
|       <div class="accordion-inner"> | ||||
| <table class="table-condensed"> | ||||
| <tr> | ||||
| <td><?php printMLText("category");?>:</td>
 | ||||
| <td> | ||||
| <select class="chzn-select" name="category[]" multiple="multiple" data-placeholder="<?php printMLText('select_category'); ?>" data-no_results_text="<?php printMLText('unknown_document_category'); ?>"> | ||||
| <!-- | ||||
| <option value="-1"><?php printMLText("all_categories");?>
 | ||||
| --> | ||||
| <?php | ||||
| 		/* Start of fields only applicable to documents */ | ||||
| 		ob_start(); | ||||
| 		$tmpcatids = array(); | ||||
| 		foreach($categories as $tmpcat) | ||||
| 			$tmpcatids[] = $tmpcat->getID(); | ||||
| 		foreach ($allCats as $catObj) { | ||||
| 			print "<option value=\"".$catObj->getName()."\" ".(in_array($catObj->getID(), $tmpcatids) ? "selected" : "").">" . htmlspecialchars($catObj->getName()) . "\n"; | ||||
| 		$options = array(); | ||||
| 		$allcategories = $dms->getDocumentCategories(); | ||||
| 		foreach($allcategories as $category) { | ||||
| 			$options[] = array($category->getID(), $category->getName(), in_array($category->getId(), $tmpcatids)); | ||||
| 		} | ||||
| ?>
 | ||||
| </select> | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("status");?>:</td>
 | ||||
| <td> | ||||
| <?php if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') { ?>
 | ||||
| <label class="checkbox" for='draft'><input type="checkbox" id="draft" name="draft" value="1" <?php echo in_array(S_DRAFT, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT);?></label>
 | ||||
| <?php if($workflowmode == 'traditional') { ?>
 | ||||
| <label class="checkbox" for='pendingReview'><input type="checkbox" id="pendingReview" name="pendingReview" value="1" <?php echo in_array(S_DRAFT_REV, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT_REV);?></label>
 | ||||
| <?php } ?>
 | ||||
| <label class="checkbox" for='pendingApproval'><input type="checkbox" id="pendingApproval" name="pendingApproval" value="1" <?php echo in_array(S_DRAFT_APP, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT_APP);?></label>
 | ||||
| <?php } elseif($workflowmode == 'advanced') { ?>
 | ||||
| <label class="checkbox" for='inWorkflow'><input type="checkbox" id="inWorkflow" name="inWorkflow" value="1" <?php echo in_array(S_IN_WORKFLOW, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_IN_WORKFLOW);?></label>
 | ||||
| <?php } ?>
 | ||||
| <label class="checkbox" for='released'><input type="checkbox" id="released" name="released" value="1" <?php echo in_array(S_RELEASED, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_RELEASED);?></label>
 | ||||
| <label class="checkbox" for='rejected'><input type="checkbox" id="rejected" name="rejected" value="1" <?php echo in_array(S_REJECTED, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_REJECTED);?></label>
 | ||||
| <label class="checkbox" for='inrevision'><input type="checkbox" id="inrevision" name="inrevision" value="1" <?php echo in_array(S_IN_REVISION, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_IN_REVISION);?></label>
 | ||||
| <label class="checkbox" for='obsolete'><input type="checkbox" id="obsolete" name="obsolete" value="1" <?php echo in_array(S_OBSOLETE, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_OBSOLETE);?></label>
 | ||||
| <label class="checkbox" for='expired'><input type="checkbox" id="expired" name="expired" value="1" <?php echo in_array(S_EXPIRED, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_EXPIRED);?></label>
 | ||||
| <label class="checkbox" for='needs_correction'><input type="checkbox" id="needs_correction" name="needs_correction" value="1" <?php echo in_array(S_NEEDS_CORRECTION, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_NEEDS_CORRECTION);?></label>
 | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("reception");?>:</td>
 | ||||
| <td> | ||||
| <label class="checkbox" for='reception'><input type="checkbox" id="reception" name="reception[]" value="missingaction" <?php echo in_array('missingaction', $reception) ? "checked" : ""; ?>><?php printMLText('reception_noaction'); ?></label>
 | ||||
| <label class="checkbox" for='reception'><input type="checkbox" id="reception" name="reception[]" value="hasrejection" <?php echo in_array('hasrejection', $reception) ? "checked" : ""; ?>><?php printMLText('reception_rejected'); ?></label>
 | ||||
| <label class="checkbox" for='reception'><input type="checkbox" id="reception" name="reception[]" value="hasacknowledge" <?php echo in_array('hasacknowledge', $reception) ? "checked" : ""; ?>><?php printMLText('reception_acknowleged'); ?></label>
 | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("expires");?>:</td>
 | ||||
| <td> | ||||
|         <label class="checkbox inline"> | ||||
| 				  <input type="checkbox" name="expirationdate" value="true" <?php if($expirationdate) echo "checked"; ?>/><?php printMLText("between");?>
 | ||||
|         </label><br /> | ||||
|         <span class="input-append date" style="display: inline;" id="expirationstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> | ||||
|           <input class="span4" size="16" name="expirationstart" type="text" value="<?php if($expstartdate) printf("%04d-%02d-%02d", $expstartdate['year'], $expstartdate['month'], $expstartdate['day']); else echo date('Y-m-d'); ?>"> | ||||
|           <span class="add-on"><i class="fa fa-calendar"></i></span> | ||||
|         </span>  | ||||
| 				<?php printMLText("and"); ?>
 | ||||
|         <span class="input-append date" style="display: inline;" id="expirationenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> | ||||
|           <input class="span4" size="16" name="expirationend" type="text" value="<?php if($expstopdate) printf("%04d-%02d-%02d", $expstopdate['year'], $expstopdate['month'], $expstopdate['day']); else echo date('Y-m-d'); ?>"> | ||||
|           <span class="add-on"><i class="fa fa-calendar"></i></span> | ||||
|         </span> | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("revision");?>:</td>
 | ||||
| <td> | ||||
|         <label class="checkbox inline"> | ||||
| 				  <input type="checkbox" name="revisiondate" value="true" <?php if($revisiondate) echo "checked"; ?>/><?php printMLText("between");?>
 | ||||
|         </label><br /> | ||||
|         <span class="input-append date" style="display: inline;" id="revisionstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> | ||||
|           <input class="span4" size="16" name="revisionstart" type="text" value="<?php if($revisionstartdate) printf("%04d-%02d-%02d", $revisionstartdate['year'], $revisionstartdate['month'], $revisionstartdate['day']); else echo date('Y-m-d'); ?>"> | ||||
|           <span class="add-on"><i class="fa fa-calendar"></i></span> | ||||
|         </span>  | ||||
| 				<?php printMLText("and"); ?>
 | ||||
|         <span class="input-append date" style="display: inline;" id="revisionenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> | ||||
|           <input class="span4" size="16" name="revisionend" type="text" value="<?php if($revisionstopdate) printf("%04d-%02d-%02d", $revisionstopdate['year'], $revisionstopdate['month'], $revisionstopdate['day']); else echo date('Y-m-d'); ?>"> | ||||
|           <span class="add-on"><i class="fa fa-calendar"></i></span> | ||||
|         </span> | ||||
| </td> | ||||
| </tr> | ||||
| <tr> | ||||
| <td><?php printMLText("status_change");?>:</td>
 | ||||
| <td> | ||||
|         <label class="checkbox inline"> | ||||
| 				  <input type="checkbox" name="statusdate" value="true" <?php if($statusdate) echo "checked"; ?>/><?php printMLText("between");?>
 | ||||
|         </label><br /> | ||||
|         <span class="input-append date datepicker" style="display: inline;" id="statusstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> | ||||
|           <input class="span4" size="16" name="statusstart" type="text" value="<?php if($statusstartdate) printf("%04d-%02d-%02d", $statusstartdate['year'], $statusstartdate['month'], $statusstartdate['day']); else echo date('Y-m-d'); ?>"> | ||||
|           <span class="add-on"><i class="fa fa-calendar"></i></span> | ||||
|         </span>  | ||||
| 				<?php printMLText("and"); ?>
 | ||||
|         <span class="input-append date datepicker" style="display: inline;" id="statusenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> | ||||
|           <input class="span4" size="16" name="statusend" type="text" value="<?php if($statusstopdate) printf("%04d-%02d-%02d", $statusstopdate['year'], $statusstopdate['month'], $statusstopdate['day']); else echo date('Y-m-d'); ?>"> | ||||
|           <span class="add-on"><i class="fa fa-calendar"></i></span> | ||||
|         </span> | ||||
| </td> | ||||
| </tr> | ||||
| <?php | ||||
| 		$this->formField( | ||||
| 			getMLText("categories"), | ||||
| 			array( | ||||
| 				'element'=>'select', | ||||
| 				'class'=>'chzn-select', | ||||
| 				'name'=>'category[]', | ||||
| 				'multiple'=>true, | ||||
| 				'attributes'=>array(array('data-placeholder', getMLText('select_category'), array('data-no_results_text', getMLText('unknown_document_category')))), | ||||
| 				'options'=>$options | ||||
| 			) | ||||
| 		); | ||||
| 		$options = array(); | ||||
| 		if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') { | ||||
| 			if($workflowmode == 'traditional') {  | ||||
| 				$options[] = array(S_DRAFT_REV, getOverallStatusText(S_DRAFT_REV), in_array(S_DRAFT_REV, $status)); | ||||
| 			} | ||||
| 		} elseif($workflowmode == 'advanced') { | ||||
| 			$options[] = array(S_IN_WORKFLOW, getOverallStatusText(S_IN_WORKFLOW), in_array(S_IN_WORKFLOW, $status)); | ||||
| 		} | ||||
| 		$options[] = array(S_DRAFT_APP, getOverallStatusText(S_DRAFT_APP), in_array(S_DRAFT_APP, $status)); | ||||
| 		$options[] = array(S_RELEASED, getOverallStatusText(S_RELEASED), in_array(S_RELEASED, $status)); | ||||
| 		$options[] = array(S_REJECTED, getOverallStatusText(S_REJECTED), in_array(S_REJECTED, $status)); | ||||
| 		$options[] = array(S_IN_REVISION, getOverallStatusText(S_IN_REVISION), in_array(S_IN_REVISION, $status)); | ||||
| 		$options[] = array(S_EXPIRED, getOverallStatusText(S_EXPIRED), in_array(S_EXPIRED, $status)); | ||||
| 		$options[] = array(S_OBSOLETE, getOverallStatusText(S_OBSOLETE), in_array(S_OBSOLETE, $status)); | ||||
| 		$options[] = array(S_NEEDS_CORRECTION, getOverallStatusText(S_NEEDS_CORRECTION), in_array(S_NEEDS_CORRECTION, $status)); | ||||
| 		$this->formField( | ||||
| 			getMLText("status"), | ||||
| 			array( | ||||
| 				'element'=>'select', | ||||
| 				'class'=>'chzn-select', | ||||
| 				'name'=>'status[]', | ||||
| 				'multiple'=>true, | ||||
| 				'attributes'=>array(array('data-placeholder', getMLText('select_status')), array('data-no_results_text', getMLText('unknown_status'))), | ||||
| 				'options'=>$options | ||||
| 			) | ||||
| 		); | ||||
| 		$this->formField( | ||||
| 			getMLText("expires")." (".getMLText('from').")", | ||||
| 			$this->getDateChooser($expstartdate, "expirationstart", $this->params['session']->getLanguage()) | ||||
| 		); | ||||
| 		$this->formField( | ||||
| 			getMLText("expires")." (".getMLText('to').")", | ||||
| 			$this->getDateChooser($expenddate, "expirationend", $this->params['session']->getLanguage()) | ||||
| 		); | ||||
| 		$this->formField( | ||||
| 			getMLText("revision")." (".getMLText('from').")", | ||||
| 			$this->getDateChooser($revisionstartdate, "revisiondatestart", $this->params['session']->getLanguage()) | ||||
| 		); | ||||
| 		$this->formField( | ||||
| 			getMLText("revision")." (".getMLText('to').")", | ||||
| 			$this->getDateChooser($revisionenddate, "revisiondateend", $this->params['session']->getLanguage()) | ||||
| 		); | ||||
| 		$this->formField( | ||||
| 			getMLText("status_change")." (".getMLText('from').")", | ||||
| 			$this->getDateChooser($statusstartdate, "statusdatestart", $this->params['session']->getLanguage()) | ||||
| 		); | ||||
| 		$this->formField( | ||||
| 			getMLText("status_change")." (".getMLText('to').")", | ||||
| 			$this->getDateChooser($statusenddate, "statusdateend", $this->params['session']->getLanguage()) | ||||
| 		); | ||||
| 		if($attrdefs) { | ||||
| 			foreach($attrdefs as $attrdef) { | ||||
| 				$attricon = ''; | ||||
| 				if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_document || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent) { | ||||
| ?>
 | ||||
| <tr> | ||||
| 	<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
 | ||||
| 	<td> | ||||
| <?php | ||||
| 					if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) | ||||
| 						echo $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from').'  '.getMLText('to').' '.$this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to'); | ||||
| 					else | ||||
| 						$this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true) | ||||
| ?></td>
 | ||||
| </tr> | ||||
| 
 | ||||
| <?php | ||||
| 					if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) { | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from')); | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to')); | ||||
| 					} else | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true)); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| ?>
 | ||||
| </table> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </div> | ||||
| <?php | ||||
| 		// }}}
 | ||||
| 
 | ||||
| 		// Seach options for folders {{{
 | ||||
| 		$content = ob_get_clean(); | ||||
| 		$this->printAccordion(getMLText('filter_for_documents'), $content); | ||||
| 		/* First check if any of the folder filters are set. If it is, | ||||
| 		 * open the accordion. | ||||
| 		 */ | ||||
| 		$openfilterdlg = false; | ||||
| 		if($attrdefs) { | ||||
| 			foreach($attrdefs as $attrdef) { | ||||
| 				$attricon = ''; | ||||
| 				if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) { | ||||
| 					if(!empty($attributes[$attrdef->getID()])) | ||||
| 						$openfilterdlg = true; | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| ?>
 | ||||
| <div class="accordion" id="accordion3"> | ||||
|   <div class="accordion-group"> | ||||
|     <div class="accordion-heading"> | ||||
|       <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion3" href="#collapseFolder"> | ||||
|         <?php printMLText('filter_for_folders'); ?>
 | ||||
|       </a> | ||||
|     </div> | ||||
|     <div id="collapseFolder" class="accordion-body <?php if(!$openfilterdlg) echo "collapse";?>"> | ||||
|       <div class="accordion-inner"> | ||||
| <table class="table-condensed"> | ||||
| <?php | ||||
| 		ob_start(); | ||||
| 		if($attrdefs) { | ||||
| 			foreach($attrdefs as $attrdef) { | ||||
| 				$attricon = ''; | ||||
| 				if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) { | ||||
| ?>
 | ||||
| <tr> | ||||
| 	<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
 | ||||
| 	<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : null, 'attributes', true) ?></td>
 | ||||
| </tr> | ||||
| <?php | ||||
| 					if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) { | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from')); | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to')); | ||||
| 					} else | ||||
| 						$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true)); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| ?>
 | ||||
| </table> | ||||
|       </div> | ||||
|     </div> | ||||
|   </div> | ||||
| </div> | ||||
| <?php | ||||
| 		$content = ob_get_clean(); | ||||
| 		$this->printAccordion(getMLText('filter_for_folders'), $content); | ||||
| 		// }}}
 | ||||
| ?>
 | ||||
| </form> | ||||
|  | @ -603,84 +518,86 @@ function typeahead() { /* {{{ */ | |||
| 		// Fulltext search Form {{{
 | ||||
| 		if($enablefullsearch) { | ||||
| 	  	echo "<div class=\"tab-pane ".(($fullsearch == true) ? 'active' : '')."\" id=\"fulltext\">\n"; | ||||
| 	$this->contentContainerStart(); | ||||
| ?>
 | ||||
| <form action="../out/out.Search.php" name="form2" style="min-height: 330px;"> | ||||
| <input type="hidden" name="fullsearch" value="1" /> | ||||
| <table class="table-condensed"> | ||||
| <tr> | ||||
| <td><?php printMLText("search_query");?>:</td>
 | ||||
| <td> | ||||
| <input type="text" class="form-control" name="query" value="<?php echo htmlspecialchars($this->query); ?>" /> | ||||
| <!-- | ||||
| <select name="mode"> | ||||
| <option value="1" selected><?php printMLText("search_mode_and");?>
 | ||||
| <option value="0"><?php printMLText("search_mode_or");?>
 | ||||
| </select> | ||||
| --> | ||||
| </td> | ||||
| </tr> | ||||
| <?php if(!isset($facets['owner'])) { ?>
 | ||||
| <tr> | ||||
| <td><?php printMLText("owner");?>:</td>
 | ||||
| <td> | ||||
| <select class="chzn-select" name="owner[]" data-allow-clear="true" data-placeholder="<?php printMLText('select_users'); ?>" data-no_results_text="<?php printMLText('unknown_owner'); ?>"> | ||||
| <option value=""></option> | ||||
| <?php | ||||
| 			foreach ($allUsers as $userObj) { | ||||
| 				if ($userObj->isGuest() || ($userObj->isHidden() && $userObj->getID() != $user->getID() && !$user->isAdmin())) | ||||
| 					continue; | ||||
| 				print "<option value=\"".$userObj->getLogin()."\" ".(in_array($userObj->getLogin(), $owner) ? "selected" : "").">" . htmlspecialchars($userObj->getLogin()." - ".$userObj->getFullName()) . "</option>\n"; | ||||
| 			$this->contentContainerStart(); | ||||
| 			$this->formField( | ||||
| 				getMLText("search_query"), | ||||
| 				array( | ||||
| 					'element'=>'input', | ||||
| 					'type'=>'text', | ||||
| 					'name'=>'query', | ||||
| 					'value'=>htmlspecialchars($this->query) | ||||
| 				) | ||||
| 			); | ||||
| 			$this->formField(getMLText("under_folder"), $this->getFolderChooserHtml("form1", M_READ, -1, $startfolder, 'folderfullsearchid')); | ||||
| 			if(!isset($facets['owner'])) { | ||||
| 			$options = array(); | ||||
| 			foreach ($allUsers as $currUser) { | ||||
| 				if($user->isAdmin() || (!$currUser->isGuest() && (!$currObj->isHidden() || $currObj->getID() == $user->getID()))) | ||||
| 					$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), in_array($currUser->getID(), $owner), array(array('data-subtitle', htmlspecialchars($currUser->getFullName())))); | ||||
| 			} | ||||
| ?>
 | ||||
| </select> | ||||
| </td> | ||||
| </tr> | ||||
| <?php } ?>
 | ||||
| <?php if(!isset($facets['category'])) { ?>
 | ||||
| <tr> | ||||
| <td><?php printMLText("category_filter");?>:</td>
 | ||||
| <td> | ||||
| <select class="chzn-select" name="categoryids[]" multiple="multiple" data-placeholder="<?php printMLText('select_category'); ?>" data-no_results_text="<?php printMLText('unknown_document_category'); ?>"> | ||||
| <!-- | ||||
| <option value="-1"><?php printMLText("all_categories");?>
 | ||||
| --> | ||||
| <?php | ||||
| 		$tmpcatids = array(); | ||||
| 		foreach($categories as $tmpcat) | ||||
| 			$tmpcatids[] = $tmpcat->getID(); | ||||
| 		foreach ($allCats as $catObj) { | ||||
| 			print "<option value=\"".$catObj->getID()."\" ".(in_array($catObj->getID(), $tmpcatids) ? "selected" : "").">" . htmlspecialchars($catObj->getName()) . "\n"; | ||||
| 			$this->formField( | ||||
| 				getMLText("owner"), | ||||
| 				array( | ||||
| 					'element'=>'select', | ||||
| 					'name'=>'owner[]', | ||||
| 					'class'=>'chzn-select', | ||||
| 					'multiple'=>true, | ||||
| 					'options'=>$options | ||||
| 				) | ||||
| 			); | ||||
| 		} | ||||
| ?>
 | ||||
| </select> | ||||
| </td> | ||||
| </tr> | ||||
| <?php } ?>
 | ||||
| <tr> | ||||
| <td><?php printMLText("status");?>:</td>
 | ||||
| <td> | ||||
| <?php if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') { ?>
 | ||||
| <?php if($workflowmode == 'traditional') { ?>
 | ||||
| <label class="checkbox" for='pendingReview'><input type="checkbox" id="pendingReview" name="pendingReview" value="1" <?php echo in_array(S_DRAFT_REV, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT_REV);?></label>
 | ||||
| <?php } ?>
 | ||||
| <label class="checkbox" for='pendingApproval'><input type="checkbox" id="pendingApproval" name="pendingApproval" value="1" <?php echo in_array(S_DRAFT_APP, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_DRAFT_APP);?></label>
 | ||||
| <?php } elseif($workflowmode == 'advanced') { ?>
 | ||||
| <label class="checkbox" for='inWorkflow'><input type="checkbox" id="inWorkflow" name="inWorkflow" value="1" <?php echo in_array(S_IN_WORKFLOW, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_IN_WORKFLOW);?></label>
 | ||||
| <?php } ?>
 | ||||
| <label class="checkbox" for='released'><input type="checkbox" id="released" name="released" value="1" <?php echo in_array(S_RELEASED, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_RELEASED);?></label>
 | ||||
| <label class="checkbox" for='rejected'><input type="checkbox" id="rejected" name="rejected" value="1" <?php echo in_array(S_REJECTED, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_REJECTED);?></label>
 | ||||
| <label class="checkbox" for='obsolete'><input type="checkbox" id="obsolete" name="obsolete" value="1" <?php echo in_array(S_OBSOLETE, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_OBSOLETE);?></label>
 | ||||
| <label class="checkbox" for='expired'><input type="checkbox" id="expired" name="expired" value="1" <?php echo in_array(S_EXPIRED, $status) ? "checked" : ""; ?>><?php printOverallStatusText(S_EXPIRED);?></label>
 | ||||
| </td> | ||||
| </tr> | ||||
| <?php if($facets) { | ||||
| 		if(!isset($facets['category'])) { | ||||
| 			$tmpcatids = array(); | ||||
| 			foreach($categories as $tmpcat) | ||||
| 				$tmpcatids[] = $tmpcat->getID(); | ||||
| 			$options = array(); | ||||
| 			$allcategories = $dms->getDocumentCategories(); | ||||
| 			foreach($allcategories as $category) { | ||||
| 				$options[] = array($category->getID(), $category->getName(), in_array($category->getId(), $tmpcatids)); | ||||
| 			} | ||||
| 			$this->formField( | ||||
| 				getMLText("category_filter"), | ||||
| 				array( | ||||
| 					'element'=>'select', | ||||
| 					'class'=>'chzn-select', | ||||
| 					'name'=>'category[]', | ||||
| 					'multiple'=>true, | ||||
| 					'attributes'=>array(array('data-placeholder', getMLText('select_category'), array('data-no_results_text', getMLText('unknown_document_category')))), | ||||
| 					'options'=>$options | ||||
| 				) | ||||
| 			); | ||||
| 		} | ||||
| 		$options = array(); | ||||
| 		if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') { | ||||
| 			if($workflowmode == 'traditional') {  | ||||
| 				$options[] = array(S_DRAFT_REV, getOverallStatusText(S_DRAFT_REV), in_array(S_DRAFT_REV, $status)); | ||||
| 			} | ||||
| 		} elseif($workflowmode == 'advanced') { | ||||
| 			$options[] = array(S_IN_WORKFLOW, getOverallStatusText(S_IN_WORKFLOW), in_array(S_IN_WORKFLOW, $status)); | ||||
| 		} | ||||
| 		$options[] = array(S_DRAFT_APP, getOverallStatusText(S_DRAFT_APP), in_array(S_DRAFT_APP, $status)); | ||||
| 		$options[] = array(S_RELEASED, getOverallStatusText(S_RELEASED), in_array(S_RELEASED, $status)); | ||||
| 		$options[] = array(S_REJECTED, getOverallStatusText(S_REJECTED), in_array(S_REJECTED, $status)); | ||||
| 		$options[] = array(S_EXPIRED, getOverallStatusText(S_EXPIRED), in_array(S_EXPIRED, $status)); | ||||
| 		$options[] = array(S_OBSOLETE, getOverallStatusText(S_OBSOLETE), in_array(S_OBSOLETE, $status)); | ||||
| 		$this->formField( | ||||
| 			getMLText("status"), | ||||
| 			array( | ||||
| 				'element'=>'select', | ||||
| 				'class'=>'chzn-select', | ||||
| 				'name'=>'status[]', | ||||
| 				'multiple'=>true, | ||||
| 				'attributes'=>array(array('data-placeholder', getMLText('select_status')), array('data-no_results_text', getMLText('unknown_status'))), | ||||
| 				'options'=>$options | ||||
| 			) | ||||
| 		); | ||||
| 
 | ||||
| 		if($facets) { | ||||
| foreach($facets as $facetname=>$values) { | ||||
| ?>
 | ||||
| <tr> | ||||
| <td><?= getMLText($facetname);?>:</td>
 | ||||
| <td> | ||||
| <?php | ||||
| 	$options = array(); | ||||
| 	foreach($values as $v=>$c) { | ||||
| 		$option = array($v, $v.' ('.$c.')'); | ||||
|  | @ -689,7 +606,7 @@ foreach($facets as $facetname=>$values) { | |||
| 		$options[] = $option; | ||||
| 	} | ||||
| 	$this->formField( | ||||
| 		null, | ||||
| 		getMLText($facetname), | ||||
| 		array( | ||||
| 			'element'=>'select', | ||||
| 			'id'=>$facetname, | ||||
|  | @ -700,18 +617,13 @@ foreach($facets as $facetname=>$values) { | |||
| 			'multiple'=>true | ||||
| 		) | ||||
| 	); | ||||
| } | ||||
| 		} | ||||
| 	$this->contentContainerEnd(); | ||||
| 	$this->formSubmit("<i class=\"fa fa-search\"></i> ".getMLText('search')); | ||||
| ?>
 | ||||
| </td> | ||||
| </tr> | ||||
| <?php }} ?>
 | ||||
| <tr> | ||||
| <td></td><td><button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> <?php printMLText("search"); ?></button></td>
 | ||||
| </tr> | ||||
| </table> | ||||
| 
 | ||||
| </form> | ||||
| <?php | ||||
| 			$this->contentContainerEnd(); | ||||
| 			echo "</div>\n"; | ||||
| 		} | ||||
| 		// }}}
 | ||||
|  | @ -732,7 +644,7 @@ foreach($facets as $facetname=>$values) { | |||
| 				} | ||||
| 			} | ||||
| 			 */ | ||||
| 			print "<div class=\"alert alert-info\">".getMLText("search_report", array("doccount" => $totaldocs, "foldercount" => $totalfolders, 'searchtime'=>$searchTime))."</div>"; | ||||
| 			echo $this->infoMsg(getMLText("search_report", array("doccount" => $totaldocs, "foldercount" => $totalfolders, 'searchtime'=>$searchTime))); | ||||
| 			$this->pageList($pageNumber, $totalpages, "../out/out.Search.php", $urlparams); | ||||
| //			$this->contentContainerStart();
 | ||||
| 
 | ||||
|  | @ -742,7 +654,7 @@ foreach($facets as $facetname=>$values) { | |||
| 			else { | ||||
| 				parse_str($_SERVER['QUERY_STRING'], $tmp); | ||||
| 				$tmp['orderby'] = $orderby=="n"||$orderby=="na)"?"nd":"n"; | ||||
| 				print "<table class=\"table table-hover\">"; | ||||
| 				print "<table class=\"table table-condensed table-sm table-hover\">"; | ||||
| 				print "<thead>\n<tr>\n"; | ||||
| 				print "<th></th>\n"; | ||||
| 				print "<th>".getMLText("name"); | ||||
|  | @ -780,7 +692,7 @@ foreach($facets as $facetname=>$values) { | |||
| 						$lcattributes = $lc ? $lc->getAttributes() : null; | ||||
| 						$attrstr = ''; | ||||
| 						if($lcattributes) { | ||||
| 							$attrstr .= "<table class=\"table table-condensed\">\n"; | ||||
| 							$attrstr .= "<table class=\"table table-condensed table-sm\">\n"; | ||||
| 							$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>"; | ||||
| 							foreach($lcattributes as $lcattribute) { | ||||
| 								$arr = $this->callHook('showDocumentContentAttribute', $lc, $lcattribute); | ||||
|  | @ -802,7 +714,7 @@ foreach($facets as $facetname=>$values) { | |||
| 						} | ||||
| 						$docattributes = $document->getAttributes(); | ||||
| 						if($docattributes) { | ||||
| 							$attrstr .= "<table class=\"table table-condensed\">\n"; | ||||
| 							$attrstr .= "<table class=\"table table-condensed table-sm\">\n"; | ||||
| 							$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>"; | ||||
| 							foreach($docattributes as $docattribute) { | ||||
| 								$arr = $this->callHook('showDocumentAttribute', $document, $docattribute); | ||||
|  | @ -823,7 +735,7 @@ foreach($facets as $facetname=>$values) { | |||
| 						$extracontent = array(); | ||||
| 						$extracontent['below_title'] = $this->getListRowPath($document); | ||||
| 						if($attrstr) | ||||
| 							$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-secondary">'.getMLText('attributes').'</span>', $attrstr, true); | ||||
| 							$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-sm btn-secondary">'.getMLText('attributes').'</span>', $attrstr, true); | ||||
| 						print $this->documentListRow($document, $previewer, false, 0, $extracontent); | ||||
| 					} | ||||
| 				} elseif($entry->isType('folder')) { | ||||
|  | @ -842,7 +754,7 @@ foreach($facets as $facetname=>$values) { | |||
| 					$attrstr = ''; | ||||
| 					$folderattributes = $folder->getAttributes(); | ||||
| 					if($folderattributes) { | ||||
| 						$attrstr .= "<table class=\"table table-condensed\">\n"; | ||||
| 						$attrstr .= "<table class=\"table table-condensed table-sm\">\n"; | ||||
| 						$attrstr .= "<tr><th>".getMLText('name')."</th><th>".getMLText('attribute_value')."</th></tr>"; | ||||
| 						foreach($folderattributes as $folderattribute) { | ||||
| 							$attrdef = $folderattribute->getAttributeDefinition(); | ||||
|  | @ -853,7 +765,7 @@ foreach($facets as $facetname=>$values) { | |||
| 					$extracontent = array(); | ||||
| 					$extracontent['below_title'] = $this->getListRowPath($folder); | ||||
| 					if($attrstr) | ||||
| 						$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-secondary">'.getMLText('attributes').'</span>', $attrstr, true); | ||||
| 						$extracontent['bottom_title'] = '<br />'.$this->printPopupBox('<span class="btn btn-mini btn-sm btn-secondary">'.getMLText('attributes').'</span>', $attrstr, true); | ||||
| 					print $this->folderListRow($folder, false, $extracontent); | ||||
| 					} | ||||
| 				} | ||||
|  | @ -864,7 +776,7 @@ foreach($facets as $facetname=>$values) { | |||
| 		} else { | ||||
| 			$numResults = $totaldocs + $totalfolders; | ||||
| 			if ($numResults == 0) { | ||||
| 				print "<div class=\"alert alert-error\">".getMLText("search_no_results")."</div>"; | ||||
| 				echo $this->warningMsg(getMLText("search_no_results")); | ||||
| 			} | ||||
| 		} | ||||
| // }}}
 | ||||
|  |  | |||
|  | @ -1402,7 +1402,7 @@ $(document).ready(function() { | |||
| 			$dateformat = getConvertDateFormat(); | ||||
| 		$content = ' | ||||
| <div class="input-group date" id="'.$varName.'date"> | ||||
| 	<input type="text" class="form-control" name="'.$varName.'" value="'.$defDate. '" data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="'.$dateformat.'"'.($lang ? 'data-date-language="'.str_replace('_', '-', $lang).'"' : '').' data-date-autoclose="true" data-provide="datepicker"> | ||||
| 	<input type="text" class="form-control" name="'.$varName.'" value="'.$defDate. '" data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="'.$dateformat.'"'.($lang ? 'data-date-language="'.str_replace('_', '-', $lang).'"' : '').($startdate ? ' data-date-start-date="'.$startdate.'"' : '').($enddate ? ' data-date-end-date="'.$enddate.'"' : '').' data-date-autoclose="true" data-provide="datepicker"> | ||||
| 	<div class="input-group-append"> | ||||
| 		<span class="input-group-text"><i class="fa fa-calendar"></i></span> | ||||
| 	</div> | ||||
|  | @ -1782,7 +1782,7 @@ $(document).ready(function() { | |||
| 			*/ | ||||
| 			$content = ' | ||||
| <div class="input-group date"> | ||||
| 	<input type="text" class="form-control" id="'.$fieldname.'_'.$attrdef->getId().'" name="'.$fieldname.'['.$attrdef->getId().']" value="'.($objvalue ? $objvalue : '').'" data-date="'.getReadableDate().'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'" data-date-autoclose="true" data-provide="datepicker"> | ||||
| 	<input type="text" class="form-control" id="'.$fieldname.'_'.$attrdef->getId().($namepostfix ? '_'.$namepostfix : '').'" name="'.$fieldname.'['.$attrdef->getId().']'.($namepostfix ? '['.$namepostfix.']' : '').'" value="'.($objvalue ? $objvalue : '').'" data-date="'.getReadableDate().'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'" data-date-autoclose="true" data-provide="datepicker"> | ||||
| 	<div class="input-group-append"> | ||||
| 		<span class="input-group-text"><i class="fa fa-calendar"></i></span> | ||||
| 	</div> | ||||
|  | @ -3605,13 +3605,13 @@ $("body").on("click", "span.openpopupbox", function(e) { | |||
| ?>
 | ||||
| 		<div class="accordion" id="accordion<?php echo $id; ?>"> | ||||
| 			<div class="card"> | ||||
| 				<div class="card-header"> | ||||
| 					<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion<?php echo $id; ?>" href="#collapse<?php echo $id; ?>"> | ||||
| 				<div class="card-header" id="accordionheader<?php echo $id; ?>"> | ||||
| 					<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion<?php echo $id; ?>" data-target="#collapse<?php echo $id; ?>"> | ||||
| 						<?php echo $title; ?>
 | ||||
| 					</a> | ||||
| 				</div> | ||||
| 				<div id="collapse<?php echo $id; ?>" class="accordion-body collapse" style="height: 0px;"> | ||||
| 					<div class="accordion-inner"> | ||||
| 				<div id="collapse<?php echo $id; ?>" class="collapse" data-parent="accordion<?php echo $id; ?>"> | ||||
| 					<div class="card-body"> | ||||
| <?php | ||||
| 		echo $content; | ||||
| ?>
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann