1 |
www |
1 |
<?php
|
|
|
2 |
$currentUser = $this->currentUserHelper();
|
|
|
3 |
$user = $currentUser->getUser();
|
|
|
4 |
$company = $currentUser->getCompany();
|
|
|
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 |
|
8742 |
stevensc |
33 |
if ($company) {
|
|
|
34 |
$menu = getAclMenuCompany();
|
8706 |
stevensc |
35 |
} else {
|
8742 |
stevensc |
36 |
$menu = getAclMenuSystem();
|
8706 |
stevensc |
37 |
}
|
|
|
38 |
|
8742 |
stevensc |
39 |
if ($company) {
|
|
|
40 |
$names = explode(' ', $company->name);
|
8767 |
stevensc |
41 |
$companyId = $company->uuid;
|
|
|
42 |
$companyName = $company->name;
|
|
|
43 |
$companyImg = $company->image;
|
8742 |
stevensc |
44 |
}
|
8706 |
stevensc |
45 |
|
8742 |
stevensc |
46 |
|
|
|
47 |
$usertype_id = $user->usertype_id;
|
|
|
48 |
|
8706 |
stevensc |
49 |
//[REQUEST_URI] => /settings/company-sizes/
|
|
|
50 |
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
|
|
51 |
|
|
|
52 |
if ($request_uri) {
|
|
|
53 |
if (substr($request_uri, 0, 1) == '/') {
|
|
|
54 |
$request_uri = substr($request_uri, 1);
|
|
|
55 |
}
|
|
|
56 |
if (substr($request_uri, strlen($request_uri) - 1, 1) == '/') {
|
|
|
57 |
$request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
|
|
|
58 |
}
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
$acl = $this->viewModel()->getCurrent()->getVariable('acl');
|
|
|
62 |
|
|
|
63 |
$jsonMenu = json_encode($menu);
|
|
|
64 |
|
8774 |
stevensc |
65 |
if($company){
|
8706 |
stevensc |
66 |
$js = <<<JS
|
8769 |
stevensc |
67 |
const backendVars= {
|
|
|
68 |
menu:JSON.parse('$jsonMenu'),
|
8772 |
stevensc |
69 |
companyId: "$company->uuid",
|
8769 |
stevensc |
70 |
companyImg: "$companyImg",
|
|
|
71 |
companyName: "$companyName",
|
|
|
72 |
name: "$names[0]",
|
8774 |
stevensc |
73 |
}
|
|
|
74 |
JS;
|
|
|
75 |
} else {
|
|
|
76 |
$js = <<<JS
|
|
|
77 |
const backendVars= {
|
|
|
78 |
menu:JSON.parse('$jsonMenu'),
|
|
|
79 |
companyId: "",
|
|
|
80 |
companyImg: "",
|
|
|
81 |
companyName: "",
|
|
|
82 |
name: "",
|
|
|
83 |
}
|
|
|
84 |
JS;
|
8706 |
stevensc |
85 |
}
|
|
|
86 |
$this->inlineScript()->appendScript($js);
|
8905 |
stevensc |
87 |
$this->inlineScript()->appendFile('/react-bundles/menu/menuBundle.js');
|
1 |
www |
88 |
?>
|
|
|
89 |
<!DOCTYPE html>
|
|
|
90 |
<html lang="es">
|
|
|
91 |
|
4686 |
stevensc |
92 |
<head>
|
|
|
93 |
<?php
|
|
|
94 |
echo $this->headTitle();
|
|
|
95 |
echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
|
|
|
96 |
->appendHttpEquiv('expires', '0')
|
|
|
97 |
->appendHttpEquiv('expires', 'Tue, 01 Jan 1980 1:00:00 GMT')
|
|
|
98 |
->appendHttpEquiv('pragma', 'no-cache')
|
|
|
99 |
->appendHttpEquiv('Cache-Control', 'no-store')
|
|
|
100 |
->appendHttpEquiv('Cache-Control', 'max-age=0')
|
|
|
101 |
->appendHttpEquiv('Cache-Control', 'no-cache')
|
|
|
102 |
->appendHttpEquiv('charset', 'UTF-8')
|
|
|
103 |
->appendName('viewport', 'width=device-width, initial-scale=1.0');
|
|
|
104 |
?>
|
1 |
www |
105 |
|
4686 |
stevensc |
106 |
<!-- Google Font: Source Sans Pro -->
|
|
|
107 |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
|
|
|
108 |
<!-- Font Awesome -->
|
|
|
109 |
<link rel="stylesheet" href="<?php echo $this->basePath('plugins/font-awesome/css/font-awesome.css') ?>">
|
|
|
110 |
<!-- Theme style -->
|
|
|
111 |
<link rel="stylesheet" href="<?php echo $this->basePath('css/adminlte.min.css') ?>">
|
|
|
112 |
<!-- App style -->
|
|
|
113 |
<link rel="stylesheet" href="<?php echo $this->basePath('css/app.css') ?>">
|
|
|
114 |
<link rel="stylesheet" href="<?php echo $this->basePath('/react-bundles/menu/main.css') ?>">
|
1 |
www |
115 |
|
4686 |
stevensc |
116 |
<?php
|
|
|
117 |
echo $this->headStyle();
|
|
|
118 |
echo $this->headLink();
|
|
|
119 |
echo $this->headScript();
|
|
|
120 |
?>
|
|
|
121 |
</head>
|
|
|
122 |
|
|
|
123 |
<body class="hold-transition sidebar-mini">
|
|
|
124 |
<!-- Site wrapper -->
|
8759 |
stevensc |
125 |
<div class="wrapper">
|
4686 |
stevensc |
126 |
|
8759 |
stevensc |
127 |
<!-- Main Sidebar Container -->
|
8906 |
stevensc |
128 |
<aside class="main-sidebar sidebar-light-primary right-border">
|
|
|
129 |
<!-- Brand Logo -->
|
|
|
130 |
<a href="<?php echo $this->url('dashboard') ?>" class="brand-link">
|
|
|
131 |
<?php if ($company) :
|
|
|
132 |
$names = explode(' ', $company->name);
|
8759 |
stevensc |
133 |
|
8906 |
stevensc |
134 |
?>
|
|
|
135 |
<img src="<?php echo $this->url('storage', ['type' => 'company', 'code' => $company->uuid, 'filename' => $company->image]) ?>" alt="<?php echo $company->name ?>" class="brand-image " style="opacity: .8; background-color: white">
|
|
|
136 |
<span class="brand-text font-weight-light"><?php echo $names[0] ?></span>
|
|
|
137 |
|
|
|
138 |
<?php else : ?>
|
|
|
139 |
<img src="<?php echo $this->basePath('img/logo-ll34x34.png') ?>" alt="Administrador" class="brand-image " style="opacity: .8; background-color: white">
|
|
|
140 |
<span class="brand-text font-weight-light">Admin</span>
|
|
|
141 |
<?php endif; ?>
|
|
|
142 |
</a>
|
|
|
143 |
|
|
|
144 |
<!-- Sidebar -->
|
|
|
145 |
<div class="sidebar" id="menu-sidebar">
|
|
|
146 |
|
|
|
147 |
</div>
|
|
|
148 |
<!-- /.sidebar -->
|
|
|
149 |
</aside>
|
|
|
150 |
|
4686 |
stevensc |
151 |
<!-- Content Wrapper. Contains page content -->
|
|
|
152 |
<div class="content-wrapper">
|
|
|
153 |
<section class="content">
|
|
|
154 |
<?php echo $this->content ?>
|
|
|
155 |
</section>
|
|
|
156 |
<!-- /.content -->
|
|
|
157 |
</div>
|
|
|
158 |
<!-- /.content-wrapper -->
|
|
|
159 |
</div>
|
|
|
160 |
|
|
|
161 |
<!-- jQuery -->
|
|
|
162 |
<script src="<?php echo $this->basePath('plugins/jquery/jquery.js') ?>"></script>
|
|
|
163 |
<!-- Bootstrap 4 -->
|
|
|
164 |
<script src="<?php echo $this->basePath('plugins/bootstrap/js/bootstrap.bundle.min.js') ?>"></script>
|
|
|
165 |
<!-- AdminLTE App -->
|
8906 |
stevensc |
166 |
<script src="<?php echo $this->basePath('js/adminlte.min.js') ?>"></script>
|
4686 |
stevensc |
167 |
<!-- Aplicacion -->
|
|
|
168 |
<script src="<?php echo $this->basePath('plugins/bootstrap-notify/bootstrap-notify.min.js') ?>"></script>
|
|
|
169 |
<script src="<?php echo $this->basePath('js/app.js') ?>"></script>
|
|
|
170 |
<?php
|
|
|
171 |
echo $this->inlineScript();
|
|
|
172 |
?>
|
|
|
173 |
</body>
|
|
|
174 |
|
1 |
www |
175 |
</html>
|