mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 14:37:20 +00:00
- prefixed all remaining classes with LetoDMS_
- moved pseudo static functions into classes
This commit is contained in:
parent
a8e5a892a5
commit
51c720f20b
|
@ -976,7 +976,7 @@ class LetoDMS_Document
|
||||||
|
|
||||||
unset($this->_content);
|
unset($this->_content);
|
||||||
unset($this->_latestContent);
|
unset($this->_latestContent);
|
||||||
$docResultSet = new AddContentResultSet(new LetoDMS_DocumentContent($this->_id, $version, $comment, $date, $user->getID(), $dir, $orgFileName, $fileType, $mimeType));
|
$docResultSet = new LetoDMS_AddContentResultSet(new LetoDMS_DocumentContent($this->_id, $version, $comment, $date, $user->getID(), $dir, $orgFileName, $fileType, $mimeType));
|
||||||
|
|
||||||
// TODO - verify
|
// TODO - verify
|
||||||
if ($settings->_enableConverting && in_array($docResultSet->_content->getFileType(), array_keys($settings->_convertFileTypes)))
|
if ($settings->_enableConverting && in_array($docResultSet->_content->getFileType(), array_keys($settings->_convertFileTypes)))
|
||||||
|
@ -1149,7 +1149,7 @@ class LetoDMS_Document
|
||||||
$this->_documentLinks = array();
|
$this->_documentLinks = array();
|
||||||
|
|
||||||
foreach ($resArr as $row)
|
foreach ($resArr as $row)
|
||||||
array_push($this->_documentLinks, new DocumentLink($row["id"], $row["document"], $row["target"], $row["userID"], $row["public"]));
|
array_push($this->_documentLinks, new LetoDMS_DocumentLink($row["id"], $row["document"], $row["target"], $row["userID"], $row["public"]));
|
||||||
}
|
}
|
||||||
return $this->_documentLinks;
|
return $this->_documentLinks;
|
||||||
}
|
}
|
||||||
|
@ -1191,7 +1191,7 @@ class LetoDMS_Document
|
||||||
$this->_documentFiles = array();
|
$this->_documentFiles = array();
|
||||||
|
|
||||||
foreach ($resArr as $row)
|
foreach ($resArr as $row)
|
||||||
array_push($this->_documentFiles, new DocumentFile($row["id"], $row["document"], $row["userID"], $row["comment"], $row["date"], $row["dir"], $row["fileType"], $row["mimeType"], $row["orgFileName"], $row["name"]));
|
array_push($this->_documentFiles, new LetoDMS_DocumentFile($row["id"], $row["document"], $row["userID"], $row["comment"], $row["date"], $row["dir"], $row["fileType"], $row["mimeType"], $row["orgFileName"], $row["name"]));
|
||||||
}
|
}
|
||||||
return $this->_documentFiles;
|
return $this->_documentFiles;
|
||||||
}
|
}
|
||||||
|
@ -2394,27 +2394,16 @@ class LetoDMS_DocumentContent
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
function getDocumentLink($linkID) {
|
function getDocumentLink($linkID) {
|
||||||
|
return LetoDMS_DocumentLink::getDocumentLink($linkID);
|
||||||
GLOBAL $db;
|
}
|
||||||
|
|
||||||
if (!is_numeric($linkID)) return false;
|
function filterDocumentLinks($user, $links)
|
||||||
|
{
|
||||||
$queryStr = "SELECT * FROM tblDocumentLinks WHERE id = " . $linkID;
|
|
||||||
$resArr = $db->getResultArray($queryStr);
|
|
||||||
if ((is_bool($resArr) && !$resArr) || count($resArr)==0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
$resArr = $resArr[0];
|
|
||||||
return new DocumentLink($resArr["id"], $resArr["document"], $resArr["target"], $resArr["userID"], $resArr["public"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function filterDocumentLinks($user, $links)
|
|
||||||
{
|
|
||||||
GLOBAL $settings;
|
GLOBAL $settings;
|
||||||
|
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
|
@ -2422,9 +2411,9 @@ function filterDocumentLinks($user, $links)
|
||||||
if ($link->isPublic() || ($link->_userID == $user->getID()) || ($user->getID() == $settings->_adminID) )
|
if ($link->isPublic() || ($link->_userID == $user->getID()) || ($user->getID() == $settings->_adminID) )
|
||||||
array_push($tmp, $link);
|
array_push($tmp, $link);
|
||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
class DocumentLink
|
class LetoDMS_DocumentLink
|
||||||
{
|
{
|
||||||
var $_id;
|
var $_id;
|
||||||
var $_documentID;
|
var $_documentID;
|
||||||
|
@ -2432,7 +2421,7 @@ class DocumentLink
|
||||||
var $_userID;
|
var $_userID;
|
||||||
var $_public;
|
var $_public;
|
||||||
|
|
||||||
function DocumentLink($id, $documentID, $targetID, $userID, $public)
|
function LetoDMS_DocumentLink($id, $documentID, $targetID, $userID, $public)
|
||||||
{
|
{
|
||||||
$this->_id = $id;
|
$this->_id = $id;
|
||||||
$this->_documentID = $documentID;
|
$this->_documentID = $documentID;
|
||||||
|
@ -2441,26 +2430,41 @@ class DocumentLink
|
||||||
$this->_public = $public;
|
$this->_public = $public;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDocumentLink($linkID) {
|
||||||
|
|
||||||
|
GLOBAL $db;
|
||||||
|
|
||||||
|
if (!is_numeric($linkID)) return false;
|
||||||
|
|
||||||
|
$queryStr = "SELECT * FROM tblDocumentLinks WHERE id = " . $linkID;
|
||||||
|
$resArr = $db->getResultArray($queryStr);
|
||||||
|
if ((is_bool($resArr) && !$resArr) || count($resArr)==0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$resArr = $resArr[0];
|
||||||
|
return new LetoDMS_DocumentLink($resArr["id"], $resArr["document"], $resArr["target"], $resArr["userID"], $resArr["public"]);
|
||||||
|
}
|
||||||
|
|
||||||
function getID() { return $this->_id; }
|
function getID() { return $this->_id; }
|
||||||
|
|
||||||
function getDocument()
|
function getDocument()
|
||||||
{
|
{
|
||||||
if (!isset($this->_document))
|
if (!isset($this->_document))
|
||||||
$this->_document = getDocument($this->_documentID);
|
$this->_document = LetoDMS_Document::getDocument($this->_documentID);
|
||||||
return $this->_document;
|
return $this->_document;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTarget()
|
function getTarget()
|
||||||
{
|
{
|
||||||
if (!isset($this->_target))
|
if (!isset($this->_target))
|
||||||
$this->_target = getDocument($this->_targetID);
|
$this->_target = LetoDMS_Document::getDocument($this->_targetID);
|
||||||
return $this->_target;
|
return $this->_target;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUser()
|
function getUser()
|
||||||
{
|
{
|
||||||
if (!isset($this->_user))
|
if (!isset($this->_user))
|
||||||
$this->_user = getUser($this->_userID);
|
$this->_user = LetoDMS_User::getUser($this->_userID);
|
||||||
return $this->_user;
|
return $this->_user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2481,20 +2485,10 @@ class DocumentLink
|
||||||
/* ---------------------------------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
function getDocumentFile($ID) {
|
function getDocumentFile($ID) {
|
||||||
|
return LetoDMS_DocumentFile::getDocumentFile($ID);
|
||||||
GLOBAL $db;
|
}
|
||||||
|
|
||||||
if (!is_numeric($ID)) return false;
|
|
||||||
|
|
||||||
$queryStr = "SELECT * FROM tblDocumentFiles WHERE id = " . $ID;
|
|
||||||
$resArr = $db->getResultArray($queryStr);
|
|
||||||
if ((is_bool($resArr) && !$resArr) || count($resArr)==0) return false;
|
|
||||||
|
|
||||||
$resArr = $resArr[0];
|
|
||||||
return new DocumentFile($resArr["id"], $resArr["document"], $resArr["userID"], $resArr["comment"], $resArr["date"], $resArr["dir"], $resArr["fileType"], $resArr["mimeType"], $resArr["orgFileName"], $resArr["name"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
class DocumentFile
|
class LetoDMS_DocumentFile
|
||||||
{
|
{
|
||||||
var $_id;
|
var $_id;
|
||||||
var $_documentID;
|
var $_documentID;
|
||||||
|
@ -2507,7 +2501,7 @@ class DocumentFile
|
||||||
var $_orgFileName;
|
var $_orgFileName;
|
||||||
var $_name;
|
var $_name;
|
||||||
|
|
||||||
function DocumentFile($id, $documentID, $userID, $comment, $date, $dir, $fileType, $mimeType, $orgFileName,$name)
|
function LetoDMS_DocumentFile($id, $documentID, $userID, $comment, $date, $dir, $fileType, $mimeType, $orgFileName,$name)
|
||||||
{
|
{
|
||||||
$this->_id = $id;
|
$this->_id = $id;
|
||||||
$this->_documentID = $documentID;
|
$this->_documentID = $documentID;
|
||||||
|
@ -2521,6 +2515,19 @@ class DocumentFile
|
||||||
$this->_name = $name;
|
$this->_name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDocumentFile($ID) {
|
||||||
|
GLOBAL $db;
|
||||||
|
|
||||||
|
if (!is_numeric($ID)) return false;
|
||||||
|
|
||||||
|
$queryStr = "SELECT * FROM tblDocumentFiles WHERE id = " . $ID;
|
||||||
|
$resArr = $db->getResultArray($queryStr);
|
||||||
|
if ((is_bool($resArr) && !$resArr) || count($resArr)==0) return false;
|
||||||
|
|
||||||
|
$resArr = $resArr[0];
|
||||||
|
return new LetoDMS_DocumentFile($resArr["id"], $resArr["document"], $resArr["userID"], $resArr["comment"], $resArr["date"], $resArr["dir"], $resArr["fileType"], $resArr["mimeType"], $resArr["orgFileName"], $resArr["name"]);
|
||||||
|
}
|
||||||
|
|
||||||
function getID() { return $this->_id; }
|
function getID() { return $this->_id; }
|
||||||
function getDocumentID() { return $this->_documentID; }
|
function getDocumentID() { return $this->_documentID; }
|
||||||
function getUserID() { return $this->_userID; }
|
function getUserID() { return $this->_userID; }
|
||||||
|
@ -2567,7 +2574,7 @@ class DocumentFile
|
||||||
// The object stores a copy of the new DocumentContent object, the newly assigned
|
// The object stores a copy of the new DocumentContent object, the newly assigned
|
||||||
// reviewers and approvers and the status.
|
// reviewers and approvers and the status.
|
||||||
//
|
//
|
||||||
class AddContentResultSet {
|
class LetoDMS_AddContentResultSet {
|
||||||
|
|
||||||
var $_indReviewers;
|
var $_indReviewers;
|
||||||
var $_grpReviewers;
|
var $_grpReviewers;
|
||||||
|
@ -2576,7 +2583,7 @@ class AddContentResultSet {
|
||||||
var $_content;
|
var $_content;
|
||||||
var $_status;
|
var $_status;
|
||||||
|
|
||||||
function AddContentResultSet($content) {
|
function LetoDMS_AddContentResultSet($content) {
|
||||||
|
|
||||||
$this->_content = $content;
|
$this->_content = $content;
|
||||||
$this->_indReviewers = null;
|
$this->_indReviewers = null;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user