fix - i18n reserved section name in Surveys

fix - typo in Asset_ProjectManager i18n
This commit is contained in:
Roy Johnson 2006-06-05 23:26:17 +00:00
parent e783ce7660
commit 74d9fb12ea
4 changed files with 39 additions and 12 deletions

View file

@ -7,6 +7,8 @@
- fix: Survey Asset Copy Problems
- fix: EMS Add Subevent
- fix: HTTPproxy
- fix: i18n reserved section name in Surveys
- fix: typo in Asset_ProjectManager i18n
6.99.3
- Someone removed the status from the submission templates. That has been

View file

@ -22,8 +22,28 @@ my $session = start(); # this line required
# upgrade functions go here
fixSurvey($session);
finish($session); # this line required
#-------------------------------------------------
sub fixSurvey{
my $session = shift;
print "\tFixing Surveys.\n" unless ($quiet);
# Add a defaultSectionId column to Survey table
$session->db->write("alter table Survey add column (defaultSectionId varchar(22) binary not null)");
# Set defaultSectionId for existing Surveys by finding the sectionId for the section called 'none' and update the asset
my @surveyAssets = $session->db->buildArray("select assetId from asset where className='WebGUI::Asset::Wobject::Survey'");
foreach my $assetId (@surveyAssets) {
my $survey = WebGUI::Asset->new($session, $assetId, 'WebGUI::Asset::Wobject::Survey');
my $i18n = WebGUI::International->new($session, 'Asset_Survey');
my $noneLabel = $i18n->get(107);
my ($defaultSectionId) = $session->db->quickArray("select Survey_sectionId from Survey_section where assetId=? and sectionName=?", [$assetId,$noneLabel]);
$survey->update({defaultSectionId => $defaultSectionId});
}
}
##-------------------------------------------------
#sub exampleFunction {