From 069e4ba60d8e338f2398f918c25b846641ca014b Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 4 Jul 2004 20:32:47 +0000 Subject: [PATCH] adding this file which never got checked in --- docs/upgrades/upgrade_6.0.2-6.0.3.pl | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 docs/upgrades/upgrade_6.0.2-6.0.3.pl diff --git a/docs/upgrades/upgrade_6.0.2-6.0.3.pl b/docs/upgrades/upgrade_6.0.2-6.0.3.pl new file mode 100644 index 000000000..c94047d54 --- /dev/null +++ b/docs/upgrades/upgrade_6.0.2-6.0.3.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl + +use lib "../../lib"; +use Getopt::Long; +use Parse::PlainConfig; +use strict; +use WebGUI::Session; +use WebGUI::International; +use WebGUI::SQL; + + +my $configFile; +my $quiet; + +GetOptions( + 'configFile=s'=>\$configFile, + 'quiet'=>\$quiet +); + +WebGUI::Session::open("../..",$configFile); + +print "\tFixing pagination template variables.\n" unless ($quiet); +my $sth = WebGUI::SQL->read("select * from template where namespace in ('Article')"); +while (my $data = $sth->hashRef) { + $data->{template} =~ s/pagination\.ispagination\.firstPage/pagination.isFirstPage/ig; + $data->{template} =~ s/pagination\.ispagination\.lastPage/pagination.isLastPage/ig; + WebGUI::SQL->write("update template set template=".quote($data->{template})." where namespace=".quote($data->{namespace})." and templateId=".quote($data->{templateId})); +} +$sth->finish; + + +WebGUI::Session::close(); + +