| 1 | www | 1 | <?php
 | 
        
           | 11565 | efrain | 2 | $currentUserHelper    = $this->currentUserHelper();
 | 
        
           |  |  | 3 | $user = $currentUserHelper->getUser();
 | 
        
           |  |  | 4 | $company = $currentUserHelper->getCompany();
 | 
        
           | 1 | www | 5 |   | 
        
           |  |  | 6 | $notify = '';
 | 
        
           |  |  | 7 | $messages = $this->flashMessenger()->getInfoMessages();
 | 
        
           | 4686 | stevensc | 8 | foreach ($messages as $message) {
 | 
        
           |  |  | 9 | 	$notify .= "$.fn.showInfo('$message')";
 | 
        
           | 1 | www | 10 | }
 | 
        
           |  |  | 11 |   | 
        
           |  |  | 12 | $messages = $this->flashMessenger()->getSuccessMessages();
 | 
        
           | 4686 | stevensc | 13 | foreach ($messages as $message) {
 | 
        
           |  |  | 14 | 	$notify .= "$.fn.showSuccess('$message')";
 | 
        
           | 1 | www | 15 | }
 | 
        
           |  |  | 16 |   | 
        
           |  |  | 17 | $messages = $this->flashMessenger()->getWarningMessages();
 | 
        
           | 4686 | stevensc | 18 | foreach ($messages as $message) {
 | 
        
           |  |  | 19 | 	$notify .= " $.fn.showWarning('$message')";
 | 
        
           | 1 | www | 20 | }
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 | $messages = $this->flashMessenger()->getErrorMessages();
 | 
        
           | 4686 | stevensc | 23 | foreach ($messages as $message) {
 | 
        
           |  |  | 24 | 	$notify .= " $.fn.showError('$message')";
 | 
        
           | 1 | www | 25 | }
 | 
        
           |  |  | 26 |   | 
        
           | 4686 | stevensc | 27 | if ($notify) {
 | 
        
           |  |  | 28 | 	$this->inlineScript()->captureStart();
 | 
        
           |  |  | 29 | 	echo " jQuery( document ).ready(function( $ ) { $notify }); ";
 | 
        
           |  |  | 30 | 	$this->inlineScript()->captureEnd();
 | 
        
           | 1 | www | 31 | }
 | 
        
           |  |  | 32 |   | 
        
           | 15089 | efrain | 33 |   | 
        
           |  |  | 34 | $menu = [];
 | 
        
           |  |  | 35 |   | 
        
           | 9056 | stevensc | 36 | if ($company) {
 | 
        
           | 15089 | efrain | 37 | 	$baseMenu = getAclMenuCompany();
 | 
        
           | 9056 | stevensc | 38 | } else {
 | 
        
           | 15089 | efrain | 39 | 	$baseMenu= getAclMenuSystem();
 | 
        
           | 9056 | stevensc | 40 | }
 | 
        
           | 8922 | stevensc | 41 |   | 
        
           | 9056 | stevensc | 42 | if ($company) {
 | 
        
           |  |  | 43 | 	$names = explode(' ', $company->name);
 | 
        
           |  |  | 44 | 	$companyId = $company->uuid;
 | 
        
           |  |  | 45 | 	$companyName = $company->name;
 | 
        
           |  |  | 46 | 	$companyImg = $company->image;
 | 
        
           |  |  | 47 | }
 | 
        
           | 8922 | stevensc | 48 |   | 
        
           | 15089 | efrain | 49 | $session_usertype_id = $user->usertype_id;
 | 
        
           |  |  | 50 | $acl = $this->viewModel()->getCurrent()->getVariable('acl');
 | 
        
           | 9056 | stevensc | 51 |   | 
        
           | 15089 | efrain | 52 |   | 
        
           |  |  | 53 | foreach($baseMenu as $menuLevel1)
 | 
        
           |  |  | 54 | {
 | 
        
           |  |  | 55 |     if(!$acl->isAllowed($session_usertype_id ,  $menuLevel1['route'])) {
 | 
        
           |  |  | 56 |         continue;
 | 
        
           |  |  | 57 |     }
 | 
        
           |  |  | 58 |   | 
        
           |  |  | 59 |   | 
        
           |  |  | 60 |     $optionLevel1 = [
 | 
        
           |  |  | 61 |         'label' => $menuLevel1['label'],
 | 
        
           |  |  | 62 |         'route' => $menuLevel1['route'],
 | 
        
           |  |  | 63 |         'class' => empty($menuLevel1['class']) ? '' :  $menuLevel1['class'],
 | 
        
           |  |  | 64 |   | 
        
           |  |  | 65 |     ];
 | 
        
           |  |  | 66 |   | 
        
           |  |  | 67 |   | 
        
           |  |  | 68 |     if(!empty($menuLevel1['pages'])) {
 | 
        
           |  |  | 69 |   | 
        
           |  |  | 70 |   | 
        
           |  |  | 71 |   | 
        
           |  |  | 72 |   | 
        
           |  |  | 73 |         $optionLevel1['pages'] = [];
 | 
        
           |  |  | 74 |   | 
        
           |  |  | 75 |   | 
        
           |  |  | 76 |   | 
        
           |  |  | 77 |         foreach($menuLevel1['pages'] as $menuLevel2)
 | 
        
           |  |  | 78 |         {
 | 
        
           |  |  | 79 |   | 
        
           |  |  | 80 |             $optionLevel2 = [
 | 
        
           |  |  | 81 |                 'label' => $menuLevel2['label'],
 | 
        
           |  |  | 82 |                 'route' => $menuLevel2['route'],
 | 
        
           |  |  | 83 |                 'class' => empty($menuLevel2['class']) ? '' :  $menuLevel2['class'],
 | 
        
           |  |  | 84 |             ];
 | 
        
           |  |  | 85 |   | 
        
           |  |  | 86 |             if(!$acl->isAllowed($session_usertype_id ,  $menuLevel2['route'])) {
 | 
        
           |  |  | 87 |                continue;
 | 
        
           |  |  | 88 |             }
 | 
        
           |  |  | 89 |   | 
        
           |  |  | 90 |             if(!empty($menuLevel2['pages'])) {
 | 
        
           |  |  | 91 |                 $optionLevel2['pages'] = [];
 | 
        
           |  |  | 92 |   | 
        
           |  |  | 93 |                 foreach($menuLevel2['pages'] as $menuLevel3)
 | 
        
           |  |  | 94 |                 {
 | 
        
           |  |  | 95 |   | 
        
           |  |  | 96 |                     $optionLevel3 = [
 | 
        
           |  |  | 97 |                         'label' => $menuLevel3['label'],
 | 
        
           |  |  | 98 |                         'route' => $menuLevel3['route'],
 | 
        
           |  |  | 99 |                         'class' => empty($menuLevel3['class']) ? '' :  $menuLevel3['class'],
 | 
        
           |  |  | 100 |                     ];
 | 
        
           |  |  | 101 |   | 
        
           |  |  | 102 |                     if(!$acl->isAllowed($session_usertype_id ,  $menuLevel3['route'])) {
 | 
        
           |  |  | 103 |                         continue;
 | 
        
           |  |  | 104 |                     }
 | 
        
           |  |  | 105 |   | 
        
           |  |  | 106 |                     array_push($optionLevel2['pages'], $optionLevel3);
 | 
        
           |  |  | 107 |   | 
        
           |  |  | 108 |                 }
 | 
        
           |  |  | 109 |             }
 | 
        
           |  |  | 110 |   | 
        
           |  |  | 111 |   | 
        
           |  |  | 112 |             array_push($optionLevel1['pages'], $optionLevel2);
 | 
        
           |  |  | 113 |   | 
        
           |  |  | 114 |         }
 | 
        
           |  |  | 115 |   | 
        
           |  |  | 116 |   | 
        
           |  |  | 117 |     }
 | 
        
           |  |  | 118 |   | 
        
           |  |  | 119 |   | 
        
           |  |  | 120 |   | 
        
           |  |  | 121 |   | 
        
           |  |  | 122 |     array_push($menu, $optionLevel1);
 | 
        
           |  |  | 123 | }
 | 
        
           |  |  | 124 |   | 
        
           |  |  | 125 |   | 
        
           | 9056 | stevensc | 126 | //[REQUEST_URI] => /settings/company-sizes/
 | 
        
           |  |  | 127 | $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
 | 
        
           |  |  | 128 |   | 
        
           |  |  | 129 | if ($request_uri) {
 | 
        
           | 14575 | stevensc | 130 | 	if (substr($request_uri, 0, 1) == '/') {
 | 
        
           |  |  | 131 | 		$request_uri = substr($request_uri, 1);
 | 
        
           |  |  | 132 | 	}
 | 
        
           |  |  | 133 | 	if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
 | 
        
           |  |  | 134 | 		$request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
 | 
        
           |  |  | 135 | 	}
 | 
        
           | 9056 | stevensc | 136 | }
 | 
        
           |  |  | 137 |   | 
        
           |  |  | 138 |   | 
        
           | 15089 | efrain | 139 |   | 
        
           | 9056 | stevensc | 140 | $jsonMenu = json_encode($menu);
 | 
        
           | 14575 | stevensc | 141 |   | 
        
           |  |  | 142 | if ($company) {
 | 
        
           |  |  | 143 | 	$js = <<<JS
 | 
        
           | 9056 | stevensc | 144 | 	const backendVars= {
 | 
        
           |  |  | 145 | 		menu:JSON.parse('$jsonMenu'),
 | 
        
           |  |  | 146 | 		companyId: "$company->uuid",
 | 
        
           |  |  | 147 | 		companyImg: "$companyImg",
 | 
        
           |  |  | 148 | 		companyName: "$companyName",
 | 
        
           |  |  | 149 | 		name: "$names[0]",
 | 
        
           |  |  | 150 | 	}
 | 
        
           |  |  | 151 | JS;
 | 
        
           |  |  | 152 | } else {
 | 
        
           |  |  | 153 | 	$js = <<<JS
 | 
        
           |  |  | 154 | 	const backendVars= {
 | 
        
           |  |  | 155 | 		menu:JSON.parse('$jsonMenu'),
 | 
        
           |  |  | 156 | 		companyId: "",
 | 
        
           |  |  | 157 | 		companyImg: "",
 | 
        
           |  |  | 158 | 		companyName: "",
 | 
        
           |  |  | 159 | 		name: "",
 | 
        
           |  |  | 160 | 	}
 | 
        
           |  |  | 161 | JS;
 | 
        
           |  |  | 162 | }
 | 
        
           |  |  | 163 | $this->inlineScript()->appendScript($js);
 | 
        
           |  |  | 164 | $this->inlineScript()->appendFile('/react-bundles/menu/menuBundle.js');
 | 
        
           |  |  | 165 |   | 
        
           | 1 | www | 166 | ?>
 | 
        
           |  |  | 167 | <!DOCTYPE html>
 | 
        
           |  |  | 168 | <html lang="es">
 | 
        
           |  |  | 169 |   | 
        
           | 4686 | stevensc | 170 | <head>
 | 
        
           |  |  | 171 | 	<?php
 | 
        
           |  |  | 172 | 	echo $this->headTitle();
 | 
        
           |  |  | 173 | 	echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
 | 
        
           |  |  | 174 | 		->appendHttpEquiv('expires', '0')
 | 
        
           |  |  | 175 | 		->appendHttpEquiv('expires', 'Tue, 01 Jan 1980 1:00:00 GMT')
 | 
        
           |  |  | 176 | 		->appendHttpEquiv('pragma', 'no-cache')
 | 
        
           |  |  | 177 | 		->appendHttpEquiv('Cache-Control', 'no-store')
 | 
        
           |  |  | 178 | 		->appendHttpEquiv('Cache-Control', 'max-age=0')
 | 
        
           |  |  | 179 | 		->appendHttpEquiv('Cache-Control', 'no-cache')
 | 
        
           |  |  | 180 | 		->appendHttpEquiv('charset', 'UTF-8')
 | 
        
           |  |  | 181 | 		->appendName('viewport', 'width=device-width, initial-scale=1.0');
 | 
        
           |  |  | 182 | 	?>
 | 
        
           | 1 | www | 183 |   | 
        
           | 14575 | stevensc | 184 | 	<!-- Google Font: Source Sans Pro -->
 | 
        
           |  |  | 185 | 	<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
 | 
        
           |  |  | 186 | 	<!-- Font Awesome -->
 | 
        
           |  |  | 187 | 	<link rel="stylesheet" href="<?php echo $this->basePath('plugins/font-awesome/css/font-awesome.css') ?>">
 | 
        
           | 4686 | stevensc | 188 | 	<!-- Theme style -->
 | 
        
           |  |  | 189 | 	<link rel="stylesheet" href="<?php echo $this->basePath('css/adminlte.min.css') ?>">
 | 
        
           |  |  | 190 | 	<!-- App style -->
 | 
        
           |  |  | 191 | 	<link rel="stylesheet" href="<?php echo $this->basePath('/react-bundles/menu/main.css') ?>">
 | 
        
           | 9002 | stevensc | 192 | 	<script src="<?php echo $this->basePath('plugins/ckeditor/ckeditor.js') ?>"></script>
 | 
        
           | 1 | www | 193 |   | 
        
           | 11578 | nelberth | 194 | 	<?php if ($currentUserHelper->hasIdentity()) :  ?>
 | 
        
           | 14575 | stevensc | 195 | 		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/icons.css') ?>" />
 | 
        
           |  |  | 196 | 		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/smiley/assets/sprites/emojione.sprites.css') ?>" />
 | 
        
           |  |  | 197 | 		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/uploader/jquery.ui.plupload/css/jquery-ui.css') ?>" />
 | 
        
           |  |  | 198 | 		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/uploader/jquery.ui.plupload/css/jquery.ui.plupload.css') ?>" />
 | 
        
           |  |  | 199 |   | 
        
           |  |  | 200 | 		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/chat.css') ?>" />
 | 
        
           |  |  | 201 | 		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/style-cesa.css') ?>" />
 | 
        
           | 14900 | stevensc | 202 | 		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/responsive-cesa.css') ?>" />
 | 
        
           | 15158 | stevensc | 203 | 		<link rel="stylesheet" href="<?php echo $this->basePath('css/main.css') ?>">
 | 
        
           | 11565 | efrain | 204 | 	<?php endif; ?>
 | 
        
           | 11578 | nelberth | 205 | 	<?php
 | 
        
           |  |  | 206 | 	echo $this->headStyle();
 | 
        
           |  |  | 207 | 	echo $this->headLink();
 | 
        
           |  |  | 208 | 	echo $this->headScript();
 | 
        
           |  |  | 209 | 	?>
 | 
        
           | 14903 | stevensc | 210 |   | 
        
           | 4686 | stevensc | 211 | </head>
 | 
        
           |  |  | 212 |   | 
        
           |  |  | 213 | <body class="hold-transition sidebar-mini">
 | 
        
           |  |  | 214 | 	<!-- Site wrapper -->
 | 
        
           | 14150 | stevensc | 215 | 	<div class="wrapper">
 | 
        
           | 14575 | stevensc | 216 |   | 
        
           | 14150 | stevensc | 217 | 		<div id="menu-sidebar"></div>
 | 
        
           | 8759 | stevensc | 218 |   | 
        
           | 4686 | stevensc | 219 | 		<!-- Content Wrapper. Contains page content -->
 | 
        
           | 14143 | stevensc | 220 | 		<div class="content-wrapper">
 | 
        
           | 4686 | stevensc | 221 | 			<section class="content">
 | 
        
           |  |  | 222 | 				<?php echo $this->content ?>
 | 
        
           |  |  | 223 | 			</section>
 | 
        
           | 14575 | stevensc | 224 |   | 
        
           |  |  | 225 |   | 
        
           |  |  | 226 | 			<?php
 | 
        
           | 11565 | efrain | 227 | 			if ($currentUserHelper->hasIdentity()) {
 | 
        
           | 14575 | stevensc | 228 | 				echo $this->chatHelper($user->id);
 | 
        
           | 11565 | efrain | 229 | 			}
 | 
        
           |  |  | 230 | 			?>
 | 
        
           | 14575 | stevensc | 231 |   | 
        
           | 4686 | stevensc | 232 | 			<!-- /.content -->
 | 
        
           |  |  | 233 | 		</div>
 | 
        
           |  |  | 234 | 		<!-- /.content-wrapper -->
 | 
        
           |  |  | 235 | 	</div>
 | 
        
           |  |  | 236 | 	<!-- jQuery -->
 | 
        
           |  |  | 237 | 	<script src="<?php echo $this->basePath('plugins/jquery/jquery.js') ?>"></script>
 | 
        
           |  |  | 238 | 	<!-- Bootstrap 4 -->
 | 
        
           |  |  | 239 | 	<script src="<?php echo $this->basePath('plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
 | 
        
           |  |  | 240 | 	<!-- AdminLTE App -->
 | 
        
           | 8906 | stevensc | 241 | 	<script src="<?php echo $this->basePath('js/adminlte.min.js') ?>"></script>
 | 
        
           | 4686 | stevensc | 242 | 	<!--  Aplicacion -->
 | 
        
           |  |  | 243 | 	<script src="<?php echo $this->basePath('plugins/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
 | 
        
           |  |  | 244 | 	<script src="<?php echo $this->basePath('js/app.js') ?>"></script>
 | 
        
           | 11577 | nelberth | 245 | 	<?php if ($currentUserHelper->hasIdentity()) :  ?>
 | 
        
           |  |  | 246 | 		<script type="text/javascript" src="<?php echo $this->basePath('vendors/smiley/smiley.js') ?>"></script>
 | 
        
           |  |  | 247 | 		<script type="text/javascript" src="<?php echo $this->basePath('vendors/smiley/js/emojione.min.js') ?>"></script>
 | 
        
           |  |  | 248 | 	<?php endif; ?>
 | 
        
           | 4686 | stevensc | 249 | 	<?php
 | 
        
           |  |  | 250 | 	echo $this->inlineScript();
 | 
        
           |  |  | 251 | 	?>
 | 
        
           | 14575 | stevensc | 252 |   | 
        
           |  |  | 253 |   | 
        
           | 4686 | stevensc | 254 | </body>
 | 
        
           |  |  | 255 |   | 
        
           | 1 | www | 256 | </html>
 |