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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-1 / +1 lines)
Lines 326-332 $(document).ready(function() Link Here
326
        <ol>
326
        <ol>
327
          <li>
327
          <li>
328
            <span class="label">Suggested by: </span>
328
            <span class="label">Suggested by: </span>
329
            [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]">suggestion #[% suggestionid %]</a>)
329
            [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&amp;op=show">suggestion #[% suggestionid %]</a>)
330
          </li>
330
          </li>
331
        </ol>
331
        </ol>
332
        </fieldset>
332
        </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-1 / +1 lines)
Lines 42-48 Link Here
42
        <ol>
42
        <ol>
43
          <li>
43
          <li>
44
            <span class="label">Suggested by: </span>
44
            <span class="label">Suggested by: </span>
45
            [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]">suggestion #[% suggestionid %]</a>)
45
            [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&amp;op=show">suggestion #[% suggestionid %]</a>)
46
          </li>
46
          </li>
47
        </ol>
47
        </ol>
48
        </fieldset>
48
        </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-2 / +2 lines)
Lines 244-250 Link Here
244
                [% IF ( loop_order.suggestionid ) %]
244
                [% IF ( loop_order.suggestionid ) %]
245
                    <br/>
245
                    <br/>
246
                    Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %]
246
                    Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %]
247
                    (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid %]">suggestion #[% loop_order.suggestionid %]</a>)
247
                    (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid %]&amp;op=show">suggestion #[% loop_order.suggestionid %]</a>)
248
                [% END %]
248
                [% END %]
249
                </td>
249
                </td>
250
                <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
250
                <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
Lines 369-375 Link Here
369
                [% IF ( loop_receive.suggestionid ) %]
369
                [% IF ( loop_receive.suggestionid ) %]
370
                    <br/>
370
                    <br/>
371
                    Suggested by: [% loop_receive.surnamesuggestedby %][% IF ( loop_receive.firstnamesuggestedby ) %], [% loop_receive.firstnamesuggestedby %] [% END %]
371
                    Suggested by: [% loop_receive.surnamesuggestedby %][% IF ( loop_receive.firstnamesuggestedby ) %], [% loop_receive.firstnamesuggestedby %] [% END %]
372
                    (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_receive.suggestionid %]">suggestion #[% loop_receive.suggestionid %]</a>)
372
                    (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_receive.suggestionid %]&amp;op=show">suggestion #[% loop_receive.suggestionid %]</a>)
373
                [% END %]
373
                [% END %]
374
                </td>
374
                </td>
375
                <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
375
                <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_receive.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-9 / +133 lines)
Lines 1-5 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]<title>Koha &rsaquo; Acquisitions  &rsaquo;
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( op_save ) %][% IF ( suttesionid ) %]Edit purchase suggestion #[% suggestionid %][% ELSE %]Enter a new purchase suggestion[% END %][% ELSE %]Suggestions Management[% END %]</title>
2
<title>Koha &rsaquo; Acquisitions  &rsaquo;
3
    [% IF ( op_save ) %]
4
        [% IF ( suggestionid) %]
5
            [% IF ( op == 'show' ) %]
6
                Show purchase suggestion #[% suggestionid %]
7
            [% ELSE %]
8
                Edit purchase suggestion #[% suggestionid %]
9
            [% END %]
10
        [% ELSE %]
11
            Enter a new purchase suggestion
12
        [% END %]
13
    [% ELSE %]
14
        Suggestions Management
15
    [% END %]
16
</title>
3
[% INCLUDE 'doc-head-close.inc' %]
17
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'calendar.inc' %]
18
[% INCLUDE 'calendar.inc' %]
5
[% IF ( op_else ) %] <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
19
[% IF ( op_else ) %] <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
Lines 91-97 $(document).ready(function() { calcNewsuggTotal(); }); Link Here
91
<body>
105
<body>
92
[% INCLUDE 'header.inc' %]
106
[% INCLUDE 'header.inc' %]
93
[% INCLUDE 'cat-search.inc' %]
107
[% INCLUDE 'cat-search.inc' %]
94
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; [% IF ( op_save ) %] <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo; [% IF ( suggestionid ) %]Suggestion edit #[% suggestionid %][% ELSE %]New purchase suggestion[% END %][% ELSE %]Suggestions Management[% END %] </div>
108
<div id="breadcrumbs">
109
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;
110
    [% IF ( op_save ) %]
