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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-4 / +27 lines)
Lines 167-174 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
167
[% IF ( op_save )  %]
167
[% IF ( op_save )  %]
168
    <script type="text/javascript">
168
    <script type="text/javascript">
169
        // <![CDATA[
169
        // <![CDATA[
170
        $(document).ready(function() { calcNewsuggTotal(); });
170
        $(document).ready(function() {
171
        // ]]>
171
          calcNewsuggTotal();
172
          $( "#findborrowersuggestion" ).autocomplete({
173
            source: "/cgi-bin/koha/circ/ysearch.pl",
174
            minLength: 3,
175
            select: function( event, ui ) {
176
                $( "#findborrowersuggestion" ).val( ui.item.surname + ', ' + ui.item.firstname + ' (' + ui.item.cardnumber + ')' );
177
                $( "#suggestedby").val( ui.item.borrowernumber );
178
                return false;
179
            }
180
          })
181
          .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
182
            return $( "<li></li>" )
183
            .data( "ui-autocomplete-item", item )
184
            .append( "<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
185
            .appendTo( ul );
186
          };
187
        });
188
      // ]]>
172
    </script>
189
    </script>
173
[% END %]
190
[% END %]
174
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
191
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
Lines 397-404 h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o Link Here
397
            <tr>
414
            <tr>
398
                <th><label for="suggesteddate">Suggestion creation</label> </th>
415
                <th><label for="suggesteddate">Suggestion creation</label> </th>
399
                <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/></td>
416
                <td><input type="text" id="suggesteddate" name="suggesteddate" size="10" maxlength="10" value="[% suggesteddate | $KohaDates %]"/></td>
400
                <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 %]
417
                <td>
401
                </td>
418
                  <div class="autocomplete">
419
                    <input autocomplete="on" id="findborrowersuggestion" name="findborrowersuggestion" size="40" class="focus" type="text" [% IF ( suggestedby_borrowernumber ) %] value="[% suggestedby_surname %], [% suggestedby_firstname %] [% Branches.GetName( suggestedby_branchcode ) %] ([% suggestedby_description %])" [% END %] />
420
                    <input name="branch" value="[% Branches.GetLoggedInBranchcode() %]" type="hidden" />
421
                    <input name="printer" value="" type="hidden" />
422
                  </div>
423
                  <input type="hidden" id="suggestedby" name="suggestedby" value="[% suggestedby %]"/>
424
              </td>
402
            </tr>
425
            </tr>
403
            <tr>
426
            <tr>
404
                <th><label for="managedon">Suggestion management</label> </th>
427
                <th><label for="managedon">Suggestion management</label> </th>
(-)a/suggestion/suggestion.pl (-1 / +12 lines)
Lines 30-35 use C4::Budgets; Link Here
30
use C4::Search;
30
use C4::Search;
31
use C4::Members;
31
use C4::Members;
32
use C4::Debug;
32
use C4::Debug;
33
use C4::Log;
33
34
34
use Koha::DateUtils qw( dt_from_string );
35
use Koha::DateUtils qw( dt_from_string );
35
36
Lines 128-133 if ( $op =~ /save/i ) { Link Here
128
    }
129
    }
129
    if ( $suggestion_only->{'suggestionid'} > 0 ) {
130
    if ( $suggestion_only->{'suggestionid'} > 0 ) {
130
        &ModSuggestion($suggestion_only);
131
        &ModSuggestion($suggestion_only);
132
        my $member = GetMember(borrowernumber => $$suggestion_only{'suggestedby'});
133
        logaction('ACQUISITIONS', 'MODIFY', undef, 'Suggestion title: ' . $$suggestion_only{'title'} . ", creator: " .
134
                                               $member->{'surname'} . ', ' .
135
                                               $member->{'firstname'} . ' (' .
136
                                               $member->{'cardnumber'} . ')' );
137
131
    } else {
138
    } else {
132
        ###FIXME:Search here if suggestion already exists.
139
        ###FIXME:Search here if suggestion already exists.
133
        my $suggestions_loop =
140
        my $suggestions_loop =
Lines 143-148 if ( $op =~ /save/i ) { Link Here
143
        else {    
150
        else {    
144
            ## Adding some informations related to suggestion
151
            ## Adding some informations related to suggestion
145
            &NewSuggestion($suggestion_only);
152
            &NewSuggestion($suggestion_only);
153
            my $member = GetMember(borrowernumber => $$suggestion_only{'suggestedby'});
154
            logaction('ACQUISITIONS', 'ADD', undef, 'Suggestion title: ' . $$suggestion_only{'title'} . ", creator: " .
155
                                               $member->{'surname'} . ', ' .
156
                                               $member->{'firstname'} . ' (' .
157
                                               $member->{'cardnumber'} . ')' );
146
        }
158
        }
147
        # empty fields, to avoid filter in "SearchSuggestion"
159
        # empty fields, to avoid filter in "SearchSuggestion"
148
    }  
160
    }  
149
- 

Return to bug 14376