1 |
www |
1 |
<?php
|
4554 |
stevensc |
2 |
|
4553 |
stevensc |
3 |
use LeadersLinked\Model\Theme;
|
1 |
www |
4 |
|
|
|
5 |
$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
|
|
|
6 |
|
4553 |
stevensc |
7 |
$currentNetworkHelper = $this->currentNetworkHelper();
|
|
|
8 |
$currentNetwork = $currentNetworkHelper->getNetwork();
|
|
|
9 |
|
1 |
www |
10 |
// months
|
|
|
11 |
$months = [
|
|
|
12 |
'LABEL_MONTH_JANUARY',
|
|
|
13 |
'LABEL_MONTH_FEBRUARY',
|
|
|
14 |
'LABEL_MONTH_MARCH',
|
|
|
15 |
'LABEL_MONTH_APRIL',
|
|
|
16 |
'LABEL_MONTH_MAY',
|
|
|
17 |
'LABEL_MONTH_JUNE',
|
|
|
18 |
'LABEL_MONTH_JULY',
|
|
|
19 |
'LABEL_MONTH_AUGUST',
|
|
|
20 |
'LABEL_MONTH_SEPTEMBER',
|
|
|
21 |
'LABEL_MONTH_OCTOBER',
|
|
|
22 |
'LABEL_MONTH_NOVEMBER',
|
|
|
23 |
'LABEL_MONTH_DECEMBER',
|
|
|
24 |
];
|
|
|
25 |
|
|
|
26 |
// vars to json
|
|
|
27 |
$userExperiences = json_encode($user_experiences);
|
|
|
28 |
$userEducations = json_encode($user_educations);
|
|
|
29 |
$monthsJson = json_encode($months);
|
|
|
30 |
$userLanguages = json_encode($user_languages);
|
|
|
31 |
$userSkills = json_encode($user_skills);
|
|
|
32 |
$companySizesOptions = json_encode($company_sizes);
|
|
|
33 |
$degreesOptions = json_encode($degrees);
|
|
|
34 |
$industriesOptions = json_encode($industries);
|
|
|
35 |
$languagesOptions = json_encode($languages);
|
|
|
36 |
$skillsOptions = json_encode($skills);
|
3912 |
efrain |
37 |
$userAptitudes = json_encode($user_aptitudes);
|
|
|
38 |
$userHobbiesAndInterests = json_encode($user_hobbies_and_interests);
|
|
|
39 |
$aptitudesOptions = json_encode($aptitudes);
|
|
|
40 |
$hobbiesAndInterestsOptions = json_encode($hobbies_and_interests);
|
|
|
41 |
|
1 |
www |
42 |
$googleMapPlacesUrl = 'https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places';
|
|
|
43 |
$error_msg = "Por favor seleccione una ubicación real";
|
|
|
44 |
|
|
|
45 |
$js = <<<JS
|
|
|
46 |
// autoComplete place
|
|
|
47 |
let autoComplete;
|
|
|
48 |
|
|
|
49 |
function handleScriptLoad(updateQuery, autoCompleteRef, setAddresObject, setError) {
|
|
|
50 |
autoComplete = new window.google.maps.places.Autocomplete(
|
6550 |
stevensc |
51 |
autoCompleteRef.current
|
1 |
www |
52 |
);
|
|
|
53 |
autoComplete.setFields(["address_components", "formatted_address", "geometry"]);
|
|
|
54 |
autoComplete.addListener("place_changed", () =>
|
4675 |
stevensc |
55 |
handlePlaceSelect(updateQuery, setAddresObject, setError)
|
1 |
www |
56 |
);
|
|
|
57 |
}
|
|
|
58 |
|
4675 |
stevensc |
59 |
async function handlePlaceSelect(updateQuery, setAddresObject, setError) {
|
|
|
60 |
const addressObject = autoComplete.getPlace();
|
|
|
61 |
// console.log(addressObject.geometry.location.lat());
|
|
|
62 |
// console.log(addressObject.geometry.location.lng());
|
|
|
63 |
const query = addressObject.formatted_address;
|
|
|
64 |
if(query){
|
|
|
65 |
setError("");
|
1 |
www |
66 |
updateQuery(query);
|
5081 |
stevensc |
67 |
setAddresObject({
|
|
|
68 |
...addressObject,
|
|
|
69 |
address_components:[
|
|
|
70 |
...addressObject.address_components,
|
|
|
71 |
{
|
|
|
72 |
latitude: addressObject.geometry.location.lat(),
|
|
|
73 |
longitude: addressObject.geometry.location.lng(),
|
|
|
74 |
types:["geometry"]
|
|
|
75 |
}
|
|
|
76 |
]
|
|
|
77 |
});
|
4675 |
stevensc |
78 |
}else{
|
|
|
79 |
setError("$error_msg");
|
|
|
80 |
}
|
5082 |
stevensc |
81 |
}
|
1 |
www |
82 |
|
5890 |
stevensc |
83 |
const skillsArray = Object.entries($userSkills).map(([key, value]) => ({ value: key, name: value }))
|
|
|
84 |
const skillsOptions = Object.entries($skillsOptions).map(([key, value]) => ({ value: key, name: value }))
|
|
|
85 |
const languagesArray = Object.entries($userLanguages).map(([key, value]) => ({ value: key, name: value }))
|
|
|
86 |
const languagesOptions = Object.entries($languagesOptions).map(([key, value]) => ({ value: key, name: value }))
|
|
|
87 |
const aptitudesArray = Object.entries($userAptitudes).map(([key, value]) => ({ value: key, name: value }))
|
|
|
88 |
const aptitudesOptions = Object.entries($aptitudesOptions).map(([key, value]) => ({ value: key, name: value }))
|
|
|
89 |
const userHobbiesAndInterests = Object.entries($userHobbiesAndInterests).map(([key, value]) => ({ value: key, name: value }))
|
|
|
90 |
const hobbiesAndInterestsOptions = Object.entries($hobbiesAndInterestsOptions).map(([key, value]) => ({ value: key, name: value }))
|
|
|
91 |
|
1 |
www |
92 |
const backendVars = {
|
5493 |
stevensc |
93 |
uuid:"$user_uuid",
|
|
|
94 |
profileId:"$user_profile_uuid",
|
1 |
www |
95 |
cover:"$cover",
|
|
|
96 |
following:"$following",
|
|
|
97 |
follower:"$follower",
|
|
|
98 |
image:"$image",
|
|
|
99 |
facebook: "$facebook",
|
|
|
100 |
twitter: "$twitter",
|
|
|
101 |
instagram: "$instagram",
|
|
|
102 |
fullName: `$full_name`,
|
|
|
103 |
overview: `$overview`,
|
4606 |
stevensc |
104 |
formatted_address: "$formatted_address",
|
5493 |
stevensc |
105 |
experiences: $userExperiences,
|
|
|
106 |
educations: $userEducations,
|
|
|
107 |
months: $monthsJson,
|
5890 |
stevensc |
108 |
languages: languagesArray,
|
|
|
109 |
skills: skillsArray,
|
|
|
110 |
aptitudes: aptitudesArray,
|
|
|
111 |
hobbiesAndInterests: userHobbiesAndInterests,
|
5493 |
stevensc |
112 |
sizes: {
|
|
|
113 |
cover: "$image_size_cover",
|
|
|
114 |
image: "$image_size_profile",
|
5495 |
stevensc |
115 |
},
|
5493 |
stevensc |
116 |
options: {
|
|
|
117 |
companySizes: $companySizesOptions,
|
|
|
118 |
degrees: $degreesOptions,
|
|
|
119 |
industries: $industriesOptions,
|
5890 |
stevensc |
120 |
languages: languagesOptions,
|
|
|
121 |
skills: skillsOptions,
|
|
|
122 |
aptitudes: aptitudesOptions,
|
|
|
123 |
hobbiesAndInterests: hobbiesAndInterestsOptions
|
5493 |
stevensc |
124 |
}
|
4573 |
stevensc |
125 |
}
|
3912 |
efrain |
126 |
|
5082 |
stevensc |
127 |
const LABELS = {
|
|
|
128 |
HOBBIES_AND_INTERESTS: 'LABEL_HOBBIES_AND_INTERESTS',
|
5496 |
stevensc |
129 |
DATATABLE_EMPTY: 'LABEL_DATATABLE_EMPTY',
|
|
|
130 |
FOLLOW: 'LABEL_FOLLOW',
|
|
|
131 |
UNFOLLOW: 'LABEL_UNFOLLOW',
|
|
|
132 |
SKILLS: 'LABEL_SKILLS',
|
|
|
133 |
LANGUAGES:'LABEL_LANGUAGES',
|
|
|
134 |
LOCATION:'LABEL_LOCATION',
|
|
|
135 |
EDUCATION:'LABEL_EDUCATION',
|
|
|
136 |
CURRENT:'LABEL_CURRENT',
|
|
|
137 |
EXPERIENCE:'LABEL_EXPERIENCE',
|
|
|
138 |
OVERVIEW:'LABEL_OVERVIEW',
|
|
|
139 |
CONNECTIONS:'LABEL_CONNECTIONS',
|
|
|
140 |
FOLLOWING:'LABEL_FOLLOWING',
|
|
|
141 |
FOLLOWERS:'LABEL_FOLLOWERS',
|
|
|
142 |
PROFILE_NOT_VIEWED: 'LABEL_PROFILE_NOT_VIEWED',
|
|
|
143 |
VIEW_MORE: 'LABEL_VIEW_MORE',
|
|
|
144 |
VIEW_LESS: 'LABEL_VIEW_LESS',
|
|
|
145 |
TITLE_CONFIRM_CONECTION: 'LABEL_TITLE_CONFIRM_CONECTION',
|
|
|
146 |
ACCEPT: 'LABEL_ACCEPT',
|
|
|
147 |
CANCEL:'LABEL_CANCEL',
|
|
|
148 |
CONNECT:'LABEL_CONNECT',
|
|
|
149 |
MESSAGE:'LABEL_MESSAGE',
|
|
|
150 |
PERSONAL_INFO:'LABEL_PERSONAL_INFO',
|
|
|
151 |
APTITUDES:'LABEL_APTITUDES',
|
|
|
152 |
HOBBIES_AND_INTERESTS:'LABEL_HOBBIES_AND_INTERESTS',
|
|
|
153 |
WHO_HAS_SEEN_THIS_PROFILE:'LABEL_WHO_HAS_SEEN_THIS_PROFILE',
|
|
|
154 |
EMPTY:'LABEL_DATATABLE_EMPTY',
|
|
|
155 |
ABOUT_GROUP: 'LABEL_ABOUT_GROUP',
|
|
|
156 |
FIRST_NAME: 'LABEL_FIRST_NAME',
|
|
|
157 |
DESCRIPTION: 'LABEL_DESCRIPTION',
|
|
|
158 |
SOCIAL_NETWORKS: 'LABEL_SOCIAL_NETWORKS',
|
5082 |
stevensc |
159 |
}
|
|
|
160 |
|
5080 |
stevensc |
161 |
JS;
|
5070 |
stevensc |
162 |
|
1 |
www |
163 |
$this->inlineScript()->appendScript($js);
|
5080 |
stevensc |
164 |
|
4553 |
stevensc |
165 |
if ($currentNetwork->theme_id == Theme::THEME_LEADERSLINKED_LINKEDIN) {
|
|
|
166 |
$this->headLink()->appendStylesheet('/react-bundles/profile/edit/main.css');
|
|
|
167 |
$this->inlineScript()->appendFile('/react-bundles/profile/edit/linkedinProfileEditBundle.js');
|
4554 |
stevensc |
168 |
$this->headLink()->appendStylesheet('/react-bundles/profile/view/main.css');
|
|
|
169 |
} else {
|
5494 |
stevensc |
170 |
$this->headLink()->appendStylesheet('/look-and-field/profile.css');
|
4553 |
stevensc |
171 |
$this->inlineScript()->appendFile('/react-bundles/profile/edit/profileEditBundle.js');
|
|
|
172 |
}
|
5080 |
stevensc |
173 |
|
1 |
www |
174 |
?>
|
|
|
175 |
|
|
|
176 |
<div id="react-my-profile-edit">
|
|
|
177 |
<div class="process-comm" id="paginator-process-comm">
|
|
|
178 |
<div class="spinner">
|
|
|
179 |
<div class="bounce1"></div>
|
|
|
180 |
<div class="bounce2"></div>
|
|
|
181 |
<div class="bounce3"></div>
|
|
|
182 |
</div>
|
|
|
183 |
</div>
|
|
|
184 |
</div>
|
|
|
185 |
<script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>
|