bunches o syntax fixes.

This commit is contained in:
Matthew Wilson 2006-01-14 21:06:52 +00:00
parent 742e63e389
commit 19bce8eaf6
14 changed files with 24 additions and 24 deletions

View file

@ -132,7 +132,7 @@ sub getEditForm {
$tabform->getTab("properties")->readOnly( $tabform->getTab("properties")->readOnly(
-label=>$i18n->get('thumbnail'), -label=>$i18n->get('thumbnail'),
-hoverHelp=>$i18n->get('Thumbnail description'), -hoverHelp=>$i18n->get('Thumbnail description'),
-value=>'<a href="'.$self->getFileUrl.'"><img src="'.$self->getThumbnailUrl.'?noCache='$self->session->datetime->time().'" alt="thumbnail" /></a>' -value=>'<a href="'.$self->getFileUrl.'"><img src="'.$self->getThumbnailUrl.'?noCache='.$self->session->datetime->time().'" alt="thumbnail" /></a>'
); );
my ($x, $y) = $self->getStorageLocation->getSizeInPixels($self->get("filename")); my ($x, $y) = $self->getStorageLocation->getSizeInPixels($self->get("filename"));
$tabform->getTab("properties")->readOnly( $tabform->getTab("properties")->readOnly(

View file

@ -1105,7 +1105,7 @@ sub www_unsubscribe {
my @_months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); my @_months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
sub _get_rfc822_date { sub _get_rfc822_date {
my ($time) = @_; my ($time) = @_;
my ($year, $mon, $mday, $hour, $min, $sec) = $self->session->datetime->loca$self->session->datetime->time($time); my ($year, $mon, $mday, $hour, $min, $sec) = $self->session->datetime->localtime($time);
my $month = $_months[$mon - 1]; my $month = $_months[$mon - 1];
return sprintf("%02d %s %04d %02d:%02d:%02d GMT", return sprintf("%02d %s %04d %02d:%02d:%02d GMT",
$mday, $month, $year, $hour, $min, $sec); $mday, $month, $year, $hour, $min, $sec);

View file

@ -428,7 +428,7 @@ sub www_viewReport {
); );
$f->submit(-value=>"Search"); $f->submit(-value=>"Search");
$var{'form'} = $f->print; $var{'form'} = $f->print;
my $url = $self->getUrl("func=viewReport&selectDepartment=$self->session->form->process("selectDepartment")&reportPagination=$self->session->form->process("reportPagination")&startDate=$self->session->form->process("startDate")&endDate=$self->session->form->process("endDate")&doit=1"); my $url = $self->getUrl("func=viewReport;selectDepartment=".$self->session->form->process("selectDepartment").";reportPagination=".$self->session->form->process("reportPagination").";startDate=".$self->session->form->process("startDate").";endDate=".$self->session->form->process("endDate").";doit=1");
if ($self->session->form->process("doit")) { if ($self->session->form->process("doit")) {
$var{showReport} = 1; $var{showReport} = 1;
$endDate = $self->session->datetime->addToTime($endDate,24,0,0); $endDate = $self->session->datetime->addToTime($endDate,24,0,0);

View file

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

View file

@ -1173,16 +1173,16 @@ sub www_respond {
if ($key =~ /^answerId_(.+)$/) { if ($key =~ /^answerId_(.+)$/) {
my $id = $1; my $id = $1;
my ($previousResponse) = $self->session->db->quickArray("select count(*) from Survey_questionResponse my ($previousResponse) = $self->session->db->quickArray("select count(*) from Survey_questionResponse
where Survey_answerId=".$self->session->db->quote($self->session->form->process(""answerId_".$id"))." and Survey_responseId=".$self->session->db->quote($self->session->scratch->get($varname))); where Survey_answerId=".$self->session->db->quote($self->session->form->process("answerId_".$id))." and Survey_responseId=".$self->session->db->quote($self->session->scratch->get($varname)));
next if ($previousResponse); next if ($previousResponse);
my $answer = $self->getCollateral("Survey_answer","Survey_answerId",$self->session->form->process(""answerId_".$id")); my $answer = $self->getCollateral("Survey_answer","Survey_answerId",$self->session->form->process("answerId_".$id));
if ($self->get("questionOrder") eq "response" && $answer->{gotoQuestion} eq "") { if ($self->get("questionOrder") eq "response" && $answer->{gotoQuestion} eq "") {
$terminate = 1; $terminate = 1;
} }
my $response = $self->session->form->process(""textResponse_".$id} || $answer->{answer"); my $response = $self->session->form->process("textResponse_".$id) || $answer->{answer});
$self->session->db->write("insert into Survey_questionResponse (Survey_answerId,Survey_questionId,Survey_responseId,Survey_id,comment,response,dateOfResponse) values ( $self->session->db->write("insert into Survey_questionResponse (Survey_answerId,Survey_questionId,Survey_responseId,Survey_id,comment,response,dateOfResponse) values (
".$self->session->db->quote($answer->{Survey_answerId}).", ".$self->session->db->quote($answer->{Survey_questionId}).", ".$self->session->db->quote($self->session->scratch->get($varname).", ".$self->session->db->quote($answer->{Survey_id}).", ".$self->session->db->quote($answer->{Survey_answerId}).", ".$self->session->db->quote($answer->{Survey_questionId}).", ".$self->session->db->quote($self->session->scratch->get($varname).", ".$self->session->db->quote($answer->{Survey_id}).",
".$self->session->db->quote($self->session->form->process(""comment_".$id")).", ".$self->session->db->quote($response).", ".$self->session->datetime->time().")"); ".$self->session->db->quote($self->session->form->process("comment_".$id)).", ".$self->session->db->quote($response).", ".$self->session->datetime->time().")");
} }
} }
my $responseCount = $self->getQuestionResponseCount($self->session->scratch->get($varname)); my $responseCount = $self->getQuestionResponseCount($self->session->scratch->get($varname));

View file

@ -222,9 +222,9 @@ sub createAccount {
value=>[$connection->{ldapLinkId}], value=>[$connection->{ldapLinkId}],
extras=>qq|onchange="location.href='$url'+this.options[this.selectedIndex].value"| extras=>qq|onchange="location.href='$url'+this.options[this.selectedIndex].value"|
}); });
$vars->{'create.form.ldapId'} = WebGUI::Form::text($self->session,{"name"=>"authLDAP_ldapId","value"=>$self->session->form->process(""authLDAP_ldapId"}")); $vars->{'create.form.ldapId'} = WebGUI::Form::text($self->session,{"name"=>"authLDAP_ldapId","value"=>$self->session->form->process("authLDAP_ldapId"}));
$vars->{'create.form.ldapId.label'} = $connection->{ldapIdentityName}; $vars->{'create.form.ldapId.label'} = $connection->{ldapIdentityName};
$vars->{'create.form.password'} = WebGUI::Form::password($self->session,{"name"=>"authLDAP_identifier","value"=>$self->session->form->process(""authLDAP_identifier"}")); $vars->{'create.form.password'} = WebGUI::Form::password($self->session,{"name"=>"authLDAP_identifier","value"=>$self->session->form->process("authLDAP_identifier")});
$vars->{'create.form.password.label'} = $connection->{ldapPasswordName}; $vars->{'create.form.password.label'} = $connection->{ldapPasswordName};
$vars->{'create.form.hidden'} = WebGUI::Form::hidden($self->session,{"name"=>"confirm","value"=>$self->session->form->process("confirm")}); $vars->{'create.form.hidden'} = WebGUI::Form::hidden($self->session,{"name"=>"confirm","value"=>$self->session->form->process("confirm")});

View file

@ -176,7 +176,7 @@ sub createAccount {
.'<img src="'.$storage->getUrl($filename).'" border="0" alt="captcha" align="middle" />'; .'<img src="'.$storage->getUrl($filename).'" border="0" alt="captcha" align="middle" />';
$vars->{'create.form.captcha.label'} = $i18n->get("captcha label","AuthWebGUI"); $vars->{'create.form.captcha.label'} = $i18n->get("captcha label","AuthWebGUI");
} }
$vars->{'create.form.username'} = WebGUI::Form::text($self->session,{"name"=>"authWebGUI.username","value"=>$self->session->form->process(""authWebGUI.username"}")); $vars->{'create.form.username'} = WebGUI::Form::text($self->session,{"name"=>"authWebGUI.username","value"=>$self->session->form->process("authWebGUI.username"}));
$vars->{'create.form.username.label'} = $i18n->get(50); $vars->{'create.form.username.label'} = $i18n->get(50);
$vars->{'create.form.password'} = WebGUI::Form::password($self->session,{"name"=>"authWebGUI.identifier"}); $vars->{'create.form.password'} = WebGUI::Form::password($self->session,{"name"=>"authWebGUI.identifier"});
$vars->{'create.form.password.label'} = $i18n->get(51); $vars->{'create.form.password.label'} = $i18n->get(51);

View file

@ -98,15 +98,15 @@ sub toHtml {
tie %options, 'Tie::IxHash'; tie %options, 'Tie::IxHash';
%options = $self->orderedHash; %options = $self->orderedHash;
my @values = $self->getValues(); my @values = $self->getValues();
foreach my $key (keys %options) { foreach my $key (keys %options) {
$output .= '<option value="'.$key.'"'; $output .= '<option value="'.$key.'"';
foreach my $item (@values) { foreach my $item (@values) {
if ($item eq $key) { if ($item eq $key) {
$output .= ' selected="selected"'; $output .= ' selected="selected"';
} }
} }
$output .= '>'.${$self->get("options}"){$key}.'</option>'; $output .= '>'.$self->get("options")->{$key}.'</option>';
} }
$output .= '</select>'."\n"; $output .= '</select>'."\n";
return $output; return $output;
} }

View file

@ -47,7 +47,7 @@ sub process {
($time) = $session->dbSlave->quickArray("SELECT max(revisionDate) FROM assetData where assetId=".$session->db->quote($session->asset->getId)); ($time) = $session->dbSlave->quickArray("SELECT max(revisionDate) FROM assetData where assetId=".$session->db->quote($session->asset->getId));
my $i18n = WebGUI::International->new($session,'Macro_LastModified'); my $i18n = WebGUI::International->new($session,'Macro_LastModified');
return $i18n->get('never') if $time eq 0; return $i18n->get('never') if $time eq 0;
return $label$session->datetime->epochToHuman($time,$format) if ($time); return $label.$session->datetime->epochToHuman($time,$format) if ($time);
} }
1; 1;

View file

@ -108,7 +108,7 @@ sub process {
} }
} }
# If we reach this point, we had no success in finding an asset the user can view: # If we reach this point, we had no success in finding an asset the user can view:
$session->errorHandler->warn("Could not find a random thread that was viewable by the user $session->user->profileField("username") after $numberOfTries tries. Check parameters of macro on page ".$session->asset->get('url')); $session->errorHandler->warn("Could not find a random thread that was viewable by the user ".$session->user->profileField("username")." after $numberOfTries tries. Check parameters of macro on page ".$session->asset->get('url'));
return ''; return '';
} }

