From 21188e7949d9dd84052f9ecd76c8b2e63699b490 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 2 Jan 2006 18:51:38 +0000 Subject: [PATCH] forward port of colins 6.8.4 bugwork --- docs/changelog/6.x.x.txt | 12 ++++++++++ docs/upgrades/upgrade_6.8.3-6.8.4.pl | 28 +++++++++++++++------- lib/WebGUI/Asset/Wobject/DataForm.pm | 5 ++++ lib/WebGUI/Asset/Wobject/EventsCalendar.pm | 2 +- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index f6ecc1ef6..7e7dab096 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -9,6 +9,18 @@ - fix [ 1379384 ] image uploads to non-public pages (Len Kranendonk / ilance.nl) - fix [ 1379915 ] Survey can only be completed once per user + - Fixed broken UI Level examples in the config file. + - fixed a bug in SyncProfilesToLDAP + - fix [ 1387242 ] uploadsHandler fails + - fix [ 1389086 ] 6.8.3 RichEdit buttons disappear + - fix [ 1379915 ] Survey can only be completed once per user + - fix [ 1389371 ] Pictures & Avatars Don't Work + - The avatar user profile field is now visible and editable by default. + - fix [ 1392277 ] Stock Quote Template error + - fix [ 1387505 ] Hover help not working on Matrix + - fix [ 1393867 ] Data Form Not Emailing + - fix [ 1392643 ] 2006 Calendar dates are not correct? + - Removed the If macro, since it was scheduled for removal in 6.8.0. 6.8.3 diff --git a/docs/upgrades/upgrade_6.8.3-6.8.4.pl b/docs/upgrades/upgrade_6.8.3-6.8.4.pl index 4c2075b19..466e0cd9d 100644 --- a/docs/upgrades/upgrade_6.8.3-6.8.4.pl +++ b/docs/upgrades/upgrade_6.8.3-6.8.4.pl @@ -23,13 +23,14 @@ start(); # this line required fixDefaultThreadTemplate(); enableAvatarProfileField(); +updateDataFormEmailFields(); finish(); # this line required #------------------------------------------------- sub fixDefaultThreadTemplate { - print "\Add avatar to default thread template.\n" unless ($quiet); + print "\Enable Avatars in the default Thread template.\n" unless ($quiet); my $template = < @@ -259,6 +260,24 @@ EOT1 } +#------------------------------------------------- +sub enableAvatarProfileField { + print "\tMake user profile Avatar field visible and editable.\n" unless ($quiet); + WebGUI::SQL->write("update userProfileField set visible=1 where fieldName='avatar'"); + WebGUI::SQL->write("update userProfileField set editable=1 where fieldName='avatar'"); +} + +#------------------------------------------------- +sub updateDataFormEmailFields { + print "\tFix default email tabId's.\n" unless ($quiet); + WebGUI::SQL->write("alter table DataForm_field alter DataForm_tabId set default 0;"); + my $sth = WebGUI::SQL->read('select DataForm_fieldId,DataForm_tabId from DataForm_field'); + my $wrh = WebGUI::SQL->prepare('update DataForm_field set DataForm_tabId=0 where DataForm_fieldId=?'); + while (my %hash = $sth->hash) { + $wrh->execute([$hash{DataForm_fieldId}]) unless $hash{DataForm_tabId}; + } +} + # ---- DO NOT EDIT BELOW THIS LINE ---- @@ -275,13 +294,6 @@ sub start { WebGUI::SQL->write("insert into webguiVersion values (".quote($toVersion).",'upgrade',".time().")"); } -#------------------------------------------------- -sub enableAvatarProfileField { - print "\tMake user profile Avatar field visible and editable.\n" unless ($quiet); - WebGUI::SQL->write("update userProfileField set visible=1 where fieldName='avatar'"); - WebGUI::SQL->write("update userProfileField set editable=1 where fieldName='avatar'"); -} - #------------------------------------------------- sub finish { WebGUI::Session::close(); diff --git a/lib/WebGUI/Asset/Wobject/DataForm.pm b/lib/WebGUI/Asset/Wobject/DataForm.pm index f6dd4db48..008879be1 100644 --- a/lib/WebGUI/Asset/Wobject/DataForm.pm +++ b/lib/WebGUI/Asset/Wobject/DataForm.pm @@ -508,6 +508,7 @@ sub processPropertiesFromFormPost { if ($self->session->form->process("assetId") eq "new") { $self->setCollateral("DataForm_field","DataForm_fieldId",{ DataForm_fieldId=>"new", + DataForm_tabId=>0, name=>"from", label=>WebGUI::International::get(10,"Asset_DataForm"), status=>"editable", @@ -517,6 +518,7 @@ sub processPropertiesFromFormPost { }); $self->setCollateral("DataForm_field","DataForm_fieldId",{ DataForm_fieldId=>"new", + DataForm_tabId=>0, name=>"to", label=>WebGUI::International::get(11,"Asset_DataForm"), status=>"hidden", @@ -527,6 +529,7 @@ sub processPropertiesFromFormPost { }); $self->setCollateral("DataForm_field","DataForm_fieldId",{ DataForm_fieldId=>"new", + DataForm_tabId=>0, name=>"cc", label=>WebGUI::International::get(12,"Asset_DataForm"), status=>"hidden", @@ -536,6 +539,7 @@ sub processPropertiesFromFormPost { }); $self->setCollateral("DataForm_field","DataForm_fieldId",{ DataForm_fieldId=>"new", + DataForm_tabId=>0, name=>"bcc", label=>WebGUI::International::get(13,"Asset_DataForm"), status=>"hidden", @@ -545,6 +549,7 @@ sub processPropertiesFromFormPost { }); $self->setCollateral("DataForm_field","DataForm_fieldId",{ DataForm_fieldId=>"new", + DataForm_tabId=>0, name=>"subject", label=>WebGUI::International::get(14,"Asset_DataForm"), status=>"editable", diff --git a/lib/WebGUI/Asset/Wobject/EventsCalendar.pm b/lib/WebGUI/Asset/Wobject/EventsCalendar.pm index aee199e24..e95ef6fa7 100644 --- a/lib/WebGUI/Asset/Wobject/EventsCalendar.pm +++ b/lib/WebGUI/Asset/Wobject/EventsCalendar.pm @@ -353,7 +353,7 @@ sub view { my $firstDayInFirstWeek = WebGUI::DateTime::getFirstDayInMonthPosition($thisMonth); my $daysInMonth = WebGUI::DateTime::getDaysInMonth($thisMonth); my @prepad; - while ($dayOfWeekCounter < $firstDayInFirstWeek) { + while (($dayOfWeekCounter <= $firstDayInFirstWeek) and $firstDayInFirstWeek != 7) { push(@prepad,{ count => $dayOfWeekCounter });