use configured class names, remove old code

This commit is contained in:
Uwe Steinmann 2015-07-15 08:20:55 +02:00
parent 533011df95
commit 832e760e03

View File

@ -22,7 +22,7 @@
* 2010 Uwe Steinmann * 2010 Uwe Steinmann
* @version Release: @package_version@ * @version Release: @package_version@
*/ */
class SeedDMS_Core_User { class SeedDMS_Core_User { /* {{{ */
/** /**
* @var integer id of user * @var integer id of user
* *
@ -67,9 +67,7 @@ class SeedDMS_Core_User {
/** /**
* @var string prefered language of user * @var string prefered language of user
* possible values are 'English', 'German', 'Chinese_ZH_TW', 'Czech' * possible values are subdirectories within the language directory
* 'Francais', 'Hungarian', 'Italian', 'Portuguese_BR', 'Slovak',
* 'Spanish'
* *
* @access protected * @access protected
*/ */
@ -748,8 +746,9 @@ class SeedDMS_Core_User {
return false; return false;
$this->_groups = array(); $this->_groups = array();
$classname = $this->_dms->getClassname('group');
foreach ($resArr as $row) { foreach ($resArr as $row) {
$group = new SeedDMS_Core_Group($row["id"], $row["name"], $row["comment"]); $group = new $classname($row["id"], $row["name"], $row["comment"]);
$group->setDMS($this->_dms); $group->setDMS($this->_dms);
array_push($this->_groups, $group); array_push($this->_groups, $group);
} }
@ -844,8 +843,9 @@ class SeedDMS_Core_User {
return false; return false;
$documents = array(); $documents = array();
$classname = $this->_dms->getClassname('document');
foreach ($resArr as $row) { foreach ($resArr as $row) {
$document = new SeedDMS_Core_Document($row["id"], $row["name"], $row["comment"], $row["date"], $row["expires"], $row["owner"], $row["folder"], $row["inheritAccess"], $row["defaultAccess"], $row["lockUser"], $row["keywords"], $row["sequence"]); $document = new $classname($row["id"], $row["name"], $row["comment"], $row["date"], $row["expires"], $row["owner"], $row["folder"], $row["inheritAccess"], $row["defaultAccess"], $row["lockUser"], $row["keywords"], $row["sequence"]);
$document->setDMS($this->_dms); $document->setDMS($this->_dms);
$documents[] = $document; $documents[] = $document;
} }
@ -854,8 +854,6 @@ class SeedDMS_Core_User {
/** /**
* Returns all documents locked by a given user * Returns all documents locked by a given user
* FIXME: Not full implemented. Do not use, because it still requires the
* temporary tables!
* *
* @param object $user * @param object $user
* @return array list of documents * @return array list of documents
@ -873,8 +871,9 @@ class SeedDMS_Core_User {
return false; return false;
$documents = array(); $documents = array();
$classname = $this->_dms->getClassname('document');
foreach ($resArr as $row) { foreach ($resArr as $row) {
$document = new SeedDMS_Core_Document($row["id"], $row["name"], $row["comment"], $row["date"], $row["expires"], $row["owner"], $row["folder"], $row["inheritAccess"], $row["defaultAccess"], $row["lockUser"], $row["keywords"], $row["sequence"]); $document = new $classname($row["id"], $row["name"], $row["comment"], $row["date"], $row["expires"], $row["owner"], $row["folder"], $row["inheritAccess"], $row["defaultAccess"], $row["lockUser"], $row["keywords"], $row["sequence"]);
$document->setDMS($this->_dms); $document->setDMS($this->_dms);
$documents[] = $document; $documents[] = $document;
} }
@ -885,7 +884,7 @@ class SeedDMS_Core_User {
* Get a list of reviews * Get a list of reviews
* This function returns a list of all reviews seperated by individual * This function returns a list of all reviews seperated by individual
* and group reviews. If the document id * and group reviews. If the document id
* is passed, then only this document will be checked for approvals. The * is passed, then only this document will be checked for reviews. The
* same is true for the version of a document which limits the list * same is true for the version of a document which limits the list
* further. * further.
* *
@ -901,11 +900,6 @@ class SeedDMS_Core_User {
function getReviewStatus($documentID=null, $version=null) { /* {{{ */ function getReviewStatus($documentID=null, $version=null) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
/*
if (!$db->createTemporaryTable("ttreviewid")) {
return false;
}
*/
$status = array("indstatus"=>array(), "grpstatus"=>array()); $status = array("indstatus"=>array(), "grpstatus"=>array());
// See if the user is assigned as an individual reviewer. // See if the user is assigned as an individual reviewer.
@ -995,27 +989,7 @@ class SeedDMS_Core_User {
function getApprovalStatus($documentID=null, $version=null) { /* {{{ */ function getApprovalStatus($documentID=null, $version=null) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
/*
if (!$db->createTemporaryTable("ttapproveid")) {
return false;
}
*/
$status = array("indstatus"=>array(), "grpstatus"=>array()); $status = array("indstatus"=>array(), "grpstatus"=>array());
// See if the user is assigned as an individual approver.
/*
$queryStr = "SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ".
"`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ".
"`tblDocumentApproveLog`.`userID` ".
"FROM `tblDocumentApprovers` ".
"LEFT JOIN `tblDocumentApproveLog` USING (`approveID`) ".
"LEFT JOIN `ttapproveid` on `ttapproveid`.`maxLogID` = `tblDocumentApproveLog`.`approveLogID` ".
"WHERE `ttapproveid`.`maxLogID`=`tblDocumentApproveLog`.`approveLogID` ".
($documentID==null ? "" : "AND `tblDocumentApprovers`.`documentID` = '". $documentID ."' ").
($version==null ? "" : "AND `tblDocumentApprovers`.`version` = '". $version ."' ").
"AND `tblDocumentApprovers`.`type`='0' ".
"AND `tblDocumentApprovers`.`required`='". $this->_id ."' ";
*/
$queryStr = $queryStr =
"SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ". "SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ".
"`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ". "`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ".
@ -1045,20 +1019,6 @@ class SeedDMS_Core_User {
// See if the user is the member of a group that has been assigned to // See if the user is the member of a group that has been assigned to
// approve the document version. // approve the document version.
/*
$queryStr = "SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ".
"`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ".
"`tblDocumentApproveLog`.`userID` ".
"FROM `tblDocumentApprovers` ".
"LEFT JOIN `tblDocumentApproveLog` USING (`approveID`) ".
"LEFT JOIN `tblGroupMembers` ON `tblGroupMembers`.`groupID` = `tblDocumentApprovers`.`required` ".
"LEFT JOIN `ttapproveid` on `ttapproveid`.`maxLogID` = `tblDocumentApproveLog`.`approveLogID` ".
"WHERE `ttapproveid`.`maxLogID`=`tblDocumentApproveLog`.`approveLogID` ".
($documentID==null ? "" : "AND `tblDocumentApprovers`.`documentID` = '". $documentID ."' ").
($version==null ? "" : "AND `tblDocumentApprovers`.`version` = '". $version ."' ").
"AND `tblDocumentApprovers`.`type`='1' ".
"AND `tblGroupMembers`.`userID`='". $this->_id ."'";
*/
$queryStr = $queryStr =
"SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ". "SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ".
"`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ". "`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ".
@ -1314,5 +1274,5 @@ class SeedDMS_Core_User {
return true; return true;
} /* }}} */ } /* }}} */
} } /* }}} */
?> ?>