Bug 4461: DBRev 19.12.00.066
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 10:25:02 +0000 (11:25 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 10:25:02 +0000 (11:25 +0100)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Koha.pm
installer/data/mysql/atomicupdate/bug-4461_add-OPACReportProblem-syspref.perl [deleted file]
installer/data/mysql/atomicupdate/bug-4461_add-problem-report-notice.perl [deleted file]
installer/data/mysql/atomicupdate/bug-4461_add-problem-reports-table.perl [deleted file]
installer/data/mysql/atomicupdate/bug-4461_manage_problem_reports_userflags.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 49df317..f33b217 100644 (file)
--- a/Koha.pm
+++ b/Koha.pm
@@ -29,7 +29,7 @@ use vars qw{ $VERSION };
 # - #4 : the developer version. The 4th number is the database subversion.
 #        used by developers when the database changes. updatedatabase take care of the changes itself
 #        and is automatically called by Auth.pm when needed.
-$VERSION = "19.12.00.065";
+$VERSION = "19.12.00.066";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug-4461_add-OPACReportProblem-syspref.perl b/installer/data/mysql/atomicupdate/bug-4461_add-OPACReportProblem-syspref.perl
deleted file mode 100644 (file)
index 4c858b5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACReportProblem', 0, NULL, 'Allow patrons to submit problem reports for OPAC pages to the library or Koha Administrator', 'YesNo') });
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 4461 - Add OPACReportProblem system preference)\n";
-}
diff --git a/installer/data/mysql/atomicupdate/bug-4461_add-problem-report-notice.perl b/installer/data/mysql/atomicupdate/bug-4461_add-problem-report-notice.perl
deleted file mode 100644 (file)
index bd642a5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    $dbh->do(q{INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email') });
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 4461 - Adding PROBLEM_REPORT notice)\n";
-}
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
deleted file mode 100644 (file)
index fab48d7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-
-    if( !TableExists( 'problem_reports' ) ){
-        $dbh->do(q{ 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) 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 TEXT 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(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
-        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci });
-    }
-
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 4461: Add problem reports table)\n";
-}
diff --git a/installer/data/mysql/atomicupdate/bug-4461_manage_problem_reports_userflags.perl b/installer/data/mysql/atomicupdate/bug-4461_manage_problem_reports_userflags.perl
deleted file mode 100644 (file)
index 0d12b98..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-$DBversion = 'XXX';  # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
-    $dbh->do(q{INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (26, 'problem_reports', 'Manage problem reports', 0) });
-    $dbh->do(q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (26, 'manage_problem_reports', 'Manage OPAC problem reports') });
-
-    # Always end with this (adjust the bug info)
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug 4461 - Add user permissions for managing OPAC problem reports)\n";
-}
index 4cf630f..b4e1158 100755 (executable)
@@ -21464,6 +21464,52 @@ if( CheckVersion( $DBversion ) ) {
     NewVersion( $DBversion, 23173, "Add ILLCheckAvailability syspref");
 }
 
+$DBversion = '19.12.00.066';
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(
+q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACReportProblem', 0, NULL, 'Allow patrons to submit problem reports for OPAC pages to the library or Koha Administrator', 'YesNo') }
+    );
+    $dbh->do(
+q{INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('members', 'PROBLEM_REPORT','OPAC Problem Report','OPAC Problem Report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email') }
+    );
+    if ( !TableExists('problem_reports') ) {
+        $dbh->do(
+            q{ 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) 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 TEXT 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(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
+        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci }
+        );
+    }
+    $dbh->do(
+q{INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (26, 'problem_reports', 'Manage problem reports', 0) }
+    );
+    $dbh->do(
+q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (26, 'manage_problem_reports', 'Manage OPAC problem reports') }
+    );
+
+    NewVersion(
+        $DBversion,
+        4461,
+        [
+            "Add OPACReportProblem system preference",
+            "Adding PROBLEM_REPORT notice",
+            "Add problem reports table",
+            "Add user permissions for managing OPAC problem reports"
+        ]
+    );
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.
 my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';