more admin console changes
This commit is contained in:
parent
c2efefbc4c
commit
73fd8fc506
22 changed files with 70 additions and 124 deletions
|
|
@ -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