[interchange-cvs] interchange - heins modified 2 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Mon Feb 2 15:58:13 EST 2004
User: heins
Date: 2004-02-02 20:58:13 GMT
Modified: lib/Vend Form.pm
Modified: lib/Vend/Table Editor.pm
Log:
* Allow setting of a disabled.param=1 entry so that you can show
widgets in a table editor yet not accept data from them. The DISABLED=1
flag will be set in the widget (which normally grays it out) and
it will be set to be display_only.
* Pass the form and form_name parameters to Vend::Form for use in
widgets.
Revision Changes Path
2.41 +14 -2 interchange/lib/Vend/Form.pm
rev 2.41, prev_rev 2.40
Index: Form.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Form.pm,v
retrieving revision 2.40
retrieving revision 2.41
diff -u -r2.40 -r2.41
--- Form.pm 30 Jan 2004 17:33:10 -0000 2.40
+++ Form.pm 2 Feb 2004 20:58:13 -0000 2.41
@@ -1,6 +1,6 @@
# Vend::Form - Generate Form widgets
#
-# $Id: Form.pm,v 2.40 2004/01/30 17:33:10 racke Exp $
+# $Id: Form.pm,v 2.41 2004/02/02 20:58:13 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -38,7 +38,7 @@
require Exporter;
@ISA = qw(Exporter);
-$VERSION = substr(q$Revision: 2.40 $, 10);
+$VERSION = substr(q$Revision: 2.41 $, 10);
@EXPORT = qw (
display
@@ -74,6 +74,8 @@
.
qq({ROWS?} size="{ROWS}"{/ROWS?})
.
+ qq({DISABLED?} DISABLED{/DISABLED?})
+ .
qq({MULTIPLE?} MULTIPLE{/MULTIPLE?})
.
qq({EXTRA?} {EXTRA}{/EXTRA?})
@@ -94,6 +96,8 @@
.
qq({COLS?} cols="{COLS}"{/COLS?})
.
+ qq({DISABLED?} DISABLED{/DISABLED?})
+ .
qq({MAXLENGTH?} maxlength="{MAXLENGTH}"{/MAXLENGTH?})
.
qq({WRAP?} wrap="{WRAP}"{/WRAP?})
@@ -138,6 +142,8 @@
.
qq({COLS?} size="{COLS}"{/COLS?})
.
+ qq({DISABLED?} DISABLED{/DISABLED?})
+ .
qq({MAXLENGTH?} maxlength="{MAXLENGTH}"{/MAXLENGTH?})
.
qq({EXTRA?} {EXTRA}{/EXTRA?})
@@ -163,6 +169,8 @@
.
qq({EXTRA?} {EXTRA}{/EXTRA?})
.
+ qq({DISABLED?} DISABLED{/DISABLED?})
+ .
qq({SELECTED?} CHECKED{/SELECTED?})
.
qq(> {TLABEL})
@@ -172,6 +180,8 @@
.
qq({EXTRA?} {EXTRA}{/EXTRA?})
.
+ qq({DISABLED?} DISABLED{/DISABLED?})
+ .
qq({SELECTED?} CHECKED{/SELECTED?})
.
qq(> {TLABEL} )
@@ -189,6 +199,8 @@
qq(<td{TD_VALUE?} {TD_VALUE}{/TD_VALUE?}>)
.
qq(<input type="{VARIANT}" name="{NAME}" value="{TVALUE}")
+ .
+ qq({DISABLED?} DISABLED{/DISABLED?})
.
qq({EXTRA?} {EXTRA}{/EXTRA?})
.
1.49 +13 -4 interchange/lib/Vend/Table/Editor.pm
rev 1.49, prev_rev 1.48
Index: Editor.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/Editor.pm,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- Editor.pm 29 Jan 2004 01:43:45 -0000 1.48
+++ Editor.pm 2 Feb 2004 20:58:13 -0000 1.49
@@ -1,6 +1,6 @@
# Vend::Table::Editor - Swiss-army-knife table editor for Interchange
#
-# $Id: Editor.pm,v 1.48 2004/01/29 01:43:45 mheins Exp $
+# $Id: Editor.pm,v 1.49 2004/02/02 20:58:13 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
package Vend::Table::Editor;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.48 $, 10);
+$VERSION = substr(q$Revision: 1.49 $, 10);
use Vend::Util;
use Vend::Interpolate;
@@ -314,7 +314,10 @@
db
class
extra
+ disabled
field
+ form
+ form_name
filter
height
help
@@ -1065,6 +1068,7 @@
check
database
default
+ disabled
extra
field
filter
@@ -1354,6 +1358,7 @@
for(qw/
append
default
+ disabled
database
error
extra
@@ -1763,6 +1768,7 @@
my $class = $opt->{class} || {};
my $database = $opt->{database};
my $default = $opt->{default};
+ my $disabled = $opt->{disabled};
my $error = $opt->{error};
my $extra = $opt->{extra};
my $field = $opt->{field};
@@ -3140,6 +3146,7 @@
and $col = "$t:$1"
and $serialize = $c;
$k = $3 || undef;
+ $do = 1 if $disabled->{$c};
push @ext_enable, ("$t:$c" . $k ? ":$k" : '')
unless $do;
}
@@ -3149,6 +3156,7 @@
$c =~ /(.+?)\.\w.*/
and $col = $1
and $serialize = $c;
+ $do = 1 if $disabled->{$c};
push @data_enable, $col
unless $do and ! $opt->{mailto};
}
@@ -3226,7 +3234,7 @@
#::logDebug("display_only=$do col=$c");
$widget->{$c} = 'value'
- if $do and ! ($opt->{wizard} || $opt->{mailto});
+ if $do and ! ($disabled->{$c} || $opt->{wizard} || $opt->{mailto});
if (! length $currval and defined $default->{$c}) {
$currval = $default->{$c};
@@ -3333,6 +3341,7 @@
db => $database->{$c},
default => $currval,
default_widget => $opt->{default_widget},
+ disabled => $disabled->{$c},
extra => $extra->{$c},
fallback => 1,
field => $field->{$c},
@@ -3490,7 +3499,7 @@
### END USER INCLUDE
unless ($opt->{mailto} and $opt->{mv_blob_only}) {
- @cols = grep ! $display_only{$_}, @cols;
+ @cols = grep ! $display_only{$_} && ! $disabled->{$_}, @cols;
}
$passed_fields = join " ", @cols;
More information about the interchange-cvs
mailing list