diff --git a/Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/User.java b/Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/User.java index 175464b6e90..b9ab4ab7452 100644 --- a/Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/User.java +++ b/Kitodo-DataManagement/src/main/java/org/kitodo/data/database/beans/User.java @@ -111,6 +111,9 @@ public class User extends BaseBean { @Column(name = "show_pagination_by_default") private boolean showPaginationByDefault; + @Column(name = "paginate_from_first_page_by_default") + private boolean paginateFromFirstPageByDefault; + /** * Constructor for User Entity. */ @@ -146,6 +149,7 @@ public User(User user) { this.shortcuts = user.shortcuts; this.showCommentsByDefault = user.showCommentsByDefault; this.showPaginationByDefault = user.showPaginationByDefault; + this.paginateFromFirstPageByDefault = user.paginateFromFirstPageByDefault; this.defaultGalleryViewMode = user.defaultGalleryViewMode; if (user.roles != null) { @@ -172,7 +176,6 @@ public User(User user) { this.filters = user.filters; } - // default values if (Objects.nonNull(user.tableSize)) { this.tableSize = user.tableSize; } @@ -493,6 +496,24 @@ public void setShowPaginationByDefault(boolean showPaginationByDefault) { this.showPaginationByDefault = showPaginationByDefault; } + /** + * Get paginateFromFirstPageByDefault. + * + * @return value of paginateFromFirstPageByDefault + */ + public boolean isPaginateFromFirstPageByDefault() { + return paginateFromFirstPageByDefault; + } + + /** + * Set paginateFromFirstPageByDefault. + * + * @param paginateFromFirstPageByDefault as boolean + */ + public void setPaginateFromFirstPageByDefault(boolean paginateFromFirstPageByDefault) { + this.paginateFromFirstPageByDefault = paginateFromFirstPageByDefault; + } + /** * Removes a user from the environment. Since the * user ID may still be referenced somewhere, the user is not hard deleted from diff --git a/Kitodo-DataManagement/src/main/resources/db/migration/V2_128__Add_default_pagination_scope.sql b/Kitodo-DataManagement/src/main/resources/db/migration/V2_128__Add_default_pagination_scope.sql new file mode 100644 index 00000000000..2f71191a3d2 --- /dev/null +++ b/Kitodo-DataManagement/src/main/resources/db/migration/V2_128__Add_default_pagination_scope.sql @@ -0,0 +1,13 @@ +-- +-- (c) Kitodo. Key to digital objects e. V. +-- +-- This file is part of the Kitodo project. +-- +-- It is licensed under GNU General Public License version 3 or later. +-- +-- For the full copyright and license information, please read the +-- GPL3-License.txt file that was distributed with this source code. +-- + +-- Add column "paginate_from_first_page_by_default" to "user" table +ALTER TABLE user ADD paginate_from_first_page_by_default TINYINT(1) DEFAULT 0; diff --git a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/PaginationPanel.java b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/PaginationPanel.java index 12756c817b9..dac9751538d 100644 --- a/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/PaginationPanel.java +++ b/Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/PaginationPanel.java @@ -29,6 +29,7 @@ import org.kitodo.api.dataformat.View; import org.kitodo.config.ConfigCore; import org.kitodo.config.enums.ParameterCore; +import org.kitodo.data.database.beans.User; import org.kitodo.exceptions.InvalidImagesException; import org.kitodo.exceptions.InvalidMetadataValueException; import org.kitodo.exceptions.MediaNotFoundException; @@ -56,7 +57,7 @@ public class PaginationPanel { private List selectPaginationModeItems; private IllustratedSelectItem selectPaginationModeSelectedItem; private Map selectPaginationScopeItems; - private Boolean selectPaginationScopeSelectedItem = Boolean.TRUE; + private Boolean selectPaginationScopeSelectedItem; /** * Constructor. @@ -265,6 +266,11 @@ public void setFictitiousCheckboxChecked(boolean fictitiousCheckboxChecked) { this.fictitiousCheckboxChecked = fictitiousCheckboxChecked; } + private void prepareSelectPaginationScopeSelectedItem() { + selectPaginationScopeSelectedItem = ServiceManager.getUserService().getCurrentUser() + .isPaginateFromFirstPageByDefault(); + } + private void preparePaginationSelectionItems() { List physicalDivisions = dataEditor.getWorkpiece().getAllPhysicalDivisionChildrenSortedFilteredByPageAndTrack(); paginationSelectionItems = new ArrayList<>(physicalDivisions.size()); @@ -388,5 +394,6 @@ public void show() { selectPaginationScopeSelectedItem = Boolean.TRUE; preparePaginationSelectionItems(); preparePaginationSelectionSelectedItems(); + prepareSelectPaginationScopeSelectedItem(); } } diff --git a/Kitodo/src/main/resources/messages/messages_de.properties b/Kitodo/src/main/resources/messages/messages_de.properties index 977d2061390..90d592319a5 100644 --- a/Kitodo/src/main/resources/messages/messages_de.properties +++ b/Kitodo/src/main/resources/messages/messages_de.properties @@ -1174,6 +1174,7 @@ userDN=User DN userDocumentationLink=Anwenderdokumentation Kitodo.Production 3.X userEdit.metadataEditorSettings = Metadateneditor userEdit.metadataEditorSettings.defaultGalleryView = Standardansicht Galerie +userEdit.metadataEditorSettings.paginateFromFirstPageByDefault = Standardm\u00E4ssig ab erster markierten Seite paginieren userEdit.metadataEditorSettings.showCommentsByDefault = Kommentare standardm\u00E4ssig einblenden userEdit.metadataEditorSettings.showPaginationByDefault = Paginierung standardm\u00E4ssig einblenden userInstruction=Bedienungshinweise diff --git a/Kitodo/src/main/resources/messages/messages_en.properties b/Kitodo/src/main/resources/messages/messages_en.properties index d95a8ed8ffd..a12c156c25f 100644 --- a/Kitodo/src/main/resources/messages/messages_en.properties +++ b/Kitodo/src/main/resources/messages/messages_en.properties @@ -1175,6 +1175,7 @@ userDN=User DN userDocumentationLink=Kitodo.Production 3.X user documentation userEdit.metadataEditorSettings = Metadata editor userEdit.metadataEditorSettings.defaultGalleryView = Default gallery view +userEdit.metadataEditorSettings.paginateFromFirstPageByDefault = By default paginate from first selected page userEdit.metadataEditorSettings.showCommentsByDefault = Show comments by default userEdit.metadataEditorSettings.showPaginationByDefault = Show pagination by default userInstruction=User instructions diff --git a/Kitodo/src/main/webapp/WEB-INF/templates/includes/userEdit/metadataEditorSettings.xhtml b/Kitodo/src/main/webapp/WEB-INF/templates/includes/userEdit/metadataEditorSettings.xhtml index b1c59701504..ae34840089a 100644 --- a/Kitodo/src/main/webapp/WEB-INF/templates/includes/userEdit/metadataEditorSettings.xhtml +++ b/Kitodo/src/main/webapp/WEB-INF/templates/includes/userEdit/metadataEditorSettings.xhtml @@ -77,6 +77,15 @@ value="#{UserForm.userObject.showPaginationByDefault}" onchange="toggleSave()"/> +
+ + +