Form inheritance work for lists, removal of $session{os}{slash}
This commit is contained in:
parent
abe85d439e
commit
99df1f414e
90 changed files with 1364 additions and 1168 deletions
|
|
@ -435,11 +435,11 @@ sub www_editCommerceSettings {
|
|||
# payment plugin
|
||||
if (%paymentPlugins) {
|
||||
WebGUI::Style::setRawHeadTags('<script type="text/javascript">var activePayment="'.$paymentPlugin.'";</script>');
|
||||
$tabform->getTab("payment")->selectList(
|
||||
$tabform->getTab("payment")->selectBox(
|
||||
-name => 'commercePaymentPlugin',
|
||||
-options => \%paymentPlugins,
|
||||
-label => $i18n->get('payment form'),
|
||||
-value => [$paymentPlugin],
|
||||
-value => $paymentPlugin,
|
||||
-extras => 'onchange="activePayment=operateHidden(this.options[this.selectedIndex].value,activePayment)"'
|
||||
);
|
||||
|
||||
|
|
@ -473,11 +473,11 @@ sub www_editCommerceSettings {
|
|||
# shipping plugin
|
||||
if (%shippingPlugins) {
|
||||
WebGUI::Style::setRawHeadTags('<script type="text/javascript">var activeShipping="'.$shippingPlugin.'";</script>');
|
||||
$tabform->getTab('shipping')->selectList(
|
||||
$tabform->getTab('shipping')->selectBox(
|
||||
-name => 'commerceShippingPlugin',
|
||||
-options=> \%shippingPlugins,
|
||||
-label => $i18n->get('shipping plugin label'),
|
||||
-value => [$shippingPlugin],
|
||||
-value => $shippingPlugin,
|
||||
-extras => 'onchange="activeShipping=operateHidden(this.options[this.selectedIndex].value,activeShipping)"'
|
||||
);
|
||||
|
||||
|
|
@ -593,12 +593,12 @@ sub www_listTransactions {
|
|||
$output .= '</tr><tr>';
|
||||
$output .= '<td></td>';
|
||||
$output .= '<td align="left">'.$i18n->get('transaction status').'</td>';
|
||||
$output .= '<td>'.WebGUI::Form::selectList({name => 'tStatus', value => [$session{form}{tStatus}], options => $transactionOptions});
|
||||
$output .= '<td>'.WebGUI::Form::selectBox({name => 'tStatus', value => [$session{form}{tStatus}], options => $transactionOptions});
|
||||
$output .= '</tr><tr>';
|
||||
|
||||
$output .= '<td></td>';
|
||||
$output .= '<td align="left">'.$i18n->get('shipping status').'</td>';
|
||||
$output .= '<td>'.WebGUI::Form::selectList({name => 'sStatus', value => [$session{form}{sStatus}], options => $shippingOptions});
|
||||
$output .= '<td>'.WebGUI::Form::selectBox({name => 'sStatus', value => [$session{form}{sStatus}], options => $shippingOptions});
|
||||
$output .= '</tr><tr>';
|
||||
|
||||
$output .= '<td></td>';
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ sub www_richEditPageTree {
|
|||
-label=>WebGUI::International::get(104),
|
||||
-hoverHelp=>WebGUI::International::get('104 description'),
|
||||
);
|
||||
$f->selectList(
|
||||
$f->selectBox(
|
||||
-name=>"target",
|
||||
-label=>WebGUI::International::get('target'),
|
||||
-hoverHelp=>WebGUI::International::get('target description'),
|
||||
|
|
|
|||
|
|
@ -117,9 +117,9 @@ sub getGroupSearchForm {
|
|||
-name=>"doit",
|
||||
-value=>1
|
||||
);
|
||||
$f->selectList(
|
||||
$f->selectBox(
|
||||
-name=>"modifier",
|
||||
-value=>([$session{scratch}{groupSearchModifier} || WebGUI::International::get("contains") ]),
|
||||
-value=>($session{scratch}{groupSearchModifier} || WebGUI::International::get("contains") ),
|
||||
-options=>{
|
||||
startsWith=>WebGUI::International::get("starts with"),
|
||||
contains=>WebGUI::International::get("contains"),
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ sub _linkTOC {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub _getHelpFilesList {
|
||||
my $dir = join $session{os}{slash}, $session{config}{webguiRoot},"lib","WebGUI","Help";
|
||||
my $dir = join '/', $session{config}{webguiRoot},"lib","WebGUI","Help";
|
||||
opendir (DIR,$dir) or WebGUI::ErrorHandler::fatal("Can't open Help directory!");
|
||||
my @files;
|
||||
foreach my $file (readdir DIR) {
|
||||
|
|
|
|||
|
|
@ -47,35 +47,25 @@ sub getRequiredProfileFields {
|
|||
$method = $data->{dataType};
|
||||
$label = WebGUI::Operation::Shared::secureEval($data->{fieldLabel});
|
||||
$default = WebGUI::Operation::Shared::secureEval($data->{dataDefault});
|
||||
if ($method eq "selectList") {
|
||||
$values = WebGUI::Operation::Shared::secureEval($data->{dataValues});
|
||||
# note: this big if statement doesn't look elegant, but doing regular ORs caused problems with the array reference.
|
||||
if ($session{form}{$data->{fieldName}}) {
|
||||
$default = [$session{form}{$data->{fieldName}}];
|
||||
}
|
||||
elsif ($session{user}{$data->{fieldName}}) {
|
||||
$default = [$session{user}{$data->{fieldName}}];
|
||||
}
|
||||
$hash{'profile.formElement'} = WebGUI::Form::selectList({
|
||||
"name"=>$data->{fieldName},
|
||||
"options"=>$values,
|
||||
"value"=>$default
|
||||
});
|
||||
$values = WebGUI::Operation::Shared::secureEval($data->{dataValues});
|
||||
my $default;
|
||||
if ($session{form}{$data->{fieldName}}) {
|
||||
$default = $session{form}{$data->{fieldName}};
|
||||
}
|
||||
elsif ($session{user}{$data->{fieldName}}) {
|
||||
$default = $session{user}{$data->{fieldName}};
|
||||
}
|
||||
else {
|
||||
if ($session{form}{$data->{fieldName}}) {
|
||||
$default = $session{form}{$data->{fieldName}};
|
||||
}
|
||||
elsif (exists $session{user}{$data->{fieldName}}) {
|
||||
$default = $session{user}{$data->{fieldName}};
|
||||
}
|
||||
else {
|
||||
$default = $data->{dataDefault};
|
||||
}
|
||||
|
||||
my $cmd = 'WebGUI::Form::'.$method.'({"name"=>$data->{fieldName},"value"=>$default})';
|
||||
$hash{'profile.formElement'} = eval($cmd);
|
||||
$default = WebGUI::Operation::Shared::secureEval($data->{dataDefault});
|
||||
}
|
||||
my $form = WebGUI::Form::DynamicField->new(
|
||||
name => $data->{fieldName},
|
||||
value => $default,
|
||||
options => $values,
|
||||
fieldType => $method,
|
||||
);
|
||||
|
||||
$hash{'profile.form.element'} = $form->displayForm();
|
||||
$hash{'profile.formElement.label'} = $label;
|
||||
push(@array,\%hash)
|
||||
}
|
||||
|
|
@ -184,6 +174,7 @@ sub www_editProfile {
|
|||
if ($data->{required}) {
|
||||
$hash{'profile.form.element.subtext'} = "*";
|
||||
}
|
||||
push(@profile,\%hash);
|
||||
if (($previousCategory && $category ne $previousCategory) || $counter eq $a->rows) {
|
||||
my @temp = @profile;
|
||||
my $hashRef;
|
||||
|
|
@ -193,7 +184,6 @@ sub www_editProfile {
|
|||
@profile = ();
|
||||
}
|
||||
$previousCategory = $category;
|
||||
push(@profile,\%hash);
|
||||
}
|
||||
$a->finish;
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ sub www_editProfileField {
|
|||
foreach $key (keys %hash) {
|
||||
$hash{$key} = WebGUI::Operation::Shared::secureEval($hash{$key});
|
||||
}
|
||||
$f->selectList(
|
||||
$f->selectBox(
|
||||
-name=>"profileCategoryId",
|
||||
-options=>\%hash,
|
||||
-label=>WebGUI::International::get(489,"WebGUIProfile"),
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ sub www_editSettings {
|
|||
-value=>$session{setting}{metaDataEnabled}
|
||||
);
|
||||
# user interface settings
|
||||
$tabform->getTab("ui")->selectList(
|
||||
$tabform->getTab("ui")->selectBox(
|
||||
-name=>"richEditor",
|
||||
-label=>$i18n->get("default rich editor"),
|
||||
-hoverHelp=>$i18n->get("default rich editor description"),
|
||||
|
|
@ -207,7 +207,7 @@ sub www_editSettings {
|
|||
-hoverHelp=>$i18n->get('show performance indicators description'),
|
||||
-value=>$session{setting}{showPerformanceIndicators}
|
||||
);
|
||||
$tabform->getTab("misc")->selectList(
|
||||
$tabform->getTab("misc")->selectBox(
|
||||
-name=>"hostToUse",
|
||||
-value=>[$session{setting}{hostToUse}],
|
||||
-options=>{
|
||||
|
|
@ -274,7 +274,7 @@ sub www_editSettings {
|
|||
foreach (@{$session{config}{authMethods}}) {
|
||||
$options->{$_} = $_;
|
||||
}
|
||||
$tabform->getTab("auth")->selectList(
|
||||
$tabform->getTab("auth")->selectBox(
|
||||
-name=>"authMethod",
|
||||
-options=>$options,
|
||||
-label=>$i18n->get(164),
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ sub www_editSubscription {
|
|||
-hoverHelp => $i18n->get('subscription group description'),
|
||||
-value => [$properties->{subscriptionGroup} || 2]
|
||||
);
|
||||
$f->selectList(
|
||||
$f->selectBox(
|
||||
-name => 'duration',
|
||||
-label => $i18n->get('subscription duration'),
|
||||
-hoverHelp => $i18n->get('subscription duration description'),
|
||||
|
|
|
|||
|
|
@ -125,9 +125,9 @@ sub getUserSearchForm {
|
|||
-name=>"doit",
|
||||
-value=>1
|
||||
)
|
||||
.WebGUI::Form::selectList(
|
||||
.WebGUI::Form::selectBox(
|
||||
-name=>"modifier",
|
||||
-value=>([$session{scratch}{userSearchModifier} || "contains"]),
|
||||
-value=>($session{scratch}{userSearchModifier} || "contains"),
|
||||
-options=>{
|
||||
startsWith=>WebGUI::International::get("starts with"),
|
||||
contains=>WebGUI::International::get("contains"),
|
||||
|
|
@ -139,9 +139,9 @@ sub getUserSearchForm {
|
|||
-value=>$session{scratch}{userSearchKeyword},
|
||||
-size=>15
|
||||
)
|
||||
.WebGUI::Form::selectList(
|
||||
.WebGUI::Form::selectBox(
|
||||
-name => "status",
|
||||
-value => [$session{scratch}{userSearchStatus} || "users.status like '%'"],
|
||||
-value => ($session{scratch}{userSearchStatus} || "users.status like '%'"),
|
||||
-options=> {
|
||||
"" => WebGUI::International::get(821),
|
||||
Active => WebGUI::International::get(817),
|
||||
|
|
@ -252,22 +252,22 @@ sub www_editUser {
|
|||
-value => $u->status
|
||||
);
|
||||
} else {
|
||||
$tabform->getTab("account")->selectList(
|
||||
$tabform->getTab("account")->selectBox(
|
||||
-name => "status",
|
||||
-options => \%status,
|
||||
-label => $i18n->get(816),
|
||||
-value => [$u->status]
|
||||
-value => $u->status
|
||||
);
|
||||
}
|
||||
my $options;
|
||||
foreach (@{$session{config}{authMethods}}) {
|
||||
$options->{$_} = $_;
|
||||
}
|
||||
$tabform->getTab("account")->selectList(
|
||||
$tabform->getTab("account")->selectBox(
|
||||
-name=>"authMethod",
|
||||
-options=>$options,
|
||||
-label=>$i18n->get(164),
|
||||
-value=>[$u->authMethod],
|
||||
-value=>$u->authMethod,
|
||||
-extras=>"onChange=\"active=operateHidden(this.options[this.selectedIndex].value,active)\""
|
||||
);
|
||||
foreach (@{$session{config}{authMethods}}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue