mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +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
|
||||
* @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();
|
||||
|
||||
$result = array('docs'=>array(), 'folders'=>array(), 'contents'=>array());
|
||||
if($this->_objtype == SeedDMS_Core_AttributeDefinition::objtype_all ||
|
||||
$this->_objtype == SeedDMS_Core_AttributeDefinition::objtype_document) {
|
||||
$queryStr = "SELECT * FROM `tblDocumentAttributes` WHERE `attrdef`=".$this->_id." AND ";
|
||||
if($this->getMultipleValues()) {
|
||||
$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).")";
|
||||
} else {
|
||||
$queryStr .= "`value`=".$db->qstr($attrvalue);
|
||||
$this->_objtype == SeedDMS_Core_AttributeDefinition::objtype_document) {
|
||||
$queryStr = "SELECT * FROM `tblDocumentAttributes` WHERE `attrdef`=".$this->_id;
|
||||
if($attrvalue != null) {
|
||||
$queryStr .= " AND ";
|
||||
if($this->getMultipleValues()) {
|
||||
$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).")";
|
||||
} else {
|
||||
$queryStr .= "`value`".$op.$db->qstr($attrvalue);
|
||||
}
|
||||
}
|
||||
if($limit)
|
||||
$queryStr .= " limit ".(int) $limit;
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
- 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.
|
||||
- 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>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
|
Loading…
Reference in New Issue
Block a user