rewriteReceiptLog() can handle none exiting users

This commit is contained in:
Uwe Steinmann 2017-03-09 11:14:31 +01:00
parent 0cfd663275
commit ee4215f89e

View File

@ -3635,7 +3635,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
/* Second, insert the new entries */
foreach($recipients as $receipt) {
$queryStr = "INSERT INTO `tblDocumentRecipients` (`documentID`, `version`, `type`, `required`) ".
"VALUES ('".$this->_document->getID()."', '".$this->_version."', ".$receipt['type'] .", ".$receipt['required']->getID().")";
"VALUES ('".$this->_document->getID()."', '".$this->_version."', ".$receipt['type'] .", ".(is_object($receipt['required']) ? $receipt['required']->getID() : (int) $receipt['required']).")";
if (!$db->getResult($queryStr)) {
$db->rollbackTransaction();
return false;
@ -3648,7 +3648,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return false;
}
$queryStr = "INSERT INTO `tblDocumentReceiptLog` (`receiptID`, `status`, `comment`, `date`, `userID`) ".
"VALUES ('".$receiptID ."', '".(int) $log['status']."', ".$db->qstr($log['comment']) .", ".$db->qstr($log['date']).", ".$log['user']->getID().")";
"VALUES ('".$receiptID ."', '".(int) $log['status']."', ".$db->qstr($log['comment']) .", ".$db->qstr($log['date']).", ".(is_object($log['user']) ? $log['user']->getID() : (int) $log['user']).")";
if (!$db->getResult($queryStr)) {
$db->rollbackTransaction();
return false;