mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
611be01cce
|
@ -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,
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user