diff --git a/Layout/default/Preorder/Index.php b/Layout/default/Preorder/Index.php index 7660a9dc1..d97168da2 100644 --- a/Layout/default/Preorder/Index.php +++ b/Layout/default/Preorder/Index.php @@ -1075,6 +1075,8 @@ $pagination_entity_name = "Vorbestellungen"; is(["preorderfront"]) && !$me->is("preorderreadonly")): ?> $preorder->id])?>"> + + isAdmin()): ?> $preorder->id, "filter" => $filter])?>" class="text-danger" onclick="if(!confirm('Vorbestellung wirklich löschen?')) return false;" title="Vorbestellung Löschen"> diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index 087affdc5..6e6e16c80 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -791,6 +791,10 @@ class PreorderController extends mfBaseController { $qs = http_build_query($qs); } + if(!$this->me->isAdmin()) { + $this->redirect("Preorder", "Index", $qs); + } + $id = $this->request->id; if(!is_numeric($id) || $id < 1) { $this->layout()->setFlash("Vorbestellung nicht gefunden!", "error"); diff --git a/db/migrations/20250121164455_construction_consent_change_status_and_result.php b/db/migrations/20250121164455_construction_consent_change_status_and_result.php index f418b3baa..976d1af07 100644 --- a/db/migrations/20250121164455_construction_consent_change_status_and_result.php +++ b/db/migrations/20250121164455_construction_consent_change_status_and_result.php @@ -22,6 +22,7 @@ final class ConstructionConsentChangeStatusAndResult extends AbstractMigration $cco = $this->table("ConstructionConsentOwner"); $cco->changeColumn("status", "enum", ["null" => true, "default" => null, "values" => "new,requested,answered"]); $cco->changeColumn("result", "enum", ["null" => true, "default" => null, "values" => "success,failure"]); + $cco->update(); $this->execute("UPDATE ConstructionConsentOwner SET status=NULL, result=NULL"); $cco->changeColumn("status", "enum", ["null" => true, "default" => null, "values" => "new,sent,returned,outstanding"]); diff --git a/db/migrations/20250131150000_warehouse_modify_10.php b/db/migrations/20250131150000_warehouse_modify_10.php index 15ee86a77..7dc8b59a3 100644 --- a/db/migrations/20250131150000_warehouse_modify_10.php +++ b/db/migrations/20250131150000_warehouse_modify_10.php @@ -5,7 +5,12 @@ use Phinx\Migration\AbstractMigration; final class WarehouseModify10 extends AbstractMigration { public function up(): void { if ($this->getEnvironment() == "thetool") { - // Drop the existing tables + // Remove foreign keys and drop the existing tables + $this->table("WarehouseOrderItem") + ->dropForeignKey("orderId") + ->dropForeignKey("articleId") + ->update(); + $this->table("WarehouseOrder")->drop()->save(); $this->table("WarehouseOrderItem")->drop()->save(); diff --git a/db/migrations/20250612124000_add_new_indexes_adb.php b/db/migrations/20250612124000_add_new_indexes_adb.php index 5fce29b7e..4c810a0b2 100644 --- a/db/migrations/20250612124000_add_new_indexes_adb.php +++ b/db/migrations/20250612124000_add_new_indexes_adb.php @@ -14,7 +14,7 @@ final class AddNewIndexesAdb extends AbstractMigration ->save(); $wohneinheit->removeIndexByName('extref') - ->addIndex('extref', ['name' => 'idx_extref_full']) + ->addIndex('extref', ['name' => 'idx_extref_full', 'limit' => 32]) ->save(); } diff --git a/db/migrations/20250715110000_warehouse_offer_versioning.php b/db/migrations/20250715110000_warehouse_offer_versioning.php index 81871b356..b1f7e59cb 100644 --- a/db/migrations/20250715110000_warehouse_offer_versioning.php +++ b/db/migrations/20250715110000_warehouse_offer_versioning.php @@ -49,6 +49,7 @@ final class WarehouseOfferVersioning extends AbstractMigration // Use Phinx schema builder to add columns to the WarehouseOffer table $warehouseOffer = $this->table('WarehouseOffer'); $warehouseOffer + ->addColumn('contactPerson', 'string', ['limit' => 255, 'null' => true, "after" => 'customerName']) ->addColumn('contactPersonEmail', 'string', ['limit' => 255, 'null' => true, 'after' => 'contactPerson']) ->addColumn('lastSentDate', 'integer', ['null' => true, 'after' => 'status']) ->addColumn('version', 'integer', ['default' => 1, 'after' => 'id']) diff --git a/lib/Citycom/OanApiHelper.php b/lib/Citycom/OanApiHelper.php index 87404fe7d..ee793e0e8 100644 --- a/lib/Citycom/OanApiHelper.php +++ b/lib/Citycom/OanApiHelper.php @@ -116,10 +116,12 @@ class Citycom_OanApiHelper { $this->log->debug(print_r($want_services, true)); + $allowed_service_types = array_merge(CITYCOM_OAN_API_SERVICES_FOR_ORDER, CITYCOM_OAN_API_SERVICES_FOR_RESERVATION); + // check if we have these services already foreach($cc_service_types as $stype) { - if(!in_array($stype->name, CITYCOM_OAN_API_SERVICES_FOR_ORDER)) continue; - $ctag_service_type = array_flip(CITYCOM_OAN_API_SERVICES_FOR_ORDER)[$stype->name]; + if(!in_array($stype->name, $allowed_service_types)) continue; + $ctag_service_type = array_flip($allowed_service_types)[$stype->name]; if(PreorderCtag::getFirstActive(["preorder_id" => $preorder->id, "service_type" => $ctag_service_type])) { // service was ordered already, remove from want_services unset($want_services[$ctag_service_type]);