merging 6.2.10 and 6.2.11 changes

This commit is contained in:
JT Smith 2005-01-28 22:19:39 +00:00
parent 486b96d94d
commit d47830aceb
28 changed files with 139 additions and 59 deletions

View file

@ -62,6 +62,52 @@
- Added CDG Commerce iTransact payment plugin.
6.2.11
- Fixed a navigation problem where home page was not showing up.
- fix [ 1111452 ] 6.2.10 showDebug=1 in create.sql
- Removed fix 1079821 as it caused an ugly post bug defined as [ 1111591 ] Message Preview problems. (Duplicate message)
- fix [ 1111490 ] Calendar events in 6.2.10 (Matt Wilson)
6.2.10
- A lot of help updates (Colin Kuskie)
- A bunch of GUID fixes (Eric Kennedy)
- fix [ 1102676 ] Re-visit 920583 Theme imports fail (Gerald Young)
- fix [ 1085795 ] Wrong parameter count to WebGUI/Group.pm (Dri)
- fix [ 1085485 ] parentId in page table not an int
- fix [ 1080299 ] Home page can be deleted
- fix [ 1071435 ] AdminBar macro incorrectly selects packages
- fix [ 1080326 ] DeleteExpiredTrash doesn't work
- Fixed the version compare bug in testEnvironment.pl and statistics due to
the missing status.
- fix [ 1072107 ] Calling ^SI(); by id doesn't work. (Dri)
- fix [ 1055088 ] SI macro will not do by ID look-up
- fix [ 1074036 ] Eventscalendar : very slow (Milo vd Zee)
- fix [ 1069991 ] Deleted msg - problems in nested, threaded views (mdj2000)
- fix [ 1108905 ] WebGUI::Mail charset inconsistency (fix) (Dri)
- fix [ 1108539 ] Profile issues
- fix [ 1096397 ] Data Form mail acknowledgement
- fix [ 1095532 ] Deploying package with sub-pages fails
- fix [ 1089383 ] message log URL missing operation name
- fix [ 1088470 ] missing '>' in template (create.sql) - minor. (Matt Wilson)
- fix [ 1080783 ] Profile field issue
- fix [ 1079821 ] Make printable macro ignores POST variables (rainer)
- fix [ 1078370 ] CPU Spike- UNKNOWN CAUSE
- fix [ 1078488 ] bad slashes in thumbnail
- fix [ 1077905 ] Post Preview template won't load. templateId 1 hardcoded!! (mdj2000)
- fix [ 1071941 ] Time Zone
- fix [ 1076678 ] Infinite loop with snippet
- fix [ 1075290 ] forum template subscription problem
- fix [ 1072838 ] FIX -- LDAP Auth: Sign up with existing WG username crashes
(Roy Johnson)
- fix [ 1066778 ] www.plainblack.com/news?wid=920&func=viewRSS (Dri)
- fix [ 1070169 ] 6.2.9 - Template create problem
- fix [ 1110644 ] Eventscalender month crossing bug (Milo van der Zee)
- fixed a template switching problem in the 6.0.0 upgrade script.
- fix [ 1071229 ] unauthorized user can view submissions!
6.2.9
- bugfix [ 1058105 ] input tag has to be closed with /
- Changed a bunch of comparison operators that could potentially break with

View file

@ -41,12 +41,6 @@ save you many hours of grief.
changed significantly enough that automatic migration of them is
not possible.
* The recommended default location for the WebGUI log is now
/var/log/webgui.log instead of /data/webgui.log
* The default path for WebGUI backups is now /tmp/backups rather than
/data/backups
* You may add optional protection for your uploaded WebGUI files. This
will check the privileges of the files from the WebGUI database
before sending them to the browser. To enable this you must use
@ -66,6 +60,15 @@ save you many hours of grief.
there have been many changes to the API in this release.
6.2.10
--------------------------------------------------------------------
* The recommended default location for the WebGUI log is now
/var/log/webgui.log instead of /data/webgui.log
* The default path for WebGUI backups is now /tmp/backups rather than
/data/backups
6.2.8
--------------------------------------------------------------------
* Due to a bug in the theme system, if you created any themes in any

View file

