mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
issue warning if document has expired, validate form to add link
This commit is contained in:
parent
2ec025451b
commit
ea45ed5b7b
|
@ -179,17 +179,31 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
||||||
$document = $this->params['document'];
|
$document = $this->params['document'];
|
||||||
|
|
||||||
header('Content-Type: application/javascript; charset=UTF-8');
|
header('Content-Type: application/javascript; charset=UTF-8');
|
||||||
parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder'));
|
parent::jsTranslations(array('js_form_error', 'js_form_errors', 'cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder'));
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin()) {
|
||||||
$latestContent = $this->callHook('documentLatestContent', $document);
|
$latestContent = $this->callHook('documentLatestContent', $document);
|
||||||
if($latestContent === null)
|
if($latestContent === null)
|
||||||
$latestContent = $document->getLatestContent();
|
$latestContent = $document->getLatestContent();
|
||||||
$this->printTimelineJs('out.ViewDocument.php?action=timelinedata&documentid='.$latestContent->getDocument()->getID(), 300, '', date('Y-m-d'));
|
$this->printTimelineJs('out.ViewDocument.php?action=timelinedata&documentid='.$latestContent->getDocument()->getID(), 300, '', date('Y-m-d'));
|
||||||
}
|
}
|
||||||
// $this->printDocumentChooserJs("form1");
|
|
||||||
$this->printDeleteDocumentButtonJs();
|
$this->printDeleteDocumentButtonJs();
|
||||||
/* Add js for catching click on document in one page mode */
|
/* Add js for catching click on document in one page mode */
|
||||||
$this->printClickDocumentJs();
|
$this->printClickDocumentJs();
|
||||||
|
?>
|
||||||
|
$(document).ready( function() {
|
||||||
|
$("#form1").validate({
|
||||||
|
ignore: [],
|
||||||
|
rules: {
|
||||||
|
docid: {
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
docid: "<?php printMLText("js_no_document");?>",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
<?php
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function documentInfos() { /* {{{ */
|
function documentInfos() { /* {{{ */
|
||||||
|
@ -646,6 +660,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
||||||
$this->htmlAddHeader('<link href="../styles/bootstrap/timeline/timeline.css" rel="stylesheet">'."\n", 'css');
|
$this->htmlAddHeader('<link href="../styles/bootstrap/timeline/timeline.css" rel="stylesheet">'."\n", 'css');
|
||||||
$this->htmlAddHeader('<script type="text/javascript" src="../styles/bootstrap/timeline/timeline-min.js"></script>'."\n", 'js');
|
$this->htmlAddHeader('<script type="text/javascript" src="../styles/bootstrap/timeline/timeline-min.js"></script>'."\n", 'js');
|
||||||
$this->htmlAddHeader('<script type="text/javascript" src="../styles/bootstrap/timeline/timeline-locales.js"></script>'."\n", 'js');
|
$this->htmlAddHeader('<script type="text/javascript" src="../styles/bootstrap/timeline/timeline-locales.js"></script>'."\n", 'js');
|
||||||
|
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
|
||||||
|
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||||
$this->globalNavigation($folder);
|
$this->globalNavigation($folder);
|
||||||
|
@ -820,6 +836,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
||||||
?>
|
?>
|
||||||
<div class="tab-pane <?php if($currenttab == 'revapp') echo 'active'; ?>" id="revapp" role="tabpanel">
|
<div class="tab-pane <?php if($currenttab == 'revapp') echo 'active'; ?>" id="revapp" role="tabpanel">
|
||||||
<?php
|
<?php
|
||||||
|
if($document->hasExpired())
|
||||||
|
$this->warningMsg(getMLText('cannot_revapp_expired_docs'));
|
||||||
$this->rowStart();
|
$this->rowStart();
|
||||||
/* Just check fo an exting reviewStatus, even workflow mode is set
|
/* Just check fo an exting reviewStatus, even workflow mode is set
|
||||||
* to traditional_only_approval. There may be old documents which
|
* to traditional_only_approval. There may be old documents which
|
||||||
|
@ -1413,7 +1431,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Theme_Style {
|
||||||
if (!$user->isGuest()){
|
if (!$user->isGuest()){
|
||||||
?>
|
?>
|
||||||
<br>
|
<br>
|
||||||
<form action="../op/op.AddDocumentLink.php" name="form1" class="form-horizontal">
|
<form action="../op/op.AddDocumentLink.php" id="form1" name="form1" class="form-horizontal">
|
||||||
<input type="hidden" name="documentid" value="<?php print $documentid;?>">
|
<input type="hidden" name="documentid" value="<?php print $documentid;?>">
|
||||||
<?php echo createHiddenFieldWithKey('adddocumentlink'); ?>
|
<?php echo createHiddenFieldWithKey('adddocumentlink'); ?>
|
||||||
<?php $this->contentContainerStart(); ?>
|
<?php $this->contentContainerStart(); ?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user