Added fields to Preordercampaign

This commit is contained in:
Frank Schubert
2022-05-11 17:35:21 +02:00
parent 11ede6a5b7
commit ebf2f808f3
13 changed files with 531 additions and 15 deletions

View File

@@ -0,0 +1,71 @@
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="<?=self::getUrl("Dashboard")?>"><?=MFAPPNAME_SLUG?></a></li>
<li class="breadcrumb-item active">Verträge</li>
</ol>
</div>
<h4 class="page-title">Verträge</h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body mb-3">
<div class="float-left">
<h4 class="header-title">Liste aller Verträge</h4>
</div>
<div class="float-right">
<a class="btn btn-primary mb-2" href="<?=self::getUrl("Contract", "add")?>"><i class="fas fa-plus"></i> Neuen Vertrag anlegen</a>
</div>
<table class="table table-striped table-hover">
<tr>
<th>Inhaber</th>
<th>Produkt</th>
<th>Anschluss</th>
<th>Preis</th>
<th>Preis Setup</th>
<th>Rechnungsperiode</th>
<th>Erstellt</th>
<th>Zuletzt bearbeitet</th>
<th></th>
</tr>
<?php foreach($contracts as $contract): ?>
<tr>
<td><?=$contract->owner->getCompanyOrName()?></td>
<td><?=$contract->product->name?></td>
<td>
<?php if($contract->termination_id): ?>
<?=$contract->termination->building->street?><br />
<?=$contract->termination->building->zip?> <?=$contract->termination->building->city?>
<?php endif; ?>
</td>
<td><?=$contract->price?></td>
<td><?=$contract->price_setup?></td>
<td><?=(12 / $contract->billing_period)?>x Jährlich</td>
<td><?=date('d.m.Y H:i', $contract->create)?> (<?=$contract->creator->name?>)</td>
<td><?=date('d.m.Y H:i', $contract->edit)?> (<?=$contract->editor->name?>)</td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?=self::getUrl("Contract", "edit", ["id" => $contract->id])?>"><i class="far fa-edit" title="Vertrag bearbeiten"></i></a>
<a href="<?=self::getUrl("Contract", "cancel", ["id" => $contract->id])?>" class="text-danger" title="Vertrag kündigen"><i class="fas fa-trash"></i></a>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>
</div>
</div>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>

View File

@@ -119,9 +119,9 @@
<label class="col-lg-2 col-form-label" for="type">Vorbestelltyp *</label>
<div class="col-lg-10">
<select class="form-control" name="type" id="type">
<option value="interest" <?=($preorder->type == "interest") ? "selected='selected'" : ""?>>Interessensbekundung</option>
<option value="provision" <?=($preorder->type == "provision") ? "selected='selected'" : ""?>>Vorsorgeanschluss</option>
<option value="order" <?=($preorder->type == "order") ? "selected='selected'" : ""?>>Vollanschluss</option>
<?php if(array_key_exists("interest", $campaign->types)): ?><option value="interest" <?=($preorder->type == "interest") ? "selected='selected'" : ""?>>Interessensbekundung</option><?php endif; ?>
<?php if(array_key_exists("provision", $campaign->types)): ?><option value="provision" <?=($preorder->type == "provision") ? "selected='selected'" : ""?>>Vorsorgeanschluss</option><?php endif; ?>
<?php if(array_key_exists("order", $campaign->types)): ?><option value="order" <?=($preorder->type == "order") ? "selected='selected'" : ""?>>Vollanschluss</option><?php endif; ?>
</select>
</div>
</div>

View File

@@ -70,7 +70,6 @@
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="to">Bis</label>
<div class="col-lg-10">
@@ -78,6 +77,39 @@
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="product_type">Verfügbare Produkte *</label>
<div class="col-lg-10">
<select class="form-control" name="product_type" id="product_type" data-placeholder="Bitte auswählen ...">
<option value="all" <?=($campaign->product_type == "all") ? "selected='selected'" : ""?>>Alle Produkte im Netzgebiet</option>
<option value="setup_only" <?=($campaign->product_type == "setup_only") ? "selected='selected'" : ""?>>Nur Anschlussbestellung, keine Produkte</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="types">Erlaubte Anschlusstypen *</label>
<div class="col-lg-10">
<select class="select2 form-control select2-multiple" name="types[]" id="types" multiple="multiple" data-placeholder="Bitte auswählen ...">
<option value="interest" <?=(is_array($campaign->types) && array_key_exists("interest", $campaign->types)) ? "selected='selected'" : ""?>><?=__("interest", "preorder")?></option>
<option value="provision" <?=(is_array($campaign->types) && array_key_exists("provision", $campaign->types)) ? "selected='selected'" : ""?>><?=__("provision", "preorder")?></option>
<option value="order" <?=(is_array($campaign->types) && array_key_exists("order", $campaign->types)) ? "selected='selected'" : "netowner"?>><?=__("order", "preorder")?></option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="fulfillment">Auftragsabwicklung bei Projektstart *</label>
<div class="col-lg-10">
<select class="form-control" name="fulfillment" id="fulfillment" data-placeholder="Bitte auswählen ...">
<option value="thetool" <?=($campaign->fulfillment == "thetool") ? "selected='selected'" : ""?>>thetool</option>
<option value="thirdparty" <?=($campaign->fulfillment == "thirdparty") ? "selected='selected'" : ""?>>Drittsystem</option>
</select>
</div>
</div>
</div>
</div>
@@ -117,5 +149,12 @@
todayBtn: 'linked',
autoclose: true
});
$("#types").select2({
allowClear: true,
placeholder: "",
closeOnSelect: false
});
</script>
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>