Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Embperl-cvs
svn commit: r1228715 - in /perl/embperl/trunk/Embperl/Form/Control: age.pm datetime.pm grid.pm number.pm price.pm
 

Index | Next | Previous | View Flat


richter at apache

Jan 7, 2012, 12:15 PM


Views: 319
Permalink
svn commit: r1228715 - in /perl/embperl/trunk/Embperl/Form/Control: age.pm datetime.pm grid.pm number.pm price.pm

Author: richter
Date: Sat Jan 7 20:15:00 2012
New Revision: 1228715

URL: http://svn.apache.org/viewvc?rev=1228715&view=rev
Log:
Embperl::Form

Modified:
perl/embperl/trunk/Embperl/Form/Control/age.pm
perl/embperl/trunk/Embperl/Form/Control/datetime.pm
perl/embperl/trunk/Embperl/Form/Control/grid.pm
perl/embperl/trunk/Embperl/Form/Control/number.pm
perl/embperl/trunk/Embperl/Form/Control/price.pm

Modified: perl/embperl/trunk/Embperl/Form/Control/age.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/age.pm?rev=1228715&r1=1228714&r2=1228715&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/age.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/age.pm Sat Jan 7 20:15:00 2012
@@ -51,7 +51,7 @@ sub init_data
my $fdat = $req -> {docdata} || \%fdat ;
my $name = $self->{name} ;
my $val = $fdat->{$name} ;
- return if ($val eq '') ;
+ return if ($val eq '' || $req -> {"ef_age_init_done_$name"}) ;

#20060914041444Z
my ($year, $mon, $mday, $hour, $min, $sec, $tz) = ($val =~ /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(.)$/) ;
@@ -63,6 +63,7 @@ sub init_data
$year2,$mon2,$mday2, $hour2,$min2,$sec2) } ;

$fdat->{$name} = $Dd > 0?"${Dd}Tage":sprintf ('%d:%02dh', $Dh, $Dm) ;
+ $req -> {"ef_age_init_done_$name"} = 1 ;
}

# ------------------------------------------------------------------------------------------

Modified: perl/embperl/trunk/Embperl/Form/Control/datetime.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/datetime.pm?rev=1228715&r1=1228714&r2=1228715&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/datetime.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/datetime.pm Sat Jan 7 20:15:00 2012
@@ -57,7 +57,7 @@ sub init_data
my $fdat = $req -> {docdata} || \%fdat ;
my $name = $self->{name} ;
my $time = $fdat->{$name} ;
- return if ($time eq '') ;
+ return if ($time eq '' || $req -> {"ef_datetime_init_done_$name"}) ;

my ($y, $m, $d, $h, $min, $s, $z) = ($time =~ /^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(.)/) ;

@@ -77,6 +77,7 @@ sub init_data
}

$fdat->{$name} = $date ;
+ $req -> {"ef_datetime_init_done_$name"} = 1 ;
}

# ------------------------------------------------------------------------------------------

Modified: perl/embperl/trunk/Embperl/Form/Control/grid.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/grid.pm?rev=1228715&r1=1228714&r2=1228715&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/grid.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/grid.pm Sat Jan 7 20:15:00 2012
@@ -264,7 +264,7 @@ $]<table class="ef-element ef-element-wi
[- $self -> show_grid_table ($req) ; -]
</table>
[.- $self -> show_grid_title ($req)
- if ($max > $self -> {header_bottom}) -]
+ if ($max > $self -> {header_bottom} && !$self -> {disable_controls}) -]
<table id="__[+ $self -> {fullid} +]_newrow" style="display: none">
[.-
local $req -> {epf_no_script} = 1 ;
@@ -290,7 +290,7 @@ $]
<table class="cBase cGridTitle">
<tr class="cTableRow">
<td class="cBase cGridLabelBox">[+ $self -> form -> convert_label ($self) +]</td>
- [$if !($self -> is_readonly ($req)) $]
+ [$if !($self -> is_readonly ($req)) && !$self -> {disable_controls} $]
<td class="cBase cGridControlBox">
<div>
<span class="ui-icon ui-icon-circle-triangle-n ef-icon" id="[+ $self -> {fullid} +]-up" title="Zeile Hoch"></span>
@@ -357,8 +357,10 @@ $]
[$endforeach$]
</tr>
[$if $line2 $]
- <tr class="cGridRow2" id="[+ "$id-row2-$i" +]">
- [- $ro = $gridro || $line2 -> is_readonly ; -]
+ [- $ro = $gridro || $line2 -> is_readonly ; -]
+ [$if (!$ro || $fdat{"__${name}_${j}_$i"} !~ /^\s*$/) $]
+ <tr class="cGridRow2" id="[+ "$id-row2-$i" +]">
+
<td colspan="[+ scalar(@$fields) +]" class="[+ $ro?'cGridCellReadonly':'cGridCell' +]">[$if $n++ == 0$]<input type="hidden" name="[+ "__${name}_#row#_$i" +]" value="[+ $i +]">[$endif$][.-
local $line2 -> {name} = "__${name}_${j}_$i" ;
if ($ro)
@@ -371,7 +373,8 @@ $]
}
$j++ ;
-]</td>
- </tr>
+ </tr>
+ [$endif$]
[$endif$]
[$ endsub $]

@@ -449,6 +452,10 @@ field defintion wich is show in a second

JavaScript function that is called whan grid changes (i.e. add row, delete row etc.)

+=head3 disable_controls
+
+If true, controls for add, delete, up and down will not be shown
+
=head3 header_bottom

If grid has more rows as given in this parameter,

Modified: perl/embperl/trunk/Embperl/Form/Control/number.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/number.pm?rev=1228715&r1=1228714&r2=1228715&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/number.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/number.pm Sat Jan 7 20:15:00 2012
@@ -21,6 +21,24 @@ use base 'Embperl::Form::Control::input'

use Embperl::Inline ;

+# ---------------------------------------------------------------------------
+#
+# show_control_readonly - output the control as readonly
+#
+
+sub show_control_readonly
+ {
+ my ($self, $req, $value) = @_ ;
+
+ my $unit = $self->{unit} ;
+ my $unittext = $self -> form -> convert_text ($self, ($unit =~ /:/)?$unit:"unit:$unit", $unit) ;
+ $unittext =~ s/^unit:// ;
+ $value = $self -> {value} || $Embperl::fdat{$self -> {name}} if (!defined($value)) ;
+ $value .= $unittext if ($unit) ;
+
+ $self -> SUPER::show_control_readonly ($req, $value) ;
+ }
+
1 ;

__EMBPERL__

Modified: perl/embperl/trunk/Embperl/Form/Control/price.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/price.pm?rev=1228715&r1=1228714&r2=1228715&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/price.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/price.pm Sat Jan 7 20:15:00 2012
@@ -52,7 +52,7 @@ sub init_data
delete $self -> {unit} if ($parentctrl) ;
my $name = $self->{name} ;
my $val = $fdat->{$name} ;
- return if ($val eq '') ;
+ return if ($val eq '' || $req -> {"ef_price_init_done_$name"}) ;

my $sep ;
my $dec ;
@@ -83,6 +83,7 @@ sub init_data
$int[0] = '0' if (@int == 1 && !$int[0]) ;
$frac = substr ($frac . '00', 0, 2) ;
$fdat->{$name} = ($minus?'-':'') . join ($sep, @int) . $dec . $frac ;
+ $req -> {"ef_price_init_done_$name"} = 1 ;
}

# ------------------------------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe [at] perl
For additional commands, e-mail: embperl-cvs-help [at] perl

Subject User Time
svn commit: r1228715 - in /perl/embperl/trunk/Embperl/Form/Control: age.pm datetime.pm grid.pm number.pm price.pm richter at apache Jan 7, 2012, 12:15 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.