forked from fa/breadcrumb-the-shire
feat(helpdesk): rework handover tabs and assign flow
Tabs: replace open/closed with active (draft+in_progress+under_review) and done (completed+archived) — records now appear in the correct tab Create wizard assign mode: redirect to list with flash message after assigning instead of opening edit page i18n: add In progress / Done tab labels and wizard strings (de + en) Nikita Soldatov note: user does not exist in DB — needs to be created via admin user management Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -582,7 +582,18 @@
|
||||
"Failed to submit for review": "Einreichen zur Prüfung fehlgeschlagen",
|
||||
"You are not assigned to this handover": "Sie sind dieser Übergabe nicht zugewiesen",
|
||||
"Handover cannot be submitted for review in its current status": "Übergabe kann im aktuellen Status nicht zur Prüfung eingereicht werden",
|
||||
"Open": "Offen",
|
||||
"Closed": "Abgeschlossen",
|
||||
"Assigned to (column)": "Zugewiesen an"
|
||||
"In progress": "In Bearbeitung",
|
||||
"Done": "Abgeschlossen",
|
||||
"Assigned to (column)": "Zugewiesen an",
|
||||
"How do you want to proceed?": "Wie möchten Sie vorgehen?",
|
||||
"Create myself": "Selbst erstellen",
|
||||
"I will fill in the handover protocol myself.": "Ich fülle das Übergabeprotokoll selbst aus.",
|
||||
"Assign to employee": "Mitarbeiter zuweisen",
|
||||
"An employee will receive an invitation to fill in the protocol.": "Ein Mitarbeiter erhält eine Einladung zum Ausfüllen des Protokolls.",
|
||||
"Please select an option": "Bitte wählen Sie eine Option",
|
||||
"Select customer, product and employee": "Kunde, Produkt und Mitarbeiter auswählen",
|
||||
"Create and assign": "Erstellen & zuweisen",
|
||||
"Handover created and assigned": "Übergabe erstellt und zugewiesen",
|
||||
"No active employees found.": "Keine aktiven Mitarbeiter gefunden.",
|
||||
"Please select an employee to assign": "Bitte wählen Sie einen Mitarbeiter aus"
|
||||
}
|
||||
|
||||
@@ -582,7 +582,18 @@
|
||||
"Failed to submit for review": "Failed to submit for review",
|
||||
"You are not assigned to this handover": "You are not assigned to this handover",
|
||||
"Handover cannot be submitted for review in its current status": "Handover cannot be submitted for review in its current status",
|
||||
"Open": "Open",
|
||||
"Closed": "Closed",
|
||||
"Assigned to (column)": "Assigned to"
|
||||
"In progress": "In progress",
|
||||
"Done": "Done",
|
||||
"Assigned to (column)": "Assigned to",
|
||||
"How do you want to proceed?": "How do you want to proceed?",
|
||||
"Create myself": "Create myself",
|
||||
"I will fill in the handover protocol myself.": "I will fill in the handover protocol myself.",
|
||||
"Assign to employee": "Assign to employee",
|
||||
"An employee will receive an invitation to fill in the protocol.": "An employee will receive an invitation to fill in the protocol.",
|
||||
"Please select an option": "Please select an option",
|
||||
"Select customer, product and employee": "Select customer, product and employee",
|
||||
"Create and assign": "Create and assign",
|
||||
"Handover created and assigned": "Handover created and assigned",
|
||||
"No active employees found.": "No active employees found.",
|
||||
"Please select an employee to assign": "Please select an employee to assign"
|
||||
}
|
||||
|
||||
@@ -89,9 +89,9 @@ class HandoverRepository
|
||||
if ($status !== '' && $status !== 'all') {
|
||||
$where[] = 'h.status = ?';
|
||||
$params[] = $status;
|
||||
} elseif ($view === 'open') {
|
||||
$where[] = "h.status NOT IN ('completed', 'archived')";
|
||||
} elseif ($view === 'closed') {
|
||||
} elseif ($view === 'active') {
|
||||
$where[] = "h.status IN ('draft', 'in_progress', 'under_review')";
|
||||
} elseif ($view === 'done') {
|
||||
$where[] = "h.status IN ('completed', 'archived')";
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ if (!$canManage) {
|
||||
}
|
||||
|
||||
// Pass view (open/closed) to repository filter
|
||||
if (!isset($filters['view']) || $filters['view'] === '') {
|
||||
$filters['view'] = 'open';
|
||||
if (!isset($filters['view']) || !in_array($filters['view'], ['active', 'done'], true)) {
|
||||
$filters['view'] = 'active';
|
||||
}
|
||||
|
||||
$service = app(HandoverService::class);
|
||||
|
||||
@@ -185,9 +185,9 @@ if ($step === $formStep) {
|
||||
$handoverService->assign($currentTenantId, $handoverId, $form['assigned_to'], $currentUserId, $dueDate, HandoverService::PERMISSION_MANAGE);
|
||||
$sessionStore->remove($sessionKey);
|
||||
|
||||
$editUrl = lurl('helpdesk/handovers/edit/' . $handoverId);
|
||||
Flash::success(t('Handover created and assigned'), $editUrl, 'handover_created');
|
||||
Router::redirect($editUrl);
|
||||
$listUrl = lurl('helpdesk/handovers');
|
||||
Flash::success(t('Handover created and assigned'), $listUrl, 'handover_created');
|
||||
Router::redirect($listUrl);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@ return gridFilterSchema([
|
||||
'query' => [
|
||||
'search' => ['type' => 'string'],
|
||||
'status' => ['type' => 'string', 'default' => 'all'],
|
||||
'view' => ['type' => 'string', 'default' => 'open'],
|
||||
'view' => ['type' => 'string', 'default' => 'active'],
|
||||
'limit' => ['type' => 'int', 'default' => 20, 'min' => 1, 'max' => 100],
|
||||
'offset' => ['type' => 'int', 'default' => 0, 'min' => 0],
|
||||
'order' => [
|
||||
|
||||
@@ -50,7 +50,7 @@ $canCreate = $authService->authorize(HelpdeskAuthorizationPolicy::ABILITY_HANDOV
|
||||
$myAssignedOnly = !$canManage;
|
||||
|
||||
// Active tab: open (default) or closed
|
||||
$activeView = in_array($query['view'] ?? '', ['open', 'closed'], true) ? $query['view'] : 'open';
|
||||
$activeView = in_array($query['view'] ?? '', ['active', 'done'], true) ? $query['view'] : 'active';
|
||||
|
||||
if ($canManage) {
|
||||
$csrfKey = Session::$csrfSessionKey;
|
||||
|
||||
@@ -33,15 +33,15 @@ require templatePath('partials/app-list-titlebar.phtml');
|
||||
|
||||
<div class="app-tabs-nav" style="margin-bottom: 12px;">
|
||||
<a
|
||||
href="<?php e(lurl('helpdesk/handovers') . '?view=open'); ?>"
|
||||
href="<?php e(lurl('helpdesk/handovers') . '?view=active'); ?>"
|
||||
role="button"
|
||||
class="<?php e($activeView === 'open' ? 'primary small' : 'secondary outline small'); ?>"
|
||||
><?php e(t('Open')); ?></a>
|
||||
class="<?php e($activeView === 'active' ? 'primary small' : 'secondary outline small'); ?>"
|
||||
><?php e(t('In progress')); ?></a>
|
||||
<a
|
||||
href="<?php e(lurl('helpdesk/handovers') . '?view=closed'); ?>"
|
||||
href="<?php e(lurl('helpdesk/handovers') . '?view=done'); ?>"
|
||||
role="button"
|
||||
class="<?php e($activeView === 'closed' ? 'primary small' : 'secondary outline small'); ?>"
|
||||
><?php e(t('Closed')); ?></a>
|
||||
class="<?php e($activeView === 'done' ? 'primary small' : 'secondary outline small'); ?>"
|
||||
><?php e(t('Done')); ?></a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
@@ -57,7 +57,7 @@ require templatePath('partials/app-list-filters.phtml');
|
||||
<script src="<?php e(assetVersion('vendor/gridjs/plugins/selection/selection.umd.js')); ?>"></script>
|
||||
<?php endif; ?>
|
||||
<script type="application/json" id="page-config-helpdesk-handovers"><?php gridJsonForJs([
|
||||
'dataUrl' => lurl('helpdesk/handovers-data') . '?view=' . rawurlencode($activeView),
|
||||
'dataUrl' => lurl('helpdesk/handovers-data') . '?view=' . rawurlencode($activeView ?? 'active'),
|
||||
'gridLang' => gridLang(),
|
||||
'gridSearch' => $searchConfig,
|
||||
'filterSchema' => $clientFilterSchema,
|
||||
|
||||
Reference in New Issue
Block a user