SetVersion ($DBversion);
}
-
+$DBversion = "3.11.00.111";
+if ( CheckVersion($DBversion) ) {
+ my $sth = $dbh->prepare("
+ SELECT module, code, branchcode, content
+ FROM letter
+ WHERE content LIKE '%<fine>%'
+ ");
+ $sth->execute;
+ my $sth_update = $dbh->prepare("UPDATE letter SET content = ? WHERE module = ? AND code = ? AND branchcode = ?");
+ while(my $row = $sth->fetchrow_hashref){
+ $row->{content} =~ s/<fine>\w+<\/fine>/<<items.fine>>/;
+ $sth_update->execute($row->{content}, $row->{module}, $row->{code}, $row->{branchcode});
+ }
+ print "Upgrade to $DBversion done (use new <<items.fine>> syntax in notices)\n";
+ SetVersion ($DBversion);
+}
=head1 FUNCTIONS