Merge branch 'fronkdev' into 'master'

Added new Voicenumber delete_reason

See merge request fronk/thetool!2017
This commit is contained in:
Frank Schubert
2026-01-15 17:10:08 +00:00
5 changed files with 44 additions and 3 deletions

View File

@@ -117,6 +117,7 @@
<option></option>
<option value="ported_out" <?=($number->disabled_reason == "ported_out") ? "selected='selected'" : ""?>>Zu neuem Provider portiert</option>
<option value="ported_back" <?=($number->disabled_reason == "ported_back") ? "selected='selected'" : ""?>>Zum Anker zurückportiert</option>
<option value="contract_cancelled" <?=($number->disabled_reason == "contract_cancelled") ? "selected='selected'" : ""?>>Vertrag gekündigt</option>
<option value="reserved" <?=($number->disabled_reason == "reserved") ? "selected='selected'" : ""?>>Reserviert</option>
<option value="legacy" <?=($number->disabled_reason == "legacy") ? "selected='selected'" : ""?>>Legacy</option>
<option value="damaged" <?=($number->disabled_reason == "damaged") ? "selected='selected'" : ""?>>Kaputt</option>

View File

@@ -42,7 +42,7 @@
Lokal
<?php endif; ?>
</td>
<td><?=$num->disabled_reason?></td>
<td><?=$num->disabled_reason?><?=($num->disabled > 1) ? " (<i>".date("d.m.Y H:i", $num->disabled)."</i>)" : ""?></td>
<td><?=($num->id && $num->enable_on_date) ? date("d.m.Y", $num->enable_on_date) : ""?></td>
<td>
<a href="<?=self::getUrl("Voicenumber", "edit", ["block_id" => $block->id, "number" => $number])?>"><i class="fas fa-edit"></i></a>

View File

@@ -114,8 +114,11 @@ class VoicenumberController extends mfBaseController {
$number_data['port_out_date'] = self::dateToTimestamp($r->port_out_date);
}
if($r->disabled === "1") {
$number_data['disabled'] = 1;
if($r->disabled == "1") {
if(!$number->disabled) {
$number_data['disabled'] = date('U');
$number_data['disabled_by'] = $this->me->id;
}
switch($r->disabled_reason) {
case "ported_out":
$number_data['disabled_reason'] = "ported_out";
@@ -123,6 +126,9 @@ class VoicenumberController extends mfBaseController {
case "ported_back":
$number_data['disabled_reason'] = "ported_back";
break;
case "contract_cancelled":
$number_data['disabled_reason'] = "contract_cancelled";
break;
case "legacy":
$number_data['disabled_reason'] = "legacy";
break;

View File

@@ -17,6 +17,7 @@ class VoicenumberModel {
public $ported_out;
public $disabled;
public $disabled_reason;
public $disabled_by;
public $enable_on_date;
public $comment;

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class VoicenumberAddDisableReasonCanceled extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Voicenumber");
$table->changeColumn("disabled", "integer", ["null" => false, "default" => 0]);
$table->changeColumn("disabled_reason", "enum", ["values" => "ported_out,ported_back,reserved,legacy,damaged,contract_cancelled", "null" => true, "default" => null]);
$table->addColumn("disabled_by", "integer", ["null" => true, "default" => null, "after" => "disabled_reason"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
}
if($this->getEnvironment() == "addressdb") {
}
}
}