969 lines
61 KiB
PHP
969 lines
61 KiB
PHP
<?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"><a href="<?= self::getUrl("Preordercampaign") ?>">Vorbestellkampagnen</a>
|
|
</li>
|
|
<li class="breadcrumb-item active"><?= ($Action == "add") ? "neu" : "bearbeiten" ?></li>
|
|
</ol>
|
|
</div>
|
|
<h4 class="page-title">Vorbestellkampagne</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h4 class="header-title mb-2"><?= ($Action == "add") ? "Neue " : "" ?>
|
|
Vorbestellkampagne <?= ($Action == "edit") ? "bearbeiten " : "" ?></h4>
|
|
|
|
<form class="form-horizontal" method="post"
|
|
action="<?= self::getUrl("Preordercampaign", "save") ?>">
|
|
<input type="hidden" name="id" value="<?= $campaign->id ?>"/>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="network_id">Netzgebiet *</label>
|
|
<div class="col-lg-10">
|
|
<select class="select2 form-control " name="network_id" id="network_id">
|
|
<option></option>
|
|
<?php foreach ($networks as $network): ?>
|
|
<option value="<?= $network->id ?>" <?= ($campaign->network_id == $network->id) ? "selected='selected'" : "" ?>><?= ($network->name) ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="name">Name *</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="name" id="name"
|
|
value="<?= $campaign->name ?>"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="description">Info</label>
|
|
<div class="col-lg-10">
|
|
<textarea class="form-control" style="height:120px;"
|
|
name="description"><?= $campaign->description ?></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="area">Gebiet *</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="area" id="area"
|
|
value="<?= $campaign->area ?>"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="homes_total">Homes gesamt *</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="homes_total" id="homes_total"
|
|
value="<?= $campaign->homes_total ?>"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="from">Von</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control datepicker" name="from" id="from"
|
|
value="<?= ($campaign->from) ? date('d.m.Y', $campaign->from) : "" ?>"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="to">Bis</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control datepicker" name="to" id="to"
|
|
value="<?= ($campaign->to) ? date('d.m.Y', $campaign->to) : "" ?>"/>
|
|
</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="no_setup" <?= ($campaign->product_type == "no_setup") ? "selected='selected'" : "" ?>>
|
|
Alle Produkte im Netzgebiet, ohne Herstellungsprodukt
|
|
</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 Vorbestellungstypen
|
|
*</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'" : "" ?>><?= __("order", "preorder") ?></option>
|
|
<option value="reorder" <?= (is_array($campaign->types) && array_key_exists("reorder", $campaign->types)) ? "selected='selected'" : "" ?>><?= __("reorder", "preorder") ?></option>
|
|
<option value="legacytransfer" <?= (is_array($campaign->types) && array_key_exists("legacytransfer", $campaign->types)) ? "selected='selected'" : "" ?>><?= __("legacytransfer", "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="rimo" <?= ($campaign->fulfillment == "rimo") ? "selected='selected'" : "" ?>>
|
|
RIMO
|
|
</option>
|
|
<option value="thirdparty" <?= ($campaign->fulfillment == "thirdparty") ? "selected='selected'" : "" ?>>
|
|
Drittsystem
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="oaid_origin">OAID Herkunft *</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="oaid_origin" id="oaid_origin"
|
|
data-placeholder="Bitte auswählen ...">
|
|
<option value="thetool" <?= ($campaign->oaid_origin == "thetool") ? "selected='selected'" : "" ?>>
|
|
thetool
|
|
</option>
|
|
<option value="ofaa" <?= ($campaign->oaid_origin == "ofaa") ? "selected='selected'" : "" ?>>
|
|
OFAA
|
|
</option>
|
|
<option value="other" <?= ($campaign->oaid_origin == "other") ? "selected='selected'" : "" ?>>
|
|
Andere (importieren, aber nicht verarbeiten)
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="adb_netzgebiet_ids">Beschränkt auf
|
|
Salescluster (GWR)</label>
|
|
<div class="col-lg-10">
|
|
<select class="select2 form-control select2-multiple"
|
|
name="adb_netzgebiet_ids[]" id="adb_netzgebiet_ids" multiple="multiple"
|
|
data-placeholder="Salescluster ...">
|
|
<?php foreach (ADBNetzgebietModel::getAll() as $salescluster): ?>
|
|
<option value="<?= $salescluster->id ?>" <?= (is_array($campaign->salesclusters) && array_key_exists($salescluster->id, $campaign->salesclusters)) ? "selected='selected'" : "" ?>><?= $salescluster->name ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="banned_rimo_fcp">Für Bestellung
|
|
gesperrte FCPs</label>
|
|
<div class="col-lg-10">
|
|
<select class="select2 form-control select2-multiple bg-danger"
|
|
name="banned_rimo_fcp[]" id="banned_rimo_fcp" multiple="multiple"
|
|
data-placeholder="FCPs ...">
|
|
<?php foreach ($campaign->all_fcp_names as $fcp_name): ?>
|
|
<option value="<?= $fcp_name ?>" <?= (is_array($campaign->banned_fcps) && in_array($fcp_name, $campaign->banned_fcps)) ? "selected='selected'" : "" ?>><?= $fcp_name ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="adb_netzgebiet_ids">Erforderliche
|
|
Zusatzfelder:</label>
|
|
<div class="col-lg-10">
|
|
<select class="select2 form-control select2-multiple" name="required_fields[]"
|
|
id="required_fields" multiple="multiple" data-placeholder="Felder ...">
|
|
<option value="contact_type" <?= (is_array($campaign->required_fields) && in_array("contact_type", $campaign->required_fields)) ? "selected='selected'" : "" ?>>
|
|
Kontakttyp (Besitzer/Bewohner)
|
|
</option>
|
|
</select>
|
|
<small>Diese Felder müssen beim Bestellen angegeben werden</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="district_is_city">Ortsteil ist
|
|
Ort:</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="district_is_city" id="district_is_city">
|
|
<option value="0" <?= (!$campaign->district_is_city) ? "selected='selected'" : "" ?>>
|
|
Nein
|
|
</option>
|
|
<option value="1" <?= ($campaign->district_is_city) ? "selected='selected'" : "" ?>>
|
|
Ja
|
|
</option>
|
|
</select>
|
|
<small>Statt Ort muss Ortsteil/Bezirk angegeben werden</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="hausnummer_add_zusatz">Adresszusatz an
|
|
Hausnummer anhängen:</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="hausnummer_add_zusatz"
|
|
id="hausnummer_add_zusatz">
|
|
<option value="0" <?= (!$campaign->hausnummer_add_zusatz) ? "selected='selected'" : "" ?>>
|
|
Nein
|
|
</option>
|
|
<option value="1" <?= ($campaign->hausnummer_add_zusatz) ? "selected='selected'" : "" ?>>
|
|
Ja
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="exist_is_error">Erlaubte Vorbestellungen
|
|
pro Wohneinheit (API):</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="exist_is_error" id="exist_is_error">
|
|
<option value="0" <?= (!$campaign->exist_is_error) ? "selected='selected'" : "" ?>>
|
|
Mehr als eine
|
|
</option>
|
|
<option value="1" <?= ($campaign->exist_is_error) ? "selected='selected'" : "" ?>>
|
|
Maximal eine
|
|
</option>
|
|
</select>
|
|
<small>Weiterer Bestellversuch liefert Fehler zurück</small>
|
|
</div>
|
|
</div>
|
|
|
|
<hr/>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="cifurl">CIF Url</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="cifurl" id="cifurl"
|
|
value="<?= $campaign->cifurl ?>"/>
|
|
<small>
|
|
Customer Installation Feedback (für QR-Code bei Status 145).<br/>
|
|
Templatevariable <code>{{CIFTOKEN}}</code> wird mit echtem Cif Token ersetzt<br/>
|
|
Beispiel: <code>https://pro.ichwillglasfaser.at/ClientSubmit/finishedInstallationWork?c={{CIFTOKEN}}</code>
|
|
</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label"
|
|
for="cifcableurl">Kabelnachbestell-Url</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="cifcableurl" id="cifcableurl"
|
|
value="<?= $campaign->cifcableurl ?>"/>
|
|
<small>Für Begleitschreiben - Status 145</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="iframe_origins">IFrame Origins</label>
|
|
<div class="col-lg-10">
|
|
<div id="iframe-origins-container">
|
|
<!-- Dynamic inputs will be added here -->
|
|
</div>
|
|
<button type="button" class="btn btn-sm btn-success mt-2" id="add-iframe-origin">
|
|
<i class="fas fa-plus"></i> Origin URL
|
|
</button>
|
|
<input type="hidden" name="iframe_origins" id="iframe_origins" value=""/>
|
|
<small class="form-text text-muted">
|
|
URL's wo der Bestell-Iframe eingebunden werden darf.<br/>
|
|
Beispiel: https://partner-a.com, https://partner-b.de<br/>
|
|
</small>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- IFrame Consents -->
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label">IFrame Consents</label>
|
|
<div class="col-lg-10">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<button class="btn btn-link text-left p-0 w-100" type="button" data-toggle="collapse" data-target="#iframe-consents-collapse" aria-expanded="false" aria-controls="iframe-consents-collapse">
|
|
<i class="fas fa-chevron-right" id="iframe-consents-icon"></i>
|
|
<strong>IFrame Consents konfigurieren</strong>
|
|
</button>
|
|
</div>
|
|
<div class="collapse" id="iframe-consents-collapse">
|
|
<div class="card-body">
|
|
<div id="iframe-consents-container">
|
|
<!-- Dynamic inputs will be added here -->
|
|
</div>
|
|
<input type="hidden" name="iframe_consents" id="iframe_consents" value=""/>
|
|
<small class="form-text text-muted">
|
|
Zustimmungen für verschiedene Bereiche konfigurieren
|
|
</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h4>Netzbetreiber</h4>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h4>Aktivnetzbetreiber</h4>
|
|
<?php foreach ($campaign->active_operators as $aop): ?>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label"
|
|
for="active_operators_<?= $aop->id ?>"></label>
|
|
<div class="col-lg-4">
|
|
<select class="form-control"
|
|
name="active_operators[<?= $aop->id ?>]"
|
|
id="active_operators_<?= $aop->id ?>"
|
|
data-placeholder="Netzbetreiber wählen ...">
|
|
<option></option>
|
|
<?php foreach (AddressModel::search(['addresstype' => ["netowner"]]) as $operator): ?>
|
|
<option value="<?= $operator->id ?>" <?= ($operator->id == $aop->operator_id) ? "selected='selected'" : "" ?>><?= $operator->getCompanyOrName() ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<label class="col-lg-1 col-form-label text-right" for="active_isps">ISPs:</label>
|
|
<div class="col-lg-4">
|
|
<select class="select2 form-control select2-multiple active_isps"
|
|
name="active_isps[<?= $aop->operator_id ?>][]"
|
|
id="active_isps_<?= $aop->id ?>" multiple="multiple"
|
|
data-placeholder="ISPs wählen ...">
|
|
<option></option>
|
|
<?php foreach (AddressModel::search(['addresstype' => ["salespartner"]]) as $isp): ?>
|
|
<option value="<?= $isp->id ?>" <?= (array_key_exists($isp->id, $aop->isps)) ? "selected='selected'" : "" ?>><?= $isp->getCompanyOrName() ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
<hr/>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label text-right"
|
|
for="active_operators">Neu</label>
|
|
<div class="col-lg-4">
|
|
<select class="form-control" name="active_operators[new]"
|
|
id="active_operators"
|
|
data-placeholder="Netzbetreiber wählen ...">
|
|
<option></option>
|
|
<?php foreach (AddressModel::search(['addresstype' => ["netowner"]]) as $operator): ?>
|
|
<option value="<?= $operator->id ?>"><?= $operator->getCompanyOrName() ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<label class="col-lg-1 col-form-label text-right"
|
|
for="active_isps">ISPs:</label>
|
|
<div class="col-lg-4">
|
|
<select class="select2 form-control select2-multiple active_isps"
|
|
name="active_isps[new]" id="active_isps" multiple="multiple"
|
|
data-placeholder="ISPs wählen ...">
|
|
<option></option>
|
|
<?php foreach (AddressModel::search(['addresstype' => ["salespartner"]]) as $isp): ?>
|
|
<option value="<?= $isp->id ?>"><?= $isp->getCompanyOrName() ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="apiusers">Passive Netzbetreiber</label>
|
|
<div class="col-lg-10">
|
|
<select class="form-control" name="passive_operators[]"
|
|
id="passive_operators" multiple="multiple"
|
|
data-placeholder="Netzbetreiber wählen ...">
|
|
<?php foreach (AddressModel::search(['addresstype' => ["netowner", "salespartner"]]) as $operator): ?>
|
|
<option value="<?= $operator->id ?>" <?= (is_array($campaign->passive_operators) && array_key_exists($operator->id, $campaign->passive_operators)) ? "selected='selected'" : "" ?>><?= $operator->getCompanyOrName() ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h4>Verrechnungsdaten</h4>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="">Netzinhaber FIBU Kostenstelle</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="netowner_fibu_cost_code" value="<?=$campaign->netowner_fibu_cost_code?>" />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<h4>Emailbenachrichtigungen</h4>
|
|
<?php if(isset($campaign) && $campaign): ?>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h4 class="">Absender</h4>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="from_email_name">Name</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="from_email_name" id="from_email_name" value="<?= $campaign->from_email_name ?>"/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="from_email">Emailadresse</label>
|
|
<div class="col-lg-10">
|
|
<input type="text" class="form-control" name="from_email" id="from_email" value="<?= $campaign->from_email ?>"/>
|
|
</div>
|
|
</div>
|
|
|
|
<h4 class="mt-3">Emailtemplates</h4>
|
|
<?php $i=0; foreach(PreorderstatusModel::getAll() as $status): ?>
|
|
<div class="form-group row p-2 mb-0 border-bottom" id="statustemplate-<?=$status->code?>" style="background-color: #<?=($i%2 == 0) ? "fafafa" : "fff"?>">
|
|
|
|
<label class="col-lg-2 col-form-label text-right text-monospace" for="mailtemplates_<?=$status->code?>"><?=$status->name?></label>
|
|
<div class="col-lg-10">
|
|
<div class="row">
|
|
<div class="col-8">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend text-monospace">
|
|
<span class="input-group-text" id="basic-addon1"><?=$status->code?></span>
|
|
</div>
|
|
<select name="mailtemplates[<?=$status->code?>][mailtemplate_id]" id="mailtemplate-<?=$status->code?>" class="form-control select2">
|
|
<option value=""></option>
|
|
<?php foreach(MailtemplateModel::search(["is_include" => "0"]) as $template): ?>
|
|
<option value="<?=$template->id?>" <?=(is_array($campaign->statusnotifcation_mailtemplates) && array_key_exists($status->code, $campaign->statusnotifcation_mailtemplates) && $campaign->statusnotifcation_mailtemplates[$status->code]->mailtemplate_id == $template->id) ? "selected='selected'" : ""?>><?=$template->name?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend text-monospace">
|
|
<span class="input-group-text">@</span>
|
|
</div>
|
|
<input type="text" class="form-control" name="test_to" id="test-to-<?=$status->code?>" value="" placeholder="Test Emailadresse" />
|
|
<div class="input-group-append">
|
|
<button class="btn btn-outline-success" type="button" onclick="sendTestStatusEmail(<?=$status->code?>)"><i class="fas fa-envelope"></i> Testmail versenden</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-1">
|
|
<div class="col-lg">
|
|
<label>
|
|
<input type="checkbox" name="mailtemplates[<?=$status->code?>][allow_on_skip]" value="1" id="allow_on_skip-<?=$status->code?>" <?=(is_array($campaign->statusnotifcation_mailtemplates) && array_key_exists($status->code, $campaign->statusnotifcation_mailtemplates) && $campaign->statusnotifcation_mailtemplates[$status->code]->allow_on_skip) ? "checked='checked'" : ""?> />
|
|
Benachrichtigung darf bei Überspringen versendet werden, wenn nötig
|
|
</label><br />
|
|
<label>
|
|
<input type="checkbox" name="mailtemplates[<?=$status->code?>][prevent_previous]" value="1" id="prevent_previous-<?=$status->code?>" <?=(is_array($campaign->statusnotifcation_mailtemplates) && array_key_exists($status->code, $campaign->statusnotifcation_mailtemplates) && $campaign->statusnotifcation_mailtemplates[$status->code]->prevent_previous) ? "checked='checked'" : ""?> />
|
|
Keine vorigen Benachrichtigungen versenden, wenn dieser Status ohne Mailtemplate eintritt
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php $i++; endforeach; ?>
|
|
|
|
<?php
|
|
// echo json_encode($campaign->statusnotifcation_mailtemplates);exit;
|
|
?>
|
|
<!-- START CUSTOM LOGICAL MAIL TEMPLATES-->
|
|
<div class="form-group row p-2 mb-0 border-bottom" id="statustemplate-300-custom" style="background-color: #<?=($i%2 == 0) ? "fafafa" : "fff"?>">
|
|
|
|
<label class="col-lg-2 col-form-label text-right text-monospace" for="mailtemplates_300-custom">VA - 8 Wochen - keine Bestellung</label>
|
|
<div class="col-lg-10">
|
|
<div class="row">
|
|
<div class="col-8">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend text-monospace">
|
|
<span class="input-group-text" id="basic-addon1">300 Custom</span>
|
|
</div>
|
|
<select name="mailtemplates[300-custom][mailtemplate_id]" id="mailtemplate-300-custom" class="form-control select2">
|
|
<option value=""></option>
|
|
<?php foreach(MailtemplateModel::search(["is_include" => "0"]) as $template): ?>
|
|
<!-- TODO: select value if selected-->
|
|
<option value="<?=$template->id?>" <?=(is_array($campaign->statusnotifcation_mailtemplates) && array_key_exists('300-custom', $campaign->statusnotifcation_mailtemplates) && $campaign->statusnotifcation_mailtemplates['300-custom']->mailtemplate_id == $template->id) ? "selected='selected'" : ""?>><?=$template->name?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend text-monospace">
|
|
<span class="input-group-text">@</span>
|
|
</div>
|
|
<input type="text" class="form-control" name="test_to" id="test-to-300-custom"
|
|
value="" placeholder="Test E-Mail (example@test.tld)" />
|
|
<div class="input-group-append">
|
|
<button class="btn btn-outline-success" type="button" onclick="sendTestStatusEmail('300-custom')"><i class="fas fa-envelope"></i> Testmail versenden</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row p-2 mb-0 border-bottom" id="statustemplate-300-custom-new-order" style="background-color: #<?=($i%2 == 0) ? "fafafa" : "fff"?>">
|
|
|
|
<label class="col-lg-2 col-form-label text-right text-monospace" for="mailtemplates_300-custom-new-order">Neue Bestellung mit Wohneinheit Status <300</label>
|
|
<div class="col-lg-10">
|
|
<div class="row">
|
|
<div class="col-8">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend text-monospace">
|
|
<span class="input-group-text" id="basic-addon1">Neu Custom</span>
|
|
</div>
|
|
<select name="mailtemplates[300-custom-new-order][mailtemplate_id]" id="mailtemplate-300-custom-new-order" class="form-control select2">
|
|
<option value=""></option>
|
|
<?php foreach(MailtemplateModel::search(["is_include" => "0"]) as $template): ?>
|
|
<option value="<?=$template->id?>" <?=(is_array($campaign->statusnotifcation_mailtemplates) && array_key_exists('300-custom-new-order', $campaign->statusnotifcation_mailtemplates) && $campaign->statusnotifcation_mailtemplates['300-custom-new-order']->mailtemplate_id == $template->id) ? "selected='selected'" : ""?>><?=$template->name?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div class="input-group">
|
|
<div class="input-group-prepend text-monospace">
|
|
<span class="input-group-text">@</span>
|
|
</div>
|
|
<input type="text" class="form-control" name="test_to" id="test-to-300-custom-new-order"
|
|
value="" placeholder="Test E-Mail (example@test.tld)" />
|
|
<div class="input-group-append">
|
|
<button class="btn btn-outline-success" type="button" onclick="sendTestStatusEmail('300-custom-new-order')"><i class="fas fa-envelope"></i> Testmail versenden</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- END CUSTOM LOGICAL MAIL TEMPLATES -->
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<i>Verfügbar nach Speichern...</i>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
|
|
<h4>API-User</h4>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="apiusers">Erlaubte
|
|
User</label>
|
|
<div class="col-lg-10">
|
|
<select class="select2 form-control select2-multiple"
|
|
name="apiusers[]" id="apiusers" multiple="multiple"
|
|
data-placeholder="Benutzer auswählen ...">
|
|
<?php foreach (UserModel::search(['apikey' => true]) as $user): ?>
|
|
<option value="<?= $user->id ?>" <?= (is_array($campaign->apiusers) && array_key_exists($user->id, $campaign->apiusers)) ? "selected='selected'" : "" ?>><?= $user->username ?>
|
|
(<?= $user->name ?>)
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<small>Benutzer mit API-Key</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="corsorigins">CORS Origin
|
|
Hostnamen</label>
|
|
<div class="col-lg-10">
|
|
<textarea class="form-control"
|
|
name="corsorigins"><?= ($campaign->corsorigins) ? implode("\n", $campaign->corsorigins) : "" ?></textarea>
|
|
<small>Hostname der Website, mit oder ohne Protokoll
|
|
(<em>https://</em>); *. als Wildcard erlaubt
|
|
(<em>*.domain.com</em>); ein Eintrag pro Zeile</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="form-group row">
|
|
<label class="col-lg-2 col-form-label" for="note">Interne Notiz</label>
|
|
<div class="col-lg-10">
|
|
<textarea class="form-control" style="height:120px;" name="note"
|
|
id="note"><?= $campaign->note ?></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-lg-2"></label>
|
|
<div class="col-lg-10">
|
|
<button type="submit" name="return" value="" class="btn btn-primary">Speichern</button>
|
|
<button type="submit" name="return" value="index" class="btn btn-primary ml-1">Speichern und zur Übersicht</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
$('.datepicker').datepicker({
|
|
language: 'de',
|
|
format: "dd.mm.yyyy",
|
|
showWeekDays: true,
|
|
todayBtn: 'linked',
|
|
autoclose: true
|
|
});
|
|
|
|
$("#types").select2({
|
|
allowClear: true,
|
|
placeholder: "",
|
|
closeOnSelect: false
|
|
});
|
|
|
|
$("#adb_netzgebiet_ids").select2({
|
|
allowClear: true,
|
|
placeholder: "",
|
|
closeOnSelect: false
|
|
});
|
|
/*
|
|
$("#active_operators").select2({
|
|
allowClear: true,
|
|
placeholder: "",
|
|
closeOnSelect: false
|
|
});
|
|
*/
|
|
$("#passive_operators").select2({
|
|
allowClear: true,
|
|
placeholder: "",
|
|
closeOnSelect: false
|
|
});
|
|
|
|
$(".active_isps").select2({
|
|
allowClear: true,
|
|
placeholder: "",
|
|
closeOnSelect: false
|
|
});
|
|
$("#apiusers").select2({
|
|
allowClear: true,
|
|
placeholder: "",
|
|
closeOnSelect: false
|
|
});
|
|
|
|
$("#required_fields").select2({
|
|
allowClear: true,
|
|
placeholder: "",
|
|
closeOnSelect: false
|
|
});
|
|
$("#banned_rimo_fcp").select2({
|
|
allowClear: true,
|
|
placeholder: "",
|
|
closeOnSelect: false,
|
|
background: "bg-danger"
|
|
});
|
|
|
|
<?php if(isset($campaign) && $campaign): ?>
|
|
function sendTestStatusEmail(status_code) {
|
|
if(!status_code) return;
|
|
|
|
var template_id = $("#mailtemplate-" + status_code).val();
|
|
var email_to = $("#test-to-" + status_code).val();
|
|
|
|
$.post("<?=self::getUrl("Preordercampaign", "Api")?>",
|
|
{
|
|
do: "sendStatusEmail",
|
|
campaign_id: <?=$campaign->id?>,
|
|
template_id: template_id,
|
|
to_email: email_to
|
|
},
|
|
(success) => {
|
|
if(success.status == "OK") {
|
|
window.notify("success", "Testmail wurde versendet");
|
|
} else {
|
|
window.notify("error", "Beim versenden ist ein Fehler aufgetragen.");
|
|
}
|
|
|
|
console.log(success);
|
|
},
|
|
"json"
|
|
);
|
|
}
|
|
<?php endif; ?>
|
|
</script>
|
|
|
|
<!--IFRAME SCRIPT PARTS-->
|
|
<script>
|
|
$(document).ready(function() {
|
|
// Initialize with existing data
|
|
let iframeOrigins = <?= $campaign->iframe_origins ?? '[]'; ?>;
|
|
let iframeConsents = <?= $campaign->iframe_consents ?? '{}'; ?>;
|
|
|
|
console.log(iframeConsents);
|
|
|
|
// Predefined consent types with default texts
|
|
const consentTypes = {
|
|
'agb': {
|
|
'label': 'Zustimmung AGB',
|
|
required: true,
|
|
'defaultText': 'Ich habe mich über die wesentlichen Vertragsinhalte lt. Vertragsbedingungen Glasfaseranschluss informiert und akzeptiere die Allgemeinen Geschäftsbedingungen.'
|
|
},
|
|
'dsgvo': {
|
|
'label': 'Zustimmung DSGVO',
|
|
required: true,
|
|
'defaultText': 'Ich habe die Information zur Datenschutzgrundverordnung (DSGVO) zur Kenntnis genommen. Diese ist jederzeit im Downloadbereich abrufbar.'
|
|
},
|
|
'ruecktrittsrecht': {
|
|
'label': 'Zustimmung Rücktrittsrecht',
|
|
required: true,
|
|
'defaultText': 'Ich habe die Information über die Rücktrittsrechte für Verbraucher gemäß §3 KSchG und §§ 11 FAGG erhalten, gelesen und zur Kenntnis genommen.'
|
|
},
|
|
'datenweitergabe': {
|
|
'label': 'Zustimmung Datenweitergabe',
|
|
'defaultText': 'Ich stimme zu, dass meine Daten zur telefonischen Kontaktaufnahme, sowie für die postalische und elektronische Zusendung von Produkt- und Dienstleistungs-Informationen bzw. für Marketingaktivitäten an verbundene Unternehmen übermittelt werden. Diese Zustimmungserklärung kann jederzeit widerrufen werden.'
|
|
},
|
|
'grabungsarbeiten': {
|
|
'label': 'Zustimmung Grabungsarbeiten',
|
|
'defaultText': 'Ich stimme den notwendigen Grabungsarbeiten für die Installation des Glasfaseranschlusses zu.'
|
|
}
|
|
};
|
|
|
|
// Ensure iframeConsents is an object with all consent types
|
|
Object.keys(consentTypes).forEach(key => {
|
|
if (!iframeConsents[key]) {
|
|
iframeConsents[key] = {
|
|
url: consentTypes[key].defaultURL || '',
|
|
text: consentTypes[key].defaultText,
|
|
required: consentTypes[key].required || false,
|
|
replace: consentTypes[key].defaultReplacer || ''
|
|
};
|
|
}
|
|
});
|
|
|
|
// IFrame Origins Management (unchanged)
|
|
function renderIframeOrigins() {
|
|
const container = $('#iframe-origins-container');
|
|
container.empty();
|
|
|
|
iframeOrigins.forEach((origin, index) => {
|
|
const row = $(`
|
|
<div class="input-group mb-2">
|
|
<input type="text" class="form-control iframe-origin-input"
|
|
placeholder="https://example.com" value="${origin}" data-index="${index}">
|
|
<div class="input-group-append">
|
|
<button type="button" class="btn btn-outline-danger remove-iframe-origin" data-index="${index}">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
`);
|
|
container.append(row);
|
|
});
|
|
|
|
updateIframeOriginsInput();
|
|
}
|
|
|
|
function updateIframeOriginsInput() {
|
|
$('#iframe_origins').val(JSON.stringify(iframeOrigins));
|
|
}
|
|
|
|
// Add new iframe origin
|
|
$('#add-iframe-origin').click(function() {
|
|
iframeOrigins.push('');
|
|
renderIframeOrigins();
|
|
});
|
|
|
|
// Remove iframe origin
|
|
$(document).on('click', '.remove-iframe-origin', function() {
|
|
const index = $(this).data('index');
|
|
iframeOrigins.splice(index, 1);
|
|
renderIframeOrigins();
|
|
});
|
|
|
|
// Update iframe origin value
|
|
$(document).on('input', '.iframe-origin-input', function() {
|
|
const index = $(this).data('index');
|
|
const value = $(this).val();
|
|
iframeOrigins[index] = value;
|
|
updateIframeOriginsInput();
|
|
});
|
|
|
|
|
|
|
|
// IFrame Consents Management (modified for predefined types)
|
|
function renderIframeConsents() {
|
|
const container = $('#iframe-consents-container');
|
|
container.empty();
|
|
|
|
Object.keys(consentTypes).forEach(consentKey => {
|
|
const consent = iframeConsents[consentKey];
|
|
const consentConfig = consentTypes[consentKey];
|
|
|
|
const row = $(`
|
|
<div class="card mb-3">
|
|
<div class="card-header">
|
|
<h6 class="mb-0">${consentConfig.label}</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<label class="form-label">URL</label>
|
|
<input type="text" class="form-control iframe-consent-url"
|
|
placeholder="https://partner.com" value="${consent.url || ''}" data-consent="${consentKey}">
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label class="form-label">URL Replacer</label>
|
|
<input type="text" class="form-control iframe-consent-replace"
|
|
placeholder="Consent" value="${consent.replace || 'Consent'}" data-consent="${consentKey}">
|
|
</div>
|
|
</div>
|
|
<div class="row mt-3">
|
|
<div class="col-md-8">
|
|
<label class="form-label">Text</label>
|
|
<textarea class="form-control iframe-consent-text" rows="4"
|
|
placeholder="${consentConfig.defaultText}" data-consent="${consentKey}">${consent.text || consentConfig.defaultText}</textarea>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-check mt-4">
|
|
<input type="checkbox" class="form-check-input iframe-consent-required"
|
|
id="consent-required-${consentKey}" data-consent="${consentKey}" ${consent.required ? 'checked' : ''}>
|
|
<label class="form-check-label" for="consent-required-${consentKey}">
|
|
Erforderlich?
|
|
</label>
|
|
</div>
|
|
|
|
<div class="form-check mt-4">
|
|
<input type="checkbox" class="form-check-input iframe-consent-activated"
|
|
id="consent-activated-${consentKey}" data-consent="${consentKey}" ${consent.activated ? 'checked' : ''}>
|
|
<label class="form-check-label" for="consent-activated-${consentKey}">
|
|
Aktiviert?
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`);
|
|
container.append(row);
|
|
});
|
|
|
|
updateIframeConsentsInput();
|
|
}
|
|
|
|
function updateIframeConsentsInput() {
|
|
console.log('json result', JSON.stringify(iframeConsents));
|
|
$('#iframe_consents').val(JSON.stringify(iframeConsents));
|
|
}
|
|
|
|
// Update iframe consent values
|
|
$(document).on('input', '.iframe-consent-url', function() {
|
|
const consentKey = $(this).data('consent');
|
|
const value = $(this).val();
|
|
iframeConsents[consentKey].url = value;
|
|
updateIframeConsentsInput();
|
|
});
|
|
|
|
$(document).on('input', '.iframe-consent-text', function() {
|
|
const consentKey = $(this).data('consent');
|
|
const value = $(this).val();
|
|
iframeConsents[consentKey].text = value;
|
|
updateIframeConsentsInput();
|
|
});
|
|
|
|
$(document).on('input', '.iframe-consent-replace', function() {
|
|
const consentKey = $(this).data('consent');
|
|
const value = $(this).val();
|
|
iframeConsents[consentKey].replace = value;
|
|
updateIframeConsentsInput();
|
|
});
|
|
|
|
$(document).on('change', '.iframe-consent-required', function() {
|
|
const consentKey = $(this).data('consent');
|
|
const checked = $(this).is(':checked');
|
|
iframeConsents[consentKey].required = checked;
|
|
updateIframeConsentsInput();
|
|
});
|
|
|
|
$(document).on('change', '.iframe-consent-activated', function() {
|
|
const consentKey = $(this).data('consent');
|
|
const checked = $(this).is(':checked');
|
|
iframeConsents[consentKey].activated = checked;
|
|
updateIframeConsentsInput();
|
|
});
|
|
|
|
// Initial render
|
|
renderIframeOrigins();
|
|
renderIframeConsents();
|
|
|
|
// Add at least one empty entry if none exist for origins
|
|
if (iframeOrigins.length === 0) {
|
|
$('#add-iframe-origin').click();
|
|
}
|
|
|
|
// Handle collapse icon rotation
|
|
$('#iframe-consents-collapse').on('show.bs.collapse', function () {
|
|
$('#iframe-consents-icon').removeClass('fa-chevron-right').addClass('fa-chevron-down');
|
|
});
|
|
|
|
$('#iframe-consents-collapse').on('hide.bs.collapse', function () {
|
|
$('#iframe-consents-icon').removeClass('fa-chevron-down').addClass('fa-chevron-right');
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|