Switched-off modules leave ITFlow completely: one map of each module's pages, windows, portal and guest pages (modulePaths) turned away by moduleRequestGuard with a refusal in the right shape, the API refusing resources and tag and category kinds of a module that is off, and every other page leaving out its tabs, New items, links, dashboard tiles, search groups, calendar layers, kinds, email previews, From addresses, settings sections and cron jobs; the nightly run skips the work of a module that is off, shared links don't open with IT documentation off, hidden settings keep their values, start pages fall back to the dashboard; 26.12.6 changelog and CONTRIBUTING rule

This commit is contained in:
johnnyq
2026-12-03 18:44:24 -05:00
parent 015b8a8217
commit 76c572c67e
72 changed files with 717 additions and 150 deletions

View File

@@ -130,6 +130,15 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
if (!$can_support) {
unset($location_tabs['assets'], $location_tabs['networks'], $location_tabs['racks'], $location_tabs['tickets'], $location_tabs['documents'], $location_tabs['files']);
}
// The parts of ITFlow switched off (Admin > Settings > Modules) - their tabs and New items go
$location_itdoc = moduleOn('itdoc');
$location_ticketing = moduleOn('ticketing');
if (!$location_itdoc) {
unset($location_tabs['assets'], $location_tabs['networks'], $location_tabs['racks'], $location_tabs['documents'], $location_tabs['files']);
}
if (!$location_ticketing) {
unset($location_tabs['tickets']);
}
$move_url = "modals/location/location_assign.php?id=$location_id&kind=";
$unset_url = function ($kind, $id) use ($location_id) {
@@ -186,7 +195,7 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
<div class="dropdown">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown"><i class="fas fa-plus me-2"></i>New</button>
<div class="dropdown-menu dropdown-menu-end">
<?php if ($can_support_edit) { ?>
<?php if ($can_support_edit && $location_ticketing) { ?>
<a class="dropdown-item ajax-modal" href="#" data-modal-size="lg" data-modal-url="modals/ticket/ticket_add.php?client_id=<?= $client_id ?>&location_id=<?= $location_id ?>">
<i class="fas fa-fw fa-life-ring text-secondary me-2"></i>Ticket Here
</a>
@@ -201,7 +210,7 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
<i class="fas fa-fw fa-user text-secondary me-2"></i>Contact
</a>
<?php } ?>
<?php if ($can_support_edit) { ?>
<?php if ($can_support_edit && $location_itdoc) { ?>
<a class="dropdown-item ajax-modal" href="#" data-modal-size="lg" data-modal-url="modals/asset/asset_add.php?client_id=<?= $client_id ?>&location_id=<?= $location_id ?>">
<i class="fas fa-fw fa-desktop text-secondary me-2"></i>Asset
</a>
@@ -233,12 +242,12 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
<button type="button" class="btn btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown"><i class="fas fa-dolly me-2"></i>Move Here</button>
<div class="dropdown-menu dropdown-menu-end">
<?php foreach (LOCATION_KINDS as $kind => $k) {
if (lookupUserPermission($k['module']) < 2) {
if (lookupUserPermission($k['module']) < 2 || ($kind !== 'contact' && !$location_itdoc)) {
continue;
} ?>
<a class="dropdown-item ajax-modal" href="#" data-modal-url="<?= $move_url . $kind ?>"><i class="fas fa-fw <?= $k['icon'] ?> text-secondary me-2"></i><?= $k['plural'] ?></a>
<?php } ?>
<?php if ($can_support_edit) { ?>
<?php if ($can_support_edit && $location_itdoc) { ?>
<div class="dropdown-divider"></div>
<?= linkPickerButton('location', $location_id, '', 'Link a document or file', 'dropdown-item', 'fas fa-fw fa-link text-secondary me-2') ?>
<?php } ?>
@@ -431,6 +440,7 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
</div>
<?php if ($can_support) { ?>
<?php if (isset($location_tabs['assets'])) { ?>
<!-- Assets on site -->
<div class="tab-pane fade" id="location-pane-assets" role="tabpanel">
<div class="itflow-asset-pane-bar">
@@ -477,7 +487,9 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
<div class="itflow-asset-empty">No assets here.</div>
<?php } ?>
</div>
<?php } ?>
<?php if (isset($location_tabs['networks'])) { ?>
<!-- Networks -->
<div class="tab-pane fade" id="location-pane-networks" role="tabpanel">
<div class="itflow-asset-pane-bar">
@@ -525,7 +537,9 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
<div class="itflow-asset-empty">No networks here.</div>
<?php } ?>
</div>
<?php } ?>
<?php if (isset($location_tabs['racks'])) { ?>
<!-- Racks -->
<div class="tab-pane fade" id="location-pane-racks" role="tabpanel">
<div class="itflow-asset-pane-bar">
@@ -557,7 +571,9 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
<div class="itflow-asset-empty">No racks here.</div>
<?php } ?>
</div>
<?php } ?>
<?php if (isset($location_tabs['tickets'])) { ?>
<!-- Tickets for this site -->
<div class="tab-pane fade" id="location-pane-tickets" role="tabpanel">
<div class="itflow-asset-pane-bar">
@@ -575,10 +591,14 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
<div class="itflow-asset-empty">No tickets for this site.</div>
<?php } ?>
</div>
<?php } ?>
<!-- Documents and files -->
<?php foreach (['documents' => ['document', $documents, 'Floor plans, site runbooks, cabling and access guides.', 'No documents linked.'],
'files' => ['file', $files, 'Photos of the cupboard and the patch panel, plans, leases.', 'No files linked.']] as $pane => [$to, $linked, $hint, $empty]) { ?>
'files' => ['file', $files, 'Photos of the cupboard and the patch panel, plans, leases.', 'No files linked.']] as $pane => [$to, $linked, $hint, $empty]) {
if (!isset($location_tabs[$pane])) {
continue;
} ?>
<div class="tab-pane fade" id="location-pane-<?= $pane ?>" role="tabpanel">
<div class="itflow-asset-pane-bar">
<span class="text-body-secondary small"><?= $hint ?></span>