summaryrefslogtreecommitdiff
path: root/httemplate/edit/part_export.cgi
diff options
context:
space:
mode:
authorrsiddall <rsiddall>2009-05-15 19:41:34 +0000
committerrsiddall <rsiddall>2009-05-15 19:41:34 +0000
commitad84bf7cfdb56aa1fe268ea315b7a2f7dd768db2 (patch)
tree22715493769195be6ba6672162ac6283801fb08a /httemplate/edit/part_export.cgi
parent5f675c352a10f555de5831bb76ab00b35b6b9bd1 (diff)
Simple domain registration at Tucows OpenSRS using an export based on Net::OpenSRS.
When a domain is added and the export runs, it will register the domain or initiate a transfer. You can also choose no action. There's currently no provision for revoking domains or renewing registrations. Depending on the settings at OpenSRS, orders may look like they've succeeded in Freeside but actually be queued pending input by the reseller at OpenSRS. The part_export CGIs were modified to allow a multi-valued select to be used to control which TLDs are enabled for registration.
Diffstat (limited to 'httemplate/edit/part_export.cgi')
-rw-r--r--httemplate/edit/part_export.cgi23
1 files changed, 19 insertions, 4 deletions
diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi
index d579797..8b697e1 100644
--- a/httemplate/edit/part_export.cgi
+++ b/httemplate/edit/part_export.cgi
@@ -79,13 +79,28 @@ my $widget = new HTML::Widgets::SelectLayers(
);
$html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!;
if ( $type eq 'select' ) {
- $html .= qq!<SELECT NAME="$option">!;
- foreach my $select_option ( @{$optinfo->{options}} ) {
+ my $size = defined($optinfo->{size}) ? " SIZE=" . $optinfo->{size} : '';
+ my $multi = defined($optinfo->{multi}) ? ' MULTIPLE' : '';
+ $html .= qq!<SELECT NAME="$option"$multi$size>!;
+ my @values = split '\s+', $value if $multi;
+ my @options;
+ if (defined($optinfo->{option_values})) {
+ my $valsub = $optinfo->{option_values};
+ @options = &$valsub();
+ } elsif (defined($optinfo->{options})) {
+ @options = @{$optinfo->{options}};
+ }
+ foreach my $select_option ( @options ) {
#if ( ref($select_option) ) {
#} else {
- my $selected = $select_option eq $value ? ' SELECTED' : '';
+ my $selected = ($multi ? grep {$_ eq $select_option} @values : $select_option eq $value ) ? ' SELECTED' : '';
+ my $label = $select_option;
+ if (defined($optinfo->{option_label})) {
+ my $labelsub = $optinfo->{option_label};
+ $label = &$labelsub($select_option);
+ }
$html .= qq!<OPTION VALUE="$select_option"$selected>!.
- qq!$select_option</OPTION>!;
+ qq!$label</OPTION>!;
#}
}
$html .= '</SELECT>';