Bug 14931

Summary: Remove C4::Dates from files admin/aq*.pl
Product: Koha Reporter: Marc Véron <veron>
Component: Architecture, internals, and plumbingAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: hector.hecaxmmx, jonathan.druart+koha, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 14870    
Attachments: Bug 14931 - Remove C4::Dates from files admin/aq*.pl
[SIGNED-OFF]Bug 14931 - Remove C4::Dates from files admin/aq*.pl
Bug 14931 - (Follow-up) Validate date entry in contracts
Bug 14931 - (Follow-up) Validate date entry in contracts
[SIGNED OFF] Bug 14931 - (Follow-up) Validate date entry in contracts
Bug 14931 - Remove C4::Dates from files admin/aq*.pl
Bug 14931 - (Follow-up) Validate date entry in contracts
Bug 14931: (qa followu-up) small improvements
Bug 14931: Fix test xt/author/valid_templates complaining on opac-topissues.tt

Description Marc Véron 2015-09-30 16:49:23 UTC
This patch removes C4::Dates from:

- admin/aqbudgets.pl
- admin/aqplan.pl
- admin/aqcontract.pl


To test:

- Apply patch

- Go to Home > Adminstration > Budgets > All funds
  (admin/aqbudgets.pl)
- Verify that everything displays as before

- Edit one of the funds and click on 'Planning - Plan by months'
  (admin/aqplan.pl)
- Verify that planning works as before

- Go to Home > Acquisitions, search for an active vendor and view the vendor
- Click on 'Contracts' at the left
  (admin/aqcontract.pl)
- Create and edit contracts and verify that it works OK.
  (Note: there is no help for this page, see Bug 14929)
Comment 1 Marc Véron 2015-09-30 16:52:26 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2015-10-09 16:15:21 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-10-15 09:16:40 UTC
I get a software error if the dates are not correctly formatted.
Comment 4 Marc Véron 2015-10-15 11:05:56 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2015-10-15 11:07:02 UTC
The Follow-up needs an other sign-off.
Comment 6 Marc Véron 2015-10-23 09:41:33 UTC
Still applies
Comment 7 Héctor Eduardo Castro Avalos 2015-10-23 20:34:40 UTC
Sorry Marc, but fail me.

This is the error message:

DBIx::Class::ResultSet::find(): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'booksellerid' AND me.1 IS NULL AND me.2015-12-31 = 'contractname' AND me.Fict' at line 1 at /home/koha/kohaclone/C4/Contract.pm line 125

This happend me when modifing the contract and i've entered an invalid date 32/10/2015 (DD/MM/YY)

This happen me when modifying the contract and entered an invalid date 32/10/2015 (DD/MM/YY)
Comment 8 Marc Véron 2015-10-25 17:22:55 UTC Comment hidden (obsolete)
Comment 9 Jesse Weaver 2015-10-27 21:40:38 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2015-10-28 08:42:28 UTC
Created attachment 44103 [details] [review]
Bug 14931 - Remove C4::Dates from files admin/aq*.pl

This patch removes C4::Dates from:

- admin/aqbudgets.pl
- admin/aqplan.pl
- admin/aqcontract.pl

To test:

- Apply patch

- Go to Home > Adminstration > Budgets > All funds
  (admin/aqbudgets.pl)
- Verify that everything displays as before

- Edit one of the funds and click on 'Planning - Plan by months'
  (admin/aqplan.pl)
- Verify that planning works as before

- Go to Home > Acquisitions, search for an active vendor and view the vendor
- Click on 'Contracts' at the left
  (admin/aqcontract.pl)
- Create and edit contracts and verify that it works OK.
  (Note: there is no help for this page, see Bug 14929)

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. Tested with dateformat syspref
Dates in planning by months not needed to be on iso format, aqplan.pl
uses instead Date::Calc

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2015-10-28 08:42:39 UTC
Created attachment 44104 [details] [review]
Bug 14931 - (Follow-up) Validate date entry in contracts

Go to Home > Acquisitions, search for an active vendor and view the vendor
- Click on 'Contracts' at the left
  (admin/aqcontract.pl)
- Create and edit contracts and verify that it works OK.
  (Note: there is no help for this page, see Bug 14929)

Amended for comment #7  25.10.2015 / mv

Signed-off-by: Jesse Weaver <pianohacker@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Jonathan Druart 2015-10-28 08:42:43 UTC
Created attachment 44105 [details] [review]
Bug 14931: (qa followu-up) small improvements

- Avoid 1 call to dt_from_string in some cases
- Do not use $_

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2015-10-28 08:59:41 UTC Comment hidden (obsolete)
Comment 14 Tomás Cohen Arazi 2015-10-29 15:05:42 UTC
Patches pushed to master.

Thanks Marc!