stable

Clone or download

Read-only

refactor: Prepare the field to enforce filename pattern

Currently it is the emptyness of the pattern text field that decides if the filename pattern must be enforced or not. It is not easy for an admin to know how to deactivate the feature. Following Design Team advice, we cannot base the enforcement of a rule on the fact that the text field is empty or not. This will lead to a change in the web interface, by adding a checkbox to allow the user to decide to enforce or not the filename pattern (and to keep the pattern intact whatever the decision). This will be done in a next contribution. Current one prepare the field by encapsulating the pattern in a dedicated object that contains both the string pattern and the boolean is_enforced. No functional changes, pattern is still enforced if not empty for now. Part of story #24166: apply a naming pattern on files to enforce a convention Change-Id: I99c10bdae9e65fbe12fbce2a63cfa41938f14597

Modified Files

Name
M plugins/docman/include/FilenamePattern/FilenameBuilder.php +4 −2 Go to diff View file
R plugins/document/tests/unit/Stubs/FilenamePatternRetrieverStub.php Go to diff View file
M plugins/docman/include/FilenamePattern/FilenamePatternRetriever.php +7 −2 Go to diff View file
M plugins/docman/include/FilenamePattern/RetrieveFilenamePattern.php +1 −1 Go to diff View file
M plugins/docman/include/docmanPlugin.php +1 −1 Go to diff View file
M plugins/docman/include/view/Admin/FilenamePatternWarningsCollector.php +5 −3 Go to diff View file
M plugins/docman/include/view/Docman_View_Admin_FilenamePattern.class.php +3 −3 Go to diff View file
A plugins/docman/tests/unit/FilenamePattern/FilenamePatternTest.php +64 −0 Go to diff View file
M plugins/docman/tests/unit/Stubs/FilenamePatternRetrieverStub.php +5 −4 Go to diff View file
M plugins/document/include/Config/ModalDisplayer.php +1 −1 Go to diff View file
M plugins/document/include/Tree/DocumentTreePresenter.php +3 −2 Go to diff View file
M plugins/document/tests/unit/Config/ModalDisplayerTest.php +1 −1 Go to diff View file
M plugins/webdav/include/webdavPlugin.php +1 −1 Go to diff View file