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->globalNavigation($folder);
$this->contentStart();
@ -110,7 +113,6 @@ $(document).ready(function() {
$this->contentHeading(getMLText("submit_receipt"));
if(getMLText('info_submit_receipt', array(), ''))
$this->infoMsg(getMLText('info_submit_receipt', array(), ''));
$this->contentContainerStart();
// Display the Receipt form.
$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 ?>">
<?php echo createHiddenFieldWithKey('receiptdocument'); ?>
<div class="control-group">
<label class="control-label"><?php printMLText("comment");?>:</label>
<div class="controls">
<textarea name="comment" cols="80" rows="4"></textarea>
</div>
</div>
<?php if($receiptreject) { ?>
<div class="control-group">
<label class="control-label"><?php printMLText("receipt_status");?>:</label>
<div class="controls">
<select name="receiptStatus">
<?php if($receiptStatus['status'] != 1) { ?>
<option value='1'><?php printMLText("status_receipted")?></option>
<?php } ?>
<?php if($receiptStatus['status'] != -1) { ?>
<option value='-1'><?php printMLText("rejected")?></option>
<?php } ?>
</select>
</div>
</div>
<?php } else { ?>
<input type="hidden" name="receiptStatus" value="1" />
<?php } ?>
<div class="controls">
<input type='submit' class="btn btn-primary" name='<?= $receipttype ?>Receipt' value='<?php printMLText("submit_receipt")?>'/>
<div>
<?php
$this->contentContainerStart();
$this->formField(
getMLText("comment"),
array(
'element'=>'textarea',
'name'=>'comment',
'required'=>true,
'rows'=>4,
'cols'=>80
)
);
if($receiptreject) {
$options = array();
if($revisionStatus['status'] != 1)
$options[] = array('1', getMLText("status_receipted"));
if($revisionStatus['status'] != -1)
$options[] = array('-1', getMLText("rejected"));
$this->formField(
getMLText("revision_status"),
array(
'element'=>'select',
'name'=>'receiptStatus',
'options'=>$options,
)
);
} 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 ?>'/>
<?php if($receipttype == 'grp'): ?>
<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() ?>'/>
</form>
<?php
$this->contentContainerEnd();
$this->contentEnd();
$this->htmlEndPage();
} /* }}} */