Started cpe shipping
This commit is contained in:
@@ -160,7 +160,7 @@
|
||||
<input type="hidden" name="order_id" value="<?=$product->order_id?>" />
|
||||
<input type="hidden" name="orderproduct_id" value="<?=$product->id?>" />
|
||||
<input type="hidden" name="termination_id" value="<?=$product->termination_id?>" />
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
|
||||
|
||||
127
Layout/default/Cpeshipping/Index.php
Normal file
127
Layout/default/Cpeshipping/Index.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/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 active">CPE Versand</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">CPE Versand</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">CPE Versand</h4>
|
||||
</div>
|
||||
|
||||
<?php if($pagination['maxItems'] > $pagination['count']): ?>
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center mb-1">
|
||||
<li class="page-item <?=($pagination['start'] - $pagination['count'] < 0) ? "disabled" : ""?>">
|
||||
<a class="page-link" href="<?=$this->getUrl($Mod, "Index", ["filter" => $filter])?>" tabindex="-1">Erste</a>
|
||||
</li>
|
||||
<li class="page-item <?=($pagination['start'] - $pagination['count'] < 0) ? "disabled" : ""?>">
|
||||
<a class="page-link" href="<?=$this->getUrl($Mod,"Index",['s' => $pagination['start'] - $pagination['count'], "filter" => $filter])?>" tabindex="-1">Zurück</a>
|
||||
</li>
|
||||
<?php for($i = 0; $i < ($pagination['maxItems'] / $pagination['count']); $i++): ?>
|
||||
<li class="page-item <?=($pagination['start'] == $i*$pagination['count']) ? "disabled font-weight-bold" : ""?>"><a class="page-link" href="<?=$this->getUrl($Mod,"Index",['s' => $i*$pagination['count'], "filter" => $filter])?>"><?=$i+1?></a></li>
|
||||
<?php endfor; ?>
|
||||
<li class="page-item <?=($pagination['maxItems'] / ($pagination['start'] + $pagination['count']) < 1) ? "disabled" : ""?>">
|
||||
<a class="page-link" href="<?=$this->getUrl($Mod,"Index",['s' => $pagination['start'] + $pagination['count'], "filter" => $filter])?>">Vor</a>
|
||||
</li>
|
||||
<li class="page-item <?=($pagination['maxItems'] / ($pagination['start'] + $pagination['count']) < 1) ? "disabled" : ""?>">
|
||||
<a class="page-link" href="<?=$this->getUrl($Mod,"Index",['s' => ($pagination['maxItems'] - $pagination['maxItems'] % $pagination['count']), "filter" => $filter])?>">Letzte</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<div class="pagination justify-content-center">
|
||||
<?php if($pagination['maxItems']): ?>
|
||||
Zu versendende CPEs <?=$pagination['start']+1?> bis <?=($pagination['start'] + $pagination['count'] > $pagination['maxItems']) ? $pagination['maxItems'] : $pagination['start'] + $pagination['count']?> von <?=$pagination['maxItems']?>
|
||||
<?php else: ?>
|
||||
Keine CPEs zum Versenden gefunden
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?=self::getUrl("Cpeshipping", "ship")?>">
|
||||
<table class="table table-striped table-hover">
|
||||
<tr>
|
||||
<th class="text-center"><input type="checkbox" id="checkAll" class="form-control" /></th>
|
||||
<th>Kundennummer</th>
|
||||
<th>Kunde</th>
|
||||
<th>Lieferort</th>
|
||||
<th>Gerät</th>
|
||||
</tr>
|
||||
<?php foreach($cpeprovisionings as $c): ?>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="form-control" name="ships[]" value="<?=$c->id?>" /></td>
|
||||
<td><?=$c->order->owner->customer_number?></td>
|
||||
<td><?=$c->order->owner->getCompanyOrName()?></td>
|
||||
<td><?=($c->termination_id) ? $c->termination->building->zip." ".$c->termination->building->city : $c->order->owner->zip." ".$c->order->owner->city?></td>
|
||||
<td><?=$c->routertype?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<input type="submit" class="btn btn-primary" value="Versand-CSV generieren" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php if($pagination['maxItems'] > $pagination['count']): ?>
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center mb-1">
|
||||
<li class="page-item <?=($pagination['start'] - $pagination['count'] < 0) ? "disabled" : ""?>">
|
||||
<a class="page-link" href="<?=$this->getUrl($Mod, "Index", ["filter" => $filter])?>" tabindex="-1">Erste</a>
|
||||
</li>
|
||||
<li class="page-item <?=($pagination['start'] - $pagination['count'] < 0) ? "disabled" : ""?>">
|
||||
<a class="page-link" href="<?=$this->getUrl($Mod,"Index",['s' => $pagination['start'] - $pagination['count'], "filter" => $filter])?>" tabindex="-1">Zurück</a>
|
||||
</li>
|
||||
<?php for($i = 0; $i < ($pagination['maxItems'] / $pagination['count']); $i++): ?>
|
||||
<li class="page-item <?=($pagination['start'] == $i*$pagination['count']) ? "disabled font-weight-bold" : ""?>"><a class="page-link" href="<?=$this->getUrl($Mod,"Index",['s' => $i*$pagination['count'], "filter" => $filter])?>"><?=$i+1?></a></li>
|
||||
<?php endfor; ?>
|
||||
<li class="page-item <?=($pagination['maxItems'] / ($pagination['start'] + $pagination['count']) < 1) ? "disabled" : ""?>">
|
||||
<a class="page-link" href="<?=$this->getUrl($Mod,"Index",['s' => $pagination['start'] + $pagination['count'], "filter" => $filter])?>">Vor</a>
|
||||
</li>
|
||||
<li class="page-item <?=($pagination['maxItems'] / ($pagination['start'] + $pagination['count']) < 1) ? "disabled" : ""?>">
|
||||
<a class="page-link" href="<?=$this->getUrl($Mod,"Index",['s' => ($pagination['maxItems'] - $pagination['maxItems'] % $pagination['count']), "filter" => $filter])?>">Letzte</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<div class="pagination justify-content-center">
|
||||
<?php if($pagination['maxItems']): ?>
|
||||
Zu versendende CPEs <?=$pagination['start']+1?> bis <?=($pagination['start'] + $pagination['count'] > $pagination['maxItems']) ? $pagination['maxItems'] : $pagination['start'] + $pagination['count']?> von <?=$pagination['maxItems']?>
|
||||
<?php else: ?>
|
||||
Keine CPEs zum Versenden gefunden
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#checkAll").click(function() {
|
||||
$('input:checkbox').not(this).prop('checked', this.checked);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php include(realpath(dirname(__FILE__)."/../")."/footer.php"); ?>
|
||||
@@ -337,8 +337,8 @@
|
||||
<td onclick="toggleOrder(<?=$order->id?>)" colspan="7" class="pt-0" style="border-top: none;">
|
||||
<div class="row">
|
||||
<div class="mr-4 order-date-pill <?=($order->terminations[0]->workflowitems["bautermin"]->value->value_string) ? "active" : ""?>">Tiefbau: <span class="text-monospace"><?=($order->terminations[0]->workflowitems["bautermin"]->value->value_string) ? "<span class='text-success'>".$order->terminations[0]->workflowitems["bautermin"]->value->value_string."</span>" : "--.--.----"?></span></div>
|
||||
<div class="mr-4 order-date-pill <?=($order->terminations[0]->workflowitems["backbone_setup_date"]->value->value_string) ? "active" : ""?>">Backbone Bautermin: <span class="text-monospace"><?=($order->terminations[0]->workflowitems["backbone_setup_date"]->value->value_string) ? "<span class='text-success'>".$order->terminations[0]->workflowitems["backbone_setup_date"]->value->value_string."</span>" : "--.--.----"?></span></div>
|
||||
<div class="mr-4 order-date-pill <?=($order->terminations[0]->workflowitems["customer_setup_date"]->value->value_string) ? "active" : ""?>">Kunde Bautermin: <span class="text-monospace"><?=($order->terminations[0]->workflowitems["customer_setup_date"]->value->value_string) ? "<span class='text-success'>".$order->terminations[0]->workflowitems["customer_setup_date"]->value->value_string."</span>" : "--.--.----"?></span></div>
|
||||
<div class="mr-4 order-date-pill <?=($order->terminations[0]->workflowitems["backbone_setup_date"]->value->value_string) ? "active" : ""?>">Leitungsbau Backbone: <span class="text-monospace"><?=($order->terminations[0]->workflowitems["backbone_setup_date"]->value->value_string) ? "<span class='text-success'>".$order->terminations[0]->workflowitems["backbone_setup_date"]->value->value_string."</span>" : "--.--.----"?></span></div>
|
||||
<div class="mr-4 order-date-pill <?=($order->terminations[0]->workflowitems["customer_setup_date"]->value->value_string) ? "active" : ""?>">Leitungsbau Kunde: <span class="text-monospace"><?=($order->terminations[0]->workflowitems["customer_setup_date"]->value->value_string) ? "<span class='text-success'>".$order->terminations[0]->workflowitems["customer_setup_date"]->value->value_string."</span>" : "--.--.----"?></span></div>
|
||||
<div class="mr-4 order-date-pill">Versandtermin: <span class="text-monospace">--.--.----</span></div>
|
||||
<div id="date-pill-<?=$order->id?>-install_date" class="order-date-pill <?=($order->install_date) ? "active" : ""?>" id="order-install-date-<?=$order->id?>">Vorortinstallation: <span class="text-monospace"><?=($order->install_date) ? "<span class='text-success'>".date("d.m.Y",$order->install_date)."</span>" : "--.--.----"?></span></div>
|
||||
</div>
|
||||
@@ -355,8 +355,8 @@
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2">Tiefbau: <input type="text" class="form-control" name="bautermin" placeholder="--.--.----" value="<?=$order->terminations[0]->workflowitems["bautermin"]->value->value_string?>" readonly="readonly" /></div>
|
||||
<div class="col-md-2">Backbone Bautermin: <input type="text" class="form-control" name="leitungsbautermin" placeholder="--.--.----" value="<?=$order->terminations[0]->workflowitems["backbone_setup_date"]->value->value_string?>" readonly="readonly" /></div>
|
||||
<div class="col-md-2">Kunde Bautermin: <input type="text" class="form-control" name="leitungsbautermin" placeholder="--.--.----" value="<?=$order->terminations[0]->workflowitems["customer_setup_date"]->value->value_string?>" readonly="readonly" /></div>
|
||||
<div class="col-md-2">Leitungsbau Backbone: <input type="text" class="form-control" name="leitungsbautermin_backbone" placeholder="--.--.----" value="<?=$order->terminations[0]->workflowitems["backbone_setup_date"]->value->value_string?>" readonly="readonly" /></div>
|
||||
<div class="col-md-2">Leitungsbau Kunde: <input type="text" class="form-control" name="leitungsbautermin_kunde" placeholder="--.--.----" value="<?=$order->terminations[0]->workflowitems["customer_setup_date"]->value->value_string?>" readonly="readonly" /></div>
|
||||
<div class="col-md-2">Versandtermin: <input type="text" class="form-control" name="versandtermin" placeholder="--.--.----" value="" readonly="readonly" /></div>
|
||||
<div class="col-md-2">
|
||||
Vorortinstallation:
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
<?php
|
||||
$wfLabelClass = "";
|
||||
$m = [];
|
||||
if(preg_match('/<!--class:\s*([^>]+)-->/',$item->label, $m)) {
|
||||
if($m[1]) {
|
||||
$wfLabelClass = $m[1];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<td class="workflow-item wfitem-<?=$item->type?> wfitem-width-<?=$item->width?>" <?=($item->width > 1) ? "colspan='".$item->width."'" : ""?> style="width: <?=$this->commaToDot(round(100 / $wfColspan, 2) * $item->width)?>%">
|
||||
<?php if($item->type != "gps"): ?>
|
||||
<label class="form-label" for="wfitem_<?=$item->name?>_<?=$$wftype->id?>">
|
||||
<label class="form-label <?=$wfLabelClass?>" for="wfitem_<?=$item->name?>_<?=$$wftype->id?>">
|
||||
<?=($item->label) ? $item->label : " "?>
|
||||
<?=($item->label && $item->required == 1) ? "*" : ""?>
|
||||
</label>
|
||||
|
||||
@@ -3,4 +3,50 @@
|
||||
class Cpeprovisioning extends mfBaseModel {
|
||||
protected $forcestr = ["wifi_ssid", "wifi_pass"];
|
||||
|
||||
private $order;
|
||||
private $orderproduct;
|
||||
private $termination;
|
||||
private $creator;
|
||||
private $editor;
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
if($name == "cpeprovisioning") {
|
||||
$this->cpeprovisioning = CpeprovisioningModel::getFirst(["orderproduct_id" => $this->id]);
|
||||
return $this->cpeprovisioning;
|
||||
}
|
||||
|
||||
if($name == "creator") {
|
||||
if($this->id) {
|
||||
$this->creator = new User($this->create_by);
|
||||
return $this->creator;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if($name == "editor") {
|
||||
if($this->id) {
|
||||
$this->editor = new User($this->edit_by);
|
||||
return $this->editor;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
if($this->$name->id) {
|
||||
return $this->$name;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ class CpeprovisioningController extends mfBaseController {
|
||||
$this->me = $me;
|
||||
$this->layout()->set("me",$me);
|
||||
|
||||
if(!$me->is(["Admin", "salespartner"])) {
|
||||
if(!$me->is(["Admin"])) {
|
||||
$this->redirect("Dashboard");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,24 @@ class CpeprovisioningModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("shipping", $filter)) {
|
||||
$shipping = $filter['shipping'];
|
||||
if($shipping) {
|
||||
$where .= " AND shipping=1";
|
||||
} else {
|
||||
$where .= " AND shipping=0";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("shipped", $filter)) {
|
||||
$shipped = $filter['shipped'];
|
||||
if($shipped) {
|
||||
$where .= " AND shipped=1";
|
||||
} else {
|
||||
$where .= " AND shipped=0";
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($filter, $where);exit;
|
||||
return $where;
|
||||
}
|
||||
|
||||
34
application/Cpeshipping/CpeshippingController.php
Normal file
34
application/Cpeshipping/CpeshippingController.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
class CpeshippingController extends mfBaseController {
|
||||
|
||||
protected function init() {
|
||||
$this->needlogin=true;
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
$this->me = $me;
|
||||
$this->layout()->set("me",$me);
|
||||
|
||||
if(!$me->is(["Admin"])) {
|
||||
$this->redirect("Dashboard");
|
||||
}
|
||||
}
|
||||
|
||||
protected function indexAction() {
|
||||
$this->layout()->setTemplate("Cpeshipping/Index");
|
||||
$provisions = CpeprovisioningModel::search(["shipping" => 1, "shipped" => 0]);
|
||||
|
||||
$this->layout()->set("cpeprovisionings", $provisions);
|
||||
|
||||
}
|
||||
|
||||
protected function shipAction() {
|
||||
$this->redirect("Cpeshipping");
|
||||
$r = $this->request;
|
||||
|
||||
/*if($r->ships) {
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user