Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15158 | Rev 15337 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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 {
15202 stevensc 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
 
15202 stevensc 53
foreach ($baseMenu as $menuLevel1) {
54
	if (!$acl->isAllowed($session_usertype_id,  $menuLevel1['route'])) {
55
		continue;
56
	}
15089 efrain 57
 
15202 stevensc 58
 
59
	$optionLevel1 = [
60
		'label' => $menuLevel1['label'],
61
		'route' => $menuLevel1['route'],
62
		'class' => empty($menuLevel1['class']) ? '' :  $menuLevel1['class'],
63
 
64
	];
65
 
66
 
67
	if (!empty($menuLevel1['pages'])) {
68
 
69
 
70
 
71
 
72
		$optionLevel1['pages'] = [];
73
 
74
 
75
 
76
		foreach ($menuLevel1['pages'] as $menuLevel2) {
77
 
78
			$optionLevel2 = [
79
				'label' => $menuLevel2['label'],
80
				'route' => $menuLevel2['route'],
81
				'class' => empty($menuLevel2['class']) ? '' :  $menuLevel2['class'],
82
			];
83
 
84
			if (!$acl->isAllowed($session_usertype_id,  $menuLevel2['route'])) {
85
				continue;
86
			}
87
 
88
			if (!empty($menuLevel2['pages'])) {
89
				$optionLevel2['pages'] = [];
90
 
91
				foreach ($menuLevel2['pages'] as $menuLevel3) {
92
 
93
					$optionLevel3 = [
94
						'label' => $menuLevel3['label'],
95
						'route' => $menuLevel3['route'],
96
						'class' => empty($menuLevel3['class']) ? '' :  $menuLevel3['class'],
97
					];
98
 
99
					if (!$acl->isAllowed($session_usertype_id,  $menuLevel3['route'])) {
100
						continue;
101
					}
102
 
103
					array_push($optionLevel2['pages'], $optionLevel3);
104
				}
105
			}
106
 
107
 
108
			array_push($optionLevel1['pages'], $optionLevel2);
109
		}
110
	}
111
 
112
 
113
 
114
 
115
	array_push($menu, $optionLevel1);
15089 efrain 116
}
117
 
118
 
9056 stevensc 119
//[REQUEST_URI] => /settings/company-sizes/
120
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
121
 
122
if ($request_uri) {
14575 stevensc 123
	if (substr($request_uri, 0, 1) == '/') {
124
		$request_uri = substr($request_uri, 1);
125
	}
126
	if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
127
		$request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
128
	}
9056 stevensc 129
}
130
 
131
 
15089 efrain 132
 
9056 stevensc 133
$jsonMenu = json_encode($menu);
14575 stevensc 134
 
135
if ($company) {
136
	$js = <<<JS
9056 stevensc 137
	const backendVars= {
138
		menu:JSON.parse('$jsonMenu'),
139
		companyId: "$company->uuid",
140
		companyImg: "$companyImg",
141
		companyName: "$companyName",
142
		name: "$names[0]",
143
	}
144
JS;
145
} else {
146
	$js = <<<JS
147
	const backendVars= {
148
		menu:JSON.parse('$jsonMenu'),
149
		companyId: "",
150
		companyImg: "",
151
		companyName: "",
152
		name: "",
153
	}
154
JS;
155
}
156
$this->inlineScript()->appendScript($js);
157
$this->inlineScript()->appendFile('/react-bundles/menu/menuBundle.js');
158
 
1 www 159
?>
160
<!DOCTYPE html>
161
<html lang="es">
162
 
4686 stevensc 163
<head>
164
	<?php
165
	echo $this->headTitle();
166
	echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
167
		->appendHttpEquiv('expires', '0')
168
		->appendHttpEquiv('expires', 'Tue, 01 Jan 1980 1:00:00 GMT')
169
		->appendHttpEquiv('pragma', 'no-cache')
170
		->appendHttpEquiv('Cache-Control', 'no-store')
171
		->appendHttpEquiv('Cache-Control', 'max-age=0')
172
		->appendHttpEquiv('Cache-Control', 'no-cache')
173
		->appendHttpEquiv('charset', 'UTF-8')
174
		->appendName('viewport', 'width=device-width, initial-scale=1.0');
175
	?>
1 www 176
 
14575 stevensc 177
	<!-- Google Font: Source Sans Pro -->
178
	<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
179
	<!-- Font Awesome -->
180
	<link rel="stylesheet" href="<?php echo $this->basePath('plugins/font-awesome/css/font-awesome.css') ?>">
4686 stevensc 181
	<!-- Theme style -->
182
	<link rel="stylesheet" href="<?php echo $this->basePath('css/adminlte.min.css') ?>">
183
	<!-- App style -->
184
	<link rel="stylesheet" href="<?php echo $this->basePath('/react-bundles/menu/main.css') ?>">
9002 stevensc 185
	<script src="<?php echo $this->basePath('plugins/ckeditor/ckeditor.js') ?>"></script>
1 www 186
 
11578 nelberth 187
	<?php if ($currentUserHelper->hasIdentity()) :  ?>
14575 stevensc 188
		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/icons.css') ?>" />
189
		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/smiley/assets/sprites/emojione.sprites.css') ?>" />
190
		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/uploader/jquery.ui.plupload/css/jquery-ui.css') ?>" />
191
		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('vendors/uploader/jquery.ui.plupload/css/jquery.ui.plupload.css') ?>" />
192
 
193
		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/chat.css') ?>" />
194
		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/style-cesa.css') ?>" />
14900 stevensc 195
		<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('css/responsive-cesa.css') ?>" />
15158 stevensc 196
		<link rel="stylesheet" href="<?php echo $this->basePath('css/main.css') ?>">
15202 stevensc 197
		<style>
198
			:root {
199
				--bg-color: #fff;
200
				--body-bg-color: #f2f2f2;
201
				--bg-color-secondary: #D9D9D9;
202
				--font-color: #16283c;
203
				--font-color-hover: #1d315c;
204
				--title-color: #000;
205
				--subtitle-color: #626d7a;
206
				--icons-color: #666666;
207
				--button-bg: #16283c;
208
				--button-bg-hover: #1d315c;
209
				--button-text-color: #fff;
210
				--button-bg-secondary: #0000;
211
				--button-bg-secondary-hover: #909090;
212
				--button-text-color-secondary: #000;
213
				--button-bg-tertiary: #f4f4f4;
214
				--button-text-color-tertiary: #909090;
215
				--border-primary: #e8e8e8;
216
				--border-trasnparent: #0000;
217
				--chat-received: #fff;
218
				--chat-send: #d8f1e4;
219
				--chat-color: #626d7a;
220
 
221
				--dark-blue: #01245d;
222
				--primary-green: #1eb89e;
223
				--light-font: #bebebe;
224
				--light-gray: #bebebe;
225
				--dark-white: #e7e7e7;
226
				--gray: #909090;
227
				--primary-lightblue: #0961bf;
228
				--primary-lightblue-hover: #1e5591;
229
				--yellow-highlight: #ecec0e;
230
				--yellow-darker: #decd00;
231
				--background-gray: #f5f5f7;
232
				--danger: #e20808;
233
				--danger-hover: #a10707;
234
				--shadow-gray: rgb(0 0 0 / 5%);
235
				--online-green: #42b72a;
236
				--blue: #0860bf;
237
				--border-gray: #e8e8e8;
238
				--border-gray-primary: #b3b3b3;
239
				--white: #ffffff;
240
				--black: #000000;
241
				--dark-blue-pr: #16283c;
242
 
243
				--white-backdrop: rgba(255, 255, 255, 0.4);
244
				--grayline-border: 1px solid #e5e5e5;
245
				--border-radius: 10px;
246
				--light-shadow: 0px 0px 11px 0px rgb(0 0 0 /10%);
247
				--shadow: 0px 4px 14px -2px rgb(0 0 0 / 12%);
248
			}
249
		</style>
11565 efrain 250
	<?php endif; ?>
11578 nelberth 251
	<?php
252
	echo $this->headStyle();
253
	echo $this->headLink();
254
	echo $this->headScript();
255
	?>
15202 stevensc 256
 
4686 stevensc 257
</head>
258
 
259
<body class="hold-transition sidebar-mini">
260
	<!-- Site wrapper -->
14150 stevensc 261
	<div class="wrapper">
14575 stevensc 262
 
14150 stevensc 263
		<div id="menu-sidebar"></div>
8759 stevensc 264
 
4686 stevensc 265
		<!-- Content Wrapper. Contains page content -->
14143 stevensc 266
		<div class="content-wrapper">
4686 stevensc 267
			<section class="content">
268
				<?php echo $this->content ?>
269
			</section>
14575 stevensc 270
 
271
 
272
			<?php
11565 efrain 273
			if ($currentUserHelper->hasIdentity()) {
14575 stevensc 274
				echo $this->chatHelper($user->id);
11565 efrain 275
			}
276
			?>
14575 stevensc 277
 
4686 stevensc 278
			<!-- /.content -->
279
		</div>
280
		<!-- /.content-wrapper -->
281
	</div>
282
	<!-- jQuery -->
283
	<script src="<?php echo $this->basePath('plugins/jquery/jquery.js') ?>"></script>
284
	<!-- Bootstrap 4 -->
285
	<script src="<?php echo $this->basePath('plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
286
	<!-- AdminLTE App -->
8906 stevensc 287
	<script src="<?php echo $this->basePath('js/adminlte.min.js') ?>"></script>
4686 stevensc 288
	<!--  Aplicacion -->
289
	<script src="<?php echo $this->basePath('plugins/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
290
	<script src="<?php echo $this->basePath('js/app.js') ?>"></script>
11577 nelberth 291
	<?php if ($currentUserHelper->hasIdentity()) :  ?>
292
		<script type="text/javascript" src="<?php echo $this->basePath('vendors/smiley/smiley.js') ?>"></script>
293
		<script type="text/javascript" src="<?php echo $this->basePath('vendors/smiley/js/emojione.min.js') ?>"></script>
294
	<?php endif; ?>
4686 stevensc 295
	<?php
296
	echo $this->inlineScript();
297
	?>
14575 stevensc 298
 
299
 
4686 stevensc 300
</body>
301
 
1 www 302
</html>