[interchange-cvs] interchange - heins modified 4 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Wed Sep 11 19:23:01 2002
User: heins
Date: 2002-09-11 23:22:55 GMT
Modified: dist/lib/UI/pages/admin db_metaconfig_spread.html
Modified: spread.html
Modified: code/UI_Tag row_edit.coretag
Modified: scripts interchange.PL
Log:
* Improve spreadsheet.
-- Any meta widget can be used.
-- No possiblity of data crossover with embedded nulls.
-- Remove need for "Change display" with improved meta edit (will
add temporary view selector soon).
-- Better display (I think).
-- Better consistency of display for data and new record, etc.
-- Fields can use meta, go to textarea, have text field all selectable
from spreadsheet meta control.
Revision Changes Path
2.3 +14 -0 interchange/dist/lib/UI/pages/admin/db_metaconfig_spre=
ad.html
rev 2.3, prev_rev 2.2
Index: db_metaconfig_spread.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/db_metaconfig_spread=
html,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -r2.2 -r2.3
--- db_metaconfig_spread.html 5 Feb 2002 20:57:04 -0000 2.2
+++ db_metaconfig_spread.html 11 Sep 2002 23:22:54 -0000 2.3
@@ -51,6 +51,7 @@
[table-editor
table=3Dmv_metadata
view=3Ddbconfig
+ table-width=3D"90%"
=20
key=3D"[scratch tmp_dbcode]"
=20
@@ -62,8 +63,10 @@
=3DSpreadsheet page display
=20
extended.spread_fields
+ extended.spread_meta
extended.spread_height
extended.spread_width
+ extended.spread_textarea
extended.spread_textarea_rows
"
=20
@@ -71,16 +74,23 @@
code =3D> 'View::Table',
name =3D> 'Description',
'extended.spread_fields' =3D> 'Fields to edit',
+ 'extended.spread_meta' =3D> 'Fields to meta display',
+ 'extended.spread_textarea' =3D> 'Fields for textarea display',
'extended.spread_height' =3D> 'Number of rows',
'extended.spread_width' =3D> 'Column width',
'extended.spread_textarea_rows' =3D> 'Rows in a textarea',
}`
=20
+ filter=3D`{
+ 'extended.spread_meta' =3D> 'null_to_space',
+ }`
widget=3D`{
code =3D> 'hidden_text',
name =3D> 'value',
height =3D> 'text_5',
'extended.spread_fields' =3D> 'move_combo_8',
+ 'extended.spread_meta' =3D> 'checkbox_left_4',
+ 'extended.spread_textarea' =3D> 'checkbox_left_4',
'extended.spread_height' =3D> 'text_5',
'extended.spread_width' =3D> 'text_5',
'extended.spread_textarea_rows' =3D> 'text_5',
@@ -88,6 +98,8 @@
=20
database=3D`{
'extended.spread_fields' =3D> $CGI->{ui_table},
+ 'extended.spread_meta' =3D> $CGI->{ui_table},
+ 'extended.spread_textarea' =3D> $CGI->{ui_table},
}`
=20
height=3D`{
@@ -96,6 +108,8 @@
=20
options=3D`{
'extended.spread_fields' =3D> 'columns',
+ 'extended.spread_meta' =3D> 'columns',
+ 'extended.spread_textarea' =3D> 'columns',
}`
=20
]
2.6 +157 -105 interchange/dist/lib/UI/pages/admin/spread.html
rev 2.6, prev_rev 2.5
Index: spread.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/spread.html,v
retrieving revision 2.5
retrieving revision 2.6
diff -u -r2.5 -r2.6
--- spread.html 18 Aug 2002 15:38:26 -0000 2.5
+++ spread.html 11 Sep 2002 23:22:55 -0000 2.6
@@ -18,7 +18,7 @@
form=3D"
ui_table=3D[cgi mv_data_table]
ui_view=3D[cgi ui_meta_view]
- "][cgi mv_data_table]
+ "][cgi mv_data_table]</A>
[/either]
[/seti]
[set ui_class]Admin[/set]
@@ -27,98 +27,137 @@
=20
@_UI_STD_HEAD_@
=20
+<FORM ACTION=3D"[area href=3D"[either][cgi ui_searchpage][or]@@MV_PAGE@@[/=
either]"]" METHOD=3DGET>
+<INPUT TYPE=3Dhidden NAME=3Dmv_session_id VALUE=3D"[data session id]">
+<INPUT TYPE=3Dhidden NAME=3Dmv_data_table VALUE=3D"[cgi mv_data_table]">
+<INPUT TYPE=3Dhidden NAME=3Dmv_action VALUE=3Dback>
+<INPUT TYPE=3Dhidden NAME=3Dui_show_fields VALUE=3D"[cgi ui_show_fields]">
+
+[if !scratch tmp_large]
+<table>
+<tr>
+<td>
+ [loop list=3D"[cgi mv_data_table]"]
+ [if-loop-data __UI_META_TABLE__ name]
+ <B>[loop-data __UI_META_TABLE__ name]</B>
+ [/if-loop-data]
+ [if-loop-data __UI_META_TABLE__ help_url]
+ <small><A HREF=3D"[loop-data __UI_META_TABLE__ help_=
url]">help</A></small>
+ [/if-loop-data]
+ [if-loop-data __UI_META_TABLE__ help]
+ <BR><i>[loop-data __UI_META_TABLE__ name]</i>
+ [/if-loop-data]
+ [/loop]
+</td>
+<td>
+<input NAME=3Dui_text_qualification size=3D16><INPUT TYPE=3Dsubmit VALUE=
=3D"[L]Limit with search[/L]">
+</td>
+</tr>
+</table>
+[/if]
+</FORM>
+
+
+
[perl tables=3D"[cgi mv_data_table] __UI_META_TABLE__"]
my $table =3D $CGI->{mv_data_table};
my $db =3D $Db{$table};
my $mrec =3D $Tag->meta_record($table, $CGI->{ui_meta_view}) || {};
- $Values->{mv_data_table} =3D $table;
- $Values->{ui_data_key_name} =3D $db->config('KEY');
- my @fields =3D grep
- $_ ne $Values->{ui_data_key_name},
- split /[\0\s,]+/,
- $CGI->{ui_data_fields} ||
- $CGI->{mv_data_fields} ||
- $Values->{"spread:$table:ui_data_fields"} ||
- $mrec->{spread_fields} ||
- $mrec->{attribute} ||
- join(" ", $db->columns());
- $Values->{ui_data_fields} =3D join " ", @fields;
-
- $Values->{"ui_spread_meta:$table"} =3D $CGI->{"ui_spread_meta:$table"}
- if defined $CGI->{"ui_spread_meta:$table"};
-
- $Values->{ui_meta_display} =3D $Values->{"ui_spread_meta:$table"};
-
- $Values->{ui_spreadsheet_rows} =3D
- $Values->{"ui_spreadsheet_rows:$table"}
- ||=3D $CGI->{"ui_spreadsheet_rows:$table"} || $mrec->{spread_height} ||=
10;=20
-
- $Values->{ui_textarea_rows} =3D
- $Values->{"ui_textarea_rows:$table"} ||=3D $mrec->{spread_textarea_rows}=
|| 4;
-
- $Values->{ui_spread_size} =3D
- $Values->{"ui_spread_size:$table"}
- ||=3D $CGI->{"ui_spread_size:$table"} || $mrec->{spread_width} || 12;=
=20
+ $mrec ||=3D {};
+ $mrec->{spread_fields} ||=3D join(" ", $db->columns());
+ $mrec->{spread_height} ||=3D 10;
+ my $key =3D $CGI->{ui_data_key_name} =3D $db->config('KEY');
+ $mrec->{spread_sort} ||=3D $key;
+ $CGI->{ui_description_field} =3D $mrec->{label};
+
+ my $qual;
+ if ($CGI->{ui_text_qualification} and $CGI->{ui_text_qualification} =3D~ =
/=3D/ ) {
+ my ($f, $s) =3D split /\s*=3D\s*/, $CGI->{ui_text_qualification} , 2;
+ $qual =3D "co=3D1\nop=3Deq\nse=3D$s\nsf=3D$f";
+ }
+ elsif ($CGI->{ui_text_qualification}) {
+ $qual =3D "se=3D$CGI->{ui_text_qualification}";
+ }
+ else {
+ $qual =3D "ra=3Dyes";
+ }
+
+ my @fields =3D split /[\0\s,]+/, $mrec->{spread_fields};
+ @fields =3D grep length($_) && $_ ne $key, @fields;
+
+ $CGI->{mv_data_fields} =3D join " ", @fields;
=20
+ $CGI->{mrec_textarea_rows} ||=3D 4;
+
+ $CGI->{mrec_spread_width} ||=3D $mrec->{spread_width} || 12;=20
+
+ my $sp =3D q{@@MV_PAGE@@};
+
+ $Scratch->{mrec_options} =3D qq{
+ $qual
+ fi=3D$table
+ st=3Ddb
+ sp=3D$sp
+ ml=3D$mrec->{spread_height}
+ rf=3D$CGI->{ui_data_key_name}
+ tf=3D$mrec->{spread_sort}
+ };
+ $Scratch->{ui_num_col} =3D scalar(@fields) + 2;
+ $Scratch->{ui_most_col} =3D $Scratch->{ui_num_col} - 1;=20
+ $Config->{NoSearch} =3D '';
return;
[/perl]
-[if scratch ui_failure]
- <blockquote class=3Dcerror>
- [msg arg.0=3D"[scratchd ui_failure]"]Error: %s[/msg]
- </blockquote>
-[/if]
+
<FORM METHOD=3DPOST ACTION=3D"[base-url]/ui">
<INPUT TYPE=3Dhidden NAME=3D"mv_todo" VALUE=3D"set">
<INPUT TYPE=3Dhidden NAME=3D"mv_nextpage" VALUE=3D"@@MV_PAGE@@">
<INPUT TYPE=3Dhidden NAME=3D"mv_data_table" VALUE=3D"[value mv_data_table]=
">
<INPUT TYPE=3Dhidden NAME=3D"mv_data_key" VALUE=3D"[value ui_data_key_name=
]">
<INPUT TYPE=3Dhidden NAME=3D"mv_data_decode" VALUE=3D"yes">
+<INPUT TYPE=3Dhidden NAME=3D"mv_data_multiple" VALUE=3D"1">
+<INPUT TYPE=3Dhidden NAME=3D"mv_click" VALUE=3D"process_filter">
<INPUT TYPE=3Dhidden NAME=3D"mv_update_empty" VALUE=3D"1">
<INPUT TYPE=3Dhidden NAME=3D"mv_update_empty_key" VALUE=3D"0">
<INPUT TYPE=3Dhidden NAME=3D"ui_text_qualification" value=3D"[cgi ui_text_=
qualification]">
<INPUT TYPE=3Dhidden NAME=3D"ui_return_to" value=3D"[cgi ui_return_to]">
-<INPUT TYPE=3Dhidden NAME=3D"mv_data_fields"
- VALUE=3D"[db-columns columns=3D'[value ui_data_fields]']">
-
+<INPUT TYPE=3Dhidden NAME=3D"mv_data_fields" VALUE=3D"[cgi mv_data_fields]=
">
<INPUT TYPE=3Dhidden NAME=3D"mv_data_function" VALUE=3D"update">
=20
[calc]
- @areas =3D grep /\S/, split /[\s,\0]+/, $Values->{ui_data_fields};
- $Scratch->{ui_num_col} =3D scalar(@areas) + 2;
- $Config->{NoSearch} =3D '';
- if ($CGI->{ui_text_qualification} and $CGI->{ui_text_qualification} =3D~ =
/=3D/ ) {
- my ($f, $s) =3D split /\s*=3D\s*/, $CGI->{ui_text_qualification} , 2;
- $CGI->{ui_text_qualification} =3D "co=3D1\nop=3Deq\nse=3D$s\nsf=3D$f";
- }
- elsif ($CGI->{ui_text_qualification}) {
- $CGI->{ui_text_qualification} =3D "se=3D$CGI->{ui_text_qualification}";
- }
- else {
- $CGI->{ui_text_qualification} =3D "ra=3Dyes";
- }
- $CGI->{ui_description_field} =3D
- q{[data table=3D__UI_META_TABLE__
- col=3Dfield
- key=3D"[cgi mv_data_table]"
- ]};
-
- return;
[/calc]
=20
-[if !value ui_spreadsheet_rows]
-[value name=3Dui_spreadsheet_rows set=3D10 hide=3D1]
-[/if]
-[search-region more=3D1 arg=3D"
- [cgi ui_text_qualification]
- ml=3D[value ui_spreadsheet_rows]
- rf=3D[value ui_data_key_name]
- tf=3D[value ui_data_key_name]
- st=3Ddb
- sp=3D@@MV_PAGE@@
- fi=3D[value mv_data_table]
- "]
+[search-region more=3D1 arg=3D"[scratch mrec_options]"]
+<table cellpadding=3D2 cellspacing=3D0 width=3D"90%">
=20
-<table __UI_T_PROPERTIES__>
+<tr>
+<td colspan=3D"[scratch ui_num_col]" class=3Drborder><img src=3D"bg.gif" w=
idth=3D__UI_MAIN_WIDTH__ height=3D1></td>
+</tr>
+<tr>
+ <td class=3Drnorm> </td>
+ <td colspan=3D"[scratch ui_most_col]" class=3Drnorm>
+ [button text=3D"[L]Ok[/L]" extra=3D|style=3D"font-weigh=
t: bold"|]
+ mv_todo=3Dset
+ [return-to click]
+ [/button]
+ <INPUT TYPE=3Dsubmit NAME=3Dmv_click VALUE=3D"[L]Cancel[/L]">
+ </td>
+</tr>
+[more-list]
+[prev-anchor] <span style=3D"font-size: larger; font-weight: bo=
lder"><</span> [/prev-anchor]
+[next-anchor] <span style=3D"font-size: larger; font-weight: bo=
lder">></span> [/next-anchor]
+[first-anchor] <span style=3D"font-size: larger; font-weight: bolder"=
><<</span>[/first-anchor]
+[last-anchor] <span style=3D"font-size: larger; font-weight: bolder">=
>></span>[/last-anchor]
+[page-anchor] <span style=3D"font-size: larger; font-weight: bolder">=
$PAGE$</span>[/page-anchor]
+<tr>
+<td colspan=3D"[scratch ui_num_col]" class=3Drspacer><img src=3D"bg.gif" w=
idth=3D__UI_MAIN_WIDTH__ height=3D1></td>
+</tr>
+<tr>
+<td class=3Drnorm> </td>
+<td colspan=3D"[scratch ui_most_col]" class=3Drnorm>
+ [msg arg.0=3D`q{[more]}`]More pages: %s[/msg]
+</td>
+</tr>
+[/more-list]
=20
<tr>
<td colspan=3D"[scratch ui_num_col]" class=3Drborder><img src=3D"bg.gif" w=
idth=3D__UI_MAIN_WIDTH__ height=3D1></td>
@@ -126,23 +165,24 @@
=20
<TR class=3Drnorm CELLPADDING=3D2>
<TH ALIGN=3DCENTER> </TH>
- <TH ALIGN=3DCENTER>[value ui_data_key_name]</TH>
- [row-edit
- columns=3D"[value ui_data_fields]"
- height=3D`$Values->{"ui_textarea_rows:$Values->{mv_data_table}"}`
- textarea=3D"[value name=3D'ui_textarea_fields:[value mv_data_table]']"
- ]
+ <TH ALIGN=3DCENTER>[cgi ui_data_key_name]</TH>
+ [row-edit columns=3D"[cgi mv_data_fields]" ]
</TR>
=20
-<tr>
-<td colspan=3D"[scratch ui_num_col]" class=3Drspacer><img src=3D"bg.gif" w=
idth=3D__UI_MAIN_WIDTH__ height=3D1></td>
-</tr>
-
[search-list]
+ [item-sub addnum]
+ my $inc =3D shift;
+ my $out =3D '';
+ if($ss_row_num) {
+ $out =3D $ss_row_num . '_';
+ }
+ $ss_row_num++ if $inc;
+ return $out;
+ [/item-sub]
[if-mm keys [item-code]]
<TR class=3Drnorm>
- <td><input type=3Dcheckbox name=3D"batch_id" value=3D"[item-code]"><input=
type=3Dhidden name=3D"[value ui_data_key_name]" value=3D"[item-code]"></td>
- <TD>
+ <td valign=3Dtop><input type=3Dcheckbox name=3D"batch_id" value=3D"[item-=
code]"><input type=3Dhidden name=3D"[item-exec addnum][/item-exec][cgi ui_d=
ata_key_name]" value=3D"[item-code]"></td>
+ <TD valign=3Dtop>
[page href=3D"__UI_BASE__/flex_editor"
form=3D|
page_title=3DEdit [value mv_data_table]: [item-code]
@@ -152,37 +192,55 @@
</TD>
[row-edit
key=3D"[item-code]"
- size=3D"[value ui_spread_size]"
- columns=3D"[value ui_data_fields]"
- height=3D`
- my $tab =3D $Values->{mv_data_table};
- return $Values->{"ui_textarea_rows:$tab"};
- `
- textarea=3D`
- my $tab =3D $Values->{mv_data_table};
- return $Values->{"ui_textarea_fields:$tab"};
- `
+ extra=3D"valign=3Dtop"
+ pointer=3D"[item-exec addnum]1[/item-exec]"
+ columns=3D"[cgi mv_data_fields]"
]
</TR>
+<tr>
+<td colspan=3D"[scratch ui_num_col]" class=3Drspacer><img src=3D"bg.gif" w=
idth=3D__UI_MAIN_WIDTH__ height=3D1></td>
+</tr>
[/if-mm]
[set row_number][item-increment][/set]
[/search-list]
=20
+<tr>
+<td colspan=3D"[scratch ui_num_col]" class=3Drmarq>New record</td>
+</tr>
+
+<TR class=3Drnorm CELLPADDING=3D2>
+ <TH ALIGN=3DCENTER> </TH>
+ <TH ALIGN=3DCENTER>[cgi ui_data_key_name]</TH>
+ [row-edit columns=3D"[cgi mv_data_fields]" ]
+</TR>
+
+
<TR class=3Drnorm>
- <td COLSPAN=3D2>
- <input type=3Dtext size=3D12 name=3D"[value ui_data_key_name]">
+ <td COLSPAN=3D2 valign=3Dtop>
+ <input type=3Dtext size=3D12 name=3D"999999_[cgi ui_data_key_name]">
</TD>
- [row-edit blank=3D1 size=3D"[value ui_spread_size]" columns=3D"[value ui_=
data_fields]"]
+ [row-edit
+ blank=3D1
+ pointer=3D999999
+ extra=3D"valign=3Dtop"
+ columns=3D"[cgi mv_data_fields]"
+ extra=3D"valign=3Dtop"
+ ]
</TR>
=20
[more-list]
+[prev-anchor] <span style=3D"font-size: larger; font-weight: bo=
lder"><</span> [/prev-anchor]
+[next-anchor] <span style=3D"font-size: larger; font-weight: bo=
lder">></span> [/next-anchor]
+[first-anchor] <span style=3D"font-size: larger; font-weight: bolder"=
><<</span>[/first-anchor]
+[last-anchor] <span style=3D"font-size: larger; font-weight: bolder">=
>></span>[/last-anchor]
+[page-anchor] <span style=3D"font-size: larger; font-weight: bolder">=
$PAGE$</span>[/page-anchor]
<tr>
<td colspan=3D"[scratch ui_num_col]" class=3Drspacer><img src=3D"bg.gif" w=
idth=3D__UI_MAIN_WIDTH__ height=3D1></td>
</tr>
<tr>
<td class=3Drnorm> </td>
-<td colspan=3D"[calc]$Scratch->{ui_num_col} - 1[/calc]" class=3Drnorm>
- <FONT SIZE=3D"+1">[msg arg.0=3D"[more]"]More pages: %s[/msg] </FONT>
+<td colspan=3D"[scratch ui_most_col]" class=3Drnorm>
+ [msg arg.0=3D`q{[more]}`]More pages: %s[/msg]
</td>
</tr>
[/more-list]
@@ -197,18 +255,13 @@
=20
<tr>
<td class=3Drnorm> </td>
-<td colspan=3D"[calc]$Scratch->{ui_num_col} - 1[/calc]" class=3Drnorm>
+<td colspan=3D"[scratch ui_most_col]" class=3Drnorm>
=20
=20
- <B></B> [button text=3D"[L]Ok[/L]" bold=3D1]
+ [button text=3D"[L]Ok[/L]" extra=3D|style=3D"font-weigh=
t: bold"|]
mv_todo=3Dset
[return-to click]
[/button]
- [button text=3D"[L]Change display[/L]"]
- mv_todo=3Dreturn
- mv_data_table=3D[cgi mv_data_table]
- mv_nextpage=3D__UI_BASE__/spread_control
- [/button]
[button text=3D"[L]Delete checked rows[/L]"
confirm=3D"[L]Are you sure you want to delete the checked rows?[/L]"]
[flag type=3Dwrite table=3D"[cgi mv_data_table]"]
@@ -254,7 +307,6 @@
</center>
[/search-region]
</FORM>
-
=20
=20
<!-- ----- END REAL STUFF ----- -->
1.3 +58 -35 interchange/code/UI_Tag/row_edit.coretag
rev 1.3, prev_rev 1.2
Index: row_edit.coretag
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/code/UI_Tag/row_edit.coretag,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- row_edit.coretag 8 Feb 2002 23:08:20 -0000 1.2
+++ row_edit.coretag 11 Sep 2002 23:22:55 -0000 1.3
@@ -5,16 +5,39 @@
UserTag row-edit Routine <<EOR
sub {
my ($key,$table,$size,$columns,$opt) =3D @_;
- use vars qw/$CGI %Db $Values $Variable/;
+ use vars qw/$CGI $Values $Variable/;
#::logDebug("row_edit options=3D" . ::uneval($opt));
$table =3D $table || $CGI::values{mv_data_table} || return "BLANK DB";
- my $db =3D $Db{$table} || Vend::Data::database_exists_ref($table);
- my $mtab =3D $Variable->{UI_META_TABLE} || 'mvmetadata';
- my $mdb =3D $Db{$mtab} || Vend::Data::database_exists_ref($mtab);
+ my $db =3D ::database_exists_ref($table);
+ my $mtab =3D $::Variable->{UI_META_TABLE} || 'mv_metadata';
+ my $mdb =3D ::database_exists_ref($mtab);
$opt->{view} ||=3D $CGI->{ui_meta_view};
=20
my $view =3D UI::Primitive::meta_record($table, $opt->{view}) || {};
=20=09
+ my $tm_extra =3D '';
+ my $ta_extra =3D '';
+ my $tf_extra =3D '';
+ if($opt->{extra}) {
+ $tf_extra =3D " $opt->{extra}";
+ }
+ if($opt->{meta_extra}) {
+ $tm_extra .=3D " $opt->{meta_extra}";
+ }
+ if($opt->{textarea_extra}) {
+ $tm_extra .=3D " $opt->{meta_extra}";
+ }
+
+ $ta_extra ||=3D $tf_extra;
+ $tm_extra ||=3D $tf_extra;
+
+ my $prependor =3D '';
+ if($opt->{pointer}) {
+ $prependor =3D $opt->{pointer};
+ $prependor =3D~ s/\D+//;
+ $prependor =3D $prependor ? $prependor . '_' : '';
+#::logDebug("setting prependor to $prependor");
+ }
return errmsg("non-existent table '%s' for row-edit", $table)
unless $db;
$db =3D $db->ref();
@@ -25,11 +48,11 @@
if ($key) {
eval {
$bad =3D ! $db->record_exists($key);
- $bad =3D 'DELETED' if $bad;
+ $bad =3D errmsg('DELETED') if $bad;
};
- $bad =3D 'ERROR' if $@;
+ $bad =3D errmsg('ERROR') if $@;
if(! $bad and $acl) {
- $bad =3D 'Not available'
+ $bad =3D errmsg('Not available')
if ! UI::Primitive::ui_acl_atom($acl, 'keys', $key);
}
}
@@ -63,54 +86,54 @@
=20
my $out =3D '';
=20
- my $meta =3D $CGI->{ui_no_meta_display} ? '' : $view->{type};
+ my $meta =3D $CGI->{ui_no_meta_display} ? '' : $view->{spread_meta};
+ my %do_ta;
+ my %do_meta;
+ if($meta) {
+ my @metas =3D grep /\S/, split /[\0,\s]+/, $meta;
+ @do_meta{@metas} =3D @metas;
+ }
+
+ if($view->{spread_textarea}) {
+ my @tas =3D grep /\S/, split /[\0,\s]+/, $view->{spread_textarea};
+ @do_ta{@tas} =3D @tas;
+ }
my $tmp;
=20
$size =3D $size || $view->{width} || 12;
if($bad) {
for(@cols) {
- $out .=3D "<TD>$bad</TD>";
+ $out .=3D "<TD$tf_extra>$bad</TD>";
}
}
- elsif($key) {
- my $text;
+ elsif($key or $opt->{blank}) {
for(@cols) {
- eval {
- $text =3D $db->field($key,$_);
- };
- $text =3D 'DELETED' if $@;
+ my $text =3D $opt->{blank} ? '' : $db->field($key, $_);
my $msg =3D '';
- if($meta) {
- if ( $view->{type} =3D~ /combo|checkbox|multi|date|image|option_format=
/) {
- $msg =3D '<br><small><small>unable to display with field info</small>=
</small>';
- }
- else {
- my $tmp =3D UI::Primitive::meta_display($table,$_,$key,$text);
- $out .=3D "<TD>$tmp</TD>";
- next;
- }
+ if($do_meta{$_}) {
+ my $tmp =3D Vend::Tags->display( {
+ table =3D> $table,
+ column =3D> $_,
+ name =3D> "$prependor$_",
+ value =3D> $text,
+ template =3D> ' $WIDGET$ ',
+ });
+ $out .=3D "<TD$tm_extra>$tmp</TD>";
+ next;
}
-=09=09=09
- if($ta{$_} || $text =3D~ /\n/) {
+ elsif($do_ta{$_}) {
my $rows =3D $opt->{height} || 4;
HTML::Entities::encode($text, $ESCAPE_CHARS::std);
$out .=3D <<EOF;
-<TD><TEXTAREA NAME=3D"$_" COLS=3D"$size" ROWS=3D"$rows">$text</TEXTAREA>$m=
sg</TD>
+<TD$ta_extra><TEXTAREA NAME=3D"$prependor$_" COLS=3D"$size" ROWS=3D"$rows"=
>$text</TEXTAREA>$msg</TD>
EOF
}
else {
$text =3D~ s/"/"/g;
$out .=3D <<EOF;
-<TD><INPUT NAME=3D"$_" SIZE=3D$size VALUE=3D"$text">$msg</TD>
+<TD$tf_extra><INPUT NAME=3D"$prependor$_" SIZE=3D$size VALUE=3D"$text">$ms=
g</TD>
EOF
}
- }
- }
- elsif($opt->{blank}) {
- for(@cols) {
- $out .=3D <<EOF;
-<TD><INPUT NAME=3D"$_" SIZE=3D$size VALUE=3D""></TD>
-EOF
}
}
else {
2.56 +22 -1 interchange/scripts/interchange.PL
rev 2.56, prev_rev 2.55
Index: interchange.PL
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/scripts/interchange.PL,v
retrieving revision 2.55
retrieving revision 2.56
diff -u -r2.55 -r2.56
--- interchange.PL 7 Sep 2002 20:05:12 -0000 2.55
+++ interchange.PL 11 Sep 2002 23:22:55 -0000 2.56
@@ -3,7 +3,7 @@
#
# Interchange version 4.9.3
#
-# $Id: interchange.PL,v 2.55 2002/09/07 20:05:12 mheins Exp $
+# $Id: interchange.PL,v 2.56 2002/09/11 23:22:55 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. and others.
# http://www.icdevgroup.org/
@@ -804,9 +804,20 @@
#::logDebug("update_data: blob safe object=3D$safe");
}
=20
+ my @multis;
+ if($CGI::values{mv_data_multiple}) {
+ my $re =3D qr/^\d+_$prikey$/;
+ @multis =3D grep $_ =3D~ $re, keys %CGI::values;
+ for(@multis) {
+ s/_.*//;
+ }
+ @multis =3D sort { $a <=3D> $b } @multis;
+ }
+
#::logDebug("update_data:db=3D$db key=3D$prikey VALUES=3D" . ::uneval(\%CG=
I::values));
#::logDebug("update_data:db=3D$db key=3D$prikey data=3D" . ::uneval(\%data=
));
my $select_key;
+ SETDATA: {
for($i =3D 0; $i < @{$data{$prikey}}; $i++) {
#::logDebug("iteration of update_data:db=3D$db key=3D$prikey data=3D" . ::=
uneval(\%data));
@k =3D (); @v =3D ();
@@ -930,6 +941,16 @@
if $CGI::values{mv_data_email};
}
}
+ if(my $new =3D shift(@multis)) {
+#::logDebug("Doing multi for $new");
+ last SETDATA unless length $CGI::values{"${new}_$prikey"};
+ for(@fields) {
+ my $value =3D $CGI::values{$_} =3D $CGI::values{"${new}_$_"};
+ $data{$_} =3D [ $value ];
+ }
+ redo SETDATA;
+ }
+ } # end SETDATA
=20
if($CGI::values{mv_data_return_key}) {
my @keys =3D split /\0/, $CGI::values{mv_data_return_key};