From f451fa57efbe9dc27d6dcc092fc52f23903bde54 Mon Sep 17 00:00:00 2001 From: SilverDav Date: Mon, 15 May 2023 17:26:29 +0200 Subject: [PATCH 1/2] Bug #13588 : fixing browseBar display in locations choice --- .../webapp/kmelia/jsp/publicationPaths.jsp | 459 +++++++++--------- 1 file changed, 232 insertions(+), 227 deletions(-) diff --git a/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/publicationPaths.jsp b/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/publicationPaths.jsp index b0d7117eae..a2ef166fb8 100644 --- a/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/publicationPaths.jsp +++ b/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/publicationPaths.jsp @@ -23,272 +23,277 @@ along with this program. If not, see . --%> -<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@ taglib uri="http://www.silverpeas.com/tld/viewGenerator" prefix="view"%> +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> +<%@ taglib uri="http://www.silverpeas.com/tld/viewGenerator" prefix="view" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="p" uri="http://www.silverpeas.com/tld/viewGenerator" %> +<%@ taglib prefix="sp" uri="http://www.silverpeas.com/tld/viewGenerator" %> <%@ page import="org.silverpeas.components.kmelia.model.KmeliaPublication" %> <% -response.setHeader("Cache-Control","no-store"); //HTTP 1.1 -response.setHeader("Pragma","no-cache"); //HTTP 1.0 -response.setDateHeader ("Expires",-1); //prevents caching at the proxy server + response.setHeader("Cache-Control", "no-store"); //HTTP 1.1 + response.setHeader("Pragma", "no-cache"); //HTTP 1.0 + response.setDateHeader("Expires", -1); //prevents caching at the proxy server %> <%@ include file="checkKmelia.jsp" %> <% -KmeliaPublication publication = (KmeliaPublication) request.getAttribute("Publication"); -String linkedPathString = (String) request.getAttribute("LinkedPathString"); -String currentLang = (String) request.getAttribute("Language"); + KmeliaPublication publication = (KmeliaPublication) request.getAttribute("Publication"); + String linkedPathString = (String) request.getAttribute("LinkedPathString"); + String currentLang = (String) request.getAttribute("Language"); -String pubName = publication.getDetail().getName(currentLang); -String id = publication.getDetail().getPK().getId(); + String pubName = publication.getDetail().getName(currentLang); + String id = publication.getDetail().getPK().getId(); -boolean toolbox = componentId.startsWith("toolbox"); + boolean toolbox = componentId.startsWith("toolbox"); %> - - - - - - - - - - - - <% - Window window = gef.getWindow(); - Frame frame = gef.getFrame(); - - BrowseBar browseBar = window.getBrowseBar(); - - browseBar.setDomainName(spaceLabel); - browseBar.setComponentName(componentLabel, "javascript:onClick=topicGoTo('0')"); - browseBar.setPath(linkedPathString); - browseBar.setExtraInformation(pubName); - - out.println(window.printBefore()); - - KmeliaDisplayHelper.displayAllOperations(id, kmeliaScc, gef, "ViewPath", resources, out); + currentPath.set(KMELIA, componentLabel); + displayCurrentPath(); + emptyComponentTreeview(); + $.post("<%=routerUrl%>ShowAliasTree?ComponentId=" + componentId, function(data) { + $("#treeviewFolders").html(data); + }); + } - out.println(frame.printBefore()); + function displayCurrentPath() { + let path = ""; + for (const key of currentPath.keys()) { + if (key !== '0') { + path += " > "; + } + let a = ""; + if (key === KMELIA) { + a = currentPath.get(KMELIA); + } else { + a = "" + + currentPath.get(key) + ""; + } + path += a; + } + $("#currentPath").html(path); + } - Board board = gef.getBoard(); - - out.println(board.printBefore()); + function viewLocalComponent() { + $.post("<%=routerUrl%>ShowAliasTree?ComponentId=<%=componentId%>", function(data) { + $("#localTreeview").html(data); + }); + } - //regarder si la publication est dans la corbeille - if (publication.getLocation().isTrash()) { - //la publi est dans la corbeille - out.println("
"+kmeliaScc.getString("kmelia.PubInBasket")+"
"); - } + function emptyComponentTreeview() { + $("#treeviewFolders").empty(); + } - %> -
-
-

