Merged the "Invite a Friend" application into the Account system and cleaned up the templates in the Inbox

This commit is contained in:
Frank Dillon 2008-11-18 04:52:16 +00:00
parent e7469531cf
commit d91bc5754d
13 changed files with 532 additions and 213 deletions

View file

@ -9,11 +9,12 @@ save you many hours of grief.
7.6.4
--------------------------------------------------------------------
* The user facing portions of WebGUI's profile, inbox, and friends systems
have been completely updated. No data will be lost but all templates
including custom templates that are related to these systems will be deleted
on upgrade. Please make sure you export your custom templates prior to
upgrading as you will need to modify them for the new system.
* The user facing portions of WebGUI's profile, inbox, friends, and "invite
a friend" systems have been completely updated. No data will be lost
but all templates including custom templates that are related to these
systems will be deleted on upgrade. Please make sure you export your
custom templates prior to upgrading as you will need to modify them for
the new system.
* The Survey system has been completely updated. Please make sure you
create full backups of your survey results and export them as needed.

View file

@ -393,7 +393,7 @@ sub upgradeAccount {
#Add the settings for the inbox module
$setting->add("inboxStyleTemplateId",""); #Use the userStyle by default
$setting->add("inboxLayoutTempalteId","N716tpSna0iIQTKxS4gTWA");
$setting->add("inboxLayoutTempalteId","gfZOwaTWYjbSoVaQtHBBEw");
$setting->add("inboxViewTemplateId","c8xrwVuu5QE0XtF9DiVzLw");
$setting->add("inboxViewMessageTemplateId","0n4HtbXaWa_XJHkFjetnLQ");
$setting->add("inboxSendMessageTemplateId","6uQEULvXFgCYlRWnYzZsuA");
@ -403,7 +403,16 @@ sub upgradeAccount {
$setting->add("inboxManageInvitationsTemplateId","1Q4Je3hKCJzeo0ZBB5YB8g");
$setting->add("inboxViewInvitationTemplateId","VBkY05f-E3WJS50WpdKd1Q");
$setting->add("inboxInvitationConfirmTemplateId","5A8Hd9zXvByTDy4x-H28qw");
#Inbox Invitations
$setting->add("inboxInviteUserEnabled",$session->setting->get("userInvitationsEnabled"));
$setting->add("inboxInviteUserRestrictSubject","0");
$setting->add("inboxInviteUserSubject","^International(invite subject,Account_Inbox,^u;);");
$setting->add("inboxInviteUserRestrictMessage","0");
$setting->add("inboxInviteUserMessage","^International(invite message,Account_Inbox);");
$setting->add("inboxInviteUserMessageTemplateId","XgcsoDrbC0duVla7N7JAdw");
$setting->add("inboxInviteUserTemplateId","cR0UFm7I1qUI2Wbpj--08Q");
$setting->add("inboxInviteUserConfirmTemplateId","SVIhz68689hwUGgcDM-gWw");
#Add the settings for the friends module
$setting->add("friendsStyleTemplateId",""); #Use the userStyle by default
$setting->add("friendsLayoutTempalteId","N716tpSna0iIQTKxS4gTWA");
@ -422,6 +431,7 @@ sub upgradeAccount {
$setting->add("shopStyleTemplateId",""); #Use the userStyle by default
$setting->add("shopLayoutTemplateId","aUDsJ-vB9RgP-AYvPOy8FQ");
#Add inbox changes
$session->db->write(q{
create table inbox_messageState (
@ -489,20 +499,25 @@ sub upgradeAccount {
$session->db->write(q{REPLACE INTO `userProfileField` VALUES ('publicProfile','WebGUI::International::get(861)',1,0,'RadioList','{ all=>WebGUI::International::get(\'public label\',\'Account_Profile\'), friends=>WebGUI::International::get(\'friends only label\',\'Account_Profile\'), none=>WebGUI::International::get(\'private label\',\'Account_Profile\')}','[\"none\"]',8,'4',1,1,0,0,0,'')});
#Clean up old templates and settings
my $oldtemplates = {
editUserProfileTemplate => 'Operation/Profile/Edit',
viewUserProfileTemplate => 'Operation/Profile/View',
manageFriendsTemplateId => 'friends/manage',
sendPrivateMessageTemplateId => 'Inbox/SendPrivateMessage',
viewInboxTemplateId => 'Inbox',
viewInboxMessageTemplateId => 'Inbox/Message',
my $oldsettings = {
editUserProfileTemplate => 'Operation/Profile/Edit',
viewUserProfileTemplate => 'Operation/Profile/View',
manageFriendsTemplateId => 'friends/manage',
sendPrivateMessageTemplateId => 'Inbox/SendPrivateMessage',
viewInboxTemplateId => 'Inbox',
viewInboxMessageTemplateId => 'Inbox/Message',
userInvitationsEmailTemplateId => 'userInvite/Email',
userInvitationsEnabled => 'userInvite',
userInvitationsEmailExists => '',
};
foreach my $setting (keys %{$oldtemplates}) {
foreach my $setting (keys %{$oldsettings}) {
#Remove the setting
$session->db->write("delete from settings where name=?",[$setting]);
$session->setting->remove($setting);
#$session->db->write("delete from settings where name=?",[$setting]);
#Remove all the templates with the related namespace
my $assets = $session->db->buildArrayRef("select distinct assetId from template where namespace=?",[$oldtemplates->{$setting}]);
next if ($oldsettings->{$setting} eq "");
my $assets = $session->db->buildArrayRef("select distinct assetId from template where namespace=?",[$oldsettings->{$setting}]);
#Purge the template
foreach my $assetId (@{$assets}) {
WebGUI::Asset->newByDynamicClass($session,$assetId)->purge;