111
        <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a> &rsaquo;
112
        [% IF ( op == 'show' ) %]
113
            Show suggestion #[% suggestionid %]
114
        [% ELSE %]
115
            Suggestion edit #[% suggestionid %]
116
        [% END %]
117
    [% ELSE %]
118
        Suggestions Management
119
    [% END %]
120
</div>
121
122
[% IF ( op == 'show' ) %]
123
<div id="doc" class="yui-t7"> <!-- <div id="doc3" class="yui-t2"> -->
124
<div id="bd">
125
    <div id="yui-main">
126
    <div class="yui-b">
127
128
    <fieldset class="rows">
129
      <legend>Bibliographic information</legend>
130
      <ol>
131
        <li><span class="label">Title:</span>[% title |html %]</li>
132
        <li><span class="label">Author:</span>[% author %]</li>
133
        <li><span class="label">Copyright date:</span>[% copyrightdate %]</li>
134
        <li><span class="label">ISBN or ISSN or other standard number:</span>[% isbn %]</li>
135
        <li><span class="label">Publisher:</span>[% publishercode %]</li>
136
        <li><span class="label">Publication Place:</span>[% place %]</li>
137
        <li><span class="label">Collection Title:</span>[% collectiontitle %]</li>
138
        <li><span class="label">Document Type:</span>
139
            [% FOREACH itemtypeloo IN itemtypeloop %]
140
                [% IF ( itemtypeloo.selected ) %][% itemtypeloo.description %][% END %]
141
            [% END %]
142
        </li>
143
        [% IF ( patron_reason_loop ) %]
144
          <li><span class="label">Reason for suggestion: </span>
145
            [% FOREACH patron_reason_loo IN patron_reason_loop %]
146
              [% IF ( patron_reason_loo.selected ) %][% patron_reason_loo.lib %][% END %]
147
            [% END %]
148
          </li>
149
        [% END %]
150
        <li><span class="label">Notes:</span>[% note %]</li>
151
      </ol>
152
    </fieldset>
153
    <fieldset class="rows"> <legend>Suggestion management</legend>
154
      <ol>
155
        <li>
156
          <span class="label">Status:</span>
157
          [% IF ( STATUS == 'ASKED' ) %]Pending
158
          [% ELSIF ( STATUS == 'ACCEPTED' ) %]Accepted
159
          [% ELSIF ( STATUS == 'CHECKED' ) %]Checked
160
          [% ELSIF ( STATUS == 'REJECTED' ) %]Rejected
161
          [% ELSE %]No Status
162
          [% END %]
163
        </li>
164
        <li>
165
          <table>
166
            <thead><tr><th>&nbsp;</th><th>Date</th><th>By</th></tr></thead>
167
            <tbody>
168
            <tr>
169
                <th><span class="label">Suggestion creation</span> </th>
170
                <td>[% suggesteddate %]</td>
