Merge branch 'fronkdev' into 'master'
Fronkdev See merge request fronk/thetool!297
This commit is contained in:
@@ -645,17 +645,44 @@
|
||||
(is_array($product->product->attributes) && count($product->product->attributes))
|
||||
&& (array_key_exists(TT_ATTRIB_VOICENUMBER_REQUIRED_NAME, $product->product->attributes)
|
||||
&& $product->product->attributes[TT_ATTRIB_VOICENUMBER_REQUIRED_NAME]->value == 1)
|
||||
|| $product->voicenumber
|
||||
|| $product->voicenumbers
|
||||
): ?>
|
||||
<div class="row mt-1 mb-2" id="voicenumber-<?=$i?>-line">
|
||||
<?php else: ?>
|
||||
<div class="row mt-1 mb-2 hidden" id="voicenumber-<?=$i?>-line">
|
||||
<?php endif; ?>
|
||||
<!-- line to input voicenumber -->
|
||||
|
||||
<div class="col-6">
|
||||
<label class="form-label" for="voicenumber-<?=$i?>">Rufnummer</label>
|
||||
<textarea class="form-control" name="products[<?=$i?>][voicenumber]" id="voicenumber-<?=$i?>" placeholder="Eine Rufnummer pro Zeile (+43 123 456 78)" /><?=(is_array($product->voicenumbers) && count($product->voicenumbers)) ? implode("\n", $product->voicenumbers) : ""?></textarea>
|
||||
<small>Wenn Rufnummern bekannt sind oder portiert werden (Eine Rufnummer pro Zeile (+43 123 456 78))</small>
|
||||
<!-- line to input voicenumber -->
|
||||
<?php if(is_array($product->voicenumbers) && count($product->voicenumbers)): ?>
|
||||
Rufnummer: <strong><?=implode("\n<br />", $product->voicenumbers)?></strong> <i class="fas fa-pencil pointer text-primary" onclick="toggleVoicenumberEdit(<?=$i?>)"></i>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row <?=is_array($product->voicenumbers) && count($product->voicenumbers) ? "hidden" : ""?>" id="voicenumber-edit-<?=$i?>">
|
||||
<div class="col-4" id="voicenumberblock-<?=$i?>-line">
|
||||
<label class="form-label" for="voicenumberblock-<?=$i?>">Nummernblock *</label>
|
||||
<select name="voicenumberblock_id" id="voicenumberblock_id-<?=$i?>" class="form-control select2" onchange="loadVoicenumbers(<?=$i?>)">
|
||||
<option></option>
|
||||
<option value="portin">Rufnummernportierung</option>
|
||||
<?php foreach(VoicenumberblockModel::getAll() as $block): ?>
|
||||
<option value="<?=$block->id?>">+<?=$block->countrycode?> <?=$block->areacode?> (<?=$block->name?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-4 hidden" id="voicenumber-select-<?=$i?>-line">
|
||||
<label class="form-label" for="voicenumber-<?=$i?>">Rufnummer wählen *</label>
|
||||
<select name="products[<?=$i?>][voicenumber]" id="voicenumber-<?=$i?>" class="form-control select2">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-4 hidden" id="voicenumber-custom-<?=$i?>-line">
|
||||
<label class="form-label" for="voicenumber_custom-<?=$i?>">Rufnummer eingeben *</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][voicenumber_custom]" id="voicenumber_custom-<?=$i?>" value="" placeholder="Gesamte Rufnummer (+43 123 456 78 )" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -771,11 +798,31 @@
|
||||
</div>
|
||||
|
||||
<div class="row mt-1 mb-2 hidden" id="voicenumber-<?=$i?>-line">
|
||||
<!-- line to input voicenumber -->
|
||||
<div class="col-6">
|
||||
<label class="form-label" for="voicenumber-<?=$i?>">Rufnummer</label>
|
||||
<textarea class="form-control" name="products[<?=$i?>][voicenumber]" id="voicenumber-<?=$i?>" placeholder="Eine Rufnummer pro Zeile (+43 123 456 78)" /></textarea>
|
||||
<small>Wenn Rufnummern bekannt sind oder portiert werden (Eine Rufnummer pro Zeile (+43 123 456 78))</small>
|
||||
<!-- line to input voicenumber -->
|
||||
<div class="row">
|
||||
<div class="col-4" id="voicenumberblock-<?=$i?>-line">
|
||||
<label class="form-label" for="voicenumberblock-<?=$i?>">Nummernblock *</label>
|
||||
<select name="voicenumberblock_id" id="voicenumberblock_id-<?=$i?>" class="form-control select2" onchange="loadVoicenumbers(<?=$i?>)">
|
||||
<option></option>
|
||||
<option value="portin">Rufnummernportierung</option>
|
||||
<?php foreach(VoicenumberblockModel::getAll() as $block): ?>
|
||||
<option value="<?=$block->id?>">+<?=$block->countrycode?> <?=$block->areacode?> (<?=$block->name?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-4 hidden" id="voicenumber-select-<?=$i?>-line">
|
||||
<label class="form-label" for="voicenumber-<?=$i?>">Rufnummer wählen *</label>
|
||||
<select name="products[<?=$i?>][voicenumber]" id="voicenumber-<?=$i?>" class="form-control select2">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-4 hidden" id="voicenumber-custom-<?=$i?>-line">
|
||||
<label class="form-label" for="voicenumber_custom-<?=$i?>">Rufnummer eingeben *</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][voicenumber_custom]" id="voicenumber_custom-<?=$i?>" value="" placeholder="Gesamte Rufnummer (+43 123 456 78 )" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1271,6 +1318,59 @@
|
||||
|
||||
}
|
||||
|
||||
function toggleVoicenumberEdit(id) {
|
||||
$('#voicenumber-edit-' + id).toggle();
|
||||
|
||||
$("#voicenumber-select-" + id + "-line select").empty();
|
||||
$("#voicenumber-custom-" + id + "-line input").val("");
|
||||
|
||||
}
|
||||
|
||||
function loadVoicenumbers(id) {
|
||||
var block_id = $("#voicenumberblock_id-" + id).val();
|
||||
|
||||
if(block_id == "portin") {
|
||||
$("#voicenumber-select-" + id + "-line").hide();
|
||||
$("#voicenumber-select-" + id + "-line select").val("");
|
||||
$("#voicenumber-" + id).empty();
|
||||
|
||||
$("#voicenumber-custom-" + id + "-line").show();
|
||||
//$("#voicenumberblock-" + id + "-line").hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if(!block_id) return;
|
||||
|
||||
$.ajax({
|
||||
url: "<?=self::getUrl("Voicenumberblock", "api")?>",
|
||||
type: "POST",
|
||||
context: id,
|
||||
data: {
|
||||
do: "getFreeNumbers",
|
||||
id: block_id
|
||||
},
|
||||
success: function(success) {
|
||||
//console.log(success, id);
|
||||
if(success.status != "OK") return;
|
||||
|
||||
if(("numbers" in success.result) && success.result.numbers.length) {
|
||||
$("#voicenumber-" + id).empty();
|
||||
success.result.numbers.forEach(function(num) {
|
||||
$("#voicenumber-" + id).append("<option value='" + num + "'>+" + num + "</option>");
|
||||
});
|
||||
//$("#voicenumberblock-" + id + "-line").hide();
|
||||
$("#voicenumber-custom-" + id + "-line").hide();
|
||||
$("#voicenumber-custom-" + id + "-line input").val("");
|
||||
|
||||
$("#voicenumber-select-" + id + "-line").show();
|
||||
|
||||
}
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/*********************
|
||||
* Form validation
|
||||
*/
|
||||
|
||||
@@ -533,6 +533,16 @@
|
||||
?>
|
||||
<br /><small class="text-pink"><?=$product->termination->code?> - <?= str_replace("\n", " - ", $product->termination->getAddress())?></small>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if(
|
||||
(is_array($product->product->attributes) && count($product->product->attributes))
|
||||
&& (array_key_exists(TT_ATTRIB_VOICENUMBER_REQUIRED_NAME, $product->product->attributes)
|
||||
&& $product->product->attributes[TT_ATTRIB_VOICENUMBER_REQUIRED_NAME]->value == 1)
|
||||
|| $product->voicenumbers
|
||||
):
|
||||
?>
|
||||
<br /><small class="text-pink"><?=implode("\n<br />", $product->voicenumbers)?></small>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?=($product->billing_period == 12) ? "Jährlich" : "Monatlich"?></td>
|
||||
<td class="text-monospace text-right"><?=number_format($product->price, 4, ",", ".")?></td>
|
||||
@@ -994,6 +1004,16 @@
|
||||
?>
|
||||
<br /><small class="text-pink"><?=$product->termination->code?> - <?= str_replace("\n", " - ", $product->termination->getAddress())?></small>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if(
|
||||
(is_array($product->product->attributes) && count($product->product->attributes))
|
||||
&& (array_key_exists(TT_ATTRIB_VOICENUMBER_REQUIRED_NAME, $product->product->attributes)
|
||||
&& $product->product->attributes[TT_ATTRIB_VOICENUMBER_REQUIRED_NAME]->value == 1)
|
||||
|| $product->voicenumbers
|
||||
):
|
||||
?>
|
||||
<br /><small class="text-pink"><?=implode("\n<br />", $product->voicenumbers)?></small>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?=($product->billing_period == 12) ? "Jährlich" : "Monatlich"?></td>
|
||||
<td class="text-monospace text-right"><?=number_format($product->price, 4, ",", ".")?></td>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<th>Entsperrung</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php $i = 0; foreach(range($block->first, $block->last) as $number): ?>
|
||||
<?php $num = VoicenumberModel::getFirst(['voicenumberblock_id' => $block_id, 'number' => $number]) ?>
|
||||
<?php $i = 0; foreach(range((array_key_exists($block->id, $num_from) ? $num_from[$block->id] : $block->first), $block->last) as $number): ?>
|
||||
<?php $num = VoicenumberModel::getFirst(['voicenumberblock_id' => $block->id, 'number' => $number]) ?>
|
||||
<tr>
|
||||
<td><?=$number?></td>
|
||||
<td>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if(rest_duration < 60*5) {
|
||||
if(rest_duration < 60) {
|
||||
// show notification
|
||||
if($("#se_notf").length) {
|
||||
$("#se_notf .time").text(rest_duration);
|
||||
|
||||
Reference in New Issue
Block a user