mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 04:56:06 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
c39fbcb70d
|
@ -2112,14 +2112,26 @@ 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
|
} else {
|
||||||
$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 {
|
||||||
|
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date && is_array($attribute)) {
|
||||||
|
$kkll = [];
|
||||||
|
if(!empty($attribute['from']))
|
||||||
|
$kkll[] = "`tblFolderAttributes`.`value`>='".$attribute['from']."'";
|
||||||
|
if(!empty($attribute['to']))
|
||||||
|
$kkll[] = "`tblFolderAttributes`.`value`<='".$attribute['to']."'";
|
||||||
|
if($kkll)
|
||||||
|
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND ".implode(' AND ', $kkll)." AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||||
|
} else {
|
||||||
$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`)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Is the search restricted to documents created between two specific dates?
|
// Is the search restricted to documents created between two specific dates?
|
||||||
$searchCreateDate = "";
|
$searchCreateDate = "";
|
||||||
|
@ -2291,9 +2303,20 @@ class SeedDMS_Core_DMS {
|
||||||
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND (`tblDocumentAttributes`.`value` like '%".$valueset[0].implode("%' OR `tblDocumentAttributes`.`value` like '%".$valueset[0], $attribute)."%') AND `tblDocumentAttributes`.`document` = `tblDocuments`.`id`)";
|
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND (`tblDocumentAttributes`.`value` like '%".$valueset[0].implode("%' OR `tblDocumentAttributes`.`value` like '%".$valueset[0], $attribute)."%') AND `tblDocumentAttributes`.`document` = `tblDocuments`.`id`)";
|
||||||
} else
|
} else
|
||||||
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value`='".$attribute."' AND `tblDocumentAttributes`.`document` = `tblDocuments`.`id`)";
|
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value`='".$attribute."' AND `tblDocumentAttributes`.`document` = `tblDocuments`.`id`)";
|
||||||
} else
|
} else {
|
||||||
|
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date && is_array($attribute)) {
|
||||||
|
$kkll = [];
|
||||||
|
if(!empty($attribute['from']))
|
||||||
|
$kkll[] = "`tblDocumentAttributes`.`value`>='".$attribute['from']."'";
|
||||||
|
if(!empty($attribute['to']))
|
||||||
|
$kkll[] = "`tblDocumentAttributes`.`value`<='".$attribute['to']."'";
|
||||||
|
if($kkll)
|
||||||
|
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND ".implode(' AND ', $kkll)." AND `tblDocumentAttributes`.`document`=`tblDocuments`.`id`)";
|
||||||
|
} else {
|
||||||
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value` like '%".$attribute."%' AND `tblDocumentAttributes`.`document` = `tblDocuments`.`id`)";
|
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value` like '%".$attribute."%' AND `tblDocumentAttributes`.`document` = `tblDocuments`.`id`)";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
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($attrdef->getValueSet()) {
|
||||||
if($attrdef->getMultipleValues()) {
|
if($attrdef->getMultipleValues()) {
|
||||||
|
@ -2304,9 +2327,21 @@ class SeedDMS_Core_DMS {
|
||||||
} else {
|
} else {
|
||||||
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentContentAttributes` WHERE `tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentContentAttributes`.`value`='".$attribute."' AND `tblDocumentContentAttributes`.content = `tblDocumentContent`.id)";
|
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentContentAttributes` WHERE `tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentContentAttributes`.`value`='".$attribute."' AND `tblDocumentContentAttributes`.content = `tblDocumentContent`.id)";
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
|
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date && is_array($attribute)) {
|
||||||
|
$kkll = [];
|
||||||
|
if(!empty($attribute['from']))
|
||||||
|
$kkll[] = "`tblDocumentContentAttributes`.`value`>='".$attribute['from']."'";
|
||||||
|
if(!empty($attribute['to']))
|
||||||
|
$kkll[] = "`tblDocumentContentAttributes`.`value`<='".$attribute['to']."'";
|
||||||
|
if($kkll)
|
||||||
|
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentContentAttributes` WHERE `tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND ".implode(' AND ', $kkll)." AND `tblDocumentContentAttributes`.`content`=`tblDocumentContent`.`id`)";
|
||||||
|
} else {
|
||||||
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentContentAttributes` WHERE `tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentContentAttributes`.`value` like '%".$attribute."%' AND `tblDocumentContentAttributes`.content = `tblDocumentContent`.id)";
|
$lsearchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentContentAttributes` WHERE `tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentContentAttributes`.`value` like '%".$attribute."%' AND `tblDocumentContentAttributes`.content = `tblDocumentContent`.id)";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($lsearchAttributes)
|
||||||
$searchAttributes[] = "(".implode(" OR ", $lsearchAttributes).")";
|
$searchAttributes[] = "(".implode(" OR ", $lsearchAttributes).")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,6 +485,22 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext
|
||||||
else
|
else
|
||||||
$attributes = array();
|
$attributes = array();
|
||||||
|
|
||||||
|
foreach($attributes as $attrdefid=>$attribute) {
|
||||||
|
$attrdef = $dms->getAttributeDefinition($attrdefid);
|
||||||
|
if($attribute) {
|
||||||
|
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) {
|
||||||
|
if(is_array($attribute)) {
|
||||||
|
if(!empty($attributes[$attrdefid]['from']))
|
||||||
|
$attributes[$attrdefid]['from'] = date('Y-m-d', makeTsFromDate($attribute['from']));
|
||||||
|
if(!empty($attributes[$attrdefid]['to']))
|
||||||
|
$attributes[$attrdefid]['to'] = date('Y-m-d', makeTsFromDate($attribute['to']));
|
||||||
|
} else {
|
||||||
|
$attributes[$attrdefid] = date('Y-m-d', makeTsFromDate($attribute));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the page number to display. If the result set contains more than
|
// Get the page number to display. If the result set contains more than
|
||||||
// 25 entries, it is displayed across multiple pages.
|
// 25 entries, it is displayed across multiple pages.
|
||||||
|
|
|
@ -215,6 +215,9 @@ ul.jqtree-tree li.jqtree_common > .jqtree-element:hover {
|
||||||
background-color: #E0E0E0;
|
background-color: #E0E0E0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.datepicker {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
/* Sidenav for Docs
|
/* Sidenav for Docs
|
||||||
* -------------------------------------------------- */
|
* -------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -447,6 +447,7 @@ $(document).ready( function() {
|
||||||
var view = element.data('view');
|
var view = element.data('view');
|
||||||
var action = element.data('action');
|
var action = element.data('action');
|
||||||
var query = element.data('query');
|
var query = element.data('query');
|
||||||
|
var afterload = $(this).data('afterload');
|
||||||
if(view && action) {
|
if(view && action) {
|
||||||
url = seeddms_webroot+base+"out/out."+view+".php?action="+action;
|
url = seeddms_webroot+base+"out/out."+view+".php?action="+action;
|
||||||
if(query) {
|
if(query) {
|
||||||
|
@ -477,6 +478,12 @@ $(document).ready( function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}); /* }}} */
|
}); /* }}} */
|
||||||
|
if(afterload) {
|
||||||
|
var func = eval(afterload);
|
||||||
|
if(typeof func === "function"){
|
||||||
|
func();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}); /* }}} */
|
}); /* }}} */
|
||||||
|
|
||||||
|
@ -490,6 +497,7 @@ $(document).ready( function() {
|
||||||
var view = element.data('view');
|
var view = element.data('view');
|
||||||
var action = element.data('action');
|
var action = element.data('action');
|
||||||
var query = element.data('query');
|
var query = element.data('query');
|
||||||
|
var afterload = $(this).data('afterload');
|
||||||
if(view && action) {
|
if(view && action) {
|
||||||
url = seeddms_webroot+base+"out/out."+view+".php?action="+action;
|
url = seeddms_webroot+base+"out/out."+view+".php?action="+action;
|
||||||
if(query) {
|
if(query) {
|
||||||
|
@ -538,6 +546,12 @@ $(document).ready( function() {
|
||||||
}); /* }}} */
|
}); /* }}} */
|
||||||
if(callback)
|
if(callback)
|
||||||
callback.call();
|
callback.call();
|
||||||
|
if(afterload) {
|
||||||
|
var func = eval(afterload);
|
||||||
|
if(typeof func === "function"){
|
||||||
|
func();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}); /* }}} */
|
}); /* }}} */
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,10 @@ $(document).ready( function() {
|
||||||
$this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
$this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))));
|
||||||
$this->globalNavigation($folder);
|
$this->globalNavigation($folder);
|
||||||
$this->contentStart();
|
$this->contentStart();
|
||||||
$this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder);
|
// $this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder);
|
||||||
|
?>
|
||||||
|
<div class="ajax" data-view="ViewFolder" data-action="navigation" data-no-spinner="true" <?php echo ($folder ? "data-query=\"folderid=".$folder->getID()."\"" : "") ?>></div>
|
||||||
|
<?php
|
||||||
$this->contentHeading(getMLText("add_subfolder"));
|
$this->contentHeading(getMLText("add_subfolder"));
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1737,11 +1737,11 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function printAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false) { /* {{{ */
|
function printAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false, $namepostfix='') { /* {{{ */
|
||||||
echo self::getAttributeEditField($attrdef, $attribute, $fieldname, $norequire);
|
echo self::getAttributeEditField($attrdef, $attribute, $fieldname, $norequire, $namepostfix);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function getAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false) { /* {{{ */
|
function getAttributeEditField($attrdef, $attribute, $fieldname='attributes', $norequire=false, $namepostfix='') { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$content = '';
|
$content = '';
|
||||||
switch($attrdef->getType()) {
|
switch($attrdef->getType()) {
|
||||||
|
@ -1754,7 +1754,7 @@ $(document).ready(function() {
|
||||||
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
|
||||||
$dateformat = getConvertDateFormat($this->params['settings']->_dateformat);
|
$dateformat = getConvertDateFormat($this->params['settings']->_dateformat);
|
||||||
$content .= '<span class="input-append date datepicker" data-date="'.getReadableDate().'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'">
|
$content .= '<span class="input-append date datepicker" data-date="'.getReadableDate().'" data-date-format="'.$dateformat.'" data-date-language="'.str_replace('_', '-', $this->params['session']->getLanguage()).'">
|
||||||
<input id="'.$fieldname.'_'.$attrdef->getId().'" class="span9" size="16" name="'.$fieldname.'['.$attrdef->getId().']" type="text" value="'.($objvalue ? $objvalue : '').'">
|
<input id="'.$fieldname.'_'.$attrdef->getId().($namepostfix ? '_'.$namepostfix : '').'" class="span8" size="16" name="'.$fieldname.'['.$attrdef->getId().']'.($namepostfix ? '['.$namepostfix.']' : '').'" type="text" value="'.($objvalue ? $objvalue : '').'">
|
||||||
<span class="add-on"><i class="fa fa-calendar"></i></span>
|
<span class="add-on"><i class="fa fa-calendar"></i></span>
|
||||||
</span>';
|
</span>';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -331,7 +331,14 @@ function typeahead() { /* {{{ */
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||||
<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : null, 'attributes', true) ?></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>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -495,7 +502,17 @@ function typeahead() { /* {{{ */
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
|
||||||
|
<<<<<<< HEAD
|
||||||
<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : null, 'attributes', true) ?></td>
|
<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : null, 'attributes', true) ?></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>
|
||||||
|
>>>>>>> seeddms-5.1.x
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue
Block a user