added new menu point and added new permission

This commit is contained in:
Luca Haid
2025-08-18 18:47:00 +02:00
parent dbbf4f204e
commit 17b4a0f3f2
4 changed files with 41 additions and 1 deletions

View File

@@ -500,6 +500,15 @@ $siteTitle = "Benutzer";
<label for="can_RMLAdmin" class="form-check-label">RML-Workorder-Admin</label>
</div>
</div>
<div class="col-4">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="can[RMLCompany]"
id="can_RMLCompany"
value="1" <?=($user && $user->can("RMLCompany")) ? "checked='checked'" : ""?> />
<label for="can_RMLCompany" class="form-check-label">RML-Workorder-Firma</label>
</div>
</div>
</div>
<hr/>

View File

@@ -124,7 +124,7 @@
</li>
<?php endif; ?>
<?php if($me->is(["Admin","netowner","lineplanner","pipeplanner","pipeworker","lineworker"]) && ($me->is("employee") || $me->can(["Building","Pipework","Linework","Patching","Filestore"]))): ?>
<?php if($me->is(["Admin","netowner","lineplanner","pipeplanner","pipeworker","lineworker"]) && ($me->is("employee") || $me->can(["Building","Pipework","Linework","Patching","Filestore", "RMLCompany"]))): ?>
<li class="has-submenu mobile-hide">
<a href="#">
<i class="fas fa-fw fa-hard-hat"></i>Netzbau <div class="arrow-down"></div>
@@ -139,6 +139,9 @@
<?php if($me->is(["Admin","netowner","pipeplanner","pipeplanner"]) && $me->is("employee")): ?><li><a href="<?=self::getUrl("FiberPlanDispatcher")?>"><i class="fas fa-building-circle-arrow-right text-info"></i> Verteiler und Schächte</a></li><?php endif; ?>
<?php if($me->is(["Admin","netowner","lineplanner","lineworker"]) && $me->is("employee")): ?><li><a href="<?=self::getUrl("FiberPlanPipe")?>"><i class="fas fa-pipe text-info pl-1"></i> Rohrverzeichnis</a></li><?php endif; ?>
<?php if($me->is(["Admin","netowner","lineplanner","lineworker"]) && $me->is("employee")): ?><li><a href="<?=self::getUrl("FiberPlanCable")?>"><i class="fa-solid fa-timeline text-info "></i> Kabelverzeichnis</a></li><?php endif; ?>
<!-- add a new line Arbeitsaufträge for RMLCompany, add a new line Arbeitsaufträge-Management for RMLAdmin -->
<?php if($me->can("RMLCompany")): ?><li><a href="<?=self::getUrl("RMLWorkorderCompany")?>"><i class="far fa-fw fa-clipboard-question text-info"></i> Arbeitsaufträge</a></li><?php endif; ?>
<?php if($me->can("RMLAdmin")): ?><li><a href="<?=self::getUrl("RMLWorkorderAdmin")?>"><i class="far fa-fw fa-clipboard-question text-info"></i> Arbeitsaufträge-Management</a></li><?php endif; ?>
</ul>
</li>
<?php endif; ?>

View File

@@ -265,6 +265,7 @@ class UserController extends mfBaseController
$user->permissions->canADBExtended = "false";
$user->permissions->canAssetAdmin = "false";
$user->permissions->canRMLAdmin = "false";
$user->permissions->canRMLCompany = "false";
if($r->get("can") && is_array($r->can)) {
foreach($r->can as $key => $can) {

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class RmlworkorderUpdateStatusEnum extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("WorkerPermission");
$table->addColumn("canRMLCompany", "enum", ["null" => false, "values" => ['false', 'true'], "default" => "false", "after" => "canSuperexpert"]);
$table->update();
// ALTER TABLE `WorkerPermission` ADD COLUMN `canRMLCompany` ENUM('false', 'true') NOT NULL DEFAULT 'false' AFTER `canSuperexpert`;
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("WorkerPermission");
$table->removeColumn("canRMLCompany");
$table->save();
}
}
}