[interchange-cvs] interchange - heins modified 5 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Sun May 29 11:30:19 EDT 2005


User:      heins
Date:      2005-05-29 15:30:19 GMT
Modified:  lib/Vend Interpolate.pm
Modified:  dist/standard/include/checkout shopping_cart
Modified:  dist/standard/pages/ord basket.html finalize.html
Modified:  dist/standard/templates/components cart
Log:
* Change [quantity-name] and [modifier-name attribute] to [PREFIX-quantity-name]
  and [PREFIX-modifier-name attribute].

* Provide list compatibility routines to make the old tag keywords work.

* Update standard catalog to use these.

* Passes regression tests 100%.

* I thought this had been done a long time ago!

Revision  Changes    Path
2.247     +17 -20    interchange/lib/Vend/Interpolate.pm


rev 2.247, prev_rev 2.246
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.246
retrieving revision 2.247
diff -u -r2.246 -r2.247
--- Interpolate.pm	17 May 2005 16:59:33 -0000	2.246
+++ Interpolate.pm	29 May 2005 15:30:19 -0000	2.247
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.246 2005/05/17 16:59:33 mheins Exp $
+# $Id: Interpolate.pm,v 2.247 2005/05/29 15:30:19 mheins Exp $
 #
 # Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.246 $, 10);
+$VERSION = substr(q$Revision: 2.247 $, 10);
 
 @EXPORT = qw (
 
@@ -397,12 +397,12 @@
 		elsif
 		matches
 		match_count
-		modifier_name
+		_modifier_name
 		more
 		more_list
 		no_match
 		on_match
-		quantity_name
+		_quantity_name
 		sort
 		then
 
@@ -470,14 +470,12 @@
 	'_increment'	=> qr($T{_increment}\]),
 	'_last'			=> qr($T{_last}\]\s*($Some)\s*),
 	'_line'			=> qr($T{_line}$Opt\]),
-	'_modifier_if'	=> qr($T{_modifier}(\d*)$Spacef(!?)$Spaceo($Codere)$Optr\]($Some)),
-	'_modifier'		=> qr($T{_modifier}$Spacef(\w+)\]),
 	'_next'			=> qr($T{_next}\]\s*($Some)\s*),
 	'_options'		=> qr($T{_options}($Spacef[^\]]+)?\]),
 	'_header_param'	=> qr($T{_header_param}$Mandf$Optr\]),
 	'_header_param_if'	=> qr($T{_header_param}(\d*)$Spacef(!?)\s*($Codere)$Optr\]($Some)),
-	'_param_if'		=> qr($T{_param}(\d*)$Spacef(!?)\s*($Codere)$Optr\]($Some)),
-	'_param'		=> qr($T{_param}$Mandf\]),
+	'_param_if'		=> qr((?:$T{_param}|$T{_modifier})(\d*)$Spacef(!?)\s*($Codere)$Optr\]($Some)),
+	'_param'		=> qr((?:$T{_param}|$T{_modifier})$Mandf\]),
 	'_parent_if'	=> qr($T{_parent}(\d*)$Spacef(!?)\s*($Codere)$Optr\]($Some)),
 	'_parent'		=> qr($T{_parent}$Mandf\]),
 	'_pos_if'		=> qr($T{_pos}(\d*)$Spacef(!?)\s*(\d+)$Optr\]($Some)),
@@ -496,12 +494,12 @@
 	'elsif_end'		=> qr($T{elsif}\s+($All)$T{'/elsif'}\s*$),
 	'matches'		=> qr($T{matches}\]),
 	'match_count'		=> qr($T{match_count}\]),
-	'modifier_name'	=> qr($T{modifier_name}$Spacef(\w+)\]),
 	'more'			=> qr($T{more}\]),
 	'more_list'		=> qr($T{more_list}$Optx$Optx$Optx$Optx$Optx\]($Some)$T{'/more_list'}),
 	'no_match'   	=> qr($T{no_match}\]($Some)$T{'/no_match'}),
 	'on_match'   	=> qr($T{on_match}\]($Some)$T{'/on_match'}),
-	'quantity_name'	=> qr($T{quantity_name}\]),
+	'_quantity_name'	=> qr($T{_quantity_name}\]),
+	'_modifier_name'	=> qr($T{_modifier_name}$Spacef(\w+)\]),
 	'then'			=> qr(^\s*$T{then}$T($Some)$T{'/then'}),
 );
 
@@ -3031,11 +3029,14 @@
 	my $prefix = shift;
 	my $textref = shift;
 
+	$$textref =~ s:\[quantity[-_]name:[$prefix-quantity-name:gi;
+	$$textref =~ s:\[modifier[-_]name\s:[$prefix-modifier-name :gi;
+
 	$$textref =~ s:\[if[-_]data\s:[if-$prefix-data :gi
 		and $$textref =~ s:\[/if[-_]data\]:[/if-$prefix-data]:gi;
 
-	$$textref =~ s:\[if[-_]modifier\s:[if-$prefix-modifier :gi
-		and $$textref =~ s:\[/if[-_]modifier\]:[/if-$prefix-modifier]:gi;
+	$$textref =~ s:\[if[-_]modifier\s:[if-$prefix-param :gi
+		and $$textref =~ s:\[/if[-_]modifier\]:[/if-$prefix-param]:gi;
 
 	$$textref =~ s:\[if[-_]field\s:[if-$prefix-field :gi
 		and $$textref =~ s:\[/if[-_]field\]:[/if-$prefix-field]:gi;
@@ -4077,7 +4078,7 @@
 						  alternate($count, $1, $end, $page_start, $array_last)
 				  							?	pull_else($2)
 											:	pull_if($2)#ige;
-		1 while $run =~ s#$IB$QR{_param_if}$IE[-_]param\1\]#
+		1 while $run =~ s#$IB$QR{_param_if}$IE[-_](?:param|modifier)\1\]#
 				  (defined $fh->{$3} ? $row->[$fh->{$3}] : '')
 				  					?	pull_if($5,$2,$4,$row->[$fh->{$3}])
 									:	pull_else($5,$2,$4,$row->[$fh->{$3}])#ige;
@@ -4252,7 +4253,7 @@
 											:	pull_if($2)#ge;
 		tag_labeled_data_row($code,\$run);
 		$run =~ s:$B$QR{_line}:join "\t", @{$hash}:ge;
-		1 while $run =~ s#$IB$QR{_param_if}$IE[-_]param\1\]#
+		1 while $run =~ s#$IB$QR{_param_if}$IE[-_](?:param|modifier)\1\]#
 				  $item->{$3}	?	pull_if($5,$2,$4,$item->{$3})
 								:	pull_else($5,$2,$4,$item->{$3})#ige;
 		1 while $run =~ s#$IB$QR{_parent_if}$IE[-_]parent\1\]#
@@ -4262,9 +4263,6 @@
 				  my $tmp = item_field($item, $3);
 				  $tmp	?	pull_if($5,$2,$4,$tmp)
 						:	pull_else($5,$2,$4,$tmp)#ge;
-		1 while $run =~ s#$IB$QR{_modifier_if}$IE[-_]modifier\1\]#
-				  $item->{$3}	?	pull_if($5,$2,$4,$item->{$3})
-								:	pull_else($5,$2,$4,$item->{$3})#ge;
 		$run =~ s:$B$QR{_increment}:$i + 1:ge;
 		
 		$run =~ s:$B$QR{_accessories}:
@@ -4274,11 +4272,10 @@
 		$run =~ s:$B$QR{_sku}:$code:ig;
 		$run =~ s:$B$QR{_code}:$item->{code}:ig;
 		$run =~ s:$B$QR{_quantity}:$item->{quantity}:g;
-		$run =~ s:$B$QR{_modifier}:ed($item->{$1}):ge;
 		$run =~ s:$B$QR{_param}:ed($item->{$1}):ge;
 		$run =~ s:$B$QR{_parent}:ed($opt->{$1}):ge;
-		$run =~ s:$QR{quantity_name}:quantity$item->{mv_ip}:g;
-		$run =~ s:$QR{modifier_name}:$1$item->{mv_ip}:g;
+		$run =~ s:$B$QR{_quantity_name}:quantity$item->{mv_ip}:g;
+		$run =~ s:$B$QR{_modifier_name}:$1$item->{mv_ip}:g;
 		$run =~ s!$B$QR{_subtotal}!currency(item_subtotal($item),$1)!ge;
 		$run =~ s!$B$QR{_discount_subtotal}!
 						currency( discount_subtotal($item), $1 )!ge;



1.3       +2 -2      interchange/dist/standard/include/checkout/shopping_cart


rev 1.3, prev_rev 1.2
Index: shopping_cart
===================================================================
RCS file: /var/cvs/interchange/dist/standard/include/checkout/shopping_cart,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- shopping_cart	26 Jan 2005 17:51:13 -0000	1.2
+++ shopping_cart	29 May 2005 15:30:19 -0000	1.3
@@ -15,7 +15,7 @@
 
         <tr class="[item-alternate 2]cartnorm[else]cartalt[/else][/item-alternate]">
           <td valign=top>
-            <inPUT type=checkbox name="[quantity-name]" onClick="this.form.action='[process]', this.form.submit()" value=0>
+            <input type=checkbox name="[item-quantity-name]" onClick="this.form.action='[process]', this.form.submit()" value=0>
           </td>
           <td><b>[item-sku]</b></td>
           <td><a href="[area href="[item-sku]"]" class="cartlink"><b>[item-description]</b></a>
@@ -40,7 +40,7 @@
             [/if-item-field]
           </td>
           <td valign=top>
-            <input type=text name="[quantity-name]" value="[item-quantity]" size=3>
+            <input type=text name="[item-quantity-name]" value="[item-quantity]" size=3>
           </td>
           <td>
             [item-discount-price]



1.7       +3 -3      interchange/dist/standard/pages/ord/basket.html


rev 1.7, prev_rev 1.6
Index: basket.html
===================================================================
RCS file: /var/cvs/interchange/dist/standard/pages/ord/basket.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- basket.html	23 Apr 2005 18:10:12 -0000	1.6
+++ basket.html	29 May 2005 15:30:19 -0000	1.7
@@ -136,7 +136,7 @@
 	<TR class="[item-calc]$row_class || 'cartnorm'[/item-calc]">
 		<TD align=center valign="top">
 [if-item-param !mv_si]
-	    		<INPUT TYPE=checkbox NAME="[quantity-name]" onClick="this.form.action='[process-target]', this.form.submit()" VALUE=0>
+	    		<INPUT TYPE=checkbox NAME="[item-quantity-name]" onClick="this.form.action='[process-target]', this.form.submit()" VALUE=0>
 [/if-item-param]
 	  	</TD>
 	  	<TD valign="top"><b>[item-sku]</b></TD>
@@ -236,10 +236,10 @@
 
 	  </TD>
 
-[input-filter name="[quantity-name]" op="nullselect digits_dot"][/input-filter]
+[input-filter name="[item-quantity-name]" op="nullselect digits_dot"][/input-filter]
 
 	  <TD ALIGN=CENTER valign="top">
-	    <INPUT TYPE=text NAME="[quantity-name]" VALUE="[item-quantity]" SIZE=3>
+	    <INPUT TYPE=text NAME="[item-quantity-name]" VALUE="[item-quantity]" SIZE=3>
 	  </TD>
 	[if discount [item-code]]
 	  <TD ALIGN=right valign="top">



1.7       +2 -2      interchange/dist/standard/pages/ord/finalize.html


rev 1.7, prev_rev 1.6
Index: finalize.html
===================================================================
RCS file: /var/cvs/interchange/dist/standard/pages/ord/finalize.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- finalize.html	23 Apr 2005 18:10:12 -0000	1.6
+++ finalize.html	29 May 2005 15:30:19 -0000	1.7
@@ -74,7 +74,7 @@
 
         <TR class="[item-alternate 2]cartdisplay[else]cartdisplay_alt[/else][/item-alternate]">
           <TD align=center valign=top>
-            <INPUT TYPE=checkbox NAME="[quantity-name]" onClick="this.form.action='[process]', this.form.submit()" VALUE=0>
+            <INPUT TYPE=checkbox NAME="[item-quantity-name]" onClick="this.form.action='[process]', this.form.submit()" VALUE=0>
           </TD>
           <TD><b>[item-sku]</b></TD>
           <TD><a href="[area href="[item-sku]"]" class="cartlink"><b>[item-description]</b></a>
@@ -88,7 +88,7 @@
             [/if-item-field]
           </TD>
           <TD ALIGN=CENTER valign=top>
-            <INPUT TYPE=text NAME="[quantity-name]" VALUE="[item-quantity]" SIZE=3>
+            <INPUT TYPE=text NAME="[item-quantity-name]" VALUE="[item-quantity]" SIZE=3>
           </TD>
           <TD ALIGN=RIGHT>
             [item-discount-price]



1.3       +5 -5      interchange/dist/standard/templates/components/cart


rev 1.3, prev_rev 1.2
Index: cart
===================================================================
RCS file: /var/cvs/interchange/dist/standard/templates/components/cart,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cart	26 Jan 2005 17:59:22 -0000	1.2
+++ cart	29 May 2005 15:30:19 -0000	1.3
@@ -93,7 +93,7 @@
 
 	<TR class="[item-calc]$row_class || 'cartnorm'[/item-calc]">
 		<TD align=center valign="top">
-	    		<INPUT TYPE=checkbox NAME="[quantity-name]" onClick="this.form.action='[process-target]', this.form.submit()" VALUE=0>
+	    		<INPUT TYPE=checkbox NAME="[item-quantity-name]" onClick="this.form.action='[process-target]', this.form.submit()" VALUE=0>
 	  	</TD>
 	  	<TD valign="top"><b>[item-sku]</b></TD>
 	  	<td><a href="[area href="item-sku"]" class="cartlink"><b>[item-description]</b></A><br><br>
@@ -190,10 +190,10 @@
 
 	  </TD>
 
-[input-filter name="[quantity-name]" op="nullselect digits_dot"][/input-filter]
+[input-filter name="[item-quantity-name]" op="nullselect digits_dot"][/input-filter]
 
 	  <TD ALIGN=CENTER valign="top">
-	    <INPUT TYPE=text NAME="[quantity-name]" VALUE="[item-quantity]" SIZE=3>
+	    <INPUT TYPE=text NAME="[item-quantity-name]" VALUE="[item-quantity]" SIZE=3>
 	  </TD>
 	[if discount [item-code]]
 	  <TD ALIGN=right valign="top">
@@ -234,7 +234,7 @@
 	  <TD>&nbsp;</td>
 	  <TD>
 	    <SMALL>
-	    <INPUT TYPE=hidden NAME="[modifier-name mv_an]" VALUE="{mv_an}">
+	    <INPUT TYPE=hidden NAME="[item-modifier-name mv_an]" VALUE="{mv_an}">
 	    {textarea}
 	    </SMALL>
 	  </TD>
@@ -247,7 +247,7 @@
 	  </TD>
 	  <TD>
 	    <SMALL>
-	    <PRE>{mv_ad}</PRE><INPUT TYPE=hidden NAME="[modifier-name mv_ad]" VALUE="[filter entities]{mv_ad}[/filter]">
+	    <PRE>{mv_ad}</PRE><INPUT TYPE=hidden NAME="[item-modifier-name mv_ad]" VALUE="[filter entities]{mv_ad}[/filter]">
 	    </SMALL>
 	  </TD>
 	  <TD>&nbsp;</TD>








More information about the interchange-cvs mailing list