StoryTopic 'Alphabetically' sort order

This commit is contained in:
Scott Walters 2010-07-27 18:42:31 -04:00
parent 33592f9dbb
commit e033192328
6 changed files with 110 additions and 9 deletions

View file

@ -8,6 +8,7 @@
- fixed #11742: linktag FilePump macro not xhtml valid
- fixed #11744: Default DataForm list template does not contain pagination
- fixed #11683: URL with UTF8 (for äÄöÖüÜß)
- added option for sort order of Alphabetically on title to StoryArchive, StoryTopic and Keyword
7.9.9
- fixed #11693: Shopping cart does not show for visitor user

View file

@ -33,6 +33,7 @@ my $session = start(); # this line required
# upgrade functions go here
addSpamStopWordsToConfig($session);
alterStoryArchiveTable($session);
alterStoryTopicTable($session);
finish($session); # this line required
@ -74,6 +75,24 @@ sub alterStoryArchiveTable {
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub alterStoryTopicTable {
my $session = shift;
print "\tAdd story sort order column to the StoryTopic table... " unless $quiet;
my $sth = $session->db->read('DESCRIBE `StoryTopic`');
while (my ($col) = $sth->array) {
if ($col eq 'storySortOrder') {
print "Skipped.\n" unless $quiet;
return;
}
}
$session->db->write("ALTER TABLE StoryTopic ADD COLUMN storySortOrder CHAR(22)");
$session->db->write("UPDATE StoryTopic SET storySortOrder = 'Chronologically' WHERE storySortOrder IS NULL");
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------