Autosave: 20260804-000549
This commit is contained in:
parent
d2738a2add
commit
12a6d00ac6
@ -317,7 +317,7 @@ function cc_test_panel_orders_signature(array $orders): string
|
||||
return sha1(json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
}
|
||||
|
||||
$view = $_GET['view'] ?? 'pendientes_hoy';
|
||||
$view = trim((string) ($_GET['view'] ?? ''));
|
||||
|
||||
$storeKey = trim((string) ($_GET['store'] ?? 'flower'));
|
||||
$storeKey = mb_strtolower($storeKey);
|
||||
@ -339,6 +339,7 @@ $isMainTuaniStore = cc_test_is_tuani_main_store_key($storeKey);
|
||||
$isTuaniRecuperablesStore = $storeKey === 'tuani_recuperables';
|
||||
$canShowTuaniLogisticaButton = $isMainTuaniStore || $isTuaniRecuperablesStore;
|
||||
$viewCardColumnClass = $isTuaniRecuperablesStore ? 'col-md-6 col-xl-2' : 'col-md-6 col-xl-2';
|
||||
$defaultView = cc_test_callcenter_pro_default_view_key($storeKey);
|
||||
|
||||
$viewCards = $isTuaniRecuperablesStore ? [
|
||||
'pendientes_hoy' => [
|
||||
@ -444,8 +445,11 @@ $allowedViews = [];
|
||||
foreach ($viewCards as $viewKey => $cardConfig) {
|
||||
$allowedViews[$viewKey] = $cardConfig['heading'];
|
||||
}
|
||||
if ($view === '') {
|
||||
$view = $defaultView;
|
||||
}
|
||||
if (!isset($allowedViews[$view])) {
|
||||
$view = array_key_first($allowedViews) ?: 'pendientes_hoy';
|
||||
$view = isset($allowedViews[$defaultView]) ? $defaultView : (array_key_first($allowedViews) ?: 'pendientes_hoy');
|
||||
}
|
||||
|
||||
$_SESSION[cc_test_callcenter_store_session_key()] = cc_test_normalize_context_key($storeKey);
|
||||
@ -1335,7 +1339,7 @@ require_once 'layout_header.php';
|
||||
<span class="badge rounded-pill text-bg-light border px-3 py-2">Drive detectado: <?php echo (int) $totalRows; ?> filas</span>
|
||||
<span class="badge rounded-pill text-bg-light border px-3 py-2">Agregados: <?php echo (int) $agregadosCount; ?></span>
|
||||
<span class="badge rounded-pill text-bg-light border px-3 py-2"><?php if ($usesIncrementalSync && $lastProcessedRow !== null): ?><?php echo htmlspecialchars(mb_strtoupper($storeLabel)); ?>: distribución desde fila <?php echo (int) ($storeConfig['startRow'] ?? $startRow); ?> · último procesado <?php echo (int) $lastProcessedRow; ?><?php else: ?>Extracción: desde fila <?php echo (int) $startRow; ?><?php endif; ?></span>
|
||||
<span class="badge rounded-pill text-bg-light border px-3 py-2">Actualización en vivo cada 10 min</span>
|
||||
<span class="badge rounded-pill text-bg-light border px-3 py-2">Actualización en vivo cada 5 min</span>
|
||||
<a href="test_importar_drive.php?store=<?php echo htmlspecialchars($storeKey); ?>" class="btn btn-outline-primary btn-sm">Ver vista previa Drive</a>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="return ccCallCenterPanelRefreshNow(event);"><i class="bi bi-arrow-clockwise me-1"></i>Actualizar pedidos</button>
|
||||
</div>
|
||||
@ -2297,7 +2301,7 @@ ccCallCenterPanelBaseUrl.hash = '';
|
||||
const ccCallCenterPanelRefreshUrl = new URL(ccCallCenterPanelBaseUrl.toString());
|
||||
ccCallCenterPanelRefreshUrl.searchParams.set('ajax_refresh', '1');
|
||||
const ccCallCenterPanelInitialSignature = <?php echo json_encode((string) ($panelOrdersSignature ?? ''), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>;
|
||||
const ccCallCenterPanelRefreshMs = 600000;
|
||||
const ccCallCenterPanelRefreshMs = 300000;
|
||||
let ccCallCenterPanelRefreshInFlight = false;
|
||||
let ccCallCenterPanelLastSignature = ccCallCenterPanelInitialSignature;
|
||||
|
||||
|
||||
@ -235,6 +235,7 @@ $isMainTuaniStore = cc_test_is_tuani_main_store_key($storeKey);
|
||||
$isTuaniRecuperablesStore = $storeKey === 'tuani_recuperables';
|
||||
$canShowTuaniLogisticaButton = $isMainTuaniStore || $isTuaniRecuperablesStore;
|
||||
$viewCardColumnClass = $isTuaniRecuperablesStore ? 'col-md-6 col-xl-2' : 'col-md-6 col-xl-2';
|
||||
$callCenterDefaultView = $isMainTuaniStore ? cc_test_callcenter_pro_default_view_key($storeKey) : $view;
|
||||
|
||||
$viewCards = $isTuaniRecuperablesStore ? [
|
||||
'pendientes_hoy' => [
|
||||
@ -1562,7 +1563,7 @@ require_once 'layout_header.php';
|
||||
<h1 class="h2 fw-bold mb-1"><i class="bi bi-headset text-primary"></i> Base de Datos Pedidos</h1>
|
||||
<div class="d-flex flex-wrap gap-2 mt-3">
|
||||
<a href="<?php echo htmlspecialchars(cc_test_build_url('gestiones_callcenter.php', array_merge(['view' => 'pendientes_hoy', 'store' => $storeKey], $persistedAssessorParams))); ?>" class="btn btn-sm <?php echo $view !== 'todos' ? 'btn-primary' : 'btn-outline-primary'; ?>">Bandeja principal</a>
|
||||
<a href="<?php echo htmlspecialchars(cc_test_build_url('call_center_pro.php', array_merge(['view' => $view, 'store' => $storeKey], $persistedAssessorParams))); ?>" class="btn btn-sm btn-outline-dark"><?php echo htmlspecialchars($callCenterSectionLabel); ?></a>
|
||||
<a href="<?php echo htmlspecialchars(cc_test_build_url('call_center_pro.php', array_merge(['view' => $callCenterDefaultView, 'store' => $storeKey], $persistedAssessorParams))); ?>" class="btn btn-sm btn-outline-dark"><?php echo htmlspecialchars($callCenterSectionLabel); ?></a>
|
||||
</div>
|
||||
<ul class="nav nav-pills mt-3 flex-wrap gap-2" role="tablist" aria-label="Selector de tienda">
|
||||
<?php foreach ($storeNavGroups as $groupKey => $group): ?>
|
||||
@ -2739,15 +2740,15 @@ require_once 'layout_header.php';
|
||||
<div class="mb-3">
|
||||
<label for="ccAssessorColorInput" class="form-label">Color</label>
|
||||
<div class="d-flex align-items-center gap-3 flex-wrap">
|
||||
<input type="color" class="form-control form-control-color" id="ccAssessorColorInput" name="color_hex" value="#0D6EFD" title="Elegir color">
|
||||
<code class="small" id="ccAssessorColorHexText">#0D6EFD</code>
|
||||
<input type="color" class="form-control form-control-color" id="ccAssessorColorInput" name="color_hex" value="#99EAFD" title="Elegir color">
|
||||
<code class="small" id="ccAssessorColorHexText">#99EAFD</code>
|
||||
</div>
|
||||
<div class="form-text">Este color se aplicará a la franja, al badge y al panel de rendimiento de la asesora.</div>
|
||||
</div>
|
||||
<div class="rounded-4 border p-3" id="ccAssessorColorPreview">
|
||||
<div class="small text-muted">Vista previa</div>
|
||||
<div class="fw-semibold mt-1" id="ccAssessorColorPreviewLabel">Asesora</div>
|
||||
<code class="small" id="ccAssessorColorPreviewHex">#0D6EFD</code>
|
||||
<code class="small" id="ccAssessorColorPreviewHex">#99EAFD</code>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer d-flex justify-content-between flex-wrap gap-2">
|
||||
|
||||
@ -73,11 +73,12 @@ function cc_test_assessor_default_color_hex(string $assessorKey): string
|
||||
return '#6C757D';
|
||||
}
|
||||
|
||||
$palette = ['#0D6EFD', '#198754', '#FD7E14', '#DC3545', '#20C997', '#FFC107', '#D63384'];
|
||||
$palette = ['#F97316', '#198754', '#FD7E14', '#DC3545', '#20C997', '#FFC107', '#D63384'];
|
||||
$paletteIndex = abs((int) crc32($normalizedKey)) % count($palette);
|
||||
|
||||
return match ($normalizedKey) {
|
||||
'KARINA' => '#0D6EFD',
|
||||
'KARINA' => '#99EAFD',
|
||||
'ROSA' => '#0D6EFD',
|
||||
'ESTEFANYA' => '#198754',
|
||||
'CARMEN' => '#FF00FF',
|
||||
'MIRELLA' => '#EFBF04',
|
||||
@ -260,6 +261,11 @@ function cc_test_is_tuani_main_store_key(string $storeKey): bool
|
||||
return in_array($storeKey, ['flower', 'otra_tienda'], true);
|
||||
}
|
||||
|
||||
function cc_test_callcenter_pro_default_view_key(string $storeKey): string
|
||||
{
|
||||
return cc_test_is_tuani_main_store_key($storeKey) ? 'ultimos_3_dias' : 'pendientes_hoy';
|
||||
}
|
||||
|
||||
if (!function_exists('cc_test_normalize_phone_digits')) {
|
||||
function cc_test_normalize_phone_digits(string $value): string
|
||||
{
|
||||
|
||||
@ -56,7 +56,8 @@ if ($currentCallCenterStore !== '') {
|
||||
if ($currentCallCenterView !== '') {
|
||||
$callCenterPersistentParams['view'] = $currentCallCenterView;
|
||||
}
|
||||
$appendCallCenterParams = static function (string $url) use ($callCenterPersistentParams): string {
|
||||
$callCenterProDefaultView = ($currentCallCenterStore !== '' && cc_test_is_tuani_main_store_key($currentCallCenterStore)) ? 'ultimos_3_dias' : '';
|
||||
$appendCallCenterParams = static function (string $url) use ($callCenterPersistentParams, $callCenterProDefaultView): string {
|
||||
if (empty($callCenterPersistentParams)) {
|
||||
return $url;
|
||||
}
|
||||
@ -65,7 +66,12 @@ $appendCallCenterParams = static function (string $url) use ($callCenterPersiste
|
||||
return $url;
|
||||
}
|
||||
|
||||
return $url . '?' . http_build_query($callCenterPersistentParams);
|
||||
$params = $callCenterPersistentParams;
|
||||
if ($url === 'call_center_pro.php' && $callCenterProDefaultView !== '') {
|
||||
$params['view'] = $callCenterProDefaultView;
|
||||
}
|
||||
|
||||
return $url . '?' . http_build_query($params);
|
||||
};
|
||||
|
||||
// Define navigation items for each role
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user