1 |
www |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
use LeadersLinked\Model\UserExperience;
|
|
|
4 |
|
|
|
5 |
$acl = $this->viewModel()
|
|
|
6 |
->getRoot()
|
|
|
7 |
->getVariable('acl');
|
|
|
8 |
$currentUserHelper = $this->currentUserHelper();
|
|
|
9 |
$currentUser = $currentUserHelper->getUser();
|
|
|
10 |
$currentCompany = $currentUserHelper->getCompany();
|
5761 |
stevensc |
11 |
$companyId = $currentCompany->uuid;
|
1 |
www |
12 |
|
|
|
13 |
$roleName = $currentUserHelper->getUserTypeId();
|
|
|
14 |
|
5743 |
stevensc |
15 |
$routeWebsite = $this->url('profile/website', ['id' => $currentCompany->uuid]);
|
|
|
16 |
$routeCompanySize = $this->url('profile/company-size', ['id' => $currentCompany->uuid]);
|
|
|
17 |
$routeIndustry = $this->url('profile/industry', ['id' => $currentCompany->uuid]);
|
|
|
18 |
$routeExtended = $this->url('profile/extended', ['id' => $currentCompany->uuid]);
|
|
|
19 |
$routeSocialNetworks = $this->url('profile/social-network', ['id' => $currentCompany->uuid]);
|
|
|
20 |
$routeLocationAdd = $this->url('profile/location', ['id' => $currentCompany->uuid, 'operation' => 'add']);
|
|
|
21 |
$routeFoundationYear = $this->url('profile/foundation_year', ['id' => $currentCompany->uuid, 'operation' => 'add']);
|
|
|
22 |
$routeImageUpload = $this->url('profile/image', ['id' => $currentCompany->uuid, 'operation' => 'upload']);
|
|
|
23 |
$routeCoverUpload = $this->url('profile/cover', ['id' => $currentCompany->uuid, 'operation' => 'upload']);
|
|
|
24 |
$routeFooterUpload = $this->url('profile/footer', ['id' => $currentCompany->uuid, 'operation' => 'upload']);
|
|
|
25 |
$routeHeaderUpload = $this->url('profile/header', ['id' => $currentCompany->uuid, 'operation' => 'upload']);
|
1 |
www |
26 |
|
|
|
27 |
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
|
|
|
28 |
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
|
|
|
29 |
|
8525 |
stevensc |
30 |
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
|
|
|
31 |
|
|
|
32 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
33 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));
|
|
|
34 |
|
|
|
35 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
36 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
|
|
|
37 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
|
|
|
38 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
|
|
|
39 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
|
|
|
40 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));
|
|
|
41 |
|
1 |
www |
42 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
|
|
|
43 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
|
|
|
44 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
|
|
|
45 |
|
|
|
46 |
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
|
|
|
47 |
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
|
|
|
48 |
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.min.js'));
|
|
|
49 |
|
|
|
50 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
51 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
|
|
52 |
|
8525 |
stevensc |
53 |
|
1 |
www |
54 |
$this->inlineScript()->captureStart();
|
|
|
55 |
echo <<<JS
|
|
|
56 |
jQuery( document ).ready(function( $ ) {
|
|
|
57 |
|
8525 |
stevensc |
58 |
$.validator.addMethod('greaterThan', function (value, element, param) {
|
|
|
59 |
var otherElement = $(param);
|
|
|
60 |
return parseInt(value, 10) > parseInt(otherElement.val(), 10);
|
|
|
61 |
}, 'ERROR_INVALID_MINIMUM');
|
|
|
62 |
|
|
|
63 |
$.validator.setDefaults({
|
|
|
64 |
debug: true,
|
|
|
65 |
highlight: function(element) {
|
|
|
66 |
$(element).addClass('is-invalid');
|
8523 |
stevensc |
67 |
},
|
8525 |
stevensc |
68 |
unhighlight: function(element) {
|
|
|
69 |
$(element).removeClass('is-invalid');
|
|
|
70 |
},
|
|
|
71 |
errorElement: 'span',
|
|
|
72 |
errorClass: 'error invalid-feedback',
|
|
|
73 |
errorPlacement: function(error, element) {
|
|
|
74 |
if(element.parent('.form-group').length) {
|
|
|
75 |
error.insertAfter(element);
|
|
|
76 |
} else if(element.parent('.toggle').length) {
|
|
|
77 |
error.insertAfter(element.parent().parent());
|
8523 |
stevensc |
78 |
} else {
|
8525 |
stevensc |
79 |
error.insertAfter(element.parent());
|
8523 |
stevensc |
80 |
}
|
|
|
81 |
}
|
|
|
82 |
});
|
8525 |
stevensc |
83 |
|
|
|
84 |
|
|
|
85 |
$.fn.showFormErrorValidator = function(fieldname, errors) {
|
|
|
86 |
var field = $(fieldname);
|
|
|
87 |
if(field) {
|
|
|
88 |
$(field).addClass('is-invalid');
|
|
|
89 |
|
8523 |
stevensc |
90 |
|
8525 |
stevensc |
91 |
var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
|
|
|
92 |
if(field.parent('.form-group').length) {
|
|
|
93 |
error.insertAfter(field);
|
|
|
94 |
} else if(field.parent('.toggle').length) {
|
|
|
95 |
error.insertAfter(field.parent().parent());
|
|
|
96 |
} else {
|
|
|
97 |
error.insertAfter(field.parent());
|
|
|
98 |
}
|
|
|
99 |
}
|
|
|
100 |
};
|
8523 |
stevensc |
101 |
|
8525 |
stevensc |
102 |
var validatorExtended = $('#form-extended').validate({
|
8523 |
stevensc |
103 |
debug: true,
|
|
|
104 |
onclick: false,
|
|
|
105 |
onkeyup: false,
|
|
|
106 |
onfocusout: false,
|
|
|
107 |
ignore: [],
|
|
|
108 |
rules: {
|
8525 |
stevensc |
109 |
'description': {
|
|
|
110 |
updateCkeditor:function() {
|
|
|
111 |
CKEDITOR.instances.description.updateElement();
|
|
|
112 |
},
|
|
|
113 |
required: false,
|
8523 |
stevensc |
114 |
},
|
|
|
115 |
},
|
|
|
116 |
|
|
|
117 |
submitHandler: function(form)
|
|
|
118 |
{
|
|
|
119 |
NProgress.start();
|
|
|
120 |
$.ajax({
|
|
|
121 |
'dataType' : 'json',
|
|
|
122 |
'accept' : 'application/json',
|
|
|
123 |
'method' : 'post',
|
8525 |
stevensc |
124 |
'url' : $('#form-extended').attr('action'),
|
|
|
125 |
'data' : $('#form-extended').serialize()
|
8523 |
stevensc |
126 |
}).done(function(response) {
|
|
|
127 |
if(response['success']) {
|
|
|
128 |
|
8525 |
stevensc |
129 |
$('#overview-description').html(response['data']['description']);
|
|
|
130 |
$("#extended-box").modal('hide');
|
8523 |
stevensc |
131 |
} else {
|
8525 |
stevensc |
132 |
validatorExtended.resetForm();
|
8523 |
stevensc |
133 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
134 |
$.fn.showError(response['data']);
|
|
|
135 |
} else {
|
|
|
136 |
$.each(response['data'], function( fieldname, errors ) {
|
8525 |
stevensc |
137 |
$.fn.showFormErrorValidator('#form-extended #' + fieldname, errors);
|
8523 |
stevensc |
138 |
});
|
|
|
139 |
}
|
|
|
140 |
}
|
|
|
141 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
142 |
$.fn.showError(textStatus);
|
|
|
143 |
}).always(function() {
|
|
|
144 |
NProgress.done();
|
|
|
145 |
});
|
|
|
146 |
return false;
|
|
|
147 |
},
|
|
|
148 |
invalidHandler: function(form, validator) {
|
|
|
149 |
|
|
|
150 |
}
|
|
|
151 |
});
|
|
|
152 |
|
|
|
153 |
|
8525 |
stevensc |
154 |
$('.btn-extended-edit').on("click", function(e){
|
8523 |
stevensc |
155 |
e.preventDefault();
|
|
|
156 |
|
|
|
157 |
NProgress.start();
|
|
|
158 |
$.ajax({
|
|
|
159 |
'dataType' : 'json',
|
|
|
160 |
'accept' : 'application/json',
|
|
|
161 |
'method' : 'get',
|
8525 |
stevensc |
162 |
'url' : '$routeExtended',
|
8523 |
stevensc |
163 |
}).done(function(response) {
|
|
|
164 |
if(response['success']) {
|
8525 |
stevensc |
165 |
CKEDITOR.instances.description.setData(response['data']['description']);
|
|
|
166 |
validatorExtended.resetForm();
|
8523 |
stevensc |
167 |
|
8525 |
stevensc |
168 |
$("#extended-box").modal('show');
|
8523 |
stevensc |
169 |
} else {
|
|
|
170 |
$.fn.showError(response['data']);
|
|
|
171 |
}
|
|
|
172 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
173 |
$.fn.showError(textStatus);
|
|
|
174 |
}).always(function() {
|
|
|
175 |
NProgress.done();
|
|
|
176 |
});
|
|
|
177 |
return false;
|
|
|
178 |
|
|
|
179 |
});
|
1 |
www |
180 |
|
8525 |
stevensc |
181 |
$('.btn-extended-close').on("click", function(e){
|
8523 |
stevensc |
182 |
e.preventDefault();
|
|
|
183 |
|
8525 |
stevensc |
184 |
$("#extended-box").modal('hide');
|
8523 |
stevensc |
185 |
return false;
|
|
|
186 |
});
|
|
|
187 |
|
8767 |
stevensc |
188 |
CKEDITOR.replace('description', {
|
|
|
189 |
toolbar: [
|
|
|
190 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
191 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
192 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
193 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
194 |
'/',
|
|
|
195 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
196 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
197 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
198 |
],
|
|
|
199 |
removePlugins: 'elementspath,Anchor',
|
|
|
200 |
heigth: 100
|
|
|
201 |
});
|
8525 |
stevensc |
202 |
|
1 |
www |
203 |
});
|
|
|
204 |
|
8525 |
stevensc |
205 |
|
1 |
www |
206 |
JS;
|
|
|
207 |
$this->inlineScript()->captureEnd();
|
|
|
208 |
|
6005 |
stevensc |
209 |
$jsonLocations = json_encode($locations);
|
8525 |
stevensc |
210 |
|
5743 |
stevensc |
211 |
$js = <<<JS
|
|
|
212 |
const urlVars = {
|
|
|
213 |
routeWebsite: "$routeWebsite",
|
|
|
214 |
routeCompanySize: "$routeCompanySize",
|
|
|
215 |
routeIndustry: "$routeIndustry",
|
|
|
216 |
routeExtended: "$routeExtended",
|
|
|
217 |
routeSocialNetworks: "$routeSocialNetworks",
|
|
|
218 |
routeLocationAdd: "$routeLocationAdd",
|
|
|
219 |
routeFoundationYear: "$routeFoundationYear",
|
|
|
220 |
routeImageUpload: "$routeImageUpload",
|
|
|
221 |
routeCoverUpload: "$routeCoverUpload",
|
|
|
222 |
routeFooterUpload: "$routeFooterUpload",
|
5757 |
stevensc |
223 |
routeHeaderUpload: "$routeHeaderUpload",
|
|
|
224 |
cover: "$cover",
|
5795 |
stevensc |
225 |
companyId: "$companyId",
|
5925 |
stevensc |
226 |
followers: "$follower",
|
5988 |
stevensc |
227 |
image: "$image",
|
6002 |
stevensc |
228 |
overview: "$overview",
|
6025 |
stevensc |
229 |
locations: JSON.parse('$jsonLocations'),
|
6026 |
stevensc |
230 |
industry: "$industry",
|
6027 |
stevensc |
231 |
companySize: "$company_size",
|
6050 |
stevensc |
232 |
companyName: "$company_name",
|
|
|
233 |
foundationYear: "$foundation_year",
|
6055 |
stevensc |
234 |
website: "$website",
|
6059 |
stevensc |
235 |
header: "$header",
|
8525 |
stevensc |
236 |
footer: "$footer"
|
5743 |
stevensc |
237 |
}
|
|
|
238 |
JS;
|
|
|
239 |
|
|
|
240 |
$this->inlineScript()->appendScript($js);
|
6448 |
stevensc |
241 |
$this->headLink()->appendStylesheet('/react-bundles/profile/main.css');
|
5743 |
stevensc |
242 |
$this->inlineScript()->appendFile('/react-bundles/profile/profileBundle.js');
|
1 |
www |
243 |
?>
|
|
|
244 |
|
777 |
geraldo |
245 |
<style>
|
5743 |
stevensc |
246 |
.user-profile-ov {
|
|
|
247 |
position: relative;
|
|
|
248 |
}
|
777 |
geraldo |
249 |
|
5743 |
stevensc |
250 |
.user-profile-ov .add-dp {
|
|
|
251 |
position: absolute;
|
|
|
252 |
top: 30%;
|
|
|
253 |
right: 10%;
|
|
|
254 |
}
|
779 |
geraldo |
255 |
|
5743 |
stevensc |
256 |
.user-profile-ov .add-dp i {
|
|
|
257 |
font-size: 14px;
|
|
|
258 |
border: 2px solid #fff;
|
|
|
259 |
background: #e44d3a;
|
|
|
260 |
padding: 11px;
|
|
|
261 |
color: #ffff
|
|
|
262 |
}
|
777 |
geraldo |
263 |
</style>
|
|
|
264 |
|
1 |
www |
265 |
<!-- Content Header (Page header) -->
|
5743 |
stevensc |
266 |
<div id="profile">
|
5800 |
stevensc |
267 |
</div>
|
8525 |
stevensc |
268 |
|
|
|
269 |
<div class="modal" tabindex="-1" role="dialog" id="extended-box">
|
8523 |
stevensc |
270 |
<div class="modal-dialog" role="document">
|
|
|
271 |
<?php
|
8525 |
stevensc |
272 |
$form = $this->formExtended;
|
8523 |
stevensc |
273 |
$form->setAttributes([
|
|
|
274 |
'method' => 'post',
|
8525 |
stevensc |
275 |
'action' => $routeExtended,
|
|
|
276 |
'name' => 'form-extended',
|
|
|
277 |
'id' => 'form-extended'
|
8523 |
stevensc |
278 |
]);
|
|
|
279 |
$form->prepare();
|
|
|
280 |
echo $this->form()->openTag($form);
|
|
|
281 |
?>
|
|
|
282 |
<div class="modal-content">
|
|
|
283 |
<div class="modal-header">
|
|
|
284 |
<h3 class="modal-title">LABEL_CHANGE</h3>
|
|
|
285 |
</div>
|
|
|
286 |
<div class="modal-body">
|
|
|
287 |
<div class="form-group">
|
|
|
288 |
<?php
|
8525 |
stevensc |
289 |
$element = $form->get('description');
|
8523 |
stevensc |
290 |
$element->setAttributes(['class' => 'form-control']);
|
8525 |
stevensc |
291 |
$element->setOptions(['label' => 'LABEL_OVERVIEW']);
|
8523 |
stevensc |
292 |
echo $this->formLabel($element);
|
8525 |
stevensc |
293 |
echo $this->formTextArea($element);
|
8523 |
stevensc |
294 |
?>
|
|
|
295 |
</div>
|
|
|
296 |
</div>
|
|
|
297 |
<div class="modal-footer">
|
|
|
298 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
8525 |
stevensc |
299 |
<button type="button" class="btn btn-default btn-extended-close">LABEL_CANCEL</button>
|
8523 |
stevensc |
300 |
</div>
|
|
|
301 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
302 |
</div>
|
|
|
303 |
</div>
|
6060 |
stevensc |
304 |
</div>
|