tons more fixes. getting closer to gamma.
This commit is contained in:
parent
fa5439b099
commit
9c7e8699a2
9 changed files with 65 additions and 48 deletions
|
|
@ -115,7 +115,7 @@ sub page {
|
|||
$session->errorHandler->error("The notFound page failed to be created!");
|
||||
$output = "An error was encountered while processing your request.";
|
||||
}
|
||||
$output = "An error was encountered while processing your request." unless $output ne '';
|
||||
$output = "An error was encountered while processing your request." if $output eq '';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ sub render {
|
|||
my $importNodeLineage = $importNode->get("lineage");
|
||||
my $assetLineage = $self->session->asset->get("lineage");
|
||||
if ($assetLineage =~ /^$importNodeLineage/ || $assetLineage eq "000001") {
|
||||
$var{"backtosite.url"} = $self->getDefault($self->session)->getUrl;
|
||||
$var{"backtosite.url"} = WebGUI::Asset->getDefault($self->session)->getUrl;
|
||||
} else {
|
||||
$var{"backtosite.url"} = $self->session->asset->getContainer->getUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,7 +267,6 @@ We override the update method from WebGUI::Asset in order to handle file system
|
|||
|
||||
sub update {
|
||||
my $self = shift;
|
||||
use WebGUI; WebGUI::dumpSession("foo");
|
||||
my %before = (
|
||||
owner => $self->get("ownerUserId"),
|
||||
view => $self->get("groupIdView"),
|
||||
|
|
|
|||
|
|
@ -648,27 +648,27 @@ sub view {
|
|||
my $self = shift;
|
||||
my $passedVars = shift;
|
||||
my $var;
|
||||
##Priority encoding
|
||||
if ( $self->session->form->process("mode") eq "form") {
|
||||
$self->viewForm($passedVars);
|
||||
}
|
||||
elsif ( $self->session->form->process("mode") eq "list") {
|
||||
$self->viewList;
|
||||
}
|
||||
##Priority encoding
|
||||
if ( $self->session->form->process("mode") eq "form") {
|
||||
return $self->viewForm($passedVars);
|
||||
}
|
||||
elsif ( $self->session->form->process("mode") eq "list") {
|
||||
return $self->viewList;
|
||||
}
|
||||
elsif( $self->defaultViewForm ) {
|
||||
$self->viewForm($passedVars);
|
||||
}
|
||||
else {
|
||||
$self->viewList();
|
||||
}
|
||||
return $self->viewForm($passedVars);
|
||||
}
|
||||
else {
|
||||
return $self->viewList();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub viewList {
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup($self->get("groupToViewEntries")));
|
||||
return $self->processTemplate($self->getListTemplateVars,$self->get("listTemplateId"));
|
||||
return $self->session->privilege::insufficient() unless ($self->session->user->isInGroup($self->get("groupToViewEntries")));
|
||||
return $self->processTemplate($self->getListTemplateVars,$self->get("listTemplateId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -868,16 +868,16 @@ sub www_editFieldSave {
|
|||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
$self->session->form->process("name") = $self->session->form->process("label") if ($self->session->form->process("name") eq "");
|
||||
$self->session->form->process("tid") = "0" if ($self->session->form->process("tid") eq "");
|
||||
$self->session->form->process("name") = $self->session->url->urlize($self->session->form->process("name"));
|
||||
$self->session->form->process("name") =~ s/\-//g;
|
||||
$self->session->form->process("name") =~ s/\///g;
|
||||
my $tid = $self->session->form->process("tid") || "0";
|
||||
my $name = $self->session->url->urlize($self->session->form->process("name"));
|
||||
$name =~ s/\-//g;
|
||||
$name =~ s/\///g;
|
||||
$self->setCollateral("DataForm_field","DataForm_fieldId",{
|
||||
DataForm_fieldId=>$self->session->form->process("fid"),
|
||||
width=>$self->session->form->process("width"),
|
||||
name=>$self->session->form->process("name"),
|
||||
name=>$name,
|
||||
label=>$self->session->form->process("label"),
|
||||
DataForm_tabId=>$self->session->form->process("tid"),
|
||||
DataForm_tabId=>$tid,
|
||||
status=>$self->session->form->process("status"),
|
||||
type=>$self->session->form->process("type"),
|
||||
possibleValues=>$self->session->form->process("possibleValues"),
|
||||
|
|
@ -886,12 +886,12 @@ sub www_editFieldSave {
|
|||
rows=>$self->session->form->process("rows"),
|
||||
vertical=>$self->session->form->process("vertical"),
|
||||
extras=>$self->session->form->process("extras"),
|
||||
}, "1","1", _tonull("DataForm_tabId",$self->session->form->process("tid")));
|
||||
}, "1","1", _tonull("DataForm_tabId",$tid));
|
||||
if($self->session->form->process("position")) {
|
||||
$self->session->db->write("update DataForm_field set sequenceNumber=".$self->session->db->quote($self->session->form->process("position")).
|
||||
" where DataForm_fieldId=".$self->session->db->quote($self->session->form->process("fid")));
|
||||
}
|
||||
$self->reorderCollateral("DataForm_field","DataForm_fieldId", _tonull("DataForm_tabId",$self->session->form->process("tid"))) if ($self->session->form->process("fid") ne "new");
|
||||
$self->reorderCollateral("DataForm_field","DataForm_fieldId", _tonull("DataForm_tabId",$tid)) if ($self->session->form->process("fid") ne "new");
|
||||
if ($self->session->stow->get('whatNext') eq "editField" || $self->session->form->process("proceed") eq "editField") {
|
||||
return $self->www_editField('new');
|
||||
}
|
||||
|
|
@ -905,9 +905,9 @@ sub www_editTab {
|
|||
my $i18n = WebGUI::International->new($self->session,"Asset_DataForm");
|
||||
my (%tab, $f);
|
||||
tie %tab, 'Tie::CPHash';
|
||||
$self->session->form->process("tid") = "new" if ($self->session->form->process("tid") eq "");
|
||||
unless ($self->session->form->process("tid") eq "new") {
|
||||
%tab = $self->session->db->quickHash("select * from DataForm_tab where DataForm_tabId=".$self->session->db->quote($self->session->form->process("tid")));
|
||||
my $tid = shift || $self->session->form->process("tid") || "new";
|
||||
unless ($tid eq "new") {
|
||||
%tab = $self->session->db->quickHash("select * from DataForm_tab where DataForm_tabId=".$self->session->db->quote($tid));
|
||||
}
|
||||
$f = WebGUI::HTMLForm->new($self->session,-action=>$self->getUrl);
|
||||
$f->hidden(
|
||||
|
|
@ -929,7 +929,7 @@ sub www_editTab {
|
|||
-value=>$tab{subtext},
|
||||
-subtext=>""
|
||||
);
|
||||
if ($self->session->form->process("tid") eq "new") {
|
||||
if ($tid eq "new") {
|
||||
$f->whatNext(
|
||||
-options=>{
|
||||
editTab=>$i18n->get(103),
|
||||
|
|
@ -941,25 +941,25 @@ sub www_editTab {
|
|||
$f->submit;
|
||||
my $ac = $self->getAdminConsole;
|
||||
$ac->setHelp("data form fields add/edit","Asset_DataForm");
|
||||
return $ac->render($f->print,$i18n->get('20'));
|
||||
return $ac->render($f->print,$i18n->get('103')) if $tid eq "new";
|
||||
return $ac->render($f->print,$i18n->get('102'));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editTabSave {
|
||||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
$self->session->form->process("name") = $self->session->form->process("label") if ($self->session->form->process("name") eq "");
|
||||
$self->session->form->process("name") = $self->session->url->urlize($self->session->form->process("name"));
|
||||
$self->session->form->process("name") =~ s/\-//g;
|
||||
$self->session->form->process("name") =~ s/\///g;
|
||||
my $name = $self->session->form->process("name") || $self->session->form->process("label");;
|
||||
$name = $self->session->url->urlize($name);
|
||||
$name =~ s/\-//g;
|
||||
$name =~ s/\///g;
|
||||
$self->setCollateral("DataForm_tab","DataForm_tabId",{
|
||||
DataForm_tabId=>$self->session->form->process("tid"),
|
||||
label=>$self->session->form->process("label"),
|
||||
subtext=>$self->session->form->process("subtext")
|
||||
});
|
||||
if ($self->session->form->process("proceed") eq "editTab") {
|
||||
$self->session->form->process("tid") = "new";
|
||||
return $self->www_editTab;
|
||||
return $self->www_editTab("new");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
@ -1107,6 +1107,19 @@ sub www_process {
|
|||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 www_view ( )
|
||||
|
||||
Overwrite www_view method and call the superclass object, passing in a 1 to disable cache
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $self = shift;
|
||||
$self->SUPER::www_view(1);
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ sub www_cancelTransaction {
|
|||
my $i18n = WebGUI::International->new($session, 'Commerce');
|
||||
$var{message} = $i18n->get('checkout canceled message');
|
||||
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session->setting->get("commerceCheckoutCanceledTemplateId"))->process(\%var));
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,$session->setting->get("commerceCheckoutCanceledTemplateId"))->process(\%var));
|
||||
}
|
||||
|
||||
# This operation is here for easier future extensions to the commerce system.
|
||||
|
|
@ -191,7 +191,7 @@ sub www_checkoutConfirm {
|
|||
$var{'viewShoppingCart.url'} = $session->url->page('op=viewCart');
|
||||
$var{'viewShoppingCart.label'} = $i18n->get('view shopping cart');
|
||||
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session->setting->get("commerceConfirmCheckoutTemplateId"))->process(\%var));
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,$session->setting->get("commerceConfirmCheckoutTemplateId"))->process(\%var));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -321,7 +321,7 @@ sub www_checkoutSubmit {
|
|||
return WebGUI::Operation::execute($session,'viewPurchaseHistory') unless ($checkoutError);
|
||||
|
||||
# If an error has occurred show the template errorlog
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session->setting->get("commerceTransactionErrorTemplateId"))->process(\%param));
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,$session->setting->get("commerceTransactionErrorTemplateId"))->process(\%param));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -690,7 +690,7 @@ sub www_selectPaymentGateway {
|
|||
$var{formSubmit} = WebGUI::Form::submit($session,{value=>$i18n->get('payment gateway select')});
|
||||
$var{formFooter} = WebGUI::Form::formFooter;
|
||||
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session->setting->get("commerceSelectPaymentGatewayTemplateId"))->process(\%var));
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,$session->setting->get("commerceSelectPaymentGatewayTemplateId"))->process(\%var));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -736,7 +736,7 @@ sub www_selectShippingMethod {
|
|||
$var{formSubmit} = WebGUI::Form::submit($session,{value=>$i18n->get('shipping select button')});
|
||||
$var{formFooter} = WebGUI::Form::formFooter;
|
||||
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session->setting->get("commerceSelectShippingMethodTemplateId"))->process(\%var));
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,$session->setting->get("commerceSelectShippingMethodTemplateId"))->process(\%var));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -826,7 +826,7 @@ sub www_viewCart {
|
|||
|
||||
$var{total} = sprintf('%.2f', $total);
|
||||
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session->setting->get("commerceViewShoppingCartTemplateId"))->process(\%var));
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,$session->setting->get("commerceViewShoppingCartTemplateId"))->process(\%var));
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ sub www_editGroup {
|
|||
sub www_editGroupSave {
|
||||
my $session = shift; use WebGUI; WebGUI::dumpSession($session);
|
||||
return $session->privilege->adminOnly() unless ($session->user->isInGroup(3) || _hasSecondaryPrivilege($session,$session->form->process("gid")));
|
||||
my $g = WebGUI::Group->new($session->form->process("gid"));
|
||||
my $g = WebGUI::Group->new($session,$session->form->process("gid"));
|
||||
$g->description($session->form->process("description"));
|
||||
$g->name($session->form->process("groupName"));
|
||||
$g->expireOffset($session->form->interval("expireOffset"));
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ sub www_viewHelp {
|
|||
my @related = _related($session, $help->{related});
|
||||
foreach my $row (@related) {
|
||||
my $relatedHelp = _get($session,$row->{tag},$row->{namespace});
|
||||
$ac->addSubmenuItem(_link($row->{tag},$row->{namespace}),$i18n->get($relatedHelp->{title},$row->{namespace}));
|
||||
$ac->addSubmenuItem(_link($session,$row->{tag},$row->{namespace}),$i18n->get($relatedHelp->{title},$row->{namespace}));
|
||||
}
|
||||
my %vars;
|
||||
$vars{body} = $i18n->get($help->{body});
|
||||
|
|
@ -159,7 +159,7 @@ sub www_viewHelpIndex {
|
|||
@helpIndex = sort { $a->[2] cmp $b->[2] } @helpIndex;
|
||||
foreach my $helpEntry (@helpIndex) {
|
||||
my ($namespace, $id, $title) = @{ $helpEntry };
|
||||
$output .= '<p><a href="'._link($id,$namespace).'">'.$title.'</a></p>';
|
||||
$output .= '<p><a href="'._link($session,$id,$namespace).'">'.$title.'</a></p>';
|
||||
$i++;
|
||||
if ($i == $halfway) {
|
||||
$output .= '</td><td valign="top">';
|
||||
|
|
@ -189,7 +189,7 @@ sub www_viewHelpTOC {
|
|||
@entries = sort { $a->[0] cmp $b->[0] } @entries;
|
||||
foreach my $helpEntry (@entries) {
|
||||
my ($helpName, $helpFile) = @{ $helpEntry };
|
||||
$output .= '<p><a href="'._linkTOC($helpFile).'">'.$helpName."</a></p>\n";
|
||||
$output .= '<p><a href="'._linkTOC($session,$helpFile).'">'.$helpName."</a></p>\n";
|
||||
$i++;
|
||||
if ($i % $third == 0) {
|
||||
$output .= '</td><td valign="top">';
|
||||
|
|
@ -212,7 +212,7 @@ sub www_viewHelpChapter {
|
|||
my $output = '';
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
foreach my $id (@entries) {
|
||||
$output .= '<p><a href="'._link($id,$namespace).'">'.$i18n->get($help->{$id}{title},$namespace).'</a></p>';
|
||||
$output .= '<p><a href="'._link($session,$id,$namespace).'">'.$i18n->get($help->{$id}{title},$namespace).'</a></p>';
|
||||
}
|
||||
my $ac = WebGUI::AdminConsole->new($session,"help");
|
||||
$ac->addSubmenuItem($session->url->page('op=viewHelpIndex'),$i18n->get(95));
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ sub stow {
|
|||
|
||||
=head2 style ( )
|
||||
|
||||
Returns a WebGUI::Style object.
|
||||
Returns a WebGUI::Session::Style object.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
|
|
@ -554,6 +554,11 @@ The end of the form.
|
|||
lastUpdated => 1031514049
|
||||
},
|
||||
|
||||
'102' => {
|
||||
message => q|Edit Tab|,
|
||||
lastUpdated => 1137974142
|
||||
},
|
||||
|
||||
'103' => {
|
||||
message => q|Add new Tab|,
|
||||
lastUpdated => 1052048005
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue