More Contract stuff
This commit is contained in:
@@ -172,6 +172,58 @@
|
||||
<div class="card">
|
||||
<div class="card-body" id="link-container">
|
||||
<h4>Verknüpfungen</h4>
|
||||
|
||||
<table class="table table-striped table-sm table-bordered">
|
||||
<tr>
|
||||
<th>Verknüpfung</th>
|
||||
<th>Kunde</th>
|
||||
<th>Contract ID</th>
|
||||
<th>Produkt</th>
|
||||
<th>Matchcode</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($contract->links as $type => $links): ?>
|
||||
<?php foreach($links as $link): ?>
|
||||
<tr>
|
||||
<td><?=$type?></td>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $link->contract->owner_id])?>"><?=$link->contract->owner->getCompanyOrName()?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract_id?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product->name?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->matchcode?></a></td>
|
||||
<td>
|
||||
<a href="<?=self::getUrl("Contract", "deleteLink", ["link_id" => $link->id])?>" onclick="if(!confirm('Verknüpfung wirklich entfernen?')) return false;" class="text-danger" title="Verknüpfung entfernen"><i class="fas fa-xmark-large"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<?php foreach($contract->links as $link): ?>
|
||||
<div class="form-group row" id="link-<?=$linknum?>">
|
||||
<label class="col-lg-2 col-form-label" for="links_<?=$link->id?>_contract_id"></label>
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<select class="form-control" name="links[<?=$link->id?>][type]">
|
||||
<option value="link" <?=($link->type == "link") ? "selected='selected'" : ""?>>Verknüpfung mit</option>
|
||||
<option value="upgrade" <?=($link->type == "upgrade") ? "selected='selected'" : ""?>>Upgrade von</option>
|
||||
<option value="downgrade" <?=($link->type == "downgrade") ? "selected='selected'" : ""?>>Downgrade von</option>
|
||||
<option value="relocation" <?=($link->type == "relocation") ? "selected='selected'" : ""?>>Umzug von</option>
|
||||
<option value="productchange" <?=($link->type == "productchange") ? "selected='selected'" : ""?>>Produktwechsel von</option>
|
||||
</select>
|
||||
</div>
|
||||
<!--input type="text" class="form-control" name="links[<?=$linknum?>][contract_id]" id="links_<?=$linknum?>_contract_id" placeholder="Contract ID oder Suche nach Produkt, Matchcode, Kunde" value="<?=$contract->cancel_date?>"-->
|
||||
<select class="form-control basicAutoComplete link-autocomplete" autocomplete="off" name="links[<?=$link->id?>][contract_id]" id="links_<?=$link->id?>_contract_id" data-linknum="<?=$link->id?>" data-url="<?=self::getUrl('Contract','api')?>?do=findContract&autocomplete=1&preferred_address_id=<?=$contract->owner->id?>" placeholder="Contract ID oder Suche nach Produkt, Matchcode, Kunde" data-noresults-text="Keine Suchergebnisse">
|
||||
<option></option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-danger" onclick="clearNewLink(<?=$link->id?>)"><i class="fas fa-xmark-large mr-1"></i> Entfernen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php $linknum = 1337; ?>
|
||||
<div class="form-group row" id="link-<?=$linknum?>">
|
||||
<label class="col-lg-2 col-form-label" for="links_<?=$linknum?>_contract_id"></label>
|
||||
|
||||
@@ -32,7 +32,12 @@
|
||||
<div class="row">
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_owner">Inhaber</label>
|
||||
<label class="form-label" for="filter_owner">Kundennummer</label>
|
||||
<input type="text" class="form-control" name="filter[customer_number]" id="filter_street" value="<?=$filter['customer_number']?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_owner">Inhaber Name</label>
|
||||
<input type="text" class="form-control" name="filter[owner]" id="filter_street" value="<?=$filter['owner']?>" />
|
||||
</div>
|
||||
|
||||
@@ -51,6 +56,13 @@
|
||||
<input type="text" class="form-control" name="filter[product_name]" id="filter_product_name" value="<?=$filter['product_name']?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_show_canceled">Gekündigte Produkte</label>
|
||||
<select class="form-control" name="filter[show_canceled]" id="filter_show_canceled">
|
||||
<option value="0" <?=($filter['show_canceled'] == 0) ? "selected='selected'" : ""?>>Ausblenden</option>
|
||||
<option value="1" <?=($filter['show_canceled'] == 1 ) ? "selected='selected'" : ""?>>Anzeigen</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
<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"><a href="<?=self::getUrl("Contract")?>">Verträge</a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Contract")?>">Aktive Produkte</a></li>
|
||||
<li class="breadcrumb-item active"><?=$contract->product_name?> [<?=$contract->matchcode?>]</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?=$contract->product_name?> [<?=$contract->matchcode?>] (<?=$contract->id?>)</h4>
|
||||
<h4 class="page-title">Aktives Produkt</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,87 +29,119 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>Vertragsinhaber</h4>
|
||||
<h3 class="text-center mb-3"><?=$contract->product_name?> (<?=$contract->id?>)</h3>
|
||||
|
||||
<table class="table table-sm table-striped view-table">
|
||||
<tr>
|
||||
<th style="max-width: 50vw;">ID:</th>
|
||||
<td style="width: 50vw;"><a href="<?=self::getUrl("Address", "View", ["id" => $contract->owner->id])?>"><?=$contract->owner->id?></a></td>
|
||||
</tr><tr>
|
||||
<th>Kundennummer:</th>
|
||||
<td><?=$contract->owner->customer_number?></td>
|
||||
</tr><tr>
|
||||
<th>Adresse:</th>
|
||||
<td>
|
||||
<?=($contract->owner->company) ? nl2br($contract->owner->company)."<br />" : ""?>
|
||||
<?=$contract->owner->firstname?> <?=$contract->owner->lastname?><br />
|
||||
<?=$contract->owner->street?><br />
|
||||
<?=$contract->owner->zip?> <?=$contract->owner->city?>
|
||||
<?=($contract->owner->country) ? "<br />".$contract->owner->country : "" ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Kontakt:</th>
|
||||
<td>
|
||||
<?=($contract->owner->phone) ? "Telefon: ".$contract->owner->phone."<br />" : ""?>
|
||||
<?=($contract->owner->mobile) ? "Mobil: ".$contract->owner->mobile."<br />" : ""?>
|
||||
<?=($contract->owner->fax) ? "Fax: ".$contract->owner->fax."<br />" : ""?>
|
||||
<?=($contract->owner->email) ? "Email: ".$contract->owner->email."<br />" : ""?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th></th>
|
||||
<td></td>
|
||||
</tr><tr>
|
||||
<th>Service PIN:</th>
|
||||
<td><?=$contract->owner->spin?></td>
|
||||
</tr><tr>
|
||||
<th>Einwilligungen:</th>
|
||||
<td>
|
||||
<p><i class="mr-1 fas <?=($contract->owner->allow_contact) ? "fa-check text-success" : "fa-xmark-large text-danger"?>"></i> Informationen per Post/Email/Telefon</p>
|
||||
<p><i class="mr-1 fas <?=($contract->owner->allow_spin) ? "fa-check text-success" : "fa-xmark-large text-danger"?>"></i>Auskunft mit Service PIN</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($contract->billingaddress_id): ?>
|
||||
<tr>
|
||||
<td colspan="2" class="bg-white"><h4>Rechungsempfänger</h4></td>
|
||||
</tr><tr>
|
||||
<th>ID:</th>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $contract->billingaddress->id])?>"><?=$contract->billingaddress->id?></a></td>
|
||||
</tr><tr>
|
||||
<th>Kundennummer:</th>
|
||||
<td><?=$contract->billingaddress->customer_number?></td>
|
||||
</tr><tr>
|
||||
<th>Adresse:</th>
|
||||
<td>
|
||||
<?=($contract->billingaddress->company) ? nl2br($contract->billingaddress->company)."<br />" : ""?>
|
||||
<?php if($contract->billingaddress->firstname || $contract->billingaddress->lastname): ?><?=$contract->billingaddress->firstname?> <?=$contract->billingaddress->lastname?><br /><?php endif; ?>
|
||||
<?=$contract->billingaddress->street?><br />
|
||||
<?=$contract->billingaddress->zip?> <?=$contract->billingaddress->city?>
|
||||
<?=($contract->billingaddress->country) ? "<br />".$contract->billingaddress->country : "" ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Kontakt:</th>
|
||||
<td>
|
||||
<?=($contract->billingaddress->phone) ? "Telefon: ".$contract->billingaddress->phone."<br />" : ""?>
|
||||
<?=($contract->billingaddress->mobile) ? "Mobil: ".$contract->billingaddress->mobile."<br />" : ""?>
|
||||
<?=($contract->billingaddress->fax) ? "Fax: ".$contract->billingaddress->fax."<br />" : ""?>
|
||||
<?=($contract->billingaddress->email) ? "Email: ".$contract->billingaddress->email."<br />" : ""?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
||||
<h4>Vertrag</h4>
|
||||
<table class="table table-sm table-striped view-table">
|
||||
<tr>
|
||||
<th style="max-width: 50vw;">Matchcode:</th>
|
||||
<td style="width: 50vw;"><?=$contract->matchcode?></td>
|
||||
</tr><tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Vertragsinhaber:</th>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $contract->owner->id])?>"><?=$contract->owner->getCompanyOrName()?> (<?=$contract->owner->customer_number?>)</a></td>
|
||||
</tr>
|
||||
<?php if($contract->billingaddress_id): ?>
|
||||
<tr>
|
||||
<th>Rechnungsempfänger:</th>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $contract->owner->id])?>"><?=$contract->billingaddress->getCompanyOrName()?> (<?=$contract->billingaddress->customer_number?>)</a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<th>Produkt:</th>
|
||||
<td><?=$contract->product_name?></td>
|
||||
</tr><tr>
|
||||
<th>Produkt Info:</th>
|
||||
<td><?=$contract->product_info?></td>
|
||||
</tr><tr>
|
||||
</tr>
|
||||
<!-- upgrades -->
|
||||
<?php if(is_array($contract->upgradeFrom) && count($contract->upgradeFrom)): ?>
|
||||
<tr>
|
||||
<th>Upgrade von:</th>
|
||||
<td>
|
||||
<?php foreach($contract->upgradeFrom as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if(is_array($contract->upgradeTo) && count($contract->upgradeTo)): ?>
|
||||
<tr>
|
||||
<th>Upgrade auf:</th>
|
||||
<td>
|
||||
<?php foreach($contract->upgradeTo as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- downgrades -->
|
||||
<?php if(is_array($contract->downgradeFrom) && count($contract->downgradeFrom)): ?>
|
||||
<tr>
|
||||
<th>Downgrade von:</th>
|
||||
<td>
|
||||
<?php foreach($contract->downgradeFrom as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if(is_array($contract->downgradeTo) && count($contract->downgradeTo)): ?>
|
||||
<tr>
|
||||
<th>Downgrade auf:</th>
|
||||
<td>
|
||||
<?php foreach($contract->downgradeTo as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- productchange -->
|
||||
<?php if(is_array($contract->productchangeFrom) && count($contract->productchangeFrom)): ?>
|
||||
<tr>
|
||||
<th>Produktwechsel von:</th>
|
||||
<td>
|
||||
<?php foreach($contract->productchangeFrom as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if(is_array($contract->productchangeTo) && count($contract->productchangeTo)): ?>
|
||||
<tr>
|
||||
<th>Produktwechsel auf:</th>
|
||||
<td>
|
||||
<?php foreach($contract->productchangeTo as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- relocation -->
|
||||
<?php if(is_array($contract->relocationFrom) && count($contract->relocationFrom)): ?>
|
||||
<tr>
|
||||
<th>Umzug von:</th>
|
||||
<td>
|
||||
<?php foreach($contract->relocationFrom as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->origin_contract_id])?>" class="contract-link <?=($link->origin->cancel_date && $link->origin->cancel_date <= date('U')) ? "canceled" : ""?>"><?=$link->origin->product_name?> [<?=$link->origin->matchcode?>] (<?=$link->origin_contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if(is_array($contract->relocationTo) && count($contract->relocationTo)): ?>
|
||||
<tr>
|
||||
<th>Umzug auf:</th>
|
||||
<td>
|
||||
<?php foreach($contract->relocationTo as $link): ?>
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $link->contract_id])?>"><?=$link->contract->product_name?> [<?=$link->contract->matchcode?>] (<?=$link->contract_id?>)</a><br />
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr>
|
||||
<th>SLA:</th>
|
||||
<td><?=$contract->sla->name?></td>
|
||||
</tr><tr>
|
||||
@@ -157,14 +189,60 @@
|
||||
<th>Erstellt:</th>
|
||||
<td class="text-monospace"><?=date('d.m.Y H:i:s',$contract->create)?> (<?=$contract->creator->name?>)</td>
|
||||
</tr><tr>
|
||||
<th>Zuletzte bearbeitet:</th>
|
||||
<th>Zuletzt bearbeitet:</th>
|
||||
<td class="text-monospace"><?=date('d.m.Y H:i:s',$contract->edit)?> (<?=$contract->editor->name?>)</td>
|
||||
</tr><tr class="bg-white">
|
||||
<td colspan="2" class="text-center">
|
||||
<a href="<?=self::getUrl("Contractconfig", "edit", ["contract_id" => $contract->id])?>"><button type="button" class="btn btn-sm btn-outline-info">Konfiguration bearbeiten</button></a>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary">Inhaberwechsel</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-success">Produkt-/Standortwechsel</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-danger">Kündigen</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if((is_array($contract->linkFrom) && count($contract->linkFrom)) || (is_array($contract->linkTo) && count($contract->linkTo))): ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>Verknüpfte Verträge</h4>
|
||||
|
||||
<table class="table table-striped table-sm table-bordered">
|
||||
<tr>
|
||||
<th>Kunde</th>
|
||||
<th>Contract ID</th>
|
||||
<th>Produkt</th>
|
||||
<th>Matchcode</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($contract->links as $link): ?>
|
||||
<?php
|
||||
|
||||
if($link->contract_id == $contract->id) {
|
||||
$linkcontract = $link->origin;
|
||||
} else {
|
||||
$linkcontract = $link->contract;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="<?=self::getUrl("Address", "View", ["id" => $linkcontract->owner_id])?>"><?=$linkcontract->owner->getCompanyOrName()?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->id?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->product->name?></a></td>
|
||||
<td><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->matchcode?></a></td>
|
||||
<td>
|
||||
<a href="<?=self::getUrl("Contract", "deleteLink", ["link_id" => $link->id])?>" onclick="if(!confirm('Verknüpfung wirklich entfernen?')) return false;" class="text-danger" title="Verknüpfung entfernen"><i class="fas fa-xmark-large"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!--
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>Konfiguration</h4>
|
||||
@@ -190,7 +268,7 @@
|
||||
<a href="#" class="btn btn-sm btn-outline-primary">Konfiguration bearbeiten</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
3
Layout/default/Contractconfig/Form.php
Normal file
3
Layout/default/Contractconfig/Form.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
var_dump($groups);
|
||||
247
Layout/default/Contractconfiggroup/Index.php
Normal file
247
Layout/default/Contractconfiggroup/Index.php
Normal file
@@ -0,0 +1,247 @@
|
||||
<?php
|
||||
$siteTitle = "Benutzer";
|
||||
?>
|
||||
<?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")?>">the-tool</a></li>
|
||||
<li class="breadcrumb-item"><a href="<?=self::getUrl("Contractconfig")?>">Contractconfig</a></li>
|
||||
<li class="breadcrumb-item">Contractconfig</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Contractconfig</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row">
|
||||
<div class="col-lg">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="form-group">
|
||||
<form method="post" action="<?=self::getUrl("Contractconfiggroup", "save")?>">
|
||||
<label class="form-label" for="">Neue Config Gruppe anlegen</label>
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control" name="name" placeholder="Gruppenname..." />
|
||||
<div class="input-group-append">
|
||||
<button type="submit" class="btn btn-primary"><i class="fas fa-plus"></i> Gruppe hinzufügen</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(is_array($configgroups) && count($configgroups)): ?>
|
||||
<?php foreach($configgroups as $group): ?>
|
||||
<h4>Gruppe <?=$group->name?> <small><a href="#" onclick="$('#item-form-<?=$group->id?>').toggle()"><i class="fas fa-plus"></i> Neues Element erstellen</a></small></h4>
|
||||
|
||||
<div class="card hidden" id="item-form-<?=$group->id?>">
|
||||
<div class="card-body">
|
||||
<form method="post" action="<?=self::getUrl("ContractconfigItem", "save")?>">
|
||||
<input type="hidden" name="group_id" value="<?=$group->id?>" />
|
||||
<div class="p-2 <?=($i % 2 == 0) ? "bg-light" : ""?>">
|
||||
<div class="row col">
|
||||
<h5>Neues Config Element</h5>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="item_new_name">Name <small class="text-monospace">[a-z0-9._-]</small></label>
|
||||
<input type="text" class="form-control" id="item_new_name" name="name" value="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="item_new_type">Datentyp</label>
|
||||
<select class="form-control" id="item_new_type" name="type" onchange='toggleTypedata("new")'>
|
||||
<option value="string">String</option>
|
||||
<option value="int">Ganzzahl</option>
|
||||
<option value="decimal">Dezimalzahl</option>
|
||||
<option value="enum">Auswahl</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group" id="typedata_new">
|
||||
<div class="enum hidden">
|
||||
<label for="item_new_data">Auswahldaten (1 Element pro Zeile)</label>
|
||||
<textarea class="form-control" style="height: 128px" id="item_new_data" name="data"></textarea>
|
||||
</div>
|
||||
<div class="pattern">
|
||||
<label for="item_new_pattern">Regex Pattern</label>
|
||||
<input type="text" class="form-control" id="item_new_pattern" name="pattern" value="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="item_new_displayname">Anzeigename</label>
|
||||
<input type="text" class="form-control" id="item_new_displayname" name="displayname" value="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="item_new_description">Beschreibung</label>
|
||||
<input type="text" class="form-control" id="item_new_description" name="description" value="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col">
|
||||
<input type="submit" class="btn btn-primary" value="Speichern" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(is_array($group->items) && count($group->items)): ?>
|
||||
<?php $i = 0; foreach($group->items as $item): ?>
|
||||
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item list-group-item-action" onclick="$('#item-edit-<?=$item->id?>').toggle()"><span class="text-monospace text-pink"><?=$item->name?></span> - <?=$item->displayname?> [<?=$item->type?>]</a>
|
||||
|
||||
|
||||
<div class="card hidden" id="item-edit-<?=$item->id?>">
|
||||
<div class="card-body">
|
||||
|
||||
<form method="post" action="<?=self::getUrl("ContractconfigItem", "save")?>">
|
||||
<input type="hidden" name="item_id" value="<?=$item->id?>" />
|
||||
<input type="hidden" name="group_id" value="<?=$group->id?>" />
|
||||
<div class="p-2 <?=($i % 2 == 0) ? "bg-light" : ""?>">
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="item_<?=$item->id?>_name">Name <small class="text-monospace">[a-z0-9._-]</small></label>
|
||||
<input type="text" class="form-control" id="item_<?=$item->id?>_name" name="name" value="<?=$item->name?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="item_<?=$item->id?>_type">Datentyp</label>
|
||||
<select class="form-control" id="item_<?=$item->id?>_type" name="type" onchange="toggleTypedata(<?=$item->id?>)">
|
||||
<option value="string" <?=($item->type == "string") ? "selected='selected'" : ""?>>String</option>
|
||||
<option value="int" <?=($item->type == "int") ? "selected='selected'" : ""?>>Ganzzahl</option>
|
||||
<option value="decimal" <?=($item->type == "decimal") ? "selected='selected'" : ""?>>Dezimalzahl</option>
|
||||
<option value="enum" <?=($item->type == "enum") ? "selected='selected'" : ""?>>Auswahl</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group" id="typedata_<?=$item->id?>">
|
||||
<div class="enum <?=($item->type != "enum") ? "hidden" : ""?>">
|
||||
<label for="item_<?=$item->id?>_data">Auswahldaten (1 Element pro Zeile)</label>
|
||||
<textarea class="form-control" style="height: 128px" id="item_<?=$item->id?>_data" name="data"><?=$item->typedata?></textarea>
|
||||
</div>
|
||||
<div class="pattern <?=($item->type != "string") ? "hidden" : ""?>">
|
||||
<label for="item_<?=$item->id?>_pattern">Regex Pattern</label>
|
||||
<input type="text" class="form-control" id="item_<?=$item->id?>_pattern" name="pattern" value="<?=$item->pattern?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="item_<?=$item->id?>_displayname">Anzeigename</label>
|
||||
<input type="text" class="form-control" id="item_<?=$item->id?>_displayname" name="displayname" value="<?=$item->displayname?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="item_<?=$item->id?>_description">Beschreibung</label>
|
||||
<input type="text" class="form-control" id="item_<?=$item->id?>_description" name="description" value="<?=$item->description?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-md-11 float-left">
|
||||
<input type="submit" class="btn btn-primary" value="Speichern" />
|
||||
</div>
|
||||
<div class="col-md-1 float-right">
|
||||
<small><a class="text-danger" href="<?=self::getUrl("Contractconfig", "deleteItem", ['id' => $item->id])?>" onclick="if(!confirm('Attribut wirklich löschen?')) return false;"><i class="fas fa-trash-alt"></i> löschen</a></small>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $i++; endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $i++; endforeach; ?>
|
||||
<?php else: ?>
|
||||
<i>Keine Configgruppen gefunden</i>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#address_id").select2({
|
||||
allowClear: true,
|
||||
placeholder: ""
|
||||
});
|
||||
|
||||
var item;
|
||||
var hash = window.location.hash.substr(1);
|
||||
var match = hash.match(/item=(\d+)/);
|
||||
if(match && match[1]) {
|
||||
item = match[1]
|
||||
$('#item-edit-' + item).show()
|
||||
var pos = $('#item-edit-' + item).offset().top;
|
||||
$(window).scrollTop(pos);
|
||||
}
|
||||
|
||||
function toggleTypedata(id) {
|
||||
var type = $('#item_' + id + '_type').val();
|
||||
if(type == "enum") {
|
||||
$('#typedata_' + id + " .enum").show();
|
||||
$('#typedata_' + id + " .pattern").hide();
|
||||
} else if(type == "string") {
|
||||
$('#typedata_' + id + " .pattern").show();
|
||||
$('#typedata_' + id + " .enum").hide();
|
||||
} else {
|
||||
$('#typedata_' + id + " .pattern").hide();
|
||||
$('#typedata_' + id + " .enum").hide();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?><?php
|
||||
@@ -41,7 +41,7 @@
|
||||
<label class="col-lg-2 col-form-label" for="contractconfiggroups">Contractconfig Groups</label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control select2-multiple" name="contractconfiggroups[]" id="contractconfiggroups" multiple="multiple" data-placeholder="Choose ...">
|
||||
<?php foreach(ContractconfigGroupModel::getAll() as $ccgroup): ?>
|
||||
<?php foreach(ContractconfiggroupModel::getAll() as $ccgroup): ?>
|
||||
<option value="<?=$ccgroup->id?>" <?=(is_array($group->contractconfiggroups) && array_key_exists($ccgroup->id, $group->contractconfiggroups)) ? "selected='selected'" : ""?>><?=$ccgroup->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
<ul class="submenu">
|
||||
<li><a href="<?=self::getUrl("Contract")?>"><i class="fas fa-file-contract"></i> Verträge</a></li>
|
||||
<li><hr /></li>
|
||||
<li><a href="<?=self::getUrl("Contractconfig")?>"><i class="fas fa-wrench"></i> Vertragsconfig</a></li>
|
||||
<li><a href="<?=self::getUrl("Contractconfiggroup")?>"><i class="fas fa-wrench"></i> Vertragsconfig</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user