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

(-)a/C4/Suggestions.pm (+3 lines)
Lines 113-118 sub SearchSuggestion { Link Here
113
            U2.email            AS emailmanagedby,
113
            U2.email            AS emailmanagedby,
114
            U2.branchcode       AS branchcodemanagedby,
114
            U2.branchcode       AS branchcodemanagedby,
115
            U2.borrowernumber   AS borrnummanagedby,
115
            U2.borrowernumber   AS borrnummanagedby,
116
            U3.surname          AS surnamelastmodificationby,
117
            U3.firstname        AS firstnamelastmodificationby,
116
            BU.budget_name      AS budget_name
118
            BU.budget_name      AS budget_name
117
        FROM suggestions
119
        FROM suggestions
118
            LEFT JOIN borrowers     AS U1 ON suggestedby=U1.borrowernumber
120
            LEFT JOIN borrowers     AS U1 ON suggestedby=U1.borrowernumber
Lines 121-126 sub SearchSuggestion { Link Here
121
            LEFT JOIN borrowers     AS U2 ON managedby=U2.borrowernumber
123
            LEFT JOIN borrowers     AS U2 ON managedby=U2.borrowernumber
122
            LEFT JOIN branches      AS B2 ON B2.branchcode=U2.branchcode
124
            LEFT JOIN branches      AS B2 ON B2.branchcode=U2.branchcode
123
            LEFT JOIN categories    AS C2 ON C2.categorycode=U2.categorycode
125
            LEFT JOIN categories    AS C2 ON C2.categorycode=U2.categorycode
126
            LEFT JOIN borrowers     AS U3 ON lastmodificationby=U3.borrowernumber
124
            LEFT JOIN aqbudgets     AS BU ON budgetid=BU.budget_id
127
            LEFT JOIN aqbudgets     AS BU ON budgetid=BU.budget_id
125
        WHERE 1=1
128
        WHERE 1=1
126
    }
129
    }
(-)a/installer/data/mysql/kohastructure.sql (+3 lines)
Lines 3026-3031 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
3026
   accepteddate date default NULL, -- date the suggestion was marked as accepted
3026
   accepteddate date default NULL, -- date the suggestion was marked as accepted
3027
   rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table
3027
   rejectedby INT(11) default NULL, -- borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table
3028
   rejecteddate date default NULL, -- date the suggestion was marked as rejected
3028
   rejecteddate date default NULL, -- date the suggestion was marked as rejected
3029
   lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time
3030
   lastmodificationdate date default NULL, -- date of the last modification
3029
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3031
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3030
  `note` LONGTEXT, -- note entered on the suggestion
3032
  `note` LONGTEXT, -- note entered on the suggestion
3031
  `author` varchar(80) default NULL, -- author of the suggested item
3033
  `author` varchar(80) default NULL, -- author of the suggested item
Lines 3061-3066 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
3061
  CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3063
  CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3062
  CONSTRAINT `suggestions_ibfk_acceptedby` FOREIGN KEY (`acceptedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3064
  CONSTRAINT `suggestions_ibfk_acceptedby` FOREIGN KEY (`acceptedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3063
  CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3065
  CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3066
  CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3064
  CONSTRAINT `suggestions_ibfk_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3067
  CONSTRAINT `suggestions_ibfk_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3065
  CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE,
3068
  CONSTRAINT `suggestions_budget_id_fk` FOREIGN KEY (`budgetid`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE SET NULL ON UPDATE CASCADE,
3066
  CONSTRAINT `suggestions_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE
3069
  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 (+20 lines)
Lines 189-194 Link Here
189
                    [% END %]
189
                    [% END %]
190
                </td>
190
                </td>
191
            </tr>
191
            </tr>
192
            <tr>
193
                <th>Last modification on:</th>
194
                <td>[% lastmodificationdate | $KohaDates %]</td>
195
                <td>
196
                    [% IF ( lastmodificationby_patron.borrowernumber ) %]
197
                        <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>
198
                        [% Branches.GetName( lastmodificationby_patron.branchcode ) | html %] ([% lastmodificationby_patron.category.description | html %])
199
                    [% END %]
200
                </td>
201
            </tr>
192
            </tbody>
202
            </tbody>
193
        </table></li></ol>
203
        </table></li></ol>
194
    </fieldset>
204
    </fieldset>
Lines 368-373 Link Here
368
                <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
378
                <td><input type="text" id="accepteddate" name="accepteddate" class="datepicker" size="10" maxlength="10" value="[% accepteddate | $KohaDates %]" />[% INCLUDE 'date-format.inc' %]</td>
369
                <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>
379
                <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>
370
            </tr>
380
            </tr>
381
            <tr>
382
                <th><label for="lastmodificationdate">Last modification on:</label> </th>
383
                <td>[% lastmodificationdate | $KohaDates %]</td>
384
                <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>
385
            </tr>
371
            </tbody>
386
            </tbody>
372
        </table></li>
387
        </table></li>
373
388
Lines 525-530 Link Here
525
                <th class="anti-the">Suggestion</th>
540
                <th class="anti-the">Suggestion</th>
526
                <th>Suggested by - on</th>
541
                <th>Suggested by - on</th>
527
                <th>Managed by - on</th>
542
                <th>Managed by - on</th>
543
                <th>Last modification by - on</th>
528
                <th>Library</th>
544
                <th>Library</th>
529
                <th>Fund</th>
545
                <th>Fund</th>
530
                <th>Status</th>
546
                <th>Status</th>
Lines 554-559 Link Here
554
                    [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate | $KohaDates %][% END %]
570
                    [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate | $KohaDates %][% END %]
555
                </td>
571
                </td>
556
                <td>
572
                <td>
573
                    <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>
574
                    [% IF ( suggestions_loo.lastmodificationdate ) %] - [% suggestions_loo.lastmodificationdate | $KohaDates %][% END %]
575
                </td>
576
                <td>
557
                    [% Branches.GetName( suggestions_loo.branchcode ) | html %]
577
                    [% Branches.GetName( suggestions_loo.branchcode ) | html %]
558
                </td>
578
                </td>
559
                <td>
579
                <td>
(-)a/suggestion/suggestion.pl (-2 / +4 lines)
Lines 166-171 if ( $op =~ /save/i ) { Link Here
166
166
167
        if ( $suggestion_only->{'suggestionid'} > 0 ) {
167
        if ( $suggestion_only->{'suggestionid'} > 0 ) {
168
168
169
            $suggestion_only->{lastmodificationdate} = dt_from_string;
170
            $suggestion_only->{lastmodificationby}   = C4::Context->userenv->{number};
171
169
            &ModSuggestion($suggestion_only);
172
            &ModSuggestion($suggestion_only);
170
173
171
            if ( $notify ) {
174
            if ( $notify ) {
Lines 372-378 if ($op=~/else/) { Link Here
372
375
373
$template->param(
376
$template->param(
374
    "${_}_patron" => scalar Koha::Patrons->find( $suggestion_ref->{$_} ) )
377
    "${_}_patron" => scalar Koha::Patrons->find( $suggestion_ref->{$_} ) )
375
  for qw(managedby suggestedby acceptedby);
378
  for qw(managedby suggestedby acceptedby lastmodificationby);
376
379
377
$template->param(
380
$template->param(
378
    %$suggestion_ref,
381
    %$suggestion_ref,
379
- 

Return to bug 23590