Merge branch 'revert-preorder' into 'master'
Reverted Filter See merge request fronk/thetool!864
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
$pagination_baseurl = $this->getUrl($Mod,"Index");
|
$pagination_baseurl = $this->getUrl($Mod,"Index");
|
||||||
$pagination_baseurl_params = ["filter" => $filter];
|
$pagination_baseurl_params = ["filter" => $filter];
|
||||||
$pagination_entity_name = "Vorbestellungen";
|
$pagination_entity_name = "Vorbestellungen";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.preorder-campaign-import {
|
.preorder-campaign-import {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
@@ -60,9 +60,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
if (window.matchMedia('(min-width: 576px)').matches) {
|
if (window.matchMedia('(min-width: 576px)').matches) {
|
||||||
return;
|
return;
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- start page title -->
|
<!-- start page title -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -137,48 +137,13 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="col-sm-12 col-md-2">
|
<div class="col-sm-12 col-md-2">
|
||||||
<label class="form-label" for="filter_preordercampaign_id" style="display: flex">Kampagne
|
<label class="form-label" for="filter_preordercampaign_id">Kampagne</label>
|
||||||
<?php if(isset($netowner_campaign_ids) && is_array($netowner_campaign_ids) && count($netowner_campaign_ids)): ?>
|
<select name="filter[preordercampaign_id]" id="filter_preordercampaign_id" class="form-control">
|
||||||
<div class="dropdown ml-1" style="cursor: pointer">
|
<option value="">Alle</option>
|
||||||
<span id="netowner-campaigns-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle">(Netzbesitzer <i class="fas fa-caret-down"></i>)</span>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="netowner-campaigns-dropdown">
|
|
||||||
<?php foreach($netowner_campaign_ids as $netowner => $campaigns): ?>
|
|
||||||
<a class="dropdown-item" href="#" onclick="selectNetOwnerCampaign(<?= htmlspecialchars(json_encode($campaigns), ENT_QUOTES, 'UTF-8') ?>, '<?= htmlspecialchars($netowner)?>'); return false;"><?= htmlspecialchars($netowner) ?></a>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.select2-selection.select2-selection--multiple {
|
|
||||||
max-height: 150px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function selectNetOwnerCampaign(campaigns, netowner) {
|
|
||||||
$('#filter_preordercampaign_id').val(campaigns);
|
|
||||||
$('#filter_preordercampaign_id').trigger('change');
|
|
||||||
console.log(campaigns);
|
|
||||||
window.notify('success', 'Kampagnen von ' + netowner + ' ausgewählt');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
|
|
||||||
</label>
|
|
||||||
<select name="filter[preordercampaign_id][]" id="filter_preordercampaign_id" class="form-control" multiple="multiple">
|
|
||||||
<?php
|
|
||||||
// if partner_id is string unset it from filter
|
|
||||||
if(isset($filter) && array_key_exists("preordercampaign_id", $filter) && is_string($filter["preordercampaign_id"])) {
|
|
||||||
$filter["preordercampaign_id"] = explode(",", $filter["preordercampaign_id"]);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<?php foreach($my_campaigns as $c): ?>
|
<?php foreach($my_campaigns as $c): ?>
|
||||||
<option value="<?=$c->id?>" <?=(isset($filter) && array_key_exists("preordercampaign_id", $filter) && in_array($c->id, $filter["preordercampaign_id"])) ? "selected='selected'" : ""?>><?=$c->name?></option>
|
<option value="<?=$c->id?>" <?=(isset($campaign) && $c->id == $campaign->id) ? "selected='selected'" : ""?>><?=$c->name?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -227,14 +192,14 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- INFO THIS FILTER IS CURRENTLY HIDDEN -->
|
<!-- INFO THIS FILTER IS CURRENTLY HIDDEN -->
|
||||||
<!-- <div class="col-sm-12 col-md-2">-->
|
<!-- <div class="col-sm-12 col-md-2">-->
|
||||||
<!-- <label class="form-label" for="filter_addon_services">Zusatzdienste</label>-->
|
<!-- <label class="form-label" for="filter_addon_services">Zusatzdienste</label>-->
|
||||||
<!-- <select name="filter[addon_services]" id="filter_addon_services" class="form-control">-->
|
<!-- <select name="filter[addon_services]" id="filter_addon_services" class="form-control">-->
|
||||||
<!-- <option></option>-->
|
<!-- <option></option>-->
|
||||||
<!-- <option value="1" --><?php //=(isset($filter['addon_services']) && $filter['addon_services'] == 1) ? "selected='selected'" : ""?><!-- >Nur mit Zusatzdiensten</option>-->
|
<!-- <option value="1" --><?php //=(isset($filter['addon_services']) && $filter['addon_services'] == 1) ? "selected='selected'" : ""?><!-- >Nur mit Zusatzdiensten</option>-->
|
||||||
<!-- </select>-->
|
<!-- </select>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-sm-12 col-md-1">
|
<div class="col-sm-12 col-md-1">
|
||||||
@@ -391,8 +356,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
||||||
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
||||||
|
|
||||||
<div class="preorder-campaign-table-wrapper">
|
<div class="preorder-campaign-table-wrapper">
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
@@ -491,8 +456,8 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination-summary.php"); ?>
|
||||||
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
<?php include(realpath(dirname(__FILE__)."/../")."/tpl/pagination.php"); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -506,7 +471,6 @@
|
|||||||
$("#filter_type").select2({closeOnSelect: false});
|
$("#filter_type").select2({closeOnSelect: false});
|
||||||
$("#filter_status").select2({closeOnSelect: false});
|
$("#filter_status").select2({closeOnSelect: false});
|
||||||
$("#filter_partner_id").select2({closeOnSelect: false});
|
$("#filter_partner_id").select2({closeOnSelect: false});
|
||||||
$("#filter_preordercampaign_id").select2({closeOnSelect: false});
|
|
||||||
$("#connection_type_id").select2({closeOnSelect: false});
|
$("#connection_type_id").select2({closeOnSelect: false});
|
||||||
|
|
||||||
var attributes = ["bep_specified", "inhouse_cabling_supplied"];
|
var attributes = ["bep_specified", "inhouse_cabling_supplied"];
|
||||||
|
|||||||
@@ -75,31 +75,13 @@ class PreorderController extends mfBaseController {
|
|||||||
|
|
||||||
$this->layout()->set("campaign", new Preordercampaign());
|
$this->layout()->set("campaign", new Preordercampaign());
|
||||||
|
|
||||||
$all_preorder_campaigns = PreordercampaignModel::getAll();
|
|
||||||
if ($this->me->is("Admin")) {
|
|
||||||
$netowner_campaign_ids = [];
|
|
||||||
|
|
||||||
foreach ($all_preorder_campaigns as $campaign) {
|
|
||||||
$network = new Network($campaign->network_id);
|
|
||||||
$netowner = new Address($network->owner_id);
|
|
||||||
|
|
||||||
if (!array_key_exists($netowner->getCompanyOrName(), $netowner_campaign_ids)) {
|
|
||||||
$netowner_campaign_ids[$netowner->getCompanyOrName()] = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
$netowner_campaign_ids[$netowner->getCompanyOrName()][] = $campaign->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->layout()->set("netowner_campaign_ids", $netowner_campaign_ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($this->me->is("Admin")) {
|
if($this->me->is("Admin")) {
|
||||||
if($filter['preordercampaign_id']) {
|
if($filter['preordercampaign_id']) {
|
||||||
$this->layout()->set("campaign", new Preordercampaign($filter['preordercampaign_id']));
|
$this->layout()->set("campaign", new Preordercampaign($filter['preordercampaign_id']));
|
||||||
} else {
|
} else {
|
||||||
$my_campaigns = $all_preorder_campaigns;
|
$my_campaigns = PreordercampaignModel::getAll();
|
||||||
}
|
}
|
||||||
$this->layout()->set("my_campaigns", $all_preorder_campaigns);
|
$this->layout()->set("my_campaigns", PreordercampaignModel::getAll());
|
||||||
} else {
|
} else {
|
||||||
if($this->me->is("preorderfront")) {
|
if($this->me->is("preorderfront")) {
|
||||||
$pns = json_decode($this->me->getFlag("preorder_networks"));
|
$pns = json_decode($this->me->getFlag("preorder_networks"));
|
||||||
|
|||||||
Reference in New Issue
Block a user