fix some return values, use configured class names

This commit is contained in:
Uwe Steinmann 2015-07-15 08:19:09 +02:00
parent ef8e4e8400
commit de62d04129

View File

@ -30,7 +30,7 @@ define("S_DRAFT_APP", 1);
/*
* Document is released. A document is in release state either when
* it needs no review or approval after uploaded or has been reviewed
* and/or approved..
* and/or approved.
*/
define("S_RELEASED", 2);
@ -2366,6 +2366,8 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* then its status is set to S_RELEASED immediately. Any change of
* the status is monitored in the table tblDocumentStatusLog. This
* function will always return the latest entry for the content.
*
* @return array latest record from tblDocumentStatusLog
*/
function getStatus($limit=1) { /* {{{ */
$db = $this->_document->_dms->getDB();
@ -2375,20 +2377,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
// Retrieve the current overall status of the content represented by
// this object.
if (!isset($this->_status)) {
/*
if (!$db->createTemporaryTable("ttstatid", $forceTemporaryTable)) {
return false;
}
$queryStr="SELECT `tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ".
"`tblDocumentStatusLog`.`comment`, `tblDocumentStatusLog`.`date`, ".
"`tblDocumentStatusLog`.`userID` ".
"FROM `tblDocumentStatus` ".
"LEFT JOIN `tblDocumentStatusLog` USING (`statusID`) ".
"LEFT JOIN `ttstatid` ON `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` ".
"WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` ".
"AND `tblDocumentStatus`.`documentID` = '". $this->_document->getID() ."' ".
"AND `tblDocumentStatus`.`version` = '". $this->_version ."' ";
*/
$queryStr=
"SELECT `tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ".
"`tblDocumentStatusLog`.`comment`, `tblDocumentStatusLog`.`date`, ".
@ -2480,7 +2468,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return false;
unset($this->_status);
return true;
} /* }}} */
@ -3106,7 +3093,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if (count($reviewStatus["indstatus"])==0) {
// User is not assigned to review this document. No action required.
// Return an error.
return -3;
return -2;
}
$indstatus = array_pop($reviewStatus["indstatus"]);
if ($indstatus["status"]!=0) {
@ -3138,7 +3125,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if (count($reviewStatus)==0) {
// User is not assigned to review this document. No action required.
// Return an error.
return -3;
return -2;
}
if ($reviewStatus[0]["status"]!=0) {
// User has already submitted a review or has already been deleted;
@ -3169,7 +3156,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if (count($approvalStatus["indstatus"])==0) {
// User is not assigned to approve this document. No action required.
// Return an error.
return -3;
return -2;
}
$indstatus = array_pop($approvalStatus["indstatus"]);
if ($indstatus["status"]!=0) {
@ -3201,7 +3188,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if (count($approvalStatus)==0) {
// User is not assigned to approve this document. No action required.
// Return an error.
return -3;
return -2;
}
if ($approvalStatus[0]["status"]!=0) {
// User has already submitted an approval or has already been deleted;
@ -4155,7 +4142,7 @@ class SeedDMS_Core_AddContentResultSet { /* {{{ */
return false;
}
if (!strcasecmp($type, "i")) {
if (strcasecmp(get_class($approver), "SeedDMS_Core_User")) {
if (strcasecmp(get_class($approver), $dms->getClassname("user"))) {
return false;
}
if ($this->_indApprovers == null) {
@ -4164,7 +4151,7 @@ class SeedDMS_Core_AddContentResultSet { /* {{{ */
$this->_indApprovers[$status][] = $approver;
}
if (!strcasecmp($type, "g")) {
if (strcasecmp(get_class($approver), "SeedDMS_Core_Group")) {
if (strcasecmp(get_class($approver), $dms->getClassname("group"))) {
return false;
}
if ($this->_grpApprovers == null) {