3 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
\r
5 * This library is free software; you can redistribute it and/or modify it under
\r
6 * the terms of the GNU Lesser General Public License as published by the Free
\r
7 * Software Foundation; either version 2.1 of the License, or (at your option)
\r
10 * This library is distributed in the hope that it will be useful, but WITHOUT
\r
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
\r
17 <%@page import="com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil"%>
\r
18 <%@page import="com.liferay.portlet.journal.model.JournalArticle"%>
\r
19 <%@page import="fr.logica.ent.portlet.portletconfiguration.exception.PermissionConflictException"%>
\r
20 <%@page import="java.util.Arrays"%>
\r
21 <%@page import="java.lang.reflect.Array"%>
\r
22 <%@page import="fr.logica.ent.util.EntUtil"%>
\r
23 <%@page import="fr.logica.portal.ent.ENTConstantesUtil"%>
\r
24 <%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%>
\r
25 <%@page import="com.liferay.portlet.documentlibrary.service.DLAppServiceUtil"%>
\r
26 <%@page import="com.liferay.portal.kernel.repository.model.Folder"%>
\r
27 <%@page import="com.liferay.portlet.documentlibrary.model.DLFolder"%>
\r
28 <%@page import="com.liferay.portlet.documentlibrary.model.DLFileEntry"%>
\r
29 <%@page import="fr.logica.ent.util.ENTDLUtil"%>
\r
30 <%@page import="org.apache.commons.lang.StringUtils"%>
\r
31 <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
\r
32 <%@ include file="/html/portlet/portlet_configuration/init.jsp" %>
\r
33 <%@ include file="/html/portlet/portlet_configuration/init_ent.jsp" %>
\r
34 <%@ page import="com.liferay.portal.kernel.language.LanguageUtil" %>
\r
35 <%@ page import="com.liferay.portlet.documentlibrary.model.DLFileShortcut" %>
\r
36 <%@ page import="fr.logica.ent.portlet.entservice.service.HistoriqueHabilitationLocalServiceUtil" %>
\r
37 <%@ page import="fr.logica.ent.portlet.entservice.service.DocumentLibraryLocalServiceUtil" %>
\r
40 String redirect = ParamUtil.getString(request, "redirect");
\r
41 String redirectViewURL = ParamUtil.getString(request, "redirectViewURL");
\r
42 String returnToFullPageURL = ParamUtil.getString(request, "returnToFullPageURL");
\r
43 String resourcePrimaryKey = ParamUtil.getString(request, "resourcePrimaryKey");
\r
44 String resourceClassName = ParamUtil.getString(request, "resourceClassName");
\r
45 String titleContentBreadcrumb = ParamUtil.getString(request, "titleContentBreadcrumb");
\r
46 Boolean showCancelButton = ParamUtil.getBoolean(request, "showCancelButton");
\r
47 String listeAutorisations = ParamUtil.getString(request, "listeAutorisations");
\r
50 PortletURL actionPortletURL = renderResponse.createActionURL();
\r
52 actionPortletURL.setParameter("struts_action", "/portlet_configuration/edit_diffusion");
\r
53 actionPortletURL.setParameter("redirect", redirect);
\r
54 actionPortletURL.setParameter("returnToFullPageURL", returnToFullPageURL);
\r
55 actionPortletURL.setParameter("portletResource", portletResource);
\r
56 actionPortletURL.setParameter("resourcePrimaryKey", resourcePrimaryKey);
\r
57 actionPortletURL.setParameter("resourceClassName", resourceClassName);
\r
58 actionPortletURL.setParameter("redirectViewURL", redirectViewURL);
\r
59 actionPortletURL.setParameter("titleContentBreadcrumb", titleContentBreadcrumb);
\r
60 actionPortletURL.setParameter("listeAutorisations", String.valueOf(listeAutorisations));
\r
61 actionPortletURL.setParameter("showCancelButton", String.valueOf(showCancelButton));
\r
63 PortletURL actionPortletURLRestauration = renderResponse.createActionURL();
\r
64 actionPortletURLRestauration.setParameter("struts_action", "/portlet_configuration/edit_diffusion");
\r
65 actionPortletURLRestauration.setParameter("redirect", redirect);
\r
66 actionPortletURLRestauration.setParameter("returnToFullPageURL", returnToFullPageURL);
\r
67 actionPortletURLRestauration.setParameter("portletResource", portletResource);
\r
68 actionPortletURLRestauration.setParameter("resourcePrimaryKey", resourcePrimaryKey);
\r
69 actionPortletURLRestauration.setParameter("resourceClassName", resourceClassName);
\r
70 actionPortletURLRestauration.setParameter("redirectViewURL", redirectViewURL);
\r
71 actionPortletURLRestauration.setParameter("titleContentBreadcrumb", titleContentBreadcrumb);
\r
72 actionPortletURLRestauration.setParameter("listeAutorisations", String.valueOf(listeAutorisations));
\r
73 actionPortletURLRestauration.setParameter("showCancelButton", String.valueOf(showCancelButton));
\r
74 actionPortletURLRestauration.setParameter("cmd","restaurer_habilitation");
\r
76 String diffusion = (String) request.getAttribute("diffusion");
\r
77 boolean empecherEcriture = false;
\r
79 if(resourceClassName.equalsIgnoreCase(DLFileShortcut.class.getName())
\r
80 || resourceClassName.equalsIgnoreCase(DLFileEntry.class.getName())
\r
81 || resourceClassName.equalsIgnoreCase(DLFolder.class.getName())){
\r
83 if(resourceClassName.equalsIgnoreCase(DLFileEntry.class.getName())){
\r
84 FileEntry vFileEntry = DLAppServiceUtil.getFileEntry(Long.parseLong(resourcePrimaryKey));
\r
85 if(null!= vFileEntry
\r
86 && null != vFileEntry.getFolder()){
\r
87 folderId = vFileEntry.getFolder().getFolderId();
\r
89 } else if (resourceClassName.equalsIgnoreCase(DLFolder.class.getName())){
\r
90 folderId = Long.parseLong(resourcePrimaryKey);
\r
93 empecherEcriture = DocumentLibraryLocalServiceUtil.isTypeEmplacement(folderId, themeDisplay.getCompanyId(), ENTConstantesUtil.FOLDER_TYPE_ESPACE_PERSO);
\r
96 boolean historiqueExiste = HistoriqueHabilitationLocalServiceUtil.hasHistorique(Long.valueOf(resourcePrimaryKey));
\r
101 titleContentBreadcrumb = ENTDLUtil.replaceApostropheDroitEtPermission(titleContentBreadcrumb);
\r
102 if(StringUtils.isNotEmpty(titleContentBreadcrumb)){
\r
103 PortalUtil.addPortletBreadcrumbEntry(request, titleContentBreadcrumb, redirect);
\r
105 PortalUtil.addPortletBreadcrumbEntry(request, LanguageUtil.get(pageContext, "general.rightsAndPermissions"), null);
\r
107 <script language="javascript" type="text/javascript" src="${themeDisplay.pathThemeJavaScript}/jquery-ui-1.8.20.custom.min.js"></script>
\r
109 <script type="text/javascript">
\r
110 function afficherPagesPubliques() {
\r
111 var element=jQuery("#etablissement").toggleClass("hide");
\r
112 if(element.hasClass("hide")){
\r
113 jQuery("#img_page_publique").each(function(){this.src="/ent-demo-theme/images/arrows/list_closed.gif"})
\r
115 jQuery("#img_page_publique").each(function(){this.src="/ent-demo-theme/images/arrows/list_opened.gif"})
\r
120 <div class="edit-diffusion">
\r
121 <liferay-ui:error exception="<%= fr.logica.ent.portlet.portletconfiguration.exception.PermissionConflictException.class %>" message="permission-conflict-warning" />
\r
123 //Verification qu'un gestionnaire n'est pas dans la liste
\r
125 if(folderId!=-1 && diffusion !=null && !diffusion.isEmpty()){
\r
126 List<String> diffusionsList = Arrays.asList(diffusion.split(" "));
\r
127 // on ne verifie pas si on estdans l'espace perso
\r
128 if(!DocumentLibraryLocalServiceUtil.isTypeEmplacement(folderId, themeDisplay.getCompanyId(), ENTConstantesUtil.FOLDER_TYPE_ESPACE_PERSO) ){
\r
129 String userRightNonModifiable = DocumentLibraryLocalServiceUtil.checkChangeRightGestionnairesConstraint(folderId, diffusionsList);
\r
131 if (userRightNonModifiable != null) {
\r
133 <div class="portlet-msg-error">
\r
134 <liferay-ui:message key="diffusion.forbidden.permissions" arguments="<%=new String[]{userRightNonModifiable}%>"/>
\r
142 <div class="portlet-button-holder">
\r
143 <c:if test="${showCancelButton==false}">
\r
144 <div class="alignement-left">
\r
145 <a inputcssclass="portlet-button-input alignement-left" href="<%=redirectViewURL%>">
\r
146 <img src="/ent-demo-theme/images/general/go_doc_content.gif" class="vertical-align">
\r
147 <liferay-ui:message key="diffusion.link.retour" />
\r
150 <a inputcssclass="portlet-button-input alignement-left" href="<%=redirect%>">
\r
151 <i><liferay-ui:message key="general.content" /></i>
\r
155 <b><i><liferay-ui:message key="general.rightsAndPermissions" /></i></b>
\r
158 <c:when test="${not empty newOwner}">
\r
160 <c:when test="${hasConflicts != null && hasConflicts == true}">
\r
161 <c:set var="onSubmitStr">if(checkConflicts()) {if(!confirmerChangementGestionnaire()) {event.preventDefault();};};</c:set>
\r
164 <c:set var="onSubmitStr">if(!confirmerChangementGestionnaire()) {event.preventDefault();};</c:set>
\r
169 <c:if test="${hasConflicts != null && hasConflicts == true}">
\r
170 <c:set var="onSubmitStr">if(!checkConflicts()) {event.preventDefault();};</c:set>
\r
175 <aui:form action="<%= actionPortletURL.toString() %>" method="post" name="fm" onSubmit="${onSubmitStr}">
\r
176 <c:if test="${isEditeurPagePublique}">
\r
178 boolean isMessageAccueil = false;
\r
180 if(resourceClassName.equalsIgnoreCase(JournalArticle.class.getName())) {
\r
181 JournalArticle journalArticle = JournalArticleLocalServiceUtil.getLatestArticle(new Integer(resourcePrimaryKey));
\r
182 if(journalArticle !=null) {
\r
183 String typeJournalArticle = journalArticle.getType();
\r
184 isMessageAccueil = typeJournalArticle.equals("TYPE_PRIVATE") || typeJournalArticle.equals("TYPE_PUBLIC");
\r
188 if(!isMessageAccueil) {
\r
190 <div class="portal-form_table">
\r
191 <img onclick="afficherPagesPubliques();" src="/ent-demo-theme/images/arrows/list_closed.gif" title="Visualiser les publications sur pages publiques" name="img_page_publique" id="img_page_publique">
\r
192 <a href="javascript:afficherPagesPubliques();"><liferay-ui:message key="diffusion.link.title.etablissement.publication" /> </a>
\r
195 <table class="portal-explorateur hide" id="etablissement">
\r
197 <tr class="ligne2" style="background-color: #F3F6FB;">
\r
198 <th width="75%" scope="col"> <liferay-ui:message key="diffusion.table.title.etablissement" /></th>
\r
199 <th width="25%" style="text-align: center;">
\r
200 <strong><liferay-ui:message key="diffusion.table.title.etablissement.publication" /></strong>
\r
204 <c:forEach var="entry" items="${etablissements}">
\r
205 <tr id="${entry.organizationId}">
\r
206 <td class="moreSpace">
\r
209 <td style="text-align: center;">
\r
210 <input type="checkbox" name="etabIds" <c:if test="${entry.published}"> checked="checked"</c:if> value="${entry.organizationId}"/>
\r
216 <table class="portal-explorateur" id="groupe">
\r
218 <tr class="ligne2" style="background-color: #F3F6FB;">
\r
219 <th width="65%" scope="col" class="affichagelibelle" ><img src="/ent-demo-theme/images/icons/group.gif"/> <liferay-ui:message key="diffusion.table.title.group" /></th>
\r
220 <th width="15%" class="align-center">
\r
221 <strong><liferay-ui:message key="diffusion.permission.view" /></strong>
\r
223 <input id="check_all_groupe_lecture" class="checkbox" type="checkbox" onclick="if (this.checked) { checkAllLinked('groupe', 'VIEW') } else { unCheckAllLinked('groupe', 'VIEW') }" style="background-color:#F3F6FB;align:center">
\r
225 <th width="15%" class="align-center">
\r
226 <strong><liferay-ui:message key="diffusion.permission.update" /></strong>
\r
228 <input id="check_all_groupe_ecriture" class="checkbox" type="checkbox" <c:if test="<%=empecherEcriture%>"> readonly="readonly" disabled="disabled"</c:if> onclick="if (this.checked) { checkAllLinked('groupe', 'UPDATE') } else { unCheckAllLinked('groupe', 'UPDATE') }" style="background-color:#F3F6FB;align:center">
\r
230 <c:if test="${(empty teams) and (empty usergroups)}">
\r
231 <th class="align-center" width="5%" scope="col" id="supp_button_groupe">
\r
232 <img id="delete_none_groupe" src="/ent-demo-theme/images/general/delete_disabled.gif">
\r
235 <c:if test="${(not empty teams) or (not empty usergroups)}">
\r
236 <th class="align-center" width="5%" scope="col" id="supp_button_groupe">
\r
237 <a href="#" onclick="supprimerAllGroupes()"><img id="delete_all_groupe" title="Supprimer tous les groupes" src="/ent-demo-theme/images/general/delete.gif"></a>
\r
242 <c:forEach var="entry" items="${teams}">
\r
243 <tr id="${entry.teamId}" class="shared_groups">
\r
244 <td class="moreSpace">
\r
245 <c:if test="${entry.hasSousGroupes}">
\r
246 <a id="lien-groupe-${entry.teamId}" onClick="plierDeplier(${entry.teamId})" href="#" class="lien-ferme">
\r
247 <img alt="plus" src="/ent-demo-theme/images/plus.png" style="float: left; padding-right: 10px; padding-top: 3px;">
\r
250 <input type="hidden" name="teamIds" value="${entry.teamId}" class="groupeIds"/>
\r
251 ${entry.teamName}<c:if test="${not empty entry.description}"><br/></c:if>
\r
252 ${entry.description}
\r
254 <td class="align-center">
\r
255 <c:if test="${entry.canRead}">
\r
256 <input type="checkbox" checked="checked" id="${entry.teamId}_action_view" name="${entry.teamId}_actionIds" value="VIEW" onclick="if (!this.checked) {verifyUnCheck('${entry.teamId}','groupe','VIEW') }else {verifyCheck('${entry.teamId}','groupe','VIEW')}"/>
\r
259 <td class="align-center">
\r
260 <c:if test="${entry.canWrite}">
\r
261 <input type="checkbox" checked="checked" id="${entry.teamId}_action_update" name="${entry.teamId}_actionIds" <c:if test="<%=empecherEcriture%>"> readonly="readonly" disabled="disabled"</c:if> value="UPDATE" onclick="if (!this.checked) {verifyUnCheck('${entry.teamId}','groupe','UPDATE') } else {verifyCheck('${entry.teamId}','groupe','UPDATE')}" />
\r
263 <c:if test="${not entry.canWrite}">
\r
264 <input type="checkbox" id="${entry.teamId}_action_update" name="${entry.teamId}_actionIds" <c:if test="<%=empecherEcriture%>"> readonly="readonly" disabled="disabled"</c:if> value="UPDATE" onclick="if (!this.checked) {verifyUnCheck('${entry.teamId}','groupe','UPDATE') } else {verifyCheck('${entry.teamId}','groupe','UPDATE')}"/>
\r
267 <td class="align-center" width="5%">
\r
268 <img class="cursor-pointer" title="Supprimer un groupe" onclick="<portlet:namespace />supprimerDroits('${entry.teamId}');" src="/ent-demo-theme/images/general/delete.gif">
\r
271 ${entry.listeSousGroupesHTML}
\r
273 <c:forEach var="entry" items="${usergroups}">
\r
274 <tr id="${entry.groupId}" class="shared_groups">
\r
275 <td class="moreSpace" width="65%">
\r
276 <c:if test="${entry.hasSousGroupes}">
\r
277 <a id="lien-groupe-${entry.groupId}" onClick="plierDeplier(${entry.groupId})" href="#" class="lien-ferme">
\r
278 <img alt="plus" src="/ent-demo-theme/images/plus.png" style="float: left; padding-right: 10px; padding-top: 3px;">
\r
281 <input type="hidden" name="teamIds" value="${entry.groupId}" class="groupeIds"/>
\r
282 ${entry.usergroupName}<c:if test="${not empty entry.description}"><br/></c:if>
\r
283 ${entry.description}
\r
285 <td width="15%" class="align-center">
\r
286 <c:if test="${entry.canRead}">
\r
287 <input type="checkbox" checked="checked" id="${entry.groupId}_action_view" name="${entry.groupId}_actionIds" value="VIEW" onclick="if (!this.checked) {verifyUnCheck('${entry.groupId}','groupe','VIEW') } else {verifyCheck('${entry.groupId}','groupe','VIEW')}"/>
\r
290 <td width="15%" class="align-center">
\r
291 <c:if test="${entry.canWrite}">
\r
292 <input type="checkbox" checked="checked" id="${entry.groupId}_action_update" name="${entry.groupId}_actionIds" <c:if test="<%=empecherEcriture%>"> readonly="readonly" disabled="disabled"</c:if> value="UPDATE" onclick="if (!this.checked) {verifyUnCheck('${entry.groupId}','groupe','UPDATE')} else {verifyCheck('${entry.groupId}','groupe','UPDATE')}"/>
\r
294 <c:if test="${not entry.canWrite}">
\r
295 <input type="checkbox" id="${entry.groupId}_action_update" name="${entry.groupId}_actionIds" <c:if test="<%=empecherEcriture%>"> readonly="readonly" disabled="disabled"</c:if> value="UPDATE" onclick="if (!this.checked) {verifyUnCheck('${entry.groupId}','groupe','UPDATE') } else {verifyCheck('${entry.groupId}','groupe','UPDATE')}"/>
\r
298 <td class="align-center" width="5%">
\r
299 <img class="cursor-pointer" title="Supprimer un groupe" onclick="<portlet:namespace />supprimerDroits('${entry.groupId}');" src="/ent-demo-theme/images/general/delete.gif">
\r
302 ${entry.listeSousGroupesHTML}
\r
304 <portlet:renderURL var="rechercheURL" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
\r
305 <portlet:param name="struts_action" value="/portlet_configuration/recherche" />
\r
306 <portlet:param name="resourceClassName" value="<%= resourceClassName %>" />
\r
307 <portlet:param name="resourcePrimKey" value="<%= resourcePrimaryKey %>" />
\r
308 <portlet:param name="cmd" value="rechercheGroup" />
\r
309 <portlet:param name="redirect" value="<%=redirect %>" />
\r
310 <portlet:param name="redirectViewURL" value="<%=redirectViewURL %>" />
\r
311 <portlet:param name="titleContentBreadcrumb" value="<%=titleContentBreadcrumb %>" />
\r
312 <portlet:param name="listeAutorisations" value="<%= String.valueOf(listeAutorisations) %>" />
\r
313 </portlet:renderURL>
\r
316 <c:if test="<%=!historiqueExiste%>">
\r
317 <td style="text-align: right;" colspan="3"> </td>
\r
319 <c:if test="<%=historiqueExiste%>">
\r
320 <td style="text-align: right;" colspan="3"><a href="<%=actionPortletURLRestauration%>" onClick="restaurationHabilitation(this);return false;"><liferay-ui:message key="diffusion.historique.retablir" /></a></td>
\r
322 <td class="align-center">
\r
323 <a href="#" onclick="showRecherche('<%=rechercheURL %>','group')"><img title="<liferay-ui:message key="diffusion.add.group.title"/>" class="cursor-pointer" src="/ent-demo-theme/images/icons/add_group.gif"></a>
\r
328 <table class="portal-explorateur" style="margin-top:20px" id="user">
\r
330 <tr class="ligne2" style="background-color: #F3F6FB;">
\r
331 <th width="65%" scope="col" class="affichagelibelle"><img src="/ent-demo-theme/images/icons/user.gif"/> <liferay-ui:message key="diffusion.table.title.user" /></th>
\r
332 <th width="15%" class="align-center">
\r
333 <strong><liferay-ui:message key="diffusion.permission.view" /></strong>
\r
335 <input id="check_all_user_lecture" class="checkbox" type="checkbox" onclick="if (this.checked) { checkAllLinked('user', 'VIEW') } else { unCheckAllLinked('user', 'VIEW') }" style="background-color:#F3F6FB;">
\r
337 <th width="15%" class="align-center">
\r
338 <strong><liferay-ui:message key="diffusion.permission.update" /></strong>
\r
340 <input id="check_all_user_ecriture" class="checkbox" type="checkbox" <c:if test="<%=empecherEcriture%>"> readonly="readonly" disabled="disabled"</c:if> onclick="if (this.checked) { checkAllLinked('user', 'UPDATE') } else { unCheckAllLinked('user', 'UPDATE') }" style="background-color:#F3F6FB;">
\r
342 <c:if test="${(empty users)}">
\r
343 <th class="align-center" width="5%" scope="col" id="supp_button_user">
\r
344 <img id="delete_none_user" src="/ent-demo-theme/images/general/delete_disabled.gif">
\r
347 <c:if test="${(not empty users)}">
\r
348 <th class="align-center" width="5%" scope="col" id="supp_button_user">
\r
349 <a href="#" onclick="supprimerAllUsers()"><img id="delete_all_user" title="Supprimer tous les utilisateurs " src="/ent-demo-theme/images/general/delete.gif"></a>
\r
354 <c:forEach var="entry" items="${users}" >
\r
355 <tr id="${entry.groupId}" class="shared_users">
\r
356 <td width="65%" class="moreSpace">
\r
357 <input type="hidden" name="teamIds" value="${entry.groupId}" class="userIds"/>
\r
360 <td width="15%" class="align-center">
\r
361 <c:if test="${entry.canRead}">
\r
362 <input type="checkbox" checked="checked" id="${entry.groupId}_action_view" name="${entry.groupId}_actionIds" value="VIEW" onclick="if (!this.checked) {verifyUnCheck('${entry.groupId}','user','VIEW') } else {verifyCheck('${entry.groupId}','user','VIEW')}"/>
\r
365 <td width="15%" class="align-center">
\r
366 <c:if test="${entry.canWrite}">
\r
367 <input type="checkbox" checked="checked" id="${entry.groupId}_action_update" name="${entry.groupId}_actionIds" <c:if test="<%=empecherEcriture%>"> readonly="readonly" disabled="disabled"</c:if> value="UPDATE" onclick="if (!this.checked) {verifyUnCheck('${entry.groupId}','user','UPDATE')} else {verifyCheck('${entry.groupId}','user','UPDATE')}"/>
\r
369 <c:if test="${not entry.canWrite}">
\r
370 <input type="checkbox" id="${entry.groupId}_action_update" name="${entry.groupId}_actionIds" <c:if test="<%=empecherEcriture%>"> readonly="readonly" disabled="disabled"</c:if> value="UPDATE" onclick="if (!this.checked) {verifyUnCheck('${entry.groupId}','user','UPDATE') } else {verifyCheck('${entry.groupId}','user','UPDATE')}"/>
\r
373 <td class="align-center" width="5%">
\r
374 <img class="cursor-pointer" title="Supprimer un utilisateur" onclick="<portlet:namespace />supprimerDroits('${entry.groupId}');" src="/ent-demo-theme/images/general/delete.gif">
\r
378 <portlet:renderURL var="rechercheUserURLGestionnaire" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
\r
379 <portlet:param name="struts_action" value="/portlet_configuration/recherche" />
\r
380 <portlet:param name="resourceClassName" value="<%= resourceClassName %>" />
\r
381 <portlet:param name="resourcePrimKey" value="<%= resourcePrimaryKey %>" />
\r
382 <portlet:param name="cmd" value="usersSearch" />
\r
383 <portlet:param name="redirect" value="<%=redirect %>" />
\r
384 <portlet:param name="redirectViewURL" value="<%=redirectViewURL %>" />
\r
385 <portlet:param name="titleContentBreadcrumb" value="<%=titleContentBreadcrumb %>" />
\r
386 <portlet:param name="listeAutorisations" value="<%= String.valueOf(listeAutorisations) %>" />
\r
387 <portlet:param name="rechercheGestionnaire" value="<%= String.valueOf(true) %>" />
\r
388 <portlet:param name="originalOwnerId" value="${owner.userId}" />
\r
389 </portlet:renderURL>
\r
391 <c:when test="${not empty newOwner}">
\r
393 <td width="65%" class="moreSpace">
\r
394 ${newOwner.lastName} ${newOwner.firstName}
\r
395 <input type="hidden" name="newOwnerId" value="${newOwner.userId}"/>
\r
397 <td width="15%" class="align-center">
\r
398 <input type="checkbox" checked="checked" disabled="disabled" readonly="readonly" name="owner_actionIds" value="VIEW"/>
\r
400 <td width="15%" class="align-center">
\r
401 <input type="checkbox" checked="checked" readonly="readonly" disabled="disabled" name="owner_actionIds" value="UPDATE"/>
\r
403 <td class="align-center" width="5%">
\r
404 <a href="#" onclick="showRecherche('<%=rechercheUserURLGestionnaire %>','gestionnaire')" title="<liferay-ui:message key="diffusion.replace.user.title"/>" ><img alt="<liferay-ui:message key="diffusion.replace.user.title"/>" class="cursor-pointer" src="/ent-demo-theme/images/icons/refresh.gif"></a>
\r
411 <td width="65%" class="moreSpace">
\r
412 ${owner.lastName} ${owner.firstName}
\r
414 <td width="15%" class="align-center">
\r
415 <input type="checkbox" checked="checked" disabled="disabled" readonly="readonly" name="owner_actionIds" value="VIEW"/>
\r
417 <td width="15%" class="align-center">
\r
418 <input type="checkbox" checked="checked" readonly="readonly" disabled="disabled" name="owner_actionIds" value="UPDATE"/>
\r
420 <td class="align-center" width="5%">
\r
421 <a href="#" onclick="showRecherche('<%=rechercheUserURLGestionnaire %>','gestionnaire')" title="<liferay-ui:message key="diffusion.replace.user.title"/>" ><img alt="<liferay-ui:message key="diffusion.replace.user.title"/>" class="cursor-pointer" src="/ent-demo-theme/images/icons/refresh.gif"></a>
\r
427 <portlet:renderURL var="rechercheUserURL" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
\r
428 <portlet:param name="struts_action" value="/portlet_configuration/recherche" />
\r
429 <portlet:param name="resourceClassName" value="<%= resourceClassName %>" />
\r
430 <portlet:param name="resourcePrimKey" value="<%= resourcePrimaryKey %>" />
\r
431 <portlet:param name="cmd" value="usersSearch" />
\r
432 <portlet:param name="redirect" value="<%=redirect %>" />
\r
433 <portlet:param name="redirectViewURL" value="<%=redirectViewURL %>" />
\r
434 <portlet:param name="titleContentBreadcrumb" value="<%=titleContentBreadcrumb %>" />
\r
435 <portlet:param name="listeAutorisations" value="<%= String.valueOf(listeAutorisations) %>" />
\r
436 </portlet:renderURL>
\r
438 <td style="text-align: right;" colspan="3"> </td>
\r
439 <td class="align-center">
\r
440 <a href="#" onclick="showRecherche('<%=rechercheUserURL %>','user')"><img title="<liferay-ui:message key="diffusion.add.user.title"/>" class="cursor-pointer" src="/ent-demo-theme/images/icons/add_user.gif"></a>
\r
444 <aui:input name="cmd" type="hidden" value="update_diffusion" />
\r
445 <%if(resourceClassName.equalsIgnoreCase(DLFolder.class.getName())){ %>
\r
446 <aui:input name="repercuter_droit" type="hidden" value="false" />
\r
448 <div class="portal-tabs">
\r
449 <c:if test="${!showCancelButton}">
\r
450 <div class="alignement-left">
\r
451 <aui:button href="<%= redirect %>" type="cancel" />
\r
454 <input id="submit_enregistrer" type="submit" value="<liferay-ui:message key="diffusion.button.save.permission"/>" />
\r
459 <input type="hidden" name="hasConflicts" value="<liferay-ui:message key="permission-conflict"/>" id="hasConflicts" />
\r
460 <script type="text/javascript">
461 function checkConflicts() {
\r
462 var message = jQuery("#hasConflicts").val();
\r
463 return confirm(message);
\r
466 function plierDeplier(teamOrGroupId) {
\r
467 var lienGroupe = jQuery("#lien-groupe-"+teamOrGroupId);
\r
468 var etat = lienGroupe.attr("class")
\r
469 var sousGroupes = jQuery(".sous-groupe-"+teamOrGroupId);
\r
471 if(etat=='lien-ferme') {
\r
472 lienGroupe.attr("class", "lien-ouvert");
\r
473 lienGroupe.html("<img alt=\"moins\" src=\"/ent-demo-theme/images/moins.png\" style=\"float: left; padding-right: 10px; padding-top: 3px;\">");
\r
474 sousGroupes.show();
\r
476 lienGroupe.attr("class", "lien-ferme");
\r
477 lienGroupe.html("<img alt=\"plus\" src=\"/ent-demo-theme/images/plus.png\" style=\"float: left; padding-right: 10px; padding-top: 3px;\">");
\r
478 sousGroupes.hide();
\r
482 jQuery(document).ready(function() {
\r
484 function afficherSousGroupes() {
\r
485 jQuery(".shared_groups").each(function(){
\r
486 var teamOrGroupId = jQuery(this).attr("id");
\r
487 var lienGroupe = jQuery("#lien-groupe-"+teamOrGroupId);
\r
488 var etat = lienGroupe.attr("class");
\r
489 var sousGroupes = jQuery(".sous-groupe-"+teamOrGroupId);
\r
490 if(etat=='lien-ferme') {
\r
491 sousGroupes.hide();
\r
493 sousGroupes.show();
\r
498 afficherSousGroupes();
\r
501 <%if(resourceClassName.equalsIgnoreCase(DLFolder.class.getName())){ %>
\r
507 jQuery('#submit_enregistrer').click(function(e) {
\r
508 e.preventDefault();
\r
509 var dialog = jQuery('<p><liferay-ui:message key="popup.propagation.droits.confirmation"/></p>').dialog({
\r
511 "Oui" : function() {
\r
512 document.<portlet:namespace />fm.<portlet:namespace />repercuter_droit.value=true;
\r
513 if(null != document.<portlet:namespace />fm.newOwnerId
\r
514 && document.<portlet:namespace />fm.newOwnerId != ''){
\r
515 var retour = confirm('<liferay-ui:message key="diffusion.confirmation.gestionnaire" />');
\r
517 submitForm(document.<portlet:namespace />fm);
\r
519 dialog.dialog('close');
\r
522 submitForm(document.<portlet:namespace />fm);
\r
525 "Non" : function() {
\r
526 if(null != document.<portlet:namespace />fm.newOwnerId
\r
527 && document.<portlet:namespace />fm.newOwnerId.value != ''){
\r
528 var retour = confirm('<liferay-ui:message key="diffusion.confirmation.gestionnaire" />');
\r
530 submitForm(document.<portlet:namespace />fm);
\r
532 dialog.dialog('close');
\r
535 submitForm(document.<portlet:namespace />fm);
\r
538 "Annuler" : function() {
\r
539 dialog.dialog('close');
\r
553 '<portlet:namespace />supprimerDroits',
\r
554 function(groupeId) {
\r
555 /* Pas la peine d'appeler des actions, on supprime juste la ligne du tableau*/
\r
557 var tr=A.one('#'+groupeId);
\r
558 var sousGroupe=A.one('.sous-groupe-'+groupeId);
\r
563 while(sousGroupe) {
\r
564 sousGroupe.remove();
\r
565 sousGroupe=A.one('.sous-groupe-'+groupeId)
\r
574 'supprimerAllGroupes',
\r
576 /* Pas la peine d'appeler des actions, on supprime juste les lignes du tableau */
\r
578 var tr=A.one('.shared_groups');
\r
579 var sousGroupe=A.one('.sous-groupe');
\r
583 tr=A.one('.shared_groups')
\r
587 sousGroupe.remove();
\r
588 sousGroupe=A.one('.sous-groupe');
\r
591 A.one("#supp_button_groupe").html('<img id="delete_none_groupe" src="/ent-demo-theme/images/general/delete_disabled.gif">');
\r
598 'supprimerAllUsers',
\r
600 /* Pas la peine d'appeler des actions, on supprime juste les lignes du tableau */
\r
602 var tr=A.one('.shared_users');
\r
605 tr=A.one('.shared_users')
\r
607 A.one("#supp_button_user").html('<img id="delete_none_user" src="/ent-demo-theme/images/general/delete_disabled.gif">');
\r
615 function(url,typeRecherche) {
\r
617 if(typeRecherche=='user' || typeRecherche=='gestionnaire'){
\r
618 title='<liferay-ui:message key="diffusion.recherche.user.title.popup"/>';
\r
620 if(typeRecherche=='group'){
\r
621 title='<liferay-ui:message key="diffusion.recherche.group.title.popup"/>';
\r
624 var dialog = new A.Dialog(
\r
626 destroyOnClose: true,
\r
630 preventOverlap: true,
\r
641 loadingMask: {'strings.loading' : 'Chargement…'}
\r
645 ['aui-dialog', 'aui-io']
\r
648 function checkAllLinked(type, action){
\r
649 var element=document.getElementById(type);
\r
650 var elms = element.getElementsByTagName("input");
\r
651 var len = elms.length;
\r
652 for (var i = 0; i < len; i++) {
\r
653 if (elms[i].type == 'checkbox' && elms[i].value==action && elms[i].name != 'owner_actionIds') {
\r
654 elms[i].checked = true;
\r
657 if( action == 'UPDATE' ){
\r
658 var elementAllCheckId = 'check_all_' + type + '_lecture';
\r
659 var elementAllCheck = document.getElementById(elementAllCheckId);
\r
660 elementAllCheck.checked = true;
\r
661 checkAllLinked(type, 'VIEW');
\r
665 function unCheckAllLinked(type, action){
\r
666 var element=document.getElementById(type);
\r
667 var elms = element.getElementsByTagName("input");
\r
668 var len = elms.length;
\r
669 for (var i = 0; i < len; i++) {
\r
670 if (elms[i].type == 'checkbox' && elms[i].value==action && elms[i].name != 'owner_actionIds') {
\r
671 elms[i].checked = false;
\r
674 if( action == 'VIEW' ){
\r
675 var elementAllCheckId = 'check_all_' + type + '_ecriture';
\r
676 var elementAllCheck = document.getElementById(elementAllCheckId);
\r
677 elementAllCheck.checked = false;
\r
678 unCheckAllLinked(type, 'UPDATE');
\r
683 function verifyCheck(id, type, action){
\r
684 //alert('verifyCheck(id='+id+',type='+type+',action='+action+')');
\r
685 var elementAllCheckId = 'check_all_' + type + '_' + (action=='VIEW'?'lecture':'ecriture');
\r
686 var elementAllCheck = document.getElementById(elementAllCheckId);
\r
687 var element=document.getElementById(type);
\r
688 var elms = element.getElementsByTagName("input");
\r
689 var len = elms.length;
\r
691 // si je coche UPDATE, coche auto de VIEW
\r
692 if( action == 'UPDATE'){
\r
693 var viewElement = document.getElementById(id+'_action_view');
\r
694 viewElement.checked = true;
\r
695 verifyCheck(id,type,'VIEW');
\r
698 // verification de case 'All'
\r
699 for (var i = 0; i < len; i++) {
\r
700 if (elms[i].type == 'checkbox' && elms[i].value==action && elms[i].name != 'owner_actionIds' && !elms[i].checked) {
\r
704 elementAllCheck.checked = true;
\r
707 function verifyUnCheck(id, type, action){
\r
708 //alert('verifyUnCheck(id='+id+',type='+type+',action='+action+')');
\r
709 var elementAllCheckId = 'check_all_' + type + '_' + (action=='VIEW'?'lecture':'ecriture');
\r
710 var elementAllCheck = document.getElementById(elementAllCheckId);
\r
711 var element=document.getElementById(type);
\r
712 var elms = element.getElementsByTagName("input");
\r
713 var len = elms.length;
\r
715 // si je decoche VIEW, decoche auto de UPDATE
\r
716 if( action == 'VIEW'){
\r
717 var viewElement = document.getElementById(id+'_action_update');
\r
718 viewElement.checked = false;
\r
719 verifyUnCheck(id,type,'UPDATE');
\r
722 // si on decoche une case, la cas 'All' doit etre decochee
\r
723 elementAllCheck.checked = false;
\r
726 function confirmRestauration(message){
\r
727 return confirm (message);
\r
732 'restaurationHabilitation',
\r
734 if (!confirm('<liferay-ui:message key="diffusion.confirmation.restauration" />')) {
\r
737 Liferay.Util.forcePost(link);
\r
745 'confirmerChangementGestionnaire',
\r
747 var retour = confirm('<liferay-ui:message key="diffusion.confirmation.gestionnaire" />');
\r
749 submitForm(document.<portlet:namespace />fm);
\r