-
-
    -
    + function deleteAlias(aliasURI, locationId) { + var ajaxRequest = sp.ajaxRequest(aliasURI).byDeleteMethod(); + ajaxRequest.send().then(function() { + $("#currentLocations #" + locationId).remove(); + $("#localTreeview #" + locationId).prop("checked", false); + $("#treeviewFolders #" + locationId).prop("checked", false); + }); + } -
    -
    -

    -
    -
    -
    + function addAlias(aliasURI) { + let ajaxRequest = sp.ajaxRequest(aliasURI).byPutMethod(); + ajaxRequest.send().then(function() { + displayLocations(); + }); + } -
    - -
    -

    -
    -
    -
    + function displayLocations() { + let ajaxRequest = sp.ajaxRequest( + webContext + "/services/private/publications/<%=componentId%>/<%=id%>/locations?lang=" + + getUserLanguage()); + ajaxRequest.send().then(function(response) { + let lis = ""; + response.responseAsJson().forEach(function(location) { + let locationId = location.id + "-" + location.componentId; + let li = "
  • " + + location.path + ""; + if (location.alias) { + li += "" + location.user.fullName + ""; + li += "" + sp.moment.displayAsDateTime(location.date) + + ""; + li += "Supprimer"; + } + li += "
  • "; + lis += li; + }); + $("#currentLocations ul").html(lis); + }); + } - <% - out.println(board.printAfter()); + function topicGoTo(id) { + location.href = "GoToTopic?Id=" + id; + } + + + + + + <% + KmeliaDisplayHelper.displayAllOperations(id, kmeliaScc, gef, "ViewPath", resources, out); + if (publication.getLocation().isTrash()) { + out.println("
    " + kmeliaScc.getString("kmelia.PubInBasket") + + "
    "); + } - out.println(frame.printAfter()); - out.println(window.printAfter()); -%> - - + %> + + +
    +
    +

    +
    +
      +
      + +
      +
      +

      +
      +
      +
      + +
      + +
      +

      +
      +
      +
      +
      +
      +
      +
      + \ No newline at end of file From 99a145f1bdc1cda364926898aedf0575d470fc37 Mon Sep 17 00:00:00 2001 From: SilverDav Date: Wed, 3 May 2023 15:58:15 +0200 Subject: [PATCH 2/2] Bug #9479 : Focus on search query field --- .../src/main/webapp/kmelia/jsp/oneLevel.jsp | 746 +++---- .../kmelia/jsp/simpleListOfPublications.jsp | 417 ++-- .../src/main/webapp/kmelia/jsp/treeview.jsp | 1767 ++++++++--------- 3 files changed, 1462 insertions(+), 1468 deletions(-) diff --git a/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/oneLevel.jsp b/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/oneLevel.jsp index 9f8575d082..3c19e0d704 100644 --- a/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/oneLevel.jsp +++ b/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/oneLevel.jsp @@ -29,12 +29,12 @@ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://www.silverpeas.com/tld/viewGenerator" prefix="view"%> +<%@ taglib uri="http://www.silverpeas.com/tld/silverFunctions" prefix="silfn" %> <%@ taglib tagdir="/WEB-INF/tags/silverpeas/kmelia" prefix="kmelia" %> <%@page import="org.silverpeas.components.kmelia.SearchContext"%> <%@page import="org.silverpeas.core.admin.user.model.SilverpeasRole"%> <%@ page import="org.silverpeas.core.i18n.I18NHelper" %> <%@ page import="org.silverpeas.core.web.util.viewgenerator.html.browsebars.BrowseBar" %> -<%@ page import="org.silverpeas.core.web.util.viewgenerator.html.buttons.Button" %> <%@ page import="org.silverpeas.core.web.util.viewgenerator.html.operationpanes.OperationPane" %> <%@ page import="org.silverpeas.core.web.util.viewgenerator.html.window.Window" %> <%@ page import="org.silverpeas.core.webapi.node.NodeType" %> @@ -44,395 +44,395 @@ - + + <% -String rootId = "0"; - -String profile = (String) request.getAttribute("Profile"); -String translation = (String) request.getAttribute("Language"); -boolean displayNBPublis = ((Boolean) request.getAttribute("DisplayNBPublis")).booleanValue(); -Boolean rightsOnTopics = (Boolean) request.getAttribute("RightsOnTopicsEnabled"); -Boolean displaySearch = (Boolean) request.getAttribute("DisplaySearch"); -int currentPageIndex = (Integer) request.getAttribute("PageIndex"); - -SearchContext searchContext = (SearchContext) request.getAttribute("SearchContext"); -String query = ""; -if (searchContext != null) { - query = searchContext.getQuery(); -} + String rootId = "0"; -String id = (String) request.getAttribute("CurrentFolderId"); + String profile = (String) request.getAttribute("Profile"); + String translation = (String) request.getAttribute("Language"); + boolean displayNBPublis = ((Boolean) request.getAttribute("DisplayNBPublis")).booleanValue(); + Boolean rightsOnTopics = (Boolean) request.getAttribute("RightsOnTopicsEnabled"); + int currentPageIndex = (Integer) request.getAttribute("PageIndex"); -String pubIdToHighlight = (String) request.getAttribute("PubIdToHighlight"); //used when we have found publication from search (only toolbox) + SearchContext searchContext = (SearchContext) request.getAttribute("SearchContext"); -String language = kmeliaScc.getLanguage(); + String id = (String) request.getAttribute("CurrentFolderId"); + String pubIdToHighlight = (String) request.getAttribute("PubIdToHighlight"); //used when we have found publication from search (only toolbox) + String language = kmeliaScc.getLanguage(); -if (id == null) { - id = rootId; -} + if (id == null) { + id = rootId; + } -String userId = kmeliaScc.getUserId(); + String userId = kmeliaScc.getUserId(); %> - - - - - - - - - - - - - - - - - - -
      -
      -<% - Window window = gef.getWindow(); - BrowseBar browseBar = window.getBrowseBar(); - browseBar.setI18N("GoToCurrentTopic", translation); + function topicGoTo(id) { + closeWindows(); + displayTopicContent(id); + + } + + function getCurrentUserId() { + return "<%=userId%>"; + } + + function getWebContext() { + return "<%=m_context%>"; + } + + function getComponentId() { + return "${componentId}"; + } + + function getComponentLabel() { + return "<%=WebEncodeHelper.javaStringToJsString(componentLabel)%>"; + } + + function getLanguage() { + return "<%=language%>"; + } + + function getPubIdToHighlight() { + return "<%=pubIdToHighlight%>"; + } + + function getTranslation() { + return "<%=translation%>"; + } + + function getToValidateFolderId() { + return "<%=KmeliaHelper.SPECIALFOLDER_TOVALIDATE%>"; + } + + function getNonVisiblePubsFolderId() { + return "<%=KmeliaHelper.SPECIALFOLDER_NONVISIBLEPUBS%>"; + } + + function isSpecialFolder(id) { + return id === getToValidateFolderId() || id === getNonVisiblePubsFolderId(); + } + + function focusOnSearch() + { + $("#topicQuery").focus(); + } + + + + +
      +
      + <% + Window window = gef.getWindow(); + BrowseBar browseBar = window.getBrowseBar(); + browseBar.setI18N("GoToCurrentTopic", translation); + + //Display operations - following lines are mandatory to init menu correctly + OperationPane operationPane = window.getOperationPane(); + operationPane.addOperation("", resources.getString("FavoritesAdd1")+" "+kmeliaScc.getString("FavoritesAdd2"), "javaScript:addCurrentNodeAsFavorite()"); + + out.println(window.printBefore()); + %> + +
      + + + +
      + +
      +
      +
      + +
      +
      <%=resources.getString("kmelia.inProgressPublications") %> +

      "/>
      +
      +
      +
      +
      + +
      + <% + out.println(window.printAfter()); + %> + +
      + + + + +
      + +
      + + +
      + +
      + +
      + + -
      - - - -<%@ include file="../../sharing/jsp/createTicketPopin.jsp" %> - - - - - - + + function getString(key) { + return sp.i18n.get(key); + } + +
      + + + + <%@ include file="../../sharing/jsp/createTicketPopin.jsp" %> + + + + + + \ No newline at end of file diff --git a/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/simpleListOfPublications.jsp b/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/simpleListOfPublications.jsp index a714130efa..5506cda244 100644 --- a/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/simpleListOfPublications.jsp +++ b/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/simpleListOfPublications.jsp @@ -38,130 +38,125 @@ <%@ page import="org.silverpeas.core.web.selection.BasketSelectionUI" %> + <% -String id = "0"; + String id = "0"; + + String namePath = spaceLabel + " > " + componentLabel; + String profile = (String) request.getAttribute("Profile"); + String translation = (String) request.getAttribute("Language"); + boolean isGuest = (Boolean) request.getAttribute("IsGuest"); + Boolean displaySearch = (Boolean) request.getAttribute("DisplaySearch"); + int currentPageIndex = (Integer) request.getAttribute("PageIndex"); + SearchContext searchContext = (SearchContext) request.getAttribute("SearchContext"); + String pubIdToHighlight = (String) request.getAttribute("PubIdToHighlight"); //used when we have found publication from search (only toolbox) + String language = kmeliaScc.getLanguage(); + String urlTopic = URLUtil.getSimpleURL(URLUtil.URL_COMPONENT, componentId, true); + String userId = kmeliaScc.getUserId(); + + boolean userCanCreatePublications = SilverpeasRole.ADMIN.isInRole(profile) || SilverpeasRole.PUBLISHER + .isInRole(profile) || SilverpeasRole.WRITER.isInRole(profile); + boolean userCanValidatePublications = SilverpeasRole.ADMIN.isInRole(profile) || SilverpeasRole.PUBLISHER + .isInRole(profile); + + boolean userCanSeeStats = kmeliaScc.isStatisticAllowed(); -// création du nom pour les favoris -String namePath = spaceLabel + " > " + componentLabel; +%> -//R?cup?ration des param?tres -String profile = (String) request.getAttribute("Profile"); -String translation = (String) request.getAttribute("Language"); -boolean isGuest = (Boolean) request.getAttribute("IsGuest"); -Boolean displaySearch = (Boolean) request.getAttribute("DisplaySearch"); -int currentPageIndex = (Integer) request.getAttribute("PageIndex"); + + + + + + + + + + + - - -
      -
      -<% + function pasteFromOperations() { + checkOnPaste('0'); + } + + function pasteDone(folderId) { + displayPublications(folderId); + } + + function focusOnSearch() + { + $("#topicQuery").focus(); + } + + var searchInProgress = <%=searchContext != null%>; + + $(document).ready(function() { + if (searchInProgress) { + doPagination(<%=currentPageIndex%>); + } else { + displayPublications("<%=id%>"); + } + displayTopicDescription("0"); + if (isSearchTopicEnabled) { + setTimeout(focusOnSearch,500); + } + + }); + + window.SUBSCRIPTION_PROMISE.then(function() { + window.spSubManager = new SilverpeasSubscriptionManager('<%=componentId%>'); + }); + + + +
      +
      + <% Window window = gef.getWindow(); BrowseBar browseBar = window.getBrowseBar(); browseBar.setI18N("GoToCurrentTopic", translation); @@ -169,114 +164,116 @@ window.SUBSCRIPTION_PROMISE.then(function() { //Display operations OperationPane operationPane = window.getOperationPane(); if (SilverpeasRole.ADMIN.isInRole(profile)){ - if (kmeliaScc.isPdcUsed()) { - operationPane.addOperation("useless", resources.getString("GML.PDCParam"), "javascript:onClick=openSPWindow('"+m_context+"/RpdcUtilization/jsp/Main?ComponentId="+kmeliaScc.getComponentId()+"','utilizationPdc1')"); - operationPane.addOperation("useless", resources.getString("GML.PDCPredefinePositions"), "javascript:onClick=openPredefinedPdCClassification(" + id + ");"); - } - if (kmeliaScc.isContentEnabled()) { - operationPane.addOperation(resources.getIcon("kmelia.modelUsed"), resources.getString("kmelia.ModelUsed"), "ModelUsed"); - } - if (kmeliaScc.isWysiwygOnTopicsEnabled()) { - operationPane.addOperation("useless", kmeliaScc.getString("TopicWysiwyg"), "javascript:onClick=topicWysiwyg('"+id+"')"); - } + if (kmeliaScc.isPdcUsed()) { + operationPane.addOperation("useless", resources.getString("GML.PDCParam"), "javascript:onClick=openSPWindow('"+m_context+"/RpdcUtilization/jsp/Main?ComponentId="+kmeliaScc.getComponentId()+"','utilizationPdc1')"); + operationPane.addOperation("useless", resources.getString("GML.PDCPredefinePositions"), "javascript:onClick=openPredefinedPdCClassification(" + id + ");"); + } + if (kmeliaScc.isContentEnabled()) { + operationPane.addOperation(resources.getIcon("kmelia.modelUsed"), resources.getString("kmelia.ModelUsed"), "ModelUsed"); + } + if (kmeliaScc.isWysiwygOnTopicsEnabled()) { + operationPane.addOperation("useless", kmeliaScc.getString("TopicWysiwyg"), "javascript:onClick=topicWysiwyg('"+id+"')"); + } if (SilverpeasRole.ADMIN.isInRole(profile)) { operationPane.addOperation("useless", resources.getString("GML.manageSubscriptions"), "ManageSubscriptions"); } - if (kmeliaScc.isExportComponentAllowed() && kmeliaScc.isExportZipAllowed()) { - operationPane.addOperation("useless", kmeliaScc.getString("kmelia.ExportComponent"), "javascript:onClick=exportTopic()"); - } - if (kmeliaScc.isExportComponentAllowed() && kmeliaScc.isExportPdfAllowed()) { - operationPane.addOperation("useless", kmeliaScc.getString("kmelia.ExportPDF"), "javascript:openExportPDFPopup()"); - } - operationPane.addOperation(resources.getIcon("kmelia.sortPublications"), kmeliaScc.getString("kmelia.OrderPublications"), "ToOrderPublications"); - operationPane.addLine(); + if (kmeliaScc.isExportComponentAllowed() && kmeliaScc.isExportZipAllowed()) { + operationPane.addOperation("useless", kmeliaScc.getString("kmelia.ExportComponent"), "javascript:onClick=exportTopic()"); + } + if (kmeliaScc.isExportComponentAllowed() && kmeliaScc.isExportPdfAllowed()) { + operationPane.addOperation("useless", kmeliaScc.getString("kmelia.ExportPDF"), "javascript:openExportPDFPopup()"); + } + operationPane.addOperation(resources.getIcon("kmelia.sortPublications"), kmeliaScc.getString("kmelia.OrderPublications"), "ToOrderPublications"); + operationPane.addLine(); } if (userCanCreatePublications) { - operationPane.addOperationOfCreation(resources.getIcon("kmelia.operation.addPubli"), kmeliaScc.getString("PubCreer"), "NewPublication"); - if (kmeliaScc.isImportFileAllowed()) { - operationPane.addOperationOfCreation(resources.getIcon("kmelia.operation.importFile"), kmeliaScc.getString("kmelia.ImportFile"), "javascript:onClick=importFile()"); - } - if (kmeliaScc.isImportFilesAllowed()) { - operationPane.addOperationOfCreation(resources.getIcon("kmelia.operation.importFiles"), kmeliaScc.getString("kmelia.ImportFiles"), "javascript:onClick=importFiles()"); - } - operationPane.addOperation("useless", resources.getString("kmelia.operation.copyPublications"), "javascript:onclick=copyPublications()"); - operationPane.addOperation("useless", resources.getString("kmelia.operation.cutPublications"), "javascript:onclick=cutPublications()"); - operationPane.addOperation(resources.getIcon("kmelia.paste"), resources.getString("GML.paste"), "javascript:onClick=pasteFromOperations()"); - operationPane.addOperation("useless", resources.getString("kmelia.operation.deletePublications"), "javascript:onclick=deletePublications()"); - operationPane.addLine(); - } - - if (!isGuest) { - if (BasketSelectionUI.displayPutIntoBasketSelectionShortcut()) { - operationPane.addOperation("useless", resources.getString("kmelia.operation.putPublicationsInBasket"), "javascript:onclick=putPublicationsInBasket()"); + operationPane.addOperationOfCreation(resources.getIcon("kmelia.operation.addPubli"), kmeliaScc.getString("PubCreer"), "NewPublication"); + if (kmeliaScc.isImportFileAllowed()) { + operationPane.addOperationOfCreation(resources.getIcon("kmelia.operation.importFile"), kmeliaScc.getString("kmelia.ImportFile"), "javascript:onClick=importFile()"); + } + if (kmeliaScc.isImportFilesAllowed()) { + operationPane.addOperationOfCreation(resources.getIcon("kmelia.operation.importFiles"), kmeliaScc.getString("kmelia.ImportFiles"), "javascript:onClick=importFiles()"); + } + operationPane.addOperation("useless", resources.getString("kmelia.operation.copyPublications"), "javascript:onclick=copyPublications()"); + operationPane.addOperation("useless", resources.getString("kmelia.operation.cutPublications"), "javascript:onclick=cutPublications()"); + operationPane.addOperation(resources.getIcon("kmelia.paste"), resources.getString("GML.paste"), "javascript:onClick=pasteFromOperations()"); + operationPane.addOperation("useless", resources.getString("kmelia.operation.deletePublications"), "javascript:onclick=deletePublications()"); operationPane.addLine(); } - operationPane.addOperation("useless", resources.getString("kmelia.operation.exportSelection"), "javascript:onclick=exportPublications()"); - operationPane.addOperation("useless", "", "javascript:onClick=spSubManager.switchUserSubscription()"); - operationPane.addOperation("useless", resources.getString("FavoritesAdd1")+" "+kmeliaScc.getString("FavoritesAdd2"), "javaScript:addFavorite('"+ + + if (!isGuest) { + if (BasketSelectionUI.displayPutIntoBasketSelectionShortcut()) { + operationPane.addOperation("useless", resources.getString("kmelia.operation.putPublicationsInBasket"), "javascript:onclick=putPublicationsInBasket()"); + operationPane.addLine(); + } + operationPane.addOperation("useless", resources.getString("kmelia.operation.exportSelection"), "javascript:onclick=exportPublications()"); + operationPane.addOperation("useless", "", "javascript:onClick=spSubManager.switchUserSubscription()"); + operationPane.addOperation("useless", resources.getString("FavoritesAdd1")+" "+kmeliaScc.getString("FavoritesAdd2"), "javaScript:addFavorite('"+ WebEncodeHelper.javaStringToHtmlString(WebEncodeHelper.javaStringToJsString(namePath))+"','','"+urlTopic+"')"); - } + } - if (userCanCreatePublications) { - operationPane.addLine(); - operationPane.addOperation("useless", resources.getString("PubBasket"), "GoToBasket"); - if (userCanValidatePublications) { - operationPane.addOperation("useless", resources.getString("ToValidate"), "ViewPublicationsToValidate"); - operationPane.addOperation("useless", resources.getString("kmelia.folder.nonvisiblepubs"), "ViewPublicationsNonVisibles"); - } - } - if (userCanSeeStats) { - operationPane.addLine(); - operationPane.addOperation("useless", resources.getString("kmelia.operation.statistics"), "javascript:showStats();"); - } + if (userCanCreatePublications) { + operationPane.addLine(); + operationPane.addOperation("useless", resources.getString("PubBasket"), "GoToBasket"); + if (userCanValidatePublications) { + operationPane.addOperation("useless", resources.getString("ToValidate"), "ViewPublicationsToValidate"); + operationPane.addOperation("useless", resources.getString("kmelia.folder.nonvisiblepubs"), "ViewPublicationsNonVisibles"); + } + } + if (userCanSeeStats) { + operationPane.addLine(); + operationPane.addOperation("useless", resources.getString("kmelia.operation.statistics"), "javascript:showStats();"); + } - out.println(window.printBefore()); -%> - - -
      - -
      -
      + out.println(window.printBefore()); + %> + + +
      + +
      +
      +
      + +
      + <%=resources.getString("kmelia.inProgressPublications") %> +

      progress..."/>

      - -
      - <%=resources.getString("kmelia.inProgressPublications") %> -

      progress..."/>
      -
      -
      -
      +
      - -
      - <% - out.println(window.printAfter()); - %> - -
      - - - - -
      - -
      - -
      - -
      - -
      - -
      - -<%@ include file="../../sharing/jsp/createTicketPopin.jsp" %> - - - - - - +
      + +
      + <% + out.println(window.printAfter()); + %> + +
      + + + + +
      + +
      + +
      + +
      + +
      + +
      + + <%@ include file="../../sharing/jsp/createTicketPopin.jsp" %> + + + + +
      + diff --git a/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/treeview.jsp b/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/treeview.jsp index f0697fe8aa..5ba2c2f64a 100644 --- a/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/treeview.jsp +++ b/kmelia/kmelia-war/src/main/webapp/kmelia/jsp/treeview.jsp @@ -43,41 +43,38 @@ + + <% -String rootId = "0"; + String rootId = "0"; //R?cup?ration des param?tres -String profile = (String) request.getAttribute("Profile"); -String translation = (String) request.getAttribute("Language"); -boolean displayNBPublis = (Boolean) request.getAttribute("DisplayNBPublis"); -Boolean rightsOnTopics = (Boolean) request.getAttribute("RightsOnTopicsEnabled"); -Boolean displaySearch = (Boolean) request.getAttribute("DisplaySearch"); -SearchContext searchContext = (SearchContext) request.getAttribute("SearchContext"); -int currentPageIndex = (Integer) request.getAttribute("PageIndex"); + String profile = (String) request.getAttribute("Profile"); + String translation = (String) request.getAttribute("Language"); + boolean displayNBPublis = (Boolean) request.getAttribute("DisplayNBPublis"); + Boolean rightsOnTopics = (Boolean) request.getAttribute("RightsOnTopicsEnabled"); + SearchContext searchContext = (SearchContext) request.getAttribute("SearchContext"); + int currentPageIndex = (Integer) request.getAttribute("PageIndex"); -String pubIdToHighlight = (String) request.getAttribute("PubIdToHighlight"); //used when we have found publication from search (only toolbox) + String pubIdToHighlight = (String) request.getAttribute("PubIdToHighlight"); //used when we have found publication from search (only toolbox) -String id = (String) request.getAttribute("CurrentFolderId"); -String language = kmeliaScc.getLanguage(); + String id = (String) request.getAttribute("CurrentFolderId"); + String language = kmeliaScc.getLanguage(); -if (id == null) { - id = rootId; -} + if (id == null) { + id = rootId; + } -String userId = kmeliaScc.getUserId(); + String userId = kmeliaScc.getUserId(); -boolean userCanManageRoot = "admin".equalsIgnoreCase(profile); -boolean userCanManageTopics = rightsOnTopics || "admin".equalsIgnoreCase(profile) || kmeliaScc.isTopicManagementDelegated(); + boolean userCanManageRoot = "admin".equalsIgnoreCase(profile); + boolean userCanManageTopics = rightsOnTopics || "admin".equalsIgnoreCase(profile) || kmeliaScc.isTopicManagementDelegated(); %> - - - - - - + + @@ -88,518 +85,522 @@ boolean userCanManageTopics = rightsOnTopics || "admin".equalsIgnoreCase(profile - - - - - - -
      -
      -<% + } + + function getLanguage() { + return "<%=language%>"; + } + + function getPubIdToHighlight() { + return "<%=pubIdToHighlight%>"; + } + + function getTranslation() { + return "<%=translation%>"; + } + + function getToValidateFolderId() { + return "<%=KmeliaHelper.SPECIALFOLDER_TOVALIDATE%>"; + } + + function getNonVisiblePubsFolderId() { + return "<%=KmeliaHelper.SPECIALFOLDER_NONVISIBLEPUBS%>"; + } + + function isSpecialFolder(id) { + return id === getToValidateFolderId() || id === getNonVisiblePubsFolderId(); + } + + function getCurrentFolderId() { + return "<%=id%>"; + } + + function arePublicationsOnRootAllowed() { + return <%=KmeliaPublicationHelper.isPublicationsOnRootAllowed(componentId)%>; + } + + var icons = new Object(); + icons["permalink"] = "<%=resources.getIcon("kmelia.link")%>"; + icons["operation.addTopic"] = "<%=resources.getIcon("kmelia.operation.addTopic")%>"; + icons["operation.addPubli"] = "<%=resources.getIcon("kmelia.operation.addPubli")%>"; + icons["operation.importFile"] = "<%=resources.getIcon("kmelia.operation.importFile")%>"; + icons["operation.importFiles"] = "<%=resources.getIcon("kmelia.operation.importFiles")%>"; + icons["operation.subscribe"] = "<%=resources.getIcon("kmelia.operation.subscribe")%>"; + icons["operation.favorites"] = "<%=resources.getIcon("kmelia.operation.favorites")%>"; + + var params = new Object(); + params["rightsOnTopic"] = <%=rightsOnTopics.booleanValue()%>; + params["i18n"] = <%=I18NHelper.isI18nContentActivated%>; + params["nbPublisDisplayed"] = <%=displayNBPublis%>; + + var searchInProgress = <%=searchContext != null%>; + var searchFolderId = "<%=id%>"; + + + +
      +
      + <% Window window = gef.getWindow(); BrowseBar browseBar = window.getBrowseBar(); browseBar.setI18N("GoToCurrentTopic", translation); //Display operations - following lines are mandatory to init menu correctly OperationPane operationPane = window.getOperationPane(); - operationPane.addOperation("useless", resources.getString("FavoritesAdd1")+" "+resources.getString("FavoritesAdd2"), "javaScript:addCurrentNodeAsFavorite()"); + operationPane.addOperation("useless", resources.getString("FavoritesAdd1")+" "+resources.getString("FavoritesAdd2"), "javaScript:addCurrentNodeAsFavorite()"); out.println(window.printBefore()); -%> - - - -
      -
      -
      - -
      - -
      -
      + %> + +
      +
      +
      + +
      + +
      +
      +
      +
      - -
      -
      <%=resources.getString("kmelia.inProgressPublications") %> -

      "/>
      -
      -
      -
      +
      <%=resources.getString("kmelia.inProgressPublications") %> +

      "/>
      +
      +
      - -
      -
      -
      - <% - out.println(window.printAfter()); - %> - -
      - - - - -
      - -
      - - -
      - -
      - -
      - - -
      - -
      " style="display: none;"> -

      - <%=resources.getStringWithParams("kmelia.help.rightclick.content", WebEncodeHelper.javaStringToHtmlString(componentLabel)) %> -

      -
      - - -<%@ include file="../../sharing/jsp/createTicketPopin.jsp" %> - - - - - - + treeview.settings.dnd.check_while_dragging = !canBeDropped; + }); + +
      + +
      " style="display: none;"> +

      + <%=resources.getStringWithParams("kmelia.help.rightclick.content", WebEncodeHelper.javaStringToHtmlString(componentLabel)) %> +

      +
      + + + <%@ include file="../../sharing/jsp/createTicketPopin.jsp" %> + + + + + + \ No newline at end of file