keeping filter and pagination when saving OrderJournal

This commit is contained in:
Frank Schubert
2021-11-02 21:47:02 +01:00
parent 42f4da3799
commit 5a132add9b
4 changed files with 26 additions and 10 deletions
+9 -3
View File
@@ -223,6 +223,10 @@
<div id="new-journal-<?=$order->id?>" class="card-body hidden">
<form method="post" action="<?=self::getUrl("OrderJournal", "save")?>">
<input type="hidden" name="order_id" value="<?=$order->id?>" />
<input type="hidden" name="s" value="<?=$pagination['start']?>" />
<?php foreach($filter as $n => $v): ?>
<input type="hidden" name="filter[<?=$n?>]" value="<?=$v?>" />
<?php endforeach; ?>
<textarea name="text" class="form-control mb-2" style="height:120px;"></textarea>
<button class="btn btn-sm btn-primary" type="submit"><i class="fas fa-save"></i> Speichern</button>
</form>
@@ -550,6 +554,10 @@
<div id="new-journal-<?=$order->id?>" class="card-body hidden">
<form method="post" action="<?=self::getUrl("OrderJournal", "save")?>">
<input type="hidden" name="order_id" value="<?=$order->id?>" />
<input type="hidden" name="s" value="<?=$pagination['start']?>" />
<?php foreach($filter as $n => $v): ?>
<input type="hidden" name="filter[<?=$n?>]" value="<?=$v?>" />
<?php endforeach; ?>
<textarea name="text" class="form-control mb-2" style="height:120px;"></textarea>
<button class="btn btn-sm btn-primary" type="submit"><i class="fas fa-save"></i> Speichern</button>
</form>
@@ -755,7 +763,6 @@
});
function toggleOrder(id) {
$('#order-detail-' + id).toggle();
if($('#order-detail-' + id).is(":hidden")) {
@@ -768,7 +775,6 @@
}
function scrollToDiv(element){
element = element.replace("link", "");
$('html,body').unbind().animate({scrollTop: $(element).offset().top-180},'slow');
@@ -778,7 +784,7 @@
toggleOrder(<?=$highlight?>);
scrollToDiv("#order-<?=$highlight?>");
<?php if($addJournal): ?>
$('#new-journal-<?=$highlight?>').toggle()
$('#new-journal-<?=$highlight?>').toggle();
$('#new-journal-<?=$highlight?> textarea[name=text]').focus();
<?php endif; ?>
<?php endif; ?>