If you try to copy a notice or slip to another branch and that branch already has that notice or slip, it will not let you save it. There needs to be a way to overwrite the existing notice or slip without having to delete first then copy.
We are facing this same problem. I guess one possible solution could be move to "Modify notice" page instead "Add notice" if notice already exists.
Created attachment 138242 [details] [review] Bug 24616: Allow copying notice to a branch even if it exists in that branch If you try to copy notice or slip to a branch which already has that notice or slip Koha won't let you save it. Instead pop-up saying branch already has that notice is displayed. This patch allows users to copy and override already existing notice or slip. To test: 1. Find notice which exists e.g. in all branches and branch A. 2. Copy that notice, add notice screen is displayed. 3. Press save. => Pop-up informing that notice already exists in branch A is displayed. 4. Apply this patch. 5. Repeat steps 2. and 3. => Notice is saved succesfully. Also try to save the notice you tested with as a new (same code) to branch A. Confirm that pop-up is displayed as it should be. Sponsored-by: Koha-Suomi Oy
(In reply to Emmi Takkinen from comment #1) > We are facing this same problem. I guess one possible solution could be move > to "Modify notice" page instead "Add notice" if notice already exists. This wasn't the solution, but I still think we should move to "Modify notice" page in these cases. However I was unsure if this is in scope of this bug or should I open a separete bug report for this (if it doesn't already exists).
It works, but I don't think this is a complete solution. It needs to warn you that you are overwriting an existing notice or slip and give you the option to proceed or cancel. This is too dangerous as is.
(In reply to Christopher Brannon from comment #4) > It works, but I don't think this is a complete solution. It needs to warn > you that you are overwriting an existing notice or slip and give you the > option to proceed or cancel. This is too dangerous as is. That's a good point. I'll take a look at this again.
Created attachment 138503 [details] [review] Bug 24616: Allow copying notice to a branch even if it exists in that branch If you try to copy notice or slip to a branch which already has that notice or slip Koha won't let you save it. Instead pop-up saying branch already has that notice is displayed. This patch allows users to copy and override already existing notice or slip. To test: 1. Find notice which exists e.g. in all branches and branch A. 2. Copy that notice, add notice screen is displayed. 3. Press save. => Pop-up informing that notice already exists in branch A is displayed. 4. Apply this patch. 5. Repeat steps 2. and 3. 6. Pop-up to confirm overwrite of notice is displayed. => Confirm that if you press OK, notice is saved succesfully. => Otherwise, changes to notice should not be saved. Also try to save the notice you tested with as a new (same code) to branch A. Confirm that pop-up is displayed as it should be. Sponsored-by: Koha-Suomi Oy
Created attachment 142672 [details] [review] Bug 24616: Allow copying notice to a branch even if it exists in that branch If you try to copy notice or slip to a branch which already has that notice or slip Koha won't let you save it. Instead pop-up saying branch already has that notice is displayed. This patch allows users to copy and override already existing notice or slip. To test: 1. Find notice which exists e.g. in all branches and branch A. 2. Copy that notice, add notice screen is displayed. 3. Press save. => Pop-up informing that notice already exists in branch A is displayed. 4. Apply this patch. 5. Repeat steps 2. and 3. 6. Pop-up to confirm overwrite of notice is displayed. => Confirm that if you press OK, notice is saved succesfully. => Otherwise, changes to notice should not be saved. Also try to save the notice you tested with as a new (same code) to branch A. Confirm that pop-up is displayed as it should be. Sponsored-by: Koha-Suomi Oy Signed-off-by: Nick <nick@bywatersolutions.com>
I am sorry, but there is a major issue: When I save the changes, I get the overwrite warning, but: if I choose cancel, the changes are still saved. :(
Created attachment 142850 [details] [review] Bug 24616: Do not save form if user press cancel If one starts to copy a notice but then cancels this when pop-up is displayed, changes are still saved. This patch fixes this. To test: 1. Copy notice to a library where it already exists 2. Press save and then cancel when pop-up is displayed => Form and changes are still saved 3. Apply this patch. 4. Repeat steps 1. and 2. => Form is no longer saved Sponsored-by: Koha-Suomi Oy
Changing back to ASSIGNED, latest patch broke saving the form.
Created attachment 142856 [details] [review] Bug 24616: Do not save form if user press cancel If one starts to copy a notice but then cancels this when pop-up is displayed, changes are still saved. This patch fixes this. To test: 1. Copy notice to a library where it already exists 2. Press save and then cancel when pop-up is displayed => Form and changes are still saved 3. Apply this patch. 4. Repeat steps 1. and 2. => Form is no longer saved Sponsored-by: Koha-Suomi Oy
Setting this as Needs Signoff, notice form shouldn't now be saved when pressing cancel on pop-up.
The patch seems to work well. It did warn me of the existing notice and let me save the change anyway.
Created attachment 145238 [details] [review] Bug 24616: Do not save form if user press cancel If one starts to copy a notice but then cancels this when pop-up is displayed, changes are still saved. This patch fixes this. To test: 1. Copy notice to a library where it already exists 2. Press save and then cancel when pop-up is displayed => Form and changes are still saved 3. Apply this patch. 4. Repeat steps 1. and 2. => Form is no longer saved Sponsored-by: Koha-Suomi Oy Signed-off-by: ml-inlibro <marie-luce.laflamme@inlibro.com>
Changed status to now signed off - see comment #13 and signed off patch.
Created attachment 146148 [details] [review] Bug 24616: Allow copying notice to a branch even if it exists in that branch If you try to copy notice or slip to a branch which already has that notice or slip Koha won't let you save it. Instead pop-up saying branch already has that notice is displayed. This patch allows users to copy and override already existing notice or slip. To test: 1. Find notice which exists e.g. in all branches and branch A. 2. Copy that notice, add notice screen is displayed. 3. Press save. => Pop-up informing that notice already exists in branch A is displayed. 4. Apply this patch. 5. Repeat steps 2. and 3. 6. Pop-up to confirm overwrite of notice is displayed. => Confirm that if you press OK, notice is saved succesfully. => Otherwise, changes to notice should not be saved. Also try to save the notice you tested with as a new (same code) to branch A. Confirm that pop-up is displayed as it should be. Sponsored-by: Koha-Suomi Oy Signed-off-by: Nick <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 146149 [details] [review] Bug 24616: Do not save form if user press cancel If one starts to copy a notice but then cancels this when pop-up is displayed, changes are still saved. This patch fixes this. To test: 1. Copy notice to a library where it already exists 2. Press save and then cancel when pop-up is displayed => Form and changes are still saved 3. Apply this patch. 4. Repeat steps 1. and 2. => Form is no longer saved Sponsored-by: Koha-Suomi Oy Signed-off-by: ml-inlibro <marie-luce.laflamme@inlibro.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 146150 [details] [review] Bug 24616: (QA follow-up) Remove "This has bug" comment ... hopefully because there is no more bug now! Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
1) Removed this comment (hopefully rightfully) in a follow-up: +//This has bug 2) return confirm(__("A letter with the code '%s' already exists for '%s'. Overwrite this letter?").format(new_lettercode, new_branchcode)); We get the branchcode in the message instead of the library's name. But: This is already the case for the old error that doesn't allow you to overwrite. So I filed: Bug 32880 - Show library's name instead of branchcode in dialog when overwriting an existing notice
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Enhancement will not be backported to 22.05.x
Since the "copy notice" function wasn't in the manual yet, I added some documentation for that. No need for documentation on this bug though since the error message is self-explanatory.