Initial commit

This commit is contained in:
gsinghpal
2026-02-22 01:22:18 -05:00
commit 5200d5baf0
2394 changed files with 386834 additions and 0 deletions

View File

@@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024-2025 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Claim Assistant product family.
-->
<templates xml:space="preserve">
<!-- PDF Document Preview Dialog -->
<t t-name="fusion_claims.DocumentPreviewDialog">
<Dialog size="getDialogSize()" footer="false">
<t t-set-slot="header">
<div class="d-flex align-items-center justify-content-between w-100">
<div style="width: 50px"></div>
<h4 class="modal-title text-break fw-normal mb-0">
<i class="fa fa-file-pdf-o me-2 text-danger"/>
<t t-esc="props.title" />
</h4>
<div class="d-flex align-items-center gap-1">
<button type="button" class="btn btn-sm btn-outline-secondary"
t-on-click="toggleMaximize"
t-att-title="state.isMaximized ? 'Exit Fullscreen' : 'Fullscreen'">
<i t-attf-class="fa {{ state.isMaximized ? 'fa-compress' : 'fa-expand' }}" />
</button>
<a t-att-href="getViewerUrl()"
target="_blank"
class="btn btn-sm btn-outline-primary"
title="Open in New Tab">
<i class="fa fa-external-link"/>
</a>
<button type="button" class="btn-close ms-2" t-on-click="props.close"/>
</div>
</div>
</t>
<div class="position-relative bg-secondary">
<!-- Loading spinner -->
<div t-if="state.isLoading"
class="position-absolute w-100 h-100 d-flex justify-content-center align-items-center bg-light"
style="z-index: 10; min-height: 400px;">
<div class="text-center">
<div class="spinner-border text-primary mb-3" role="status" style="width: 3rem; height: 3rem;">
<span class="visually-hidden">Loading...</span>
</div>
<p class="text-muted mb-0">Loading document...</p>
</div>
</div>
<!-- PDF.js viewer iframe - handles XFA/protected PDFs -->
<iframe t-att-src="getViewerUrl()"
class="border-0"
t-att-style="getFrameStyle()"
t-on-load="onIframeLoad"
allowfullscreen="true" />
</div>
</Dialog>
</t>
<!-- XML Viewer Dialog -->
<t t-name="fusion_claims.XMLViewerDialog">
<Dialog size="getDialogSize()" footer="false">
<t t-set-slot="header">
<div class="d-flex align-items-center justify-content-between w-100">
<div style="width: 50px"></div>
<h4 class="modal-title text-break fw-normal mb-0">
<i class="fa fa-file-code-o me-2 text-info"/>
<t t-esc="props.title" />
</h4>
<div class="d-flex align-items-center gap-1">
<button type="button" class="btn btn-sm btn-outline-secondary"
t-on-click="copyToClipboard"
title="Copy to Clipboard">
<i class="fa fa-clipboard"/>
</button>
<button type="button" class="btn btn-sm btn-outline-secondary"
t-on-click="toggleMaximize"
t-att-title="state.isMaximized ? 'Exit Fullscreen' : 'Fullscreen'">
<i t-attf-class="fa {{ state.isMaximized ? 'fa-compress' : 'fa-expand' }}" />
</button>
<button type="button" class="btn btn-sm btn-outline-primary"
t-on-click="downloadXml"
title="Download XML">
<i class="fa fa-download"/>
</button>
<button type="button" class="btn-close ms-2" t-on-click="props.close"/>
</div>
</div>
</t>
<div class="position-relative">
<!-- Loading spinner -->
<div t-if="state.isLoading"
class="d-flex justify-content-center align-items-center bg-light"
style="min-height: 400px;">
<div class="text-center">
<div class="spinner-border text-primary mb-3" role="status" style="width: 3rem; height: 3rem;">
<span class="visually-hidden">Loading...</span>
</div>
<p class="text-muted mb-0">Loading XML...</p>
</div>
</div>
<!-- Error message -->
<div t-if="state.error" class="alert alert-danger m-3">
<i class="fa fa-exclamation-triangle me-2"/>
<t t-esc="state.error"/>
</div>
<!-- XML content with syntax highlighting -->
<div t-if="!state.isLoading and !state.error"
class="xml-viewer-content"
t-att-style="state.isMaximized ? 'height: calc(98vh - 120px);' : 'height: calc(85vh - 120px);'">
<pre class="xml-code m-0 p-3"><code t-out="state.formattedXml"/></pre>
</div>
</div>
</Dialog>
</t>
<!-- Image Preview Dialog -->
<t t-name="fusion_claims.ImagePreviewDialog">
<Dialog size="'xl'" footer="false">
<t t-set-slot="header">
<div class="d-flex align-items-center justify-content-between w-100">
<div style="width: 100px">
<span t-if="hasMultiple" class="badge bg-secondary">
<t t-esc="currentPosition"/>
</span>
</div>
<h4 class="modal-title text-break fw-normal mb-0">
<i class="fa fa-image me-2 text-success"/>
<t t-esc="currentImage.name" />
</h4>
<div class="d-flex align-items-center gap-1">
<button type="button" class="btn btn-sm btn-outline-primary"
t-on-click="downloadImage"
title="Download Image">
<i class="fa fa-download"/>
</button>
<button type="button" class="btn-close ms-2" t-on-click="props.close"/>
</div>
</div>
</t>
<div class="position-relative d-flex align-items-center justify-content-center bg-dark"
style="min-height: 500px; max-height: 80vh;">
<!-- Loading spinner -->
<div t-if="state.isLoading"
class="position-absolute w-100 h-100 d-flex justify-content-center align-items-center"
style="z-index: 10;">
<div class="spinner-border text-light" role="status" style="width: 3rem; height: 3rem;">
<span class="visually-hidden">Loading...</span>
</div>
</div>
<!-- Previous button -->
<button t-if="hasMultiple and state.currentIndex > 0"
type="button"
class="btn btn-dark btn-lg position-absolute start-0 ms-3"
style="z-index: 20; opacity: 0.7;"
t-on-click="previousImage">
<i class="fa fa-chevron-left fa-2x"/>
</button>
<!-- Image -->
<img t-att-src="imageUrl"
class="mw-100 mh-100"
style="object-fit: contain; max-height: 75vh;"
t-on-load="onImageLoad"
t-att-alt="currentImage.name"/>
<!-- Next button -->
<button t-if="hasMultiple and state.currentIndex &lt; props.images.length - 1"
type="button"
class="btn btn-dark btn-lg position-absolute end-0 me-3"
style="z-index: 20; opacity: 0.7;"
t-on-click="nextImage">
<i class="fa fa-chevron-right fa-2x"/>
</button>
</div>
<!-- Thumbnail strip for multiple images -->
<div t-if="hasMultiple" class="d-flex justify-content-center gap-2 p-3 bg-secondary">
<t t-foreach="props.images" t-as="img" t-key="img.id">
<div t-att-class="'border-2 rounded overflow-hidden cursor-pointer ' + (img_index === state.currentIndex ? 'border-primary' : 'border-transparent')"
style="width: 60px; height: 60px; cursor: pointer;"
t-on-click="() => { this.state.isLoading = true; this.state.currentIndex = img_index; }">
<img t-att-src="'/web/image/' + img.id + '?height=60'"
class="w-100 h-100"
style="object-fit: cover;"/>
</div>
</t>
</div>
</Dialog>
</t>
<!-- Preview Button Widget (no-save, client-side only) -->
<t t-name="fusion_claims.PreviewButtonWidget">
<button type="button"
class="btn btn-link p-0 border-0"
title="Preview"
t-on-click="onClick">
<i class="fa fa-eye"/>
</button>
</t>
</templates>

