mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
inc.ClassDMS.php
This commit is contained in:
parent
e1fc45b69a
commit
ab73fe5298
|
@ -74,7 +74,7 @@ require_once("inc.ClassAttribute.php");
|
||||||
*/
|
*/
|
||||||
class SeedDMS_Core_DMS {
|
class SeedDMS_Core_DMS {
|
||||||
/**
|
/**
|
||||||
* @var SeedDMS_Core_DMS $db reference to database object. This must be an instance
|
* @var SeedDMS_Core_DatabaseAccess $db reference to database object. This must be an instance
|
||||||
* of {@link SeedDMS_Core_DatabaseAccess}.
|
* of {@link SeedDMS_Core_DatabaseAccess}.
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
|
@ -427,7 +427,7 @@ class SeedDMS_Core_DMS {
|
||||||
* This method returns the database object as it was set by the first
|
* This method returns the database object as it was set by the first
|
||||||
* parameter of the constructor.
|
* parameter of the constructor.
|
||||||
*
|
*
|
||||||
* @return object database
|
* @return SeedDMS_Core_DatabaseAccess database
|
||||||
*/
|
*/
|
||||||
function getDB() { /* {{{ */
|
function getDB() { /* {{{ */
|
||||||
return $this->db;
|
return $this->db;
|
||||||
|
|
|
@ -176,7 +176,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
protected $_keywords;
|
protected $_keywords;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array list of categories
|
* @var SeedDMS_Core_DocumentCategory[] list of categories
|
||||||
*/
|
*/
|
||||||
protected $_categories;
|
protected $_categories;
|
||||||
|
|
||||||
|
@ -195,7 +195,15 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
*/
|
*/
|
||||||
protected $_content;
|
protected $_content;
|
||||||
|
|
||||||
function __construct($id, $name, $comment, $date, $expires, $ownerID, $folderID, $inheritAccess, $defaultAccess, $locked, $keywords, $sequence) { /* {{{ */
|
/**
|
||||||
|
* @var SeedDMS_Core_Folder
|
||||||
|
*/
|
||||||
|
protected $_folder;
|
||||||
|
|
||||||
|
/** @var SeedDMS_Core_UserAccess[] */
|
||||||
|
protected $_accessList;
|
||||||
|
|
||||||
|
function __construct($id, $name, $comment, $date, $expires, $ownerID, $folderID, $inheritAccess, $defaultAccess, $locked, $keywords, $sequence) { /* {{{ */
|
||||||
parent::__construct($id);
|
parent::__construct($id);
|
||||||
$this->_name = $name;
|
$this->_name = $name;
|
||||||
$this->_comment = $comment;
|
$this->_comment = $comment;
|
||||||
|
@ -214,14 +222,15 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$this->_content = null;
|
$this->_content = null;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an array of database fields which used for searching
|
* Return an array of database fields which used for searching
|
||||||
* a term entered in the database search form
|
* a term entered in the database search form
|
||||||
*
|
*
|
||||||
* @param array $searchin integer list of search scopes (2=name, 3=comment,
|
* @param SeedDMS_Core_DMS $dms
|
||||||
* 4=attributes)
|
* @param array $searchin integer list of search scopes (2=name, 3=comment,
|
||||||
* @return array list of database fields
|
* 4=attributes)
|
||||||
*/
|
* @return array list of database fields
|
||||||
|
*/
|
||||||
public static function getSearchFields($dms, $searchin) { /* {{{ */
|
public static function getSearchFields($dms, $searchin) { /* {{{ */
|
||||||
$db = $dms->getDB();
|
$db = $dms->getDB();
|
||||||
|
|
||||||
|
@ -247,6 +256,11 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return $searchFields;
|
return $searchFields;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param integer $id
|
||||||
|
* @param SeedDMS_Core_DMS $dms
|
||||||
|
* @return bool|SeedDMS_Core_Document
|
||||||
|
*/
|
||||||
public static function getInstance($id, $dms) { /* {{{ */
|
public static function getInstance($id, $dms) { /* {{{ */
|
||||||
$db = $dms->getDB();
|
$db = $dms->getDB();
|
||||||
|
|
||||||
|
@ -271,12 +285,13 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$classname = $dms->getClassname('document');
|
$classname = $dms->getClassname('document');
|
||||||
|
/** @var SeedDMS_Core_Document $document */
|
||||||
$document = new $classname($resArr["id"], $resArr["name"], $resArr["comment"], $resArr["date"], $resArr["expires"], $resArr["owner"], $resArr["folder"], $resArr["inheritAccess"], $resArr["defaultAccess"], $lock, $resArr["keywords"], $resArr["sequence"]);
|
$document = new $classname($resArr["id"], $resArr["name"], $resArr["comment"], $resArr["date"], $resArr["expires"], $resArr["owner"], $resArr["folder"], $resArr["inheritAccess"], $resArr["defaultAccess"], $lock, $resArr["keywords"], $resArr["sequence"]);
|
||||||
$document->setDMS($dms);
|
$document->setDMS($dms);
|
||||||
return $document;
|
return $document;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Return the directory of the document in the file system relativ
|
* Return the directory of the document in the file system relativ
|
||||||
* to the contentDir
|
* to the contentDir
|
||||||
*
|
*
|
||||||
|
@ -291,18 +306,19 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Return the name of the document
|
* Return the name of the document
|
||||||
*
|
*
|
||||||
* @return string name of document
|
* @return string name of document
|
||||||
*/
|
*/
|
||||||
function getName() { return $this->_name; }
|
function getName() { return $this->_name; }
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Set the name of the document
|
* Set the name of the document
|
||||||
*
|
*
|
||||||
* @param $newName string new name of document
|
* @param $newName string new name of document
|
||||||
*/
|
* @return bool
|
||||||
|
*/
|
||||||
function setName($newName) { /* {{{ */
|
function setName($newName) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -314,18 +330,19 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Return the comment of the document
|
* Return the comment of the document
|
||||||
*
|
*
|
||||||
* @return string comment of document
|
* @return string comment of document
|
||||||
*/
|
*/
|
||||||
function getComment() { return $this->_comment; }
|
function getComment() { return $this->_comment; }
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Set the comment of the document
|
* Set the comment of the document
|
||||||
*
|
*
|
||||||
* @param $newComment string new comment of document
|
* @param $newComment string new comment of document
|
||||||
*/
|
* @return bool
|
||||||
|
*/
|
||||||
function setComment($newComment) { /* {{{ */
|
function setComment($newComment) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -337,8 +354,15 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function getKeywords() { return $this->_keywords; }
|
function getKeywords() { return $this->_keywords; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $newKeywords
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function setKeywords($newKeywords) { /* {{{ */
|
function setKeywords($newKeywords) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -353,8 +377,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
/**
|
/**
|
||||||
* Retrieve a list of all categories this document belongs to
|
* Retrieve a list of all categories this document belongs to
|
||||||
*
|
*
|
||||||
* @return array list of category objects
|
* @return bool|SeedDMS_Core_DocumentCategory[]
|
||||||
*/
|
*/
|
||||||
function getCategories() { /* {{{ */
|
function getCategories() { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -373,13 +397,14 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return $this->_categories;
|
return $this->_categories;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a list of categories for the document
|
* Set a list of categories for the document
|
||||||
* This function will delete currently assigned categories and sets new
|
* This function will delete currently assigned categories and sets new
|
||||||
* categories.
|
* categories.
|
||||||
*
|
*
|
||||||
* @param array $newCategories list of category objects
|
* @param SeedDMS_Core_DocumentCategory[] $newCategories list of category objects
|
||||||
*/
|
* @return bool
|
||||||
|
*/
|
||||||
function setCategories($newCategories) { /* {{{ */
|
function setCategories($newCategories) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -439,7 +464,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
/**
|
/**
|
||||||
* Return the parent folder of the document
|
* Return the parent folder of the document
|
||||||
*
|
*
|
||||||
* @return object parent folder
|
* @return SeedDMS_Core_Folder parent folder
|
||||||
*/
|
*/
|
||||||
function getFolder() { /* {{{ */
|
function getFolder() { /* {{{ */
|
||||||
if (!isset($this->_folder))
|
if (!isset($this->_folder))
|
||||||
|
@ -453,7 +478,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
* This function basically moves a document from a folder to another
|
* This function basically moves a document from a folder to another
|
||||||
* folder.
|
* folder.
|
||||||
*
|
*
|
||||||
* @param object $newFolder
|
* @param SeedDMS_Core_Folder $newFolder
|
||||||
* @return boolean false in case of an error, otherwise true
|
* @return boolean false in case of an error, otherwise true
|
||||||
*/
|
*/
|
||||||
function setFolder($newFolder) { /* {{{ */
|
function setFolder($newFolder) { /* {{{ */
|
||||||
|
@ -463,12 +488,14 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
if (!$db->getResult($queryStr))
|
if (!$db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
$this->_folderID = $newFolder->getID();
|
$this->_folderID = $newFolder->getID();
|
||||||
$this->_folder = $newFolder;
|
/** @noinspection PhpUndefinedFieldInspection */
|
||||||
|
$this->_folder = $newFolder;
|
||||||
|
|
||||||
// Make sure that the folder search path is also updated.
|
// Make sure that the folder search path is also updated.
|
||||||
$path = $newFolder->getPath();
|
$path = $newFolder->getPath();
|
||||||
$flist = "";
|
$flist = "";
|
||||||
foreach ($path as $f) {
|
/** @var SeedDMS_Core_Folder[] $path */
|
||||||
|
foreach ($path as $f) {
|
||||||
$flist .= ":".$f->getID();
|
$flist .= ":".$f->getID();
|
||||||
}
|
}
|
||||||
if (strlen($flist)>1) {
|
if (strlen($flist)>1) {
|
||||||
|
@ -484,7 +511,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
/**
|
/**
|
||||||
* Return owner of document
|
* Return owner of document
|
||||||
*
|
*
|
||||||
* @return object owner of document as an instance of {@link SeedDMS_Core_User}
|
* @return SeedDMS_Core_User owner of document as an instance of {@link SeedDMS_Core_User}
|
||||||
*/
|
*/
|
||||||
function getOwner() { /* {{{ */
|
function getOwner() { /* {{{ */
|
||||||
if (!isset($this->_owner))
|
if (!isset($this->_owner))
|
||||||
|
@ -495,7 +522,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
/**
|
/**
|
||||||
* Set owner of a document
|
* Set owner of a document
|
||||||
*
|
*
|
||||||
* @param object $newOwner new owner
|
* @param SeedDMS_Core_User $newOwner new owner
|
||||||
* @return boolean true if successful otherwise false
|
* @return boolean true if successful otherwise false
|
||||||
*/
|
*/
|
||||||
function setOwner($newOwner) { /* {{{ */
|
function setOwner($newOwner) { /* {{{ */
|
||||||
|
@ -506,10 +533,14 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$this->_ownerID = $newOwner->getID();
|
$this->_ownerID = $newOwner->getID();
|
||||||
$this->_owner = $newOwner;
|
/** @noinspection PhpUndefinedFieldInspection */
|
||||||
|
$this->_owner = $newOwner;
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool|int
|
||||||
|
*/
|
||||||
function getDefaultAccess() { /* {{{ */
|
function getDefaultAccess() { /* {{{ */
|
||||||
if ($this->inheritsAccess()) {
|
if ($this->inheritsAccess()) {
|
||||||
$res = $this->getFolder();
|
$res = $this->getFolder();
|
||||||
|
@ -519,15 +550,16 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return $this->_defaultAccess;
|
return $this->_defaultAccess;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set default access mode
|
* Set default access mode
|
||||||
*
|
*
|
||||||
* This method sets the default access mode and also removes all notifiers which
|
* This method sets the default access mode and also removes all notifiers which
|
||||||
* will not have read access anymore.
|
* will not have read access anymore.
|
||||||
*
|
*
|
||||||
* @param integer $mode access mode
|
* @param integer $mode access mode
|
||||||
* @param boolean $noclean set to true if notifier list shall not be clean up
|
* @param boolean $noclean set to true if notifier list shall not be clean up
|
||||||
*/
|
* @return bool
|
||||||
|
*/
|
||||||
function setDefaultAccess($mode, $noclean="false") { /* {{{ */
|
function setDefaultAccess($mode, $noclean="false") { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -543,6 +575,9 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function inheritsAccess() { return $this->_inheritAccess; }
|
function inheritsAccess() { return $this->_inheritAccess; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -598,11 +633,12 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return $this->_expires;
|
return $this->_expires;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set expiration date as unix timestamp
|
* Set expiration date as unix timestamp
|
||||||
*
|
*
|
||||||
* @param integer unix timestamp of expiration date
|
* @param integer $expires unix timestamp of expiration date
|
||||||
*/
|
* @return bool
|
||||||
|
*/
|
||||||
function setExpires($expires) { /* {{{ */
|
function setExpires($expires) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -670,7 +706,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
/**
|
/**
|
||||||
* Lock or unlock document
|
* Lock or unlock document
|
||||||
*
|
*
|
||||||
* @param $falseOrUser user object for locking or false for unlocking
|
* @param SeedDMS_Core_User|bool $falseOrUser user object for locking or false for unlocking
|
||||||
* @return boolean true if operation was successful otherwise false
|
* @return boolean true if operation was successful otherwise false
|
||||||
*/
|
*/
|
||||||
function setLocked($falseOrUser) { /* {{{ */
|
function setLocked($falseOrUser) { /* {{{ */
|
||||||
|
@ -698,7 +734,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
/**
|
/**
|
||||||
* Get the user currently locking the document
|
* Get the user currently locking the document
|
||||||
*
|
*
|
||||||
* @return object user have a lock
|
* @return SeedDMS_Core_User|bool user have a lock
|
||||||
*/
|
*/
|
||||||
function getLockingUser() { /* {{{ */
|
function getLockingUser() { /* {{{ */
|
||||||
if (!$this->isLocked())
|
if (!$this->isLocked())
|
||||||
|
@ -709,8 +745,15 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return $this->_lockingUser;
|
return $this->_lockingUser;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
function getSequence() { return $this->_sequence; }
|
function getSequence() { return $this->_sequence; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $seq
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
function setSequence($seq) { /* {{{ */
|
function setSequence($seq) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -743,24 +786,24 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of access privileges
|
* Returns a list of access privileges
|
||||||
*
|
*
|
||||||
* If the document inherits the access privileges from the parent folder
|
* If the document inherits the access privileges from the parent folder
|
||||||
* those will be returned.
|
* those will be returned.
|
||||||
* $mode and $op can be set to restrict the list of returned access
|
* $mode and $op can be set to restrict the list of returned access
|
||||||
* privileges. If $mode is set to M_ANY no restriction will apply
|
* privileges. If $mode is set to M_ANY no restriction will apply
|
||||||
* regardless of the value of $op. The returned array contains a list
|
* regardless of the value of $op. The returned array contains a list
|
||||||
* of {@link SeedDMS_Core_UserAccess} and
|
* of {@link SeedDMS_Core_UserAccess} and
|
||||||
* {@link SeedDMS_Core_GroupAccess} objects. Even if the document
|
* {@link SeedDMS_Core_GroupAccess} objects. Even if the document
|
||||||
* has no access list the returned array contains the two elements
|
* has no access list the returned array contains the two elements
|
||||||
* 'users' and 'groups' which are than empty. The methode returns false
|
* 'users' and 'groups' which are than empty. The methode returns false
|
||||||
* if the function fails.
|
* if the function fails.
|
||||||
*
|
*
|
||||||
* @param integer $mode access mode (defaults to M_ANY)
|
* @param int $mode access mode (defaults to M_ANY)
|
||||||
* @param integer $op operation (defaults to O_EQ)
|
* @param int|string $op operation (defaults to O_EQ)
|
||||||
* @return array multi dimensional array or false in case of an error
|
* @return bool|SeedDMS_Core_UserAccess[]
|
||||||
*/
|
*/
|
||||||
function getAccessList($mode = M_ANY, $op = O_EQ) { /* {{{ */
|
function getAccessList($mode = M_ANY, $op = O_EQ) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -796,16 +839,17 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return $this->_accessList[$mode];
|
return $this->_accessList[$mode];
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add access right to folder
|
* Add access right to folder
|
||||||
* This function may change in the future. Instead of passing the a flag
|
* This function may change in the future. Instead of passing the a flag
|
||||||
* and a user/group id a user or group object will be expected.
|
* and a user/group id a user or group object will be expected.
|
||||||
*
|
*
|
||||||
* @param integer $mode access mode
|
* @param integer $mode access mode
|
||||||
* @param integer $userOrGroupID id of user or group
|
* @param integer $userOrGroupID id of user or group
|
||||||
* @param integer $isUser set to 1 if $userOrGroupID is the id of a
|
* @param integer $isUser set to 1 if $userOrGroupID is the id of a
|
||||||
* user
|
* user
|
||||||
*/
|
* @return bool
|
||||||
|
*/
|
||||||
function addAccess($mode, $userOrGroupID, $isUser) { /* {{{ */
|
function addAccess($mode, $userOrGroupID, $isUser) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -826,16 +870,17 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change access right of document
|
* Change access right of document
|
||||||
* This function may change in the future. Instead of passing the a flag
|
* This function may change in the future. Instead of passing the a flag
|
||||||
* and a user/group id a user or group object will be expected.
|
* and a user/group id a user or group object will be expected.
|
||||||
*
|
*
|
||||||
* @param integer $newMode access mode
|
* @param integer $newMode access mode
|
||||||
* @param integer $userOrGroupID id of user or group
|
* @param integer $userOrGroupID id of user or group
|
||||||
* @param integer $isUser set to 1 if $userOrGroupID is the id of a
|
* @param integer $isUser set to 1 if $userOrGroupID is the id of a
|
||||||
* user
|
* user
|
||||||
*/
|
* @return bool
|
||||||
|
*/
|
||||||
function changeAccess($newMode, $userOrGroupID, $isUser) { /* {{{ */
|
function changeAccess($newMode, $userOrGroupID, $isUser) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -1182,10 +1227,10 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
* is allowed to remove a notification. This must be checked by the calling
|
* is allowed to remove a notification. This must be checked by the calling
|
||||||
* application.
|
* application.
|
||||||
*
|
*
|
||||||
* @param $userOrGroupID id of user or group
|
* @param integer $userOrGroupID id of user or group
|
||||||
* @param $isUser boolean true if a user is passed in $userOrGroupID, false
|
* @param boolean $isUser boolean true if a user is passed in $userOrGroupID, false
|
||||||
* if a group is passed in $userOrGroupID
|
* if a group is passed in $userOrGroupID
|
||||||
* @param $type type of notification (0 will delete all) Not used yet!
|
* @param integer $type type of notification (0 will delete all) Not used yet!
|
||||||
* @return integer 0 if operation was succesful
|
* @return integer 0 if operation was succesful
|
||||||
* -1 if the userid/groupid is invalid
|
* -1 if the userid/groupid is invalid
|
||||||
* -3 if the user/group is already subscribed
|
* -3 if the user/group is already subscribed
|
||||||
|
|
|
@ -552,8 +552,8 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
* Returns an array of all parents, grand parent, etc. up to root folder.
|
* Returns an array of all parents, grand parent, etc. up to root folder.
|
||||||
* The folder itself is the last element of the array.
|
* The folder itself is the last element of the array.
|
||||||
*
|
*
|
||||||
* @return array Array of parents
|
* @return array|bool
|
||||||
*/
|
*/
|
||||||
function getPath() { /* {{{ */
|
function getPath() { /* {{{ */
|
||||||
if (!isset($this->_parentID) || ($this->_parentID == "") || ($this->_parentID == 0) || ($this->_id == $this->_dms->rootFolderID)) {
|
if (!isset($this->_parentID) || ($this->_parentID == "") || ($this->_parentID == 0) || ($this->_id == $this->_dms->rootFolderID)) {
|
||||||
return array($this);
|
return array($this);
|
||||||
|
|
|
@ -38,12 +38,16 @@ class SeedDMS_Core_Object { /* {{{ */
|
||||||
*/
|
*/
|
||||||
public $_dms;
|
public $_dms;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SeedDMS_Core_Object constructor.
|
||||||
|
* @param $id
|
||||||
|
*/
|
||||||
function __construct($id) { /* {{{ */
|
function __construct($id) { /* {{{ */
|
||||||
$this->_id = $id;
|
$this->_id = $id;
|
||||||
$this->_dms = null;
|
$this->_dms = null;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Set dms this object belongs to.
|
* Set dms this object belongs to.
|
||||||
*
|
*
|
||||||
* Each object needs a reference to the dms it belongs to. It will be
|
* Each object needs a reference to the dms it belongs to. It will be
|
||||||
|
@ -51,13 +55,13 @@ class SeedDMS_Core_Object { /* {{{ */
|
||||||
* The dms has a references to the currently logged in user
|
* The dms has a references to the currently logged in user
|
||||||
* and the database connection.
|
* and the database connection.
|
||||||
*
|
*
|
||||||
* @param object $dms reference to dms
|
* @param SeedDMS_Core_DMS $dms reference to dms
|
||||||
*/
|
*/
|
||||||
function setDMS($dms) { /* {{{ */
|
function setDMS($dms) { /* {{{ */
|
||||||
$this->_dms = $dms;
|
$this->_dms = $dms;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Return the internal id of the document
|
* Return the internal id of the document
|
||||||
*
|
*
|
||||||
* @return integer id of document
|
* @return integer id of document
|
||||||
|
|
Loading…
Reference in New Issue
Block a user