more admin console changes
This commit is contained in:
parent
c2efefbc4c
commit
73fd8fc506
22 changed files with 70 additions and 124 deletions
|
|
@ -208,7 +208,10 @@ sub getAdminFunction {
|
|||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
bless {}, $class;
|
||||
my $id = shift;
|
||||
my %self;
|
||||
$self{_function} = $class->getAdminFunction($id);
|
||||
bless \%self, $class;
|
||||
}
|
||||
|
||||
sub render {
|
||||
|
|
@ -235,17 +238,11 @@ sub render {
|
|||
return WebGUI::Template::process($session{setting}{AdminConsoleTemplate}, "AdminConsole", \%var);
|
||||
}
|
||||
|
||||
sub setAdminFunction {
|
||||
my $self = shift;
|
||||
my $id = shift;
|
||||
$self->{_function} = $self->getAdminFunction($id);
|
||||
}
|
||||
|
||||
sub setHelp {
|
||||
my $self = shift;
|
||||
my $id = shift;
|
||||
my $namespace = shift || "WebGUI";
|
||||
$self->{_helpUrl} = WebGUI::URL::page('op=viewHelp&hid='.$id.'&namespace='.$namespace)
|
||||
$self->{_helpUrl} = WebGUI::URL::page('op=viewHelp&hid='.$id.'&namespace='.$namespace) if ($id);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -58,9 +58,7 @@ sub www_viewActiveSessions {
|
|||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBarTraditional($session{form}{pn});
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("activeSessions");
|
||||
return $ac->render($output);
|
||||
return WebGUI::AdminConsole->new("activeSessions")->render($output);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -33,11 +33,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("clipboard");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("clipboard");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=manageClipboard'), WebGUI::International::get(949));
|
||||
if ($session{form}{systemClipboard} ne "1") {
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=emptyClipboard'), WebGUI::International::get(950));
|
||||
|
|
|
|||
|
|
@ -30,11 +30,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("databases");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("databases");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editDatabaseLink&dlid=new'), WebGUI::International::get(982));
|
||||
if (($session{form}{op} eq "editDatabaseLink" && $session{form}{dlid} ne "new") || $session{form}{op} eq "deleteDatabaseLink") {
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editDatabaseLink&dlid='.$session{form}{dlid}), WebGUI::International::get(983));
|
||||
|
|
|
|||
|
|
@ -44,11 +44,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("groups");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("groups");
|
||||
if (WebGUI::Grouping::isInGroup(3)) {
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editGroup&gid=new'), WebGUI::International::get(90));
|
||||
unless ($session{form}{op} eq "listGroups"
|
||||
|
|
|
|||
|
|
@ -47,15 +47,14 @@ sub _seeAlso {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_viewHelp {
|
||||
return WebGUI::Privilege::insufficient() unless (WebGUI::Grouping::isInGroup(12));
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("help");
|
||||
my $ac = WebGUI::AdminConsole->new("help");
|
||||
my $namespace = $session{form}{namespace} || "WebGUI";
|
||||
my $help = _get($session{form}{hid},$namespace);
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=viewHelpIndex'),WebGUI::International::get(95));
|
||||
foreach my $row (@{$help->{related}}) {
|
||||
my $relatedHelp = _get($row->{tag},$row->{namespace});
|
||||
$ac->addSubmenuItem(_link($row->{tag},$row->{namespace}),WebGUI::International::get($relatedHelp->{title},$row->{namespace}));
|
||||
}
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=viewHelpIndex'),WebGUI::International::get(95));
|
||||
return $ac->render(
|
||||
WebGUI::Macro::negate(WebGUI::International::get($help->{body},$namespace)),
|
||||
WebGUI::International::get(93).': '.WebGUI::International::get($help->{title},$namespace)
|
||||
|
|
@ -104,9 +103,7 @@ sub www_viewHelpIndex {
|
|||
}
|
||||
}
|
||||
$output .= '</td></tr></table>';
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("help");
|
||||
return $ac->render($output);
|
||||
return WebGUI::AdminConsole->new("help")->render($output);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -48,9 +48,7 @@ sub www_viewLoginHistory {
|
|||
$output .= $p->getPage($session{form}{pn});
|
||||
$output .= '</table>';
|
||||
$output .= $p->getBar($session{form}{pn});
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("loginHistory");
|
||||
return $ac->render($output);
|
||||
return WebGUI::AdminConsole->new("loginHistory")->render($output);
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -29,11 +29,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title,"MetaData") if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("contentProfiling");
|
||||
if ($help) {
|
||||
$ac->setHelp($help,"MetaData");
|
||||
}
|
||||
$ac->setAdminFunction("contentProfiling");
|
||||
if($session{form}{op} ne "manageMetaData") {
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=manageMetaData'), WebGUI::International::get('content profiling','MetaData'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,11 +39,10 @@ sub _submenu {
|
|||
my $i18n = WebGUI::International->new("Navigation");
|
||||
$title = $i18n->get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("navigation");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("navigation");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editNavigation'),$i18n->get("add new"));
|
||||
if (($session{form}{op} eq "editNavigation" && $session{form}{navigationId} ne "new") || $session{form}{op} eq "deleteNavigationConfirm") {
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editNavigation&identifier='.$session{form}{identifier}), $i18n->get("18"));
|
||||
|
|
|
|||
|
|
@ -51,11 +51,10 @@ sub _submenu {
|
|||
my $help = shift;
|
||||
my $namespace = shift;
|
||||
$title = WebGUI::International::get($title,$namespace) if ($title);
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("userProfiling");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("userProfiling");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page("op=editProfileCategory&cid=new"), WebGUI::International::get(490,"WebGUIProfile"));
|
||||
$ac->addSubmenuItem(WebGUI::URL::page("op=editProfileField&fid=new"), WebGUI::International::get(491,"WebGUIProfile"));
|
||||
if ((($session{form}{op} eq "editProfileField" && $session{form}{fid} ne "new") || $session{form}{op} eq "deleteProfileField") && $session{form}{cid} eq "") {
|
||||
|
|
|
|||
|
|
@ -26,11 +26,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("contentFilters");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("contentFilters");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page("op=editReplacement&replacementId=new"), WebGUI::International::get(1047));
|
||||
$ac->addSubmenuItem(WebGUI::URL::page("op=listReplacements"), WebGUI::International::get("content filters"));
|
||||
return $ac->render($workarea, $title);
|
||||
|
|
|
|||
|
|
@ -263,10 +263,9 @@ sub www_editSettings {
|
|||
$jscript .= "</script>";
|
||||
$tabform->getTab("auth")->raw($jscript);
|
||||
$tabform->submit();
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("settings");
|
||||
my $ac = WebGUI::AdminConsole->new("settings");
|
||||
$ac->setHelp("settings");
|
||||
return $ac->render($tabform->print);
|
||||
return $ac->render($tabform->print);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ sub _submenu {
|
|||
my $workarea = shift;
|
||||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
$ac->setAdminFunction("statistics");
|
||||
my $ac = WebGUI::AdminConsole->new("statistics");
|
||||
if ($session{setting}{trackPageStatistics}) {
|
||||
$ac->addSubmenuItem( WebGUI::URL::page("op=viewPageReport"), WebGUI::International::get(796));
|
||||
# $ac->addSubmenuItem( WebGUI::URL::page("op=viewTrafficReport"), WebGUI::International::get(797));
|
||||
|
|
|
|||
|
|
@ -32,11 +32,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("templates");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("templates");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editTemplate&tid=new&namespace='.$session{form}{namespace}), WebGUI::International::get(505));
|
||||
if ($session{form}{op} eq "editTemplate" && ($session{form}{tid} ne "new" || $session{form}{op} ne "deleteTemplateConfirm")) {
|
||||
$ac->addSubmenuItem(
|
||||
|
|
|
|||
|
|
@ -50,11 +50,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("themes");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("themes");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=editTheme&themeId=new'), WebGUI::International::get(901));
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=importTheme'), WebGUI::International::get(924));
|
||||
unless (isIn($session{form}{op}, qw(deleteThemeConfirm viewTheme listThemes)) || $session{form}{themeId} eq "new") {
|
||||
|
|
|
|||
|
|
@ -116,11 +116,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("trash");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("trash");
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=manageTrash'), WebGUI::International::get(10));
|
||||
if ($session{form}{systemTrash} ne "1") {
|
||||
$ac->addSubmenuItem(WebGUI::URL::page('op=emptyTrash'), WebGUI::International::get(11));
|
||||
|
|
|
|||
|
|
@ -38,11 +38,10 @@ sub _submenu {
|
|||
my $title = shift;
|
||||
$title = WebGUI::International::get($title) if ($title);
|
||||
my $help = shift;
|
||||
my $ac = WebGUI::AdminConsole->new;
|
||||
my $ac = WebGUI::AdminConsole->new("users");
|
||||
if ($help) {
|
||||
$ac->setHelp($help);
|
||||
}
|
||||
$ac->setAdminFunction("users");
|
||||
if (WebGUI::Grouping::isInGroup(3)) {
|
||||
$ac->addSubmenuItem(WebGUI::URL::page("op=addUser"), WebGUI::International::get(169));
|
||||
unless ($session{form}{op} eq "listUsers"
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use CGI::Util qw(rearrange);
|
|||
use DBI;
|
||||
use strict qw(subs vars);
|
||||
use Tie::IxHash;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::FormProcessor;
|
||||
use WebGUI::Grouping;
|
||||
|
|
@ -81,6 +82,20 @@ sub _getNextSequenceNumber {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub adminConsole {
|
||||
my $self = shift;
|
||||
my $content = shift;
|
||||
my $title = shift;
|
||||
my $helpId = shift;
|
||||
my $namespace = shift || $self->namespace;
|
||||
$title = WebGUI::International::get($title,$namespace) if ($title);
|
||||
my $ac = WebGUI::AdminConsole->new("assets");
|
||||
$ac->setHelp($helpId,$namespace);
|
||||
$ac->render($content,$title);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 canEdit ( )
|
||||
|
||||
Returns a boolean (0|1) value signifying that the user has the required privileges.
|
||||
|
|
@ -1158,23 +1173,16 @@ Prompts a user to confirm whether they wish to delete this instance.
|
|||
|
||||
sub www_delete {
|
||||
my $self = shift;
|
||||
my ($output);
|
||||
if ($self->canEdit) {
|
||||
$output = helpIcon("wobject delete");
|
||||
$output .= '<h1>'.WebGUI::International::get(42).'</h1>';
|
||||
$output .= WebGUI::International::get(43);
|
||||
$output .= '<p>';
|
||||
$output .= '<div align="center"><a href="'.WebGUI::URL::page('func=deleteConfirm&wid='.
|
||||
$self->get("wobjectId")).'">';
|
||||
$output .= WebGUI::International::get(44);
|
||||
$output .= '</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page().'">';
|
||||
$output .= WebGUI::International::get(45);
|
||||
$output .= '</a></div>';
|
||||
return $output;
|
||||
} else {
|
||||
return WebGUI::Privilege::insufficient();
|
||||
}
|
||||
return WebGUI::Privilege::insufficient() unless ($self->canEdit);
|
||||
my $output = WebGUI::International::get(43);
|
||||
$output .= '<p>';
|
||||
$output .= '<div align="center"><a href="'.WebGUI::URL::page('func=deleteConfirm&wid='. $self->get("wobjectId")).'">';
|
||||
$output .= WebGUI::International::get(44);
|
||||
$output .= '</a>';
|
||||
$output .= ' <a href="'.WebGUI::URL::page().'">';
|
||||
$output .= WebGUI::International::get(45);
|
||||
$output .= '</a></div>';
|
||||
return $self->adminConsole($output,'42',"wobject delete","WebGUI");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1259,7 +1267,6 @@ An id this namespace of the WebGUI international system. This message will be re
|
|||
sub www_edit {
|
||||
my $self = shift;
|
||||
return WebGUI::Privilege::insufficient() unless ($self->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my (@p) = @_;
|
||||
my ($properties, $layout, $privileges, $heading, $helpId, $headingId) =
|
||||
rearrange([qw(properties layout privileges heading helpId headingId)], @p);
|
||||
|
|
@ -1436,11 +1443,7 @@ sub www_edit {
|
|||
'</a></p>'
|
||||
);
|
||||
}
|
||||
my $output;
|
||||
$output = helpIcon($helpId,$self->get("namespace")) if ($helpId);
|
||||
$heading = WebGUI::International::get($headingId,$self->get("namespace")) if ($headingId);
|
||||
$output .= '<h1>'.$heading.'</h1>' if ($heading);
|
||||
return $output.$f->print;
|
||||
return $self->adminConsole($f->print,$headingId,$helpId);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -632,8 +632,7 @@ sub www_editSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editField {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($output, %field, $f, %fieldStatus,$tab);
|
||||
my (%field, $f, %fieldStatus,$tab);
|
||||
tie %field, 'Tie::CPHash';
|
||||
tie %fieldStatus, 'Tie::IxHash';
|
||||
|
||||
|
|
@ -649,8 +648,6 @@ sub www_editField {
|
|||
}
|
||||
$tab = WebGUI::SQL->buildHashRef("select DataForm_tabId,label from DataForm_tab where wobjectId=".quote($_[0]->get("wobjectId")));
|
||||
$tab->{0} = $_[0]->i18n("no tab");
|
||||
$output = helpIcon("data form fields add/edit",$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(20,$_[0]->get("namespace")).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$_[0]->get("wobjectId"));
|
||||
$f->hidden("fid",$session{form}{fid});
|
||||
|
|
@ -731,8 +728,7 @@ sub www_editField {
|
|||
);
|
||||
}
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->adminConsole($f->print,'20',"data form fields add/edit");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -769,16 +765,13 @@ sub www_editFieldSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editTab {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($output, %tab, $f);
|
||||
my (%tab, $f);
|
||||
tie %tab, 'Tie::CPHash';
|
||||
|
||||
$session{form}{tid} = "new" if ($session{form}{tid} eq "");
|
||||
unless ($session{form}{tid} eq "new") {
|
||||
%tab = WebGUI::SQL->quickHash("select * from DataForm_tab where DataForm_tabId=".quote($session{form}{tid}));
|
||||
}
|
||||
$output = helpIcon("data form fields add/edit",$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(20,$_[0]->get("namespace")).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$_[0]->get("wobjectId"));
|
||||
$f->hidden("tid",$session{form}{tid});
|
||||
|
|
@ -805,8 +798,7 @@ sub www_editTab {
|
|||
);
|
||||
}
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->adminConsole($f->print,'20',"data form fields add/edit");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ sub www_edit {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editForum {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my $forumMeta;
|
||||
if ($session{form}{forumId} ne "new") {
|
||||
$forumMeta = WebGUI::SQL->quickHashRef("select title,description from MessageBoard_forums where forumId=".quote($session{form}{forumId}));
|
||||
|
|
@ -214,7 +213,7 @@ sub www_editForum {
|
|||
}
|
||||
|
||||
$f->submit;
|
||||
return helpIcon("forum add/edit",$_[0]->get("namespace")).'<h1>'.WebGUI::International::get(77,$_[0]->get("namespace")).'</h1>'.$f->print;
|
||||
return $_[0]->adminConsole($f->print,'77','forum add/edit');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -165,10 +165,7 @@ sub purge {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_addAccessory {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($output, $f, $accessory, @usedAccessories);
|
||||
$output = helpIcon("product accessory add/edit",$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(16,$_[0]->get("namespace")).'</h1>';
|
||||
my ($f, $accessory, @usedAccessories);
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$_[0]->get("wobjectId"));
|
||||
$f->hidden("func","addAccessorySave");
|
||||
|
|
@ -180,15 +177,13 @@ sub www_addAccessory {
|
|||
$f->select("accessoryWobjectId",$accessory,WebGUI::International::get(17,$_[0]->get("namespace")));
|
||||
$f->yesNo("proceed",WebGUI::International::get(18,$_[0]->get("namespace")));
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->adminConsole($f->print, '16', "product accessory add/edit");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_addAccessorySave {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
return "" unless ($session{form}{accessoryWobjectId});
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($seq);
|
||||
($seq) = WebGUI::SQL->quickArray("select max(sequenceNumber) from Product_accessory
|
||||
where wobjectId=".quote($_[0]->get("wobjectId")));
|
||||
|
|
@ -204,9 +199,7 @@ sub www_addAccessorySave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_addRelated {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
my ($output, $f, $related, @usedRelated);
|
||||
$output = helpIcon("product related add/edit",$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(19,$_[0]->get("namespace")).'</h1>';
|
||||
my ($f, $related, @usedRelated);
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$_[0]->get("wobjectId"));
|
||||
$f->hidden("func","addRelatedSave");
|
||||
|
|
@ -218,8 +211,7 @@ sub www_addRelated {
|
|||
$f->select("relatedWobjectId",$related,WebGUI::International::get(20,$_[0]->get("namespace")));
|
||||
$f->yesNo("proceed",WebGUI::International::get(21,$_[0]->get("namespace")));
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->adminConsole( $f->print, '19',"product related add/edit");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -379,11 +371,8 @@ sub www_editSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editBenefit {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($output, $data, $f, $benefits);
|
||||
my ($data, $f, $benefits);
|
||||
$data = $_[0]->getCollateral("Product_benefit","Product_benefitId",$session{form}{bid});
|
||||
$output = helpIcon("product benefit add/edit",$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(53,$_[0]->get("namespace")).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$_[0]->get("wobjectId"));
|
||||
$f->hidden("bid",$data->{Product_benefitId});
|
||||
|
|
@ -392,8 +381,7 @@ sub www_editBenefit {
|
|||
$f->combo("benefit",$benefits,WebGUI::International::get(51,$_[0]->get("namespace")),[$data->{benefits}]);
|
||||
$f->yesNo("proceed",WebGUI::International::get(52,$_[0]->get("namespace")));
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->adminConsole($f->print,'53',"product benefit add/edit");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -415,11 +403,8 @@ sub www_editBenefitSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editFeature {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($output, $data, $f, $features);
|
||||
my ($data, $f, $features);
|
||||
$data = $_[0]->getCollateral("Product_feature","Product_featureId",$session{form}{fid});
|
||||
$output = helpIcon("product feature add/edit",$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(22,$_[0]->get("namespace")).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$_[0]->get("wobjectId"));
|
||||
$f->hidden("fid",$data->{Product_featureId});
|
||||
|
|
@ -428,8 +413,7 @@ sub www_editFeature {
|
|||
$f->combo("feature",$features,WebGUI::International::get(23,$_[0]->get("namespace")),[$data->{feature}]);
|
||||
$f->yesNo("proceed",WebGUI::International::get(24,$_[0]->get("namespace")));
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->adminConsole($f->print,'22',"product feature add/edit");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -451,11 +435,8 @@ sub www_editFeatureSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editSpecification {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($output, $data, $f, $hashRef);
|
||||
my ($data, $f, $hashRef);
|
||||
$data = $_[0]->getCollateral("Product_specification","Product_specificationId",$session{form}{sid});
|
||||
$output = helpIcon("product specification add/edit",$_[0]->get("namespace"));
|
||||
$output .= '<h1>'.WebGUI::International::get(25,$_[0]->get("namespace")).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$_[0]->get("wobjectId"));
|
||||
$f->hidden("sid",$data->{Product_specificationId});
|
||||
|
|
@ -467,8 +448,7 @@ sub www_editSpecification {
|
|||
$f->combo("units",$hashRef,WebGUI::International::get(29,$_[0]->get("namespace")),[$data->{units}]);
|
||||
$f->yesNo("proceed",WebGUI::International::get(28,$_[0]->get("namespace")));
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->adminConsole($f->print,'25',"product specification add/edit");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -590,10 +590,8 @@ sub www_editSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editAnswer {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($question, $output, $f, $answer);
|
||||
my ($question, $f, $answer);
|
||||
$answer = $_[0]->getCollateral("Survey_answer","Survey_answerId",$session{form}{aid});
|
||||
$output = '<h1>'.WebGUI::International::get(18,$_[0]->get("namespace")).'</h1>';
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$session{form}{wid});
|
||||
$f->hidden("func","editAnswerSave");
|
||||
|
|
@ -639,8 +637,7 @@ sub www_editAnswer {
|
|||
);
|
||||
}
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
return $output;
|
||||
return $_[0]->adminConsole($f->print,'18');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -668,11 +665,9 @@ sub www_editAnswerSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub www_editQuestion {
|
||||
return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit);
|
||||
$session{page}{useAdminStyle} = 1;
|
||||
my ($output, $f, $question, $answerFieldType, $sth, %data);
|
||||
my ($f, $question, $answerFieldType, $sth, %data);
|
||||
tie %data, 'Tie::CPHash';
|
||||
$question = $_[0]->getCollateral("Survey_question","Survey_questionId",$session{form}{qid});
|
||||
$output = '<h1>'.WebGUI::International::get(17,$_[0]->get("namespace")).'</h1>';
|
||||
$answerFieldType = $question->{answerFieldType} || "radioList";
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->hidden("wid",$_[0]->get("wobjectId"));
|
||||
|
|
@ -723,7 +718,7 @@ sub www_editQuestion {
|
|||
);
|
||||
}
|
||||
$f->submit;
|
||||
$output .= $f->print;
|
||||
my $output = $f->print;
|
||||
if ($question->{Survey_questionId} ne "new" && $question->{answerFieldType} ne "text") {
|
||||
$output .= '<a href="'.WebGUI::URL::page('wid='.$_[0]->get("wobjectId").'&func=editAnswer&aid=new&qid='
|
||||
.$question->{Survey_questionId}).'">'.WebGUI::International::get(23,$_[0]->get("namespace")).'</a><p>';
|
||||
|
|
@ -742,7 +737,7 @@ sub www_editQuestion {
|
|||
}
|
||||
$sth->finish;
|
||||
}
|
||||
return $output;
|
||||
return $_[0]->adminConsole($output,'17');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue