Buen día, quiero saber como puedo solucionar este problema de replica de una vista customizada en el view.list.php
// Codigo
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
// --- --- --- Services --- --- ---
require_once('customDev/src/Service/BodhPrestamoCajaService.php');
require_once('customDev/src/Service/globales/UtilidadesService.php');
// --- CRM
require_once('include/MVC/View/views/view.list.php');
// --- --- END Services --- --- ---
class bodh_inspeccion_cajaViewList extends ViewList{
private $oDataBase;
/**
* @see ViewList::preDisplay()
*/
function preDisplay(){
parent::preDisplay();
echo '<script>
let iconos = document.getElementsByClassName("suitepicon-action-edit");
for(let i = 0; iconos.length; i++){
iconos[i].parentElement.style.display="none"
}
</script>';
$this->oDataBase = DBManagerFactory::getInstance();
}
/**
* @see ViewList::listViewPrepare()
*/
function listViewPrepare() {
parent::ListViewPrepare();
// --- --- --- CRM --- --- --- //
global $GLOBALS;
global $mod_strings;
global $current_user;
$objACLRole = new ACLRole();
$oSugarSmarty = new Sugar_Smarty();
// --- customDev
$mod_strings['CTM_LBL_MODULE_ACTIVE'] = 'Inspección Caja de Herramienta';
$mod_strings['CTM_LBL_MODULE_HREF'] = 'bodh_inspeccion_caja';
$oUtilidadesService = new UtilidadesService();
$oBodhPrestamoCajaServ = new BodhPrestamoCajaService();
$aUsuarioRoles = $objACLRole->getUserRoles($current_user->id);
$bIsAdmin = is_admin($current_user);
$bAccesoModuloVista = false;
$sFechaActual = date('Y-m-d');
if( !$bIsAdmin || $bAccesoModuloVista ){
$aListaSubscripcion = $oUtilidadesService->getListaSubscripcion(
$this->oDataBase,
"b203d628-21ec-90d7-973c-643ed1927b5a"
);
$aAppListRoles = $GLOBALS['app_list_strings']['roles_list'];
$bAccesoModuloVista = $oUtilidadesService->getAccesoModuloVista(
$aListaSubscripcion['rolesAsignados'],
$aAppListRoles,
$aUsuarioRoles
);
}
if( $bIsAdmin || $bAccesoModuloVista ){
// --- --- --- Utilidades Globales Css --- --- ---
echo '<link rel="stylesheet" href="/customDev/public/assets/css/loader.css">';
echo '<link rel="stylesheet" href="/customDev/public/assets/css/utilidades.css">';
echo '<link rel="stylesheet" href="/customDev/public/assets/css/base-bootstrap5.css">';
// --- --- END Utilidades Globales Css --- --- ---
$sFechaMinima = date("Y-m-d", strtotime($sFechaActual."- 3 year"));
$aCajasHerramienta = $oBodhPrestamoCajaServ->getCajasHerramienta($this->oDataBase, "ch.date_entered >= '{$sFechaMinima}' ");
// var_dump('esta es la fecha minima para el filtro: '.$sFechaMinima); exit();
// --- sweetalert2
echo '<script src="/customDev/public/assets/sweetalert2/sweetalert2.js"></script>';
echo '<link rel="stylesheet" href="/customDev/public/assets/sweetalert2/sweetalert2.css">';
// --- daterangepicker
echo '<script src="/include/javascript/moment.min.js"></script>';
echo '<script src="/customDev/public/assets/daterangepicker/daterangepicker.js"></script>';
echo '<link rel="stylesheet" href="/customDev/public/assets/daterangepicker/daterangepicker.css">';
// --- bootstrap-select
echo '<link rel="stylesheet" href="/customDev/public/assets/bootstrap-select/bootstrap-select.css">';
echo '<script src="/customDev/public/assets/bootstrap-select/bootstrap-select.js"></script>';
// --- Utilidades Js - Css
echo '<script src="/customDev/public/assets/js/utilidades.js"></script>';
// --- Pasar variables PHP a JS
echo "<script>
var aDataPHP = {};
// Limites daterange
aDataPHP.dateRangeMinDate = '{$sFechaMinima}';
aDataPHP.dateRangeMaxDate = '{$sFechaActual}';
</script>";
// --- --- --- Renderizar HTML - Smarty --- --- ---
// --- Variables - Sugar Smarty
$oSugarSmarty->assign('aCajaHerramienta', $aCajasHerramienta);
// --- --- END Renderizar HTML - Smarty --- --- ---
echo $oSugarSmarty->fetch('customDev/templates/inspeccionCajaHerramienta/reporteInspeccion/index.html');
echo '<script src="/customDev/assets/inspeccionCajaHerramienta/reporteInspeccion/index.js"></script>';
// --- Pasar variables PHP a JS';
}
}
}
?>