mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 06:01:19 +00:00
add optional parameter $op to SeedDMS_Core_AttributeDefinition::getObjects(), SeedDMS_Core_AttributeDefinition::getObjects() will not filter by value if null is passed
This commit is contained in:
parent
afddc5a4d6
commit
55126a689b
|
@ -1066,18 +1066,21 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
||||||
* @param integer $limit limit number of documents/folders
|
* @param integer $limit limit number of documents/folders
|
||||||
* @return array array containing list of documents and folders
|
* @return array array containing list of documents and folders
|
||||||
*/
|
*/
|
||||||
public function getObjects($attrvalue, $limit=0) { /* {{{ */
|
public function getObjects($attrvalue, $limit=0, $op=O_EQ) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
$result = array('docs'=>array(), 'folders'=>array(), 'contents'=>array());
|
$result = array('docs'=>array(), 'folders'=>array(), 'contents'=>array());
|
||||||
if($this->_objtype == SeedDMS_Core_AttributeDefinition::objtype_all ||
|
if($this->_objtype == SeedDMS_Core_AttributeDefinition::objtype_all ||
|
||||||
$this->_objtype == SeedDMS_Core_AttributeDefinition::objtype_document) {
|
$this->_objtype == SeedDMS_Core_AttributeDefinition::objtype_document) {
|
||||||
$queryStr = "SELECT * FROM `tblDocumentAttributes` WHERE `attrdef`=".$this->_id." AND ";
|
$queryStr = "SELECT * FROM `tblDocumentAttributes` WHERE `attrdef`=".$this->_id;
|
||||||
|
if($attrvalue != null) {
|
||||||
|
$queryStr .= " AND ";
|
||||||
if($this->getMultipleValues()) {
|
if($this->getMultipleValues()) {
|
||||||
$sep = $this->getValueSetSeparator();
|
$sep = $this->getValueSetSeparator();
|
||||||
$queryStr .= "(`value` like ".$db->qstr($sep.$attrvalue.'%')." OR `value` like ".$db->qstr('%'.$sep.$attrvalue.$sep.'%')." OR `value` like ".$db->qstr('%'.$sep.$attrvalue).")";
|
$queryStr .= "(`value` like ".$db->qstr($sep.$attrvalue.'%')." OR `value` like ".$db->qstr('%'.$sep.$attrvalue.$sep.'%')." OR `value` like ".$db->qstr('%'.$sep.$attrvalue).")";
|
||||||
} else {
|
} else {
|
||||||
$queryStr .= "`value`=".$db->qstr($attrvalue);
|
$queryStr .= "`value`".$op.$db->qstr($attrvalue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($limit)
|
if($limit)
|
||||||
$queryStr .= " limit ".(int) $limit;
|
$queryStr .= " limit ".(int) $limit;
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
- fix validating multi value attributes
|
- fix validating multi value attributes
|
||||||
- SeedDMS_Core_User::removeFromProcesses() can be limited to a list of documents. In that case only the last version will be modified.
|
- SeedDMS_Core_User::removeFromProcesses() can be limited to a list of documents. In that case only the last version will be modified.
|
||||||
- add more types to getStatisticalData()
|
- add more types to getStatisticalData()
|
||||||
|
- add optional parameter $op to SeedDMS_Core_AttributeDefinition::getObjects()
|
||||||
|
- SeedDMS_Core_AttributeDefinition::getObjects() will not filter by value if null is passed
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user