@ -84,10 +84,10 @@ if ( grep /^style$/i, @tables ){
my ($newStyleId) = WebGUI::SQL->quickArray("select max(templateId) from template where namespace='style'");
if ($style->{styleId} > 0 && $style->{styleId} < 25) {
$newStyleId = $style->{styleId};
} elsif ($newStyleId > 999) {
} elsif ($newStyleId > 9999) {
$newStyleId++;
} else {
$newStyleId = 1000;
$newStyleId = 10000;
}
my $newStyle = $session{setting}{docTypeDec}.'
<html>
@ -103,7 +103,7 @@ if ( grep /^style$/i, @tables ){
';
WebGUI::SQL->write("insert into template (templateId, name, template, namespace) values (".$newStyleId.",
".quote($style->{name}).", ".quote($newStyle).", 'style')");
WebGUI::SQL->write("update page set styleId=".$newStyleId." where styleId=".$style->{styleId});
WebGUI::SQL->write("update page set styleId=".quote($newStyleId)." where styleId=".quote($style->{styleId}));
WebGUI::SQL->write("update themeComponent set id=".$newStyleId.", type='template' where id=".$style->{styleId}." and type='style'");
}
$sth->finish;
@ -886,7 +886,8 @@ $replace{'t'} = {
my ($sth, $data, $code, $table, $column, %identifier);
foreach $table (keys %dbFields){
unless ($sth = WebGUI::SQL->read("SELECT * FROM $table")) {die "Cannot read from table $table ";}
$sth = WebGUI::SQL->read("SELECT * FROM $table");
#unless ($sth = WebGUI::SQL->read("SELECT * FROM $table")) {die "Cannot read from table $table ";}
while ($data = $sth->hashRef){
foreach $column (@{$dbFields{$table}{fields}}){
$code = $data->{$column};

View file

@ -0,0 +1,4 @@
insert into webguiVersion values ('6.2.11','upgrade',unix_timestamp());
update page set isSystem=0, parentId='0' where pageId='1';

View file

@ -0,0 +1,8 @@
insert into webguiVersion values ('6.2.10','upgrade',unix_timestamp());
update page set isSystem=1, parentId='0' where pageId='1';
delete from template where templateId='1' and namespace='USS/Submission';
INSERT INTO template VALUES ('1','Default Submission','<h1><tmpl_var title></h1>\n<table width=\"100%\" cellpadding=2 cellspacing=1 border=0>\n<tr><td valign=\"top\" class=\"tableHeader\" width=\"100%\">\n<b><tmpl_var user.label>:</b> <a href=\"<tmpl_var user.Profile>\"><tmpl_var user.username></a><br />\n<b><tmpl_var date.label>:</b> <tmpl_var date.human><br />\n<b><tmpl_var status.label>:</b> <tmpl_var status.status><br />\n<b><tmpl_var views.label>:</b> <tmpl_var views.count><br />\n</td>\n<td rowspan=\"2\" class=\"tableMenu\" nowrap=\"1\" valign=\"top\">\n\n<tmpl_if previous.more>\n <a href=\"<tmpl_var previous.url>\">&laquo;<tmpl_var previous.label></a><br />\n</tmpl_if>\n<tmpl_if next.more>\n <a href=\"<tmpl_var next.url>\"><tmpl_var next.label>&raquo;</a><br />\n</tmpl_if>\n<tmpl_if canEdit>\n <a href=\"<tmpl_var edit.url>\"><tmpl_var edit.label></a><br />\n <a href=\"<tmpl_var delete.url>\"><tmpl_var delete.label></a><br />\n</tmpl_if>\n<tmpl_if canChangeStatus>\n <a href=\"<tmpl_var approve.url>\"><tmpl_var approve.label></a><br />\n <a href=\"<tmpl_var deny.url>\"><tmpl_var deny.label></a><br />\n</tmpl_if>\n<tmpl_if canPost>\n <a href=\"<tmpl_var post.url>\"><tmpl_var post.label></a><br />\n</tmpl_if>\n<a href=\"<tmpl_var search.url>\"><tmpl_var search.label></a><br />\n<a href=\"<tmpl_var back.url>\"><tmpl_var back.label></a><br />\n\n</td> </tr><tr><td class=\"tableData\">\n<tmpl_if image.url>\n <img src=\"<tmpl_var image.url>\" border=\"0\"><p />\n</tmpl_if>\n<tmpl_var content><p />\n<tmpl_var attachment.box><br />\n\n</td></tr></table>\n\n<tmpl_var replies>','USS/Submission',1,1);
delete from template where templateId='1' and namespace='Forum/Thread';
INSERT INTO template VALUES ('1','Default Thread','<h1><tmpl_var forum.title></h1><div align=\"right\">\r\n<script language=\"JavaScript\" type=\"text/javascript\"> <!--\r\n function goLayout(){\r\n location = document.layout.layoutSelect.options[document.layout.layoutSelect.selectedIndex].value\r\n }\r\n //--> </script>\r\n\r\n <form name=\"layout\"><select name=\"layoutSelect\" size=\"1\" onChange=\"goLayout()\">\r\n <option value=\"<tmpl_var thread.layout.flat.url>\" <tmpl_if thread.layout.isFlat>selected=\"1\"</tmpl_if>><tmpl_var thread.layout.flat.label></option>\r\n <option value=\"<tmpl_var thread.layout.nested.url>\" <tmpl_if thread.layout.isNested>selected=\"1\"</tmpl_if>><tmpl_var thread.layout.nested.label></option>\r\n <option value=\"<tmpl_var thread.layout.threaded.url>\" <tmpl_if thread.layout.isThreaded>selected=\"1\"</tmpl_if>><tmpl_var thread.layout.threaded.label></option>\r\n </select> </form> \r\n</div>\r\n<tmpl_if thread.layout.isFlat>\r\n <tmpl_loop post_loop>\r\n <a name=\"<tmpl_var post.id>\"></a>\r\n <tmpl_if __ODD__>\r\n <div class=\"highlight\" <tmpl_if post.isCurrent>style=\"border: 4px dotted #aaaaaa; padding: 5px;\"</tmpl_if>>\r\n <tmpl_else>\r\n <div <tmpl_if post.isCurrent>style=\"border: 4px dotted #aaaaaa; padding: 5px;\"</tmpl_if>>\r\n </tmpl_if>\r\n <tmpl_var post.full>\r\n </div>\r\n </tmpl_loop>\r\n</tmpl_if>\r\n\r\n<tmpl_if thread.layout.isNested>\r\n <tmpl_loop post_loop>\r\n <table width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" border=\"0\">\r\n <tr>\r\n <tmpl_loop post.indent_loop>\r\n <td width=\"20\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</td>\r\n </tmpl_loop>\r\n <td>\r\n <a name=\"<tmpl_var post.id>\"></a>\r\n <tmpl_if __ODD__>\r\n <div class=\"highlight\" <tmpl_if post.isCurrent>style=\"border: 4px dotted #aaaaaa; padding: 5px;\"</tmpl_if>>\r\n <tmpl_else>\r\n <div <tmpl_if post.isCurrent>style=\"border: 4px dotted #aaaaaa; padding: 5px;\"</tmpl_if>>\r\n </tmpl_if>\r\n <tmpl_var post.full>\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n </tmpl_loop>\r\n</tmpl_if>\r\n\r\n<tmpl_if thread.layout.isThreaded>\r\n <tmpl_var post.full>\r\n <table width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" border=\"0\">\r\n <tr>\r\n <td class=\"tableHeader\"><tmpl_var thread.subject.label></td>\r\n <td class=\"tableHeader\"><tmpl_var thread.user.label></td>\r\n <td class=\"tableHeader\"><tmpl_var thread.date.label></td>\r\n </tr>\r\n <tmpl_loop post_loop>\r\n <tmpl_if post.isCurrent>\r\n <tr class=\"highlight\">\r\n <tmpl_else>\r\n <tr>\r\n </tmpl_if>\r\n <td class=\"tableData\"><tmpl_loop post.indent_loop>&nbsp;&nbsp;&nbsp;</tmpl_loop><a href=\"<tmpl_var post.url>\"><tmpl_var post.subject></a></td>\r\n <tmpl_if thread.root.user.isVisitor>\r\n <td class=\"tableData\"><tmpl_var post.user.name></td>\r\n <tmpl_else>\r\n <td class=\"tableData\"><a href=\"<tmpl_var post.user.profile>\"><tmpl_var post.user.name></a></td>\r\n </tmpl_if>\r\n <td class=\"tableData\"><tmpl_var post.date.value> @ <tmpl_var post.time.value></td>\r\n </tr>\r\n </tmpl_loop>\r\n </table>\r\n</tmpl_if>\r\n\r\n<p />\r\n<a href=\"<tmpl_var thread.list.url>\"><tmpl_var thread.list.label></a> &bull;\r\n<a href=\"<tmpl_var thread.previous.url>\"><tmpl_var thread.previous.label></a> &bull;\r\n<a href=\"<tmpl_var thread.next.url>\"><tmpl_var thread.next.label></a> \r\n<tmpl_if user.canPost>\r\n &bull; <a href=\"<tmpl_var thread.new.url>\"><tmpl_var thread.new.label></a>\r\n <tmpl_if user.isModerator>\r\n &bull;\r\n <tmpl_if thread.isSticky>\r\n <a href=\"<tmpl_var thread.unstick.url>\"><tmpl_var thread.unstick.label></a>\r\n <tmpl_else>\r\n <a href=\"<tmpl_var thread.stick.url>\"><tmpl_var thread.stick.label></a>\r\n </tmpl_if>\r\n &bull;\r\n <tmpl_if thread.isLocked>\r\n <a href=\"<tmpl_var thread.unlock.url>\"><tmpl_var thread.unlock.label></a>\r\n <tmpl_else>\r\n <a href=\"<tmpl_var thread.lock.url>\"><tmpl_var thread.lock.label></a>\r\n </tmpl_if>\r\n </tmpl_if>\r\n</tmpl_if>\r\n<tmpl_unless user.isVisitor>\r\n &bull;\r\n <tmpl_if user.isSubscribed>\r\n <a href=\"<tmpl_var thread.unsubscribe.url>\"><tmpl_var thread.unsubscribe.label></a>\r\n <tmpl_else>\r\n <a href=\"<tmpl_var thread.subscribe.url>\"><tmpl_var thread.subscribe.label></a>\r\n </tmpl_if>\r\n</tmpl_unless>\r\n\r\n<tmpl_if multiplePages>\r\n <div class=\"pagination\">\r\n <tmpl_var previousPage> &middot; <tmpl_var pageList> &middot; <tmpl_var nextPage>\r\n </div>\r\n</tmpl_if>\r\n\r\n<div align=\"center\">\r\n<a href=\"<tmpl_var callback.url>\">-=: <tmpl_var callback.label> :=-</a>\r\n</div>','Forum/Thread',1,1);

View file

@ -29,7 +29,7 @@ sub _hasVoted {
my $self = shift;
my ($hasVoted) = WebGUI::SQL->quickArray("select count(*) from Poll_answer
where assetId=".quote($self->getId)." and ((userId=".quote($session{user}{userId})."
and userId<>1) or (userId=1 and ipAddress='$session{env}{REMOTE_ADDR}'))");
and userId<>'1') or (userId='1' and ipAddress='$session{env}{REMOTE_ADDR}'))");
return $hasVoted;
}

View file

@ -442,7 +442,7 @@ sub getResponseCount {
my $ipAddress = $self->getIp;
my $userId = $self->getUserId;
my ($count) = WebGUI::SQL->quickArray("select count(*) from Survey_response where Survey_id=".quote($self->get("Survey_id"))." and
((userId<>1 and userId=".quote($userId).") or ( userId=1 and ipAddress=".quote($ipAddress)."))");
((userId<>'1' and userId=".quote($userId).") or ( userId='1' and ipAddress=".quote($ipAddress)."))");
return $count;
}

View file

@ -318,7 +318,7 @@ sub view {
if ($constraints ne "") {
$constraints = "USS_submission.status='Approved' and ".$constraints;
} else {
$constraints = "(USS_submission.status='Approved' or (USS_submission.userId=".quote($session{user}{userId})." and USS_submission.userId<>1)";
$constraints = "(USS_submission.status='Approved' or (USS_submission.userId=".quote($session{user}{userId})." and USS_submission.userId<>'1')";
if ($var{canModerate}) {
$constraints .= " or USS_submission.status='Pending'";
}

View file

@ -217,7 +217,7 @@ sub createAccountSave {
#Check that username is valid and not a duplicate in the system.
$error .= $self->error if($self->validUsername($username));
$error .= $self->error if(!$self->validUsername($username));
#Validate profile data.
my ($profile, $temp, $warning) = WebGUI::Operation::Profile::validateProfileData();
$error .= $temp;

View file

@ -241,7 +241,7 @@ A string representing the output format for the date. Defaults to '%z %Z'. You c
%m = A two digit month.
%M = A variable digit month.
%n = A two digit minute.
%o = Offset from GMT represented as an integer.
%o = Offset from local time represented as an integer.
%O = Offset from GMT represented in four digit form with a sign. Example: -0600
%p = A lower-case am/pm.
%P = An upper-case AM/PM.
@ -265,9 +265,11 @@ sub epochToHuman {
my ($year,$month,$day,$hour,$min,$sec) = epochToArray($temp);
$output = $_[1] || "%z %Z";
#---GMT Offsets
$temp = $session{user}{timeOffset}*100;
$temp = sprintf('%+05d',$temp);
$output =~ s/\%O/$temp/g;
if ($output =~ /\%O/) {
$temp = $session{user}{timeOffset}*100;
$temp = sprintf("%+05d",Date::Manip::UnixDate("now","%z")+$temp);
$output =~ s/\%O/$temp/g;
}
$temp = $session{user}{timeOffset}+0;
$output =~ s/\%o/$temp/g;
#---dealing with percent symbol

View file

@ -454,7 +454,7 @@ sub process {
$type = "text" if ($type eq "");
$value = &$type($name);
unless (defined $value) {
$value = $default;
return $default;
}
if ($value =~ /^[\s]+$/) {
return undef;

View file

@ -214,7 +214,7 @@ sub hasRated {
return 1 if ($userId != 1 && $userId eq $self->get("userId")); # is poster
$ipAddress = $session{env}{REMOTE_ADDR} unless ($ipAddress);
my ($flag) = WebGUI::SQL->quickArray("select count(*) from forumPostRating where forumPostId="
.quote($self->get("forumPostId"))." and ((userId=".quote($userId)." and userId<>1) or (userId=1 and
.quote($self->get("forumPostId"))." and ((userId=".quote($userId)." and userId<>1) or (userId='1' and
ipAddress=".quote($ipAddress)."))");
return $flag;
}

View file

@ -1393,8 +1393,11 @@ The unique id of the post that was selected by the user in this thread.
sub getFlatThread {
my ($post, $thread, $forum, $caller, $currentPost) = @_;
my (@post_loop, @posts);
@posts = WebGUI::SQL->buildArray("SELECT forumPostId FROM forumPost WHERE forumThreadId=".quote($thread->get("forumThreadId"))." ORDER BY dateOfPost");
my (@post_loop, @posts, $OR);
unless ($post->getThread->getForum->isModerator) {
$OR = "OR status='denied' OR status='pending'";
}
@posts = WebGUI::SQL->buildArray("SELECT forumPostId FROM forumPost WHERE forumThreadId=".quote($thread->get("forumThreadId"))." AND NOT (status='deleted' $OR) ORDER BY dateOfPost");
foreach my $postId (@posts){
my $post = WebGUI::Forum::Post->new($postId);
push (@post_loop, getPostTemplateVars($post,$thread, $forum, $caller, {
@ -1829,7 +1832,7 @@ sub www_postPreview {
$newPost->{_properties}->{userId} = $session{user}{userId};
$newPost->{_properties}->{username} = ($session{form}{visitorName} || $session{user}{alias});
$newPost->{_properties}->{dateOfPost} = WebGUI::DateTime::time();
my $forum = WebGUI::Forum->new($forumId);
my $var = getPostTemplateVars($newPost, WebGUI::Forum::Thread->new($threadId), WebGUI::Forum->new($forumId), $caller);
$var->{'newpost.header'} = WebGUI::International::get('Forum, Preview Heading');
@ -1851,7 +1854,7 @@ sub www_postPreview {
$var->{'form.begin'} .= WebGUI::Form::hidden({name=>'forumOp', value=>"postSave"});
$var->{'form.submit'} = WebGUI::Form::submit();
$var->{'form.end'} = WebGUI::Form::formFooter();
return WebGUI::Template::process(1,"Forum/PostPreview", $var);
return WebGUI::Template::process($forum->get("postPreviewTemplateId"),"Forum/PostPreview", $var);
}

View file

@ -349,7 +349,8 @@ The name of the group you wish to instanciate.
=cut
sub find {
my ($groupId) = WebGUI::SQL->quickArray("select groupId from groups where groupName=".quote($_[1]));
my $name = shift;
my ($groupId) = WebGUI::SQL->quickArray("select groupId from groups where groupName=".quote($name));
return WebGUI::Group->new($groupId);
}

View file

@ -161,6 +161,9 @@ sub process {
if ($@) {
WebGUI::ErrorHandler::warn("Processing failed on macro: $macro: ".$@);
} else {
if ($result =~ /\Q$macro/) {
$result = "Endless macro loop detected. Stopping recursion.";
}
$content =~ s/\Q$macro/$result/ges;
}
}

View file

@ -42,7 +42,7 @@ sub process {
my ($collateralIdent,$width,$height,$parameters) = WebGUI::Macro::getParams($_[0]);
my ($collateral,$url);
if ($collateralIdent =~ /^\d+$/) {
if ($collateralIdent =~ /[\w|\-]{22}/) {
$collateral = WebGUI::Collateral->new($collateralIdent);
}
else {

View file

@ -14,7 +14,7 @@ use strict;
use WebGUI::International;
use WebGUI::Macro;
use WebGUI::Session;
use WebGUI::Asset::Template;
use WebGUI::Template;
use WebGUI::URL;
use WebGUI::Utility;
@ -28,7 +28,10 @@ sub process {
}
$temp = WebGUI::URL::append($session{env}{REQUEST_URI},$append);
if ($param[1] ne "") {
$temp = WebGUI::URL::append($temp,'styleId='.$param[1]);
($styleId) = WebGUI::Template::getIdByName($param[1],"style");
if ($styleId != 0) {
$temp = WebGUI::URL::append($temp,'styleId='.$styleId);
}
}
if ($param[0] ne "linkonly") {
my %var;
@ -38,11 +41,7 @@ sub process {
} else {
$var{'printable.text'} = WebGUI::International::get(53);
}
if ($param[2]) {
$temp = WebGUI::Asset::Template->newByUrl($param[2])->process(\%var);
} else {
$temp = WebGUI::Asset::Template->new("PBtmpl0000000000000109")->process(\%var);
}
$temp = WebGUI::Template::process(WebGUI::Template::getIdByName($param[2],"Macro/r_printable"), "Macro/r_printable", \%var);
}
return $temp;
}

View file

@ -92,6 +92,7 @@ sub send {
$message .= "BCC: $_[5]\n" if ($_[5]);
$message .= "Subject: ".$_[1]."\n";
$message .= "Date: ".WebGUI::DateTime::epochToHuman("","%W, %d %C %y %j:%n:%s %O")."\n";
$message .= "Content-Type: text/plain; charset=UTF-8","charset")."\n";
$message .= "\n";
$message = WebGUI::Macro::process($message);
#body

View file

@ -124,6 +124,9 @@ sub addEntry {
unless ($url =~ /^http/ || !defined $url) {
$url = WebGUI::URL::getSiteURL().$url;
}
unless ($url =~ /op=/ || !defined $url) {
$url = WebGUI::URL::append($url, "op=viewMessageLogMessage");
}
$status = $_[5];
$from = $_[6];
if ($groupId ne "") {
@ -189,6 +192,9 @@ sub addInternationalizedEntry {
unless ($url =~ /^http/ || !defined $url) {
$url = WebGUI::URL::getSiteURL().$url;
}
unless ($url =~ /op=/ || !defined $url) {
$url = WebGUI::URL::append($url, "op=viewMessageLogMessage");
}
$internationalId = $_[3];
$namespace = $_[4] || "WebGUI";
$status = $_[5] || 'notice';

View file

@ -114,7 +114,7 @@ sub validateProfileData {
$a = WebGUI::SQL->read("select * from userProfileField,userProfileCategory where userProfileField.profileCategoryId=userProfileCategory.profileCategoryId
and userProfileCategory.editable=1 and userProfileField.editable=1 order by userProfileCategory.sequenceNumber,userProfileField.sequenceNumber");
while (%field = $a->hash) {
$data{$field{fieldName}} = WebGUI::Macro::negate(WebGUI::FormProcessor::process($field{fieldName},$field{dataType}));
$data{$field{fieldName}} = WebGUI::Macro::negate(WebGUI::FormProcessor::process($field{fieldName},$field{dataType},""));
if ($field{required} && $data{$field{fieldName}} eq "") {
$error .= '<li>'.(eval $field{fieldLabel}).' '.WebGUI::International::get(451);
}elsif($field{fieldName} eq "email" && isDuplicateEmail($data{$field{fieldName}})){
@ -150,8 +150,13 @@ sub www_editProfile {
$label = eval $data->{fieldLabel};
$default = eval $data->{dataDefault};
if ($method eq "selectList") {
$values = eval $data->{dataValues};
if ($method eq "selectList" || $method eq "checkList" || $method eq "radioList") {
$values = eval $data->{dataValues};
my $orderedValues = {};
tie %{$orderedValues}, 'Tie::IxHash';
foreach my $ov (sort keys %{$values}) {
$orderedValues->{$ov} = $values->{$ov};
}
# note: this big if statement doesn't look elegant, but doing regular ORs caused problems with the array reference.
if ($session{form}{$data->{fieldName}}) {
$default = [$session{form}{$data->{fieldName}}];

View file

@ -74,7 +74,7 @@ sub www_deleteProfileCategoryConfirm {
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
return WebGUI::Privilege::vitalComponent() if ($session{form}{cid} < 1000 && $session{form}{cid} > 0);
WebGUI::SQL->write("delete from userProfileCategory where profileCategoryId=".quote($session{form}{cid}));
WebGUI::SQL->write("update userProfileField set profileCategoryId=1 where profileCategoryId=".quote($session{form}{cid}));
WebGUI::SQL->write("update userProfileField set profileCategoryId='1' where profileCategoryId=".quote($session{form}{cid}));
return www_editProfileSettings();
}

View file

@ -94,13 +94,13 @@ sub www_viewStatistics {
$version = '<a href="http://files.plainblack.com/downloads/'.$rev[0].'.x.x/webgui-'.$version.'.tar.gz">'.$version.'</a>';
}
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(349).':</td><td class="tableData">'.$version.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId<>3");
($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId<>'3'");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(147).':</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId=0");
($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId='0'");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(795).':</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId=5");
($data) = WebGUI::SQL->quickArray("select count(*) from page where parentId='5'");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(794).':</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from wobject where pageId<>3");
($data) = WebGUI::SQL->quickArray("select count(*) from wobject where pageId<>'3'");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(148).':</td><td class="tableData">'.$data.'</td></tr>';
($data) = WebGUI::SQL->quickArray("select count(*) from template where namespace='style'");
$output .= '<tr><td align="right" class="tableHeader">'.WebGUI::International::get(427).':</td><td class="tableData">'.$data.'</td></tr>';

View file

@ -173,7 +173,7 @@ Builds a hash of data from a series of rows.
=head3 sql
An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by an underscore "_" to form a complex key.
An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by a colon ":" to form a complex key.
=head3 dbh
@ -187,7 +187,7 @@ sub buildHash {
$sth = WebGUI::SQL->read($_[1],$_[2]);
while (@data = $sth->array) {
my $value = pop @data;
my $key = join("_",@data);
my $key = join(":",@data);
$hash{$key} = $value;
}
$sth->finish;

View file

@ -19,6 +19,7 @@ use File::Copy qw(cp);
use FileHandle;
use File::Path;
use POSIX;
use Storable qw(nstore retrieve);
use strict;
use warnings;
use WebGUI::ErrorHandler;
@ -241,7 +242,8 @@ sub addFileFromHashref {
my $self = shift;
my $filename = WebGUI::URL::makeCompliant(shift);
my $hashref = shift;
store $hashref, $self->getPath($filename) or $self->_addError("Couldn't create file ".$self->getPath($filename)." because ".$!);
bless $hashref;
nstore $hashref, $self->getPath($filename) or $self->_addError("Couldn't create file ".$self->getPath($filename)." because ".$!);
return $filename;
}

View file

@ -408,9 +408,9 @@ sub www_view {
} elsif ($_[0]->get("endMonth") eq "after6") {
$maxDate = WebGUI::DateTime::addToDate($minDate,0,6,0);
} elsif ($_[0]->get("endMonth") eq "after3") {
$maxDate = WebGUI::DateTime::addToDate($minDate,0,3,0);
$maxDate = WebGUI::DateTime::addToDate($minDate,0,3,0);
} elsif ($_[0]->get("endMonth") eq "current") { # a hack that we need to get the default month to be end month. probably a better way to do it
$maxDate = WebGUI::DateTime::addToDate($minDate,0,1,0);
$maxDate = WebGUI::DateTime::addToDate($minDate,0,1,0);
}
$maxDate = $maxDate || WebGUI::DateTime::time();
@ -434,32 +434,28 @@ sub www_view {
# get event information
my $query = "select * from EventsCalendar_event where ";
$query .= " wobjectId=".quote($_[0]->get("wobjectId"))." and " unless ($_[0]->get("isMaster"));
$query .= " (endDate>=$monthStart and endDate<=$monthEnd) and (startDate>=$monthStart and startDate<=$monthEnd) order by startDate,endDate";
$query .= " ((endDate>=$monthStart and endDate<=$monthEnd) or (startDate>=$monthStart and startDate<=$monthEnd)) order by startDate,endDate";
my %events;
my %previous;
my $sth = WebGUI::SQL->read($query,WebGUI::SQL->getSlave);
while (my $event = $sth->hashRef) {
my $eventLength = WebGUI::DateTime::getDaysInInterval($event->{startDate},$event->{endDate});
my $startYear = epochToHuman($event->{startDate},"%y");
my $startMonth = epochToHuman($event->{startDate},"%c");
my $startDay = epochToHuman($event->{startDate},"%D");
my $endYear = epochToHuman($event->{endDate},"%y");
my $endMonth = epochToHuman($event->{endDate},"%c");
my $endDay = epochToHuman($event->{endDate},"%D");
my ($startYear, $startMonth, $startDay, $startDate, $startTime) = split " ", WebGUI::DateTime::epochToHuman($event->{startDate}, "%y %c %D %z %Z");
my ($endYear, $endMonth, $endDay, $endDate, $endTime) = split " ", WebGUI::DateTime::epochToHuman($event->{endDate}, "%y %c %D %z %Z");
for (my $i=0; $i<=$eventLength; $i++) {
my @date = WebGUI::DateTime::epochToArray(WebGUI::DateTime::addToDate($event->{startDate},0,0,$i));
if ($date[1] == $thisMonthDate[1]) {
push(@{$events{$date[2]}}, {
description=>$event->{description},
name=>$event->{name},
'start.date.human'=>WebGUI::DateTime::epochToHuman($event->{startDate},"%z"),
'start.time.human'=>WebGUI::DateTime::epochToHuman($event->{startDate},"%Z"),
'start.date.human'=>$startDate,
'start.time.human'=>$startTime,
'start.date.epoch'=>$event->{startDate},
'start.year'=>$startYear,
'start.month'=>$startMonth,
'start.day'=>$startDay,
'end.date.human'=>WebGUI::DateTime::epochToHuman($event->{endDate},"%z"),
'end.time.human'=>WebGUI::DateTime::epochToHuman($event->{endDate},"%Z"),
'end.date.human'=>$endDate,
'end.time.human'=>$endTime,
'end.date.epoch'=>$event->{endDate},
'end.year'=>$endYear,
'end.month'=>$endMonth,

View file

@ -377,10 +377,10 @@ $version = $response->content;
chomp $version;
if ($response->is_error) {
print "Couldn't connect to Plain Black Software. Check your connection and try again.\n";
} elsif ($version eq $WebGUI::VERSION) {
} elsif ($version eq $WebGUI::VERSION."-".$WebGUI::STATUS) {
print $version." OK\n";
} else {
print "You are using ".$WebGUI::VERSION." and ".$version." is available.\n";
print "You are using ".$WebGUI::VERSION."-".$WebGUI::STATUS." and ".$version." is available.\n";
}