From: ivan Date: Fri, 4 Jan 2008 02:23:20 +0000 (+0000) Subject: reprocussions: backporting elements from HEAD needed for edit.html X-Git-Tag: freeside_1_7_3rc1~168 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=93838a89d0010da5c4757a5dc4f626d6bfe806f8;p=freeside.git reprocussions: backporting elements from HEAD needed for edit.html --- diff --git a/httemplate/elements/hidden.html b/httemplate/elements/hidden.html new file mode 100644 index 000000000..831108121 --- /dev/null +++ b/httemplate/elements/hidden.html @@ -0,0 +1,11 @@ + + +<%init> + +my %opt = @_; + + diff --git a/httemplate/elements/tablebreak-tr-title.html b/httemplate/elements/tablebreak-tr-title.html new file mode 100644 index 000000000..35dc05d8b --- /dev/null +++ b/httemplate/elements/tablebreak-tr-title.html @@ -0,0 +1,5 @@ + + + + +<% include('tr-title.html', @_ ) %> diff --git a/httemplate/elements/tr-checkbox.html b/httemplate/elements/tr-checkbox.html new file mode 100644 index 000000000..2e6d1f107 --- /dev/null +++ b/httemplate/elements/tr-checkbox.html @@ -0,0 +1,25 @@ +<% include('tr-td-label.html', @_ ) %> + + + + + +<%init> + +my %opt = @_; + +my $onchange = $opt{'onchange'} + ? 'onChange="'. $opt{'onchange'}. '(this)"' + : ''; + +my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + + diff --git a/httemplate/elements/tr-fixed-country.html b/httemplate/elements/tr-fixed-country.html new file mode 100644 index 000000000..806d92cd6 --- /dev/null +++ b/httemplate/elements/tr-fixed-country.html @@ -0,0 +1,10 @@ +<% include('tr-fixed.html', %opt ) %> +<%init> + +my %opt = @_; + +my $value = $opt{'curr_value'} || $opt{'value'}; + +$opt{'formatted_value'} = code2country($value). " ($value)"; + + diff --git a/httemplate/elements/tr-fixed-state.html b/httemplate/elements/tr-fixed-state.html new file mode 100644 index 000000000..eea30ddc5 --- /dev/null +++ b/httemplate/elements/tr-fixed-state.html @@ -0,0 +1,10 @@ +<% include('tr-fixed.html', %opt ) %> +<%init> + +my %opt = @_; + +my $value = $opt{'curr_value'} || $opt{'value'}; + +$opt{'formatted_value'} = state_label($value, $opt{'object'}->country); + + diff --git a/httemplate/elements/tr-fixed.html b/httemplate/elements/tr-fixed.html new file mode 100644 index 000000000..095e1bce9 --- /dev/null +++ b/httemplate/elements/tr-fixed.html @@ -0,0 +1,15 @@ +<% include('tr-td-label.html', @_ ) %> + + + + + +<% include('hidden.html', %opt ) %> + +<%init> + +my %opt = @_; + +my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + + diff --git a/httemplate/elements/tr-input-money.html b/httemplate/elements/tr-input-money.html new file mode 100644 index 000000000..88014192d --- /dev/null +++ b/httemplate/elements/tr-input-money.html @@ -0,0 +1,13 @@ +<% include('tr-input-text.html', @_, + 'type' => 'text', + 'prefix' => $money_char, + 'size' => 8, + ) +%> +<%once> + +my $conf = new FS::Conf; +my $money_char = $conf->config('money_char') || '$'; + + + diff --git a/httemplate/elements/tr-input-percentage.html b/httemplate/elements/tr-input-percentage.html new file mode 100644 index 000000000..ae553a93c --- /dev/null +++ b/httemplate/elements/tr-input-percentage.html @@ -0,0 +1,8 @@ +<% include('tr-input-text.html', @_, + 'type' => 'text', + 'postfix' => '%', + 'size' => 5, #6? check in IE (not a big deal) + 'maxlength' => 7, + 'text-align' => 'right', + ) +%> diff --git a/httemplate/elements/tr-input-text.html b/httemplate/elements/tr-input-text.html new file mode 100644 index 000000000..c8bec5ea6 --- /dev/null +++ b/httemplate/elements/tr-input-text.html @@ -0,0 +1,44 @@ +<% include('tr-td-label.html', @_ ) %> + + + + + +<%init> + +my %opt = @_; + +my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value}; + +my $onchange = $opt{'onchange'} + ? 'onChange="'. $opt{'onchange'}. '(this)"' + : ''; + +my $size = $opt{'size'} + ? 'SIZE="'. $opt{'size'}. '"' + : ''; + +my $maxlength = $opt{'maxlength'} + ? 'MAXLENGTH="'. $opt{'maxlength'}. '"' + : ''; + +my $align = $opt{'text-align'} + ? 'STYLE="text-align: '. $opt{'text-align'}. '"' + : ''; + + +my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + + diff --git a/httemplate/elements/tr-select.html b/httemplate/elements/tr-select.html new file mode 100644 index 000000000..07b0a01d5 --- /dev/null +++ b/httemplate/elements/tr-select.html @@ -0,0 +1,61 @@ +<% include('tr-td-label.html', @_ ) %> + + + + + +<%init> + +my %opt = @_; + +my $onchange = $opt{'onchange'} + ? 'onChange="'. $opt{'onchange'}. '(this)"' + : ''; + +my $labels = $opt{'option_labels'} || $opt{'labels'}; + +my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + +my $curr_value = $opt{'curr_value'}; + + diff --git a/httemplate/elements/tr-td-label.html b/httemplate/elements/tr-td-label.html new file mode 100644 index 000000000..77c048405 --- /dev/null +++ b/httemplate/elements/tr-td-label.html @@ -0,0 +1,17 @@ + + + + +<%init> + +my %opt = @_; + +my $style = 'padding-top: 3px'; +$style .= '; '. $opt{'cell_style'} + if $opt{'cell_style'}; + +
> + + <% $onchange %> + > +
><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %>
> + + <% $opt{'prefix'} %> + <% $maxlength %> + <% $align %> + <% $onchange %> + ><% $opt{'postfix'} %> + +
> + + + +
+ + <% $opt{label} %> + +