diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index d30926f30..68687be49 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -3,9 +3,6 @@ - added an epochDate field to the template for CS RSS items. The ^D(); macro can then format the epoch date. - fixed: actove admin console tab isn't highlighted - - fixed: Folders are cached by the client too long for visitors - - added variant id template variable to product variant loop - - fixed: editting DataForm email fields resets their name - no longer preloads files that start with . - rfe: let package import inherit permissions - added fieldsets around form controls with multiple elements @@ -22,50 +19,21 @@ - fixed: AssetProxy allows proxying content in the trash or clipboard - fixed: Textarea resizer has a gap between textbox and resizer initially - added: getLineageIterator method to simplify working on large sets of assets - - fixed: Syndicated Content doesn't decode alternate character sets - - fixed: Some templates ship with isPublic=1 - - fixed: DataForm export tab delimited doesn't work - - fixed: Project Manager sometimes causes errors when adding users to a task - - fixed: site navigation will sometimes show as half or not styled - - fixed: after editting assets from the asset manager, it returns to site instead of manager - improved Rich Text selection list, changed CS and Wiki to use it - - fixed: invalid HTML generated for Shortcut overrides tab - - fixed: copying or duplicating an asset in the asset manager never autocommits - - fixed: Server side spell checker errors when checking text with single quotes - remove Do Nothing On Delete workflow and allow none to be selected for on delete etc workflow - remove remnants of realtime workflow selection code - - fixed: Asset view time format problem - - fixed: DataForm doesn't work properly with internationalized fields - - fixed: incoming data not properly decoded from utf8 - - fixed: Can't call method "getSku" on unblessed reference - - fixed: PurgeOldInboxMessages just didn't work - - fixed: Unable to delete data form entries - fixed: Select All checkbox in Asset Manager has returned - - fixed: DataForm Integer value zero does not pass validation - added: Page range (start-finish) to available paginator text - rfe: view profile - rfe: Shop: workflow warning for almost out of stock - - fixed: Show Message On Login continue link - - fixed: Show Message On Login doesn't show after anon registration - - fixed: Settings - Show Message On Login behaviour - - fixed: Page Layout templates generate invalid HTML with description - - fixed: Form/Integer now shows 0 in the results page - added: Email from field now prefixed with username - added: Inbox messages now tell you who the message was from - fixed: Reoccurring transactions now update the correct user id - - fixed: I need a template for this display - - fixed: If a user clicks on an unsubscribe link in an email and they are not logged into WebGUI, they are now prompted to log in so that they can then unsbscribe. - - fixed: Using a password recovery token a second time informs the user of the reuse instead of having a style inside a style with a login form. - fixed: Thingy Things can now have no fields and still be functional. - fixed: Can no longer buy badges from receipt or direct link page if quantity is empty - - fixed: Tickets on add to badge screen now show the time at the event's timezone - - It was possible to run multiple singleton workflows at the same time. - - fixed: WebGUI Password Recovery email subject hard-coded - rfe: Add url to list of attributes tracked in assetHistory - - fixed: Article now only allows 2 files to be uploaded - fixed: DataForms can now export all non-default fields - rfe: Search results now return with keywords highlighted. - - rfe: After committing a version there is now a back to site link - rfe: Added sort order to Folder assets - rfe: Added canEdit and canAddFile template vars to Folder assets - rfe: Add logged-in time to Login History @@ -81,20 +49,10 @@ - rfe: Registration form to keep user entries on error - required and errored fields are now highlighted. - added: Thingy view template now has access to field_dateCreated and field_lastUpdated for Things. - added: AssetManager now times out after 30 seconds on the AJAX call to load assets. This will help people realize they are having network issues. - - fixed: DatePicker.js can now use different first days of the week. - added: Default templates now show big warning message. All templates added via upgrade scripts are set to be a "default" template. - fixed: Utility script skeleton now more complete and less annoying - - fixed: HttpProxy parser now handles self-closing tags correctly - - fixed: HttpProxy parser now doesn't try to rewrite forms unless also rewriting URLs - - fixed: WebGUI::HTML->cleanSegment now also keeps if preserving script and style - rfe: Teach Thingy to be a Web Service (SDH Consulting Group) - - multiple default templates broken with prevent proxy caching - -7.5.22 - - fixed: Layout template now gets prepared correctly - - fixed: When user does not have permissions to search/edit a thing a proper error is shown. - - fixed: Thingy now requires at least 1 field for a new Thing. 7.5.21 - fixed: purchase detail screen shows incorrectly in Safari diff --git a/docs/upgrades/packages-7.5.22/default_emsbadge.wgpkg b/docs/upgrades/packages-7.5.22/default_emsbadge.wgpkg new file mode 100644 index 000000000..46e84a226 Binary files /dev/null and b/docs/upgrades/packages-7.5.22/default_emsbadge.wgpkg differ diff --git a/docs/upgrades/packages-7.6.0/default_page.wgpkg b/docs/upgrades/packages-7.5.22/default_page.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/default_page.wgpkg rename to docs/upgrades/packages-7.5.22/default_page.wgpkg diff --git a/docs/upgrades/packages-7.6.0/default_page_table.wgpkg b/docs/upgrades/packages-7.5.22/default_page_table.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/default_page_table.wgpkg rename to docs/upgrades/packages-7.5.22/default_page_table.wgpkg diff --git a/docs/upgrades/packages-7.6.0/import_hierarchical-top-nav.wgpkg b/docs/upgrades/packages-7.5.22/import_hierarchical-top-nav.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/import_hierarchical-top-nav.wgpkg rename to docs/upgrades/packages-7.5.22/import_hierarchical-top-nav.wgpkg diff --git a/docs/upgrades/packages-7.6.0/left_column.wgpkg b/docs/upgrades/packages-7.5.22/left_column.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/left_column.wgpkg rename to docs/upgrades/packages-7.5.22/left_column.wgpkg diff --git a/docs/upgrades/packages-7.6.0/left_column_table.wgpkg b/docs/upgrades/packages-7.5.22/left_column_table.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/left_column_table.wgpkg rename to docs/upgrades/packages-7.5.22/left_column_table.wgpkg diff --git a/docs/upgrades/packages-7.6.0/news_table.wgpkg b/docs/upgrades/packages-7.5.22/news_table.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/news_table.wgpkg rename to docs/upgrades/packages-7.5.22/news_table.wgpkg diff --git a/docs/upgrades/packages-7.6.0/one_over_three.wgpkg b/docs/upgrades/packages-7.5.22/one_over_three.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/one_over_three.wgpkg rename to docs/upgrades/packages-7.5.22/one_over_three.wgpkg diff --git a/docs/upgrades/packages-7.6.0/one_over_three_table.wgpkg b/docs/upgrades/packages-7.5.22/one_over_three_table.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/one_over_three_table.wgpkg rename to docs/upgrades/packages-7.5.22/one_over_three_table.wgpkg diff --git a/docs/upgrades/packages-7.6.0/plainblacknews.wgpkg b/docs/upgrades/packages-7.5.22/plainblacknews.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/plainblacknews.wgpkg rename to docs/upgrades/packages-7.5.22/plainblacknews.wgpkg diff --git a/docs/upgrades/packages-7.6.0/right_column.wgpkg b/docs/upgrades/packages-7.5.22/right_column.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/right_column.wgpkg rename to docs/upgrades/packages-7.5.22/right_column.wgpkg diff --git a/docs/upgrades/packages-7.6.0/right_column_table.wgpkg b/docs/upgrades/packages-7.5.22/right_column_table.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/right_column_table.wgpkg rename to docs/upgrades/packages-7.5.22/right_column_table.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_gallery.css.wgpkg b/docs/upgrades/packages-7.5.22/root_import_gallery-templates_gallery.css.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_gallery.css.wgpkg rename to docs/upgrades/packages-7.5.22/root_import_gallery-templates_gallery.css.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_shelf2_shelf.css.wgpkg b/docs/upgrades/packages-7.5.22/root_import_shelf2_shelf.css.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_shelf2_shelf.css.wgpkg rename to docs/upgrades/packages-7.5.22/root_import_shelf2_shelf.css.wgpkg diff --git a/docs/upgrades/packages-7.6.0/side_by_side.wgpkg b/docs/upgrades/packages-7.5.22/side_by_side.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/side_by_side.wgpkg rename to docs/upgrades/packages-7.5.22/side_by_side.wgpkg diff --git a/docs/upgrades/packages-7.6.0/side_by_side_table.wgpkg b/docs/upgrades/packages-7.5.22/side_by_side_table.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/side_by_side_table.wgpkg rename to docs/upgrades/packages-7.5.22/side_by_side_table.wgpkg diff --git a/docs/upgrades/packages-7.6.0/three_over_one.wgpkg b/docs/upgrades/packages-7.5.22/three_over_one.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/three_over_one.wgpkg rename to docs/upgrades/packages-7.5.22/three_over_one.wgpkg diff --git a/docs/upgrades/packages-7.6.0/three_over_one_table.wgpkg b/docs/upgrades/packages-7.5.22/three_over_one_table.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/three_over_one_table.wgpkg rename to docs/upgrades/packages-7.5.22/three_over_one_table.wgpkg diff --git a/docs/upgrades/packages-7.6.0/webgui7_style3_hierarchical-top-nav.wgpkg b/docs/upgrades/packages-7.5.22/webgui7_style3_hierarchical-top-nav.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/webgui7_style3_hierarchical-top-nav.wgpkg rename to docs/upgrades/packages-7.5.22/webgui7_style3_hierarchical-top-nav.wgpkg diff --git a/docs/upgrades/packages-7.5.23/default_product.wgpkg b/docs/upgrades/packages-7.5.23/default_product.wgpkg new file mode 100644 index 000000000..84ef0f169 Binary files /dev/null and b/docs/upgrades/packages-7.5.23/default_product.wgpkg differ diff --git a/docs/upgrades/packages-7.5.24/default_product.wgpkg b/docs/upgrades/packages-7.5.24/default_product.wgpkg new file mode 100644 index 000000000..6d8522c56 Binary files /dev/null and b/docs/upgrades/packages-7.5.24/default_product.wgpkg differ diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-add-archive.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-add-archive.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-add-archive.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-add-archive.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-delete-album.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-delete-album.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-delete-album.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-delete-album.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-delete-file.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-delete-file.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-delete-file.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-delete-file.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-edit-album.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-edit-album.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-edit-album.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-edit-album.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-edit-comment.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-edit-comment.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-edit-comment.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-edit-comment.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-edit-photo.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-edit-photo.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-edit-photo.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-edit-photo.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-list-albums-view.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-list-albums-view.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-list-albums-view.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-list-albums-view.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-list-files-for-user.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-list-files-for-user.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-list-files-for-user.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-list-files-for-user.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-search.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-search.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-search.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-search.wgpkg diff --git a/docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-view-photo.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-view-photo.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_gallery-templates_default-gallery-view-photo.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_gallery-templates_default-gallery-view-photo.wgpkg diff --git a/docs/upgrades/packages-7.5.24/root_import_gallery-templates_gallery.css.wgpkg b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_gallery.css.wgpkg new file mode 100644 index 000000000..e352d0b89 Binary files /dev/null and b/docs/upgrades/packages-7.5.24/root_import_gallery-templates_gallery.css.wgpkg differ diff --git a/docs/upgrades/packages-7.6.0/root_import_shelf-default.wgpkg b/docs/upgrades/packages-7.5.24/root_import_shelf-default.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/root_import_shelf-default.wgpkg rename to docs/upgrades/packages-7.5.24/root_import_shelf-default.wgpkg diff --git a/docs/upgrades/packages-7.6.0/templates_thingy-default-search-thing.wgpkg b/docs/upgrades/packages-7.5.24/templates_thingy-default-search-thing.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/templates_thingy-default-search-thing.wgpkg rename to docs/upgrades/packages-7.5.24/templates_thingy-default-search-thing.wgpkg diff --git a/docs/upgrades/packages-7.6.0/templates_thingy-default-view-thing.wgpkg b/docs/upgrades/packages-7.5.24/templates_thingy-default-view-thing.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/templates_thingy-default-view-thing.wgpkg rename to docs/upgrades/packages-7.5.24/templates_thingy-default-view-thing.wgpkg diff --git a/docs/upgrades/packages-7.6.0/templates_thingy-default.wgpkg b/docs/upgrades/packages-7.5.24/templates_thingy-default.wgpkg similarity index 100% rename from docs/upgrades/packages-7.6.0/templates_thingy-default.wgpkg rename to docs/upgrades/packages-7.5.24/templates_thingy-default.wgpkg diff --git a/docs/upgrades/upgrade_7.5.21-7.5.22.pl b/docs/upgrades/upgrade_7.5.21-7.5.22.pl new file mode 100644 index 000000000..959e93b46 --- /dev/null +++ b/docs/upgrades/upgrade_7.5.21-7.5.22.pl @@ -0,0 +1,114 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2008 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.5.22'; +my $quiet; # this line required + + +my $session = start(); # this line required + +fixIsPublicOnTemplates ( $session ); + +finish($session); # this line required + + +#---------------------------------------------------------------------------- +sub fixIsPublicOnTemplates { + my $session = shift; + print "\tFixing 'is public' on templates" unless $quiet; + $session->db->write('UPDATE `assetIndex` SET `isPublic` = 0 WHERE assetId IN (SELECT assetId FROM asset WHERE className IN ("WebGUI::Asset::RichEdit", "WebGUI::Asset::Snippet", "WebGUI::Asset::Template") )'); + print "Done.\n" unless $quiet; +} + +#---------------------------------------------------------------------------- +# 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; + + # 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 = WebGUI::Asset->getImportNode($session)->importPackage( $storage ); + + # Make the package not a package anymore + $package->update({ isPackage => 0 }); +} + +#------------------------------------------------- +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',".$session->datetime->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 ); + } +} + diff --git a/docs/upgrades/upgrade_7.5.22-7.5.23.pl b/docs/upgrades/upgrade_7.5.22-7.5.23.pl new file mode 100644 index 000000000..7f695d609 --- /dev/null +++ b/docs/upgrades/upgrade_7.5.22-7.5.23.pl @@ -0,0 +1,106 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2008 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.5.23'; +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; + + # 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 = WebGUI::Asset->getImportNode($session)->importPackage( $storage ); + + # Make the package not a package anymore + $package->update({ isPackage => 0 }); +} + +#------------------------------------------------- +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',".$session->datetime->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 ); + } +} + diff --git a/docs/upgrades/upgrade_7.5.23-7.5.24.pl b/docs/upgrades/upgrade_7.5.23-7.5.24.pl new file mode 100644 index 000000000..deb20548a --- /dev/null +++ b/docs/upgrades/upgrade_7.5.23-7.5.24.pl @@ -0,0 +1,106 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2008 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.5.24'; +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; + + # 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 = WebGUI::Asset->getImportNode($session)->importPackage( $storage ); + + # Make the package not a package anymore + $package->update({ isPackage => 0 }); +} + +#------------------------------------------------- +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',".$session->datetime->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 ); + } +} + diff --git a/docs/upgrades/upgrade_7.5.21-7.6.0.pl b/docs/upgrades/upgrade_7.5.24-7.6.0.pl similarity index 100% rename from docs/upgrades/upgrade_7.5.21-7.6.0.pl rename to docs/upgrades/upgrade_7.5.24-7.6.0.pl