View File

@@ -0,0 +1,218 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="fusion_claims.FusionTaskMapView">
<div class="o_fusion_task_map_view">
<Layout display="display">
<t t-set-slot="control-panel-additional-actions">
<CogMenu/>
</t>
<t t-set-slot="layout-buttons">
<t t-call="{{ props.buttonTemplate }}"/>
</t>
<t t-set-slot="layout-actions">
<SearchBar toggler="searchBarToggler"/>
</t>
<t t-set-slot="control-panel-navigation-additional">
<t t-component="searchBarToggler.component" t-props="searchBarToggler.props"/>
</t>
<div class="fc_map_wrapper">
<!-- ========== SIDEBAR ========== -->
<div t-att-class="'fc_sidebar' + (state.sidebarOpen ? '' : ' fc_sidebar--collapsed')">
<!-- Sidebar header -->
<div class="fc_sidebar_header">
<div class="d-flex align-items-center justify-content-between">
<h6 class="mb-0 fw-bold">
<i class="fa fa-list-ul me-2"/>Deliveries
<span class="badge text-bg-primary ms-1" t-esc="state.taskCount"/>
</h6>
<button class="btn btn-sm btn-link text-muted p-0" t-on-click="toggleSidebar"
title="Toggle sidebar">
<i t-att-class="'fa ' + (state.sidebarOpen ? 'fa-chevron-left' : 'fa-chevron-right')"/>
</button>
</div>
<!-- New task button -->
<button class="btn btn-primary btn-sm w-100 mt-2" t-on-click="createNewTask">
<i class="fa fa-plus me-1"/>New Delivery Task
</button>
<!-- Day filter chips -->
<div class="fc_day_filters mt-2">
<t t-foreach="state.groups" t-as="group" t-key="group.key + '_filter'">
<button t-att-class="'fc_day_chip' + (isGroupVisible(group.key) ? ' fc_day_chip--active' : '')"
t-att-style="isGroupVisible(group.key) ? 'background:' + group.dayColor + ';color:#fff;border-color:' + group.dayColor : ''"
t-on-click="() => this.toggleDayFilter(group.key)">
<t t-esc="group.label"/>
<span class="fc_day_chip_count" t-esc="group.count"/>
</button>
</t>
<button class="fc_day_chip fc_day_chip--all" t-on-click="showAllDays"
title="Show all">All</button>
</div>
</div>
<!-- Sidebar body: grouped task list -->
<div class="fc_sidebar_body">
<t t-foreach="state.groups" t-as="group" t-key="group.key">
<!-- Group header (collapsible) with day color -->
<div class="fc_group_header" t-on-click="() => this.toggleGroup(group.key)">
<i t-att-class="'fa me-1 ' + (isGroupCollapsed(group.key) ? 'fa-caret-right' : 'fa-caret-down')"/>
<i class="fa fa-circle me-1" style="font-size:8px;"
t-att-style="'color:' + group.dayColor"/>
<span class="fc_group_label" t-esc="group.label"/>
<span t-if="!isGroupVisible(group.key)" class="fc_group_hidden_tag">hidden</span>
<span class="fc_group_badge" t-esc="group.count"/>
</div>
<!-- Group tasks -->
<div t-if="!isGroupCollapsed(group.key)" class="fc_group_tasks">
<t t-foreach="group.tasks" t-as="task" t-key="task.id">
<div t-att-class="'fc_task_card' + (state.activeTaskId === task.id ? ' fc_task_card--active' : '')"
t-on-click="() => this.focusTask(task.id)">
<!-- Card top row: number + status -->
<div class="fc_task_card_top">
<span class="fc_task_num" t-att-style="'background:' + task._dayColor">
<t t-esc="'#' + task._scheduleNum"/>
</span>
<span class="fc_task_status" t-att-style="'color:' + task._statusColor">
<i t-att-class="'fa ' + task._statusIcon" style="margin-right:3px;"/>
<t t-esc="task._statusLabel"/>
</span>
</div>
<!-- Client name -->
<div class="fc_task_client" t-esc="task._clientName"/>
<!-- Type + time -->
<div class="fc_task_meta">
<span><i class="fa fa-tag me-1"/><t t-esc="task._typeLbl"/></span>
<span><i class="fa fa-clock-o me-1"/><t t-esc="task._timeRange"/></span>
</div>
<!-- Technician + address -->
<div class="fc_task_detail">
<span><i class="fa fa-user me-1"/><t t-esc="task._techName"/></span>
</div>
<div t-if="task.address_display" class="fc_task_address">
<i class="fa fa-map-marker me-1"/>
<t t-esc="task.address_display"/>
</div>
<!-- Travel badge -->
<div t-if="task.travel_time_minutes" class="fc_task_travel">
<i class="fa fa-car me-1"/>
<t t-esc="task.travel_time_minutes"/> min travel
</div>
</div>
</t>
</div>
</t>
<!-- Empty state -->
<div t-if="state.groups.length === 0 and !state.loading" class="fc_sidebar_empty">
<i class="fa fa-inbox fa-2x text-muted d-block mb-2"/>
<span class="text-muted">No tasks found</span>
</div>
</div>
<!-- Sidebar footer: technician count -->
<div class="fc_sidebar_footer">
<div class="d-flex align-items-center gap-2">
<svg width="14" height="14" viewBox="0 0 48 48">
<rect x="2" y="2" width="44" height="44" rx="12" ry="12" fill="#1d4ed8" stroke="#fff" stroke-width="3"/>
<text x="24" y="30" text-anchor="middle" fill="#fff" font-size="17" font-family="Arial,sans-serif" font-weight="bold">T</text>
</svg>
<small class="text-muted">
<t t-esc="state.techCount"/> technician(s) online
</small>
</div>
</div>
</div>
<!-- Collapsed sidebar toggle -->
<button t-if="!state.sidebarOpen"
class="fc_sidebar_toggle_btn" t-on-click="toggleSidebar"
title="Open sidebar">
<i class="fa fa-chevron-right"/>
</button>
<!-- ========== MAP AREA ========== -->
<div class="fc_map_area">
<!-- Legend bar -->
<div class="fc_map_legend_bar d-flex align-items-center gap-3 px-3 py-2 border-bottom bg-view flex-wrap">
<button class="btn btn-sm d-flex align-items-center gap-1"
t-att-class="state.showTasks ? 'btn-primary' : 'btn-outline-secondary'"
t-on-click="toggleTasks">
<i class="fa fa-map-marker"/>Tasks
<span class="badge text-bg-secondary ms-1" t-esc="state.taskCount"/>
</button>
<button class="btn btn-sm d-flex align-items-center gap-1"
t-att-class="state.showTechnicians ? 'btn-primary' : 'btn-outline-secondary'"
t-on-click="toggleTechnicians">
<i class="fa fa-user"/>Techs
<span class="badge text-bg-secondary ms-1" t-esc="state.techCount"/>
</button>
<span class="border-start mx-1" style="height:20px;"/>
<span class="text-muted fw-bold" style="font-size:11px;">Pins:</span>
<span style="font-size:11px;"><i class="fa fa-map-marker me-1" style="color:#ef4444;"/>Today</span>
<span style="font-size:11px;"><i class="fa fa-map-marker me-1" style="color:#3b82f6;"/>Tomorrow</span>
<span style="font-size:11px;"><i class="fa fa-map-marker me-1" style="color:#10b981;"/>This Week</span>
<span style="font-size:11px;"><i class="fa fa-map-marker me-1" style="color:#a855f7;"/>Upcoming</span>
<span style="font-size:11px;"><i class="fa fa-map-marker me-1" style="color:#9ca3af;"/>Yesterday</span>
<span class="flex-grow-1"/>
<button class="btn btn-sm d-flex align-items-center gap-1"
t-att-class="state.showTraffic ? 'btn-warning' : 'btn-outline-secondary'"
t-on-click="toggleTraffic" title="Toggle traffic layer">
<i class="fa fa-car"/>Traffic
</button>
<button class="btn btn-outline-secondary btn-sm" t-on-click="onRefresh" title="Refresh">
<i class="fa fa-refresh" t-att-class="{'fa-spin': state.loading}"/>
</button>
</div>
<!-- Map container -->
<div class="fc_map_container">
<div t-ref="mapContainer" style="position:absolute;top:0;left:0;right:0;bottom:0;"/>
<!-- Loading -->
<div t-if="state.loading"
class="position-absolute top-0 start-0 w-100 h-100 d-flex justify-content-center align-items-center"
style="z-index:10;background:rgba(255,255,255,.92);">
<div class="text-center">
<i class="fa fa-spinner fa-spin fa-3x text-primary mb-3 d-block"/>
<span class="text-muted">Loading Google Maps...</span>
</div>
</div>
<!-- Error -->
<div t-if="state.error"
class="position-absolute top-0 start-0 w-100 h-100 d-flex justify-content-center align-items-center"
style="z-index:10;background:rgba(255,255,255,.92);">
<div class="alert alert-danger m-4" role="alert">
<i class="fa fa-exclamation-triangle me-2"/><t t-esc="state.error"/>
</div>
</div>
<!-- Empty -->
<div t-if="!state.loading and !state.error and state.taskCount === 0 and state.techCount === 0"
class="position-absolute top-50 start-50 translate-middle text-center" style="z-index:5;">
<div class="bg-white rounded-3 shadow p-4">
<i class="fa fa-map-marker fa-3x text-muted mb-3 d-block"/>
<h5>No locations to show</h5>
<p class="text-muted mb-0">Try adjusting the filters or date range.</p>
</div>
</div>
</div>
</div>
</div>
</Layout>
</div>
</t>
<t t-name="fusion_claims.FusionTaskMapView.Buttons"/>
</templates>