Bugzilla – Attachment 31948 Details for
Bug 12627
SQLHelper replacement - C4::Suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12627: Bug 12627: Fix default values - TT changes
Bug-12627-Bug-12627-Fix-default-values---TT-change.patch (text/plain), 8.74 KB, created by
Jonathan Druart
on 2014-09-30 14:34:24 UTC
(
hide
)
Description:
Bug 12627: Bug 12627: Fix default values - TT changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-30 14:34:24 UTC
Size:
8.74 KB
patch
obsolete
>From 7f5f3296dadaa42bc013166e7c7f18e8dce61e6e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 30 Sep 2014 12:56:35 +0200 >Subject: [PATCH] Bug 12627: Bug 12627: Fix default values - TT changes > >--- > .../prog/en/modules/suggestion/suggestion.tt | 17 +++++++++-------- > suggestion/suggestion.pl | 20 ++------------------ > 2 files changed, 11 insertions(+), 26 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index e3096c3..c8e25f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -1,5 +1,6 @@ > [% USE Branches %] > [% USE AuthorisedValues %] >+[% USE KohaDates %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › > [% IF ( op_save ) %] >@@ -261,18 +262,18 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <tbody> > <tr> > <th><span class="label">Suggestion creation</span> </th> >- <td>[% suggesteddate %]</td> >+ <td>[% suggesteddate | $KohaDates %]</td> > <td>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a> [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %] > </td> > </tr> > <tr> > <th><span class="label">Suggestion management</span> </th> >- <td>[% manageddate %]</td> >+ <td>[% manageddate | $KohaDates %]</td> > <td>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %]</a> [% Branches.GetName( managedby_branchcode ) %] ([% managedby_description %])[% END %]</td> > </tr> > <tr> > <th><span class="label">Suggestion accepted</span> </th> >- <td>[% accepteddate %]</td> >+ <td>[% accepteddate | $KohaDates %]</td> > <td>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])[% END %]</td> > </tr> > </tbody> >@@ -397,18 +398,18 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <tbody> > <tr> > <th><label for="suggesteddate">Suggestion creation</label> </th> >- <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlength="10" value="[% suggesteddate %]"/></td> >+ <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/></td> > <td><input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby %]"/>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a> [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])[% END %] > </td> > </tr> > <tr> > <th><label for="managedon">Suggestion management</label> </th> >- <td><input type="text" id="managedon" name="manageddate" size="10" maxlength="10" value="[% manageddate %]" /></td> >+ <td><input type="text" id="managedon" name="manageddate" size="10" maxlength="10" value="[% manageddate | $KohaDates %]" /></td> > <td><input type="hidden" id="managedby" name="managedby" value="[% managedby %]"/>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %]</a> [% Branches.GetName( managedby_branchcode ) %] ([% managedby_description %])[% END %]</td> > </tr> > <tr> > <th><label for="accepteddate">Suggestion accepted</label> </th> >- <td><input type="text" id="accepteddate" name="accepteddate" size="10" maxlength="10" value="[% accepteddate %]" /></td> >+ <td><input type="text" id="accepteddate" name="accepteddate" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" /></td> > <td><input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby %]"/>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% Branches.GetName( acceptedby_branchcode ) %] ([% acceptedby_description %])[% END %]</td> > </tr> > </tbody> >@@ -515,11 +516,11 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > </td> > <td> > [% IF ( suggestions_loo.emailsuggestedby ) %]<a href="mailto:[% suggestions_loo.emailsuggestedby %]">[% END %][% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby %][% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %] >- [% IF ( suggestions_loo.suggesteddate ) %] - [% suggestions_loo.suggesteddate %][% END %] >+ [% IF ( suggestions_loo.suggesteddate ) %] - [% suggestions_loo.suggesteddate | $KohaDates %][% END %] > </td> > <td> > [% IF ( suggestions_loo.emailmanagedby ) %]<a href="mailto:[% suggestions_loo.emailmanagedby %]">[% END %][% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby %][% END %] [% IF ( suggestions_loo.emailmanagedby ) %]</a>[% END %] >- [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate %][% END %] >+ [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate | $KohaDates %][% END %] > </td> > <td> > [% Branches.GetName( suggestions_loo.branchcode ) %] >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 14c90bd..14e6ac2 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -28,7 +28,6 @@ use C4::Koha; #GetItemTypes > use C4::Branch; > use C4::Budgets; > use C4::Search; >-use C4::Dates qw(format_date); > use C4::Members; > use C4::Debug; > >@@ -41,21 +40,13 @@ sub Init{ > # "Managed by" is used only when a suggestion is being edited (not when created) > if ($suggestion->{'suggesteddate'} eq "0000-00-00" ||$suggestion->{'suggesteddate'} eq "") { > # new suggestion >- $suggestion->{'suggesteddate'} = C4::Dates->today; >+ $suggestion->{suggesteddate} = dt_from_string; > $suggestion->{'suggestedby'} = C4::Context->userenv->{"number"} unless ($suggestion->{'suggestedby'}); > } > else { > # editing of an existing suggestion >- $suggestion->{'manageddate'} = C4::Dates->today; >+ $suggestion->{manageddate} = dt_from_string; > $suggestion->{'managedby'} = C4::Context->userenv->{"number"} unless ($suggestion->{'managedby'}); >- # suggesteddate, when coming from the DB, needs to be formated >- $suggestion->{'suggesteddate'} = format_date($suggestion->{'suggesteddate'}); >- } >- foreach my $date ( qw(rejecteddate accepteddate) ){ >- $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")? >- "": >- format_date($suggestion->{$date}) >- ); > } > $suggestion->{'branchcode'}=C4::Context->userenv->{"branch"} unless ($suggestion->{'branchcode'}); > } >@@ -258,13 +249,6 @@ if ($op=~/else/) { > my $bud = GetBudget( $suggestion->{budgetid} ); > $suggestion->{budget_name} = $bud->{budget_name} if $bud; > } >- foreach my $date (qw(suggesteddate manageddate accepteddate)) { >- if ($suggestion->{$date} and $suggestion->{$date} ne "0000-00-00") { >- $suggestion->{$date} = format_date( $suggestion->{$date} ); >- } else { >- $suggestion->{$date} = ""; >- } >- } > } > push @allsuggestions,{ > "suggestiontype"=>$criteriumvalue||"suggest", >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12627
:
29963
|
30095
|
30237
|
30269
|
30624
|
30635
|
30892
|
31916
|
31917
|
31937
|
31939
|
31940
|
31941
|
31942
|
31944
|
31948
|
31953
|
33244
|
33276
|
33277
|
33278
|
33279
|
33280
|
33281