Preorder: Status can now be changed manually
This commit is contained in:
@@ -58,14 +58,12 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_status">Status</label>
|
||||
<select name="filter[status][]" id="filter_status" class="form-control" multiple="multiple">
|
||||
<option value="new" <?=(isset($filter) && array_key_exists("status", $filter) && in_array("new", $filter['status'])) ? "selected='selected'" : ""?>>Aufgenommen</option>
|
||||
<option value="approved" <?=(isset($filter) && array_key_exists("status", $filter) && in_array("approved", $filter['status'])) ? "selected='selected'" : ""?>>Freigegeben</option>
|
||||
<option value="pipework" <?=(isset($filter) && array_key_exists("status", $filter) && in_array("pipework", $filter['status'])) ? "selected='selected'" : ""?>>Tiefbau</option>
|
||||
<option value="linework" <?=(isset($filter) && array_key_exists("status", $filter) && in_array("linework", $filter['status'])) ? "selected='selected'" : ""?>>Leitungsbau</option>
|
||||
<option value="finished" <?=(isset($filter) && array_key_exists("status", $filter) && in_array("finished", $filter['status'])) ? "selected='selected'" : ""?>>Hergestellt</option>
|
||||
<?php foreach(PreorderstatusModel::getAll() as $status): ?>
|
||||
<option value="<?=$status->id?>" <?=(isset($filter) && array_key_exists("status", $filter) && in_array($status->id, $filter['status'])) ? "selected='selected'" : ""?>><?=$status->code?> - <?=$status->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -258,7 +256,7 @@
|
||||
<?=__($preorder->type, "preorder")?><br />
|
||||
<?=$preorder->ucode?>
|
||||
</td>
|
||||
<td>Aufgenommen</td>
|
||||
<td class="status"><?=$preorder->status->code?> - <?=$preorder->status->name?></td>
|
||||
<?php if($preorder->building_id): ?>
|
||||
<td><?=$preorder->building->street?><br /><?=$preorder->building->zip?> <?=$preorder->building->city?></td>
|
||||
<?php elseif($preorder->adb_hausnummer_id): ?>
|
||||
|
||||
@@ -35,7 +35,20 @@
|
||||
<td><?=$preorder->campaign->name?></td>
|
||||
</tr><tr>
|
||||
<th>Status:</th>
|
||||
<td class="text-monospace"><?=$preorder->status->code?> - <?=$preorder->status->name?></td>
|
||||
<td class="text-monospace">
|
||||
<span id="preorder-detail-status-<?=$preorder->id?>-text"><span id="preorder-detail-status-<?=$preorder->id?>-statustext"><?=$preorder->status->code?> - <?=$preorder->status->name?></span> <a href="#" onclick="return toggleStatusControl(<?=$preorder->id?>, <?=$preorder->status_id?>)"><i class="fas fa-fw fa-edit"></i></a></span>
|
||||
<div class="input-group" id="preorder-detail-status-<?=$preorder->id?>-input" style="display:none">
|
||||
<select class="form-control">
|
||||
<?php foreach(PreorderstatusModel::getAll() as $status): ?>
|
||||
<option value="<?=$status->id?>" <?=($preorder->status_id == $status->id) ? "selected='selected'" : ""?>><?=$status->code?> - <?=$status->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-primary" title="Speichern" onclick="savePreorderStatusControl(<?=$preorder->id?>, 'email')"><i class="fas fa-check"></i></button>
|
||||
<button type="button" class="btn btn-secondary" title="Abbrechen" onclick="toggleStatusControl(<?=$preorder->id?>, 'email')"><i class="fas fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>OAID:</th>
|
||||
<td class="text-monospace text-pink"><?=$preorder->oaid?></td>
|
||||
@@ -329,4 +342,42 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function toggleStatusControl(pid, sid) {
|
||||
$("#preorder-detail-status-" + pid + "-input select").val(sid);
|
||||
$("#preorder-detail-status-" + pid + "-text").toggle();
|
||||
$("#preorder-detail-status-" + pid + "-input").toggle();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function savePreorderStatusControl(pid) {
|
||||
if(!Number.isInteger(pid) || pid < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var value = $("#preorder-detail-status-" + pid + "-input select").val();
|
||||
|
||||
$.post("<?=self::getUrl("Preorder","Api")?>",
|
||||
{
|
||||
'do': "updateStatus",
|
||||
id: pid,
|
||||
status_id: value
|
||||
},
|
||||
function(success) {
|
||||
if(success.status == "OK") {
|
||||
$("#preorder-detail-status-" + pid + "-statustext").text(success.result.status_code + " - " + success.result.status_text);
|
||||
|
||||
$("#preorder-detail-status-" + pid + "-text").addClass("text-success");
|
||||
setTimeout(() => { $("#preorder-detail-status-" + pid + "-text").removeClass("text-success") }, 1500);
|
||||
|
||||
$("#preorder-" + pid + " .status").text(success.result.status_code + " - " + success.result.status_text);
|
||||
$("#preorder-" + pid + " .status").addClass("text-success");
|
||||
setTimeout(() => { $("#preorder-" + pid + " .status").removeClass("text-success") }, 1500);
|
||||
toggleStatusControl(pid);
|
||||
}
|
||||
},
|
||||
'json');
|
||||
}
|
||||
</script>
|
||||
@@ -43,15 +43,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<!--div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="name">Taktung *</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="increment" class="form-control" name="increment" id="increment" value="<?=($plan->increment_first && $plan->increment) ? $plan->increment_first."/".$plan->increment : ""?>" placeholder="60/30" />
|
||||
</div>
|
||||
</div>
|
||||
</div-->
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="first">Destinations kopieren von bestehendem Tarifpaket</label>
|
||||
<label class="col-lg-2 col-form-label" for="first">Zonen und Destinationen aus bestehendem Tarifpaket kopieren</label>
|
||||
<div class="col-lg-10">
|
||||
<select name="copy_from_plan_id" class="form-control">
|
||||
<option value=""></option>
|
||||
@@ -63,10 +65,11 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="first">oder Destinations Importieren</label>
|
||||
<label class="col-lg-2 col-form-label" for="first">oder Zonen und Destinationen neu importieren</label>
|
||||
<div class="col-lg-10">
|
||||
<input type="file" class="form-control" name="voiceplanfile" />
|
||||
<small class="text-danger">ACHTUNG: Bestehende Destinations werden gelöscht!</small>
|
||||
Zonen File: <input type="file" class="form-control" name="voiceplanzonefile" />
|
||||
Destinations File: <input type="file" class="form-control" name="voiceplandestinationfile" />
|
||||
<?php if($voiceplan->id): ?><small class="text-danger">ACHTUNG: Bestehende Zonen und Destinationen werden gelöscht!</small><?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user