teste 1436
Organização
teste 1436
Um erro ocorreu enquanto processava o modelo.
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@111c3261"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 14, column 17]
----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3/>
4
5<#assign
6 viewerHasPrivileges = false
7 userId = themeDisplay.getUserId()
8/>
9
10<#if userId?? && _CUSTOM_FIELD_organization.getData()?? && _CUSTOM_FIELD_organization.getData() !="" >
11 <#assign
12 orgId = _CUSTOM_FIELD_organization.getData()?number
13 viewerHasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
14 organization = OrganizationLocalService.getOrganization(orgId)
15 />
16</#if>
17
18<#assign
19 nome = organization.getName()!""
20 imagem = (viewerHasPrivileges || DDMStructure_Field84114755.getData()!="0")?string(DDMStructure_CampoDeTexto18329557.getData()!"","")
21 tipo = (viewerHasPrivileges || DDMStructure_Numrico28474992.getData()!="0")?string(DDMStructure_Text61401294.getData()!"","")
22 tipo = tipo?replace("\n", "")
23 tipo = tipo?replace("\t", "")
24 tipo = tipo?replace("\r", "")
25 pais = (viewerHasPrivileges || DDMStructure_Field45654872.getData()!="0")?string(DDMStructure_Text47038833.getData()!"","")
26 cidade = (viewerHasPrivileges || DDMStructure_Field81614178.getData()!="0")?string(DDMStructure_Text38119908.getData()!"","")
27 estado = (viewerHasPrivileges || DDMStructure_Field89862022.getData()!="0")?string(DDMStructure_Text87845472.getData()!"","")!""
28
29 site = (viewerHasPrivileges || DDMStructure_Field62760436.getData()!="0")?string(DDMStructure_Text98734375.getData()!"","")
30 instagram = ""
31 linkedin = (viewerHasPrivileges || DDMStructure_Field18557678.getData()!="0")?string(DDMStructure_Text82629110.getData()!"","")
32 facebook = ""
33
34 sobre = (DDMStructure_Field80037203.getData()!="0")?string(DDMStructure_Text54730891.getData()!"","")
35 competencias = (DDMStructure_Numrico42321087.getData()!="0")?string(DDMStructure_Text51537691.getData()!"","")
36 setores = (DDMStructure_Field04200031.getData()!="0")?string("yes","")
37
38 instituicao = (viewerHasPrivileges || DDMStructure_Numrico42321087.getData()!="0")?string(DDMStructure_Text31001996.getData()!"","")
39 tipoDeEntidade = (viewerHasPrivileges || DDMStructure_Numrico28474992.getData()!="0")?string(DDMStructure_Text53411607.getData()!"","")
40
41
42>
43
44<div class="bioec_org_info_container">
45
46 <#if viewerHasPrivileges>
47 <!--<div class="botoesSidebarMobile mb-5">
48 <button class="bioec_secondary_button" data-toggle="modal" data-target="#bioec-org-delete-modal">
49 EXCLUIR ORGANIZAÇÃO
50 </button>
51 <button class="bioec_primary_button" data-toggle="modal" data-target="#bioec-org-edit-modal">
52 EDITAR
53 </button>
54 </div> -->
55 </#if>
56
57 <div id="profilePic">
58 <#if imagem?trim == "">
59 <div class="profilePic-container">
60 <i class="fa fa-user"></i>
61 <a id="btnEditOrgModal" type="button" data-toggle="modal" data-target="#bioec-org-edit-modal">
62 <i class="fa fa-edit"></i>
63 </a>
64 </div>
65 <#else>
66 <div id="ProfilePic_Frame">
67 <img src="${imagem}" />
68 <a id="btnEditOrgModal" type="button" data-toggle="modal" data-target="#bioec-org-edit-modal">
69 <i class="fa fa-edit"></i>
70 </a>
71 </div>
72 </#if>
73
74 </div>
75
76 <#if nome!="">
77 <label class="bioec_org_info_label">Nome da Organização</label>
78 <div class="bioec_org_info_content">${nome}</div>
79 </#if>
80
81 <#if tipo!="">
82 <label class="bioec_org_info_label">Tipo de Organização</label>
83 <div class="bioec_org_info_content">${tipo}</div>
84 </#if>
85
86 <#if instituicao!="" && tipo == "Grupo de Pesquisa/Universidade">
87 <label class="bioec_org_info_label">Instituição</label>
88 <div class="bioec_org_info_content">${instituicao}</div>
89 </#if>
90
91 <#if tipoDeEntidade!="" && tipo == "Investidor/Agência de Fomento">
92 <label class="bioec_org_info_label">Tipo de Entidade</label>
93 <div class="bioec_org_info_content">${tipoDeEntidade}</div>
94 </#if>
95
96 <#if cidade!="">
97 <label class="bioec_org_info_label">Cidade</label>
98 <div class="bioec_org_info_content">${cidade}</div>
99 </#if>
100
101 <#if estado!="">
102 <label class="bioec_org_info_label">Estado</label>
103 <div class="bioec_org_info_content">${estado}</div>
104 </#if>
105
106 <#if pais!="">
107 <label class="bioec_org_info_label">País</label>
108 <div class="bioec_org_info_content">${pais}</div>
109 </#if>
110
111 <div class="bioec_org_info_social_container">
112 <#if site != "">
113 <a href="${site}" target="_blank" rel="noopener noreferrer">
114 <i class="fa-solid fa-laptop"></i>
115 </a>
116 </#if>
117
118 <#if instagram != "">
119 <a href="${instagram}" target="_blank" rel="noopener noreferrer">
120 <i class="fa-brands fa-instagram"></i>
121 </a>
122 </#if>
123
124 <#if linkedin != "">
125 <a href="${linkedin}" target="_blank" rel="noopener noreferrer">
126 <i class="fa-brands fa-linkedin-in"></i>
127 </a>
128 </#if>
129
130 <#if facebook != "">
131 <a href="${facebook}" target="_blank" rel="noopener noreferrer">
132 <i class="fa-brands fa-facebook"></i>
133 </a>
134 </#if>
135
136 </div>
137
138 <#if false && viewerHasPrivileges>
139 <button data-toggle="modal" data-target="#privacyModal" class="bioec_primary_button">
140 CONFIGURAÇÕES DE PRIVACIDADE
141 </button>
142 </#if>
143</div>
144
145<style>
146.bioec_org_info_container {
147 display: flex;
148 flex-direction: column;
149 background-color: #E8ECEF;
150 height: 100%;
151 padding: 40px 24px 40px 0;
152}
153
154.bioec_org_info_img_placeholder {
155 align-self: center;
156 height: 120px;
157 width: 120px;
158 background-color: #595A5F;
159 border-radius: 50%;
160 display: flex;
161 align-items: center;
162 justify-content: center;
163 color: var(--white-1);
164 font-size: 72px;
165 cursor: default;
166}
167
168.bioec_org_info_label {
169 display: block;
170 font-weight: 700;
171 font-size: 20px;
172 line-height: 150%;
173 color: #5B5C61;
174 margin-bottom: 8px;
175 margin-top: 24px;
176 cursor: text;
177}
178
179.bioec_org_info_content {
180 display: block;
181 font-weight: 400;
182 font-size: 16px;
183 line-height: 150%;
184 color: #5B5C61;
185 border-bottom: 1px solid #BEBEBE;
186 padding-bottom: 4px;
187}
188
189.bioec_org_info_social_container {
190 display: flex;
191 flex-direction: row;
192 align-items: center;
193 justify-content: center;
194 margin: 40px 0;
195}
196
197.bioec_org_info_social_container a {
198 font-size: 35px;
199 color: #5B5C61;
200 margin: 0 15px;
201}
202
203.botoesSidebarMobile{
204display: none;
205justify-content: flex-end;
206gap: 20px;
207}
208#profilePic {
209 display: flex;
210 justify-content: center;
211 width: 120px;
212 height: 120px;
213 margin: auto;
214 position: relative;
215}
216
217#profilePic a:hover {
218 text-decoration: none;
219}
220
221#profilePic a#btnEditOrgModal {
222 text-decoration: none;
223 position: absolute;
224 right: 0;
225 bottom: 0;
226 color: var(--white);
227 background-color: var(--color-3);
228 height: 40px;
229 width: 40px;
230 border-radius: 50%;
231 border: none;
232 outline: none;
233 display: flex;
234 align-items: center;
235 justify-content: center;
236 padding: 0;
237 font-size: 18px;
238
239}
240
241#ProfilePic_Frame {
242 border-radius: 50%;
243 width: 100%;
244 height: 100%;
245 overflow: hidden;
246}
247 #ProfilePic_Frame img {
248 width: 100%;
249 height: 100%;
250 object-fit: cover;
251}
252
253.profilePic-container {
254 color: #FFF;
255 background-color: #595A5F;
256 border-radius: 50%;
257 position: relative;
258 display: flex;
259 align-items: center;
260 justify-content: center;
261 padding: 35px;
262 width: 100%;
263 height: 100%;
264 font-size: 70px;
265}
266
267
268@media (max-width: 1200px) {
269 .bioec_org_info_container {
270 padding: 40px 24px;
271 }
272}
273
274@media (max-width: 994px) {
275.botoesSidebarMobile{
276display: flex;
277}
278}
279</style>
Um erro ocorreu enquanto processava o modelo.
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@111c3261"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 20, column 17]
----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3 JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4/>
5
6<#assign
7 hasPrivileges = false
8 userId = themeDisplay.getUserId()
9/>
10
11<#assign
12 orgTypes = ["Entidade Governamental","Associação","Outras ICT's","Comunidade Tradicional/Cooperativa","Startup",
13 "Entidade do Terceiro Setor","Investidor/Agência de Fomento","Grupo de Pesquisa/Universidade","Empresa"]
14/>
15
16<#if userId?? && _CUSTOM_FIELD_organization.getData()?? && _CUSTOM_FIELD_organization.getData() !="" >
17<#assign
18 orgId = _CUSTOM_FIELD_organization.getData()?number
19 hasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
20 organization = OrganizationLocalService.getOrganization(orgId)
21/>
22</#if>
23
24<#if hasPrivileges>
25 <#assign
26 organization = OrganizationLocalService.getOrganization(_CUSTOM_FIELD_organization.getData()?number)
27 articleId = organization.getExpandoBridge().getAttribute("journal-article")
28 journalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),articleId?c)
29 articleXml = journalArticle.getDocument().getRootElement()
30
31 setoresXml = articleXml.selectNodes("dynamic-element[@name='Text40807358']")
32 setores = ""
33 />
34 <#list setoresXml as setor>
35 <#assign setores = setores + "'" + setor.getStringValue()?trim + "'," >
36 </#list>
37
38 <button class="bioec_secondary_button mx-3" data-toggle="modal" style="display: flex;margin-left: auto !important;margin-right: auto !important;margin-top: 24px;" data-target="#bioec-org-delete-modal">EXCLUIR ORGANIZAÇÃO</button>
39 <!-- <div class="mt-4 d-md-flex d-none align-items-center justify-content-end">
40 <button class="bioec_primary_button bioec_editar" data-toggle="modal" data-target="#bioec-org-edit-modal">EDITAR</button>
41 </div> -->
42
43 <#-- MODAL DE EXLUIR ORGANIZAÇÃO -->
44 <div id="bioec-org-delete-modal" class="modal fade" style="display: none;" role="dialog" aria-hidden="true">
45 <div class="modal-dialog" role="document">
46 <div class="modal-content px-4 py-3">
47 <div class="modal-header">
48 <h5 class="modal-title">Excluir organização</h5>
49 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
50 <span aria-hidden="true">×</span>
51 </button>
52 </div>
53 <div class="d-flex justify-content-end py-3">
54 <button type="button" class="bioec_secondary_button mx-3" data-dismiss="modal">CANCELAR</button>
55 <button type="button" class="bioec_primary_button" onclick="deleteOrg()" >CONTINUAR</button>
56 </div>
57 </div>
58 </div>
59 </div>
60
61
62
63 <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
64 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
65 <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
66 <link
67 rel="stylesheet"
68 href="https://cdnjs.cloudflare.com/ajax/libs/croppie/2.6.5/croppie.min.css"
69 integrity="sha512-zxBiDORGDEAYDdKLuYU9X/JaJo/DPzE42UubfBw9yg8Qvb2YRRIQ8v4KsGHOx2H1/+sdSXyXxLXv5r7tHc9ygg=="
70 crossorigin="anonymous"
71 referrerpolicy="no-referrer"
72 />
73
74 <script
75 src="https://cdnjs.cloudflare.com/ajax/libs/croppie/2.6.5/croppie.min.js"
76 integrity="sha512-Gs+PsXsGkmr+15rqObPJbenQ2wB3qYvTHuJO6YJzPe/dTLvhy0fmae2BcnaozxDo5iaF8emzmCZWbQ1XXiX2Ig=="
77 crossorigin="anonymous"
78 referrerpolicy="no-referrer"
79 ></script>
80
81
82<style>
83
84 .bioec_profile-form h1 {
85 font-weight: 400;
86 font-size: 39px;
87 line-height: 150%;
88 color: #5B5C61;
89 }
90
91 .bioec_profile-form-control {
92 margin-bottom: 40px;
93 }
94
95 .bioec_profile-form-control label {
96 color: #5B5C61;
97 font-size: 20px;
98 font-weight: 700;
99 line-height: 30px;
100 margin-bottom: 8px;
101 }
102
103 .bioec_profile-form-control label[required]::before {
104 content: "*";
105 color: #ff0000;
106 margin-right: 0.4rem;
107 }
108
109 .bioec_profile-form-control input,
110 .bioec_profile-form-control select {
111 border-radius: 0;
112 outline: none;
113 border: none;
114 border-bottom: 1px solid #BEBEBE;
115 font-size: 16px;
116 font-weight: 400;
117 line-height: 24px;
118 color: #5B5C61;
119 width: 100%;
120 background-color: transparent;
121 padding: 2px;
122 margin: 0;
123 }
124
125 .submit-attempted .bioec_profile-form-control input:invalid,
126 .submit-attempted .bioec_profile-form-control select:invalid {
127 border-bottom: 1px solid #ff0000;
128 }
129
130 .bioec_profile-flex-container {
131 display: flex;
132 flex-direction: row;
133 justify-content: space-between;
134 flex-wrap: wrap;
135 }
136
137 .bioec_profile-flex-container .bioec_profile-form-control {
138 width: 50%;
139 padding-right: 1.5rem;
140 }
141
142 .bioec_profile-form-control textarea {
143 font-size: 16px;
144 font-weight: 400;
145 line-height: 24px;
146 color: #5B5C61;
147 width: 100%;
148 background-color: transparent;
149 border-radius: 0;
150 border: 1px solid #BEBEBE;
151 resize: none;
152 outline: none;
153 margin-top: 24px;
154 }
155
156 .modal-header h1{
157 color: #5B5C61;
158 margin-bottom: 0px;
159 font-size: 25px;
160 line-height: 58.5px;
161 font-weight: 400;
162 }
163
164 @media (max-width: 768px) {
165 .bioec_profile-flex-container .bioec_profile-form-control {
166 margin-bottom: 1.5rem;
167 width: 100%;
168 padding-right: 0rem;
169 }
170 }
171</style>
172
173<script>
174
175function deleteOrg() {
176 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
177 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}",
178 {
179 method: "DELETE",
180 headers: {
181 "x-csrf-token": Liferay.authToken,
182 "Content-Type": "application/json",
183 "Accept": "application/json"
184 }
185 })
186 .then( Liferay.Util.openToast({
187 message: "Estamos processando seu arquivo. Favor aguarde por alguns segundos e redireciorameos você automaticamente.",
188 type: "success",
189 title: "",
190 toastProps: {
191 autoClose: 2000
192 }
193 }))
194 .then(setTimeout(() => { window.location.href = Liferay.ThemeDisplay.getPortalURL() + "/meu-perfil#deleteOrg" }, 2000))
195
196
197
198}
199
200
201
202</script>
203
204</#if>
Um erro ocorreu enquanto processava o modelo.
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@111c3261"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 20, column 17]
----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3 JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4/>
5
6<#assign
7 hasPrivileges = false
8 userId = themeDisplay.getUserId()
9/>
10
11<#assign
12 orgTypes = ["Entidade Governamental","Associação","Outras ICT's","Comunidade Tradicional/Cooperativa","Startup",
13 "Entidade do Terceiro Setor","Investidor/Agência de Fomento","Grupo de Pesquisa/Universidade","Empresa"]
14/>
15
16<#if userId?? && _CUSTOM_FIELD_organization.getData()?? && _CUSTOM_FIELD_organization.getData() !="" >
17<#assign
18 orgId = _CUSTOM_FIELD_organization.getData()?number
19 hasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
20 organization = OrganizationLocalService.getOrganization(orgId)
21/>
22</#if>
23
24<#if hasPrivileges && _CUSTOM_FIELD_organization.getData()?? && _CUSTOM_FIELD_organization.getData() !="">
25 <#assign
26 organization = OrganizationLocalService.getOrganization(_CUSTOM_FIELD_organization.getData()?number)
27 articleId = organization.getExpandoBridge().getAttribute("journal-article")
28 journalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),articleId?c)
29 articleXml = journalArticle.getDocument().getRootElement()
30
31 setoresXml = articleXml.selectNodes("dynamic-element[@name='Text40807358']")
32 setores = ""
33 />
34 <#list setoresXml as setor>
35 <#assign setores = setores + "'" + setor.getStringValue()?trim + "'," >
36 </#list>
37
38 <div class="mt-4 d-md-flex d-none align-items-center justify-content-end" style="display:none!important;" >
39 <button class="bioec_secondary_button mx-3" data-toggle="modal" data-target="#bioec-org-delete-modal" >EXCLUIR ORGANIZAÇÃO</button>
40 <button class="bioec_primary_button bioec_editar" data-toggle="modal" data-target="#bioec-org-edit-modal" >EDITAR</button>
41 </div>
42
43
44
45
46
47 <#-- MODAL DE EXLUIR ORGANIZAÇÃO -->
48 <div id="bioec-org-delete-modal" class="modal fade" style="display: none;" role="dialog" aria-hidden="true">
49 <div class="modal-dialog" role="document">
50 <div class="modal-content px-4 py-3">
51 <div class="modal-header">
52 <h5 class="modal-title">Excluir organização</h5>
53 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
54 <span aria-hidden="true">×</span>
55 </button>
56 </div>
57 <div class="d-flex justify-content-end py-3">
58 <button type="button" class="bioec_secondary_button mx-3" data-dismiss="modal">CANCELAR</button>
59 <button type="button" class="bioec_primary_button" onclick="deleteOrg()" >CONTINUAR</button>
60 </div>
61 </div>
62 </div>
63 </div>
64
65 <#-- MODAL DE EDIÇÃO -->
66 <div id="bioec-org-edit-modal" class="modal fade" style="display: none;" tabindex="-1" role="dialog" aria-hidden="true">
67 <div class="modal-dialog modal-lg" role="document">
68 <div class="modal-content px-4 py-3">
69
70 <div class="modal-header">
71 <h1>Sobre a organização</h1>
72 <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="closeAndReset()">
73 <span aria-hidden="true">×</span>
74 </button>
75 </div>
76
77 <div class="modal-body">
78 <form id="organization-form" class="bioec_profile-form">
79<#assign imagemOrg = DDMStructure_CampoDeTexto18329557.getData() >
80
81 <div class="d-flex justify-content-center my-5" style="
82 flex-direction: column;
83 align-items: center;
84 ">
85 <div id="orgPicContainer" class="bioec_form-picture-container" ${(imagemOrg != "")?string("style='background-image: url("+ imagemOrg +")'","")} >
86 <i id="user-icon" class="fa fa-user"></i>
87 <button type="button" onclick="openFileSelectImagem()">
88 <i class="fa fa-edit"></i>
89 </button>
90 </div>
91 <input name="imagem" id="file-input" class="d-none" type="file" onchange="encodeImageAsURL(this)" accept="image/*"/>
92 <input class="d-none" id="inputOrgBase64OrgModal" />
93 <button type="button" onclick="removeImageOrgModal(this)" id="removerImagemOrgModal" ${(imagemOrg != "")?string("", "class='d-none'")}>
94 <i class="fa fa-trash"></i> Remover imagem
95 </button>
96 </div>
97
98 <div class="bioec_profile-flex-container">
99 <div class="bioec_profile-form-control">
100 <label required>Tipo de Organização</label>
101 <select id="tipo-de-organizacao" name="tipo" required title="Selecionar" value="${DDMStructure_Text61401294.getData()}">
102 <option value="" disabled selected>Selecionar</option>
103 <#list orgTypes as type>
104 <option value="${type}" ${(type==DDMStructure_Text61401294.getData())?string("selected","")} >${type}</option>
105 </#list>
106 </select>
107 </div>
108
109 <div class="bioec_profile-form-control">
110 <div id="org-tipo-6" class="d-none">
111 <label>Tipo de entidade</label>
112 <input name="investimento" type="text" id="tipodeentidadeOrganizacao" value="${DDMStructure_Text53411607.getData()}" />
113 </div>
114 <div id="org-tipo-7" class="d-none">
115 <label>Instituição</label>
116 <input name="instituicao" type="text" id="instituicaoOrganizacao" value="${DDMStructure_Text31001996.getData()}" />
117 </div>
118 </div>
119
120 <div class="bioec_profile-form-control">
121 <label required for="nomeOrganizacao">Nome da Organização</label>
122 <input id="nomeOrganizacao" name="nome" type="text" required value="${organization.getName()}" />
123 </div>
124
125 <div class="bioec_profile-form-control">
126 <label for="cidadeOrganizacao">Cidade</label>
127 <input id="cidadeOrganizacao" name="cidade" type="text" value="${DDMStructure_Text38119908.getData()}" />
128 </div>
129
130 <div class="bioec_profile-form-control">
131 <label for="estadoOrganizacao">Estado</label>
132 <input id="estadoOrganizacao" name="estado" type="text" value="${DDMStructure_Text87845472.getData()}" />
133 </div>
134
135
136 <div class="bioec_profile-form-control">
137 <label for="paisOrganizacao">País</label>
138 <input id="paisOrganizacao" name="pais" type="text" value="${DDMStructure_Text47038833.getData()}" />
139 </div>
140
141 </div>
142
143 <h1 class="my-5">Informações digitais</h1>
144
145 <div class="bioec_profile-flex-container">
146 <div class="bioec_profile-form-control">
147 <label for="siteOrganizacao">Site</label>
148 <input id="siteOrganizacao" name="site" type="url" value="${DDMStructure_Text98734375.getData()}" />
149 </div>
150 <div class="bioec_profile-form-control">
151 <label for="linkedinOrganizacao">Linkedin</label>
152 <input id="linkedinOrganizacao" name="linkedin" type="url" value="${DDMStructure_Text82629110.getData()}" />
153 </div>
154 <#-- <div class="bioec_profile-form-control">
155 <label>Instagram</label>
156 <input name="instagram" type="url" value="${Text28208517.getData()}" />
157 </div>
158 <div class="bioec_profile-form-control">
159 <label>Facebook</label>
160 <input name="facebook" type="url" value="${Text71851201.getData()}" />
161 </div> -->
162 </div>
163
164 <h1 class="my-5">Campo de atuação</h1>
165
166 <div>
167 <div class="bioec_profile-form-control">
168 <label required for="sobreOrganizacao">Sobre a organização</label>
169 <textarea id="sobreOrganizacao" name="sobre" rows="5" >${DDMStructure_Text54730891.getData()}</textarea>
170 </div>
171
172 <div class="bioec_profile-form-control">
173 <label required for="competenciasOrganizacao">Competências tecnológicas</label>
174 <textarea id="competenciasOrganizacao" name="competencias" rows="5" >${DDMStructure_Text51537691.getData()}</textarea>
175 </div>
176
177 <div class="bioec_profile-form-control">
178 <label required>Setores de atuação</label>
179 <select id="setores-de-atuacao" name="setores" multiple="multiple" style="width: 100%">
180 <option value="Agroindústria">Agroindústria</option>
181 <option value="Água Potável e Saneamento">Água Potável e Saneamento</option>
182 <option value="Alimentos e Bebidas">Alimentos e Bebidas</option>
183 <option value="Análise de Ciclo de Vida">Análise de Ciclo de Vida</option>
184 <option value="Biotecnologia">Biotecnologia</option>
185 <option value="Educação">Educação</option>
186 <option value="Energia e Biocombustíveis">Energia e Biocombustíveis</option>
187 <option value="Higiene Pessoal, Perfumaria e Cosméticos">Higiene Pessoal, Perfumaria e Cosméticos</option>
188 <option value="Inovação">Inovação</option>
189 </select>
190 </div>
191
192 <!-- <h1 class="mt-5 mb-4">Você na organização</h1>
193
194 <div class="bioec_profile-flex-container">
195 <div class="bioec_profile-form-control">
196 <label>Cargo/Função</label>
197 <input name="cargo" type="text" value="Administrador" />
198 </div>
199 </div> -->
200
201 </div>
202
203 <div class="d-flex justify-content-center my-5">
204 <button type="button" data-dismiss="modal" class="bioec_secondary_button mx-3" onclick="closeAndReset()">CANCELAR</a>
205 <button type="button" class="bioec_primary_button mx-3" onclick="submitOrganization()">SALVAR</button>
206 </div>
207
208 </form>
209 </div>
210 </div>
211 </div>
212 </div>
213
214 <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
215 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
216 <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
217
218<script>
219
220
221function toggleSpecialFields(value) {
222 if(value == "Investidor/Agência de Fomento") {
223 $("#org-tipo-6").removeClass("d-none")
224 $("#org-tipo-7").addClass("d-none")
225 } else if(value == "Grupo de Pesquisa/Universidade") {
226 $("#org-tipo-7").removeClass("d-none")
227 $("#org-tipo-6").addClass("d-none")
228 } else {
229 $("#org-tipo-6").addClass("d-none")
230 $("#org-tipo-7").addClass("d-none")
231 }
232}
233
234$("#tipo-de-organizacao").change((obj) => {
235 const v = obj.target.value
236 toggleSpecialFields(v)
237});
238
239toggleSpecialFields(document.getElementById("tipo-de-organizacao").value)
240
241$(document).ready(() => {
242 $("#setores-de-atuacao").select2({
243 language: {
244 noResults: () => "Nenhum resultado encontrado",
245 },
246 selectionCssClass: "bioec_multi_select",
247 });
248 $("#setores-de-atuacao").val([${setores}]);
249 $("#setores-de-atuacao").trigger('change');
250
251 let urlSearchParams = new URLSearchParams(window.location.search);
252
253 if( urlSearchParams.has('popup_editar') == 1){
254 $('.bioec_editar').click();
255 urlSearchParams.delete('popup_editar');
256 if (history.replaceState) {
257 let searchString = urlSearchParams.toString().length > 0 ? '?' + urlSearchParams.toString() : '';
258 let newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname + searchString + window.location.hash;
259 history.replaceState(null, '', newUrl);
260 }
261 }
262});
263
264function validImageSize(base64="") {
265 const decoded = atob(base64.substring(base64.indexOf(',') + 1));
266 const sizeMB = decoded.length / 1e+6;
267 console.log("MB: " + decoded.length / 1e+6);
268 if(sizeMB > 10) {
269 Liferay.Util.openToast({
270 message: "O tamanho da imagem não deve ultrapassar 10 MB.",
271 type: "danger",
272 title: "",
273 toastProps: {
274 autoClose: 5000
275 }
276 })
277 return false
278 }
279 return true
280}
281
282 function encodeImageAsURL(element) {
283 let file = element.files[0];
284 let reader = new FileReader();
285 reader.onloadend = () => {
286 if(reader.result) {
287 if(!validImageSize(reader.result)) return;
288 try {
289 console.log("hi!")
290 const pic_container = document.getElementById("orgPicContainer")
291 const base64_input = document.getElementById("inputOrgBase64OrgModal")
292 base64_input.value = reader.result
293 pic_container.style.backgroundImage = 'url(' + reader.result + ')'
294 const removeImageButton = document.getElementById(
295 "removerImagemOrgModal"
296 );
297 const user_icon = document.getElementById("user-icon")
298 user_icon.style.display = "none";
299 removeImageButton.classList.remove("d-none");
300 } catch (error) {
301 console.error(error)
302 }
303 }
304 }
305 reader.readAsDataURL(file);
306 }
307
308 function removeImageOrgModal(element) {
309 try {
310 const file_input = document.getElementById("file-input");
311 const pic_container = document.getElementById("orgPicContainer")
312 const base64_input = document.getElementById("inputOrgBase64OrgModal");
313
314 file_input.value = null;
315 base64_input.value = "";
316 pic_container.style.backgroundImage = null;
317
318 const user_icon = document.getElementById("user-icon")
319 user_icon.style.display = "block";
320
321 const removeImageButton = document.getElementById("removerImagemOrgModal");
322 removeImageButton.classList.add("d-none");
323 } catch (error) {
324 console.error(error);
325 }
326 }
327
328function openFileSelectImagem() {
329 document.getElementById("file-input").click();
330}
331
332function initUrl(input, defaulthost) {
333 const value = input.value;
334 if(!value) {
335 input.value = defaulthost;
336 }
337}
338
339function submitForm() {
340console.log("Tentativa de envio")
341const form = document.getElementById("organization-form")
342form.classList.add("submit-attempted")
343}
344
345function closeAndReset() {
346 document.getElementById("organization-form").reset();
347}
348
349</script>
350
351<style>
352
353 .bioec_profile-form #removerImagemOrgModal {
354 background: none;
355 cursor: pointer;
356 border: none;
357 outline: none;
358 color: #5b5c61;
359 font-size: 16px;
360 font-weight: 900;
361 line-height: 24px;
362 letter-spacing: 0em;
363 width: fit-content;
364 margin-left: 16px;
365 margin-top: 22px;
366 }
367
368
369 .bioec_profile-form h1 {
370 font-weight: 400;
371 font-size: 39px;
372 line-height: 150%;
373 color: #5B5C61;
374 }
375
376 .bioec_profile-form-control {
377 margin-bottom: 40px;
378 }
379
380 .bioec_profile-form-control label {
381 color: #5B5C61;
382 font-size: 20px;
383 font-weight: 700;
384 line-height: 30px;
385 margin-bottom: 8px;
386 }
387
388 .bioec_profile-form-control label[required]::before {
389 content: "*";
390 color: #ff0000;
391 margin-right: 0.4rem;
392 }
393
394 .bioec_profile-form-control input,
395 .bioec_profile-form-control select {
396 border-radius: 0;
397 outline: none;
398 border: none;
399 border-bottom: 1px solid #BEBEBE;
400 font-size: 16px;
401 font-weight: 400;
402 line-height: 24px;
403 color: #5B5C61;
404 width: 100%;
405 background-color: transparent;
406 padding: 2px;
407 margin: 0;
408 }
409
410 .submit-attempted .bioec_profile-form-control input:invalid,
411 .submit-attempted .bioec_profile-form-control select:invalid {
412 border-bottom: 1px solid #ff0000;
413 }
414
415 .bioec_profile-flex-container {
416 display: flex;
417 flex-direction: row;
418 justify-content: space-between;
419 flex-wrap: wrap;
420 }
421
422 .bioec_profile-flex-container .bioec_profile-form-control {
423 width: 50%;
424 padding-right: 1.5rem;
425 }
426
427 .bioec_profile-form-control textarea {
428 font-size: 16px;
429 font-weight: 400;
430 line-height: 24px;
431 color: #5B5C61;
432 width: 100%;
433 background-color: transparent;
434 border-radius: 0;
435 border: 1px solid #BEBEBE;
436 resize: none;
437 outline: none;
438 margin-top: 24px;
439 }
440
441 .bioec_form-picture-container {
442 color: var(--white);
443 background-color: #595A5F;
444 border-radius: 50%;
445 position: relative;
446 display: flex;
447 align-items: center;
448 justify-content: center;
449 padding: 35px;
450 width: 180px;
451 height: 180px;
452 font-size: 100px;
453 background-size: cover;
454 }
455
456 .bioec_form-picture-container[style] > i {
457 display: none;
458 }
459
460 .bioec_form-picture-container button {
461 position: absolute;
462 right: 0;
463 bottom: 0;
464 color: var(--white);
465 background-color: var(--color-3);
466 height: 40px;
467 width: 40px;
468 border-radius: 50%;
469 border: none;
470 outline: none;
471 display: flex;
472 align-items: center;
473 justify-content: center;
474 padding: 0;
475 font-size: 18px
476 }
477
478 .bioec_multi_select {
479 font-size: 16px;
480 font-weight: 400;
481 line-height: 24px;
482 color: #5B5C61;
483 width: 100%;
484 background-color: transparent;
485 border-radius: 0 !important;
486 border: 1px solid #BEBEBE !important;
487 resize: none;
488 outline: none;
489 padding: 12px !important;
490 }
491
492 .bioec_multi_select .select2-selection__choice {
493 background-color: transparent !important;
494 margin-left: 12px !important;
495 margin-top: 0px !important;
496 }
497
498 .modal-header h1{
499 color: #5B5C61;
500 margin-bottom: 0px;
501 font-size: 25px;
502 line-height: 58.5px;
503 font-weight: 400;
504 }
505
506 @media (max-width: 768px) {
507 .bioec_profile-flex-container .bioec_profile-form-control {
508 margin-bottom: 1.5rem;
509 width: 100%;
510 padding-right: 0rem;
511 }
512 }
513</style>
514
515<script>
516
517function deleteOrg() {
518 Liferay.Util.openToast({message: "Enviando requisição",type: "info",title: ""});
519 fetch(Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}",
520 {
521 method: "DELETE",
522 headers: {
523 "x-csrf-token": Liferay.authToken,
524 "Content-Type": "application/json",
525 "Accept": "application/json"
526 }
527 })
528 .then( Liferay.Util.openToast({
529 message: "Estamos processando seu arquivo. Favor aguarde por alguns segundos e redireciorameos você automaticamente.",
530 type: "success",
531 title: "",
532 toastProps: {
533 autoClose: 2000
534 }
535 }))
536 .then(setTimeout(() => { window.location.href = Liferay.ThemeDisplay.getPortalURL() + "/meu-perfil#deleteOrg" }, 2000))
537
538
539
540}
541
542
543function submitOrganization() {
544 Liferay.Util.openToast({
545 message: "Enviando requisição",
546 type: "info",
547 title: "",
548 });
549 console.log("submitOrganization");
550 let site = document.getElementById("siteOrganizacao").value;
551 let linkedin = document.getElementById("linkedinOrganizacao").value;
552
553 if (site != "") {
554 if (
555 !site.startsWith("https://") &&
556 !site.startsWith("http://") &&
557 !site.startsWith("https://www") &&
558 !site.startsWith("http://www")
559 ) {
560 Liferay.Util.openToast({
561 message:
562 "O campo 'site' precisa começar com 'https://', 'http://', 'https://www' ou 'http://www' para ser válido",
563 type: "danger",
564 title: "",
565 toastProps: {
566 autoClose: 5000,
567 },
568 });
569 return;
570 }
571 }
572
573 if (linkedin != "") {
574 if (
575 !linkedin.startsWith("https://www.linkedin.com") &&
576 !site.startsWith("http://www.linkedin.com") &&
577 !linkedin.startsWith("https://linkedin.com") &&
578 !site.startsWith("http://linkedin.com")
579 ) {
580 Liferay.Util.openToast({
581 message:
582 "O campo 'linkedin' precisa começar com 'https://www.linkedin.com' ou 'http://www.linkedin.com' com ou sem os 'www.' para ser válido",
583 type: "danger",
584 title: "",
585 toastProps: {
586 autoClose: 5000,
587 },
588 });
589 return;
590 }
591 }
592
593 fetch(
594 Liferay.ThemeDisplay.getPortalURL() +
595 "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}",
596 {
597 method: "PUT",
598 headers: {
599 "x-csrf-token": Liferay.authToken,
600 "Content-Type": "application/json",
601 },
602 body: JSON.stringify({
603 imagem: document.getElementById("inputOrgBase64OrgModal").value,
604 tipo: document.getElementById("tipo-de-organizacao").value,
605 nome: document.getElementById("nomeOrganizacao").value.trim(),
606 cidade: document.getElementById("cidadeOrganizacao").value,
607 estado: document.getElementById("estadoOrganizacao").value,
608 pais: document.getElementById("paisOrganizacao").value,
609 site: document.getElementById("siteOrganizacao").value,
610 linkedin: document.getElementById("linkedinOrganizacao").value,
611 sobre: document.getElementById("sobreOrganizacao").value,
612 setores: $("#setores-de-atuacao").select2("val"),
613 competencias: document.getElementById("competenciasOrganizacao").value,
614 tipodeentidade: document.getElementById("tipodeentidadeOrganizacao")
615 .value,
616 instituicao: document.getElementById("instituicaoOrganizacao").value,
617 }),
618 }
619 )
620 .then(
621 (response) =>
622 new Promise((resolve, reject) => {
623 resolve({
624 status: response.status,
625 ok: response.ok,
626 }).then((r) => console.log(r));
627 reject({}).then((c) => console.log(c));
628 })
629 )
630 .then((res) => {
631 if (res.status == "200") {
632 Liferay.Util.openToast({
633 message: "Perfil alterado com sucesso.",
634 type: "success",
635 title: "",
636 toastProps: {
637 autoClose: 5000,
638 },
639 });
640 location.reload();
641 } else if(res.status == "302"){
642 Liferay.Util.openToast({
643 message: "Cadastre uma organização com SITE diferente.",
644 type: "danger",
645 title: "Site inserido já existe",
646 toastProps: {
647 autoClose: 5000
648 }
649 })
650 } else if(res.status == "409"){
651 Liferay.Util.openToast({
652 message: "Cadastre uma organização com Nome da Organização diferente.",
653 type: "danger",
654 title: "Nome da Organização cadastrada já existe",
655 toastProps: {
656 autoClose: 5000
657 }
658 })
659 }
660 })
661 .catch((e) => console.log(e));
662}
663
664
665</script>
666
667</#if>
Sobre drop zone
Um erro ocorreu enquanto processava o modelo.
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@111c3261"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 15, column 17]
----
1<#assign
2 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
3 JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")
4/>
5
6<#assign
7 viewerHasPrivileges = false
8 userId = themeDisplay.getUserId()
9/>
10
11<#if userId?? && _CUSTOM_FIELD_organization.getData()?? && _CUSTOM_FIELD_organization.getData() !="" >
12 <#assign
13 orgId = _CUSTOM_FIELD_organization.getData()?number
14 viewerHasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
15 organization = OrganizationLocalService.getOrganization(orgId)
16 />
17</#if>
18
19
20<#if (viewerHasPrivileges || DDMStructure_Field04200031.getData() != "0") && _CUSTOM_FIELD_organization.getData()?? && _CUSTOM_FIELD_organization.getData() !="" >
21<#assign
22 organization = OrganizationLocalService.getOrganization(_CUSTOM_FIELD_organization.getData()?number)
23 articleId = organization.getExpandoBridge().getAttribute("journal-article")
24 journalArticle = JournalArticleLocalService.getArticle(themeDisplay.getLayout().getGroupId(),articleId?c)
25 articleXml = journalArticle.getDocument().getRootElement()
26
27 setores = articleXml.selectNodes("dynamic-element[@name='Text67772680']")
28/>
29<#else>
30<#assign setores = ["privado"] />
31</#if>
32
33<#assign
34
35 sobre = (viewerHasPrivileges || DDMStructure_Field80037203.getData()!="0")?string(DDMStructure_Text54730891.getData()!"","")
36 competencias = (viewerHasPrivileges || DDMStructure_Field75645729.getData()!="0")?string(DDMStructure_Text51537691.getData()!"","")
37
38>
39
40<div>
41
42 <#if viewerHasPrivileges || DDMStructure_Field80037203.getData()!="0" >
43 <div class="bioec_org_sobre">
44 <label>Sobre a organização</label>
45 <div class="bioec_org_sobre_container">
46 <#if sobre != "">
47 ${sobre}
48 <#else>
49 <div class="bioec_org_sobre_vazio">
50 Nenhuma descrição foi adicionada neste perfil ainda
51 </div>
52 </#if>
53 </div>
54 </div>
55 </#if>
56
57 <#if viewerHasPrivileges || DDMStructure_Field75645729.getData()!="0" >
58 <div class="bioec_org_sobre">
59 <label>Competências tecnológicas</label>
60 <div class="bioec_org_sobre_container">
61 <#if competencias != "">
62 ${competencias}
63 <#else>
64 <div class="bioec_org_sobre_vazio">
65 Nenhuma descrição foi adicionada neste perfil ainda
66 </div>
67 </#if>
68 </div>
69 </div>
70 </#if>
71
72 <#if viewerHasPrivileges || DDMStructure_Field04200031.getData()!="0" >
73 <div class="bioec_org_sobre">
74 <label>Setor(es) de atuação</label>
75 <div class="bioec_org_sobre_container">
76 <#if setores[0]!="privado">
77 <#if setores?size == 1 && setores[0].getStringValue()?trim == "" >
78 <div class="bioec_org_sobre_vazio">
79 Nenhum setor foi adicionado neste perfil ainda
80 </div>
81 <#else>
82 <#if setores?size != 0 >
83 <ul>
84 <#list setores as setor>
85 <li>${setor.getStringValue()}</li>
86 </#list>
87 </ul>
88 <#else>
89 <div class="bioec_org_sobre_vazio">
90 Nenhum setor foi adicionado neste perfil ainda
91 </div>
92 </#if>
93 </#if>
94 <#else>
95 <div class="bioec_org_sobre_vazio">
96 Nenhum setor foi adicionado neste perfil ainda
97 </div>
98 </#if>
99 </div>
100 </div>
101 </#if>
102
103</div>
104
105<style>
106.bioec_org_sobre label {
107 color: #5B5C61;
108 font-weight: 700;
109 margin-bottom: 10px;
110 font-size: 20px;
111 line-height: 30px;
112}
113
114.bioec_org_sobre_container {
115 font-size: 16px;
116 border: 1px solid #BEBEBE;
117 padding: 24px;
118 color: #5B5C61;
119 margin-bottom: 40px;
120}
121
122.bioec_org_sobre_vazio {
123 color: #5B5C61;
124 font-size: 16px;
125 text-align: center;
126 font-weight: 700;
127}
128
129.bioec_org_sobre_container ul {
130 color: #5B5C61;
131 margin: 0;
132}
133</style>
Um erro ocorreu enquanto processava o modelo.
Java method "com.sun.proxy.$Proxy136.getOrganization(long)" threw an exception when invoked on com.sun.proxy.$Proxy136 object "com.liferay.portal.service.impl.OrganizationLocalServiceImpl@111c3261"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: organization = OrganizationLocalServi... [in template "34764#34807#null" at line 24, column 9]
----
1<#assign
2 viewerHasPrivileges = false
3 userId = themeDisplay.getUserId()
4/>
5<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
6
7
8<#if userId?? && _CUSTOM_FIELD_organization.getData()?? && _CUSTOM_FIELD_organization.getData() !="" >
9 <#assign
10 OrganizationLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.OrganizationLocalService")
11 />
12 <#assign
13 orgId = _CUSTOM_FIELD_organization.getData()?number
14 viewerHasPrivileges = OrganizationLocalService.hasUserOrganization(userId, orgId)
15 />
16</#if>
17
18<#assign
19 UserLocalService = serviceLocator.findService("com.liferay.portal.kernel.service.UserLocalService")
20/>
21<#assign
22 orgId = _CUSTOM_FIELD_organization.getData()?number
23 users = UserLocalService.getOrganizationUsers(orgId)
24 organization = OrganizationLocalService.getOrganization(orgId)
25 nomeDaOrg = organization.getName()!""
26/>
27
28<div class="bioec_org_admins">
29 <label>Administradores desse perfil</label>
30
31 <#list users as user>
32 <#assign userArticleId = user.getExpandoBridge().getAttribute("journal-article")!"0" >
33
34 <#assign urlWC = "">
35 <#if userArticleId != "0" && userArticleId != "">
36 <#assign userArticle = JournalArticleLocalService.getLatestArticle(themeDisplay.getLayout().getGroupId(), userArticleId?string) >
37 <#assign urlWC = userArticle.getUrlTitle()!"">
38 </#if>
39
40
41 <#assign
42 nome = user.getFullName()
43 />
44 <div class="bioec_org_admin_container">
45 <div class="bioec_org_admin_img_placeholder">
46 <i class="fa-solid fa-user"></i>
47 </div>
48 <div class="bioec_org_admin_content">
49 <b><a style="color: #5B5C61;" href="<#if urlWC != ''>/w/${urlWC}</#if>">${nome}</a></b>
50 Administrador
51 </div>
52 <#if viewerHasPrivileges>
53 <div class="bioec_org_admin_buttons_container">
54 <#if userId != user.getUserId() >
55 <button class="bioec_org_admin_button d-none" data-toggle="modal" data-target="#bioec-admin-modal">
56 <i class="fa-solid fa-pen-to-square"></i>
57 </button>
58 <button class="bioec_org_admin_button" onclick="removeAdminFromOrg(${user.getUserId()})">
59 <i class="fa-solid fa-trash-can"></i>
60 </button>
61 </#if>
62 </div>
63 </#if>
64 </div>
65 </#list>
66
67 <#if viewerHasPrivileges>
68 <div class="bioec_org_flex_end">
69 <#if (1 < users?size)>
70 <button class="bioec_secondary_button mx-3 mb-4 mb-md-0" data-toggle="modal" data-target="#bioec-leave-modal">DEIXAR DE SER ADMINISTRADOR</button>
71 </#if>
72 <button class="bioec_primary_button bioec_modal-adicionar" data-toggle="modal" data-target="#bioec-admin-modal">ADICIONAR ADMINISTRADOR</button>
73 </div>
74
75 <#-- MODAL DE ADICIONAR ADMINISTRADOR -->
76 <div id="bioec-admin-modal" class="modal fade" style="display: none;" role="dialog" aria-hidden="true">
77 <div class="modal-dialog modal-lg" role="document">
78 <div class="modal-content">
79 <div class="py-3 px-4 d-flex justify-content-between bioec_modal-line">
80 <div class="bioec_modal-title">Adicionar administrador</div>
81 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
82 <i class="fa-solid fa-xmark"></i>
83 </button>
84 </div>
85 <div class="bioec_modal-form">
86 <div class="py-3 px-4 bioec_modal-line">
87 <h1>${title.getData()}</h1>
88 <div class="bioec_modal-form-control">
89 <label>E-mail do administrador</label>
90 <input id="admin-email" type="text" placeholder="Digite aqui" value="" >
91 </div>
92 <div class="bioec_modal-form-control d-none">
93 <label>Cargo/Função</label>
94 <input id="admin-role" type="text" placeholder="Digite aqui" value="" >
95 </div>
96 </div>
97 <div class="py-3 px-4 d-flex justify-content-end">
98 <button type="button" class="bioec_secondary_button mx-3" data-dismiss="modal">CANCELAR</button>
99 <button type="button" class="bioec_primary_button" onclick="addAdminToOrg()">CONTINUAR</button>
100 </div>
101 </div>
102 </div>
103 </div>
104 </div>
105
106 <#-- MODAL DE DEIXAR ORGANIZAÇÃO -->
107 <div id="bioec-leave-modal" class="modal fade" style="display: none;" role="dialog" aria-hidden="true">
108 <div class="modal-dialog modal-lg" role="document">
109 <div class="modal-content px-4 py-4">
110 <div class="d-flex justify-content-between">
111 <h5 class="modal-title">Deixar de ser administrador</h5>
112 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
113 <span aria-hidden="true">×</span>
114 </button>
115 </div>
116 <div class="my-3">
117 <div class="mb-3">
118 ${title.getData()}
119 </div>
120 Ao clicar em continuar, a organização será removida do seu perfil. Caso possua outros administradores, ela continuará nos perfis desses usuários.
121 </div>
122 <div class="d-flex justify-content-end">
123 <button type="button" class="bioec_secondary_button mx-3" data-dismiss="modal">CANCELAR</button>
124 <button type="button" class="bioec_primary_button" onclick="quitOrganization()" >CONTINUAR</button>
125 </div>
126 </div>
127 </div>
128 </div>
129
130 </#if>
131</div>
132
133<script>
134
135$(document).ready(() => {
136 let urlSearchParams = new URLSearchParams(window.location.search);
137
138 if( urlSearchParams.has('popup_adicionar_admin') == 1){
139 $('.bioec_modal-adicionar').click();
140 urlSearchParams.delete("popup_adicionar_admin");
141 if (history.replaceState) {
142 let searchString = urlSearchParams.toString().length > 0 ? '?' + urlSearchParams.toString() : '';
143 let newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname + searchString + window.location.hash;
144 history.replaceState(null, '', newUrl);
145 }
146 }
147});
148
149
150
151
152function quitOrganization() {
153 const url = Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}/user/" + ${userId}
154 fetch(url, {
155 method: 'DELETE',
156 "headers": {
157 "x-csrf-token": Liferay.authToken,
158 "Content-Type": "application/json"
159 }
160 })
161 .then(res => {
162 if(res.status == "200"){
163 Liferay.Util.openToast({
164 message: "Você deixou de ser Administrador",
165 type: "success",
166 title: "",
167 toastProps: {
168 autoClose: 5000
169 }
170 })
171 location.reload();
172 } else {throw "err";}
173 })
174 .catch(() => showErrorToast("Não foi possível adicionar o administrador. Verifique o email e tente novamente"))
175}
176
177function removeAdminFromOrg(userId) {
178 console.log(userId)
179 if(userId) {
180 const url = Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}/user/" + userId
181 fetch(url, {
182 method: 'DELETE',
183 "headers": {
184 "x-csrf-token": Liferay.authToken,
185 "Content-Type": "application/json"
186 }
187 })
188 .then(res => {
189 if(res.status == "200"){
190 Liferay.Util.openToast({
191 message: "Administrador deletado com sucesso.",
192 type: "success",
193 title: "",
194 toastProps: {
195 autoClose: 5000
196 }
197 })
198 location.reload();
199 } else {throw "err";}
200 })
201 .catch(() => showErrorToast("Não foi possível adicionar o administrador. Verifique o email e tente novamente"))
202 }
203}
204
205function addAdminToOrg() {
206 const userEmail = document.getElementById("admin-email").value
207 console.log(userEmail)
208 if(userEmail) {
209 const url = Liferay.ThemeDisplay.getPortalURL() + "/o/profile-management/organization/${_CUSTOM_FIELD_organization.getData()}/user/" + userEmail
210 fetch(url, {
211 method: 'POST',
212 "headers": {
213 "x-csrf-token": Liferay.authToken,
214 "Content-Type": "application/json"
215 }
216 })
217 .then(res => {
218 if(res.status == "200"){
219 Liferay.Util.openToast({
220 message: "Administrador adicionado com sucesso.",
221 type: "success",
222 title: "",
223 toastProps: {
224 autoClose: 5000
225 }
226 })
227 location.reload();
228 gtag('event', 'admnistrador_registrado', {
229 "orgName" : "${nomeDaOrg}"
230 });
231 } else {throw "err";}
232 })
233 .catch(() => showErrorToast("Não foi possível adicionar o administrador. Verifique o email e tente novamente"))
234 }
235}
236
237const showErrorToast = message => {
238 Liferay.Util.openToast({
239 message,
240 type: "danger",
241 title: "",
242 toastProps: {
243 autoClose: 5000,
244 style: { top: 0 },
245 }
246 })
247 }
248
249</script>
250
251<style>
252 .bioec_org_admins {
253 margin-bottom: 40px;
254 }
255
256 .bioec_org_admins label {
257 color: #5B5C61;
258 font-weight: 700;
259 margin-bottom: 10px;
260 font-size: 20px;
261 line-height: 30px;
262 }
263
264 .bioec_org_admin_container {
265 border: 1px solid #BEBEBE;
266 padding: 24px;
267 margin-bottom: 25px;
268 display: flex;
269 flex-direction: row;
270 align-items: center;
271 }
272
273 .bioec_org_flex_end {
274 display: flex;
275 flex-direction: row;
276 align-items: center;
277 justify-content: end;
278 }
279
280 .bioec_org_admin_img_placeholder {
281 align-self: center;
282 height: 48px;
283 width: 48px;
284 background-color: #595A5F;
285 border-radius: 50%;
286 display: flex;
287 align-items: center;
288 justify-content: center;
289 color: var(--white-1);
290 font-size: 28px;
291 }
292
293 .bioec_org_admin_content {
294 font-size: 16px;
295 color: #5B5C61;
296 flex: 1;
297 margin: 0 12px;
298 }
299
300 .bioec_org_admin_content b {
301 display: block;
302 }
303
304 .bioec_org_admin_button {
305 color: var(--white-1);
306 background-color: #595A5F;
307 border-radius: 8px;
308 border: none;
309 outline: none;
310 width: 34px;
311 height: 34px;
312 font-size: 16px;
313 padding: 0px;
314 margin-left: 12px;
315 }
316
317 .bioec_org_admin_buttons_container {
318 display: flex;
319 flex-direction: row;
320 }
321
322 .bioec_modal-title {
323 font-weight: 700;
324 font-size: 20px;
325 color: #5B5C61;
326 }
327
328 .bioec_modal-line {
329 border-bottom: 1px solid #E8ECEF;
330 }
331
332 .bioec_modal-form h1 {
333 font-weight: 400;
334 font-size: 24px;
335 line-height: 150%;
336 color: #5B5C61;
337 margin-bottom: 40px;
338 }
339
340 .bioec_modal-form-control {
341 margin-bottom: 24px;
342 }
343
344 .bioec_modal-form-control label {
345 color: #5B5C61;
346 font-size: 20px;
347 font-weight: 700;
348 line-height: 30px;
349 margin-bottom: 8px;
350 }
351
352 .bioec_modal-form-control label[required]::before {
353 content: "*";
354 color: #ff0000;
355 margin-right: 0.4rem;
356 }
357
358 .bioec_modal-form-control input {
359 border-radius: 0;
360 outline: none;
361 border: none;
362 border-bottom: 1px solid #BEBEBE;
363 font-size: 16px;
364 font-weight: 400;
365 line-height: 24px;
366 color: #5B5C61;
367 width: 100%;
368 background-color: transparent;
369 padding: 2px;
370 margin: 0;
371 }
372
373 @media (max-width: 767px) {
374 .bioec_org_admin_buttons_container {
375 flex-direction: column;
376 }
377 .bioec_org_admin_button {
378 margin-bottom: 12px;
379 }
380 .bioec_org_flex_end {
381 flex-direction: column;
382 align-items: center;
383 }
384 }
385</style>
Infraestruturas drop zone
Demandas drop zone
Ofertas drop zone
Publicações drop zone