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 2996-3001 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
2996
   accepteddate date default NULL, -- date the suggestion was marked as accepted
2996
   accepteddate date default NULL, -- date the suggestion was marked as accepted
2997
   rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table
2997
   rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table
2998
   rejecteddate date default NULL, -- date the suggestion was marked as rejected
2998
   rejecteddate date default NULL, -- date the suggestion was marked as rejected
2999
   lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time
3000
   lastmodificationdate date default NULL, -- date of the last modification
2999
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3001
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3000
  `note` LONGTEXT, -- note entered on the suggestion
3002
  `note` LONGTEXT, -- note entered on the suggestion
3001
  `author` varchar(80) default NULL, -- author of the suggested item
3003
  `author` varchar(80) default NULL, -- author of the suggested item
Lines 3031-3036 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
3031
  CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3033
  CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3032
  CONSTRAINT `suggestions_ibfk_acceptedby` FOREIGN KEY (`acceptedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3034
  CONSTRAINT `suggestions_ibfk_acceptedby` FOREIGN KEY (`acceptedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3033
  CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3035
  CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3036
  CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3034
  CONSTRAINT `suggestions_ibfk_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3037
  CONSTRAINT `suggestions_ibfk_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3035
  CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE,
3038
  CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE,
3036
  CONSTRAINT `suggestions_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE
3039
  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 195-200 Link Here
195
                    [% END %]
195
                    [% END %]
196
                </td>
196
                </td>
197
            </tr>
197
            </tr>
198
            <tr>
199
                <th>Last modification on:</th>
200
                <td>[% lastmodificationdate | $KohaDates %]</td>
201
                <td>
202
                    [% IF ( lastmodificationby_patron.borrowernumber ) %]
203
                        <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>
204
                        [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
205
                    [% END %]
206
                </td>
207
            </tr>
198
            </tbody>
208
            </tbody>
199
        </table></li></ol>
209
        </table></li></ol>
200
    </fieldset>
210
    </fieldset>
Lines 374-379 Link Here
374
                <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
384
                <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
375
                <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>
385
                <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>
376
            </tr>
386
            </tr>
387
            <tr>
388
                <th><label for="lastmodificationdate">Last modification on:</label> </th>
389
                <td>[% lastmodificationdate | $KohaDates %]</td>
390
                <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>
391
            </tr>
377
            </tbody>
392
            </tbody>
378
        </table></li>
393
        </table></li>
379
394
Lines 533-538 Link Here
533
                <th>Suggested on</th>
548
                <th>Suggested on</th>
534
                <th>Managed by</th>
549
                <th>Managed by</th>
535
                <th>Managed on</th>
550
                <th>Managed on</th>
551
                <th>Last modification by</th>
552
                <th>Last modification on</th>
536
                <th>Library</th>
553
                <th>Library</th>
537
                <th>Fund</th>
554
                <th>Fund</th>
538
                <th>Status</th>
555
                <th>Status</th>
Lines 565-570 Link Here
565
                <td data-order="[% suggestions_loo.manageddate | html %]">
582
                <td data-order="[% suggestions_loo.manageddate | html %]">
566
                    [% IF ( suggestions_loo.manageddate ) %][% suggestions_loo.manageddate | $KohaDates %][% END %]
583
                    [% IF ( suggestions_loo.manageddate ) %][% suggestions_loo.manageddate | $KohaDates %][% END %]
567
                </td>
584
                </td>
585
                <td>
586
                    <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>
587
                </td>
588
                <td data-order="[% suggestions_loo.lastmodificationdate | html %]">
589
                    [% IF ( suggestions_loo.lastmodificationdate ) %] - [% suggestions_loo.lastmodificationdate | $KohaDates %][% END %]
590
                </td>
568
                <td>
591
                <td>
569
                    [% Branches.GetName( suggestions_loo.branchcode ) | html %]
592
                    [% Branches.GetName( suggestions_loo.branchcode ) | html %]
570
                </td>
593
                </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