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 4442-4448 CREATE TABLE return_claims ( Link Here
4442
4442
4443
DROP TABLE IF EXISTS `problem_reports`;
4443
DROP TABLE IF EXISTS `problem_reports`;
4444
CREATE TABLE `problem_reports` (
4444
CREATE TABLE `problem_reports` (
4445
    `reportid` int(11) NOT NULL auto_increment, -- unqiue identifier assigned by Koha
4445
    `reportid` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
4446
    `title` varchar(40) NOT NULL default '', -- report subject line
4446
    `title` varchar(40) NOT NULL default '', -- report subject line
4447
    `content` varchar(255) NOT NULL default '', -- report message content
4447
    `content` varchar(255) NOT NULL default '', -- report message content
4448
    `borrowernumber` int(11) default NULL, -- the user who created the problem report
4448
    `borrowernumber` int(11) default NULL, -- the user who created the problem report
Lines 4450-4456 CREATE TABLE `problem_reports` ( Link Here
4450
    `username` varchar(75) default NULL, -- OPAC username
4450
    `username` varchar(75) default NULL, -- OPAC username
4451
    `problempage` varchar(255) default NULL, -- page the user triggered the problem report form from
4451
    `problempage` varchar(255) default NULL, -- page the user triggered the problem report form from
4452
    `recipient` enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report
4452
    `recipient` enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report
4453
    `reportdate` datetime default NULL, -- date and time of report submission
4453
    `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- timestamp of report submission
4454
    `status` varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed
4454
    `status` varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed
4455
    PRIMARY KEY (`reportid`),
4455
    PRIMARY KEY (`reportid`),
4456
    CONSTRAINT `problem_reports_ibfk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4456
    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