Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2021-02-09 11:16:55 +01:00
commit 6fa0849924
2 changed files with 8 additions and 7 deletions

View File

@ -70,7 +70,7 @@ if (!$accessop->mayApprove($document)){
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied")); UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
} }
$approvals = $latestContent->getApprovalStatus(); $approvals = $content->getApprovalStatus();
if(!$approvals) { if(!$approvals) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("no_action")); UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("no_action"));
} }
@ -80,6 +80,8 @@ $view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
if($view) { if($view) {
$view->setParam('folder', $folder); $view->setParam('folder', $folder);
$view->setParam('document', $document); $view->setParam('document', $document);
$view->setParam('version', $content);
$view->setParam('approveid', (int) $_GET['approveid']);
$view->setParam('accessobject', $accessop); $view->setParam('accessobject', $accessop);
$view($_GET); $view($_GET);
exit; exit;

View File

@ -94,12 +94,12 @@ $(document).ready(function() {
$user = $this->params['user']; $user = $this->params['user'];
$folder = $this->params['folder']; $folder = $this->params['folder'];
$document = $this->params['document']; $document = $this->params['document'];
$content = $this->params['version'];
$approveid = $this->params['approveid'];
$latestContent = $document->getLatestContent(); $approvals = $content->getApprovalStatus();
$approvals = $latestContent->getApprovalStatus();
foreach($approvals as $approval) { foreach($approvals as $approval) {
if($approval['approveID'] == $_GET['approveid']) { if($approval['approveID'] == $approveid) {
$approvalStatus = $approval; $approvalStatus = $approval;
break; break;
} }
@ -167,10 +167,9 @@ $(document).ready(function() {
<input type='hidden' name='approvalGroup' value="<?php echo $approvalStatus['required']; ?>" /> <input type='hidden' name='approvalGroup' value="<?php echo $approvalStatus['required']; ?>" />
<?php endif; ?> <?php endif; ?>
<input type='hidden' name='documentid' value='<?php echo $document->getId() ?>'/> <input type='hidden' name='documentid' value='<?php echo $document->getId() ?>'/>
<input type='hidden' name='version' value='<?php echo $latestContent->getVersion(); ?>'/> <input type='hidden' name='version' value='<?php echo $content->getVersion(); ?>'/>
</form> </form>
<?php <?php
$this->contentContainerEnd(); $this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();