remove most of html code to create form

This commit is contained in:
Uwe Steinmann 2021-09-29 21:23:51 +02:00
parent 19266f1647
commit 43f7a94aa6

View File

@ -103,6 +103,9 @@ $(document).ready(function() {
} }
} }
$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);
$this->contentStart(); $this->contentStart();
@ -110,7 +113,6 @@ $(document).ready(function() {
$this->contentHeading(getMLText("submit_receipt")); $this->contentHeading(getMLText("submit_receipt"));
if(getMLText('info_submit_receipt', array(), '')) if(getMLText('info_submit_receipt', array(), ''))
$this->infoMsg(getMLText('info_submit_receipt', array(), '')); $this->infoMsg(getMLText('info_submit_receipt', array(), ''));
$this->contentContainerStart();
// Display the Receipt form. // Display the Receipt form.
$receipttype = ($receiptStatus['type'] == 0) ? 'ind' : 'grp'; $receipttype = ($receiptStatus['type'] == 0) ? 'ind' : 'grp';
@ -132,32 +134,38 @@ $(document).ready(function() {
?> ?>
<form class="form-horizontal" method="post" action="../op/op.ReceiptDocument.php" id="form<?= $receipttype ?>" name="form<?= $receipttype ?>"> <form class="form-horizontal" method="post" action="../op/op.ReceiptDocument.php" id="form<?= $receipttype ?>" name="form<?= $receipttype ?>">
<?php echo createHiddenFieldWithKey('receiptdocument'); ?> <?php echo createHiddenFieldWithKey('receiptdocument'); ?>
<div class="control-group"> <?php
<label class="control-label"><?php printMLText("comment");?>:</label> $this->contentContainerStart();
<div class="controls"> $this->formField(
<textarea name="comment" cols="80" rows="4"></textarea> getMLText("comment"),
</div> array(
</div> 'element'=>'textarea',
<?php if($receiptreject) { ?> 'name'=>'comment',
<div class="control-group"> 'required'=>true,
<label class="control-label"><?php printMLText("receipt_status");?>:</label> 'rows'=>4,
<div class="controls"> 'cols'=>80
<select name="receiptStatus"> )
<?php if($receiptStatus['status'] != 1) { ?> );
<option value='1'><?php printMLText("status_receipted")?></option> if($receiptreject) {
<?php } ?> $options = array();
<?php if($receiptStatus['status'] != -1) { ?> if($revisionStatus['status'] != 1)
<option value='-1'><?php printMLText("rejected")?></option> $options[] = array('1', getMLText("status_receipted"));
<?php } ?> if($revisionStatus['status'] != -1)
</select> $options[] = array('-1', getMLText("rejected"));
</div> $this->formField(
</div> getMLText("revision_status"),
<?php } else { ?> array(
<input type="hidden" name="receiptStatus" value="1" /> 'element'=>'select',
<?php } ?> 'name'=>'receiptStatus',
<div class="controls"> 'options'=>$options,
<input type='submit' class="btn btn-primary" name='<?= $receipttype ?>Receipt' value='<?php printMLText("submit_receipt")?>'/> )
<div> );
} else {
echo '<input type="hidden" name="receiptStatus" value="1" />';
}
$this->contentContainerEnd();
$this->formSubmit(getMLText('submit_revision'), $revisiontype.'Revision');
?>
<input type='hidden' name='receiptType' value='<?= $receipttype ?>'/> <input type='hidden' name='receiptType' value='<?= $receipttype ?>'/>
<?php if($receipttype == 'grp'): ?> <?php if($receipttype == 'grp'): ?>
<input type='hidden' name='receiptGroup' value='<?php echo $receiptStatus['required']; ?>'/> <input type='hidden' name='receiptGroup' value='<?php echo $receiptStatus['required']; ?>'/>
@ -166,7 +174,6 @@ $(document).ready(function() {
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/> <input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
</form> </form>
<?php <?php
$this->contentContainerEnd();
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */