View | Details | Raw Unified | Return to bug 22784
Collapse All | Expand All

(-)a/C4/Suggestions.pm (+5 lines)
Lines 205-210 sub SearchSuggestion { Link Here
205
        }
205
        }
206
    }
206
    }
207
207
208
    # By default do not search for archived suggestions
209
    unless ( exists $suggestion->{archived} && $suggestion->{archived} ) {
210
        push @query, q{ AND suggestions.archived = 0 };
211
    }
212
208
    $debug && warn "@query";
213
    $debug && warn "@query";
209
    my $sth = $dbh->prepare("@query");
214
    my $sth = $dbh->prepare("@query");
210
    $sth->execute(@sql_params);
215
    $sth->execute(@sql_params);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-6 / +38 lines)
Lines 573-578 Link Here
573
                    [% IF ( suggestions_loo.copyrightdate ) %]© [% suggestions_loo.copyrightdate | html %] [% END %]
573
                    [% IF ( suggestions_loo.copyrightdate ) %]© [% suggestions_loo.copyrightdate | html %] [% END %]
574
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc | html %]</i> [% END %]
574
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc | html %]</i> [% END %]
575
                        [% IF ( suggestions_loo.isbn ) %]; ISBN:<i>[% suggestions_loo.isbn | html %]</i> [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode | html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear | html %]</i> [% END %][% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place | html %]</i> [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle | html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) | html %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<div class="note"><i class="fa fa-comment"></i> [% suggestions_loo.note | html %]</div>[% END %]
575
                        [% IF ( suggestions_loo.isbn ) %]; ISBN:<i>[% suggestions_loo.isbn | html %]</i> [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode | html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear | html %]</i> [% END %][% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place | html %]</i> [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle | html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) | html %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<div class="note"><i class="fa fa-comment"></i> [% suggestions_loo.note | html %]</div>[% END %]
576
                        [% IF suggestions_loo.archived %]<br /><i class="fa fa-archive"> Archived[% END %]
576
                </td>
577
                </td>
577
                <td>
578
                <td>
578
                    <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.suggestedby | uri %]">[% suggestions_loo.surnamesuggestedby | html %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby | html %][% END %] [% IF (suggestions_loo.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby | html %])[% END %]</a>
579
                    <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.suggestedby | uri %]">[% suggestions_loo.surnamesuggestedby | html %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby | html %][% END %] [% IF (suggestions_loo.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby | html %])[% END %]</a>
Lines 622-629 Link Here
622
                    [% END %]
623
                    [% END %]
623
                </td>
624
                </td>
624
                <td class="actions">
625
                <td class="actions">
625
                    <a class="btn btn-xs btn-default" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&amp;op=edit"><i class="fa fa-pencil"></i> Edit</a>
626
                    <div class="dropup">
626
                    <a class="btn btn-default btn-xs deletesuggestion" href="suggestion.pl?op=delete&amp;suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a>
627
                    <div class="btn-group">
628
                        <a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid | html %]&amp;op=edit"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_[% suggestions_loo.suggestionid | html %]" role="button" data-toggle="dropdown" href="#"><b class="caret"></b></a>
629
                        <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="more_actions_[% suggestions_loo.suggestionid | html %]">
630
                            <li><a class="deletesuggestion" href="suggestion.pl?op=delete&amp;suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-trash"></i> Delete</a></li>
631
                            [% UNLESS suggestions_loo.archived %]
632
                                <li><a class="archivesuggestion" href="suggestion.pl?op=archive&amp;suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Archive</a></li>
633
                            [% ELSE %]
634
                                <li><a class="unarchivesuggestion" href="suggestion.pl?op=unarchive&amp;suggestionid=[% suggestions_loo.suggestionid | html %]"><i class="fa fa-archive"></i> Unarchive</a></li>
635
                            [% END %]
636
                        </ul>
637
                    </div>
638
                    </div>
627
                </td>
639
                </td>
628
        </tr>
640
        </tr>
629
        [% END %]</tbody>
641
        [% END %]</tbody>
Lines 683-688 Link Here
683
                    </div>
695
                    </div>
684
696
685
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
697
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
698
                    <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
686
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_status"/>Submit</button></fieldset>
699
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_status"/>Submit</button></fieldset>
687
                </fieldset>
700
                </fieldset>
688
            </div>
701
            </div>
Lines 691-696 Link Here
691
                    <label for="itemtype">Update item types with: </label>
704
                    <label for="itemtype">Update item types with: </label>
692
                    [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20  %]