171
                <td>[% IF ( suggestedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestedby_borrowernumber %]">[% suggestedby_surname %], [% suggestedby_firstname %]</a>  [% suggestedby_branchcode %] ([% suggestedby_description %])[% END %]
172
                </td>
173
            </tr>
174
            <tr>
175
                <th><span class="label">Suggestion management</span> </th>
176
                <td>[% manageddate %]</td>
177
                <td>[% IF ( managedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% managedby_borrowernumber %]">[% managedby_surname %], [% managedby_firstname %]</a> [% managedby_branchcode %] ([% managedby_description %])[% END %]</td>
178
            </tr>
179
            <tr>
180
                <th><span class="label">Suggestion Accepted</span> </th>
181
                <td>[% accepteddate %]</td>
182
                <td>[% IF ( acceptedby_borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_borrowernumber %]">[% acceptedby_surname %], [% acceptedby_firstname %]</a> [% acceptedby_branchcode %] ([% acceptedby_description %])[% END %]</td>
183
            </tr>
184
            </tbody>
185
        </table></li></ol>
186
    </fieldset>
187
    <fieldset class="rows"> <legend>Acquisition information</legend>
188
      <ol>
189
        <li>
190
          <span class="label">Library:</span> [% branchname %]
191
        </li>
192
        <li>
193
          <span class="label">Budget:</span> [% budgetname %]
194
        </li>
195
        <li>
196
          <span class="label">Copies:</span>[% quantity %]
197
        </li>
198
        <li>
199
          <span class="label">Currency:</span>[% currency %]
200
        </li>
201
        <li>
202
          <span class="label">Price:</span>[% price %]
203
        </li>
204
        <li>
205
          <span class="label">Total</span>[% total %]
206
        </li>
207
      </ol>
208
    </fieldset>
209
210
    <a class="cancel" href="suggestion.pl">&lt;&lt;Back to the list</a>
211
212
    </div>
213
    </div>
214
</div>
215
[% ELSE %]
95
216
96
[% IF ( op_save ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
217
[% IF ( op_save ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
97
<div id="bd">
218
<div id="bd">
Lines 189-195 $(document).ready(function() { calcNewsuggTotal(); }); Link Here
189
			<input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total %]"/>
310
			<input type="text" readonly="readonly" id="total" name="total" size="10" value="[% total %]"/>
190
                </li></ol>
311
                </li></ol>
191
    </fieldset><input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby %][% ELSE %]noone[% END %]"/>
312
    </fieldset><input type="hidden" id="returnsuggested" name="returnsuggested" value="[% IF ( returnsuggestedby ) %][% returnsuggestedby %][% ELSE %]noone[% END %]"/>
192
    <fieldset class="action"><input type="hidden" name="op" value="[% op %]" />[% IF ( suggestionid ) %]<input type="submit" value="Save" /> <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby %]#suggestions[% ELSE %]suggestion.pl?suggestionid=[% suggestionid %][% END %]">Cancel</a>[% ELSE %]<input type="submit" value="Submit Your Suggestion" /> <a class="cancel" href="suggestion.pl">Cancel</a>[% END %]
313
    <fieldset class="action"><input type="hidden" name="op" value="[% op %]" />[% IF ( suggestionid ) %]<input type="submit" value="Save" /> <a class="cancel" href="[% IF ( returnsuggestedby ) %]/cgi-bin/koha/members/moremember.pl?borrowernumber=[% returnsuggestedby %]#suggestions[% ELSE %]suggestion.pl?suggestionid=[% suggestionid %]&amp;op=show[% END %]">Cancel</a>[% ELSE %]<input type="submit" value="Submit Your Suggestion" /> <a class="cancel" href="suggestion.pl">Cancel</a>[% END %]
193
    </fieldset>
314
    </fieldset>
194
    </form>
315
    </form>
195
[% END %]
316
[% END %]
Lines 245-253 $(document).ready(function() { calcNewsuggTotal(); }); Link Here
245
                    <input type="checkbox" name="edit_field" value="[% suggestions_loo.suggestionid %]" />
366
                    <input type="checkbox" name="edit_field" value="[% suggestions_loo.suggestionid %]" />
246
                </td>
367
                </td>
247
                <td>
368
                <td>
248
                    <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=edit" title="suggestion" >
369
                    <a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=show" title="suggestion" >
249
                        [% suggestions_loo.title |html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author %][% END %]
370
                        [% suggestions_loo.title |html %][% IF ( suggestions_loo.author ) %], by [% suggestions_loo.author %][% END %]</a>
250
                    </a>
371
                    [<a href="suggestion.pl?suggestionid=[% suggestions_loo.suggestionid %]&amp;op=edit" title="suggestion" >edit</a>]
251
                    <br />
372
                    <br />
252
                    [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate %] [% END %]
373
                    [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate %] [% END %]
253
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc %]</i> [% END %]
374
                        [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc %]</i> [% END %]
Lines 314-320 $(document).ready(function() { calcNewsuggTotal(); }); Link Here
314
</div>
435
</div>
315
</div>
436
</div>
316
437
317
      [% UNLESS ( op_save ) %] <div class="yui-b">
438
      [% UNLESS ( op_save ) %] [% UNLESS ( op == 'show' ) %]<div class="yui-b">
318
<form name="suggestionfilter" action="suggestion.pl" method="get">
439
<form name="suggestionfilter" action="suggestion.pl" method="get">
319
<fieldset class="brief"><ol style="display:block;"><li><label for="displayby">Organize by: </label>
440
<fieldset class="brief"><ol style="display:block;"><li><label for="displayby">Organize by: </label>
320
                <select name="displayby" id="displayby" style="width:auto;">
441
                <select name="displayby" id="displayby" style="width:auto;">
Lines 458-464 $(document).ready(function() { calcNewsuggTotal(); }); Link Here
458
                </fieldset>
579
                </fieldset>
459
    </div>
580
    </div>
460
            </form>
581
            </form>
461
        </div>[% END %]
582
        </div>
583
    [% END %]
584
    [% END %]
462
</div>
585
</div>
586
[% END %]
463
[% INCLUDE 'intranet-bottom.inc' %]
587
[% INCLUDE 'intranet-bottom.inc' %]
464
588
(-)a/suggestion/suggestion.pl (-6 / +12 lines)
Lines 34-46 use C4::Debug; Link Here
34
34
35
sub Init{
35
sub Init{
36
    my $suggestion= shift @_;
36
    my $suggestion= shift @_;
37
    foreach my $date qw(suggesteddate manageddate){
37
    foreach my $date ( qw(suggesteddate manageddate) ){
38
        $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")?
38
        $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")?
39
                                $suggestion->{$date}=C4::Dates->today:
39
                                $suggestion->{$date}=C4::Dates->today:
40
                                format_date($suggestion->{$date}) 
40
                                format_date($suggestion->{$date}) 
41
                              );
41
                              );
42
    }               
42
    }               
43
    foreach my $date qw(rejecteddate accepteddate){
43
    foreach my $date ( qw(rejecteddate accepteddate) ){
44
    $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")?
44
    $suggestion->{$date}=(($suggestion->{$date} eq "0000-00-00" ||$suggestion->{$date} eq "")?
45
                                "":
45
                                "":
46
                                format_date($suggestion->{$date}) 
46
                                format_date($suggestion->{$date}) 
Lines 173-178 elsif ($op eq "change" ) { Link Here
173
    }
173
    }
174
    $op = 'else';
174
    $op = 'else';
175
}
175
}
176
elsif ( $op eq 'show' ) {
177
    $suggestion_ref=&GetSuggestion($$suggestion_ref{'suggestionid'});
178
    $$suggestion_ref{branchname} = GetBranchName $$suggestion_ref{branchcode};
179
    my $budget = GetBudget $$suggestion_ref{budgetid};
180
    $$suggestion_ref{budgetname} = $$budget{budget_name};
181
    Init($suggestion_ref);
182
}
176
if ($op=~/else/) {
183
if ($op=~/else/) {
177
    $op='else';
184
    $op='else';
178
    
185
    
Lines 193-199 if ($op=~/else/) { Link Here
193
                my $budget = GetBudget($suggestion->{budgetid});
200
                my $budget = GetBudget($suggestion->{budgetid});
194
                $suggestion->{budget_name}=$budget->{budget_name} if $budget;
201
                $suggestion->{budget_name}=$budget->{budget_name} if $budget;
195
            }
202
            }
196
            foreach my $date qw(suggesteddate manageddate accepteddate){
203
            foreach my $date ( qw(suggesteddate manageddate accepteddate) ){
197
                if ($suggestion->{$date} ne "0000-00-00" && $suggestion->{$date} ne "" ){
204
                if ($suggestion->{$date} ne "0000-00-00" && $suggestion->{$date} ne "" ){
198
                $suggestion->{$date}=format_date($suggestion->{$date}) ;
205
                $suggestion->{$date}=format_date($suggestion->{$date}) ;
199
                } else {
206
                } else {
Lines 219-225 if ($op=~/else/) { Link Here
219
    );
226
    );
220
}
227
}
221
228
222
foreach my $element qw(managedby suggestedby acceptedby) {
229
foreach my $element ( qw(managedby suggestedby acceptedby) ) {
223
#    $debug || warn $$suggestion_ref{$element};
230
#    $debug || warn $$suggestion_ref{$element};
224
    if ($$suggestion_ref{$element}){
231
    if ($$suggestion_ref{$element}){
225
        my $member=GetMember(borrowernumber=>$$suggestion_ref{$element});
232
        my $member=GetMember(borrowernumber=>$$suggestion_ref{$element});
Lines 333-339 $template->param( Link Here
333
);
340
);
334
341
335
my %hashlists;
342
my %hashlists;
336
foreach my $field qw(managedby acceptedby suggestedby budgetid) {
343
foreach my $field ( qw(managedby acceptedby suggestedby budgetid) ) {
337
    my $values_list;
344
    my $values_list;
338
    $values_list=GetDistinctValues("suggestions.".$field) ;
345
    $values_list=GetDistinctValues("suggestions.".$field) ;
339
    my @codes_list = map{
346
    my @codes_list = map{
340
- 

Return to bug 7577