fix - i18n reserved section name in Surveys
fix - typo in Asset_ProjectManager i18n
This commit is contained in:
parent
e783ce7660
commit
74d9fb12ea
4 changed files with 39 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue