You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2014/11/11 21:35:21 UTC

svn commit: r1638375 - in /perl/embperl/trunk/Embperl/Form/Control: datetime.pm selectdyn.pm

Author: richter
Date: Tue Nov 11 20:35:20 2014
New Revision: 1638375

URL: http://svn.apache.org/r1638375
Log:
remove non Embperl code form selectdyn

Modified:
    perl/embperl/trunk/Embperl/Form/Control/datetime.pm
    perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm

Modified: perl/embperl/trunk/Embperl/Form/Control/datetime.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/datetime.pm?rev=1638375&r1=1638374&r2=1638375&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/datetime.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/datetime.pm Tue Nov 11 20:35:20 2014
@@ -57,6 +57,7 @@ sub get_display_text
     
     $time = $self -> get_value ($req) if (!defined ($time)) ;
 
+    return $time if ($self -> {format} eq '-') ;
     return if ($time eq '') ;
 
     if ($self -> {dynamic} && ($time =~ /^\s*((?:d|m|y|q)(?:\+|-)?(?:\d+)?)\s*$/))
@@ -110,7 +111,7 @@ sub init_data
     my $fdat  = $req -> {docdata} || \%fdat ;
     my $name    = $self->{name} ;
     my $time    = $fdat->{$name} ;
-    return if ($time eq '' || ($req -> {"ef_datetime_init_done_$name"} && !$force)) ;
+    return if ($time eq '' || $self -> {format} eq '-' || ($req -> {"ef_datetime_init_done_$name"} && !$force)) ;
 
     $fdat->{$name} = $self -> get_display_text ($req, $time) ;
     $req -> {"ef_datetime_init_done_$name"} = 1 ;
@@ -140,7 +141,7 @@ sub prepare_fdat
     {
     my ($self, $req) = @_ ;
 
-    return if ($self -> is_readonly ($req)) ;
+    return if ($self -> is_readonly ($req) || $self -> {format} eq '-') ;
     
     my $fdat  = $req -> {form} || \%fdat ;
     my $name    = $self->{name} ;

Modified: perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm?rev=1638375&r1=1638374&r2=1638375&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/selectdyn.pm Tue Nov 11 20:35:20 2014
@@ -86,6 +86,23 @@ sub show_control_addons
 
     }
     
+# ---------------------------------------------------------------------------
+
+sub get_doctypes_for_new
+    {
+    my ($self, $req) = @_ ;
+
+    return ;
+    }
+    
+# ---------------------------------------------------------------------------
+
+sub get_datasource
+    {
+    my ($self) = @_ ;
+    
+    return  $self -> {datasrcobj} ;
+    }
 
 1 ;
 
@@ -106,24 +123,18 @@ my $doctypes ;
 my $datasrc = $self -> {datasrc} ;
 if ($datasrc)
     {
-    my %doctypes ;
-    my $datasource = $self -> {datasrcobj} ||= CouchDB::AppServ::DataSource -> get_datasource ($datasrc) ;
-    $datasrc = $datasource -> datasource ;
-    if (!$self -> {no_new})
+    my $datasource = $self -> get_datasource ;
+    if ($datasource)
         {
-        my $docclasses = $datasource -> get_doctypes_for_datasrc (undef, ['no_new', 'indirect']) ;
-        foreach my $doctype (@$docclasses)
+        $datasrc = $datasource -> datasource ;
+        if (!$self -> {no_new})
             {
-            my $docclass = CouchDB::AppServ::Docclass -> find_docclass ($doctype) ;
-            next if (!$docclass || $docclass -> abstract_doctype eq ref $docclass) ;
-            #next if ($subclass -> is_allowed ('new', $reqdata, $reqdata -> {document}) != 1) ;
-            $doctypes{$docclass -> title ($req -> {i18n})} = $docclass -> doctype ;            
+            $doctypes = $self -> get_doctypes_for_new ($req, $datasource) ;
             }
-        $doctypes = join (',', map {( $doctypes{$_}, $_) } sort keys %doctypes) ;    
+        
+        my ($constrain, $without_constrain) = $datasource -> get_constrain_value ($req, $self) ;
+        $datasrc .= '&constrain=' . $epreq->Escape ($constrain,6) . '&without_constrain=' . ($without_constrain?1:0) if ($constrain) ;
         }
-    
-    my ($constrain, $without_constrain) = $datasource -> get_constrain_value ($req, $self) ;
-    $datasrc .= '&constrain=' . $epreq->Escape ($constrain,6) . '&without_constrain=' . ($without_constrain?1:0) if ($constrain) ;
     }
 
 my $addtop    = $self -> {addtop} ;
@@ -141,6 +152,7 @@ if ($addbottom)
     }
     
 $]
+<div class="ef-control-selectdyn-div">
 <input name="_opt_[+ $name +]" [+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, undef, undef, 'ef-context-menu ' . ($self -> {no_button}?'':'ef-control-selectdyn-has-ctrl' )) } +]
 type="text" _ef_attach="ef_selectdyn" 
 [$if $self -> {size}            $]size="[+ $self->{size} +]" [$endif$]
@@ -158,6 +170,7 @@ type="text" _ef_attach="ef_selectdyn" 
 [$if !$self -> {no_button} $]<span class="ui-icon ui-icon-triangle-1-s ef-icon ef-control-selectdyn-ctrl ef-context-menu [+ $self -> {state} +]"></span>[$endif$]
 <input type="hidden" name="[+ $name +]">
 <input type="hidden" name="_id_[+ $name +]">
+</div>
 [$endsub$]
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org