Added Contractconfig Edit
This commit is contained in:
@@ -181,11 +181,13 @@
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td>
|
||||
<?=$address->customer_number?>
|
||||
<?=($address->spin) ? "<br /><span class='text-pink'>".$address->spin."</span>" : ""?>
|
||||
<a href="<?=self::getUrl("Address", "view", ["id" => $address->id, 'filter' => $filter, 's' => $pagination['start']])?>">
|
||||
<?=$address->customer_number?>
|
||||
<?=($address->spin) ? "<br /><span class='text-pink'>".$address->spin."</span>" : ""?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?=nl2br($address->company)?></td>
|
||||
<td><?=$address->getFullName()?></td>
|
||||
<td><a href="<?=self::getUrl("Address", "view", ["id" => $address->id, 'filter' => $filter, 's' => $pagination['start']])?>"><?=nl2br($address->company)?></a></td>
|
||||
<td><a href="<?=self::getUrl("Address", "view", ["id" => $address->id, 'filter' => $filter, 's' => $pagination['start']])?>"><?=$address->getFullName()?></a></td>
|
||||
<td>
|
||||
<?=$address->street?><br />
|
||||
<?=$address->zip?> <?=$address->city?>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>Person/Firma</h4>
|
||||
<h3 class="text-center mb-3"><?=$address->getCompanyOrName()?><?=($address->customer_number) ? " [".$address->customer_number."]" : ""?></h3>
|
||||
|
||||
<table class="table table-sm table-striped view-table">
|
||||
<tr>
|
||||
@@ -129,8 +129,7 @@
|
||||
<tr>
|
||||
<th>Typ</th>
|
||||
<th>Firma</th>
|
||||
<th>Vorname</th>
|
||||
<th>Nachname</th>
|
||||
<th>Name</th>
|
||||
<th>Telefon</th>
|
||||
<th>Mobil</th>
|
||||
<th>Email</th>
|
||||
@@ -142,8 +141,7 @@
|
||||
<tr>
|
||||
<td class="font-weight-bold"><?=__($type)?></td>
|
||||
<td><a href="<?=self::getUrl("Address", "view", ["id" => $link->address_id])?>"><?=$link->address->company?></a></td>
|
||||
<td><a href="<?=self::getUrl("Address", "view", ["id" => $link->address_id])?>"><?=$link->address->firstname?></a></td>
|
||||
<td><?=$link->address->lastname?></td>
|
||||
<td><a href="<?=self::getUrl("Address", "view", ["id" => $link->address_id])?>"><?=$link->address->getFullName()?></a></td>
|
||||
<td><?=$link->address->phone?></td>
|
||||
<td><?=$link->address->mobile?></td>
|
||||
<td><?=$link->address->email?></td>
|
||||
@@ -168,7 +166,7 @@
|
||||
<?php if(array_key_exists($type, $address->linked_as)): ?>
|
||||
<?php foreach($address->linked_as[$type] as $link): ?>
|
||||
<tr>
|
||||
<td><?=__($type)?> für:</td>
|
||||
<td><strong><?=__($type)?></strong> für:</td>
|
||||
<td><a href="<?=self::getUrl("Address", "view", ['id' => $link->origin_address_id])?>"><?=$link->origin->getCompanyOrName()?><?=($link->origin->customer_number) ? " [".$link->origin->customer_number."]" : ""?></a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@@ -182,6 +180,49 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(is_array($address->contracts) && count($address->contracts)): ?>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4>Verträge</h4>
|
||||
|
||||
<table class="table table-striped table-sm table-bordered table-hover">
|
||||
<tr>
|
||||
<th>Rolle</th>
|
||||
<th>Contract ID</th>
|
||||
<th>Produkt</th>
|
||||
<th>Matchcode</th>
|
||||
<th>Bestelldatum</th>
|
||||
<th>Fertigstellung</th>
|
||||
<th>Kündigung</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($address->contracts as $contract): ?>
|
||||
<tr>
|
||||
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>">
|
||||
<a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>">
|
||||
<?php if($contract->owner_id == $address->id): ?>
|
||||
Vertragsinhaber
|
||||
<?php elseif($contract->billingaddress_id == $address->id): ?>
|
||||
Rechnungsempfänger
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>"><?=$contract->id?></a></td>
|
||||
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>"><?=$contract->product->name?></a></td>
|
||||
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $contract->id])?>"><?=$contract->matchcode?></a></td>
|
||||
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><?=($contract->order_date) ? date('d.m.Y', $contract->order_date) : ""?></td>
|
||||
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><?=($contract->finish_date) ? date('d.m.Y', $contract->finish_date) : ""?></td>
|
||||
<td class="contract <?=($contract->isCancelled()) ? "canceled" : ""?>"><?=($contract->cancel_date) ? date('d.m.Y', $contract->cancel_date) : ""?></td>
|
||||
<td>
|
||||
<a href="<?=self::getUrl("Contract", "deleteLink", ["link_id" => $contract->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">
|
||||
<a href="<?=self::getUrl("Address","Index", ['filter' => $filter, 's' => $s])?>" class="btn btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Übersicht</a>
|
||||
|
||||
@@ -182,10 +182,9 @@
|
||||
<th>Matchcode</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($contract->links as $type => $links): ?>
|
||||
<?php foreach($links as $link): ?>
|
||||
<?php foreach($contract->links as $link): ?>
|
||||
<tr>
|
||||
<td><?=$type?></td>
|
||||
<td><?=__($link->type, "contract")?></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>
|
||||
@@ -194,60 +193,10 @@
|
||||
<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>
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<select class="form-control" name="links[<?=$linknum?>][type]">
|
||||
<option value="link">Verknüpfung mit</option>
|
||||
<option value="upgrade">Upgrade von</option>
|
||||
<option value="downgrade">Downgrade von</option>
|
||||
<option value="relocation">Umzug von</option>
|
||||
<option value="productchange">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[<?=$linknum?>][contract_id]" id="links_<?=$linknum?>_contract_id" data-linknum="<?=$linknum?>" data-url="<?=self::getUrl('Contract','api')?>?do=findContract&autocomplete=1" 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(<?=$linknum?>)"><i class="fas fa-xmark-large mr-1"></i> Entfernen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -22,14 +22,17 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a href="<?=self::getUrl("Contract","Index", ['filter' => $filter, 's' => $s])?>" class="btn btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Vertragsübersicht</a>
|
||||
<a href="<?=self::getUrl("Contract","edit", ['id' => $contract->id, 'filter' => $filter, 's' => $s, 'f' => "view"])?>" class="btn btn-outline-success"><i class="fas fa-edit"></i> Vertrag bearbeiten</a>
|
||||
<a href="<?=self::getUrl("Contract","Index", ['filter' => $filter, 's' => $s])?>" class="btn btn-sm btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Vertragsübersicht</a>
|
||||
<a href="<?=self::getUrl("Contract","edit", ['id' => $contract->id, 'filter' => $filter, 's' => $s, 'f' => "view"])?>" class="btn btn-sm btn-outline-success"><i class="fas fa-edit"></i> Vertrag bearbeiten</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="text-center mb-3"><?=$contract->product_name?> (<?=$contract->id?>)</h3>
|
||||
<?php if($contract->isCancelled()): ?>
|
||||
<h2 class="text-center mb-3 text-danger">GEKÜNDIGT</h2>
|
||||
<?php endif; ?>
|
||||
<h3 class="text-center mb-3 <?=($contract->isCancelled()) ? "canceled" : ""?>"><?=$contract->product_name?> (<?=$contract->id?>)</h3>
|
||||
|
||||
<table class="table table-sm table-striped view-table">
|
||||
<tr>
|
||||
@@ -209,12 +212,15 @@
|
||||
<div class="card-body">
|
||||
<h4>Verknüpfte Verträge</h4>
|
||||
|
||||
<table class="table table-striped table-sm table-bordered">
|
||||
<table class="table table-striped table-sm table-bordered table-hover">
|
||||
<tr>
|
||||
<th>Kunde</th>
|
||||
<th>Contract ID</th>
|
||||
<th>Produkt</th>
|
||||
<th>Matchcode</th>
|
||||
<th>Bestelldatum</th>
|
||||
<th>Fertigstellung</th>
|
||||
<th>Kündigung</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($contract->links as $link): ?>
|
||||
@@ -230,9 +236,12 @@
|
||||
?>
|
||||
<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 class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->id?></a></td>
|
||||
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->product->name?></a></td>
|
||||
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?>"><a href="<?=self::getUrl("Contract", "View", ["id" => $linkcontract->id])?>"><?=$linkcontract->matchcode?></a></td>
|
||||
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?>"><?=($linkcontract->order_date) ? date('d.m.Y', $linkcontract->order_date) : ""?></td>
|
||||
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?>"><?=($linkcontract->finish_date) ? date('d.m.Y', $linkcontract->finish_date) : ""?></td>
|
||||
<td class="contract <?=($linkcontract->isCancelled()) ? "canceled" : ""?>"><?=($linkcontract->cancel_date) ? date('d.m.Y', $linkcontract->cancel_date) : ""?></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>
|
||||
@@ -272,8 +281,8 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a href="<?=self::getUrl("Contract","Index", ['filter' => $filter, 's' => $s])?>" class="btn btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Vertragsübersicht</a>
|
||||
<a href="<?=self::getUrl("Contract","edit", ['id' => $contract->id, 'filter' => $filter, 's' => $s, 'f' => "view"])?>" class="btn btn-outline-success"><i class="fas fa-edit"></i> Vertrag bearbeiten</a>
|
||||
<a href="<?=self::getUrl("Contract","Index", ['filter' => $filter, 's' => $s])?>" class="btn btn-sm btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Vertragsübersicht</a>
|
||||
<a href="<?=self::getUrl("Contract","edit", ['id' => $contract->id, 'filter' => $filter, 's' => $s, 'f' => "view"])?>" class="btn btn-sm btn-outline-success"><i class="fas fa-edit"></i> Vertrag bearbeiten</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,3 +1,106 @@
|
||||
<?php
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
|
||||
var_dump($groups);
|
||||
<!-- 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"><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">Aktives Produkt</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a href="<?=self::getUrl("Contract","View", ['id' => $contract->id, 'filter' => $filter, 's' => $s])?>" class="btn btn-sm btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Vertragsansicht</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<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;">Matchcode:</th>
|
||||
<td style="width: 50vw;"><?=$contract->matchcode?></td>
|
||||
</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>
|
||||
<tr>
|
||||
<th>Produkt:</th>
|
||||
<td><?=$contract->product_name?></td>
|
||||
</tr><tr>
|
||||
<th>Produkt Info:</th>
|
||||
<td><?=$contract->product_info?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="text-center mb-3">Konfiguration bearbeiten</h4>
|
||||
<?php if(is_array($groups) && count($groups)): ?>
|
||||
<form method="post" action="<?=self::getUrl("Contractconfig", "Save")?>">
|
||||
<input type="hidden" name="contract_id" value="<?=$contract->id?>" />
|
||||
<table class="table table-sm table-borderless view-table">
|
||||
<?php foreach($groups as $group): ?>
|
||||
<tr class="bg-light">
|
||||
<th><h4><u><?=$group->name?></u></h4></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php foreach($group->items as $item): ?>
|
||||
<tr>
|
||||
<th style="max-width: 50vw;"><?=$item->displayname?>:</th>
|
||||
<td style="width: 50vw;">
|
||||
<?php if($item->type == "enum"): ?>
|
||||
<select class="form-control" name="itemvalues[<?=$item->id?>]">
|
||||
<?php foreach($item->getTypedataArray() as $option): ?>
|
||||
<option value="<?=$option?>" <?=($item->getValue() == $option) ? "selected='selected'" : ""?>><?=$option?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php else: ?>
|
||||
<input type="text" class="form-control <?=(is_array($error_items) && in_array($item->id, $error_items)) ? "invalid" : ""?>" name="itemvalues[<?=$item->id?>]" value="<?=(isset($request)) ? $request->itemvalues[$item->id] : $item->getValue()?>" />
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<input type="submit" class="btn btn-primary" value="Konfiguration speichern" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<a href="<?=self::getUrl("Contract","View", ['id' => $contract->id, 'filter' => $filter, 's' => $s])?>" class="btn btn-sm btn-secondary mr-1"><i class="fas fa-list"></i> Zurück zur Vertragsansicht</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
Reference in New Issue
Block a user