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->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
|
|
|
28 |
|
|
|
29 |
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
|
|
|
30 |
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
|
|
|
31 |
|
|
|
32 |
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
|
|
|
33 |
|
|
|
34 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
35 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));
|
|
|
36 |
|
|
|
37 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
38 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
|
|
|
39 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
|
|
|
40 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
|
|
|
41 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
|
|
|
42 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));
|
|
|
43 |
|
|
|
44 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
|
|
|
45 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
|
|
|
46 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
|
|
|
47 |
|
|
|
48 |
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
|
|
|
49 |
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
|
|
|
50 |
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.min.js'));
|
|
|
51 |
|
|
|
52 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.min.js'));
|
|
|
53 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
|
|
|
54 |
|
|
|
55 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
56 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
|
|
57 |
|
|
|
58 |
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
|
|
|
59 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
|
|
|
60 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
|
|
|
61 |
|
|
|
62 |
$this->inlineScript()->captureStart();
|
|
|
63 |
echo <<<JS
|
|
|
64 |
jQuery( document ).ready(function( $ ) {
|
|
|
65 |
|
|
|
66 |
$.validator.addMethod('greaterThan', function (value, element, param) {
|
|
|
67 |
var otherElement = $(param);
|
|
|
68 |
return parseInt(value, 10) > parseInt(otherElement.val(), 10);
|
|
|
69 |
}, 'ERROR_INVALID_MINIMUM');
|
|
|
70 |
|
|
|
71 |
$.validator.addMethod('checkLocation', function (value, element, param) {
|
|
|
72 |
var otherElement = $(param);
|
|
|
73 |
return $.trim(otherElement.val()).length > 0;
|
|
|
74 |
}, 'ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY');
|
|
|
75 |
|
|
|
76 |
var autocompleteLocation = new google.maps.places.Autocomplete(
|
|
|
77 |
(document.getElementById('location_search')),
|
|
|
78 |
{types: ['(cities)']}
|
|
|
79 |
);
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
$.fn.fillInAddressLocation = function() {
|
|
|
83 |
console.log('fillInAddressLocation');
|
|
|
84 |
|
|
|
85 |
var place = autocompleteLocation.getPlace();
|
|
|
86 |
if (!place.geometry) {
|
|
|
87 |
$.fn.showError('ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY')
|
|
|
88 |
return;
|
|
|
89 |
} else {
|
|
|
90 |
address1 = '';
|
|
|
91 |
address2 = '';
|
|
|
92 |
city1 = '';
|
|
|
93 |
city2 = '';
|
|
|
94 |
state = '';
|
|
|
95 |
country = '';
|
|
|
96 |
postal_code = '';
|
|
|
97 |
|
|
|
98 |
formatted_address = place.formatted_address;
|
|
|
99 |
latitude = place.geometry.location.lat();
|
|
|
100 |
longitude = place.geometry.location.lng();
|
|
|
101 |
var arrAddress = place.address_components;
|
|
|
102 |
|
|
|
103 |
$.each(arrAddress, function(i, address_component) {
|
|
|
104 |
if (address_component.types[0] == "route") {
|
|
|
105 |
address1 = address_component.long_name;
|
|
|
106 |
}
|
|
|
107 |
if (address_component.types[0] == "sublocality") {
|
|
|
108 |
address2 = address_component.long_name;
|
|
|
109 |
}
|
|
|
110 |
if (address_component.types[0] == "locality") {
|
|
|
111 |
city1 = address_component.long_name;
|
|
|
112 |
}
|
|
|
113 |
if (address_component.types[0] == "administrative_area_level_2") {
|
|
|
114 |
city2 = address_component.long_name;
|
|
|
115 |
}
|
|
|
116 |
if (address_component.types[0] == "administrative_area_level_1") {
|
|
|
117 |
state = address_component.long_name;
|
|
|
118 |
}
|
|
|
119 |
if (address_component.types[0] == "country") {
|
|
|
120 |
country = address_component.long_name;
|
|
|
121 |
}
|
|
|
122 |
if (address_component.types[0] == "postal_code") {
|
|
|
123 |
postal_code = address_component.long_name;
|
|
|
124 |
}
|
|
|
125 |
});
|
|
|
126 |
|
|
|
127 |
$('#form-location #formatted_address').val(formatted_address);
|
|
|
128 |
$('#form-location #address1').val(address1);
|
|
|
129 |
$('#form-location #address2').val(address2);
|
|
|
130 |
$('#form-location #city1').val(city1);
|
|
|
131 |
$('#form-location #city2').val(city2);
|
|
|
132 |
$('#form-location #state').val(state);
|
|
|
133 |
$('#form-location #country').val(country);
|
|
|
134 |
$('#form-location #postal_code').val(postal_code);
|
|
|
135 |
$('#form-location #latitude').val(latitude);
|
|
|
136 |
$('#form-location #longitude').val(longitude);
|
|
|
137 |
|
|
|
138 |
}
|
|
|
139 |
}
|
6539 |
stevensc |
140 |
|
1 |
www |
141 |
$.fn.renderLocation = function(data) {
|
|
|
142 |
$('#locations-records').empty();
|
|
|
143 |
if(Array.isArray(data)) {
|
|
|
144 |
max = data.length;
|
|
|
145 |
for(i = 0; i < max; i++)
|
|
|
146 |
{
|
|
|
147 |
var location = data[i];
|
|
|
148 |
s = '<p>' + location['formatted_address'];
|
|
|
149 |
if(location['is_main'] == 'y') {
|
|
|
150 |
s = s + ' (LABEL_MAIN_LOCATION) ';
|
|
|
151 |
}
|
|
|
152 |
s = s + ' <a href="#" title="" data-link="' + location['link_edit'] + '" class="btn-location-edit"><i class="fa fa-pencil"></i></a> ';
|
|
|
153 |
s = s + ' <a href="#" title="" data-link="' + location['link_delete'] + '" class="btn-location-delete"><i class="fa fa-trash"></i></a>';
|
|
|
154 |
s = s + ' </p>';
|
|
|
155 |
|
|
|
156 |
if(i < (max - 1)) {
|
|
|
157 |
s = s + '<hr/>';
|
|
|
158 |
}
|
|
|
159 |
$('#locations-records').append(s);
|
|
|
160 |
}
|
|
|
161 |
}
|
|
|
162 |
}
|
|
|
163 |
|
|
|
164 |
$.validator.setDefaults({
|
|
|
165 |
debug: true,
|
|
|
166 |
highlight: function(element) {
|
|
|
167 |
$(element).addClass('is-invalid');
|
|
|
168 |
},
|
|
|
169 |
unhighlight: function(element) {
|
|
|
170 |
$(element).removeClass('is-invalid');
|
|
|
171 |
},
|
|
|
172 |
errorElement: 'span',
|
|
|
173 |
errorClass: 'error invalid-feedback',
|
|
|
174 |
errorPlacement: function(error, element) {
|
|
|
175 |
if(element.parent('.form-group').length) {
|
|
|
176 |
error.insertAfter(element);
|
|
|
177 |
} else if(element.parent('.toggle').length) {
|
|
|
178 |
error.insertAfter(element.parent().parent());
|
|
|
179 |
} else {
|
|
|
180 |
error.insertAfter(element.parent());
|
|
|
181 |
}
|
|
|
182 |
}
|
|
|
183 |
});
|
|
|
184 |
|
|
|
185 |
$.fn.showFormErrorValidator = function(fieldname, errors) {
|
|
|
186 |
var field = $(fieldname);
|
|
|
187 |
if(field) {
|
|
|
188 |
$(field).addClass('is-invalid');
|
|
|
189 |
|
|
|
190 |
|
|
|
191 |
var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
|
|
|
192 |
if(field.parent('.form-group').length) {
|
|
|
193 |
error.insertAfter(field);
|
|
|
194 |
} else if(field.parent('.toggle').length) {
|
|
|
195 |
error.insertAfter(field.parent().parent());
|
|
|
196 |
} else {
|
|
|
197 |
error.insertAfter(field.parent());
|
|
|
198 |
}
|
|
|
199 |
}
|
|
|
200 |
};
|
|
|
201 |
|
|
|
202 |
var validatorLocation = $('#form-location').validate({
|
|
|
203 |
debug: true,
|
|
|
204 |
onclick: false,
|
|
|
205 |
onkeyup: false,
|
|
|
206 |
onfocusout: false,
|
|
|
207 |
ignore: [],
|
|
|
208 |
rules: {
|
|
|
209 |
'location_search': {
|
|
|
210 |
required: true,
|
|
|
211 |
checkLocation: '#form-location #latitude'
|
|
|
212 |
}
|
|
|
213 |
},
|
|
|
214 |
submitHandler: function(form)
|
|
|
215 |
{
|
|
|
216 |
NProgress.start();
|
|
|
217 |
$.ajax({
|
|
|
218 |
'dataType' : 'json',
|
|
|
219 |
'accept' : 'application/json',
|
|
|
220 |
'method' : 'post',
|
|
|
221 |
'url' : $('#form-location').attr('action'),
|
|
|
222 |
'data' : $('#form-location').serialize(),
|
|
|
223 |
}).done(function(response) {
|
|
|
224 |
if(response['success']) {
|
|
|
225 |
$.fn.renderLocation(response['data']);
|
|
|
226 |
|
|
|
227 |
$("#location-box").modal('hide');
|
|
|
228 |
} else {
|
|
|
229 |
validatorLocation.resetForm();
|
|
|
230 |
$.fn.showError(response['data']);
|
|
|
231 |
}
|
|
|
232 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
233 |
$.fn.showError(textStatus);
|
|
|
234 |
}).always(function() {
|
|
|
235 |
NProgress.done();
|
|
|
236 |
});
|
|
|
237 |
return false;
|
|
|
238 |
},
|
|
|
239 |
invalidHandler: function(form, validator) {
|
|
|
240 |
|
|
|
241 |
}
|
|
|
242 |
});
|
|
|
243 |
|
|
|
244 |
$('.btn-location-add').on("click", function(e){
|
|
|
245 |
e.preventDefault();
|
|
|
246 |
|
|
|
247 |
$('#form-location').attr('action', '$routeLocationAdd');
|
|
|
248 |
$('#form-location #location_search').val('');
|
|
|
249 |
$('#form-location #formatted_address').val('');
|
|
|
250 |
$('#form-location #address1').val('');
|
|
|
251 |
$('#form-location #address2').val('');
|
|
|
252 |
$('#form-location #country').val('');
|
|
|
253 |
$('#form-location #state').val('');
|
|
|
254 |
$('#form-location #city1').val('');
|
|
|
255 |
$('#form-location #city2').val('');
|
|
|
256 |
$('#form-location #postal_code').val('');
|
|
|
257 |
$('#form-location #latitude').val('');
|
|
|
258 |
$('#form-location #longitude').val('');
|
|
|
259 |
validatorLocation.resetForm();
|
|
|
260 |
|
|
|
261 |
$("#location-box").modal('show');
|
|
|
262 |
});
|
|
|
263 |
|
|
|
264 |
$('body').on('click', 'a.btn-location-edit', function(e) {
|
|
|
265 |
e.preventDefault();
|
|
|
266 |
|
|
|
267 |
var url = $(this).data('link');
|
|
|
268 |
|
|
|
269 |
NProgress.start();
|
|
|
270 |
$.ajax({
|
|
|
271 |
'dataType' : 'json',
|
|
|
272 |
'accept' : 'application/json',
|
|
|
273 |
'method' : 'get',
|
|
|
274 |
'url' : url,
|
|
|
275 |
}).done(function(response) {
|
|
|
276 |
if(response['success']) {
|
|
|
277 |
$('#form-location').attr('action', url);
|
|
|
278 |
$('#form-location #location_search').val(response['data']['formatted_address']);
|
|
|
279 |
$('#form-location #formatted_address').val(response['data']['formatted_address']);
|
|
|
280 |
$('#form-location #address1').val(response['data']['address1']);
|
|
|
281 |
$('#form-location #address2').val(response['data']['address2']);
|
|
|
282 |
$('#form-location #country').val(response['data']['country']);
|
|
|
283 |
$('#form-location #state').val(response['data']['state']);
|
|
|
284 |
$('#form-location #city1').val(response['data']['city1']);
|
|
|
285 |
$('#form-location #city2').val(response['data']['city2']);
|
|
|
286 |
$('#form-location #postal_code').val(response['data']['postal_code']);
|
|
|
287 |
$('#form-location #latitude').val(response['data']['latitude']);
|
|
|
288 |
$('#form-location #longitude').val(response['data']['longitude']);
|
|
|
289 |
|
|
|
290 |
if(response['data']['is_main'] == 'y') {
|
|
|
291 |
$('#form-location #is_main').bootstrapToggle('on')
|
|
|
292 |
} else {
|
|
|
293 |
$('#form-location #is_main').bootstrapToggle('off')
|
|
|
294 |
}
|
|
|
295 |
|
|
|
296 |
validatorLocation.resetForm();
|
|
|
297 |
|
|
|
298 |
$("#location-box").modal('show');
|
|
|
299 |
} else {
|
|
|
300 |
$.fn.showError(response['data']);
|
|
|
301 |
}
|
|
|
302 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
303 |
$.fn.showError(textStatus);
|
|
|
304 |
}).always(function() {
|
|
|
305 |
NProgress.done();
|
|
|
306 |
});
|
|
|
307 |
return false;
|
|
|
308 |
|
|
|
309 |
|
|
|
310 |
});
|
|
|
311 |
|
|
|
312 |
$('body').on('click', 'a.btn-location-delete', function(e) {
|
|
|
313 |
e.preventDefault();
|
|
|
314 |
|
|
|
315 |
var url = $(this).data('link');
|
|
|
316 |
|
|
|
317 |
NProgress.start();
|
|
|
318 |
$.ajax({
|
|
|
319 |
'dataType' : 'json',
|
|
|
320 |
'accept' : 'application/json',
|
|
|
321 |
'method' : 'post',
|
|
|
322 |
'url' : url,
|
|
|
323 |
}).done(function(response) {
|
|
|
324 |
if(response['success']) {
|
|
|
325 |
$.fn.renderLocation(response['data']);
|
|
|
326 |
} else {
|
|
|
327 |
$.fn.showError(response['data']);
|
|
|
328 |
}
|
|
|
329 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
330 |
$.fn.showError(textStatus);
|
|
|
331 |
}).always(function() {
|
|
|
332 |
NProgress.done();
|
|
|
333 |
});
|
|
|
334 |
return false;
|
|
|
335 |
|
|
|
336 |
|
|
|
337 |
});
|
|
|
338 |
|
|
|
339 |
|
|
|
340 |
$('.btn-location-close').on("click", function(e){
|
|
|
341 |
e.preventDefault();
|
|
|
342 |
|
|
|
343 |
$("#location-box").modal('hide');
|
|
|
344 |
return false;
|
|
|
345 |
});
|
|
|
346 |
|
6486 |
stevensc |
347 |
var validatorCompanySize = $('#form-company-size').validate({
|
|
|
348 |
debug: true,
|
|
|
349 |
onclick: false,
|
|
|
350 |
onkeyup: false,
|
|
|
351 |
onfocusout: false,
|
|
|
352 |
ignore: [],
|
|
|
353 |
rules: {
|
|
|
354 |
'company_size_id': {
|
|
|
355 |
required: true,
|
|
|
356 |
},
|
|
|
357 |
},
|
|
|
358 |
|
|
|
359 |
submitHandler: function(form)
|
|
|
360 |
{
|
|
|
361 |
NProgress.start();
|
|
|
362 |
$.ajax({
|
|
|
363 |
'dataType' : 'json',
|
|
|
364 |
'accept' : 'application/json',
|
|
|
365 |
'method' : 'post',
|
|
|
366 |
'url' : $('#form-company-size').attr('action'),
|
|
|
367 |
'data' : $('#form-company-size').serialize()
|
|
|
368 |
}).done(function(response) {
|
|
|
369 |
if(response['success']) {
|
|
|
370 |
|
|
|
371 |
$('#overview-company-size').html(response['data']);
|
|
|
372 |
$("#company-size-box").modal('hide');
|
|
|
373 |
} else {
|
|
|
374 |
validatorCompanySize.resetForm();
|
|
|
375 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
376 |
$.fn.showError(response['data']);
|
|
|
377 |
} else {
|
|
|
378 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
379 |
$.fn.showFormErrorValidator('#form-company-size #' + fieldname, errors);
|
|
|
380 |
});
|
|
|
381 |
}
|
|
|
382 |
}
|
|
|
383 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
384 |
$.fn.showError(textStatus);
|
|
|
385 |
}).always(function() {
|
|
|
386 |
NProgress.done();
|
|
|
387 |
});
|
|
|
388 |
return false;
|
|
|
389 |
},
|
|
|
390 |
invalidHandler: function(form, validator) {
|
|
|
391 |
|
|
|
392 |
}
|
|
|
393 |
});
|
|
|
394 |
|
|
|
395 |
|
|
|
396 |
$('.btn-company-size-edit').on("click", function(e){
|
|
|
397 |
e.preventDefault();
|
|
|
398 |
|
|
|
399 |
NProgress.start();
|
|
|
400 |
$.ajax({
|
|
|
401 |
'dataType' : 'json',
|
|
|
402 |
'accept' : 'application/json',
|
|
|
403 |
'method' : 'get',
|
|
|
404 |
'url' : '$routeCompanySize',
|
|
|
405 |
}).done(function(response) {
|
|
|
406 |
if(response['success']) {
|
|
|
407 |
$('#form-company-size #company_size_id').val(response['data']['company_size_id']).trigger('change');
|
|
|
408 |
|
|
|
409 |
validatorCompanySize.resetForm();
|
|
|
410 |
|
|
|
411 |
$("#company-size-box").modal('show');
|
|
|
412 |
} else {
|
|
|
413 |
$.fn.showError(response['data']);
|
|
|
414 |
}
|
|
|
415 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
416 |
$.fn.showError(textStatus);
|
|
|
417 |
}).always(function() {
|
|
|
418 |
NProgress.done();
|
|
|
419 |
});
|
|
|
420 |
return false;
|
|
|
421 |
|
|
|
422 |
});
|
|
|
423 |
|
|
|
424 |
$('.btn-company-size-close').on("click", function(e){
|
|
|
425 |
e.preventDefault();
|
|
|
426 |
|
|
|
427 |
$("#company-size-box").modal('hide');
|
|
|
428 |
return false;
|
|
|
429 |
});
|
|
|
430 |
|
1 |
www |
431 |
var validatorIndustry = $('#form-industry').validate({
|
|
|
432 |
debug: true,
|
|
|
433 |
onclick: false,
|
|
|
434 |
onkeyup: false,
|
|
|
435 |
onfocusout: false,
|
|
|
436 |
ignore: [],
|
|
|
437 |
rules: {
|
|
|
438 |
'industry_id': {
|
|
|
439 |
required: true,
|
|
|
440 |
},
|
|
|
441 |
},
|
|
|
442 |
|
|
|
443 |
submitHandler: function(form)
|
|
|
444 |
{
|
|
|
445 |
NProgress.start();
|
|
|
446 |
$.ajax({
|
|
|
447 |
'dataType' : 'json',
|
|
|
448 |
'accept' : 'application/json',
|
|
|
449 |
'method' : 'post',
|
|
|
450 |
'url' : $('#form-industry').attr('action'),
|
|
|
451 |
'data' : $('#form-industry').serialize()
|
|
|
452 |
}).done(function(response) {
|
|
|
453 |
if(response['success']) {
|
|
|
454 |
|
|
|
455 |
$('#overview-industry').html(response['data']);
|
|
|
456 |
$("#industry-box").modal('hide');
|
|
|
457 |
} else {
|
|
|
458 |
validatorIndustry.resetForm();
|
|
|
459 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
460 |
$.fn.showError(response['data']);
|
|
|
461 |
} else {
|
|
|
462 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
463 |
$.fn.showFormErrorValidator('#form-industry #' + fieldname, errors);
|
|
|
464 |
});
|
|
|
465 |
}
|
|
|
466 |
}
|
|
|
467 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
468 |
$.fn.showError(textStatus);
|
|
|
469 |
}).always(function() {
|
|
|
470 |
NProgress.done();
|
|
|
471 |
});
|
|
|
472 |
return false;
|
|
|
473 |
},
|
|
|
474 |
invalidHandler: function(form, validator) {
|
|
|
475 |
|
|
|
476 |
}
|
|
|
477 |
});
|
|
|
478 |
|
|
|
479 |
|
|
|
480 |
$('.btn-industry-edit').on("click", function(e){
|
|
|
481 |
e.preventDefault();
|
|
|
482 |
|
|
|
483 |
NProgress.start();
|
|
|
484 |
$.ajax({
|
|
|
485 |
'dataType' : 'json',
|
|
|
486 |
'accept' : 'application/json',
|
|
|
487 |
'method' : 'get',
|
|
|
488 |
'url' : '$routeIndustry',
|
|
|
489 |
}).done(function(response) {
|
|
|
490 |
if(response['success']) {
|
|
|
491 |
$('#form-industry #industry_id').val(response['data']['industry_id']).trigger('change');
|
|
|
492 |
|
|
|
493 |
validatorIndustry.resetForm();
|
|
|
494 |
|
|
|
495 |
$("#industry-box").modal('show');
|
|
|
496 |
} else {
|
|
|
497 |
$.fn.showError(response['data']);
|
|
|
498 |
}
|
|
|
499 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
500 |
$.fn.showError(textStatus);
|
|
|
501 |
}).always(function() {
|
|
|
502 |
NProgress.done();
|
|
|
503 |
});
|
|
|
504 |
return false;
|
|
|
505 |
|
|
|
506 |
});
|
|
|
507 |
|
|
|
508 |
$('.btn-industry-close').on("click", function(e){
|
|
|
509 |
e.preventDefault();
|
|
|
510 |
|
|
|
511 |
$("#industry-box").modal('hide');
|
|
|
512 |
return false;
|
|
|
513 |
});
|
|
|
514 |
|
|
|
515 |
$("#form-cover #cover").fileinput({
|
|
|
516 |
theme: 'fas',
|
|
|
517 |
language: 'es',
|
|
|
518 |
showUpload: false,
|
|
|
519 |
dropZoneEnabled: false,
|
|
|
520 |
maxFileCount: 1,
|
|
|
521 |
allowedFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
|
|
|
522 |
mainClass: "input-group",
|
|
|
523 |
msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size_cover',
|
|
|
524 |
});
|
|
|
525 |
|
|
|
526 |
CKEDITOR.replace('description');
|
|
|
527 |
|
|
|
528 |
autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);
|
|
|
529 |
|
|
|
530 |
$('#form-location #is_main').bootstrapToggle({'on' : 'LABEL_MAIN_LOCATION', 'off' : 'LABEL_SECONDARY_LOCATION', 'width' : '160px', 'height' : '40px'});
|
|
|
531 |
|
|
|
532 |
});
|
|
|
533 |
|
|
|
534 |
JS;
|
|
|
535 |
$this->inlineScript()->captureEnd();
|
|
|
536 |
|
6005 |
stevensc |
537 |
$jsonLocations = json_encode($locations);
|
5743 |
stevensc |
538 |
$js = <<<JS
|
|
|
539 |
const urlVars = {
|
|
|
540 |
routeWebsite: "$routeWebsite",
|
|
|
541 |
routeCompanySize: "$routeCompanySize",
|
|
|
542 |
routeIndustry: "$routeIndustry",
|
|
|
543 |
routeExtended: "$routeExtended",
|
|
|
544 |
routeSocialNetworks: "$routeSocialNetworks",
|
|
|
545 |
routeLocationAdd: "$routeLocationAdd",
|
|
|
546 |
routeFoundationYear: "$routeFoundationYear",
|
|
|
547 |
routeImageUpload: "$routeImageUpload",
|
|
|
548 |
routeCoverUpload: "$routeCoverUpload",
|
|
|
549 |
routeFooterUpload: "$routeFooterUpload",
|
5757 |
stevensc |
550 |
routeHeaderUpload: "$routeHeaderUpload",
|
|
|
551 |
cover: "$cover",
|
5795 |
stevensc |
552 |
companyId: "$companyId",
|
5925 |
stevensc |
553 |
followers: "$follower",
|
5988 |
stevensc |
554 |
image: "$image",
|
6002 |
stevensc |
555 |
overview: "$overview",
|
6025 |
stevensc |
556 |
locations: JSON.parse('$jsonLocations'),
|
6026 |
stevensc |
557 |
industry: "$industry",
|
6027 |
stevensc |
558 |
companySize: "$company_size",
|
6050 |
stevensc |
559 |
companyName: "$company_name",
|
|
|
560 |
foundationYear: "$foundation_year",
|
6055 |
stevensc |
561 |
website: "$website",
|
6059 |
stevensc |
562 |
header: "$header",
|
|
|
563 |
footer: "$footer"
|
5743 |
stevensc |
564 |
}
|
|
|
565 |
JS;
|
|
|
566 |
|
|
|
567 |
$this->inlineScript()->appendScript($js);
|
6448 |
stevensc |
568 |
$this->headLink()->appendStylesheet('/react-bundles/profile/main.css');
|
5743 |
stevensc |
569 |
$this->inlineScript()->appendFile('/react-bundles/profile/profileBundle.js');
|
1 |
www |
570 |
?>
|
|
|
571 |
|
777 |
geraldo |
572 |
<style>
|
5743 |
stevensc |
573 |
.user-profile-ov {
|
|
|
574 |
position: relative;
|
|
|
575 |
}
|
777 |
geraldo |
576 |
|
5743 |
stevensc |
577 |
.user-profile-ov .add-dp {
|
|
|
578 |
position: absolute;
|
|
|
579 |
top: 30%;
|
|
|
580 |
right: 10%;
|
|
|
581 |
}
|
779 |
geraldo |
582 |
|
5743 |
stevensc |
583 |
.user-profile-ov .add-dp i {
|
|
|
584 |
font-size: 14px;
|
|
|
585 |
border: 2px solid #fff;
|
|
|
586 |
background: #e44d3a;
|
|
|
587 |
padding: 11px;
|
|
|
588 |
color: #ffff
|
|
|
589 |
}
|
777 |
geraldo |
590 |
</style>
|
|
|
591 |
|
1 |
www |
592 |
<!-- Content Header (Page header) -->
|
5743 |
stevensc |
593 |
<div id="profile">
|
5800 |
stevensc |
594 |
</div>
|
1 |
www |
595 |
<div class="modal" tabindex="-1" role="dialog" id="industry-box">
|
5743 |
stevensc |
596 |
<div class="modal-dialog" role="document">
|
|
|
597 |
<?php
|
|
|
598 |
$form = $this->formIndustry;
|
|
|
599 |
$form->setAttributes([
|
|
|
600 |
'method' => 'post',
|
|
|
601 |
'action' => $routeIndustry,
|
|
|
602 |
'name' => 'form-industry',
|
|
|
603 |
'id' => 'form-industry'
|
|
|
604 |
]);
|
|
|
605 |
$form->prepare();
|
|
|
606 |
echo $this->form()->openTag($form);
|
|
|
607 |
?>
|
|
|
608 |
<div class="modal-content">
|
|
|
609 |
<div class="modal-header">
|
|
|
610 |
<h3 class="modal-title">LABEL_CHANGE</h3>
|
770 |
geraldo |
611 |
</div>
|
5743 |
stevensc |
612 |
<div class="modal-body">
|
|
|
613 |
<div class="form-group">
|
|
|
614 |
<?php
|
|
|
615 |
$element = $form->get('industry_id');
|
|
|
616 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
617 |
$element->setOptions(['label' => 'LABEL_INDUSTRY']);
|
|
|
618 |
echo $this->formLabel($element);
|
|
|
619 |
echo $this->formSelect($element);
|
|
|
620 |
?>
|
|
|
621 |
</div>
|
|
|
622 |
</div>
|
|
|
623 |
<div class="modal-footer">
|
|
|
624 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
625 |
<button type="button" class="btn btn-default btn-industry-close">LABEL_CANCEL</button>
|
|
|
626 |
</div>
|
|
|
627 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
628 |
</div>
|
|
|
629 |
</div>
|
1 |
www |
630 |
</div>
|
|
|
631 |
<div class="modal" tabindex="-1" role="dialog" id="company-size-box">
|
5743 |
stevensc |
632 |
<div class="modal-dialog" role="document">
|
|
|
633 |
<?php
|
|
|
634 |
$form = $this->formCompanySize;
|
|
|
635 |
$form->setAttributes([
|
|
|
636 |
'method' => 'post',
|
|
|
637 |
'action' => $routeCompanySize,
|
|
|
638 |
'name' => 'form-company-size',
|
|
|
639 |
'id' => 'form-company-size'
|
|
|
640 |
]);
|
|
|
641 |
$form->prepare();
|
|
|
642 |
echo $this->form()->openTag($form);
|
|
|
643 |
?>
|
|
|
644 |
<div class="modal-content">
|
|
|
645 |
<div class="modal-header">
|
|
|
646 |
<h3 class="modal-title">LABEL_CHANGE</h3>
|
770 |
geraldo |
647 |
</div>
|
5743 |
stevensc |
648 |
<div class="modal-body">
|
|
|
649 |
<div class="form-group">
|
|
|
650 |
<?php
|
|
|
651 |
$element = $form->get('company_size_id');
|
|
|
652 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
653 |
$element->setOptions(['label' => 'LABEL_COMPANY_SIZE']);
|
|
|
654 |
echo $this->formLabel($element);
|
|
|
655 |
echo $this->formSelect($element);
|
|
|
656 |
?>
|
|
|
657 |
</div>
|
|
|
658 |
</div>
|
|
|
659 |
<div class="modal-footer">
|
|
|
660 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
661 |
<button type="button" class="btn btn-default btn-company-size-close">LABEL_CANCEL</button>
|
|
|
662 |
</div>
|
|
|
663 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
664 |
</div>
|
|
|
665 |
</div>
|
1 |
www |
666 |
</div>
|
|
|
667 |
<div class="modal" tabindex="-1" role="dialog" id="location-box">
|
5743 |
stevensc |
668 |
<div class="modal-dialog" role="document">
|
|
|
669 |
<?php
|
|
|
670 |
$form = $this->formLocation;
|
|
|
671 |
$form->setAttributes([
|
|
|
672 |
'method' => 'post',
|
|
|
673 |
'action' => '',
|
|
|
674 |
'name' => 'form-location',
|
|
|
675 |
'id' => 'form-location'
|
|
|
676 |
]);
|
|
|
677 |
$form->prepare();
|
|
|
678 |
echo $this->form()->openTag($form);
|
|
|
679 |
|
|
|
680 |
$fieldnames = [
|
|
|
681 |
'formatted_address',
|
|
|
682 |
'address1',
|
|
|
683 |
'address2',
|
|
|
684 |
'country',
|
|
|
685 |
'state',
|
|
|
686 |
'city1',
|
|
|
687 |
'city2',
|
|
|
688 |
'postal_code',
|
|
|
689 |
'latitude',
|
|
|
690 |
'longitude',
|
|
|
691 |
];
|
|
|
692 |
|
|
|
693 |
foreach ($fieldnames as $fieldname) {
|
|
|
694 |
|
|
|
695 |
$element = $form->get($fieldname);
|
|
|
696 |
echo $this->formHidden($element);
|
|
|
697 |
}
|
|
|
698 |
?>
|
|
|
699 |
<div class="modal-content">
|
|
|
700 |
<div class="modal-header">
|
|
|
701 |
<h3 class="modal-title">LABEL_CHANGE</h3>
|
770 |
geraldo |
702 |
</div>
|
5743 |
stevensc |
703 |
<div class="modal-body">
|
|
|
704 |
<div class="form-group datefm">
|
|
|
705 |
<?php
|
|
|
706 |
$element = $form->get('location_search');
|
|
|
707 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
708 |
$element->setOptions(['label' => 'LABEL_LOCATION']);
|
|
|
709 |
echo $this->formLabel($element);
|
|
|
710 |
echo $this->formText($element);
|
|
|
711 |
?>
|
|
|
712 |
<i class="fa fa-map-marker"></i>
|
|
|
713 |
</div>
|
|
|
714 |
<div class="form-group">
|
|
|
715 |
<?php
|
|
|
716 |
$element = $form->get('is_main');
|
|
|
717 |
echo $this->formCheckbox($element);
|
|
|
718 |
?>
|
|
|
719 |
</div>
|
770 |
geraldo |
720 |
</div>
|
5743 |
stevensc |
721 |
<div class="modal-footer">
|
|
|
722 |
<button type="submit" class="btn btn-primary ">LABEL_SAVE</button>
|
|
|
723 |
<button type="button" class="btn btn-default btn-location-close">LABEL_CANCEL</button>
|
|
|
724 |
</div>
|
|
|
725 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
726 |
</div>
|
|
|
727 |
</div>
|
6060 |
stevensc |
728 |
</div>
|