mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
1e8da679b5
|
@ -2129,7 +2129,7 @@ class SeedDMS_Core_DMS {
|
||||||
if(is_string($attribute))
|
if(is_string($attribute))
|
||||||
$attribute = array($attribute);
|
$attribute = array($attribute);
|
||||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND (`tblFolderAttributes`.`value` like '%".$valueset[0].implode("%' OR `tblFolderAttributes`.`value` like '%".$valueset[0], $attribute)."%') AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND (`tblFolderAttributes`.`value` like '%".$valueset[0].implode("%' OR `tblFolderAttributes`.`value` like '%".$valueset[0], $attribute)."%') AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||||
} else {
|
} elseif(is_string($attribute)) {
|
||||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value`='".$attribute."' AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value`='".$attribute."' AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2141,7 +2141,7 @@ class SeedDMS_Core_DMS {
|
||||||
$kkll[] = "`tblFolderAttributes`.`value`<='".$attribute['to']."'";
|
$kkll[] = "`tblFolderAttributes`.`value`<='".$attribute['to']."'";
|
||||||
if($kkll)
|
if($kkll)
|
||||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND ".implode(' AND ', $kkll)." AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND ".implode(' AND ', $kkll)." AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||||
} else {
|
} elseif(is_string($attribute)) {
|
||||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value` like '%".$attribute."%' AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value` like '%".$attribute."%' AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2342,7 +2342,7 @@ class SeedDMS_Core_DMS {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) {
|
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) {
|
||||||
if($attrdef->getValueSet()) {
|
if($valueset = $attrdef->getValueSet()) {
|
||||||
if($attrdef->getMultipleValues()) {
|
if($attrdef->getMultipleValues()) {
|
||||||
/** @noinspection PhpUndefinedVariableInspection */
|
/** @noinspection PhpUndefinedVariableInspection */
|
||||||
if(is_string($attribute))
|
if(is_string($attribute))
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
- backport setFileType() from 6.0.x
|
- backport setFileType() from 6.0.x
|
||||||
- add SeedDMS_Core_File::fileExtension()
|
- add SeedDMS_Core_File::fileExtension()
|
||||||
- add callbacks on onPostUpdateAttribute, onPostRemoveAttribute, onPostAddAttribute
|
- add callbacks on onPostUpdateAttribute, onPostRemoveAttribute, onPostAddAttribute
|
||||||
|
- fix searching for document content with a custom attribute having a value set
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
|
|
@ -41,4 +41,9 @@ require_once('SQLiteFTS/QueryHit.php');
|
||||||
*/
|
*/
|
||||||
require_once('SQLiteFTS/IndexedDocument.php');
|
require_once('SQLiteFTS/IndexedDocument.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @uses SeedDMS_SQLiteFTS_Exception
|
||||||
|
*/
|
||||||
|
require_once('SQLiteFTS/Exception.php');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -190,7 +190,8 @@ class SeedDMS_SQLiteFTS_Indexer {
|
||||||
$sql .= " WHERE docs MATCH ".$this->_conn->quote($query);
|
$sql .= " WHERE docs MATCH ".$this->_conn->quote($query);
|
||||||
$res = $this->_conn->query($sql." GROUP BY `".$facetname."`");
|
$res = $this->_conn->query($sql." GROUP BY `".$facetname."`");
|
||||||
if(!$res)
|
if(!$res)
|
||||||
return false;
|
throw new SeedDMS_SQLiteFTS_Exception("Counting records in facet \"$facetname\" failed.");
|
||||||
|
// return false;
|
||||||
$facets[$facetname] = array();
|
$facets[$facetname] = array();
|
||||||
foreach($res as $row) {
|
foreach($res as $row) {
|
||||||
if($row[$facetname] && $row['c']) {
|
if($row[$facetname] && $row['c']) {
|
||||||
|
@ -220,7 +221,8 @@ class SeedDMS_SQLiteFTS_Indexer {
|
||||||
$sql .= " WHERE docs MATCH ".$this->_conn->quote($query);
|
$sql .= " WHERE docs MATCH ".$this->_conn->quote($query);
|
||||||
$res = $this->_conn->query($sql." GROUP BY `record_type`");
|
$res = $this->_conn->query($sql." GROUP BY `record_type`");
|
||||||
if(!$res)
|
if(!$res)
|
||||||
return false;
|
throw new SeedDMS_SQLiteFTS_Exception("Counting records in facet \"record_type\" failed.");
|
||||||
|
// return false;
|
||||||
$facets['record_type'] = array('document'=>0, 'folder'=>0);
|
$facets['record_type'] = array('document'=>0, 'folder'=>0);
|
||||||
foreach($res as $row) {
|
foreach($res as $row) {
|
||||||
$facets['record_type'][$row['record_type']] = $row['c'];
|
$facets['record_type'][$row['record_type']] = $row['c'];
|
||||||
|
@ -239,6 +241,8 @@ class SeedDMS_SQLiteFTS_Indexer {
|
||||||
if(!empty($limit['offset']))
|
if(!empty($limit['offset']))
|
||||||
$sql .= " OFFSET ".(int) $limit['offset'];
|
$sql .= " OFFSET ".(int) $limit['offset'];
|
||||||
$res = $this->_conn->query($sql);
|
$res = $this->_conn->query($sql);
|
||||||
|
if(!$res)
|
||||||
|
throw new SeedDMS_SQLiteFTS_Exception("Searching for documents failed.");
|
||||||
$hits = array();
|
$hits = array();
|
||||||
if($res) {
|
if($res) {
|
||||||
foreach($res as $rec) {
|
foreach($res as $rec) {
|
||||||
|
|
|
@ -113,7 +113,7 @@ class SeedDMS_SQliteFTS_Search {
|
||||||
if(!empty($fields['status'])) {
|
if(!empty($fields['status'])) {
|
||||||
if($querystr)
|
if($querystr)
|
||||||
$querystr .= ' AND ';
|
$querystr .= ' AND ';
|
||||||
$status = array_map(function($v){return $v+10;}, $fields['status']);
|
$status = array_map(function($v){return (int)$v+10;}, $fields['status']);
|
||||||
$querystr .= '(status:';
|
$querystr .= '(status:';
|
||||||
$querystr .= implode(' OR status:', $status);
|
$querystr .= implode(' OR status:', $status);
|
||||||
$querystr .= ')';
|
$querystr .= ')';
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
<email>uwe@steinmann.cx</email>
|
<email>uwe@steinmann.cx</email>
|
||||||
<active>yes</active>
|
<active>yes</active>
|
||||||
</lead>
|
</lead>
|
||||||
<date>2021-05-10</date>
|
<date>2022-03-04</date>
|
||||||
<time>08:57:44</time>
|
<time>08:57:44</time>
|
||||||
<version>
|
<version>
|
||||||
<release>1.0.16</release>
|
<release>1.0.17</release>
|
||||||
<api>1.0.16</api>
|
<api>1.0.17</api>
|
||||||
</version>
|
</version>
|
||||||
<stability>
|
<stability>
|
||||||
<release>stable</release>
|
<release>stable</release>
|
||||||
|
@ -23,9 +23,7 @@
|
||||||
</stability>
|
</stability>
|
||||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
<notes>
|
<notes>
|
||||||
- close pipes in execWithTimeout(), also return exit code of command
|
- throw exeption in find() instead of returning false
|
||||||
- add support for fts5 (make it the default)
|
|
||||||
- add class SeedDMS_SQLiteFTS_Field
|
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
@ -336,5 +334,23 @@ add user to list of terms
|
||||||
- add indexing folders
|
- add indexing folders
|
||||||
</notes>
|
</notes>
|
||||||
</release>
|
</release>
|
||||||
|
<release>
|
||||||
|
<date>2021-05-10</date>
|
||||||
|
<time>08:57:44</time>
|
||||||
|
<version>
|
||||||
|
<release>1.0.16</release>
|
||||||
|
<api>1.0.16</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>stable</release>
|
||||||
|
<api>stable</api>
|
||||||
|
</stability>
|
||||||
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
|
<notes>
|
||||||
|
- close pipes in execWithTimeout(), also return exit code of command
|
||||||
|
- add support for fts5 (make it the default)
|
||||||
|
- add class SeedDMS_SQLiteFTS_Field
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
</changelog>
|
</changelog>
|
||||||
</package>
|
</package>
|
||||||
|
|
|
@ -89,6 +89,7 @@ $controller->setParam('sesstheme', $sesstheme);
|
||||||
$controller->setParam('referuri', $referuri);
|
$controller->setParam('referuri', $referuri);
|
||||||
$controller->setParam('session', $session);
|
$controller->setParam('session', $session);
|
||||||
if(!$controller->run()) {
|
if(!$controller->run()) {
|
||||||
|
$session = null;
|
||||||
add_log_line("login failed", PEAR_LOG_ERR);
|
add_log_line("login failed", PEAR_LOG_ERR);
|
||||||
_printMessage(getMLText($controller->getErrorMsg()), getMLText($controller->getErrorMsg())."\n");
|
_printMessage(getMLText($controller->getErrorMsg()), getMLText($controller->getErrorMsg())."\n");
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -27,17 +27,16 @@ include("../inc/inc.Extension.php");
|
||||||
include("../inc/inc.DBInit.php");
|
include("../inc/inc.DBInit.php");
|
||||||
include("../inc/inc.ClassSession.php");
|
include("../inc/inc.ClassSession.php");
|
||||||
include("../inc/inc.ClassUI.php");
|
include("../inc/inc.ClassUI.php");
|
||||||
include("../inc/inc.ClassEmailNotify.php");
|
//include("../inc/inc.ClassEmailNotify.php");
|
||||||
|
|
||||||
include $settings->_rootDir . "languages/" . $settings->_language . "/lang.inc";
|
include $settings->_rootDir . "languages/" . $settings->_language . "/lang.inc";
|
||||||
|
|
||||||
function _printMessage($heading, $message) {
|
function _printMessage($heading, $message) {
|
||||||
|
|
||||||
UI::htmlStartPage($heading, "password");
|
UI::htmlStartPage($heading, "password");
|
||||||
UI::globalBanner();
|
UI::globalBanner();
|
||||||
UI::pageNavigation($heading);
|
UI::pageNavigation($heading);
|
||||||
UI::contentContainer($message."<p><a href=\"../out/out.Login.php\">" . getMLText("login") . "</a></p>\n");
|
UI::contentContainer($message."<p><a href=\"../out/out.Login.php\">" . getMLText("login") . "</a></p>\n");
|
||||||
UI::htmlEndPage();
|
UI::htmlEndPage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ include $settings->_rootDir . "languages/" . $settings->_language . "/lang.inc";
|
||||||
|
|
||||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms));
|
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms));
|
||||||
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
//$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
|
||||||
|
|
||||||
if (isset($_REQUEST["referuri"]) && strlen($_REQUEST["referuri"])>0) {
|
if (isset($_REQUEST["referuri"]) && strlen($_REQUEST["referuri"])>0) {
|
||||||
$referrer = $_REQUEST["referuri"];
|
$referrer = $_REQUEST["referuri"];
|
||||||
|
@ -40,9 +40,8 @@ if (isset($_REQUEST["referuri"]) && strlen($_REQUEST["referuri"])>0) {
|
||||||
$referrer = '';
|
$referrer = '';
|
||||||
}
|
}
|
||||||
if($view) {
|
if($view) {
|
||||||
$view->setParam('accessobject', $accessop);
|
|
||||||
$view->setParam('referrer', $referrer);
|
$view->setParam('referrer', $referrer);
|
||||||
$view->setParam('accessobject', $accessop);
|
// $view->setParam('accessobject', $accessop);
|
||||||
$view($_GET);
|
$view($_GET);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,9 +73,10 @@ if($fullsearch) {
|
||||||
$category = $_GET['category'];
|
$category = $_GET['category'];
|
||||||
foreach($_GET['category'] as $catid) {
|
foreach($_GET['category'] as $catid) {
|
||||||
if($catid) {
|
if($catid) {
|
||||||
$cat = $dms->getDocumentCategory($catid);
|
if($cat = $dms->getDocumentCategory($catid)) {
|
||||||
$categories[] = $cat;
|
$categories[] = $cat;
|
||||||
$categorynames[] = $cat->getName();
|
$categorynames[] = $cat->getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1928,7 +1928,7 @@ $(document).ready(function() {
|
||||||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $fieldname."[".$attrdef->getId()."]");
|
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $fieldname."[".$attrdef->getId()."]");
|
||||||
break;
|
break;
|
||||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
|
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
|
||||||
$users = $dms->getAllUsers();
|
$users = $dms->getAllUsers();
|
||||||
if($users) {
|
if($users) {
|
||||||
$allowempty = $attrdef->getMinValues() == 0;
|
$allowempty = $attrdef->getMinValues() == 0;
|
||||||
|
@ -1948,7 +1948,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SeedDMS_Core_AttributeDefinition::type_group:
|
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
|
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
|
||||||
$groups = $dms->getAllGroups();
|
$groups = $dms->getAllGroups();
|
||||||
if($groups) {
|
if($groups) {
|
||||||
$allowempty = $attrdef->getMinValues() == 0;
|
$allowempty = $attrdef->getMinValues() == 0;
|
||||||
|
|
|
@ -60,7 +60,7 @@ class SeedDMS_View_Help extends SeedDMS_Theme_Style {
|
||||||
$this->columnEnd();
|
$this->columnEnd();
|
||||||
$this->columnStart(8);
|
$this->columnStart(8);
|
||||||
?>
|
?>
|
||||||
<legend><?php printMLText('help_'.strtolower($context), array(), $context); ?></legend>
|
<legend><?= htmlspecialchars(getMLText('help_'.strtolower($context), array(), $context)); ?></legend>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$helpfile = "../languages/".$this->params['session']->getLanguage()."/help/".$context.".html";
|
$helpfile = "../languages/".$this->params['session']->getLanguage()."/help/".$context.".html";
|
||||||
|
|
|
@ -1892,7 +1892,7 @@ $(document).ready(function() {
|
||||||
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $fieldname."[".$attrdef->getId()."]");
|
$content .= $this->getDocumentChooserHtml("attr".$attrdef->getId(), M_READ, -1, $target, $fieldname."[".$attrdef->getId()."]");
|
||||||
break;
|
break;
|
||||||
case SeedDMS_Core_AttributeDefinition::type_user:
|
case SeedDMS_Core_AttributeDefinition::type_user:
|
||||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
|
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
|
||||||
$users = $dms->getAllUsers();
|
$users = $dms->getAllUsers();
|
||||||
if($users) {
|
if($users) {
|
||||||
$allowempty = $attrdef->getMinValues() == 0;
|
$allowempty = $attrdef->getMinValues() == 0;
|
||||||
|
@ -1912,7 +1912,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SeedDMS_Core_AttributeDefinition::type_group:
|
case SeedDMS_Core_AttributeDefinition::type_group:
|
||||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : $attribute) : array();
|
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValueAsArray() : (is_string($attribute) ? [$attribute] : $attribute)) : array();
|
||||||
$groups = $dms->getAllGroups();
|
$groups = $dms->getAllGroups();
|
||||||
if($groups) {
|
if($groups) {
|
||||||
$allowempty = $attrdef->getMinValues() == 0;
|
$allowempty = $attrdef->getMinValues() == 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user