Skip to content

Commit

Permalink
Prevent using deactivated templates via row expansion and add 'active…
Browse files Browse the repository at this point in the history
…' column
  • Loading branch information
solth committed May 5, 2023
1 parent ae834af commit b0b19ce
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Kitodo/src/main/resources/messages/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ none=Keine
normDataRecord=URI
noImageFolderConfiguredInProject=Im Projekt ist kein Zielordner f\u00fcr die Bildgenerierung konfiguriert.
noSourceFolderConfiguredInProject=Im Projekt ist kein Quellordner f\u00fcr die Bildgenerierung konfiguriert.
noProjectsConfigured=Diese Produktionsvorlage wird von keinem Projekt verwendet!
noProjectsConfigured=Diese Produktionsvorlage wurde deaktiviert oder wird von keinem Projekt verwendet!
noTemplatesConfigured=F\u00fcr dieses Projekt wurden keine Produktionsvorlagen konfiguriert!
notSelected=Keine Auswahl
nr=Nr.
Expand Down
2 changes: 1 addition & 1 deletion Kitodo/src/main/resources/messages/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ none=None
normDataRecord=URI
noImageFolderConfiguredInProject=No target folder for imagegeneration configured in project.
noSourceFolderConfiguredInProject=No source folder for imagegeneration configured in project.
noProjectsConfigured=This template is not used by any project!
noProjectsConfigured=This template has been deactivated or is not used by any project!
noTemplatesConfigured=No template configured for this project!
notSelected=No selection
nr=Number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@
title="#{item.ruleset.title}"/>
</p:column>

<p:column headerText="#{msgs.active}"
styleClass="checkboxColumn"
sortBy="#{item.active}">
<h:outputText>
<ui:fragment rendered="#{item.isActive()}">
<i class="fa fa-check-square-o fa-lg checkbox-checked"/>
</ui:fragment>
<ui:fragment rendered="#{not item.isActive()}">
<i class="fa fa-minus-square-o fa-lg checkbox-unchecked"/>
</ui:fragment>
</h:outputText>
</p:column>

<p:column headerText="#{msgs.actions}"
resizable="false"
width="115"
Expand All @@ -68,11 +81,11 @@
<h:form id="templateActionForm">

<h:panelGroup styleClass="action"
title="#{item.projects.size() gt 0 ? msgs['createNewProcess'] : msgs['noProjectsConfigured']}">
title="#{item.isActive() and item.projects.size() gt 0 ? msgs['createNewProcess'] : msgs['noProjectsConfigured']}">
<p:commandLink id="createProcessFromTemplate"
actionListener="#{SelectProjectDialogView.setTemplateDTO(item)}"
action="#{SelectProjectDialogView.createProcessFromTemplate()}"
disabled="#{item.projects.size() lt 1}"
disabled="#{item.projects.size() lt 1 or not item.active}"
rendered="#{SecurityAccessController.hasAuthorityToAddProcess()}">
<f:setPropertyActionListener value="0" target="#{SelectProjectDialogView.selectedProjectId}"/>
<h:outputText><i class="fa fa-plus-square fa-lg"/></h:outputText>
Expand Down Expand Up @@ -162,7 +175,7 @@
title="#{project.title}"
styleClass="expansion-list-item-title"/>
<h:panelGroup class="expansion-list-item-actions">
<h:outputText rendered="#{SecurityAccessController.hasAuthorityToAddProcess()}">
<h:outputText rendered="#{SecurityAccessController.hasAuthorityToAddProcess() and item.isActive()}">
<h:link id="createProcess"
outcome="/pages/processFromTemplate?faces-redirect=true"
styleClass="action"
Expand Down

0 comments on commit b0b19ce

Please sign in to comment.