diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 25b665245..72e5ac6ba 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,4 @@ -7.9.14 +7.10.0 7.9.13 - fixed #11783: Instances deleted during realtime run diff --git a/docs/upgrades/packages-7.8.24-7.9.11/merged.wgpkg b/docs/upgrades/packages-7.8.24-7.9.11/merged.wgpkg deleted file mode 100644 index d80cb12f1..000000000 Binary files a/docs/upgrades/packages-7.8.24-7.9.11/merged.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.1/default_post_form.wgpkg b/docs/upgrades/packages-7.9.1/default_post_form.wgpkg deleted file mode 100644 index ca4ada625..000000000 Binary files a/docs/upgrades/packages-7.9.1/default_post_form.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.1/matrix-default-view-template.wgpkg b/docs/upgrades/packages-7.9.1/matrix-default-view-template.wgpkg deleted file mode 100644 index 7867b44f9..000000000 Binary files a/docs/upgrades/packages-7.9.1/matrix-default-view-template.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.1/root_import_auth.wgpkg b/docs/upgrades/packages-7.9.1/root_import_auth.wgpkg deleted file mode 100644 index d8ae7932f..000000000 Binary files a/docs/upgrades/packages-7.9.1/root_import_auth.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.1/root_import_calendar-templates_default-calendar-event-edit.wgpkg b/docs/upgrades/packages-7.9.1/root_import_calendar-templates_default-calendar-event-edit.wgpkg deleted file mode 100644 index 8573b1b61..000000000 Binary files a/docs/upgrades/packages-7.9.1/root_import_calendar-templates_default-calendar-event-edit.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.1/root_import_survey_default-survey-edit.wgpkg b/docs/upgrades/packages-7.9.1/root_import_survey_default-survey-edit.wgpkg deleted file mode 100644 index bfb8d71cd..000000000 Binary files a/docs/upgrades/packages-7.9.1/root_import_survey_default-survey-edit.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.10/data_list.wgpkg b/docs/upgrades/packages-7.9.10/data_list.wgpkg deleted file mode 100644 index 5fb51cfda..000000000 Binary files a/docs/upgrades/packages-7.9.10/data_list.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.11/asset_report.wgpkg b/docs/upgrades/packages-7.9.11/asset_report.wgpkg deleted file mode 100644 index 7795f4a50..000000000 Binary files a/docs/upgrades/packages-7.9.11/asset_report.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.11/root_import_account_account.css.wgpkg b/docs/upgrades/packages-7.9.11/root_import_account_account.css.wgpkg deleted file mode 100644 index 71916f16d..000000000 Binary files a/docs/upgrades/packages-7.9.11/root_import_account_account.css.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.11/root_import_account_default-account-layout2.wgpkg b/docs/upgrades/packages-7.9.11/root_import_account_default-account-layout2.wgpkg deleted file mode 100644 index 4e1c30e28..000000000 Binary files a/docs/upgrades/packages-7.9.11/root_import_account_default-account-layout2.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.11/root_import_default-asset-subscription.wgpkg b/docs/upgrades/packages-7.9.11/root_import_default-asset-subscription.wgpkg deleted file mode 100644 index 03f3ad2fc..000000000 Binary files a/docs/upgrades/packages-7.9.11/root_import_default-asset-subscription.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.11/root_import_matrix.wgpkg b/docs/upgrades/packages-7.9.11/root_import_matrix.wgpkg deleted file mode 100644 index a100e04c0..000000000 Binary files a/docs/upgrades/packages-7.9.11/root_import_matrix.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.13/root_import_gallery-templates.wgpkg b/docs/upgrades/packages-7.9.13/root_import_gallery-templates.wgpkg deleted file mode 100644 index b27227c7c..000000000 Binary files a/docs/upgrades/packages-7.9.13/root_import_gallery-templates.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.2/root_import_account_account.css.wgpkg b/docs/upgrades/packages-7.9.2/root_import_account_account.css.wgpkg deleted file mode 100644 index 305fe2df6..000000000 Binary files a/docs/upgrades/packages-7.9.2/root_import_account_account.css.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.2/root_import_collaboration.wgpkg b/docs/upgrades/packages-7.9.2/root_import_collaboration.wgpkg deleted file mode 100644 index 1fa092478..000000000 Binary files a/docs/upgrades/packages-7.9.2/root_import_collaboration.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.2/root_import_gallery-templates_default-gallery-view-photo.wgpkg b/docs/upgrades/packages-7.9.2/root_import_gallery-templates_default-gallery-view-photo.wgpkg deleted file mode 100644 index fc42109a7..000000000 Binary files a/docs/upgrades/packages-7.9.2/root_import_gallery-templates_default-gallery-view-photo.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.2/root_import_gallery-templates_gallery.css.wgpkg b/docs/upgrades/packages-7.9.2/root_import_gallery-templates_gallery.css.wgpkg deleted file mode 100644 index 032b70ec3..000000000 Binary files a/docs/upgrades/packages-7.9.2/root_import_gallery-templates_gallery.css.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.2/root_import_gallery-templates_images.wgpkg b/docs/upgrades/packages-7.9.2/root_import_gallery-templates_images.wgpkg deleted file mode 100644 index 300f32c6b..000000000 Binary files a/docs/upgrades/packages-7.9.2/root_import_gallery-templates_images.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.3/default-wiki-front-page.wgpkg b/docs/upgrades/packages-7.9.3/default-wiki-front-page.wgpkg deleted file mode 100644 index 5bd7d736b..000000000 Binary files a/docs/upgrades/packages-7.9.3/default-wiki-front-page.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.3/default-wiki-page.wgpkg b/docs/upgrades/packages-7.9.3/default-wiki-page.wgpkg deleted file mode 100644 index 54846118b..000000000 Binary files a/docs/upgrades/packages-7.9.3/default-wiki-page.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.3/home_map_map-templates_default-edit-map-point.wgpkg b/docs/upgrades/packages-7.9.3/home_map_map-templates_default-edit-map-point.wgpkg deleted file mode 100644 index 822fec147..000000000 Binary files a/docs/upgrades/packages-7.9.3/home_map_map-templates_default-edit-map-point.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.3/home_map_map-templates_default-map-point-view.wgpkg b/docs/upgrades/packages-7.9.3/home_map_map-templates_default-map-point-view.wgpkg deleted file mode 100644 index c9f92fa55..000000000 Binary files a/docs/upgrades/packages-7.9.3/home_map_map-templates_default-map-point-view.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.3/root_import_gallery-templates_admin.css.wgpkg b/docs/upgrades/packages-7.9.3/root_import_gallery-templates_admin.css.wgpkg deleted file mode 100644 index 8cbaecf00..000000000 Binary files a/docs/upgrades/packages-7.9.3/root_import_gallery-templates_admin.css.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.3/root_import_gallery-templates_default-gallery-edit-album.wgpkg b/docs/upgrades/packages-7.9.3/root_import_gallery-templates_default-gallery-edit-album.wgpkg deleted file mode 100644 index d086ccee2..000000000 Binary files a/docs/upgrades/packages-7.9.3/root_import_gallery-templates_default-gallery-edit-album.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.3/root_import_gallery-templates_dragdropsorting.js.wgpkg b/docs/upgrades/packages-7.9.3/root_import_gallery-templates_dragdropsorting.js.wgpkg deleted file mode 100644 index b28f5e0b5..000000000 Binary files a/docs/upgrades/packages-7.9.3/root_import_gallery-templates_dragdropsorting.js.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/crystalx.wgpkg b/docs/upgrades/packages-7.9.4/crystalx.wgpkg deleted file mode 100644 index 8b9dddb03..000000000 Binary files a/docs/upgrades/packages-7.9.4/crystalx.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/greenportal.wgpkg b/docs/upgrades/packages-7.9.4/greenportal.wgpkg deleted file mode 100644 index 5d3f9ba65..000000000 Binary files a/docs/upgrades/packages-7.9.4/greenportal.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/root_import_account_inbox_default-inbox-view-template.wgpkg b/docs/upgrades/packages-7.9.4/root_import_account_inbox_default-inbox-view-template.wgpkg deleted file mode 100644 index d78125402..000000000 Binary files a/docs/upgrades/packages-7.9.4/root_import_account_inbox_default-inbox-view-template.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/root_import_wiki.wgpkg b/docs/upgrades/packages-7.9.4/root_import_wiki.wgpkg deleted file mode 100644 index 8afed4e2a..000000000 Binary files a/docs/upgrades/packages-7.9.4/root_import_wiki.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/shopping-cart-collateral-items.wgpkg b/docs/upgrades/packages-7.9.4/shopping-cart-collateral-items.wgpkg deleted file mode 100644 index 1b6af5751..000000000 Binary files a/docs/upgrades/packages-7.9.4/shopping-cart-collateral-items.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/style-underground.wgpkg b/docs/upgrades/packages-7.9.4/style-underground.wgpkg deleted file mode 100644 index 4149a7f5f..000000000 Binary files a/docs/upgrades/packages-7.9.4/style-underground.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/style_01.wgpkg b/docs/upgrades/packages-7.9.4/style_01.wgpkg deleted file mode 100644 index da3c6b216..000000000 Binary files a/docs/upgrades/packages-7.9.4/style_01.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/style_02.wgpkg b/docs/upgrades/packages-7.9.4/style_02.wgpkg deleted file mode 100644 index a73d44fa6..000000000 Binary files a/docs/upgrades/packages-7.9.4/style_02.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.4/style_03.wgpkg b/docs/upgrades/packages-7.9.4/style_03.wgpkg deleted file mode 100644 index 1a0111228..000000000 Binary files a/docs/upgrades/packages-7.9.4/style_03.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.5/root_import_collaboration.wgpkg b/docs/upgrades/packages-7.9.5/root_import_collaboration.wgpkg deleted file mode 100644 index f83442066..000000000 Binary files a/docs/upgrades/packages-7.9.5/root_import_collaboration.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.5/root_import_gallery-templates_default-gallery-add-archive.wgpkg b/docs/upgrades/packages-7.9.5/root_import_gallery-templates_default-gallery-add-archive.wgpkg deleted file mode 100644 index cf6bb0c81..000000000 Binary files a/docs/upgrades/packages-7.9.5/root_import_gallery-templates_default-gallery-add-archive.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.5/wiki-master-by-keyword-template.tmpl.wgpkg b/docs/upgrades/packages-7.9.5/wiki-master-by-keyword-template.tmpl.wgpkg deleted file mode 100644 index b4e74c04f..000000000 Binary files a/docs/upgrades/packages-7.9.5/wiki-master-by-keyword-template.tmpl.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-add-archive.wgpkg b/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-add-archive.wgpkg deleted file mode 100644 index a907fd1d4..000000000 Binary files a/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-add-archive.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-search.wgpkg b/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-search.wgpkg deleted file mode 100644 index 0fd040d1f..000000000 Binary files a/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-search.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-view-photo.wgpkg b/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-view-photo.wgpkg deleted file mode 100644 index ded6e284f..000000000 Binary files a/docs/upgrades/packages-7.9.6/root_import_gallery-templates_default-gallery-view-photo.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.7/root_import_gallery-templates_admin.css.wgpkg b/docs/upgrades/packages-7.9.7/root_import_gallery-templates_admin.css.wgpkg deleted file mode 100644 index f5cd50d57..000000000 Binary files a/docs/upgrades/packages-7.9.7/root_import_gallery-templates_admin.css.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.7/root_import_gallery-templates_default-gallery-edit-album.wgpkg b/docs/upgrades/packages-7.9.7/root_import_gallery-templates_default-gallery-edit-album.wgpkg deleted file mode 100644 index 14275ac5d..000000000 Binary files a/docs/upgrades/packages-7.9.7/root_import_gallery-templates_default-gallery-edit-album.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.8/root_import_auth_twitter_chooseusername_default-twitter-choose-username.wgpkg b/docs/upgrades/packages-7.9.8/root_import_auth_twitter_chooseusername_default-twitter-choose-username.wgpkg deleted file mode 100644 index e024a07e9..000000000 Binary files a/docs/upgrades/packages-7.9.8/root_import_auth_twitter_chooseusername_default-twitter-choose-username.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.8/root_import_collaboration.wgpkg b/docs/upgrades/packages-7.9.8/root_import_collaboration.wgpkg deleted file mode 100644 index 98633a498..000000000 Binary files a/docs/upgrades/packages-7.9.8/root_import_collaboration.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.8/root_import_gallery-templates.wgpkg b/docs/upgrades/packages-7.9.8/root_import_gallery-templates.wgpkg deleted file mode 100644 index a2080830f..000000000 Binary files a/docs/upgrades/packages-7.9.8/root_import_gallery-templates.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.8/templates_thingy-default-search-thing.wgpkg b/docs/upgrades/packages-7.9.8/templates_thingy-default-search-thing.wgpkg deleted file mode 100644 index 6076e8b0a..000000000 Binary files a/docs/upgrades/packages-7.9.8/templates_thingy-default-search-thing.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/default_ldap_anonymous_registration_template.wgpkg b/docs/upgrades/packages-7.9.9/default_ldap_anonymous_registration_template.wgpkg deleted file mode 100644 index fc7d0b604..000000000 Binary files a/docs/upgrades/packages-7.9.9/default_ldap_anonymous_registration_template.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/default_webgui_anonymous_registration_template.wgpkg b/docs/upgrades/packages-7.9.9/default_webgui_anonymous_registration_template.wgpkg deleted file mode 100644 index d398c886e..000000000 Binary files a/docs/upgrades/packages-7.9.9/default_webgui_anonymous_registration_template.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/greenportal_calendar_greenportal_calendarmonth.wgpkg b/docs/upgrades/packages-7.9.9/greenportal_calendar_greenportal_calendarmonth.wgpkg deleted file mode 100644 index 0dfbd5389..000000000 Binary files a/docs/upgrades/packages-7.9.9/greenportal_calendar_greenportal_calendarmonth.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/matrix-search-template.wgpkg b/docs/upgrades/packages-7.9.9/matrix-search-template.wgpkg deleted file mode 100644 index 700317f02..000000000 Binary files a/docs/upgrades/packages-7.9.9/matrix-search-template.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/root_import_account_inbox_default-inbox-send-message-template.wgpkg b/docs/upgrades/packages-7.9.9/root_import_account_inbox_default-inbox-send-message-template.wgpkg deleted file mode 100644 index 07ae61705..000000000 Binary files a/docs/upgrades/packages-7.9.9/root_import_account_inbox_default-inbox-send-message-template.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/root_import_calendar-templates_default-calendar-month.wgpkg b/docs/upgrades/packages-7.9.9/root_import_calendar-templates_default-calendar-month.wgpkg deleted file mode 100644 index 055c94f4b..000000000 Binary files a/docs/upgrades/packages-7.9.9/root_import_calendar-templates_default-calendar-month.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission-main.wgpkg b/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission-main.wgpkg deleted file mode 100644 index 5cd8cf179..000000000 Binary files a/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission-main.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission-queue.wgpkg b/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission-queue.wgpkg deleted file mode 100644 index d93cc9f27..000000000 Binary files a/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission-queue.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission.wgpkg b/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission.wgpkg deleted file mode 100644 index 28cd8e598..000000000 Binary files a/docs/upgrades/packages-7.9.9/root_import_ems_ems-event-submission.wgpkg and /dev/null differ diff --git a/docs/upgrades/packages-7.9.9/stockdatatmpl000000001.wgpkg b/docs/upgrades/packages-7.9.9/stockdatatmpl000000001.wgpkg deleted file mode 100644 index 82f753636..000000000 Binary files a/docs/upgrades/packages-7.9.9/stockdatatmpl000000001.wgpkg and /dev/null differ diff --git a/docs/upgrades/upgrade_7.8.13-7.9.0.pl b/docs/upgrades/upgrade_7.8.13-7.9.0.pl deleted file mode 100644 index 1f6171d4c..000000000 --- a/docs/upgrades/upgrade_7.8.13-7.9.0.pl +++ /dev/null @@ -1,238 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = "7.9.0"; -my $quiet; - - -my $session = start(); - -# upgrade functions go here -removeBadMacroEntries($session); -addFilePumpMacro($session); -fixImportNodeSettings($session); - -finish($session); - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub removeBadMacroEntries { - my $session = shift; - print "\tRemove bad macro entries that look like perl memory locations... " unless $quiet; - my $macros = $session->config->get('macros'); - # and here's our code - foreach my $macroName (keys %{ $macros }) { - delete $macros->{$macroName} if $macroName =~ /HASH \( 0x \w+ \)/ox; - } - $session->config->set('macros', $macros); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub addFilePumpMacro { - my $session = shift; - print "\tAdd the FilePump macro... " unless $quiet; - # and here's our code - $session->config->addToHash('macros', 'FilePump' => 'FilePump'); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub fixImportNodeSettings { - my $session = shift; - print "\tFix settings in the import node... " unless $quiet; - # and here's our code - my $db = $session->db; - $db->write('update template set isDefault=0'); - my @templateIds = qw/ --ANLpoTEP-n4POAdRxCzRw PBtmpl0000000000000092 N716tpSna0iIQTKxS4gTWA VCFhB9WOsDsH2Apj3c6DpQ --PkdI8l1idu-8gDX3iOdcw PBtmpl0000000000000093 NBVSVNLp9X_bV7WrCprtCA WVtmpl0000000000000001 --zxyB-O50W8YnL39Ouoc4Q PBtmpl0000000000000094 OOyMH33plAy6oCj_QWrxtg WeatherDataTmpl0000001 -05FpjceLYhq4csF1Kww1KQ PBtmpl0000000000000097 OkphOEdaSGTXnFGhK4GT5A WikiFrontTmpl000000001 -0EAJ9EYb9ap2XwfrcXfdLQ PBtmpl0000000000000098 OxJWQgnGsgyGohP2L3zJPQ WikiKeyword00000000001 -0X4Q3tBWUb_thsVbsYz9xQ PBtmpl0000000000000099 PBEmsBadgeTemplate0000 WikiMPTmpl000000000001 -0n4HtbXaWa_XJHkFjetnLQ PBtmpl0000000000000101 PBnav00000000000bullet WikiPHTmpl000000000001 -1IzRpX0tgW7iuCfaU2Kk0A PBtmpl0000000000000103 PBnav00000000indentnav WikiPageEditTmpl000001 -1Q4Je3hKCJzeo0ZBB5YB8g PBtmpl0000000000000104 PBnav000000style01lvl2 WikiPageTmpl0000000001 -1Yn_zE_dSiNuaBGNLPbxtw PBtmpl0000000000000107 PBtmpl0000000000000001 WikiRCTmpl000000000001 -1oBRscNIcFOI-pETrCOspA PBtmpl0000000000000108 PBtmpl0000000000000002 WikiSearchTmpl00000001 -2CS-BErrjMmESOtGT90qOg PBtmpl0000000000000109 PBtmpl0000000000000004 XNd7a_g_cTvJVYrVHcx2Mw -2GxjjkRuRkdUg_PccRPjpA PBtmpl0000000000000111 PBtmpl0000000000000005 XdlKhCDvArs40uqBhvzR3w -2gtFt7c0qAFNU3BG_uvNvg PBtmpl0000000000000112 PBtmpl0000000000000006 XgcsoDrbC0duVla7N7JAdw -2rC4ErZ3c77OJzJm7O5s3w PBtmpl0000000000000113 PBtmpl0000000000000010 YP9WaMPJHvCJl-YwrLVcPw -3QpYtHrq_jmAk1FNutQM5A PBtmpl0000000000000114 PBtmpl0000000000000011 ZipArchiveTMPL00000001 -3rjnBVJRO6ZSkxlFkYh_ug PBtmpl0000000000000115 PBtmpl0000000000000012 _aE16Rr1-bXBf8SIaLZjCg -3womoo7Teyy2YKFa25-MZg PBtmpl0000000000000116 PBtmpl0000000000000013 aIpCmr9Hi__vgdZnDTz1jw -4Ekp0kJoJllRRRo_J1Rj6w PBtmpl0000000000000117 PBtmpl0000000000000014 aUDsJ-vB9RgP-AYvPOy8FQ -5A8Hd9zXvByTDy4x-H28qw PBtmpl0000000000000121 PBtmpl0000000000000015 alraubvBu-YJJ614jAHD5w -63ix2-hU0FchXGIWkG3tow PBtmpl0000000000000122 PBtmpl0000000000000016 azCqD0IjdQSlM3ar29k5Sg -64tqS80D53Z0JoAs2cX2VQ PBtmpl0000000000000123 PBtmpl0000000000000020 b1316COmd9xRv4fCI3LLGA -6X-7Twabn5KKO_AbgK3PEw PBtmpl0000000000000124 PBtmpl0000000000000021 b4n3VyUIsAHyIvT-W-jziA -6uQEULvXFgCYlRWnYzZsuA PBtmpl0000000000000128 PBtmpl0000000000000024 bPz1yk6Y9uwMDMBcmMsSCg -75CmQgpcCSkdsL-oawdn3Q PBtmpl0000000000000130 PBtmpl0000000000000026 c8xrwVuu5QE0XtF9DiVzLw -7F-BuEHi7t9bPi008H8xZQ PBtmpl0000000000000131 PBtmpl0000000000000027 cR0UFm7I1qUI2Wbpj--08Q -7Ijdd8SW32lVgg2H8R-Aqw PBtmpl0000000000000132 PBtmpl0000000000000029 d8jMMMRddSQ7twP4l1ZSIw -7JCTAiu1U_bT9ldr655Blw PBtmpl0000000000000133 PBtmpl0000000000000031 default_post_received1 -8tqyQx-LwYUHIWOlKPjJrA PBtmpl0000000000000134 PBtmpl0000000000000032 eqb9sWjFEVq0yHunGV8IGw -9ThW278DWLV0-Svf68ljFQ PBtmpl0000000000000135 PBtmpl0000000000000033 g8W53Pd71uHB9pxaXhWf_A -9j0_Z1j3Jd0QBbY2akb6qw PBtmpl0000000000000136 PBtmpl0000000000000036 gfZOwaTWYjbSoVaQtHBBEw -A16v-YjWAShXWvSACsraeg PBtmpl0000000000000137 PBtmpl0000000000000037 h_T2xtOxGRQ9QJOR6ebLpQ -AGJBGviWGAwjnwziiPjvDg PBtmpl0000000000000140 PBtmpl0000000000000038 hreA_bgxiTX-EzWCSZCZJw -AZFU33p0jpPJ-E6qLSWZng PBtmpl0000000000000141 PBtmpl0000000000000039 i9-G00ALhJOr0gMh-vHbKA -AjhlNO3wZvN5k4i4qioWcg PBtmpl0000000000000200 PBtmpl0000000000000040 ilu5BrM-VGaOsec9Lm7M6Q -AldPGu0u-jm_5xK13atCSQ PBtmpl0000000000000208 PBtmpl0000000000000041 itransact_credentials1 -BMybD3cEnmXVk2wQ_qEsRQ PBtmpl0000000000000209 PBtmpl0000000000000042 jME5BEDYVDlBZ8jIQA9-jQ -CalendarDay00000000001 PBtmpl0000000000000210 PBtmpl0000000000000043 kj3b-X3i6zRKnhLb4ZiCLw -CalendarEvent000000001 PBtmplBlankStyle000001 PBtmpl0000000000000044 ktSvKU8riGimhcsxXwqvPQ -CalendarEventEdit00001 PBtmplHelp000000000001 PBtmpl0000000000000045 lG2exkH9FeYvn4pA63idNg -CalendarMonth000000001 ProjectManagerTMPL0001 PBtmpl0000000000000047 limMkk80fMB3fqNZVf162w -CalendarPrintDay000001 ProjectManagerTMPL0002 PBtmpl0000000000000053 m3IbBavqzuKDd2PGGhKPlA -CalendarPrintEvent0001 ProjectManagerTMPL0003 PBtmpl0000000000000054 mM3bjP_iG9sv5nQb4S17tQ -CalendarPrintMonth0001 ProjectManagerTMPL0004 PBtmpl0000000000000055 mRtqRuVikSe82BQsYBlD0A -CalendarPrintWeek00001 ProjectManagerTMPL0005 PBtmpl0000000000000056 matrixtmpl000000000001 -CalendarSearch00000001 ProjectManagerTMPL0006 PBtmpl0000000000000057 matrixtmpl000000000002 -CalendarWeek0000000001 PsFn7dJt4wMwBa8hiE3hOA PBtmpl0000000000000059 matrixtmpl000000000003 -CarouselTmpl0000000001 S2_LsvVa95OSqc66ITAoig PBtmpl0000000000000060 matrixtmpl000000000004 -CarouselTmpl0000000002 S3zpVitAmhy58CAioH359Q PBtmpl0000000000000061 matrixtmpl000000000005 -CxMpE_UPauZA3p8jdrOABw SQLReportDownload00001 PBtmpl0000000000000062 matrixtmpl000000000006 -D6cJpRcey35aSkh9Q_FPUQ SVIhz68689hwUGgcDM-gWw PBtmpl0000000000000063 matrixtmpl000000000007 -DUoxlTBXhVS-Zl3CFDpt9g StockDataTMPL000000001 PBtmpl0000000000000065 nFen0xjkZn8WkpM93C9ceQ -DashboardViewTmpl00001 StockDataTMPL000000002 PBtmpl0000000000000066 nWNVoMLrMo059mDRmfOp9g -DoVNijm6lMDE0cYrtvEbDQ TEId5V-jEvUULsZA0wuRuA PBtmpl0000000000000067 newsletter000000000001 -E3tzZjzhmYoNlAyP2VW33Q TKmhv8boP3TD2xwSwUBq0g PBtmpl0000000000000068 newslettercs0000000001 -EBlxJpZQ9o-8VBOaGQbChA TbDcVLbbznPi0I0rxQf2CQ PBtmpl0000000000000077 newslettersubscrip0001 -ErEzulFiEKDkaCDVmxUavw ThingyTmpl000000000001 PBtmpl0000000000000078 oHh0UqAJeY7u2n--WD-BAA -ExpireIncResptmpl00001 ThingyTmpl000000000002 PBtmpl0000000000000079 ohjyzab5i-yW6GOWTeDUHg -FJbUTvZ2nUTn65LpW6gjsA ThingyTmpl000000000003 PBtmpl0000000000000080 pbtmpl0000000000000220 -G5V6neXIDiFXN05oL-U3AQ ThingyTmpl000000000004 PBtmpl0000000000000081 pbtmpl0000000000000221 -GNvjCFQWjY2AF2uf0aCM8Q TimeTrackingTMPL000001 PBtmpl0000000000000082 q5O62aH4pjUXsrQR3Pq4lw -GRUNFctldUgop-qRLuo_DA TimeTrackingTMPL000002 PBtmpl0000000000000083 stevecoolmenu000000001 -IOB0000000000000000001 TimeTrackingTMPL000003 PBtmpl0000000000000085 stevenav00000000000001 -IOB0000000000000000002 TuYPpHx7TUyk08639Pc8Bg PBtmpl0000000000000088 stevestyle000000000001 -K8F0j_cq_jgo8dvWY_26Ag UTNFeV7B_aSCRmmaFCq4Vw PBtmpl0000000000000091 stevestyle000000000002 -KAMdiUdJykjN02CPHpyZOw UserListTmpl0000000001 wAc4azJViVTpo-2NYOXWvg stevestyle000000000003 -MBmWlA_YEA2I6D29OMGtRg UserListTmpl0000000002 yBwydfooiLvhEFawJb0VTQ u9vfx33XDk5la1-QC5FK7g -MK4fCNoyrx5SE8eyDfOpxg UserListTmpl0000000003 yxD5ka7XHebPLD-LXBwJqw uRL9qtk7Rb0YRJ41LmHOJw -MultiSearchTmpl0000001 VBkY05f-E3WJS50WpdKd1Q zcX-wIUct0S_np14xxOA-A vrKXEtluIhbmAS9xmPukDA -zrNpGbT3odfIkg6nFSUy8Q -/; - my $tmplSth = $db->prepare('update template set isDefault=1 where assetId=?'); - foreach my $templateId (@templateIds) { - $tmplSth->execute([$templateId]); - } - $tmplSth->finish; - - print "DONE!\n" unless $quiet; -} - - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.8.24-7.9.11.pl b/docs/upgrades/upgrade_7.8.24-7.9.11.pl deleted file mode 100644 index e75cfc8bd..000000000 --- a/docs/upgrades/upgrade_7.8.24-7.9.11.pl +++ /dev/null @@ -1,529 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; -use WebGUI::Asset::WikiPage; -use WebGUI::Shop::AddressBook; -use WebGUI::Shop::Pay; -use WebGUI::Workflow; -use WebGUI::Utility; - - -my $toVersion = "7.9.11"; # make this match what version you're going to -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -##7.9.1-.2 -addSortItemsSCColumn($session); -addExtensionWorkflow($session); - -##7.9.2-.3 -reindexSiteForDefaultSynopsis( $session ); -addTopLevelWikiKeywords( $session ); - -##7.9.3-.4 -addWikiSubKeywords($session); -addSynopsistoEachWikiPage($session); -dropVisitorAddressBooks($session); -alterCartTable($session); -alterAddressBookTable($session); -addWizardHandler( $session ); -addTemplateExampleImage( $session ); -addPayDriverTemplates( $session ); - -##7.9.4-.5 -modifySortItems( $session ); -addRejectNoticeSetting($session); -installNewCSUnsubscribeTemplate($session); - -##7.9.5-.6 -addIndexForInbox($session); - -##7.9.7-.8 -addTwitterAuth( $session ); - -##7.9.8-.9 -migrateAttachmentsToJson( $session ); - -##7.9.9-.10 -alterStoryArchiveTable($session); - -##7.9.10-.11 -alterStoryTopicTable($session); -addAssetReport($session); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - - -#---------------------------------------------------------------------------- -sub addExtensionWorkflow { - print "\tAdding calendar event extension to weekly maintenence..." - unless $quiet; - my $workflow = WebGUI::Workflow->new($session, 'pbworkflow000000000002'); - my $activity = $workflow->addActivity('WebGUI::Workflow::Activity::ExtendCalendarRecurrences'); - $activity->set(title => 'Extend Calendar Recurrences'); - $activity->set(description => 'Create events for live recurrences up to two years from the current date'); - print "Done\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub addSortItemsSCColumn { - my $session = shift; - print "\tAdding sort items switch to Syndicated Content... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `SyndicatedContent`'); - while (my ($col) = $sth->array) { - if ($col eq 'sortItems') { - print "Skipped.\n" unless $quiet; - return; - } - } - $session->db->write('ALTER TABLE SyndicatedContent ADD COLUMN sortItems BOOL DEFAULT 1'); - - print "Done.\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub addTopLevelWikiKeywords { - my $session = shift; - print "\tAdding top level keywords page to WikiMaster... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `WikiMaster`'); - while (my ($col) = $sth->array) { - if ($col eq 'topLevelKeywords') { - print "Skipped.\n" unless $quiet; - return; - } - } - $session->db->write('ALTER TABLE WikiMaster ADD COLUMN topLevelKeywords LONGTEXT'); - - print "Done.\n" unless $quiet; -} - - -#---------------------------------------------------------------------------- -# Reindex the site to clear out default synopsis -sub reindexSiteForDefaultSynopsis { - my $session = shift; - print "\tRe-indexing site to clear out default synopses... " unless $quiet; - - my $rs = $session->db->read("select assetId, className from asset where state='published'"); - my @searchableAssetIds; - while (my ($id, $class) = $rs->array) { - my $asset = WebGUI::Asset->new($session,$id,$class); - if (defined $asset && $asset->get("state") eq "published" && ($asset->get("status") eq "approved" || $asset->get("status") eq "archived")) { - $asset->indexContent; - push (@searchableAssetIds, $id); - } - } - - # delete indexes of assets that are no longer searchable - my $list = $session->db->quoteAndJoin(\@searchableAssetIds) if scalar(@searchableAssetIds); - $session->db->write("delete from assetIndex where assetId not in (".$list.")") if $list; - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Add example images to templates -sub addTemplateExampleImage { - my $session = shift; - print "\tAdding example image field to template... " unless $quiet; - - $session->db->write( q{ - ALTER TABLE template ADD storageIdExample CHAR(22) - } ); - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- - -sub addWizardHandler { - my ( $sesssion ) = @_; - print "\tAdding WebGUI::Wizard... " unless $quiet; - - if ( !grep { $_ eq 'WebGUI::Content::Wizard' } @{$session->config->get('contentHandlers')} ) { - # Find the place of Operation and add before - my @handlers = (); - for my $handler ( @{$session->config->get('contentHandlers')} ) { - if ( $handler eq 'WebGUI::Content::Operation' ) { - push @handlers, 'WebGUI::Content::Wizard'; - } - push @handlers, $handler; - } - $session->config->set('contentHandlers',\@handlers); - } - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub addWikiSubKeywords { - my $session = shift; - print "\tAdd the WikiMaster sub-keywords table... " unless $quiet; - # and here's our code - $session->db->write(<getIsa($session); - PAGE: while (1) { - my $page = eval {$pager->()}; - next PAGE if Exception::Class->caught(); - last PAGE unless $page; - my ($synopsis) = $page->getSynopsisAndContent(undef, $page->get('content')); - $page->update({synopsis => $synopsis}); - } - # and here's our code - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub dropVisitorAddressBooks { - my $session = shift; - print "\tDrop AddressBooks owned by Visitor... " unless $quiet; - my $sth = $session->db->read(q|SELECT addressBookId FROM addressBook where userId='1'|); - BOOK: while (my ($addressBookId) = $sth->array) { - my $book = eval { WebGUI::Shop::AddressBook->new($session, $addressBookId); }; - next BOOK if Exception::Class->caught(); - $book->delete; - } - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub alterAddressBookTable { - my $session = shift; - print "\tDrop sessionId from the Address Book database table... " unless $quiet; - # and here's our code - $session->db->write("ALTER TABLE addressBook DROP COLUMN sessionId"); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub alterCartTable { - my $session = shift; - print "\tAdd billing address column to the Cart table... " unless $quiet; - # and here's our code - $session->db->write("ALTER TABLE cart ADD COLUMN billingAddressId CHAR(22)"); - $session->db->write("ALTER TABLE cart ADD COLUMN gatewayId CHAR(22)"); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub addPayDriverTemplates { - my $session = shift; - print "\tAdd templates to the Payment Drivers that need them... " unless $quiet; - # and here's our code - my $pay = WebGUI::Shop::Pay->new($session); - my @gateways = @{ $pay->getPaymentGateways }; - GATEWAY: foreach my $gateway (@gateways) { - next GATEWAY unless $gateway; - my $properties = $gateway->get; - if ($gateway->isa('WebGUI::Shop::PayDriver::Cash')) { - $properties->{summaryTemplateId} = '30h5rHxzE_Q0CyI3Gg7EJw'; - } - elsif ($gateway->isa('WebGUI::Shop::PayDriver::ITransact')) { - ##Nothing to do. This template was only changed, not added. - } - elsif ($gateway->isa('WebGUI::Shop::PayDriver::Ogone')) { - $properties->{summaryTemplateId} = 'jysVZeUR0Bx2NfrKs5sulg'; - } - elsif ($gateway->isa('WebGUI::Shop::PayDriver::PayPal::PayPalStd')) { - $properties->{summaryTemplateId} = '300AozDaeveAjB_KN0ljlQ'; - } - elsif ($gateway->isa('WebGUI::Shop::PayDriver::PayPal::ExpressCheckout')) { - $properties->{summaryTemplateId} = 'GqnZPB0gLoZmqQzYFaq7bg'; - } - else { - die "Unknown payment driver type found. Unable to automatically upgrade.\n"; - } - $gateway->update($properties); - } - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Changes sortItems to a SelectBox -sub modifySortItems { - my $session = shift; - print "\tUpdating SyndicatedContent...\n" unless $quiet; - - require WebGUI::Form::SelectBox; - - print "\t\tModifying table...\n" unless $quiet; - my $type = WebGUI::Form::SelectBox->getDatabaseFieldType; - $session->db->write("ALTER TABLE SyndicatedContent MODIFY sortItems $type"); - - print "\t\tConverting old values..." unless $quiet; - $session->db->write(q{ - UPDATE SyndicatedContent - SET sortItems = 'none' - WHERE sortItems <> '1' - }); - $session->db->write(q{ - UPDATE SyndicatedContent - SET sortItems = 'pubDate_des' - WHERE sortItems = '1' - }); - - # and here's our code - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Adds setting which allows users to set whether or not to send reject notices -sub addRejectNoticeSetting { - my $session = shift; - print "\tAdding reject notice setting... " unless $quiet; - $session->setting->add('sendRejectNotice',1); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub installNewCSUnsubscribeTemplate { - my $session = shift; - print "\tAdding new unsubscribe template to the CS... " unless $quiet; - $session->db->write(q|ALTER TABLE Collaboration ADD COLUMN unsubscribeTemplateId CHAR(22) NOT NULL|); - $session->db->write(q|UPDATE Collaboration set unsubscribeTemplateId='default_CS_unsubscribe'|); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Add keys and indicies to groupGroupings to help speed up group queries -sub addIndexForInbox { - my $session = shift; - print "\tAdding index to inbox_messageState... " unless $quiet; - my $sth = $session->db->read('show create table inbox_messageState'); - my ($field,$stmt) = $sth->array; - $sth->finish; - unless ($stmt =~ m/KEY `userId_deleted_isRead`/i) { - $session->db->write("alter table inbox_messageState add index userId_deleted_isRead (userId,deleted,isRead)"); - } - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Add twitter auth and macro -sub addTwitterAuth { - my $session = shift; - print "\tAdding twitter auth method... " unless $quiet; - - $session->config->addToArray( 'authMethods', 'Twitter' ); - $session->config->addToHash( 'macros', "TwitterLogin" => "TwitterLogin" ); - $session->setting->set( 'twitterEnabled', 0 ); - $session->setting->set( 'twitterTemplateIdChooseUsername', 'mfHGkp6t9gdclmzN33OEnw' ); - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Move Template attachments to JSON collateral -sub migrateAttachmentsToJson { - my $session = shift; - print "\tMoving template attachments to JSON... " unless $quiet; - # and here's our code - $session->db->write( - "ALTER TABLE template ADD attachmentsJson LONGTEXT" - ); - - my $attach; # hashref (template) of hashrefs (revisionDate) - # of arrayrefs (attachments) of hashrefs (attachment) - my $sth = $session->db->read( "SELECT * FROM template_attachments" ); - while ( my $row = $sth->hashRef ) { - push @{ $attach->{ $row->{templateId} }{ $row->{revisionDate} } }, { - url => $row->{url}, - type => $row->{type}, - }; - } - - for my $templateId ( keys %{ $attach } ) { - for my $revisionDate ( keys %{ $attach->{$templateId} } ) { - my $data = $attach->{$templateId}{$revisionDate}; - my $asset = WebGUI::Asset->newByDynamicClass( $session, $templateId, $revisionDate ); - $asset->update({ attachmentsJson => JSON->new->encode( $data ) }); - } - } - - $session->db->write( - "DROP TABLE template_attachments" - ); - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub alterStoryArchiveTable { - my $session = shift; - print "\tAdd story sort order column to the StoryAcrhive table... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `StoryArchive`'); - while (my ($col) = $sth->array) { - if ($col eq 'storySortOrder') { - print "Skipped.\n" unless $quiet; - return; - } - } - - $session->db->write("ALTER TABLE StoryArchive ADD COLUMN storySortOrder CHAR(22)"); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub alterStoryTopicTable { - my $session = shift; - print "\tAdd story sort order column to the StoryTopic table... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `StoryTopic`'); - while (my ($col) = $sth->array) { - if ($col eq 'storySortOrder') { - print "Skipped.\n" unless $quiet; - return; - } - } - - $session->db->write("ALTER TABLE StoryTopic ADD COLUMN storySortOrder CHAR(22)"); - $session->db->write("UPDATE StoryTopic SET storySortOrder = 'Chronologically' WHERE storySortOrder IS NULL"); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub addAssetReport { - my $session = shift; - print "\tAdding Asset Report Asset ... " unless $quiet; - - #Add the database table - $session->db->write(q{ - CREATE TABLE `AssetReport` ( - `assetId` char(22) character set utf8 collate utf8_bin NOT NULL, - `revisionDate` bigint(20) NOT NULL, - `settings` mediumtext, - `templateId` char(22) character set utf8 collate utf8_bin default NULL, - `paginateAfter` bigint(20) default NULL, - PRIMARY KEY (`assetId`,`revisionDate`) - ) - }); - - #Add the asset to the config file - $session->config->addToHash( "assets", "WebGUI::Asset::Wobject::AssetReport", { category => "utilities" } ); - - print "DONE!\n" unless $quiet; -} - - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - print "\tUpdating packages.\n" unless ($quiet); - addPackage( $session, 'packages-7.8.24-7.9.11/merged.wgpkg' ); -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.0-7.9.1.pl b/docs/upgrades/upgrade_7.9.0-7.9.1.pl deleted file mode 100644 index 0971fd390..000000000 --- a/docs/upgrades/upgrade_7.9.0-7.9.1.pl +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = '7.9.1'; -my $quiet; # this line required - - -my $session = start(); # this line required -addDeactivateAccountTemplateSettings($session); - -# upgrade functions go here - -finish($session); # this line required - -#---------------------------------------------------------------------------- -# Describe what our function does -sub addDeactivateAccountTemplateSettings { - my $session = shift; - print "\tAdd settings for deactivate account... " unless $quiet; - # and here's our code - $session->setting->add('webguiDeactivateAccountTemplate', 'zaHUYsE_PgKk8hnVd8ffEQ'); - $session->db->write(<db->write(<createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.1-7.9.2.pl b/docs/upgrades/upgrade_7.9.1-7.9.2.pl deleted file mode 100644 index 0fcae01e2..000000000 --- a/docs/upgrades/upgrade_7.9.1-7.9.2.pl +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = '7.9.2'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -addSortItemsSCColumn($session); -removeTranslationCruft($session); -addExtensionWorkflow($session); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -sub removeTranslationCruft { - my $session = shift; - print "\tRemoving files left over from unpacking translations... " unless $quiet; - # and here's our code - unlink File::Spec->catfile($webguiRoot, qw/lib WebGUi i18n Spanish .pm/); - unlink File::Spec->catfile($webguiRoot, qw/lib WebGUi i18n Dutch .DS_Store/); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub addExtensionWorkflow { - print "\tAdding calendar event extension to weekly maintenence..." - unless $quiet; - my $workflow = WebGUI::Workflow->new($session, 'pbworkflow000000000002'); - my $activity = $workflow->addActivity('WebGUI::Workflow::Activity::ExtendCalendarRecurrences'); - $activity->set(title => 'Extend Calendar Recurrences'); - $activity->set(description => 'Create events for live recurrences up to two years from the current date'); - print "Done\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub addSortItemsSCColumn { - my $session = shift; - print "\tAdding sort items switch to Syndicated Content... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `SyndicatedContent`'); - while (my ($col) = $sth->array) { - if ($col eq 'sortItems') { - print "Skipped.\n" unless $quiet; - return; - } - } - $session->db->write('ALTER TABLE SyndicatedContent ADD COLUMN sortItems BOOL DEFAULT 1'); - - print "Done.\n" unless $quiet; -} - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.10-7.9.11.pl b/docs/upgrades/upgrade_7.9.10-7.9.11.pl deleted file mode 100644 index 8276f9a1c..000000000 --- a/docs/upgrades/upgrade_7.9.10-7.9.11.pl +++ /dev/null @@ -1,168 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = '7.9.11'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -alterStoryTopicTable($session); -addAssetReport($session); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub addAssetReport { - my $session = shift; - print "\tAdding Asset Report Asset ... " unless $quiet; - - #Add the database table - $session->db->write(q{ - CREATE TABLE `AssetReport` ( - `assetId` char(22) character set utf8 collate utf8_bin NOT NULL, - `revisionDate` bigint(20) NOT NULL, - `settings` mediumtext, - `templateId` char(22) character set utf8 collate utf8_bin default NULL, - `paginateAfter` bigint(20) default NULL, - PRIMARY KEY (`assetId`,`revisionDate`) - ) - }); - - #Add the asset to the config file - $session->config->addToHash( "assets", "WebGUI::Asset::Wobject::AssetReport", { category => "utilities" } ); - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub alterStoryTopicTable { - my $session = shift; - print "\tAdd story sort order column to the StoryTopic table... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `StoryTopic`'); - while (my ($col) = $sth->array) { - if ($col eq 'storySortOrder') { - print "Skipped.\n" unless $quiet; - return; - } - } - - $session->db->write("ALTER TABLE StoryTopic ADD COLUMN storySortOrder CHAR(22)"); - $session->db->write("UPDATE StoryTopic SET storySortOrder = 'Chronologically' WHERE storySortOrder IS NULL"); - print "DONE!\n" unless $quiet; -} - - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.11-7.9.12.pl b/docs/upgrades/upgrade_7.9.11-7.9.12.pl deleted file mode 100644 index 6357df4c6..000000000 --- a/docs/upgrades/upgrade_7.9.11-7.9.12.pl +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = '7.9.12'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.12-7.9.13.pl b/docs/upgrades/upgrade_7.9.13-7.10.0.pl similarity index 99% rename from docs/upgrades/upgrade_7.9.12-7.9.13.pl rename to docs/upgrades/upgrade_7.9.13-7.10.0.pl index 50500fd37..8e2492a01 100644 --- a/docs/upgrades/upgrade_7.9.12-7.9.13.pl +++ b/docs/upgrades/upgrade_7.9.13-7.10.0.pl @@ -24,7 +24,7 @@ use WebGUI::Storage; use WebGUI::Asset; -my $toVersion = '7.9.13'; +my $toVersion = '7.10.0'; my $quiet; # this line required diff --git a/docs/upgrades/upgrade_7.9.13-7.9.14.pl b/docs/upgrades/upgrade_7.9.13-7.9.14.pl deleted file mode 100644 index 976b32980..000000000 --- a/docs/upgrades/upgrade_7.9.13-7.9.14.pl +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = '7.9.14'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.2-7.9.3.pl b/docs/upgrades/upgrade_7.9.2-7.9.3.pl deleted file mode 100644 index 501ea26e2..000000000 --- a/docs/upgrades/upgrade_7.9.2-7.9.3.pl +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = '7.9.3'; -my $quiet; # this line required - - -my $session = start(); # this line required - -reindexSiteForDefaultSynopsis( $session ); -addTopLevelWikiKeywords( $session ); -renameMapPointStateColumn( $session ); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -sub renameMapPointStateColumn { - my $session = shift; - print "\tRename the MapPoint column state to region... " unless $quiet; - - $session->db->write('ALTER TABLE MapPoint CHANGE state region char(35)'); - - print "Done.\n" unless $quiet; -} - - -#---------------------------------------------------------------------------- -sub addTopLevelWikiKeywords { - my $session = shift; - print "\tAdding top level keywords page to WikiMaster... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `WikiMaster`'); - while (my ($col) = $sth->array) { - if ($col eq 'topLevelKeywords') { - print "Skipped.\n" unless $quiet; - return; - } - } - $session->db->write('ALTER TABLE WikiMaster ADD COLUMN topLevelKeywords LONGTEXT'); - - print "Done.\n" unless $quiet; -} - - -#---------------------------------------------------------------------------- -# Reindex the site to clear out default synopsis -sub reindexSiteForDefaultSynopsis { - my $session = shift; - print "\tRe-indexing site to clear out default synopses... " unless $quiet; - - my $rs = $session->db->read("select assetId, className from asset where state='published'"); - my @searchableAssetIds; - while (my ($id, $class) = $rs->array) { - my $asset = WebGUI::Asset->new($session,$id,$class); - if (defined $asset && $asset->get("state") eq "published" && ($asset->get("status") eq "approved" || $asset->get("status") eq "archived")) { - $asset->indexContent; - push (@searchableAssetIds, $id); - } - } - - # delete indexes of assets that are no longer searchable - my $list = $session->db->quoteAndJoin(\@searchableAssetIds) if scalar(@searchableAssetIds); - $session->db->write("delete from assetIndex where assetId not in (".$list.")") if $list; - - print "DONE!\n" unless $quiet; -} - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.3-7.9.4.pl b/docs/upgrades/upgrade_7.9.3-7.9.4.pl deleted file mode 100644 index 872edf45d..000000000 --- a/docs/upgrades/upgrade_7.9.3-7.9.4.pl +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; -use WebGUI::Asset::WikiPage; -use WebGUI::Exception; -use WebGUI::Shop::Pay; -use WebGUI::Utility qw/isIn/; - - -my $toVersion = '7.9.4'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -addWikiSubKeywords($session); -addSynopsistoEachWikiPage($session); -dropVisitorAddressBooks($session); -alterCartTable($session); -alterAddressBookTable($session); -addWizardHandler( $session ); -addTemplateExampleImage( $session ); -addPayDriverTemplates( $session ); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -# Add example images to templates -sub addTemplateExampleImage { - my $session = shift; - print "\tAdding example image field to template... " unless $quiet; - - $session->db->write( q{ - ALTER TABLE template ADD storageIdExample CHAR(22) - } ); - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- - -sub addWizardHandler { - my ( $sesssion ) = @_; - print "\tAdding WebGUI::Wizard... " unless $quiet; - - if ( !grep { $_ eq 'WebGUI::Content::Wizard' } @{$session->config->get('contentHandlers')} ) { - # Find the place of Operation and add before - my @handlers = (); - for my $handler ( @{$session->config->get('contentHandlers')} ) { - if ( $handler eq 'WebGUI::Content::Operation' ) { - push @handlers, 'WebGUI::Content::Wizard'; - } - push @handlers, $handler; - } - $session->config->set('contentHandlers',\@handlers); - } - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub addWikiSubKeywords { - my $session = shift; - print "\tAdd the WikiMaster sub-keywords table... " unless $quiet; - # and here's our code - $session->db->write(<getIsa($session); - PAGE: while (1) { - my $page = eval {$pager->()}; - next PAGE if Exception::Class->caught(); - last PAGE unless $page; - my ($synopsis) = $page->getSynopsisAndContent(undef, $page->get('content')); - $page->update({synopsis => $synopsis}); - } - # and here's our code - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub dropVisitorAddressBooks { - my $session = shift; - print "\tDrop AddressBooks owned by Visitor... " unless $quiet; - my $sth = $session->db->read(q|SELECT addressBookId FROM addressBook where userId='1'|); - BOOK: while (my ($addressBookId) = $sth->array) { - my $book = eval { WebGUI::Shop::AddressBook->new($session, $addressBookId); }; - next BOOK if Exception::Class->caught(); - $book->delete; - } - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub alterAddressBookTable { - my $session = shift; - print "\tDrop sessionId from the Address Book database table... " unless $quiet; - # and here's our code - $session->db->write("ALTER TABLE addressBook DROP COLUMN sessionId"); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub alterCartTable { - my $session = shift; - print "\tAdd billing address column to the Cart table... " unless $quiet; - # and here's our code - $session->db->write("ALTER TABLE cart ADD COLUMN billingAddressId CHAR(22)"); - $session->db->write("ALTER TABLE cart ADD COLUMN gatewayId CHAR(22)"); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub addPayDriverTemplates { - my $session = shift; - print "\tAdd templates to the Payment Drivers that need them... " unless $quiet; - # and here's our code - my $pay = WebGUI::Shop::Pay->new($session); - my @gateways = @{ $pay->getPaymentGateways }; - GATEWAY: foreach my $gateway (@gateways) { - next GATEWAY unless $gateway; - my $properties = $gateway->get; - if ($gateway->isa('WebGUI::Shop::PayDriver::Cash')) { - $properties->{summaryTemplateId} = '30h5rHxzE_Q0CyI3Gg7EJw'; - } - elsif ($gateway->isa('WebGUI::Shop::PayDriver::ITransact')) { - ##Nothing to do. This template was only changed, not added. - } - elsif ($gateway->isa('WebGUI::Shop::PayDriver::Ogone')) { - $properties->{summaryTemplateId} = 'jysVZeUR0Bx2NfrKs5sulg'; - } - elsif ($gateway->isa('WebGUI::Shop::PayDriver::PayPal::PayPalStd')) { - $properties->{summaryTemplateId} = '300AozDaeveAjB_KN0ljlQ'; - } - elsif ($gateway->isa('WebGUI::Shop::PayDriver::PayPal::ExpressCheckout')) { - $properties->{summaryTemplateId} = 'GqnZPB0gLoZmqQzYFaq7bg'; - } - else { - warn "Unknown payment driver type found. Unable to automatically upgrade.\n"; - next GATEWAY; - } - $gateway->update($properties); - } - print "DONE!\n" unless $quiet; -} - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - - my $pay = WebGUI::Shop::Pay->new($session); - my @gateways = @{ $pay->getPaymentGateways }; - GATEWAY: foreach my $gateway (@gateways) { - next GATEWAY unless $gateway; - if (! isIn ($gateway->className, qw/WebGUI::Shop::PayDriver::Cash WebGUI::Shop::PayDriver::Ogone WebGUI::Shop::PayDriver::ITransact WebGUI::Shop::PayDriver::PayPal::PayPalStd WebGUI::Shop::PayDriver::PayPal::ExpressCheckout/) ) { - $session->close; - die "Custom payment driver found:".$gateway->className.". Please read the gotchas.txt file and the POD in WebGUI::Shop::PayDriver on how to update it for the new Cart. Then, you can safely disable this check.\n"; - } - } - - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.4-7.9.5.pl b/docs/upgrades/upgrade_7.9.4-7.9.5.pl deleted file mode 100644 index aa4e30434..000000000 --- a/docs/upgrades/upgrade_7.9.4-7.9.5.pl +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; -use WebGUI::Workflow::Instance; - - -my $toVersion = '7.9.5'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -modifySortItems( $session ); -fixRequestForApprovalScratch($session); -addRejectNoticeSetting($session); -updateGroupGroupingsTable($session); -installNewCSUnsubscribeTemplate($session); - -finish($session); # this line required - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -# Adds setting which allows users to set whether or not to send reject notices -sub addRejectNoticeSetting { - my $session = shift; - print "\tAdding reject notice setting... " unless $quiet; - $session->setting->add('sendRejectNotice',1); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -sub installNewCSUnsubscribeTemplate { - my $session = shift; - print "\tAdding new unsubscribe template to the CS... " unless $quiet; - $session->db->write(q|ALTER TABLE Collaboration ADD COLUMN unsubscribeTemplateId CHAR(22) NOT NULL|); - $session->db->write(q|UPDATE Collaboration set unsubscribeTemplateId='default_CS_unsubscribe'|); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Add keys and indicies to groupGroupings to help speed up group queries -sub updateGroupGroupingsTable { - my $session = shift; - print "\tAdding primary key and indicies to groupGroupings table... " unless $quiet; - my $sth = $session->db->read('show create table groupGroupings'); - my ($field,$stmt) = $sth->array; - $sth->finish; - unless ($stmt =~ m/PRIMARY KEY/i) { - # clean up duplicates that would prevent applying a primary key - my $rs = $session->db->read(q{ - select count(*) as num, groupId, inGroup - from groupGroupings - group by groupId, inGroup - having num > 1 - }); - my $dupSth = $session->db->prepare("delete from groupGroupings where groupId = ? and inGroup = ? limit ?"); - while (my ($num, $groupId, $inGroup) = $rs->array) { - $dupSth->execute([$groupId, $inGroup, $num-1]); - } - $dupSth->finish; - # add the primary key - $session->db->write("alter table groupGroupings add primary key (groupId,inGroup)"); - } - unless ($stmt =~ m/KEY `inGroup`/i) { - $session->db->write("alter table groupGroupings add index inGroup (inGroup)"); - } - print "DONE!\n" unless $quiet; -} - - -#---------------------------------------------------------------------------- -# Describe what our function does -sub fixRequestForApprovalScratch { - my $session = shift; - print "\tCorrect RequestApprovalForVersionTag workflow instance data with leading commas... " unless $quiet; - # and here's our code - my $instances = WebGUI::Workflow::Instance->getAllInstances($session); - INSTANCE: foreach my $instance (@{ $instances }) { - my $messageId = $instance->getScratch('messageId'); - next INSTANCE unless $messageId; - $messageId =~ s/^,//; - $instance->setScratch('messageId', $messageId); - } - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Changes sortItems to a SelectBox -sub modifySortItems { - my $session = shift; - print "\tUpdating SyndicatedContent...\n" unless $quiet; - - require WebGUI::Form::SelectBox; - - print "\t\tModifying table...\n" unless $quiet; - my $type = WebGUI::Form::SelectBox->getDatabaseFieldType; - $session->db->write("ALTER TABLE SyndicatedContent MODIFY sortItems $type"); - - print "\t\tConverting old values..." unless $quiet; - $session->db->write(q{ - UPDATE SyndicatedContent - SET sortItems = 'none' - WHERE sortItems <> '1' - }); - $session->db->write(q{ - UPDATE SyndicatedContent - SET sortItems = 'pubDate_des' - WHERE sortItems = '1' - }); - - # and here's our code - print "DONE!\n" unless $quiet; -} - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.5-7.9.6.pl b/docs/upgrades/upgrade_7.9.5-7.9.6.pl deleted file mode 100644 index 6c382052d..000000000 --- a/docs/upgrades/upgrade_7.9.5-7.9.6.pl +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = '7.9.6'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -fixConvertUTCMacroName($session); -dropOldEMSTableColumn($session); -addIndexForInbox($session); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -# Add keys and indicies to groupGroupings to help speed up group queries -sub addIndexForInbox { - my $session = shift; - print "\tAdding index to inbox_messageState... " unless $quiet; - my $sth = $session->db->read('show create table inbox_messageState'); - my ($field,$stmt) = $sth->array; - $sth->finish; - unless ($stmt =~ m/KEY `userId_deleted_isRead`/i) { - $session->db->write("alter table inbox_messageState add index userId_deleted_isRead (userId,deleted,isRead)"); - } - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub fixConvertUTCMacroName { - my $session = shift; - print "\tFix the name of the ConvertUTCToTZ macro in the config file... " unless $quiet; - $session->config->deleteFromHash('macros', 'ConvertToUTC'); - $session->config->addToHash('macros', 'ConvertUTCToTZ', 'ConvertUTCToTZ'); - # and here's our code - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub dropOldEMSTableColumn { - my $session = shift; - print "\tDrop an old column from the EventMangementSystem table that is no longer used... " unless $quiet; - $session->db->write(q|ALTER TABLE EventManagementSystem DROP COLUMN groupToApproveEvents|); - # and here's our code - print "DONE!\n" unless $quiet; -} - - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.6-7.9.7.pl b/docs/upgrades/upgrade_7.9.6-7.9.7.pl deleted file mode 100644 index ea35f7b0a..000000000 --- a/docs/upgrades/upgrade_7.9.6-7.9.7.pl +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; -use WebGUI::Asset::Wobject::Collaboration; -use WebGUI::Exception; -use WebGUI::Workflow::Cron; -use WebGUI::Utility qw/isIn/; - - -my $toVersion = '7.9.7'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -restoreDefaultCronJobs($session); -restoreCsCronJobs($session); -cleanup_inbox_messageStateTable($session); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub cleanup_inbox_messageStateTable { - my $session = shift; - print "\tDelete dead entries from the inbox_MessageState table. This may take a long time... " unless $quiet; - # and here's our code - my $source = $session->db->read("select messageId from inbox_messageState s where not exists(select messageId from inbox where messageId = s.messageId)"); - my $cleaner = $session->db->prepare("delete from inbox_messageState where messageId=?"); - while (my ($messageId) = $source->array) { - $cleaner->execute([$messageId]); - } - $source->finish; - $cleaner->finish; - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub restoreDefaultCronJobs { - my $session = shift; - # and here's our code - print "\tRestore missing default cron jobs that may have been deleted... " unless $quiet; - my $tasks = WebGUI::Workflow::Cron->getAllTasks($session); - my @taskIds = map { $_->getId } @{ $tasks }; - if (! isIn('pbcron0000000000000001', @taskIds)) { - print "\n\t\tRestoring Daily Maintenance Task... " unless $quiet; - WebGUI::Workflow::Cron->create($session, { - title => "Daily Maintenance", dayOfMonth => '*', - enabled => 1, monthOfYear => '*', - runOnce => 0, dayOfWeek => '*', - minuteOfHour => 30, workflowId => 'pbworkflow000000000001', - hourOfDay => 23, priority => 3, - }, - 'pbcron0000000000000001'); - } - if (! isIn('pbcron0000000000000002', @taskIds)) { - print "\n\t\tRestoring Weekly Maintenance Task... " unless $quiet; - WebGUI::Workflow::Cron->create($session, { - title => "Weekly Maintenance", dayOfMonth => '*', - enabled => 1, monthOfYear => '*', - runOnce => 0, dayOfWeek => '0', - minuteOfHour => 30, workflowId => 'pbworkflow000000000002', - hourOfDay => 1, priority => 3, - }, - 'pbcron0000000000000002'); - } - if (! isIn('pbcron0000000000000003', @taskIds)) { - print "\n\t\tRestoring Hourly Maintenance Task... " unless $quiet; - WebGUI::Workflow::Cron->create($session, { - title => "Hourly Maintenance", dayOfMonth => '*', - enabled => 1, monthOfYear => '*', - runOnce => 0, dayOfWeek => '*', - minuteOfHour => 15, workflowId => 'pbworkflow000000000004', - hourOfDay => '*', priority => 3, - }, - 'pbcron0000000000000003'); - } - if (! isIn('pbcron0000000000000004', @taskIds)) { - print "\n\t\tRestoring Email Delivery Task... " unless $quiet; - WebGUI::Workflow::Cron->create($session, { - title => "Send Queued Email Messages Every 5 Minutes", - dayOfMonth => '*', - enabled => 1, monthOfYear => '*', - runOnce => 0, dayOfWeek => '*', - minuteOfHour => '*/5', workflowId => 'pbworkflow000000000007', - hourOfDay => '*', priority => 3, - }, - 'pbcron0000000000000004'); - } - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub restoreCsCronJobs { - my $session = shift; - print "\tRestore missing Collaboration System cron jobs that may have been deleted... " unless $quiet; - my $i18n = WebGUI::International->new($session, "Asset_Collaboration"); - my $getCs = WebGUI::Asset::Wobject::Collaboration->getIsa($session); - CS: while (1) { - my $cs = eval { $getCs->(); }; - if (my $e = Exception::Class->caught()) { - $session->log->error($@); - next CS; - } - last CS unless $cs; - ##Do something useful with $product - my $cron = undef; - if ($cs->get("getMailCronId")) { - $cron = WebGUI::Workflow::Cron->new($session, $cs->get("getMailCronId")); - } - next CS if $cron; - $cron = WebGUI::Workflow::Cron->create($session, { - title => $cs->getTitle." ".$i18n->get("mail"), - minuteOfHour => "*/".($cs->get("getMailInterval")/60), - className => (ref $cs), - methodName => "new", - parameters => $cs->getId, - workflowId => "csworkflow000000000001" - }); - $cs->update({getMailCronId=>$cron->getId}); - if ($cs->get("getMail")) { - $cron->set({enabled=>1,title=>$cs->getTitle." ".$i18n->get("mail"), minuteOfHour=>"*/".($cs->get("getMailInterval")/60)}); - } else { - $cron->set({enabled=>0,title=>$cs->getTitle." ".$i18n->get("mail"), minuteOfHour=>"*/".($cs->get("getMailInterval")/60)}); - } - - } - print "DONE!\n" unless $quiet; -} - - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.7-7.9.8.pl b/docs/upgrades/upgrade_7.9.7-7.9.8.pl deleted file mode 100644 index 5a9b7280b..000000000 --- a/docs/upgrades/upgrade_7.9.7-7.9.8.pl +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; -use WebGUI::Asset::Wobject::Collaboration; -use WebGUI::Asset::Post::Thread; -use WebGUI::ProfileField; - -my $toVersion = '7.9.8'; -my $quiet; # this line required - -my $session = start(); # this line required - -# upgrade functions go here -changeFirstDayOfWeekDefault($session); -updateLastPostCS($session); -updateLastPostThread($session); -addTwitterAuth( $session ); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -# Add twitter auth and macro -sub addTwitterAuth { - my $session = shift; - print "\tAdding twitter auth method... " unless $quiet; - - $session->config->addToArray( 'authMethods', 'Twitter' ); - $session->config->addToHash( 'macros', "TwitterLogin" => "TwitterLogin" ); - $session->setting->set( 'twitterEnabled', 0 ); - $session->setting->set( 'twitterTemplateIdChooseUsername', 'mfHGkp6t9gdclmzN33OEnw' ); - - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub changeFirstDayOfWeekDefault { - my $session = shift; - print "\tMake the default for firstDayOfWeek a number instead of a string... " unless $quiet; - # and here's our code - my $profileField = WebGUI::ProfileField->new($session, 'firstDayOfWeek'); - my $properties = $profileField->get(); - $properties->{dataDefault} = 0; - $profileField->set($properties); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub updateLastPostCS { - my $session = shift; - print "\tUpdating last post information in every Collaboration System. This could take a very long time... " unless $quiet; - # and here's our code - my $getCs = WebGUI::Asset::Wobject::Collaboration->getIsa($session); - CS: while (my $cs = eval { $getCs->() } ) { - next CS if Exception::Class->caught(); - last CS if ! $cs; - next CS unless $cs->get('lastPostId'); - my $lastPost = WebGUI::Asset->newByDynamicClass($session, $cs->get('lastPostId')); - next CS unless $lastPost && $lastPost->get('status') eq 'archived'; - $lastPost->disqualifyAsLastPost; - } - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub updateLastPostThread { - my $session = shift; - print "\tUpdating last post information in every Thread. This could also take a very long time... " unless $quiet; - # and here's our code - my $getThread = WebGUI::Asset::Wobject::Collaboration->getIsa($session); - THREAD: while (my $thread = eval { $getThread->() } ) { - next THREAD if Exception::Class->caught(); - last THREAD if ! $thread; - next THREAD unless $thread->get('lastPostId'); - my $lastPost = WebGUI::Asset->newByDynamicClass($session, $thread->get('lastPostId')); - next THREAD unless $lastPost && $lastPost->get('status') eq 'archived'; - $lastPost->disqualifyAsLastPost; - } - print "DONE!\n" unless $quiet; -} - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.8-7.9.9.pl b/docs/upgrades/upgrade_7.9.8-7.9.9.pl deleted file mode 100644 index 4a8d1e8b3..000000000 --- a/docs/upgrades/upgrade_7.9.8-7.9.9.pl +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; -use WebGUI::ProfileField; - - -my $toVersion = '7.9.9'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -addIndexToUserSessionLog($session); -addHeightToCarousel($session); -synchronizeUserProfileTables($session); - -finish($session); # this line required - - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub addIndexToUserSessionLog { - my $session = shift; - print "\tAdd index to UserSessionLogTable... " unless $quiet; - $session->db->write(q|alter table userLoginLog add index sessionId (sessionId)|); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub addHeightToCarousel { - my $session = shift; - print "\tAdd slide height to Carousel... " unless $quiet; - $session->db->write(q|alter table Carousel add column slideHeight int(11)|); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub synchronizeUserProfileTables { - my $session = shift; - print "\tMake sure that userProfileField, and userProfileData tables are aligned correctly... " unless $quiet; - my $dbh = $session->db->dbh; - my $fields = WebGUI::ProfileField->getFields($session); - foreach my $field ( @{ $fields } ) { - my $columnInfo = $dbh->column_info(undef, undef, 'userProfileData', $field->getId)->fetchrow_hashref(); - if (! $columnInfo) { - printf "\n\t\tDeleting broken field: %s", $field->getId; - $session->db->deleteRow('userProfileField', 'fieldName', $field->getId); - } - } - - print " ...DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Move Template attachments to JSON collateral -sub migrateAttachmentsToJson { - my $session = shift; - print "\tMoving template attachments to JSON... " unless $quiet; - # and here's our code - $session->db->write( - "ALTER TABLE template ADD attachmentsJson LONGTEXT" - ); - - my $attach; # hashref (template) of hashrefs (revisionDate) - # of arrayrefs (attachments) of hashrefs (attachment) - my $sth = $session->db->read( "SELECT * FROM template_attachments" ); - while ( my $row = $sth->hashRef ) { - push @{ $attach->{ $row->{templateId} }{ $row->{revisionDate} } }, { - url => $row->{url}, - type => $row->{type}, - }; - } - - for my $templateId ( keys %{ $attach } ) { - for my $revisionDate ( keys %{ $attach->{$templateId} } ) { - my $data = $attach->{$templateId}{$revisionDate}; - my $asset = WebGUI::Asset->newByDynamicClass( $session, $templateId, $revisionDate ); - $asset->update({ attachmentsJson => JSON->new->encode( $data ) }); - } - } - - $session->db->write( - "DROP TABLE template_attachments" - ); - - print "DONE!\n" unless $quiet; -} - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - migrateAttachmentsToJson( $session ); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/docs/upgrades/upgrade_7.9.9-7.9.10.pl b/docs/upgrades/upgrade_7.9.9-7.9.10.pl deleted file mode 100644 index caa3a5daa..000000000 --- a/docs/upgrades/upgrade_7.9.9-7.9.10.pl +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env perl - -#------------------------------------------------------------------- -# WebGUI is Copyright 2001-2009 Plain Black Corporation. -#------------------------------------------------------------------- -# Please read the legal notices (docs/legal.txt) and the license -# (docs/license.txt) that came with this distribution before using -# this software. -#------------------------------------------------------------------- -# http://www.plainblack.com info@plainblack.com -#------------------------------------------------------------------- - -our ($webguiRoot); - -BEGIN { - $webguiRoot = "../.."; - unshift (@INC, $webguiRoot."/lib"); -} - -use strict; -use Getopt::Long; -use WebGUI::Session; -use WebGUI::Storage; -use WebGUI::Asset; - - -my $toVersion = '7.9.10'; -my $quiet; # this line required - - -my $session = start(); # this line required - -# upgrade functions go here -addSpamStopWordsToConfig($session); -alterStoryArchiveTable($session); - -finish($session); # this line required - -#---------------------------------------------------------------------------- -# Describe what our function does -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about... " unless $quiet; -# # and here's our code -# print "DONE!\n" unless $quiet; -#} - - -#---------------------------------------------------------------------------- -# Describe what our function does -sub addSpamStopWordsToConfig { - my $session = shift; - print "\tAdd SPAM controls to config file... " unless $quiet; - # and here's our code - $session->config->set('spamStopWords', []); - print "DONE!\n" unless $quiet; -} - -#---------------------------------------------------------------------------- -# Describe what our function does -sub alterStoryArchiveTable { - my $session = shift; - print "\tAdd story sort order column to the StoryAcrhive table... " unless $quiet; - - my $sth = $session->db->read('DESCRIBE `StoryArchive`'); - while (my ($col) = $sth->array) { - if ($col eq 'storySortOrder') { - print "Skipped.\n" unless $quiet; - return; - } - } - - $session->db->write("ALTER TABLE StoryArchive ADD COLUMN storySortOrder CHAR(22)"); - print "DONE!\n" unless $quiet; -} - -# -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- - -#---------------------------------------------------------------------------- -# Add a package to the import node -sub addPackage { - my $session = shift; - my $file = shift; - - print "\tUpgrading package $file\n" unless $quiet; - # Make a storage location for the package - my $storage = WebGUI::Storage->createTemp( $session ); - $storage->addFileFromFilesystem( $file ); - - # Import the package into the import node - my $package = eval { - my $node = WebGUI::Asset->getImportNode($session); - $node->importPackage( $storage, { - overwriteLatest => 1, - clearPackageFlag => 1, - setDefaultTemplate => 1, - } ); - }; - - if ($package eq 'corrupt') { - die "Corrupt package found in $file. Stopping upgrade.\n"; - } - if ($@ || !defined $package) { - die "Error during package import on $file: $@\nStopping upgrade\n."; - } - - return; -} - -#------------------------------------------------- -sub start { - my $configFile; - $|=1; #disable output buffering - GetOptions( - 'configFile=s'=>\$configFile, - 'quiet'=>\$quiet - ); - my $session = WebGUI::Session->open($webguiRoot,$configFile); - $session->user({userId=>3}); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->set({name=>"Upgrade to ".$toVersion}); - return $session; -} - -#------------------------------------------------- -sub finish { - my $session = shift; - updateTemplates($session); - my $versionTag = WebGUI::VersionTag->getWorking($session); - $versionTag->commit; - $session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".time().")"); - $session->close(); -} - -#------------------------------------------------- -sub updateTemplates { - my $session = shift; - return undef unless (-d "packages-".$toVersion); - print "\tUpdating packages.\n" unless ($quiet); - opendir(DIR,"packages-".$toVersion); - my @files = readdir(DIR); - closedir(DIR); - my $newFolder = undef; - foreach my $file (@files) { - next unless ($file =~ /\.wgpkg$/); - # Fix the filename to include a path - $file = "packages-" . $toVersion . "/" . $file; - addPackage( $session, $file ); - } -} - -#vim:ft=perl diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 56f1923a4..e1a28339e 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,8 +1,8 @@ package WebGUI; -our $VERSION = '7.9.14'; -our $STATUS = 'stable'; +our $VERSION = '7.10.0'; +our $STATUS = 'beta'; =head1 LEGAL