Create Workorder button in Preorder/Index now always visible for admins

This commit is contained in:
Frank Schubert
2024-11-19 15:25:44 +01:00
parent 25f2452f02
commit 77f37fbc27
4 changed files with 10 additions and 5 deletions
@@ -430,7 +430,7 @@
</table> </table>
<?php endforeach; ?> <?php endforeach; ?>
<?php elseif($preorder->adb_wohneinheit_id && $preorder->type == "legacytransfer"): ?> <?php elseif($preorder->adb_wohneinheit_id && $me->is("Admin")): ?>
<button type="button" class="btn btn-outline-primary create-workorder" onclick="createWorkorder(<?=$preorder->id?>)"><i class="fas fa-fw fa-plus"></i> <i class="fas fa-r"></i><i class="fas fa-fw fa-gears"></i> Wokorder erstellen</button> <button type="button" class="btn btn-outline-primary create-workorder" onclick="createWorkorder(<?=$preorder->id?>)"><i class="fas fa-fw fa-plus"></i> <i class="fas fa-r"></i><i class="fas fa-fw fa-gears"></i> Wokorder erstellen</button>
<?php endif; ?> <?php endif; ?>
+4 -2
View File
@@ -101,8 +101,10 @@ class Preorder extends mfBaseModel {
} }
} }
foreach($this->getProperty("adb_wohneinheit")->rimo_workorders as $workorder) { if($this->adb_wohneinheit_id && is_array($this->getProperty("adb_wohneinheit")->rimo_workorders)) {
Rimoapi::updateWorkorder($workorder->rimo_id, $update); foreach($this->getProperty("adb_wohneinheit")->rimo_workorders as $workorder) {
Rimoapi::updateWorkorder($workorder->rimo_id, $update);
}
} }
return true; return true;
+4 -1
View File
@@ -1289,7 +1289,10 @@ class PreorderController extends mfBaseController {
return false; return false;
} }
if($preorder->type != "legacytransfer") { /*if($preorder->type != "legacytransfer") {
return false;
}*/
if(!$this->me->is("Admin")) {
return false; return false;
} }
@@ -71,7 +71,7 @@ class AddressHelper
if (array_key_exists(3, $m)) { if (array_key_exists(3, $m)) {
$addresszusatz = trim($m[3]); $addresszusatz = trim($m[3]);
} }
} elseif (preg_match('/^(\D+)\s+(\d+[a-z0-9\/&#._-]*)(?:\s+((?:gesch(?:ae|ä)ft|werkstatt|betrieb und wohnungen|stg|paketlogistik|cafe|pavillon|pfarrheim|[^ ]*haus|[^ ]*geb(?:ae|ä)ude|[^ ]*halle|[^ ]*schule|Öhlmühle)(?:\s+[a-z0-9]+)?))?/i', $strasse_hausnummer, $m)) { } elseif (preg_match('/^(\D+)\s+(\d+[a-z0-9\/&#._-]*)(?:\s+((?:gesch(?:ae|ä)ft|werkstatt|schmiede|betrieb und wohnungen|stg|paketlogistik|cafe|pavillon|pfarrheim|[^ ]*haus|[^ ]*geb(?:ae|ä)ude|[^ ]*halle|[^ ]*schule|Öhlmühle)(?:\s+[a-z0-9]+)?))?/i', $strasse_hausnummer, $m)) {
$strasse_name = trim($m[1]); $strasse_name = trim($m[1]);
$hausnummer_name = trim($m[2]); $hausnummer_name = trim($m[2]);
if (array_key_exists(3, $m)) { if (array_key_exists(3, $m)) {