View file

@ -64,8 +64,8 @@ sub www_viewActiveSessions {
while (%data = $sth->hash) { while (%data = $sth->hash) {
$row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>'; $row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>';
$row[$i] .= '<td>'.$data{sessionId}.'</td>'; $row[$i] .= '<td>'.$data{sessionId}.'</td>';
$row[$i] .= '<td>'$session->datetime->epochToHuman($data{expires}).'</td>'; $row[$i] .= '<td>'.$session->datetime->epochToHuman($data{expires}).'</td>';
$row[$i] .= '<td>'$session->datetime->epochToHuman($data{lastPageView}).'</td>'; $row[$i] .= '<td>'.$session->datetime->epochToHuman($data{lastPageView}).'</td>';
$row[$i] .= '<td>'.$data{lastIP}.'</td>'; $row[$i] .= '<td>'.$data{lastIP}.'</td>';
$row[$i] .= '<td align="center">'.$session->icon->delete("op=killSession;sid=$data{sessionId}").'</td></tr>'; $row[$i] .= '<td align="center">'.$session->icon->delete("op=killSession;sid=$data{sessionId}").'</td></tr>';
$i++; $i++;

View file

@ -478,7 +478,7 @@ sub www_editGrouping {
sub www_editGroupingSave { sub www_editGroupingSave {
my $session = shift; my $session = shift;
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3) || _hasSecondaryPrivilege($session->form->process("gid"))); return $session->privilege->adminOnly() unless ($session->user->isInGroup(3) || _hasSecondaryPrivilege($session->form->process("gid")));
$group->userGroupExpireDate($session->form->process("uid"),$session->form->process("gid")$session->datetime->setToEpoch($session->form->process("expireDate"))); $group->userGroupExpireDate($session->form->process("uid"),$session->form->process("gid"),$session->datetime->setToEpoch($session->form->process("expireDate")));
$group->userIsAdmin($session->form->process("uid"),$session->form->process("gid"),$session->form->process("groupAdmin")); $group->userIsAdmin($session->form->process("uid"),$session->form->process("gid"),$session->form->process("groupAdmin"));
return www_manageUsersInGroup(); return www_manageUsersInGroup();
} }
@ -659,7 +659,7 @@ sub www_manageUsersInGroup {
.$session->icon->edit('op=editGrouping;uid='.$row->{userId}.';gid='.$session->form->process("gid")) .$session->icon->edit('op=editGrouping;uid='.$row->{userId}.';gid='.$session->form->process("gid"))
.'</td>'; .'</td>';
$output .= '<td class="tableData"><a href="'.$session->url->page('op=editUser;uid='.$row->{userId}).'">'.$row->{username}.'</a></td>'; $output .= '<td class="tableData"><a href="'.$session->url->page('op=editUser;uid='.$row->{userId}).'">'.$row->{username}.'</a></td>';
$output .= '<td class="tableData">'$session->datetime->epochToHuman($row->{expireDate},"%z").'</td></tr>'; $output .= '<td class="tableData">'.$session->datetime->epochToHuman($row->{expireDate},"%z").'</td></tr>';
} }
$output .= '</table>'.WebGUI::Form::formFooter($session,); $output .= '</table>'.WebGUI::Form::formFooter($session,);
$output .= $p->getBarTraditional; $output .= $p->getBarTraditional;

View file

@ -44,7 +44,7 @@ sub www_viewLoginHistory {
$data{username} = $i18n->get('unknown user') if ($data{userId} eq "0"); $data{username} = $i18n->get('unknown user') if ($data{userId} eq "0");
$row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>'; $row[$i] = '<tr class="tableData"><td>'.$data{username}.' ('.$data{userId}.')</td>';
$row[$i] .= '<td>'.$data{status}.'</td>'; $row[$i] .= '<td>'.$data{status}.'</td>';
$row[$i] .= '<td>'$session->datetime->epochToHuman($data{timeStamp},"%H:%n%p %M/%D/%y").'</td>'; $row[$i] .= '<td>'.$session->datetime->epochToHuman($data{timeStamp},"%H:%n%p %M/%D/%y").'</td>';
$row[$i] .= '<td>'.$data{ipAddress}.'</td>'; $row[$i] .= '<td>'.$data{ipAddress}.'</td>';
$row[$i] .= '<td>'.$data{userAgent}.'</td></tr>'; $row[$i] .= '<td>'.$data{userAgent}.'</td></tr>';
$i++; $i++;

View file

@ -503,12 +503,12 @@ sub www_listUsers {
$output .= '<td><a href="'.$session->url->page('op=editUser;uid='.$data->{userId}) $output .= '<td><a href="'.$session->url->page('op=editUser;uid='.$data->{userId})
.'">'.$data->{username}.'</a></td>'; .'">'.$data->{username}.'</a></td>';
$output .= '<td class="tableData">'.$data->{email}.'</td>'; $output .= '<td class="tableData">'.$data->{email}.'</td>';
$output .= '<td class="tableData">'$session->datetime->epochToHuman($data->{dateCreated},"%z").'</td>'; $output .= '<td class="tableData">'.$session->datetime->epochToHuman($data->{dateCreated},"%z").'</td>';
$output .= '<td class="tableData">'$session->datetime->epochToHuman($data->{lastUpdated},"%z").'</td>'; $output .= '<td class="tableData">'.$session->datetime->epochToHuman($data->{lastUpdated},"%z").'</td>';
my ($lastLoginStatus, $lastLogin) = $session->db->quickArray("select status,timeStamp from userLoginLog where my ($lastLoginStatus, $lastLogin) = $session->db->quickArray("select status,timeStamp from userLoginLog where
userId=".$session->db->quote($data->{userId})." order by timeStamp DESC"); userId=".$session->db->quote($data->{userId})." order by timeStamp DESC");
if ($lastLogin) { if ($lastLogin) {
$output .= '<td class="tableData">'$session->datetime->epochToHuman($lastLogin).'</td>'; $output .= '<td class="tableData">'.$session->datetime->epochToHuman($lastLogin).'</td>';
} else { } else {
$output .= '<td class="tableData"> - </td>'; $output .= '<td class="tableData"> - </td>';
} }