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

(-)a/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl (-2 / +2 lines)
Lines 3-9 if( CheckVersion( $DBversion ) ) { Link Here
3
3
4
    if( !TableExists( 'problem_reports' ) ){
4
    if( !TableExists( 'problem_reports' ) ){
5
        $dbh->do(q{ CREATE TABLE problem_reports (
5
        $dbh->do(q{ CREATE TABLE problem_reports (
6
            reportid int(11) NOT NULL auto_increment, -- unqiue identifier assigned by Koha
6
            reportid int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
7
            title varchar(40) NOT NULL default '', -- report subject line
7
            title varchar(40) NOT NULL default '', -- report subject line
8
            content varchar(255) NOT NULL default '', -- report message content
8
            content varchar(255) NOT NULL default '', -- report message content
9
            borrowernumber int(11) default NULL, -- the user who created the problem report
9
            borrowernumber int(11) default NULL, -- the user who created the problem report
Lines 11-17 if( CheckVersion( $DBversion ) ) { Link Here
11
            username varchar(75) default NULL, -- OPAC username
11
            username varchar(75) default NULL, -- OPAC username
12
            problempage varchar(255) default NULL, -- page the user triggered the problem report form from
12
            problempage varchar(255) default NULL, -- page the user triggered the problem report form from
13
            recipient enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report
13
            recipient enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report
14
            reportdate datetime default NULL, -- date and time of report submission
14
            created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- timestamp of report submission
15
            status varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed
15
            status varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed
16
            PRIMARY KEY (reportid),
16
            PRIMARY KEY (reportid),
17
            CONSTRAINT problem_reports_ibfk1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
17
            CONSTRAINT problem_reports_ibfk1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 4425-4431 CREATE TABLE return_claims ( Link Here
4425
4425
4426
DROP TABLE IF EXISTS `problem_reports`;
4426
DROP TABLE IF EXISTS `problem_reports`;
4427
CREATE TABLE `problem_reports` (
4427
CREATE TABLE `problem_reports` (
4428
    `reportid` int(11) NOT NULL auto_increment, -- unqiue identifier assigned by Koha
4428
    `reportid` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
4429
    `title` varchar(40) NOT NULL default '', -- report subject line
4429
    `title` varchar(40) NOT NULL default '', -- report subject line
4430
    `content` varchar(255) NOT NULL default '', -- report message content
4430
    `content` varchar(255) NOT NULL default '', -- report message content
4431
    `borrowernumber` int(11) default NULL, -- the user who created the problem report
4431
    `borrowernumber` int(11) default NULL, -- the user who created the problem report
Lines 4433-4439 CREATE TABLE `problem_reports` ( Link Here
4433
    `username` varchar(75) default NULL, -- OPAC username
4433
    `username` varchar(75) default NULL, -- OPAC username
4434
    `problempage` varchar(255) default NULL, -- page the user triggered the problem report form from
4434
    `problempage` varchar(255) default NULL, -- page the user triggered the problem report form from
4435
    `recipient` enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report
4435
    `recipient` enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report
4436
    `reportdate` datetime default NULL, -- date and time of report submission
4436
    `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- timestamp of report submission
4437
    `status` varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed
4437
    `status` varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed
4438
    PRIMARY KEY (`reportid`),
4438
    PRIMARY KEY (`reportid`),
4439
    CONSTRAINT `problem_reports_ibfk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4439
    CONSTRAINT `problem_reports_ibfk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
(-)a/opac/opac-reportproblem.pl (-2 / +11 lines)
Lines 82-88 if ( $op eq 'addreport' ) { Link Here
82
    my $message = $input->param('message');
82
    my $message = $input->param('message');
83
    my $place = $input->param('place');
83
    my $place = $input->param('place');
84
    my $recipient = $input->param('recipient') || 'library';
84
    my $recipient = $input->param('recipient') || 'library';
85
    my $problem = Koha::ProblemReport->new({ title => $subject, content => $message, borrowernumber => $borrowernumber, branchcode => $branchcode, username => $username, problempage => $place, recipient => $recipient, reportdate => dt_from_string() })->store;
85
    my $problem = Koha::ProblemReport->new(
86
        {
87
            title          => $subject,
88
            content        => $message,
89
            borrowernumber => $borrowernumber,
90
            branchcode     => $branchcode,
91
            username       => $username,
92
            problempage    => $place,
93
            recipient      => $recipient,
94
        }
95
    )->store;
86
    $template->param(
96
    $template->param(
87
        recipient => $recipient,
97
        recipient => $recipient,
88
        successfuladd => 1,
98
        successfuladd => 1,
89
- 

Return to bug 4461