Bug 9508 - the dateformat variable is not standardized in template files
Summary: the dateformat variable is not standardized in template files
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: 3.14
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Paul Poulain
URL:
Keywords:
Depends on: 9108
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-30 15:14 UTC by Jonathan Druart
Modified: 2014-12-07 20:02 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9508: Standardize the dateformat value from C4::Auth (20.40 KB, patch)
2013-01-30 15:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9508: Standardize the dateformat value from C4::Auth (20.58 KB, patch)
2013-02-01 14:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9508: Standardize the dateformat value from C4::Auth (17.77 KB, patch)
2013-03-21 11:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 9508: Standardize the dateformat value from C4::Auth (17.84 KB, patch)
2013-03-22 16:45 UTC, Paul Poulain
Details | Diff | Splinter Review
Bug 9508 follow-up : replacing tabs by spaces (31.93 KB, patch)
2013-03-22 16:45 UTC, Paul Poulain
Details | Diff | Splinter Review
Bug 9508: Standardize the dateformat value from C4::Auth (14.90 KB, patch)
2013-05-03 07:39 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9508 follow-up : replacing tabs by spaces (29.82 KB, patch)
2013-05-03 07:39 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2013-01-30 15:14:05 UTC
It would be great to use the following test everywhere
  if ( dateformat == "metric" )
instead of
  if ( dateformat_metric )
Comment 1 Jonathan Druart 2013-01-30 15:16:14 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2013-01-30 15:18:07 UTC
Checked with 

git grep "\(dateformat_us\|dateformat_metric\|dateformat_iso|\dateformatmetric|\dateformatus|\dateformatiso\)" | grep -v translator
Comment 3 Kyle M Hall 2013-02-01 14:19:33 UTC Comment hidden (obsolete)
Comment 4 Paul Poulain 2013-03-21 10:04:30 UTC
sorry, but patch does not apply anymore due to other changes. I tried to fix the conflicts, but it's a little bit took risky imo. joubu, please (and switch back to signed-off)
Comment 5 Jonathan Druart 2013-03-21 11:09:32 UTC Comment hidden (obsolete)
Comment 6 Paul Poulain 2013-03-22 16:44:22 UTC
QA comment
 * small patch, with nasty possible side effect, but looking at it it is properly written, clean code, so no reason to refuse him
 * passes koha-qa.pl, except for a tab. I've provided a follow-up with all tabs replaced by spaces (including tabs existing before the patch)
 * tested & could not find anything wrong

passed QA
Comment 7 Paul Poulain 2013-03-22 16:45:14 UTC Comment hidden (obsolete)
Comment 8 Paul Poulain 2013-03-22 16:45:20 UTC Comment hidden (obsolete)
Comment 9 Jared Camins-Esakov 2013-03-23 02:34:25 UTC
This patch no longer applies. Bumping back for 3.14.
Comment 10 Jonathan Druart 2013-03-27 15:11:47 UTC
No conflict here, switch back to "Passed QA".
Comment 11 Galen Charlton 2013-05-02 22:54:31 UTC
I too am getting merge conflicts applying this to master:

git bz apply 9508        
Bug 9508 - the dateformat variable is not standardized in template files

[PASSED QA] Bug 9508: Standardize the dateformat value from C4::Auth
Apply? [yn] y

Applying: Bug 9508: Standardize the dateformat value from C4::Auth
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging C4/Auth.pm
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
Auto-merging members/memberentry.pl
Failed to merge in the changes.
Patch failed at 0001 Bug 9508: Standardize the dateformat value from C4::Auth
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Comment 12 Jonathan Druart 2013-05-03 07:39:45 UTC
Created attachment 17915 [details] [review]
Bug 9508: Standardize the dateformat value from C4::Auth

- the dateformat value is send to all templates (from
  C4::Auth::get_template_and_user)
- remove all assignment of dateformat in all .pl files

- Remove "all" occurrences (those I found!) of dateformat_*
From now the only way to get the date format is a string comparaison
(dateformat == "metric")

Checked with the command:
  git grep "\(dateformat_us\|dateformat_metric\|dateformat_iso\)" | grep
  -v translator

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Tested all the datepickers I could find, looks good.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Comment 13 Jonathan Druart 2013-05-03 07:39:48 UTC
Created attachment 17916 [details] [review]
Bug 9508 follow-up : replacing tabs by spaces

This patch fixes tabs and replace them by spaces
Comment 14 Galen Charlton 2013-05-20 16:07:05 UTC
Pushed to master.  Thanks, Paul and Jonathan!