705
                    [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20  %]
693
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
706
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
707
                    <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
694
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_itemtype"/>Submit</button></fieldset>
708
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_itemtype"/>Submit</button></fieldset>
695
                </fieldset>
709
                </fieldset>
696
            </div>
710
            </div>
Lines 702-707 Link Here
702
                    <span id="managedby_name[% loop.count | html %]"></span>
716
                    <span id="managedby_name[% loop.count | html %]"></span>
703
                    <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" />
717
                    <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count | html %]" value="[% logged_in_user.borrowernumber | html %]" />
704
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
718
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
719
                    <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
705
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_manager"/>Submit</button></fieldset>
720
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_manager"/>Submit</button></fieldset>
706
                </fieldset>
721
                </fieldset>
707
            </div>
722
            </div>
Lines 710-715 Link Here
710
                <fieldset>
725
                <fieldset>
711
                    <label for="delete_[% loop.count | html %]">Delete selected</label>
726
                    <label for="delete_[% loop.count | html %]">Delete selected</label>
712
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
727
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
728
                    <input type="hidden" name="filter_archived" value="[% filter_archived | html %]" />
713
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="delete"/>Delete</button></fieldset>
729
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="delete"/>Delete</button></fieldset>
714
                </fieldset>
730
                </fieldset>
715
            </div>
731
            </div>
Lines 761-767 Link Here
761
                    [% ELSE %]
777
                    [% ELSE %]
762
                        <option value="acceptedby">Accepted by</option>
778
                        <option value="acceptedby">Accepted by</option>
763
                    [% END %]
779
                    [% END %]
764
                </select> <input type="submit" value="Go" /></li></ol></fieldset>
780
                </select>
781
                <input type="submit" value="Go" />
782
                </li>
783
                </ol>
784
                </fieldset>
785
765
<h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
786
<h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
766
                <div style="display:block;" id="limits">
787
                <div style="display:block;" id="limits">
767
788
Lines 777-783 Link Here
777
                    <ol>
798
                    <ol>
778
                        <li>
799
                        <li>
779
                            <label for="archived" style="display: inline;">Include archived:</label>
800
                            <label for="archived" style="display: inline;">Include archived:</label>
780
                            <input type="checkbox" id="archived" name="filter_archived" value="archived" title="Include archived suggestions in the search" />
801
                            [% IF filter_archived %]
802
                                <input type="checkbox" id="archived" name="filter_archived" checked="checked" title="Include archived suggestions in the search" />
803
                            [% ELSE %]
804
                                <input type="checkbox" id="archived" name="filter_archived" title="Include archived suggestions in the search" />
805
                            [% END %]
781
                      </li>
806
                      </li>
782
                      <li>
807
                      <li>
783
                          <label for="STATUS"> Status:</label>
808
                          <label for="STATUS"> Status:</label>
Lines 852-858 Link Here
852
                        <label for="accepteddate_to">To:</label>
877
                        <label for="accepteddate_to">To:</label>
853
                        <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" />
878
                        <input type="text" id="accepteddate_to" size="10" name="accepteddate_to" value="[% accepteddate_to | html %]" />
854
                    </li>
879
                    </li>
855
                    <li><input type="submit" value="Go" /></li></ol>
880
                    <li>
881
                        <input type="submit" value="Go" />
882
                    </li>
883
                </ol>
856
                </fieldset>
884
                </fieldset>
857
885
858
				<fieldset class="brief"><h4 class="local_collapse"><a href="#">Acquisition information</a></h4>
886
				<fieldset class="brief"><h4 class="local_collapse"><a href="#">Acquisition information</a></h4>
Lines 876-882 Link Here
876
                        [% ELSE %]
904
                        [% ELSE %]
877
                            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
905
                            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
878
                        [% END %]
906
                        [% END %]
879
                    </select></li><li><input type="submit" value="Go" /></li></ol>
907
                    </select></li>
908
                    <li>
909
                        <input type="submit" value="Go" />
910
                    </li>
911
                </ol>
880
                </fieldset>
912
                </fieldset>
881
            </form>
913
            </form>
882
        [% INCLUDE 'acquisitions-menu.inc' %]
914
        [% INCLUDE 'acquisitions-menu.inc' %]
