mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
Merge branch 'seeddms-4.3.13' into develop
Conflicts: Makefile
This commit is contained in:
commit
e9c3696466
|
@ -1,3 +1,12 @@
|
|||
--------------------------------------------------------------------------------
|
||||
Changes in version 4.3.12
|
||||
--------------------------------------------------------------------------------
|
||||
- log each operation in op/op.Ajax.php
|
||||
- fix another error when search for multi value attributes of folders
|
||||
- do not use strptime anymore (Bug #129)
|
||||
- fix specfying port for database in hostname (Bug #173)
|
||||
- propperly check for min/max values of attributes
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 4.3.11
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
6
Makefile
6
Makefile
|
@ -1,4 +1,4 @@
|
|||
VERSION=4.3.11
|
||||
VERSION=4.3.13
|
||||
SRC=CHANGELOG inc conf utils index.php languages views op out controllers README.md README.Notification README.Ubuntu drop-tables-innodb.sql styles js TODO LICENSE Makefile webdav install restapi
|
||||
# webapp
|
||||
|
||||
|
@ -7,6 +7,8 @@ EXTENSIONS := \
|
|||
login_action.tar.gz\
|
||||
example.tar.gz
|
||||
|
||||
PHPDOC=~/Downloads/phpDocumentor-2.8.1/bin/phpdoc
|
||||
|
||||
dist:
|
||||
mkdir -p tmp/seeddms-$(VERSION)
|
||||
cp -a $(SRC) tmp/seeddms-$(VERSION)
|
||||
|
@ -42,6 +44,6 @@ login_action.tar.gz: ext/login_action
|
|||
extensions: $(EXTENSIONS)
|
||||
|
||||
doc:
|
||||
phpdoc -d SeedDMS_Core --ignore 'getusers.php,getfoldertree.php,config.php,reverselookup.php' -t html
|
||||
$(PHPDOC) -d SeedDMS_Core --ignore 'getusers.php,getfoldertree.php,config.php,reverselookup.php' --force -t html
|
||||
|
||||
.PHONY: webdav webapp
|
||||
|
|
|
@ -89,6 +89,11 @@ class SeedDMS_Core_Attribute { /* {{{ */
|
|||
$this->_dms = $dms;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get internal id of attribute
|
||||
*
|
||||
* @return integer id
|
||||
*/
|
||||
function getID() { return $this->_id; }
|
||||
|
||||
/**
|
||||
|
@ -158,6 +163,11 @@ class SeedDMS_Core_Attribute { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get definition of attribute
|
||||
*
|
||||
* @return object attribute definition
|
||||
*/
|
||||
function getAttributeDefinition() { return $this->_attrdef; }
|
||||
|
||||
} /* }}} */
|
||||
|
@ -313,8 +323,18 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
|||
$this->_dms = $dms;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get internal id of attribute definition
|
||||
*
|
||||
* @return integer id
|
||||
*/
|
||||
function getID() { return $this->_id; }
|
||||
|
||||
/**
|
||||
* Get name of attribute definition
|
||||
*
|
||||
* @return string name
|
||||
*/
|
||||
function getName() { return $this->_name; }
|
||||
|
||||
function setName($name) { /* {{{ */
|
||||
|
@ -329,8 +349,24 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get object type of attribute definition
|
||||
*
|
||||
* This can be one of objtype_all,
|
||||
* objtype_folder, objtype_document, or objtype_documentcontent.
|
||||
*
|
||||
* @return integer type
|
||||
*/
|
||||
function getObjType() { return $this->_objtype; }
|
||||
|
||||
/**
|
||||
* Set object type of attribute definition
|
||||
*
|
||||
* This can be one of objtype_all,
|
||||
* objtype_folder, objtype_document, or objtype_documentcontent.
|
||||
*
|
||||
* @param integer $objtype type
|
||||
*/
|
||||
function setObjType($objtype) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
|
@ -343,8 +379,22 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get type of attribute definition
|
||||
*
|
||||
* This can be one of type_int, type_float, type_string, type_boolean.
|
||||
*
|
||||
* @return integer type
|
||||
*/
|
||||
function getType() { return $this->_type; }
|
||||
|
||||
/**
|
||||
* Set type of attribute definition
|
||||
*
|
||||
* This can be one of type_int, type_float, type_string, type_boolean.
|
||||
*
|
||||
* @param integer $type type
|
||||
*/
|
||||
function setType($type) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
|
@ -357,8 +407,19 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Check if attribute definition allows multi values for attribute
|
||||
*
|
||||
* @return boolean true if attribute may have multiple values
|
||||
*/
|
||||
function getMultipleValues() { return $this->_multiple; }
|
||||
|
||||
/**
|
||||
* Set if attribute definition allows multi values for attribute
|
||||
*
|
||||
* @param boolean $mv true if attribute may have multiple values, otherwise
|
||||
* false
|
||||
*/
|
||||
function setMultipleValues($mv) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
|
@ -371,6 +432,14 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return minimum number of values for attributes
|
||||
*
|
||||
* Attributes with multiple values may be limited to a range
|
||||
* of values. This functions returns the minimum number of values.
|
||||
*
|
||||
* @return integer minimum number of values
|
||||
*/
|
||||
function getMinValues() { return $this->_minvalues; }
|
||||
|
||||
function setMinValues($minvalues) { /* {{{ */
|
||||
|
@ -385,6 +454,14 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return maximum number of values for attributes
|
||||
*
|
||||
* Attributes with multiple values may be limited to a range
|
||||
* of values. This functions returns the maximum number of values.
|
||||
*
|
||||
* @return integer maximum number of values
|
||||
*/
|
||||
function getMaxValues() { return $this->_maxvalues; }
|
||||
|
||||
function setMaxValues($maxvalues) { /* {{{ */
|
||||
|
|
|
@ -155,8 +155,8 @@ class SeedDMS_Core_DMS {
|
|||
* two objects, which isn't required. The method will first check
|
||||
* if the objects are instances of the same class.
|
||||
*
|
||||
* @param object $object1
|
||||
* @param object $object2
|
||||
* @param object $object1 first object to be compared
|
||||
* @param object $object2 second object to be compared
|
||||
* @return boolean true if objects are equal, otherwise false
|
||||
*/
|
||||
static function checkIfEqual($object1, $object2) { /* {{{ */
|
||||
|
@ -246,6 +246,14 @@ class SeedDMS_Core_DMS {
|
|||
$this->version = '4.3.11';
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return database where meta data is stored
|
||||
*
|
||||
* This method returns the database object as it was set by the first
|
||||
* parameter of the constructor.
|
||||
*
|
||||
* @return object database
|
||||
*/
|
||||
function getDB() { /* {{{ */
|
||||
return $this->db;
|
||||
} /* }}} */
|
||||
|
@ -309,14 +317,20 @@ class SeedDMS_Core_DMS {
|
|||
/**
|
||||
* Set maximum number of subdirectories per directory
|
||||
*
|
||||
* The value of maxDirID is quite crucial because, all documents are
|
||||
* associated with a directory in the filesystem. Consequently, there is
|
||||
* maximum number of documents, because depending on the file system
|
||||
* The value of maxDirID is quite crucial, because each document is
|
||||
* stored within a directory in the filesystem. Consequently, there can be
|
||||
* a maximum number of documents, because depending on the file system
|
||||
* the maximum number of subdirectories is limited. Since version 3.3.0 of
|
||||
* SeedDMS an additional directory level has been introduced. All documents
|
||||
* SeedDMS an additional directory level has been introduced, which
|
||||
* will be created when maxDirID is not 0. All documents
|
||||
* from 1 to maxDirID-1 will be saved in 1/<docid>, documents from maxDirID
|
||||
* to 2*maxDirID-1 are stored in 2/<docid> and so on.
|
||||
*
|
||||
* Modern file systems like ext4 do not have any restrictions on the number
|
||||
* of subdirectories anymore. Therefore it is best if this parameter is
|
||||
* set to 0. Never change this parameter if documents has already been
|
||||
* created.
|
||||
*
|
||||
* This function must be called right after creating an instance of
|
||||
* {@link SeedDMS_Core_DMS}
|
||||
*
|
||||
|
@ -628,11 +642,11 @@ class SeedDMS_Core_DMS {
|
|||
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) {
|
||||
if($valueset = $attrdef->getValueSet()) {
|
||||
if($attrdef->getMultipleValues()) {
|
||||
$searchAttributes[] = "`tblFolderAttributes`.`attrdef`=".$attrdefid." AND (`tblFolderAttributes`.`value` like '".$valueset[0].implode("%' OR `tblFolderAttributes`.`value` like '".$valueset[0], $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`)";
|
||||
} else
|
||||
$searchAttributes[] = "`tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value`='".$attribute."'";
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value`='".$attribute."' AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||
} else
|
||||
$searchAttributes[] = "`tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value` like '%".$attribute."%'";
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblFolderAttributes` WHERE `tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value` like '%".$attribute."%' AND `tblFolderAttributes`.`folder`=`tblFolders`.`id`)";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -678,6 +692,7 @@ class SeedDMS_Core_DMS {
|
|||
*/
|
||||
if($searchKey || $searchOwner || $searchCreateDate || $searchAttributes) {
|
||||
// Count the number of rows that the search will produce.
|
||||
echo $searchQuery;
|
||||
$resArr = $this->db->getResultArray("SELECT COUNT(*) AS num FROM (SELECT DISTINCT `tblFolders`.id ".$searchQuery.") a");
|
||||
if ($resArr && isset($resArr[0]) && is_numeric($resArr[0]["num"]) && $resArr[0]["num"]>0) {
|
||||
$totalFolders = (integer)$resArr[0]["num"];
|
||||
|
@ -791,16 +806,16 @@ class SeedDMS_Core_DMS {
|
|||
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_document || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) {
|
||||
if($valueset = $attrdef->getValueSet()) {
|
||||
if($attrdef->getMultipleValues()) {
|
||||
$searchAttributes[] = "`tblDocumentAttributes`.`attrdef`=".$attrdefid." AND (`tblDocumentAttributes`.`value` like '".$valueset[0].implode("%' OR `tblDocumentAttributes`.`value` like '".$valueset[0], $attribute)."%')";
|
||||
$searchAttributes[] = "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
|
||||
$searchAttributes[] = "`tblDocumentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value`='".$attribute."'";
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value`='".$attribute."' AND `tblDocumentAttributes`.document = `tblDocuments`.id)";
|
||||
} else
|
||||
$searchAttributes[] = "`tblDocumentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value` like '%".$attribute."%'";
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentAttributes`.`value` like '%".$attribute."%') AND `tblDocumentAttributes`.document = `tblDocuments`.id";
|
||||
} elseif($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent) {
|
||||
if($attrdef->getValueSet())
|
||||
$searchAttributes[] = "`tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentContentAttributes`.`value`='".$attribute."'";
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentContentAttributes`.`value`='".$attribute."' AND `tblDocumentContentAttributes`.content = `tblDocumentContent`.id";
|
||||
else
|
||||
$searchAttributes[] = "`tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentContentAttributes`.`value` like '%".$attribute."%'";
|
||||
$searchAttributes[] = "EXISTS (SELECT NULL FROM `tblDocumentAttributes` WHERE `tblDocumentContentAttributes`.`attrdef`=".$attrdefid." AND `tblDocumentContentAttributes`.`value` like '%".$attribute."%' AND `tblDocumentContentAttributes`.content = `tblDocumentContent`.id";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1727,6 +1742,7 @@ class SeedDMS_Core_DMS {
|
|||
/**
|
||||
* Return workflow by its Id
|
||||
*
|
||||
* @param integer $id internal id of workflow
|
||||
* @return object of instances of {@link SeedDMS_Core_Workflow} or false
|
||||
*/
|
||||
function getWorkflow($id) { /* {{{ */
|
||||
|
@ -1750,6 +1766,7 @@ class SeedDMS_Core_DMS {
|
|||
/**
|
||||
* Return workflow by its name
|
||||
*
|
||||
* @param string $name name of workflow
|
||||
* @return object of instances of {@link SeedDMS_Core_Workflow} or false
|
||||
*/
|
||||
function getWorkflowByName($name) { /* {{{ */
|
||||
|
@ -1772,6 +1789,12 @@ class SeedDMS_Core_DMS {
|
|||
return $workflow;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Add a new workflow
|
||||
*
|
||||
* @param string $name name of workflow
|
||||
* @param string $initstate initial state of workflow
|
||||
*/
|
||||
function addWorkflow($name, $initstate) { /* {{{ */
|
||||
$db = $this->db;
|
||||
if (is_object($this->getWorkflowByName($name))) {
|
||||
|
|
|
@ -486,9 +486,13 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
|||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Returns a unix file system path
|
||||
* Returns a file system path
|
||||
*
|
||||
* @return string path separated with '/'
|
||||
* This path contains spaces around the slashes for better readability.
|
||||
* Run str_replace(' / ', '/', $path) on it to get a valid unix
|
||||
* file system path.
|
||||
*
|
||||
* @return string path separated with ' / '
|
||||
*/
|
||||
function getFolderPathPlain() { /* {{{ */
|
||||
$path="";
|
||||
|
|
|
@ -56,6 +56,17 @@ class SeedDMS_Core_Notification { /* {{{ */
|
|||
*/
|
||||
protected $_dms;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param integer $target id of document/folder this notification is
|
||||
* attached to.
|
||||
* @param integer $targettype 1 = target is document, 2 = target is a folder
|
||||
* @param integer $userid id of user. The id is -1 if the notification is
|
||||
* for a group.
|
||||
* @param integer $groupid id of group. The id is -1 if the notification is
|
||||
* for a user.
|
||||
*/
|
||||
function SeedDMS_Core_Notification($target, $targettype, $userid, $groupid) { /* {{{ */
|
||||
$this->_target = $target;
|
||||
$this->_targettype = $targettype;
|
||||
|
@ -63,16 +74,43 @@ class SeedDMS_Core_Notification { /* {{{ */
|
|||
$this->_groupid = $groupid;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Set instance of dms this object belongs to
|
||||
*
|
||||
* @param object $dms instance of dms
|
||||
*/
|
||||
function setDMS($dms) { /* {{{ */
|
||||
$this->_dms = $dms;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get id of target (document/object) this notification is attachted to
|
||||
*
|
||||
* @return integer id of target
|
||||
*/
|
||||
function getTarget() { return $this->_target; }
|
||||
|
||||
/**
|
||||
* Get type of target
|
||||
*
|
||||
* @return integer type of target (1=document/2=object)
|
||||
*/
|
||||
function getTargetType() { return $this->_targettype; }
|
||||
|
||||
/**
|
||||
* Get user for this notification
|
||||
*
|
||||
* @return integer id of user or -1 if this notification does not belong
|
||||
* to a user
|
||||
*/
|
||||
function getUser() { return $this->_dms->getUser($this->_userid); }
|
||||
|
||||
/**
|
||||
* Get group for this notification
|
||||
*
|
||||
* @return integer id of group or -1 if this notification does not belong
|
||||
* to a group
|
||||
*/
|
||||
function getGroup() { return $this->_dms->getGroup($this->_groupid); }
|
||||
} /* }}} */
|
||||
?>
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
<email>uwe@steinmann.cx</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2014-11-13</date>
|
||||
<date>2014-11-17</date>
|
||||
<time>09:09:35</time>
|
||||
<version>
|
||||
<release>4.3.11</release>
|
||||
<api>4.3.11</api>
|
||||
<release>4.3.12</release>
|
||||
<api>4.3.12</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
|
@ -24,8 +24,7 @@
|
|||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
- fixed saving multivalue attributes
|
||||
- add method SeedDMS_Core_Attribute::getValueAsArray()
|
||||
- fix searching folders with multivalue attributes
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
@ -717,5 +716,22 @@ no changes
|
|||
new release
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2014-11-13</date>
|
||||
<time>09:09:35</time>
|
||||
<version>
|
||||
<release>4.3.11</release>
|
||||
<api>4.3.11</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
- fixed saving multivalue attributes
|
||||
- add method SeedDMS_Core_Attribute::getValueAsArray()
|
||||
</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
|
|
|
@ -1089,7 +1089,10 @@ class Settings { /* {{{ */
|
|||
case 'mysql':
|
||||
case 'mysqli':
|
||||
case 'mysqlnd':
|
||||
$dsn = $this->_dbDriver.":dbname=".$this->_dbDatabase.";host=".$this->_dbHostname;
|
||||
$tmp = explode(":", $this->_dbHostname);
|
||||
$dsn = $this->_dbDriver.":dbname=".$this->_dbDatabase.";host=".$tmp[0];
|
||||
if(!empty($tmp[1]))
|
||||
$dsn .= ";port=".$tmp[1];
|
||||
break;
|
||||
case 'sqlite':
|
||||
$dsn = $this->_dbDriver.":".$this->_dbDatabase;
|
||||
|
|
|
@ -34,6 +34,24 @@ function getLongReadableDate($timestamp) {
|
|||
return date("Y-m-d H:i:s", $timestamp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts a date/time string into a timestamp
|
||||
*
|
||||
* @param $date string date in form Y-m-d H:i:s
|
||||
* @return integer/boolean unix timestamp or false in case of an error
|
||||
*/
|
||||
function makeTsFromLongDate($date) { /* }}} */
|
||||
$tmp = explode(' ', $date);
|
||||
if(count($tmp) != 2)
|
||||
return false;
|
||||
$tarr = explode(':', $tmp[1]);
|
||||
$darr = explode('-', $tmp[0]);
|
||||
if(count($tarr) != 3 || count($darr) != 3)
|
||||
return false;
|
||||
$ts = mktime($tarr[0], $tarr[1], $tarr[2], $darr[1], $darr[2], $darr[0]);
|
||||
return $ts;
|
||||
} /* }}} */
|
||||
|
||||
function getReadableDuration($secs) {
|
||||
$s = "";
|
||||
foreach ( getReadableDurationArray($secs) as $k => $v ) {
|
||||
|
@ -45,11 +63,11 @@ function getReadableDuration($secs) {
|
|||
|
||||
function getReadableDurationArray($secs) {
|
||||
$units = array(
|
||||
getMLText("weeks") => 7*24*3600,
|
||||
getMLText("days") => 24*3600,
|
||||
getMLText("hours") => 3600,
|
||||
getMLText("minutes") => 60,
|
||||
getMLText("seconds") => 1,
|
||||
getMLText("weeks") => 7*24*3600,
|
||||
getMLText("days") => 24*3600,
|
||||
getMLText("hours") => 3600,
|
||||
getMLText("minutes") => 60,
|
||||
getMLText("seconds") => 1,
|
||||
);
|
||||
|
||||
foreach ( $units as &$unit ) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
class SeedDMS_Version {
|
||||
|
||||
public $_number = "4.3.11";
|
||||
public $_number = "4.3.12";
|
||||
private $_string = "SeedDMS";
|
||||
|
||||
function SeedDMS_Version() {
|
||||
|
|
|
@ -50,7 +50,10 @@ function openDBConnection($settings) { /* {{{ */
|
|||
case 'mysql':
|
||||
case 'mysqli':
|
||||
case 'mysqlnd':
|
||||
$dsn = $settings->_dbDriver.":dbname=".$settings->_dbDatabase.";host=".$settings->_dbHostname;
|
||||
$tmp = explode(":", $settings->_dbHostname);
|
||||
$dsn = $settings->_dbDriver.":dbname=".$settings->_dbDatabase.";host=".$tmp[0];
|
||||
if(isset($tmp[1]))
|
||||
$dsn .= ";port=".$tmp[1];
|
||||
break;
|
||||
case 'sqlite':
|
||||
$dsn = $settings->_dbDriver.":".$settings->_dbDatabase;
|
||||
|
@ -116,7 +119,7 @@ function fileExistsInIncludePath($file) { /* {{{ */
|
|||
* Load default settings + set
|
||||
*/
|
||||
define("SEEDDMS_INSTALL", "on");
|
||||
define("SEEDDMS_VERSION", "4.3.11");
|
||||
define("SEEDDMS_VERSION", "4.3.12");
|
||||
|
||||
require_once('../inc/inc.ClassSettings.php');
|
||||
|
||||
|
|
|
@ -76,6 +76,14 @@ foreach($attributes as $attrdefid=>$attribute) {
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_no_regex_match"));
|
||||
}
|
||||
}
|
||||
if(is_array($attribute)) {
|
||||
if($attrdef->getMinValues() > count($attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,6 +99,14 @@ foreach($attributes_version as $attrdefid=>$attribute) {
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_no_regex_match"));
|
||||
}
|
||||
}
|
||||
if(is_array($attribute)) {
|
||||
if($attrdef->getMinValues() > count($attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,6 +69,14 @@ foreach($attributes as $attrdefid=>$attribute) {
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $document->getName())),getMLText("attr_no_regex_match"));
|
||||
}
|
||||
}
|
||||
if(is_array($attribute)) {
|
||||
if($attrdef->getMinValues() > count($attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -642,4 +642,5 @@ switch($command) {
|
|||
break; /* }}} */
|
||||
|
||||
}
|
||||
add_log_line();
|
||||
?>
|
||||
|
|
|
@ -252,6 +252,15 @@ if($attributes) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_no_regex_match"));
|
||||
}
|
||||
}
|
||||
if(is_array($attribute)) {
|
||||
if($attrdef->getMinValues() > count($attribute)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) {
|
||||
print_r($attrdef);
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
}
|
||||
if(!isset($oldattributes[$attrdefid]) || $attribute != $oldattributes[$attrdefid]->getValue()) {
|
||||
if(!$document->setAttributeValue($dms->getAttributeDefinition($attrdefid), $attribute))
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||
|
|
|
@ -160,7 +160,15 @@ if($attributes) {
|
|||
if($attribute) {
|
||||
if($attrdef->getRegex()) {
|
||||
if(!preg_match($attrdef->getRegex(), $attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $document->getName())),getMLText("attr_no_regex_match"));
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_no_regex_match"));
|
||||
}
|
||||
}
|
||||
if(is_array($attribute)) {
|
||||
if($attrdef->getMinValues() > count($attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
}
|
||||
if(!isset($oldattributes[$attrdefid]) || $attribute != $oldattributes[$attrdefid]->getValue()) {
|
||||
|
|
|
@ -183,6 +183,14 @@ if ($_FILES['userfile']['error'] == 0) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $folder->getName())),getMLText("attr_no_regex_match"));
|
||||
}
|
||||
}
|
||||
if(is_array($attribute)) {
|
||||
if($attrdef->getMinValues() > count($attribute)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_min_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
if($attrdef->getMaxValues() && $attrdef->getMaxValues() < count($attribute)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("attr_max_values", array("attrname"=>$attrdef->getName())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -54,8 +54,7 @@ class SeedDMS_View_RemoveWorkflowFromDocument extends SeedDMS_Bootstrap_Style {
|
|||
foreach($wkflog as $entry) {
|
||||
if($entry->getTransition()->getNextState()->getID() == $currentstate->getID()) {
|
||||
$enterdate = $entry->getDate();
|
||||
$d = strptime($enterdate, '%Y-%m-%d %H:%M:%S');
|
||||
$enterts = mktime($d['tm_hour'], $d['tm_min'], $d['tm_sec'], $d['tm_mon']+1, $d['tm_mday'], $d['tm_year']+1900);
|
||||
$enterts = makeTsFromLongDate($enterdate);
|
||||
}
|
||||
}
|
||||
$msg .= "The state was entered at ".$enterdate." which was ";
|
||||
|
|
|
@ -79,8 +79,7 @@ function checkForm()
|
|||
foreach($wkflog as $entry) {
|
||||
if($entry->getTransition()->getNextState()->getID() == $currentstate->getID()) {
|
||||
$enterdate = $entry->getDate();
|
||||
$d = strptime($enterdate, '%Y-%m-%d %H:%M:%S');
|
||||
$enterts = mktime($d['tm_hour'], $d['tm_min'], $d['tm_sec'], $d['tm_mon']+1, $d['tm_mday'], $d['tm_year']+1900);
|
||||
$enterts = makeTsFromLongDate($enterdate);
|
||||
}
|
||||
}
|
||||
$msg .= "The state was entered at ".$enterdate." which was ";
|
||||
|
|
|
@ -54,8 +54,7 @@ class SeedDMS_View_RewindWorkflow extends SeedDMS_Bootstrap_Style {
|
|||
foreach($wkflog as $entry) {
|
||||
if($entry->getTransition()->getNextState()->getID() == $currentstate->getID()) {
|
||||
$enterdate = $entry->getDate();
|
||||
$d = strptime($enterdate, '%Y-%m-%d %H:%M:%S');
|
||||
$enterts = mktime($d['tm_hour'], $d['tm_min'], $d['tm_sec'], $d['tm_mon']+1, $d['tm_mday'], $d['tm_year']+1900);
|
||||
$enterts = makeTsFromLongDate($enterdate);
|
||||
}
|
||||
}
|
||||
$msg .= "The state was entered at ".$enterdate." which was ";
|
||||
|
|
|
@ -55,8 +55,7 @@ class SeedDMS_View_RunSubWorkflow extends SeedDMS_Bootstrap_Style {
|
|||
foreach($wkflog as $entry) {
|
||||
if($entry->getTransition()->getNextState()->getID() == $currentstate->getID()) {
|
||||
$enterdate = $entry->getDate();
|
||||
$d = strptime($enterdate, '%Y-%m-%d %H:%M:%S');
|
||||
$enterts = mktime($d['tm_hour'], $d['tm_min'], $d['tm_sec'], $d['tm_mon']+1, $d['tm_mday'], $d['tm_year']+1900);
|
||||
$enterts = makeTsFromLongDate($enterdate);
|
||||
}
|
||||
}
|
||||
$msg .= "The state was entered at ".$enterdate." which was ";
|
||||
|
|
|
@ -79,8 +79,7 @@ function checkForm()
|
|||
foreach($wkflog as $entry) {
|
||||
if($entry->getTransition()->getNextState()->getID() == $currentstate->getID()) {
|
||||
$enterdate = $entry->getDate();
|
||||
$d = strptime($enterdate, '%Y-%m-%d %H:%M:%S');
|
||||
$enterts = mktime($d['tm_hour'], $d['tm_min'], $d['tm_sec'], $d['tm_mon']+1, $d['tm_mday'], $d['tm_year']+1900);
|
||||
$enterts = makeTsFromLongDate($enterdate);
|
||||
}
|
||||
}
|
||||
$msg .= "The state was entered at ".$enterdate." which was ";
|
||||
|
|
Loading…
Reference in New Issue
Block a user