edit parameter options form code
This commit is contained in:
parent
f6abe4561a
commit
d8fac0fdf9
2 changed files with 43 additions and 6 deletions
|
|
@ -955,22 +955,37 @@ sub www_editParameterOptions {
|
|||
my $self = shift;
|
||||
return $self->session->privilege->insufficient() unless ($self->canEdit);
|
||||
return 1;
|
||||
my $param = shift || $self->session->form->get('name') || 'new';
|
||||
my $session = $self->session;
|
||||
my $param = shift || $self->session->form->get('name');
|
||||
my $paramData = $self->getParamData;
|
||||
$param = "new" unless exists $paramData->{$param};
|
||||
if (! exists $paramData->{$param}) {
|
||||
return $self->editParameter($param);
|
||||
}
|
||||
my $option = $paramData->{$param};
|
||||
my $i18n = WebGUI::International->new($self->session,'Asset_Product');
|
||||
my $f = WebGUI::HTMLForm->new($self->session,-action=>$self->getUrl);
|
||||
$f->hidden(
|
||||
-name => "func",
|
||||
-value => "editParameterOptionSave",
|
||||
);
|
||||
$f->text(
|
||||
$f->readonly(
|
||||
-name => 'name',
|
||||
-label => $i18n->get('edit parameter name'),
|
||||
-hoverHelp => $i18n->get('edit parameter name description'),
|
||||
-value => $param,
|
||||
-maxlength => 64,
|
||||
);
|
||||
$f->float(
|
||||
-name => 'priceModifier',
|
||||
-label => $i18n->get('edit option price modifier'),
|
||||
-hoverHelp => $i18n->get('edit option price modifier description'),
|
||||
-value => $session->form->process("priceModifier") || $option->{priceModifier},
|
||||
-maxlength => 11,
|
||||
);
|
||||
$f->float(
|
||||
-name => 'weightModifier',
|
||||
-label => $i18n->get('edit option weight modifier'),
|
||||
-hoverHelp => $i18n->get('edit option weight modifier description'),
|
||||
-value => $session->form->process("weightModifier") || $option->{weightModifier},
|
||||
-maxlength => 7,
|
||||
);
|
||||
$f->submit;
|
||||
return $self->getAdminConsole->render($f->print, "edit option");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -657,6 +657,28 @@ be useful, others may not.|,
|
|||
context => q|The name of the editParameter form|
|
||||
},
|
||||
|
||||
'edit option price modifier' => {
|
||||
message => q|Price modifier|,
|
||||
lastUpdated => 1208292477,
|
||||
context => q|The form label for the priceModifier field in editProductParameterOption|
|
||||
},
|
||||
|
||||
'edit option price modifier description' => {
|
||||
message => q|<p>The amount this option adds to the default price for product variants containig this option.</p>|,
|
||||
lastUpdated => 1146606364,
|
||||
},
|
||||
|
||||
'edit option weight modifier' => {
|
||||
message => q|Weight modifier|,
|
||||
lastUpdated => 1208292479,
|
||||
context => q|The form label for the weightModifier field in editProductParameterOption|
|
||||
},
|
||||
|
||||
'edit option weight modifier description' => {
|
||||
message => q|<p>The weight this option adds to the default weight for product variants consisting of this option.</p>|,
|
||||
lastUpdated => 1208292519,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue