The 4.6.7 bug fix cycle.
This commit is contained in:
parent
a1a21aa1ee
commit
c9dcb9dda1
9 changed files with 7467 additions and 7120 deletions
11878
docs/create.sql
11878
docs/create.sql
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
30
docs/upgrades/upgrade_4.6.6-4.6.7.sql
Normal file
30
docs/upgrades/upgrade_4.6.6-4.6.7.sql
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
insert into webguiVersion values ('4.6.7','upgrade',unix_timestamp());
|
||||
alter table international add column lastUpdated int;
|
||||
update international set lastUpdated=1031514049 where languageId=1;
|
||||
update international set lastUpdated=1031516049 where languageId<>1;
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=722;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (722,1,'WebGUI','Id', 1031517195);
|
||||
delete from international where languageId=1 and namespace='UserSubmission' and internationalId=61;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (61,1,'UserSubmission','User Submission System, Add/Edit', 1031517089);
|
||||
delete from international where languageId=1 and namespace='UserSubmission' and internationalId=71;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (71,1,'UserSubmission','User Submission Systems are a great way to add a sense of community to any site as well as get free content from your users.\r\n<br><br>\r\n\r\n<b>Layout</b><br>\r\nWhat should this user submission system look like? Currently these are the views available:\r\n<ul>\r\n<li><b>Traditional</b> - Creates a simple spreadsheet style table that lists off each submission and is sorted by date. \r\n</li>\r\n<li><b>Web Log</b> - Creates a view that looks like the news site <a href="http://slashdot.org/">Slashdot</a>. Incidentally, Slashdot invented the web log format, which has since become very popular on news oriented sites. To limit the amount of the article shown on the main page, place the separator macro ^-; where you\'d like the front page content to stop.\r\n</li>\r\n<li><b>Photo Gallery</b> - Creates a matrix of thumbnails that can be clicked on to view the full image.\r\n</li></ul>\r\n\r\n<b>Who can approve?</b><br>\r\nWhat group is allowed to approve and deny content?\r\n<br><br>\r\n\r\n<b>Who can contribute?</b><br>\r\nWhat group is allowed to contribute content?\r\n<br><br>\r\n\r\n<b>Submissions Per Page</b><br>\r\nHow many submissions should be listed per page in the submissions index?\r\n<br><br>\r\n\r\n<b>Default Status</b><br>\r\nShould submissions be set to <i>Approved</i>, <i>Pending</i>, or <i>Denied</i> by default?\r\n<br><br>\r\n<i>Note:</i> If you set the default status to Pending, then be prepared to monitor your message log for new submissions.\r\n<p>\r\n\r\n<b>Karma Per Submission</b><br>\r\nHow much karma should be given to a user when they contribute to this user submission system?\r\n<p>\r\n\r\n\r\n<b>Display thumbnails?</b><br>\r\nIf there is an image present in the submission, the thumbnail will be displayed in the Layout (see above).\r\n<p>\r\n\r\n<b>Allow discussion?</b><br>\r\nDo you wish to attach a discussion to this user submission system? If you do, users will be able to comment on each submission.\r\n<p>\r\n\r\n<b>Who can post?</b><br>\r\nSelect the group that is allowed to post to this discussion.\r\n<p>\r\n\r\n<b>Edit Timeout</b><br>\r\nHow long should a user be able to edit their post before editing is locked to them?\r\n<p>\r\n<i>Note:</i> Don\'t set this limit too high. One of the great things about discussions is that they are an accurate record of who said what. If you allow editing for a long time, then a user has a chance to go back and change his/her mind a long time after the original statement was made.\r\n<p>\r\n\r\n<b>Karma Per Post</b><br>\r\nHow much karma should be given to a user when they post to this discussion?\r\n<p>\r\n\r\n<b>Who can moderate?</b><br>\r\nSelect the group that is allowed to moderate this discussion.\r\n<p>\r\n\r\n<b>Moderation Type?</b><br>\r\nYou can select what type of moderation you\'d like for your users. <i>After-the-fact</i> means that when a user posts a message it is displayed publically right away. <i>Pre-emptive</i> means that a moderator must preview and approve users posts before allowing them to be publically visible. Alerts for new posts will automatically show up in the moderator\'s WebGUI Inbox.\r\n<p>\r\nNote: In both types of moderation the moderator can always edit or delete the messages posted by your users.\r\n<p>\r\n', 1031517089);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=721;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (721,1,'WebGUI','Namespace', 1031515005);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=720;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (720,1,'WebGUI','OK', 1031514777);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=719;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (719,1,'WebGUI','Out of Date', 1031514679);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=588;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (588,1,'WebGUI','Are you certain you wish to submit this translation to Plain Black for inclusion in the official distribution of WebGUI? By clicking on the yes link you understand that you\'re giving Plain Black an unlimited license to use the translation in its software distributions.', 1031514630);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=594;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (594,1,'WebGUI','Translate messages.', 1031514314);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=593;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (593,1,'WebGUI','Submit translation.', 1031514223);
|
||||
delete from international where languageId=1 and namespace='WebGUI' and internationalId=718;
|
||||
insert into international (internationalId,languageId,namespace,message,lastUpdated) values (718,1,'WebGUI','Export translation.', 1031514184);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
package WebGUI;
|
||||
our $VERSION = "4.6.6";
|
||||
our $VERSION = "4.6.7";
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2002 Plain Black LLC.
|
||||
|
|
@ -81,7 +81,11 @@ sub page {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ($operationOutput ne "") {
|
||||
if ($session{header}{mimetype} ne "text/html") {
|
||||
$httpHeader = WebGUI::Session::httpHeader();
|
||||
WebGUI::Session::close();
|
||||
return $httpHeader.$operationOutput.$wobjectOutput;
|
||||
} elsif ($operationOutput ne "") {
|
||||
$contentHash{0} = $operationOutput;
|
||||
$content = WebGUI::Template::generate(\%contentHash,1);
|
||||
} elsif ($wobjectOutput ne "") {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ use WebGUI::URL;
|
|||
use WebGUI::HTMLForm;
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
|
||||
$f->checkbox("toggleGadget","Turn Gadgets On?");
|
||||
$f->checkbox("whichOne","Is red your favorite?","red");
|
||||
$f->checkList("dayOfWeek",\%days,"Which day?");
|
||||
$f->combo("fruit",\%fruit,"Choose a fruit or enter your own.");
|
||||
$f->date("endDate","End Date",$endDate);
|
||||
$f->email("emailAddress","Email Address");
|
||||
|
|
@ -39,8 +40,11 @@ use WebGUI::URL;
|
|||
$f->hidden("wid","55");
|
||||
$f->HTMLArea("description","Description");
|
||||
$f->integer("size","Size");
|
||||
$f->interval("timeToLive","How long should this last?",12,"hours");
|
||||
$f->password("identifier","Password");
|
||||
$f->phone("cellPhone","Cell Phone");
|
||||
$f->radio("whichOne","Is red your favorite?","red");
|
||||
$f->radioList("dayOfWeek",\%days,"Which day?");
|
||||
$f->raw("text");
|
||||
$f->readOnly("34","Page ID");
|
||||
$f->select("dayOfWeek",\%days,"Which day?");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ sub _replacement {
|
|||
if (not defined $text){
|
||||
$temp .= WebGUI::International::get(48);
|
||||
$temp .= ' <a href="'.WebGUI::URL::page('op=displayAccount').
|
||||
'">'.$session{user}{username}.'</a>.';
|
||||
'">'.$session{user}{username}.'</a>. ';
|
||||
$temp .= WebGUI::International::get(49);
|
||||
$temp = WebGUI::Macro::Backslash_pageUrl::process($temp);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -158,9 +158,9 @@ sub www_editHelpSave {
|
|||
$session{form}{seeAlso} = join(";",@seeAlso);
|
||||
$session{form}{seeAlso} .= ';';
|
||||
}
|
||||
WebGUI::SQL->write("update international set message=".quote($session{form}{title})."
|
||||
WebGUI::SQL->write("update international set message=".quote($session{form}{title}).", lastUpdated=".time()."
|
||||
where internationalId=$session{form}{titleId} and languageId=1 and namespace=".quote($session{form}{namespace}));
|
||||
WebGUI::SQL->write("update international set message=".quote($session{form}{body})."
|
||||
WebGUI::SQL->write("update international set message=".quote($session{form}{body}).", lastUpdated=".time()."
|
||||
where internationalId=$session{form}{bodyId} and languageId=1 and namespace=".quote($session{form}{namespace}));
|
||||
WebGUI::SQL->write("update help set seeAlso=".quote($session{form}{seeAlso})."
|
||||
where helpId=$session{form}{hid} and namespace=".quote($session{form}{namespace}));
|
||||
|
|
@ -170,35 +170,18 @@ sub www_editHelpSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_exportHelp {
|
||||
if ($session{user}{userId} != 3) {
|
||||
return "";
|
||||
} else {
|
||||
my ($export, $output, %help, %data, $sth);
|
||||
$output = '<h1>Export Help</h1>';
|
||||
$export = "#export of WebGUI ".$WebGUI::VERSION." help system.\n\n";
|
||||
$sth = WebGUI::SQL->read("select * from help");
|
||||
while (%help = $sth->hash) {
|
||||
%data = WebGUI::SQL->quickHash("select * from international where internationalId=$help{titleId}"
|
||||
." and languageId=1 and namespace=".quote($help{namespace}));
|
||||
$export .= "delete from international where internationalId=$data{internationalId}"
|
||||
." and namespace=".quote($data{namespace})." and languageId=1;\n";
|
||||
$export .= "insert into international (internationalId,namespace,languageId,message) values ("
|
||||
."$data{internationalId}, ".quote($data{namespace}).",1,".quote($data{message}).");\n";
|
||||
%data = WebGUI::SQL->quickHash("select * from international where internationalId=$help{bodyId}"
|
||||
." and languageId=1 and namespace=".quote($help{namespace}));
|
||||
$export .= "delete from international where internationalId=$data{internationalId}"
|
||||
." and namespace=".quote($data{namespace})." and languageId=1;\n";
|
||||
$export .= "insert into international (internationalId,namespace,languageId,message) values ("
|
||||
."$data{internationalId}, ".quote($data{namespace}).",1,".quote($data{message}).");\n";
|
||||
$export .= "delete from help where helpId=$help{helpId} and namespace=".quote($help{namespace}).";\n";
|
||||
$export .= "insert into help (helpId,namespace,titleId,bodyId,seeAlso) values ($help{helpId}, "
|
||||
.quote($help{namespace}).", $help{titleId}, $help{bodyId}, ".quote($help{seeAlso}).");\n";
|
||||
}
|
||||
$sth->finish;
|
||||
#$output .= '<form><textarea cols=80 rows=20>'.$export.'</textarea></form>';
|
||||
$output .= "<p><pre>\n\n\n\n".$export."\n\n\n\n</pre><p>";
|
||||
return $output;
|
||||
return "" if ($session{user}{userId} != 3);
|
||||
my ($export, $output, %help, $sth);
|
||||
$export = "#export of WebGUI ".$WebGUI::VERSION." help system.\n\n";
|
||||
$sth = WebGUI::SQL->read("select * from help");
|
||||
while (%help = $sth->hash) {
|
||||
$export .= "delete from help where helpId=$help{helpId} and namespace=".quote($help{namespace}).";\n";
|
||||
$export .= "insert into help (helpId,namespace,titleId,bodyId,seeAlso) values ($help{helpId}, "
|
||||
.quote($help{namespace}).", $help{titleId}, $help{bodyId}, ".quote($help{seeAlso}).");\n";
|
||||
}
|
||||
$sth->finish;
|
||||
$session{header}{mimetype} = 'text/plain';
|
||||
return $export;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -23,19 +23,47 @@ use WebGUI::SQL;
|
|||
use WebGUI::URL;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(&www_listLanguages &www_editLanguage &www_submitTranslation &www_submitTranslationConfirm &www_deleteLanguage &www_deleteLanguageConfirm
|
||||
&www_listInternationalMessages &www_editLanguageSave &www_editInternationalMessage &www_editInternationalMessageSave &www_listHelpMessages
|
||||
&www_editHelpMessage &www_editHelpMessageSave);
|
||||
our @EXPORT = qw(&www_listLanguages &www_editLanguage &www_submitTranslation &www_submitTranslationConfirm
|
||||
&www_deleteLanguage &www_deleteLanguageConfirm &www_addInternationalMessage &www_addInternationalMessageSave
|
||||
&www_listInternationalMessages &www_editLanguageSave &www_editInternationalMessage
|
||||
&www_exportTranslation &www_editInternationalMessageSave );
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _export {
|
||||
my ($sth, %data, $export);
|
||||
tie %data, 'Tie::CPHash';
|
||||
%data = WebGUI::SQL->quickHash("select * from language where languageId=".$_[0]);
|
||||
$export = "#".$data{language}." translation export for WebGUI ".$WebGUI::VERSION.".\n\n";
|
||||
$export .= "#language\n\n";
|
||||
$export .= "delete from language where languageId=".$_[0].";\n";
|
||||
$export .= "insert into language (languageId,language,characterSet) values ("
|
||||
.$data{languageId}.", ".quote($data{language}).", ".quote($data{characterSet}).");\n";
|
||||
$export .= "\n#international\n\n";
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=".$_[0]." order by lastUpdated desc");
|
||||
while (%data = $sth->hash) {
|
||||
$export .= "delete from international where languageId=".$_[0]." and namespace="
|
||||
.quote($data{namespace})." and internationalId=".$data{internationalId}.";\n";
|
||||
$export .= "insert into international (internationalId,languageId,namespace,message,lastUpdated) values ("
|
||||
.$data{internationalId}.",".$data{languageId}.",".quote($data{namespace})
|
||||
.",".quote($data{message}).", ".$data{lastUpdated}.");\n";
|
||||
}
|
||||
$sth->finish;
|
||||
return $export;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub _submenu {
|
||||
my ($output);
|
||||
$output = '<table width="100%"><tr>';
|
||||
$output .= '<td valign="top" class="content">'.$_[0].'</td>';
|
||||
$output .= '<td valign="top" class="tableMenu">';
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=editLanguage&lid='.$session{form}{lid}).'">'.WebGUI::International::get(598).'</a>';
|
||||
$output .= '<td valign="top" class="tableMenu" nowrap="1">';
|
||||
if ($session{form}{lid} == 1) {
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=addInternationalMessage&lid=1').'">Add new message.</a>';
|
||||
}
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=listInternationalMessages&lid='.$session{form}{lid}).'">'.WebGUI::International::get(594).'</a>';
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=editLanguage&lid='.$session{form}{lid}).'">'.WebGUI::International::get(598).'</a>';
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=exportTranslation&lid='.$session{form}{lid}).'">'.WebGUI::International::get(718).'</a>';
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=submitTranslation&lid='.$session{form}{lid}).'">'.WebGUI::International::get(593).'</a>';
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=listLanguages').'">'.WebGUI::International::get(585).'</a>';
|
||||
$output .= '<li><a href="'.WebGUI::URL::page().'">'.WebGUI::International::get(493).'</a>';
|
||||
|
|
@ -43,6 +71,34 @@ sub _submenu {
|
|||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_addInternationalMessage {
|
||||
my ($output,$f,$namespace);
|
||||
return WebGUI::Privilege::adminOnly() unless (WebGUI::Privilege::isInGroup(3));
|
||||
$output = '<h1>Add English Message</h1>';
|
||||
$namespace = $session{wobject};
|
||||
$namespace->{WebGUI} = 'WebGUI';
|
||||
$f = WebGUI::HTMLForm->new();
|
||||
$f->hidden("lid",1);
|
||||
$f->hidden("op","addInternationalMessageSave");
|
||||
$f->select("namespace",$namespace,"Namespace",['WebGUI']);
|
||||
$f->textarea("message","Message");
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return _submenu($output);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_addInternationalMessageSave {
|
||||
my ($nextId);
|
||||
($nextId) = WebGUI::SQL->quickArray("select max(internationalId) from international where languageId=1
|
||||
and namespace=".quote($session{form}{namespace}));
|
||||
$nextId++;
|
||||
WebGUI::SQL->write("insert into international (languageId, internationalId, namespace, message, lastUpdated) values
|
||||
(1,$nextId,".quote($session{form}{namespace}).",".quote($session{form}{message}).",".time().")");
|
||||
return "<b>Message was added with id $nextId.</b>".www_listInternationalMessages();
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_deleteLanguage {
|
||||
my ($output);
|
||||
|
|
@ -109,10 +165,12 @@ sub www_editInternationalMessage {
|
|||
sub www_editInternationalMessageSave {
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
if ($session{form}{missing}) {
|
||||
WebGUI::SQL->write("insert into international (message,namespace,languageId,internationalId) values (".quote($session{form}{message})
|
||||
.",".quote($session{form}{namespace}).",".$session{form}{lid}.",".$session{form}{iid}.")");
|
||||
WebGUI::SQL->write("insert into international (message,namespace,languageId,internationalId,lastUpdated)
|
||||
values (".quote($session{form}{message}).",".quote($session{form}{namespace})
|
||||
.",".$session{form}{lid}.",".$session{form}{iid}.", ".time().")");
|
||||
} else {
|
||||
WebGUI::SQL->write("update international set message=".quote($session{form}{message})." where namespace=".quote($session{form}{namespace})."
|
||||
WebGUI::SQL->write("update international set message=".quote($session{form}{message}).", lastUpdated="
|
||||
.time()." where namespace=".quote($session{form}{namespace})."
|
||||
and languageId=".$session{form}{lid}." and internationalId=".$session{form}{iid});
|
||||
}
|
||||
return www_listInternationalMessages();
|
||||
|
|
@ -140,12 +198,6 @@ sub www_editLanguage {
|
|||
$f->text("characterSet",WebGUI::International::get(592),$data{characterSet});
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
if ($session{form}{lid} ne "new") {
|
||||
$output .= '<ul>';
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=listInternationalMessages&lid='.$session{form}{lid}).'">'.WebGUI::International::get(594).'</a>';
|
||||
$output .= '<li><a href="'.WebGUI::URL::page('op=submitLanguage&lid='.$session{form}{lid}).'">'.WebGUI::International::get(593).'</a>';
|
||||
$output .= '</ul>';
|
||||
}
|
||||
return _submenu($output);
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
|
|
@ -168,90 +220,79 @@ sub www_editLanguageSave {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_listHelpMessages {
|
||||
my ($output, $sth, $key, $p, %data, %newList, %list, $i, $missing, @row, @split,$new);
|
||||
tie %data, 'Tie::CPHash';
|
||||
tie %list, 'Tie::IxHash';
|
||||
tie %newList, 'Tie::IxHash';
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
%data = WebGUI::SQL->quickHash("select language from language where languageId=".$session{form}{lid});
|
||||
$missing = '<b>'.WebGUI::International::get(596).'</b>';
|
||||
$output = '<h1>'.WebGUI::International::get(595).' ('.$data{language}.')</h1>';
|
||||
$sth = WebGUI::SQL->read("select * from help where languageId=".$session{form}{lid});
|
||||
while (%data = $sth->hash) {
|
||||
$list{$data{helpId}."-".$data{namespace}} = $data{action}.' '.$data{object};
|
||||
}
|
||||
$sth->finish;
|
||||
$sth = WebGUI::SQL->read("select * from help where languageId=1");
|
||||
while (%data = $sth->hash) {
|
||||
unless ($list{$data{helpId}."-".$data{namespace}}) {
|
||||
$list{"missing-".$data{helpId}."-".$data{namespace}} = $missing;
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
foreach $key (sort {$b cmp $a} keys %list) {
|
||||
$newList{$key}=$list{$key};
|
||||
}
|
||||
foreach $key (keys %newList) {
|
||||
@split = split(/-/,$key);
|
||||
if ($split[0] eq "missing") {
|
||||
$split[0] = $split[1];
|
||||
$split[1] = $split[2];
|
||||
$new = 1;
|
||||
} else {
|
||||
$new = 0;
|
||||
}
|
||||
$row[$i] = editIcon('op=editHelpMessage&lid='.$session{form}{lid}.'&hid='.$split[0].'&namespace='.$split[1].'&pn='.$session{form}{pn}.'&missing='.$new)
|
||||
.' '.$newList{$key}."<br>";
|
||||
$i++;
|
||||
}
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=listHelpMessages&lid='.$session{form}{lid}),\@row,50);
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
return _submenu($output);
|
||||
} else {
|
||||
return WebGUI::Privilege::adminOnly();
|
||||
}
|
||||
sub www_exportTranslation {
|
||||
$session{header}{mimetype} = 'text/plain';
|
||||
return _export($session{form}{lid});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_listInternationalMessages {
|
||||
my ($output, $sth, $new, $key, $p, %data, %newList, %list, $i, $missing, @row, @split);
|
||||
my ($output, $sth, $key, $p, $search, $status, %data, %list, $i, $missing, @row, $f, $outOfDate, $ok);
|
||||
tie %data, 'Tie::CPHash';
|
||||
tie %list, 'Tie::IxHash';
|
||||
tie %newList, 'Tie::IxHash';
|
||||
if (WebGUI::Privilege::isInGroup(3)) {
|
||||
%data = WebGUI::SQL->quickHash("select language from language where languageId=".$session{form}{lid});
|
||||
$missing = '<b>'.WebGUI::International::get(596).'</b>';
|
||||
$outOfDate = '<b>'.WebGUI::International::get(719).'</b>';
|
||||
$ok = WebGUI::International::get(720);
|
||||
$output = '<h1>'.WebGUI::International::get(595).' ('.$data{language}.')</h1>';
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=".$session{form}{lid}." order by namespace");
|
||||
$f = WebGUI::HTMLForm->new(1);
|
||||
$f->hidden("op","listInternationalMessages");
|
||||
$f->hidden("lid",$session{form}{lid});
|
||||
$f->text("search","",$session{form}{search});
|
||||
$f->submit("search");
|
||||
$output .= $f->print;
|
||||
if ($session{form}{search} ne "") {
|
||||
$search = " and message like ".quote("%".$session{form}{search}."%");
|
||||
}
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=".$session{form}{lid}.$search);
|
||||
while (%data = $sth->hash) {
|
||||
$list{$data{namespace}."-".$data{internationalId}} = "<em>[$data{namespace}]</em> - ".$data{message};
|
||||
$list{"z-".$data{namespace}."-".$data{internationalId}}{id} = $data{internationalId};
|
||||
$list{"z-".$data{namespace}."-".$data{internationalId}}{namespace} = $data{namespace};
|
||||
$list{"z-".$data{namespace}."-".$data{internationalId}}{message} = $data{message};
|
||||
$list{"z-".$data{namespace}."-".$data{internationalId}}{lastUpdated} = $data{lastUpdated};
|
||||
$list{"z-".$data{namespace}."-".$data{internationalId}}{missing} = 0;
|
||||
}
|
||||
$sth->finish;
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=1");
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=1".$search);
|
||||
while (%data = $sth->hash) {
|
||||
unless ($list{$data{namespace}."-".$data{internationalId}}) {
|
||||
$list{"missing-".$data{namespace}."-".$data{internationalId}} = "<em>[$data{namespace}]</em> - ".$missing;
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
foreach $key (sort {$b cmp $a} keys %list) {
|
||||
$newList{$key}=$list{$key};
|
||||
}
|
||||
foreach $key (keys %newList) {
|
||||
@split = reverse(split(/-/,$key));
|
||||
if ($split[3] eq "missing") {
|
||||
$new = 1;
|
||||
$key = $data{namespace}."-".$data{internationalId};
|
||||
unless ($list{"z-".$key}) {
|
||||
$list{"a-".$key}{missing} = 1;
|
||||
$list{"a-".$key}{namespace} = $data{namespace};
|
||||
$list{"a-".$key}{id} = $data{internationalId};
|
||||
} else {
|
||||
$new = 0;
|
||||
}
|
||||
$row[$i] = editIcon('op=editInternationalMessage&lid='.$session{form}{lid}.'&iid='.$split[0].'&namespace='.$split[1]
|
||||
.'&pn='.$session{form}{pn}.'&missing='.$new)
|
||||
.' '.$newList{$key}."<br>"; # add real message here
|
||||
$i++;
|
||||
if ($list{"z-".$key}{lastUpdated} > $data{lastUpdated}) {
|
||||
$list{"o-".$key} = $list{"z-".$key};
|
||||
delete($list{"z-".$key});
|
||||
$list{"o-".$key}{outOfDate} = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$sth->finish;
|
||||
foreach $key (sort {$a cmp $b} keys %list) {
|
||||
if ($list{$key}{outOfDate}) {
|
||||
$status = $outOfDate;
|
||||
} elsif ($list{$key}{missing}) {
|
||||
$status = $missing;
|
||||
} else {
|
||||
$status = $ok;
|
||||
}
|
||||
$row[$i] = '<tr valign="top"><td>'.$status."</td><td>"
|
||||
.editIcon('op=editInternationalMessage&lid='.$session{form}{lid}
|
||||
.'&iid='.$list{$key}{id}.'&namespace='.$list{$key}{namespace}.'&pn='.$session{form}{pn}
|
||||
.'&missing='.$list{$key}{missing})."</td><td>".$list{$key}{namespace}."</td><td>"
|
||||
.$list{$key}{id}."</td><td>".$list{$key}{message}."</td></tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$p = WebGUI::Paginator->new(WebGUI::URL::page('op=listInternationalMessages&lid='.$session{form}{lid}),\@row,100);
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
$output .= '<table style="font-size: 11px;" width="100%">';
|
||||
$output .= '<tr><td class="tableHeader">'.WebGUI::International::get(434).'</td><td class="tableHeader">'.
|
||||
WebGUI::International::get(575).'</td><td class="tableHeader">'.WebGUI::International::get(721)
|
||||
.'</td><td class="tableHeader">'.WebGUI::International::get(722)
|
||||
.'</td><td class="tableHeader" width="100%">'.WebGUI::International::get(230).'</td></tr>';
|
||||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
return _submenu($output);
|
||||
} else {
|
||||
|
|
@ -295,26 +336,7 @@ sub www_submitTranslation {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_submitTranslationConfirm {
|
||||
my ($sth, %data, $submission);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$submission = "#Translation export for WebGUI ".$WebGUI::Version.".\n\n";
|
||||
$submission .= "#language\n\n";
|
||||
$submission .= "delete from language where languageId=".$session{form}{lid}.";\n";
|
||||
$sth = WebGUI::SQL->read("select * from language where languageId=".$session{form}{lid});
|
||||
while (%data = $sth->hash) {
|
||||
$submission .= "insert into language (languageId,language,characterSet) values ("
|
||||
.$data{languageId}.", ".quote($data{language}).", ".quote($data{characterSet}).");\n";
|
||||
}
|
||||
$sth->finish;
|
||||
$submission .= "\n#international\n\n";
|
||||
$submission .= "delete from international where languageId=".$session{form}{lid}.";\n";
|
||||
$sth = WebGUI::SQL->read("select * from international where languageId=".$session{form}{lid});
|
||||
while (%data = $sth->hash) {
|
||||
$submission .= "insert into international (internationalId,languageId,namespace,message) values ("
|
||||
.$data{internationalId}.",".$data{languageId}.",".quote($data{namespace}).",".quote($data{message}).");\n";
|
||||
}
|
||||
$sth->finish;
|
||||
WebGUI::Mail::send("info\@plainblack.com","International Message Submission",$submission);
|
||||
WebGUI::Mail::send("info\@plainblack.com","International Message Submission",_export($session{form}{lid}));
|
||||
return www_editLanguage();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ sub _loadWobjects {
|
|||
sub close {
|
||||
$session{'dbh'}->disconnect();
|
||||
undef %session;
|
||||
$ENV{PATH_INFO} = "/"; #work around to fix a bug in mod_perl (win32)
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -174,7 +175,7 @@ sub httpHeader {
|
|||
($charset) = WebGUI::SQL->quickArray("select characterSet from language where languageId=".$session{user}{language});
|
||||
$charset = "ISO-8859-1" if ($charset eq "");
|
||||
return $session{cgi}->header(
|
||||
-type => 'text/html; charset='.$charset,
|
||||
-type => $session{header}{mimetype}.'; charset='.$charset,
|
||||
-cookie => $session{header}{cookie},
|
||||
-status => $session{header}{status}
|
||||
);
|
||||
|
|
@ -218,6 +219,9 @@ sub open {
|
|||
$session{cgi} = CGI->new();
|
||||
$CGI::POST_MAX=1024 * $session{setting}{maxAttachmentSize};
|
||||
###----------------------------
|
||||
### header variables
|
||||
$session{header}{mimetype} = 'text/html';
|
||||
###----------------------------
|
||||
### evironment variables from web server
|
||||
$session{env} = \%ENV;
|
||||
###----------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue