From 73de4a2e3f39f22d7049d224f516d4f26ac00560 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 17 Nov 2009 16:11:10 +0100 Subject: [PATCH] Date management update Suggestions --- .../en/modules/suggestion/suggestion.tmpl | 46 ++++++++----------- .../prog/en/modules/opac-suggestions.tmpl | 1 - opac/opac-suggestions.pl | 2 +- suggestion/suggestion.pl | 39 ++++++++++++---- 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl index 80c43e490f..f29bfd80d8 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl @@ -95,7 +95,6 @@ $(document).ready(function() {
  • -
  • Suggestion management
      @@ -140,7 +139,7 @@ $(document).ready(function() { - +
    " />">CancelCancel
    @@ -165,28 +164,21 @@ $(document).ready(function() { " />
    Suggestion information: - - -
    - - - -
    - - - -
    - - - +
    + +
    + +
    + +
    Acquistion information : @@ -254,15 +246,15 @@ $(document).ready(function() {
    © ; Volume: - ; ISBN : ; Published by in in ; ;
    ; + ; ISBN : ; Published by in in ; ;
    ">, -
    +
    ">, -
    +
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl index 4c3e8bbc0d..a66a8ad2f0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl @@ -73,7 +73,6 @@ $.tablesorter.addParser({ -
  • " /> Cancel
    diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 0a8b2f8e9f..7c07c9f65b 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -75,7 +75,7 @@ if ( $op eq "add_confirm" ) { #some suggestion are answering the request Donot Add } else { - $$suggestion{'suggestioncreatedon'}=C4::Dates->today; + $$suggestion{'suggestioncreateddate'}=C4::Dates->today; $$suggestion{'branchcode'}=C4::Context->userenv->{"branch"}; &NewSuggestion($suggestion); # empty fields, to avoid filter in "SearchSuggestion" diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index ddaacf1d56..859c0dd749 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -35,15 +35,17 @@ sub Init{ $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")? $suggestion->{$date}=C4::Dates->today: format_date($suggestion->{$date}) - ); - } - $suggestion->{'accepteddate'}=(($suggestion->{'accepteddate'} eq "0000-00-00" ||$suggestion->{'accepteddate'} eq "")? + ); + } + foreach my $date qw(rejecteddate accepteddate){ + $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")? "": - format_date($suggestion->{'accepteddate'}) - ); - $suggestion->{'managedby'} =C4::Context->userenv->{"number"} unless ($suggestion->{'managedby'}); - $suggestion->{'suggestedby'}=C4::Context->userenv->{"number"} unless ($suggestion->{'suggestedby'}); - $suggestion->{'branchcode'} =C4::Context->userenv->{"branch"} unless ($suggestion->{'branchcode'}); + format_date($suggestion->{$date}) + ); + } + $suggestion->{'managedby'}=C4::Context->userenv->{"number"} unless ($suggestion->{'managedby'}); + $suggestion->{'createdby'}=C4::Context->userenv->{"number"} unless ($suggestion->{'createdby'}); + $suggestion->{'branchcode'}=C4::Context->userenv->{"branch"} unless ($suggestion->{'branchcode'}); } sub GetCriteriumDesc{ @@ -119,6 +121,7 @@ elsif ($op=~/edit/) { $op ='save'; } elsif ($op eq "change" ) { +<<<<<<< HEAD:suggestion/suggestion.pl if ($$suggestion_ref{"STATUS"}){ my $tmpstatus=($$suggestion_ref{"STATUS"} eq "ACCEPTED"?"accepted":"managed"); $$suggestion_ref{"$tmpstatus"."on"}=C4::Dates->today; @@ -134,6 +137,26 @@ elsif ($op eq "change" ) { foreach (keys %$suggestion_ref){ delete $$suggestion_ref{$_} unless ($$suggestion_ref{$_}); } +======= + if ($$suggestion_ref{"STATUS"}){ + if (my $tmpstatus=lc($$suggestion_ref{"STATUS"}) =~/ACCEPTED|REJECTED/i){ + $$suggestion_ref{"$tmpstatus"."date"}=C4::Dates->today; + $$suggestion_ref{"$tmpstatus"."by"}=C4::Context->userenv->{number}; + } + $$suggestion_ref{"manageddate"}=C4::Dates->today; + $$suggestion_ref{"managedby"}=C4::Context->userenv->{number}; + } + if ( my $reason = $$suggestion_ref{"reason$tabcode"}){ + if ( $reason eq "other" ) { + $reason = $$suggestion_ref{"other_reason$tabcode"}; + } + $$suggestion_ref{'reason'}=$reason; + } + delete $$suggestion_ref{$_} foreach ("reason$tabcode", "other_reason$tabcode"); + foreach (keys %$suggestion_ref){ + delete $$suggestion_ref{$_} unless ($$suggestion_ref{$_}); + } +>>>>>>> Date management update Suggestions:suggestion/suggestion.pl foreach my $suggestionid (@editsuggestions) { next unless $suggestionid; $$suggestion_ref{'suggestionid'}=$suggestionid; -- 2.39.5