mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
- added more documentation
This commit is contained in:
parent
c594cb334a
commit
816ff09d9d
|
@ -227,7 +227,12 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function getCategories() {
|
/**
|
||||||
|
* Retrieve a list of all categories this document belongs to
|
||||||
|
*
|
||||||
|
* @return array list of category objects
|
||||||
|
*/
|
||||||
|
function getCategories() { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
if(!$this->_categories) {
|
if(!$this->_categories) {
|
||||||
|
@ -243,8 +248,15 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->_categories;
|
return $this->_categories;
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set a list of categories for the document
|
||||||
|
* This function will delete currently assigned categories and sets new
|
||||||
|
* categories.
|
||||||
|
*
|
||||||
|
* @param array $newCategories list of category objects
|
||||||
|
*/
|
||||||
function setCategories($newCategories) { /* {{{ */
|
function setCategories($newCategories) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -263,7 +275,7 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return creation date of document
|
* Return creation date of the document
|
||||||
*
|
*
|
||||||
* @return integer unix timestamp of creation date
|
* @return integer unix timestamp of creation date
|
||||||
*/
|
*/
|
||||||
|
@ -271,6 +283,11 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
return $this->_date;
|
return $this->_date;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the parent folder of the document
|
||||||
|
*
|
||||||
|
* @return object parent folder
|
||||||
|
*/
|
||||||
function getFolder() { /* {{{ */
|
function getFolder() { /* {{{ */
|
||||||
if (!isset($this->_folder))
|
if (!isset($this->_folder))
|
||||||
$this->_folder = $this->_dms->getFolder($this->_folderID);
|
$this->_folder = $this->_dms->getFolder($this->_folderID);
|
||||||
|
@ -418,6 +435,11 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if document expires
|
||||||
|
*
|
||||||
|
* @return boolean true if document has expiration date set, otherwise false
|
||||||
|
*/
|
||||||
function expires() { /* {{{ */
|
function expires() { /* {{{ */
|
||||||
if (intval($this->_expires) == 0)
|
if (intval($this->_expires) == 0)
|
||||||
return false;
|
return false;
|
||||||
|
@ -425,6 +447,11 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get expiration time of document
|
||||||
|
*
|
||||||
|
* @return integer/boolean expiration date as unix timestamp or false
|
||||||
|
*/
|
||||||
function getExpires() { /* {{{ */
|
function getExpires() { /* {{{ */
|
||||||
if (intval($this->_expires) == 0)
|
if (intval($this->_expires) == 0)
|
||||||
return false;
|
return false;
|
||||||
|
@ -432,6 +459,11 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
return $this->_expires;
|
return $this->_expires;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set expiration date as unix timestamp
|
||||||
|
*
|
||||||
|
* @param integer unix timestamp of expiration date
|
||||||
|
*/
|
||||||
function setExpires($expires) { /* {{{ */
|
function setExpires($expires) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -655,6 +687,14 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove access rights for a user or group
|
||||||
|
*
|
||||||
|
* @param integer $userOrGroupID ID of user or group
|
||||||
|
* @param boolean $isUser true if $userOrGroupID is a user id, false if it
|
||||||
|
* is a group id.
|
||||||
|
* @return boolean true on success, otherwise false
|
||||||
|
*/
|
||||||
function removeAccess($userOrGroupID, $isUser) { /* {{{ */
|
function removeAccess($userOrGroupID, $isUser) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
@ -666,7 +706,7 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
|
|
||||||
unset($this->_accessList);
|
unset($this->_accessList);
|
||||||
|
|
||||||
// Update the notify list, if necessary.
|
// Update the notify list, if the user looses access rights.
|
||||||
$mode = ($isUser ? $this->getAccessMode($this->_dms->getUser($userOrGroupID)) : $this->getGroupAccessMode($this->_dms->getGroup($userOrGroupID)));
|
$mode = ($isUser ? $this->getAccessMode($this->_dms->getUser($userOrGroupID)) : $this->getGroupAccessMode($this->_dms->getGroup($userOrGroupID)));
|
||||||
if ($mode == M_NONE) {
|
if ($mode == M_NONE) {
|
||||||
$this->removeNotify($userOrGroupID, $isUser);
|
$this->removeNotify($userOrGroupID, $isUser);
|
||||||
|
@ -805,7 +845,7 @@ class LetoDMS_Core_Document { /* {{{ */
|
||||||
* -3: User is already subscribed.
|
* -3: User is already subscribed.
|
||||||
* -4: Database / internal error.
|
* -4: Database / internal error.
|
||||||
*/
|
*/
|
||||||
function addNotify($userOrGroupID, $isUser,$send_email=TRUE) { /* {{{ */
|
function addNotify($userOrGroupID, $isUser) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
$userOrGroup = ($isUser ? "userID" : "groupID");
|
$userOrGroup = ($isUser ? "userID" : "groupID");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user