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

This commit is contained in:
Uwe Steinmann 2021-11-17 20:58:16 +01:00
commit 611be01cce

View File

@ -33,30 +33,22 @@ class SeedDMS_View_OverrideContentStatus extends SeedDMS_Theme_Style {
function js() { /* {{{ */
header('Content-Type: application/javascript; charset=UTF-8');
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
?>
function checkForm()
{
msg = new Array();
if (document.form1.overrideStatus.value == "") msg.push("<?php printMLText("js_no_override_status");?>");
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
if (msg != "") {
noty({
text: msg.join('<br />'),
type: 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
_timeout: 1500,
});
return false;
}
else
return true;
}
$(document).ready(function() {
$('body').on('submit', '#form1', function(ev){
if(checkForm()) return;
ev.preventDefault();
$("#form1").validate({
rules: {
comment: {
required: true
},
overrideStatus: {
required: true
},
},
messages: {
comment: "<?php printMLText("js_no_comment");?>",
overrideStatus: "<?php printMLText("js_no_override_status");?>",
},
});
});
<?php
@ -73,6 +65,9 @@ $(document).ready(function() {
$reviewStatus = $content->getReviewStatus();
$approvalStatus = $content->getApprovalStatus();
$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->globalNavigation($folder);
$this->contentStart();
@ -93,6 +88,7 @@ $(document).ready(function() {
array(
'element'=>'textarea',
'name'=>'comment',
'required'=>true,
'rows'=>4,
)
);