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

(-)a/C4/Suggestions.pm (+3 lines)
Lines 111-116 sub SearchSuggestion { Link Here
111
            U2.email            AS emailmanagedby,
111
            U2.email            AS emailmanagedby,
112
            U2.branchcode       AS branchcodemanagedby,
112
            U2.branchcode       AS branchcodemanagedby,
113
            U2.borrowernumber   AS borrnummanagedby,
113
            U2.borrowernumber   AS borrnummanagedby,
114
            U3.surname          AS surnamelastmodificationby,
115
            U3.firstname        AS firstnamelastmodificationby,
114
            BU.budget_name      AS budget_name
116
            BU.budget_name      AS budget_name
115
        FROM suggestions
117
        FROM suggestions
116
            LEFT JOIN borrowers     AS U1 ON suggestedby=U1.borrowernumber
118
            LEFT JOIN borrowers     AS U1 ON suggestedby=U1.borrowernumber
Lines 119-124 sub SearchSuggestion { Link Here
119
            LEFT JOIN borrowers     AS U2 ON managedby=U2.borrowernumber
121
            LEFT JOIN borrowers     AS U2 ON managedby=U2.borrowernumber
120
            LEFT JOIN branches      AS B2 ON B2.branchcode=U2.branchcode
122
            LEFT JOIN branches      AS B2 ON B2.branchcode=U2.branchcode
121
            LEFT JOIN categories    AS C2 ON C2.categorycode=U2.categorycode
123
            LEFT JOIN categories    AS C2 ON C2.categorycode=U2.categorycode
124
            LEFT JOIN borrowers     AS U3 ON lastmodificationby=U3.borrowernumber
122
            LEFT JOIN aqbudgets     AS BU ON budgetid=BU.budget_id
125
            LEFT JOIN aqbudgets     AS BU ON budgetid=BU.budget_id
123
        WHERE 1=1
126
        WHERE 1=1
124
    }
127
    }
(-)a/installer/data/mysql/kohastructure.sql (+3 lines)
Lines 3032-3037 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
3032
   accepteddate date default NULL, -- date the suggestion was marked as accepted
3032
   accepteddate date default NULL, -- date the suggestion was marked as accepted
3033
   rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table
3033
   rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table
3034
   rejecteddate date default NULL, -- date the suggestion was marked as rejected
3034
   rejecteddate date default NULL, -- date the suggestion was marked as rejected
3035
   lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time
3036
   lastmodificationdate date default NULL, -- date of the last modification
3035
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3037
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3036
  `note` LONGTEXT, -- note entered on the suggestion
3038
  `note` LONGTEXT, -- note entered on the suggestion
3037
  `author` varchar(80) default NULL, -- author of the suggested item
3039
  `author` varchar(80) default NULL, -- author of the suggested item
Lines 3067-3072 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
3067
  CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3069
  CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3068
  CONSTRAINT `suggestions_ibfk_acceptedby` FOREIGN KEY (`acceptedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3070
  CONSTRAINT `suggestions_ibfk_acceptedby` FOREIGN KEY (`acceptedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3069
  CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3071
  CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3072
  CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3070
  CONSTRAINT `suggestions_ibfk_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3073
  CONSTRAINT `suggestions_ibfk_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3071
  CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE,
3074
  CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE,
3072
  CONSTRAINT `suggestions_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE
3075
  CONSTRAINT `suggestions_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (+23 lines)
Lines 190-195 Link Here
190
                    [% END %]
190
                    [% END %]
191
                </td>
191
                </td>
192
            </tr>
192
            </tr>
193
            <tr>
194
                <th>Last modification on:</th>
195
                <td>[% lastmodificationdate | $KohaDates %]</td>
196
                <td>
197
                    [% IF ( lastmodificationby_patron.borrowernumber ) %]
198
                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% lastmodificationby_patron.borrowernumber | uri %]">[% lastmodificationby_patron.surname | html %], [% lastmodificationby_patron.firstname | html %] ([% lastmodificationby_patron.cardnumber | html %])</a>
