mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
fix various errors and validation of form
This commit is contained in:
parent
3487a27f9d
commit
768631bf55
|
@ -33,55 +33,36 @@ class SeedDMS_View_ReceiptDocument extends SeedDMS_Theme_Style {
|
|||
|
||||
function js() { /* {{{ */
|
||||
header('Content-Type: application/javascript; charset=UTF-8');
|
||||
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
|
||||
?>
|
||||
function checkIndForm()
|
||||
{
|
||||
msg = new Array();
|
||||
if (document.formind.reviewStatus.value == "") msg.push("<?php printMLText("js_no_receipt_status");?>");
|
||||
if (document.formind.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;
|
||||
}
|
||||
function checkGrpForm()
|
||||
{
|
||||
msg = new Array();
|
||||
if (document.formgrp.reviewGroup.value == "") msg.push("<?php printMLText("js_no_receipt_group");?>");
|
||||
if (document.formgrp.reviewStatus.value == "") msg.push("<?php printMLText("js_no_receipt_status");?>");
|
||||
if (document.formgrp.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', '#formind', function(ev){
|
||||
if(checkIndForm()) return;
|
||||
event.preventDefault();
|
||||
$("#formind").validate({
|
||||
rules: {
|
||||
comment: {
|
||||
required: true
|
||||
},
|
||||
receiptStatus: {
|
||||
required: true
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
comment: "<?php printMLText("js_no_comment");?>",
|
||||
receiptStatus: "<?php printMLText("js_no_receipt_status");?>",
|
||||
},
|
||||
});
|
||||
$('body').on('submit', '#formgrp', function(ev){
|
||||
if(checkGrpForm()) return;
|
||||
event.preventDefault();
|
||||
$("#formgrp").validate({
|
||||
rules: {
|
||||
comment: {
|
||||
required: true
|
||||
},
|
||||
receiptStatus: {
|
||||
required: true
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
comment: "<?php printMLText("js_no_comment");?>",
|
||||
receiptStatus: "<?php printMLText("js_no_receipt_status");?>",
|
||||
},
|
||||
});
|
||||
});
|
||||
<?php
|
||||
|
@ -148,12 +129,12 @@ $(document).ready(function() {
|
|||
);
|
||||
if($receiptreject) {
|
||||
$options = array();
|
||||
if($revisionStatus['status'] != 1)
|
||||
if($receiptStatus['status'] != 1)
|
||||
$options[] = array('1', getMLText("status_receipted"));
|
||||
if($revisionStatus['status'] != -1)
|
||||
if($receiptStatus['status'] != -1)
|
||||
$options[] = array('-1', getMLText("rejected"));
|
||||
$this->formField(
|
||||
getMLText("revision_status"),
|
||||
getMLText("receipt_status"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'name'=>'receiptStatus',
|
||||
|
@ -164,7 +145,7 @@ $(document).ready(function() {
|
|||
echo '<input type="hidden" name="receiptStatus" value="1" />';
|
||||
}
|
||||
$this->contentContainerEnd();
|
||||
$this->formSubmit(getMLText('submit_revision'), $revisiontype.'Revision');
|
||||
$this->formSubmit(getMLText('submit_receipt'), $receipttype.'Receipt');
|
||||
?>
|
||||
<input type='hidden' name='receiptType' value='<?= $receipttype ?>'/>
|
||||
<?php if($receipttype == 'grp'): ?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user