(-)a/suggestion/suggestion.pl (-4 / +15 lines)
Lines 92-97 my $displayby = $input->param('displayby') || ''; Link Here
92
my $tabcode         = $input->param('tabcode');
92
my $tabcode         = $input->param('tabcode');
93
my $save_confirmed  = $input->param('save_confirmed') || 0;
93
my $save_confirmed  = $input->param('save_confirmed') || 0;
94
my $notify          = $input->param('notify');
94
my $notify          = $input->param('notify');
95
my $filter_archived = $input->param('filter_archived');
95
96
96
my $reasonsloop     = GetAuthorisedValues("SUGGEST");
97
my $reasonsloop     = GetAuthorisedValues("SUGGEST");
97
98
Lines 104-110 my $columns = ' '.join(' ', $schema->source('Suggestion')->columns).' '; Link Here
104
my $suggestion_only = { map { $columns =~ / $_ / ? ($_ => $suggestion_ref->{$_}) : () } keys %$suggestion_ref };
105
my $suggestion_only = { map { $columns =~ / $_ / ? ($_ => $suggestion_ref->{$_}) : () } keys %$suggestion_ref };
105
$suggestion_only->{STATUS} = $suggestion_ref->{STATUS};
106
$suggestion_only->{STATUS} = $suggestion_ref->{STATUS};
106
107
107
delete $$suggestion_ref{$_} foreach qw( suggestedbyme op displayby tabcode edit_field notify );
108
delete $$suggestion_ref{$_} foreach qw( suggestedbyme op displayby tabcode notify filter_archived );
108
foreach (keys %$suggestion_ref){
109
foreach (keys %$suggestion_ref){
109
    delete $$suggestion_ref{$_} if (!$$suggestion_ref{$_} && ($op eq 'else' ));
110
    delete $$suggestion_ref{$_} if (!$$suggestion_ref{$_} && ($op eq 'else' ));
110
}
111
}
Lines 288-293 elsif ($op eq "update_status" ) { Link Here
288
    }
289
    }
289
    redirect_with_params($input);
290
    redirect_with_params($input);
290
}
291
}
292
elsif ($op eq "archive" ) {
293
    Koha::Suggestions->find($_)->update({ archived => 1 }) for @editsuggestions;
294
295
    redirect_with_params($input);
296
}
297
elsif ($op eq "unarchive" ) {
298
    Koha::Suggestions->find($_)->update({ archived => 0 }) for @editsuggestions;
299
300
    redirect_with_params($input);
301
}
291
elsif ( $op eq 'update_itemtype' ) {
302
elsif ( $op eq 'update_itemtype' ) {
292
    my $new_itemtype = $input->param('suggestion_itemtype');
303
    my $new_itemtype = $input->param('suggestion_itemtype');
293
    foreach my $suggestionid (@editsuggestions) {
304
    foreach my $suggestionid (@editsuggestions) {
Lines 346-352 if ($op=~/else/) { Link Here
346
        next if ( $definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue ) and ($displayby ne 'branchcode' or $branchfilter ne '__ANY__' );
357
        next if ( $definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue ) and ($displayby ne 'branchcode' or $branchfilter ne '__ANY__' );
347
        $$suggestion_ref{$displayby} = $criteriumvalue;
358
        $$suggestion_ref{$displayby} = $criteriumvalue;
348
359
349
        my $suggestions = &SearchSuggestion($suggestion_ref);
360
        my $suggestions = &SearchSuggestion({ %$suggestion_ref, archived => $filter_archived });
350
        foreach my $suggestion (@$suggestions) {
361
        foreach my $suggestion (@$suggestions) {
351
            if ($suggestion->{budgetid}){
362
            if ($suggestion->{budgetid}){
352
                my $bud = GetBudget( $suggestion->{budgetid} );
363
                my $bud = GetBudget( $suggestion->{budgetid} );
Lines 377-382 $template->param( Link Here
377
388
378
$template->param(
389
$template->param(
379
    %$suggestion_ref,
390
    %$suggestion_ref,
391
    filter_archived => $filter_archived,
380
    "op"             =>$op,
392
    "op"             =>$op,
381
);
393
);
382
394
Lines 455-461 sub redirect_with_params { Link Here
455
        displayby branchcode title author isbn publishercode copyrightdate
467
        displayby branchcode title author isbn publishercode copyrightdate
456
        collectiontitle suggestedby suggesteddate_from suggesteddate_to
468
        collectiontitle suggestedby suggesteddate_from suggesteddate_to
457
        manageddate_from manageddate_to accepteddate_from
469
        manageddate_from manageddate_to accepteddate_from
458
        accepteddate_to budgetid
470
        accepteddate_to budgetid filter_archived
459
        )
471
        )
460
      )
472
      )
461
    {
473
    {
462
- 

Return to bug 22784