199
                        [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
200
                    [% END %]
201
                </td>
202
            </tr>
193
            </tbody>
203
            </tbody>
194
        </table></li></ol>
204
        </table></li></ol>
195
    </fieldset>
205
    </fieldset>
Lines 369-374 Link Here
369
                <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
379
                <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
370
                <td><input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>[% IF ( acceptedby_patron.borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_patron.borrowernumber | uri %]">[% acceptedby_patron.surname | html %], [% acceptedby_patron.firstname | html %] ([% suggestedby_patron.cardnumber | html %])</a> [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])[% END %]</td>
380
                <td><input type="hidden" id="acceptedby" name="acceptedby" value="[% acceptedby | html %]"/>[% IF ( acceptedby_patron.borrowernumber ) %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% acceptedby_patron.borrowernumber | uri %]">[% acceptedby_patron.surname | html %], [% acceptedby_patron.firstname | html %] ([% suggestedby_patron.cardnumber | html %])</a> [% Branches.GetName( acceptedby_patron.branchcode ) | html %] ([% acceptedby_patron.category.description | html %])[% END %]</td>
371
            </tr>
381
            </tr>
382
            <tr>
383
                <th><label for="lastmodificationdate">Last modification on:</label> </th>
384
                <td>[% lastmodificationdate | $KohaDates %]</td>
385
                <td>[% INCLUDE 'patron-title.inc' patron=lastmodificationby_patron hide_patron_infos_if_needed=1 %] [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])</td>
386
            </tr>
372
            </tbody>
387
            </tbody>
373
        </table></li>
388
        </table></li>
374
389
Lines 528-533 Link Here
528
                <th>Suggested on</th>
543
                <th>Suggested on</th>
529
                <th>Managed by</th>
544
                <th>Managed by</th>
530
                <th>Managed on</th>
545
                <th>Managed on</th>
546
                <th>Last modification by</th>
547
                <th>Last modification on</th>
531
                <th>Library</th>
548
                <th>Library</th>
532
                <th>Fund</th>
549
                <th>Fund</th>
533
                <th>Status</th>
550
                <th>Status</th>
Lines 561-566 Link Here
561
                    [% IF ( suggestions_loo.manageddate ) %][% suggestions_loo.manageddate | $KohaDates %][% END %]
578
                    [% IF ( suggestions_loo.manageddate ) %][% suggestions_loo.manageddate | $KohaDates %][% END %]
562
                </td>
579
                </td>
563
                <td>
580
                <td>
581
                    <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestions_loo.lastmodificationby | uri %]">[% suggestions_loo.surnamelastmodificationby | html %][% IF ( suggestions_loo.firstnamelastmodificationby ) %], [% suggestions_loo.firstnamelastmodificationby | html %][% END %]</a>
582
                </td>
583
                <td data-order="[% suggestions_loo.lastmodificationdate | html %]">
584
                    [% IF ( suggestions_loo.lastmodificationdate ) %] - [% suggestions_loo.lastmodificationdate | $KohaDates %][% END %]
585
                </td>
586
                <td>
564
                    [% Branches.GetName( suggestions_loo.branchcode ) | html %]
587
                    [% Branches.GetName( suggestions_loo.branchcode ) | html %]
565
                </td>
588
                </td>
566
                <td>
589
                <td>
(-)a/suggestion/suggestion.pl (-2 / +4 lines)
Lines 165-170 if ( $op =~ /save/i ) { Link Here
165
165
166
        if ( $suggestion_only->{'suggestionid'} > 0 ) {
166
        if ( $suggestion_only->{'suggestionid'} > 0 ) {
167
167
168
            $suggestion_only->{lastmodificationdate} = dt_from_string;
169
            $suggestion_only->{lastmodificationby}   = C4::Context->userenv->{number};
170
168
            &ModSuggestion($suggestion_only);
171
            &ModSuggestion($suggestion_only);
169
172
170
            if ( $notify ) {
173
            if ( $notify ) {
Lines 371-377 if ($op=~/else/) { Link Here
371
374
372
$template->param(
375
$template->param(
373
    "${_}_patron" => scalar Koha::Patrons->find( $suggestion_ref->{$_} ) )
376
    "${_}_patron" => scalar Koha::Patrons->find( $suggestion_ref->{$_} ) )
374
  for qw(managedby suggestedby acceptedby);
377
  for qw(managedby suggestedby acceptedby lastmodificationby);
375
378
376
$template->param(
379
$template->param(
377
    %$suggestion_ref,
380
    %$suggestion_ref,
378
- 

Return to bug 23590