beginnings of shipping mangement interface
This commit is contained in:
parent
e32bdb6217
commit
9284f8744f
3 changed files with 49 additions and 12 deletions
|
|
@ -128,9 +128,8 @@ sub www_pay {
|
|||
my $session = shift;
|
||||
my $output = undef;
|
||||
my $method = "www_".$session->form->get("method");
|
||||
my $pay = WebGUI::Shop::Pay->create($session);
|
||||
if ($method ne "www_" && $pay->can($method)) {
|
||||
$output = $pay->$method();
|
||||
if ($method ne "www_" && WebGUI::Shop::Pay->can($method)) {
|
||||
$output = WebGUI::Shop::Pay->$method($session);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -147,9 +146,8 @@ sub www_ship {
|
|||
my $session = shift;
|
||||
my $output = undef;
|
||||
my $method = "www_".$session->form->get("method");
|
||||
my $ship = WebGUI::Shop::Ship->create($session);
|
||||
if ($method ne "www_" && $ship->can($method)) {
|
||||
$output = $ship->$method();
|
||||
if ($method ne "www_" && WebGUI::Shop::Ship->can($method)) {
|
||||
$output = WebGUI::Shop::Ship->$method($session);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ sub getAdminConsole {
|
|||
my $url = $self->session->url;
|
||||
$ac->addSubmenuItem($url->page("shop=admin"), $i18n->get("shop settings"));
|
||||
$ac->addSubmenuItem($url->page("shop=tax"), $i18n->get("taxes"));
|
||||
$ac->addSubmenuItem($url->page("shop=pay"), $i18n->get("payment methods"));
|
||||
$ac->addSubmenuItem($url->page("shop=ship"), $i18n->get("shipping methods"));
|
||||
$ac->addSubmenuItem($url->page("shop=pay;method=manage"), $i18n->get("payment methods"));
|
||||
$ac->addSubmenuItem($url->page("shop=ship;method=manage"), $i18n->get("shipping methods"));
|
||||
$ac->addSubmenuItem($url->page("shop=transactions"), $i18n->get("transactions"));
|
||||
return $ac;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@ package WebGUI::Shop::Ship;
|
|||
|
||||
use strict;
|
||||
|
||||
use WebGUI::International;
|
||||
use WebGUI::Shop::ShipDriver;
|
||||
use WebGUI::Pluggable;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::Exception;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Pluggable;
|
||||
use WebGUI::Shop::Admin;
|
||||
use WebGUI::Shop::ShipDriver;
|
||||
use WebGUI::Utility;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -176,4 +177,42 @@ sub new {
|
|||
return $driver;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_do ( )
|
||||
|
||||
Let's ship drivers do method calls. Requires a driver param in the post form vars which contains the id of the driver to load.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_do {
|
||||
my ($class, $session) = @_;
|
||||
my $form = $session->form;
|
||||
my $driver = $class->new($session, $form->get("driver"));
|
||||
my $output = undef;
|
||||
my $method = "www_". ( $form->get("do"));
|
||||
if ($driver->can($method)) {
|
||||
$output = $driver->$method();
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_manage ( )
|
||||
|
||||
The main management screen for shippers.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_manage {
|
||||
my ($class, $session) = @_;
|
||||
return $session->privilege->adminOnly() unless ($session->user->isInGroup("3"));
|
||||
my $admin = WebGUI::Shop::Admin->new($session);
|
||||
my $console = $admin->getAdminConsole;
|
||||
my $output = "Test";
|
||||
my $i18n = WebGUI::International->new($session, "Shop");
|
||||
return $console->render($output, $i18n->get("shipping methods"));
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue