[interchange-cvs] interchange - heins modified 5 files

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Wed Jul 2 00:06:01 2003


User:      heins
Date:      2003-07-02 04:05:51 GMT
Modified:  lib/Vend Form.pm
Modified:  lib/Vend/Table Editor.pm
Modified:  dist/lib/UI/pages/include/meta mv_metadata.asc
Modified:  dist/lib/UI/pages/include/templates ui_type1
Modified:  dist/foundation/products mv_metadata.asc
Log:
* Fix several things with Table editor

	-- Modified passing of {table} parameter in display for table editor,
	   setting flag to prevent getting table data twice.

	-- Make lookup_query honor {db} parameter for selecting base table
	   for lookup

	-- Lookup should now work internally to the table if no {db} spec'd

	-- Sigh -- Mozilla screwed up their CSS size passing like MSIE, so
	   remove special things that made item editor/table editor automatically
	   look better on Mozilla (without setting *_height and *_width explicitly).

	-- Added MAXLENGTH to things you can set in meta_editor

	-- Added MAXLENGTH to parameters honored by [display ...]/Vend::Form,
	   without having to manipulate extra=" maxlength=22" stuff.

	-- Put hooks in for auto-JS checks in table editor / [display]

* Other

    -- Made default metadata (for merge) match foundation

Revision  Changes    Path
2.34      +8 -2      interchange/lib/Vend/Form.pm


rev 2.34, prev_rev 2.33
Index: Form.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Form.pm,v
retrieving revision 2.33
retrieving revision 2.34
diff -u -r2.33 -r2.34
--- Form.pm	18 Jun 2003 17:34:44 -0000	2.33
+++ Form.pm	2 Jul 2003 04:05:51 -0000	2.34
@@ -1,6 +1,6 @@
 # Vend::Form - Generate Form widgets
 # 
-# $Id: Form.pm,v 2.33 2003/06/18 17:34:44 jon Exp $
+# $Id: Form.pm,v 2.34 2003/07/02 04:05:51 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.33 $, 10);
+$VERSION = substr(q$Revision: 2.34 $, 10);
 
 @EXPORT = qw (
 	display
@@ -94,6 +94,8 @@
 		.
 		qq({COLS?} cols="{COLS}"{/COLS?})
 		.
+		qq({MAXLENGTH?} maxlength="{MAXLENGTH}"{/MAXLENGTH?})
+		.
 		qq({WRAP?} wrap="{WRAP}"{/WRAP?})
 		.
 		qq({EXTRA?} {EXTRA}{/EXTRA?})
@@ -107,6 +109,8 @@
 		.
 		qq({COLS?} size="{COLS}"{/COLS?})
 		.
+		qq({MAXLENGTH?} maxlength="{MAXLENGTH}"{/MAXLENGTH?})
+		.
 		qq({EXTRA?} {EXTRA}{/EXTRA?})
 		.
 		qq(>{APPEND})
@@ -133,6 +137,8 @@
 		qq({PREPEND}<input type="text" name="{NAME}" value="{ENCODED}")
 		.
 		qq({COLS?} size="{COLS}"{/COLS?})
+		.
+		qq({MAXLENGTH?} maxlength="{MAXLENGTH}"{/MAXLENGTH?})
 		.
 		qq({EXTRA?} {EXTRA}{/EXTRA?})
 		.



1.36      +18 -10    interchange/lib/Vend/Table/Editor.pm


rev 1.36, prev_rev 1.35
Index: Editor.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/Editor.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- Editor.pm	19 Jun 2003 16:00:39 -0000	1.35
+++ Editor.pm	2 Jul 2003 04:05:51 -0000	1.36
@@ -1,6 +1,6 @@
 # Vend::Table::Editor - Swiss-army-knife table editor for Interchange
 #
-# $Id: Editor.pm,v 1.35 2003/06/19 16:00:39 mheins Exp $
+# $Id: Editor.pm,v 1.36 2003/07/02 04:05:51 mheins Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 2002 Mike Heins <mike@perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Table::Editor;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.35 $, 10);
+$VERSION = substr(q$Revision: 1.36 $, 10);
 
 use Vend::Util;
 use Vend::Interpolate;
@@ -234,6 +234,7 @@
 
 	if(! defined $opt->{value} and $table and $column and length($key)) {
 		$opt->{value} = tag_data($table, $column, $key);
+		$opt->{already_got_data} = 1;
 	}
 
 	my $mtab;
@@ -319,15 +320,18 @@
 								help
 								help_url
 								label
+								js_check
 								lookup
 								lookup_exclude
 								lookup_query
+								maxlength
 								name
 								options
 								outboard
 								passed
 								pre_filter
 								prepend
+								table
 								type
 								width
 								/;
@@ -757,7 +761,6 @@
 	left:0px;
 	top:${int1}px;
 	margin:0px;
-	padding:6px;
 	$opt->{panel_style}
 	}
 -->
@@ -1362,6 +1365,8 @@
                     label
                     lookup
                     lookup_query
+					js_check
+                    maxlength
                     meta
                     options
                     outboard
@@ -1758,6 +1763,8 @@
 	my $lookup       = $opt->{lookup};
 	my $lookup_query = $opt->{lookup_query};
 	my $meta         = $opt->{meta};
+	my $js_check     = $opt->{js_check};
+	my $maxlength    = $opt->{maxlength};
 	my $options      = $opt->{options};
 	my $outboard     = $opt->{outboard};
 	my $override     = $opt->{override};
@@ -2347,14 +2354,16 @@
 		chunk 'HIDDEN_USER', 'OUTPUT_MAP', join("", @o); # unless $wo;
 	}
 
-	if($opt->{tabbed} and $Session->{browser} !~ /Gecko/) {
-		$opt->{table_width} ||= $opt->{panel_width} + 10;
-		$opt->{table_height} ||= $opt->{panel_height} + 10;
+	if($opt->{tabbed}) {
+		$opt->{table_width} ||= ($opt->{panel_width} || 800) + 10;
+		$opt->{table_height} ||= ($opt->{panel_height} || 600) + 10;
+		$opt->{inner_table_width} ||= ($opt->{panel_width} || 800);
+		$opt->{inner_table_height} ||= ($opt->{panel_height} || 600);
 	}
 	chunk ttag(), <<EOF; # unless $wo;
 <table class=touter border="0" cellspacing="0" cellpadding="0" width="$opt->{table_width}" height="$opt->{table_height}">
 <tr>
-  <td>
+  <td valign=top>
 
 <table class=tinner width="$opt->{inner_table_width}" height="$opt->{inner_table_height}" cellspacing=0 cellmargin=0 cellpadding="2" align="center" border="0">
 EOF
@@ -3035,9 +3044,7 @@
         my $pw = $opt->{panel_width} || '800';
         my $th = $opt->{tab_height} || '30';
         my $oh = $ph + $th;
-        my $extra = $Vend::Session->{browser} =~ /Gecko/
-                  ? ''
-                  : " width=$pw height=$oh";
+        my $extra = " width=$pw height=$oh valign=top";
         chunk ttag(), qq{<tr><td colspan=$span$extra>\n};
     }
 
@@ -3284,6 +3291,7 @@
 							label				=> $label->{$c},
 							lookup				=> $lookup->{$c},
 							lookup_query		=> $lookup_query->{$c},
+							maxlength			=> $maxlength->{$c},
 							meta				=> $meta->{$c},
 							meta_url			=> $meta_url,
 							meta_url_specific	=> $meta_url_specific,



1.9       +7 -6      interchange/dist/lib/UI/pages/include/meta/mv_metadata.asc


rev 1.9, prev_rev 1.8
Index: mv_metadata.asc
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/include/meta/mv_metadata.asc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- mv_metadata.asc	19 Jun 2003 20:08:37 -0000	1.8
+++ mv_metadata.asc	2 Jul 2003 04:05:51 -0000	1.9
@@ -73,7 +73,7 @@
 inventory::min_order	text	5								Minimum Order Qty	Minimum number allowed to order										
 inventory::quantity	text	8								On hand											
 inventory::sku	text	16								SKU											
-inventory::stock_message	select							In stock,Ships in 3-5 days,Ships in 4-6 weeks,Special order		Out of stock message	Some absurd amount of help on the same line to make sure the colspan is good for use.	stock_message									
+inventory::stock_message	select							In stock,Ships in 3-5 days,Ships in 4-6 weeks,Special order		Out of stock message	A short message to explain what happens when the item is out of stock.	stock_message									
 item_select::products	table		50			Item Editor			item_select			products									{'ui_show_fields' => "sku
description
prod_group
category
price(%.2f align=right)",'ui_sort_field' => "description",'ui_special_add' => "Qty price;pricing:q5:rn,Option;products:option_type:r,Promo;merchandising:featured:r,Inventory;inventory:quantity:rn",}
 locale	table		10																		{'panel_shade' => "f",'ui_sort_field' => "code",'ui_more_alpha' => "1",'ui_more_decade' => "100",}
 matrix::options::price	text	12								Price			digits_dot								
@@ -115,6 +115,8 @@
 mv_metadata::attribute	text	20								Column name	Do not set this.										
 mv_metadata::code	text	30								Table::Column	Table::Column to be operated on.										
 mv_metadata::db	combo							tables		Lookup Table	Table for an external lookup.		nullselect								
+mv_metadata::extended.js_check	move_combo							required=Required,digits=Digits only,money=2 decimal places,no_html=No HTML		JavaScript checks			digits								
+mv_metadata::extended.maxlength	text	3								Maxlength for text field			digits								
 mv_metadata::field	move_combo	20	10					columns::		Field for lookup	Can be two comma separated fields, in which case second is used as the label text. Both must be in the same table.										
 mv_metadata::filter	move_combo	30	1					filters		Filter(s)	Filters which can transform or constrain your data. Some widgets
require filters.										
 mv_metadata::height	text	4								Height	SIZE for SELECT<BR>
ROWS for TEXTAREA<BR>		digits								
@@ -357,8 +359,6 @@
 variable	table											variable							1		{'ui_meta_specific' => "1",'panel_shade' => "f",'spread_height' => "25",'spread_meta' => "Variable pref_group",'ui_sort_combined' => "pref_group,code",}
 variable::Variable	text	60								Preference value											
 variable::Variable::ADDRESS	text									Company Address											
-variable::Variable::THEME_CSS	textarea_70_40									CSS for site	This overrides the setting in the foundation template/*/theme.cfg file.										
-variable::Variable::CATALOG_STATIC	select							No, Yes		Enabled for users?	<b>Yes</b> will cause Interchange to generate static links where possible.<BR><BR>
<b>No</b> disables generation of static links for users; you can still send a search engine to the statically generated URL and it will spider the static links on the page.										
 variable::Variable::CGI_URL	text									CGI URL	URL that calls Interchange, without the server name										
 variable::Variable::CHECK_ACCEPTED	select							0=No, 1=Yes													
 variable::Variable::COD_ACCEPTED	select							0=No, 1=Yes													
@@ -383,9 +383,10 @@
 variable::Variable::PO_ACCEPTED	select							0=No, 1=Yes													
 variable::Variable::SECURE_ENABLE	yesno									Enable Secure URL?											
 variable::Variable::SETTLE_TRANSACTION	yesno									Settle transactions	If you ship hard goods and only do an authorization at order time, you may choose to settle the transaction automatically via the Order manager. This needs to be set to Yes to enable this.										
-variable::Variable::STATIC_LOGGED	select							No, Yes		Enabled for logged in users?	<b>Yes</b> will cause Interchange to generate static links where possible, even when users are logged in.										
 variable::Variable::STYLE	select							foundation=Foundation Red,purpleyellow=Purple and Yellow,grayorange=Gray and Orange,fixedwidth=Fixed Width,greens=Green,grayscale=Gray,blueyellow=Blue and Yellow		Theme											
-variable::Variable::TAXFIELD	select							state=Simple state-based,
multi=State/Province and VAT		Type of tax	You must <b>apply changes</b> after changing this.										
+variable::Variable::TAXFIELD	select							state=Simple state-based,
multi=State/Province and VAT,=None		Type of tax	You must <b>apply changes</b> after changing this.										
+variable::Variable::THEME_CSS	textarea_70_40									CSS for site	This overrides the setting in the foundation template/*/theme.cfg file.										
+variable::Variable::UI_BACKUP_TABLES	multiple							tables		Tables to Back up			null_to_space								{}
 variable::Variable::UI_DBCONFIG	yesno									Offer Database Config Link	Shows Database configuration link on Tables  main manu										
 variable::Variable::UI_IMAGE_META	yesno									New table display style	Image meta llink										
 variable::Variable::UI_IMAGE_META-_NULL_-UI_META_LINK	yesno									New table display style											
@@ -393,7 +394,7 @@
 variable::Variable::UI_META_LINK	select							0=No, 1=Yes		Meta edit links	Determines whether enabled by default. They can be turned on in Preferences.										
 variable::Variable::UI_SECURE	yesno										Determines whether to force UI into secure mode or not.										
 variable::code	text									Variable name											
-variable::pref_group	combo	20								Preferences area		pref_group	nullselect								
+variable::pref_group	combo	20			variable					Preferences area		pref_group	nullselect								
 variant::inventory::quantity	text	8								On hand	Inventory of this variant.										
 variant::options::code	text	20								SKU									 		
 variant::options::description	textarea	60	3							Variant description											



1.4       +2 -1      interchange/dist/lib/UI/pages/include/templates/ui_type1


rev 1.4, prev_rev 1.3
Index: ui_type1
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/include/templates/ui_type1,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ui_type1	27 Jun 2003 04:06:17 -0000	1.3
+++ ui_type1	2 Jul 2003 04:05:51 -0000	1.4
@@ -182,7 +182,8 @@
                                  <td class="darkshade"> 
                                     <table width="100%" border="0" cellspacing="0" cellpadding="7">
                                        <tr> 
-                                          <td class="workarea"> 
+                                          <td class="workarea" valign=top>
+
 			  [if warnings]
 			  <blockquote class=cmessage>
 				  [warnings]



2.39      +4 -2      interchange/dist/foundation/products/mv_metadata.asc


rev 2.39, prev_rev 2.38
Index: mv_metadata.asc
===================================================================
RCS file: /var/cvs/interchange/dist/foundation/products/mv_metadata.asc,v
retrieving revision 2.38
retrieving revision 2.39
diff -u -r2.38 -r2.39
--- mv_metadata.asc	25 Jun 2003 15:32:55 -0000	2.38
+++ mv_metadata.asc	2 Jul 2003 04:05:51 -0000	2.39
@@ -50,7 +50,7 @@
 dbconfig::mv_metadata::options	move_combo	20	8	 				columns::		Fields to edit	Recommended fields to display on editor screen, in order of
 display. If a blank line is between them, a break line will
be put in.										
 dbconfig::mv_metadata::type	select							=No,
1=Yes		Display with meta (spreadsheet)			filesafe								
 dbconfig::mv_metadata::width	text	4								Default spreadsheet column width			digits								
-ichelp	table		100									ichelp							1		{'panel_shade' => "f",'ui_show_fields' => "code
title",'include_form' => "<td class=clabel>
                        Send result to ICDEVGROUP
                    </td>
                    <td class=cdata>
                        <input type=checkbox name=mv_cleanup value=send_to_icdevgroup> 
                             <span class=chelp style=\"font-size: smaller\">If you believe this help edit is generally applicable, you can check this button to send to ICDEVGROUP for possible inclusion in the distribution. (Emailed, your email must be working.)</span>
                    </td>",'ui_sort_field' => "code",}
+ichelp	table		100									ichelp									{'panel_shade' => "f",'ui_show_fields' => "code
title",'include_form' => "<td class=clabel>
                        Send result to ICDEVGROUP
                    </td>
                    <td class=cdata>
                        <input type=checkbox name=mv_cleanup value=send_to_icdevgroup> 
                             <span class=chelp style=\"font-size: smaller\">If you believe this help edit is generally applicable, you can check this button to send to ICDEVGROUP for possible inclusion in the distribution. (Emailed, your email must be working.)</span>
                    </td>",'ui_sort_field' => "code",}
 ichelp::helptext	textarea	72	15							Help Text											
 icmenu	table	12	50	code
mgroup
msort
next_line
page
name(30)
inactive
		Interchange menus						icmenu									
 icmenu::debug	yesno									Debug	 Set to "Yes" to get debug messages relating to the item (if supported by menu).										
@@ -115,6 +115,8 @@
 mv_metadata::attribute	text	20								Column name	Do not set this.										
 mv_metadata::code	text	30								Table::Column	Table::Column to be operated on.										
 mv_metadata::db	combo							tables		Lookup Table	Table for an external lookup.		nullselect								
+mv_metadata::extended.js_check	move_combo							required=Required,digits=Digits only,money=2 decimal places,no_html=No HTML		JavaScript checks			digits								
+mv_metadata::extended.maxlength	text	3								Maxlength for text field			digits								
 mv_metadata::field	move_combo	20	10					columns::		Field for lookup	Can be two comma separated fields, in which case second is used as the label text. Both must be in the same table.										
 mv_metadata::filter	move_combo	30	1					filters		Filter(s)	Filters which can transform or constrain your data. Some widgets
require filters.										
 mv_metadata::height	text	4								Height	SIZE for SELECT<BR>
ROWS for TEXTAREA<BR>		digits								
@@ -297,7 +299,7 @@
 transactions::deleted	yesno									Deleted											
 transactions::order_id	text	32								Order ID											
 transactions::status	select							pending=Pending, shipped=Shipped, partial=Partially shipped, backorder=Back ordered, waiting=Waiting for payment, credit=Waiting for credit check, canceled=Canceled					nullselect								
-ui-version										4.9.7											
+ui-version										4.9.9											
 ui_component::mv_metadata	table								ui_component			mv_metadata									{'ui_data_fields' => "=Main

code
label
default
type
width
height
options
filter

=Database lookup

lookup
field
db

=Help and misc

help
help_url
prepend
append
pre_filter",'table_width' => "80%",'left_width' => "30%",}
 ui_component::mv_metadata::append	textarea	60	5							Append HTML	<SMALL>HTML to be appended to the widget.
Will substitute in the macros _UI_TABLE_, _UI_COLUMN_,
_UI_KEY, and _UI_VALUE_, and will resolve relative links
with absolute links.</SMALL>										
 ui_component::mv_metadata::attribute	text	20								Column name	Do not set this.