diff --git a/Koha/Schema/Result/ProblemReport.pm b/Koha/Schema/Result/ProblemReport.pm index a55ad1ece6..f2655b5a7d 100644 --- a/Koha/Schema/Result/ProblemReport.pm +++ b/Koha/Schema/Result/ProblemReport.pm @@ -46,8 +46,9 @@ __PACKAGE__->table("problem_reports"); =head2 borrowernumber data_type: 'integer' + default_value: 0 is_foreign_key: 1 - is_nullable: 1 + is_nullable: 0 =head2 branchcode @@ -86,9 +87,9 @@ __PACKAGE__->table("problem_reports"); =head2 status data_type: 'varchar' - default_value: 'N' + default_value: 'NEW' is_nullable: 0 - size: 1 + size: 6 =cut @@ -100,7 +101,12 @@ __PACKAGE__->add_columns( "content", { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, "borrowernumber", - { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + { + data_type => "integer", + default_value => 0, + is_foreign_key => 1, + is_nullable => 0, + }, "branchcode", { data_type => "varchar", @@ -128,7 +134,7 @@ __PACKAGE__->add_columns( is_nullable => 0, }, "status", - { data_type => "varchar", default_value => "N", is_nullable => 0, size => 1 }, + { data_type => "varchar", default_value => "NEW", is_nullable => 0, size => 6 }, ); =head1 PRIMARY KEY @@ -157,12 +163,7 @@ __PACKAGE__->belongs_to( "borrowernumber", "Koha::Schema::Result::Borrower", { borrowernumber => "borrowernumber" }, - { - is_deferrable => 1, - join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", - }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); =head2 branchcode @@ -181,8 +182,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-11 08:28:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qVNVIuurFD6Q6p4YA5Kptg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2020-03-18 22:36:43 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XQn+sJwh4s+EK9vf2gQ7Qw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/admin/problem-reports.pl b/admin/problem-reports.pl index 659a6e0e2d..70b97276c2 100755 --- a/admin/problem-reports.pl +++ b/admin/problem-reports.pl @@ -48,18 +48,18 @@ my @report_ids = $query->multi_param('report_ids'); if ( $action eq 'viewed' ) { foreach my $report_id ( @report_ids ) { my $report = Koha::ProblemReports->find($report_id); - $report->set({ status => 'V' })->store; + $report->set({ status => 'Viewed' })->store; } } elsif ( $action eq 'closed' ) { foreach my $report_id ( @report_ids ) { my $report = Koha::ProblemReports->find($report_id); - $report->set({ status => 'C' })->store; + $report->set({ status => 'Closed' })->store; } } elsif ( $action eq 'new' ) { foreach my $report_id ( @report_ids ) { my $report = Koha::ProblemReports->find($report_id); - $report->set({ status => 'N' })->store; + $report->set({ status => 'New' })->store; } } diff --git a/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl b/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl index 11cee3aa67..02dcb49281 100644 --- a/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl +++ b/installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl @@ -6,13 +6,13 @@ if( CheckVersion( $DBversion ) ) { reportid int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha title varchar(40) NOT NULL default '', -- report subject line content varchar(255) NOT NULL default '', -- report message content - borrowernumber int(11) default NULL, -- the user who created the problem report + borrowernumber int(11) NOT NULL default 0, -- the user who created the problem report branchcode varchar(10) NOT NULL default '', -- borrower's branch username varchar(75) default NULL, -- OPAC username problempage varchar(255) default NULL, -- page the user triggered the problem report form from recipient enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- timestamp of report submission - status varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed + status varchar(6) NOT NULL default 'New', -- status of the report. New, Viewed, Closed PRIMARY KEY (reportid), CONSTRAINT problem_reports_ibfk1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT problem_reports_ibfk2 FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 38c2ee55ce..2b7371fd52 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4445,13 +4445,13 @@ CREATE TABLE `problem_reports` ( `reportid` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha `title` varchar(40) NOT NULL default '', -- report subject line `content` varchar(255) NOT NULL default '', -- report message content - `borrowernumber` int(11) default NULL, -- the user who created the problem report + `borrowernumber` int(11) NOT NULL default 0, -- the user who created the problem report `branchcode` varchar(10) NOT NULL default '', -- borrower's branch `username` varchar(75) default NULL, -- OPAC username `problempage` varchar(255) default NULL, -- page the user triggered the problem report form from `recipient` enum('admin','library') NOT NULL default 'library', -- the 'to-address' of the problem report `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- timestamp of report submission - `status` varchar(1) NOT NULL default 'N', -- status of the report. N=new, V=viewed, C=closed + `status` varchar(6) NOT NULL default 'New', -- status of the report. New, Viewed, Closed PRIMARY KEY (`reportid`), CONSTRAINT `problem_reports_ibfk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `problem_reports_ibfk2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/problem-reports.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/problem-reports.tt index 4d6faf0c6f..ceb0f6c440 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/problem-reports.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/problem-reports.tt @@ -64,6 +64,7 @@