Bug 14949 - Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl
Summary: Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14870 15087
  Show dependency treegraph
 
Reported: 2015-10-04 16:23 UTC by Marc Véron
Modified: 2016-06-21 21:40 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 14949 - Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl (3.67 KB, patch)
2015-10-04 16:39 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14949 - Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl (3.80 KB, patch)
2015-10-05 07:07 UTC, j.kylmala
Details | Diff | Splinter Review
Bug 14949 - (followup) Fix regression with hard due date (1.56 KB, patch)
2015-10-06 13:20 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14949 - Remove remaining C4::Dates and fix display in admin/categorie.pl (2.44 KB, patch)
2015-10-14 19:55 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 14949 - (followup) Fix regression with hard due date (1.66 KB, patch)
2015-10-23 21:32 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 14949 - Remove remaining C4::Dates and fix display in admin/categorie.pl (2.53 KB, patch)
2015-10-23 21:32 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[PASSED QA] Bug 14949 - Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl (3.88 KB, patch)
2015-10-24 20:50 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 14949 - (followup) Fix regression with hard due date (1.71 KB, patch)
2015-10-24 20:50 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 14949 - Remove remaining C4::Dates and fix display in admin/categorie.pl (2.58 KB, patch)
2015-10-24 20:50 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2015-10-04 16:23:45 UTC
Bug to remove C4::Dates from 
 - admin/smart-rules.pl 
 - admin/categorie.pl
Comment 1 Marc Véron 2015-10-04 16:39:21 UTC Comment hidden (obsolete)
Comment 2 j.kylmala 2015-10-05 07:07:31 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-10-06 10:24:24 UTC
Regression found:
There is no way to reset a hard due date.
To reproduce:
Don't apply this patch, go on smart-rules.pl and edit a line. Do not define a Hard due date, save.
The value is "None defined".

Apply this patch, edit the line, do not change anything and save.
The value is now "before 06/10/2015"
Comment 4 Marc Véron 2015-10-06 13:20:57 UTC Comment hidden (obsolete)
Comment 5 Héctor Eduardo Castro Avalos 2015-10-13 21:40:48 UTC
Hi Marc

Yet another line with C4::Dates in admin/categorie.pl

    $category->enrolmentperioddate(
        C4::Dates::format_date( $category->enrolmentperioddate() ) );

This in line 286
Comment 6 Marc Véron 2015-10-14 19:25:35 UTC
Hi Héctor,
Thaks for this catch.
The date formatting is not necessary here. Additionally, there is a bug:
enrolmentperiod and enrolmentperioddate are not transmitted to the template.

To verify, try to delete some categories. 

The confirmation screen will always display 

Enrollment period: until

instead of

Enrollment period: 99 months 
or 
Enrollment period: until (a date)

Patch follows.
Comment 7 Marc Véron 2015-10-14 19:55:14 UTC Comment hidden (obsolete)
Comment 8 Marc Véron 2015-10-23 09:40:10 UTC
Still applies / Auto merging
Comment 9 Héctor Eduardo Castro Avalos 2015-10-23 21:32:15 UTC Comment hidden (obsolete)
Comment 10 Héctor Eduardo Castro Avalos 2015-10-23 21:32:59 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2015-10-24 20:50:26 UTC
Created attachment 43934 [details] [review]
[PASSED QA] Bug 14949 - Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl

Bug to remove C4::Dates from
 - admin/smart-rules.pl
 - admin/categorie.pl

To test:

- Apply patch

- Go to Home > Administration > Circulation and fine rules (smart-rules.pl)
- Edit or add a rule
- Verify that 'Hard due date' displays and saves fine

- Go to Home > Administration > Patron categories
- Edit or add a category
- Verify that 'Until date' displays and saves fine

Note: The date picker does not warn about wrong date formats as e.g. while
      editing patrons, but that is not in the scope of this bug

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2015-10-24 20:50:29 UTC
Created attachment 43935 [details] [review]
[PASSED QA] Bug 14949 - (followup) Fix regression with hard due date

This patch fixes the regresseion as described in comment #3

To test:

- Go on smart-rules.pl and edit a line. Do not define a Hard due date, save.
  The value is "None defined".

- Edit the line, do not change anything and save.
  The value should be "None defined"

- Edit the line, define a hard due date, save.
  The date should display as expected.

- Edit the line agein, remove the hard due date, save.
  The value should be "None defined"

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2015-10-24 20:50:32 UTC
Created attachment 43936 [details] [review]
[PASSED QA] Bug 14949 - Remove remaining C4::Dates and fix display in admin/categorie.pl

This patch removes a remaining C4::Dates from admin/categroie.pl and fixes
the display of "Enrollment period" on the confirmation screen for deleting.

To verify and test pls. refer to comments #5 and #6

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Tomás Cohen Arazi 2015-10-27 13:45:16 UTC
Patches pushed to master.

Thanks Marc!