Interchange

CVS log for interchange/lib/Vend/Interpolate.pm

[BACK] Up to [Local Repository] / interchange / lib / Vend

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 2.310: download - view: text, markup, annotated - select for diffs
Fri Dec 5 16:43:40 2008 UTC (4 weeks, 5 days ago) by mheins
Branches: MAIN
CVS tags: HEAD
Diff to: previous 2.309: preferred, colored
Changes since revision 2.309: +11 -4 lines

* Make TAX_CATEGORY_FIELD work as intended, where a colon-separated
  table and field will work as well as a simple field in the same table
  as the item.

Revision 2.309: download - view: text, markup, annotated - select for diffs
Sun Nov 16 05:01:03 2008 UTC (7 weeks, 3 days ago) by jon
Branches: MAIN
Diff to: previous 2.308: preferred, colored
Changes since revision 2.308: +9 -12 lines
Remove unnecessary calls to item_subtotal and thus the database.

In the first chunk, when there's a discount, there were extra calls to
item_subtotal.

In the second chunk, apply_discount only takes one argument, and it calls
item_subtotal itself, so there's no point in calling it in the parent.

Patch by Josh Braegger <jbraegger@backcountry.com>, with a little cleanup
and removal of the now-unused $tmp variable by myself.

Thanks, Josh!

Revision 2.308: download - view: text, markup, annotated - select for diffs
Sun Sep 21 11:40:27 2008 UTC (3 months, 2 weeks ago) by racke
Branches: MAIN
CVS tags: REL_5_7_1
Diff to: previous 2.307: preferred, colored
Changes since revision 2.307: +4 -2 lines
Vend::Interpolate::interpolate_html returns undef on undefined input text.
This allows to determine whether $Tag->include fails or just produces an
empty string.

Revision 2.307: download - view: text, markup, annotated - select for diffs
Fri Sep 12 21:59:48 2008 UTC (3 months, 3 weeks ago) by racke
Branches: MAIN
Diff to: previous 2.306: preferred, colored
Changes since revision 2.306: +3 -2 lines
Under rare cases the missing search can fall through in a block below, which
caused an internal server error in the following code line:

	$obj->{matches} = scalar @{$obj->{mv_results}};

This is now mitigated by an empty mv_results array and results in a search
error as one would expect.

Revision 2.306: download - view: text, markup, annotated - select for diffs
Mon Jul 28 21:27:28 2008 UTC (5 months, 1 week ago) by mheins
Branches: MAIN
Diff to: previous 2.305: preferred, colored
Changes since revision 2.305: +6 -2 lines
* Make levies description fix I should have originally made.

Revision 2.261.2.9: download - view: text, markup, annotated - select for diffs
Mon Jul 28 21:27:22 2008 UTC (5 months, 1 week ago) by mheins
Branches: STABLE_5_4-branch
CVS tags: REL_5_4_3
Diff to: previous 2.261.2.8: preferred, colored; branchpoint 2.261: preferred, colored; next MAIN 2.262: preferred, colored
Changes since revision 2.261.2.8: +5 -2 lines
* Make levies description fix I should have originally made.

Revision 2.303.2.3: download - view: text, markup, annotated - select for diffs
Mon Jul 28 21:27:03 2008 UTC (5 months, 1 week ago) by mheins
Branches: STABLE_5_6-branch
CVS tags: REL_5_6_1, DEB_5_6_1_2
Diff to: previous 2.303.2.2: preferred, colored; branchpoint 2.303: preferred, colored; next MAIN 2.304: preferred, colored
Changes since revision 2.303.2.2: +5 -2 lines
* Make levies description fix I should have originally made.

Revision 2.303.2.2: download - view: text, markup, annotated - select for diffs
Mon Jul 28 20:49:45 2008 UTC (5 months, 1 week ago) by mheins
Branches: STABLE_5_6-branch
Diff to: previous 2.303.2.1: preferred, colored; branchpoint 2.303: preferred, colored
Changes since revision 2.303.2.1: +2 -3 lines
* Fix bug in my commit found by Racke

Revision 2.261.2.8: download - view: text, markup, annotated - select for diffs
Mon Jul 28 20:49:13 2008 UTC (5 months, 1 week ago) by mheins
Branches: STABLE_5_4-branch
Diff to: previous 2.261.2.7: preferred, colored; branchpoint 2.261: preferred, colored
Changes since revision 2.261.2.7: +2 -3 lines
* Fix bug in my commit found by Racke

Revision 2.305: download - view: text, markup, annotated - select for diffs
Mon Jul 28 20:47:48 2008 UTC (5 months, 1 week ago) by mheins
Branches: MAIN
Diff to: previous 2.304: preferred, colored
Changes since revision 2.304: +2 -3 lines
* Fix bug in my commit found by Racke.

Revision 2.261.2.7: download - view: text, markup, annotated - select for diffs
Mon Jun 16 14:39:57 2008 UTC (6 months, 3 weeks ago) by mheins
Branches: STABLE_5_4-branch
Diff to: previous 2.261.2.6: preferred, colored; branchpoint 2.261: preferred, colored
Changes since revision 2.261.2.6: +17 -4 lines
* Fix deficiency in Levies, where multiple handling modes separated by null
  would not work as in the old subtotal calculation model.

Revision 2.303.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 16 14:39:07 2008 UTC (6 months, 3 weeks ago) by mheins
Branches: STABLE_5_6-branch
Diff to: previous 2.303: preferred, colored
Changes since revision 2.303: +17 -4 lines
* Fix deficiency in Levies, where multiple handling modes separated by null
  would not work as in the old subtotal calculation model.

Revision 2.304: download - view: text, markup, annotated - select for diffs
Mon Jun 16 14:35:56 2008 UTC (6 months, 3 weeks ago) by mheins
Branches: MAIN
Diff to: previous 2.303: preferred, colored
Changes since revision 2.303: +17 -4 lines
* Fix deficiency in Levies, where multiple handling modes separated by null
  would not work as in the old subtotal calculation model.

Revision 2.303: download - view: text, markup, annotated - select for diffs
Tue May 13 22:33:15 2008 UTC (7 months, 3 weeks ago) by jon
Branches: MAIN
CVS tags: STABLE_5_6-root, REL_5_5_3
Branch point for: STABLE_5_6-branch
Diff to: previous 2.302: preferred, colored
Changes since revision 2.302: +5 -6 lines
Change syntax for option to use custom SQL as a counter.

Resolves syntax conflict with MySQL pseudo-counters:

    db_name:table_name(column_name)

Syntax is now:

    dbname:SELECT function_name(args)

Revision 2.302: download - view: text, markup, annotated - select for diffs
Tue May 13 02:53:13 2008 UTC (7 months, 3 weeks ago) by jon
Branches: MAIN
Diff to: previous 2.301: preferred, colored
Changes since revision 2.301: +12 -10 lines
Optimize empty [perl] blocks.

Skip costly eval of code entirely if perl tag was called with no code,
as is often done for the side-effect of opening database handles.

Revision 2.301: download - view: text, markup, annotated - select for diffs
Mon May 12 16:08:43 2008 UTC (7 months, 3 weeks ago) by mheins
Branches: MAIN
Diff to: previous 2.300: preferred, colored
Changes since revision 2.300: +3 -3 lines
* Fix bug: Remove /o causing change of delimiter for all loops on page.

Revision 2.300: download - view: text, markup, annotated - select for diffs
Wed Apr 23 03:16:23 2008 UTC (8 months, 2 weeks ago) by pajamian
Branches: MAIN
CVS tags: REL_5_5_2
Diff to: previous 2.299: preferred, colored
Changes since revision 2.299: +3 -3 lines
Fixed bug where previous rows values were left in $Row if [loop] is iterated with [PREFIX-next].

Revision 2.299: download - view: text, markup, annotated - select for diffs
Thu Apr 17 22:50:33 2008 UTC (8 months, 3 weeks ago) by jon
Branches: MAIN
Diff to: previous 2.298: preferred, colored
Changes since revision 2.298: +8 -2 lines
Fix regexes that use UTF-8 inside a Safe compartment.

Patch by Sonny Cook <sonny@endpoint.com>, with some logging tweaks by me.

Revision 2.298: download - view: text, markup, annotated - select for diffs
Tue Mar 25 17:13:21 2008 UTC (9 months, 2 weeks ago) by jon
Branches: MAIN
Diff to: previous 2.297: preferred, colored
Changes since revision 2.297: +3 -3 lines
Various minor UTF-8 changes.

Correct attribution of &Vend::CharSet::display_chars (which is from
perluniintro manpage).

Enable localization of an error string.

Match content type more tightly in 2 spots ("text" is only trustworthy
in the MIME major type, not minor, and even that may be a stretch).

Simplify request method matching in a few places for readability and a
(trivial) performance benefit.

Use conventional $c lexical instead of $g for catalog hashref.

Fix tab/space differences to match context.

Update copyrights of files changed in 2008.

Revision 2.297: download - view: text, markup, annotated - select for diffs
Fri Mar 21 18:56:12 2008 UTC (9 months, 2 weeks ago) by jon
Branches: MAIN
Diff to: previous 2.296: preferred, colored
Changes since revision 2.296: +3 -3 lines
Add new synonym [if var ...] = [if variable ...] to match the [var] tag.

The invalid [if var ...] form was quietly accepted but always evaluated
to true, so this synonym is an important usability enhancement for any
expected [if var ...] that would evaluate to true during testing but
misleadingly appears to work.

Includes a unit test, and also tests for [if variable ...] and
[if global ...].

Thanks to Dan Collis-Puro <dan@endpoint.com> for the idea.

Revision 2.296: download - view: text, markup, annotated - select for diffs
Sat Feb 16 06:47:00 2008 UTC (10 months, 3 weeks ago) by kwalsh
Branches: MAIN
Diff to: previous 2.295: preferred, colored
Changes since revision 2.295: +3 -2 lines
    * Give the "flypage" SpecialSub the choice of returning a plain SKU
      value rather than the overly-complicated { mv_results => [[$sku]] }
      hashref.

Revision 2.295: download - view: text, markup, annotated - select for diffs
Mon Feb 11 21:37:47 2008 UTC (10 months, 3 weeks ago) by mheins
Branches: MAIN
Diff to: previous 2.294: preferred, colored
Changes since revision 2.294: +4 -3 lines
* Get rid of cuddled else that is not within coding guidelines
  (perlstyle).

Revision 2.294: download - view: text, markup, annotated - select for diffs
Wed Feb 6 16:29:55 2008 UTC (11 months ago) by mheins
Branches: MAIN
Diff to: previous 2.293: preferred, colored
Changes since revision 2.293: +5 -5 lines
* Incorporate changes suggested by Lars Tode:

	- Make sort apply even if type is custom and nothing is returned by
	  custom routine

	- Allow inclusive attribute even for non-salestax items.

Revision 2.293: download - view: text, markup, annotated - select for diffs
Sat Dec 22 20:49:34 2007 UTC (12 months, 2 weeks ago) by kwalsh
Branches: MAIN
Diff to: previous 2.292: preferred, colored
Changes since revision 2.292: +5 -5 lines
    * Allow localisation of the "No search was found" error message.
      Patch supplied by Rene Hertell - thanks.

Revision 2.292: download - view: text, markup, annotated - select for diffs
Sat Nov 17 23:30:33 2007 UTC (13 months, 3 weeks ago) by jon
Branches: MAIN
Diff to: previous 2.291: preferred, colored
Changes since revision 2.291: +9 -2 lines
Add option to use a custom SQL function as a counter.

This allows something other than a plain database sequence to be used to
replace counter files, for example to allow character prefixes or suffixes
with sequences, or to avoid writing files locally when in a cluster
environment.

For example, if you create a function called "custom_counter" in PostgreSQL,
you would set up catalog.cfg like this:

UserDB  default   sql_counter  "userdb:custom_counter('userdb_username_seq')"
Route   default   sql_counter  "transactions:custom_counter('order_number_seq')"

And whatever the custom_counter function returns will be used by Interchange.

Revision 2.291: download - view: text, markup, annotated - select for diffs
Thu Nov 15 00:29:39 2007 UTC (13 months, 3 weeks ago) by jon
Branches: MAIN
Diff to: previous 2.290: preferred, colored
Changes since revision 2.290: +5 -5 lines
Correct output of value-extended after successful file write.

The docs here:

http://www.icdevgroup.org/interchange-doc-5.2.0/frames/ictags_121.html

state, and it makes intuitive sense, that Perly true should be returned when
a file is successfully written. This was not the case before.

Also use earlier-set lexicals to avoid repeating the fallback to ''.

Thanks to Spencer Christensen <schristensen@backcountry.com> for the patch.

Revision 2.290: download - view: text, markup, annotated - select for diffs
Tue Nov 6 10:58:26 2007 UTC (14 months ago) by kwalsh
Branches: MAIN
Diff to: previous 2.289: preferred, colored
Changes since revision 2.289: +7 -5 lines
    * Further to the previous patch.  It seemed a bit silly to keep the
      random=0 backward compatibility when all of the other rules were
      thrown out of the window, so random=0 is now the same as random=no
      (return all of the original rows in their original order).

Revision 2.289: download - view: text, markup, annotated - select for diffs
Tue Nov 6 10:20:38 2007 UTC (14 months ago) by kwalsh
Branches: MAIN
Diff to: previous 2.288: preferred, colored
Changes since revision 2.288: +5 -4 lines
    * Fix to the "random" parameter used by looping tags.

	-- If set to "no" or "false" then do nothing (previously returned
	   one random result).

	-- If set to "yes" or "true" then then return all results in a
	   random order (again, previously returned one random result).

	-- If set to a numeric > 0 then return that many random results.

	-- If set to 0 then return 1 random result (as before).

	-- If set to a numeric > the available results then return all
	   results in a random order (previously returned the original
	   results in the original order).

    If you're using "random=yes" to request one random result then you
    will need to change your code to use random=1 instead.

Revision 2.288: download - view: text, markup, annotated - select for diffs
Tue Oct 30 16:27:43 2007 UTC (14 months, 1 week ago) by mheins
Branches: MAIN
Diff to: previous 2.287: preferred, colored
Changes since revision 2.287: +4 -4 lines
* Upon reconsideration, I have made negative tax amounts excluded upon
  use of a pragma. It seems to me that if you want to prevent negative
  tax, you should prevent negative amounts.

Revision 2.287: download - view: text, markup, annotated - select for diffs
Tue Oct 30 16:23:32 2007 UTC (14 months, 1 week ago) by mheins
Branches: MAIN
Diff to: previous 2.286: preferred, colored
Changes since revision 2.286: +10 -6 lines
* Fix salestax() routine to not allow negative tax. Allow it with use of a
  Pragma, if someone wants to implement refunds.

* Remove code that does nothing -- fly_tax was being run frequently when
  not needed at all. (The $cost var was never accessed again.)

Revision 2.286: download - view: text, markup, annotated - select for diffs
Thu Oct 11 01:37:16 2007 UTC (14 months, 4 weeks ago) by kwalsh
Branches: MAIN
Diff to: previous 2.285: preferred, colored
Changes since revision 2.285: +6 -4 lines
    * Fixed something that looked like a security bug.  It seemed to me
      that a filename of "tmp/../../../../something" would get past the
      checks, so changed the code to make use of Vend::File::allowed_file()
      instead.

Revision 2.285: download - view: text, markup, annotated - select for diffs
Mon Sep 17 05:37:31 2007 UTC (15 months, 3 weeks ago) by kwalsh
Branches: MAIN
Diff to: previous 2.284: preferred, colored
Changes since revision 2.284: +17 -2 lines
    * Created a new [PREFIX-include] loop sub-tag.  This works just like
      the [include] tag, except that it allows other [PREFIX-*] sub-tags
      to be parsed from within the included file.

      Note: Files included with [PREFIX-include] cannot contain further
      [PREFIX-include] sub-tags.  This could be easily created (respecting
      the "include_depth" Limit etc.) but I felt that that was an
      unnecessary overhead.

Revision 2.284: download - view: text, markup, annotated - select for diffs
Mon Aug 20 23:57:34 2007 UTC (16 months, 2 weeks ago) by kwalsh
Branches: MAIN
CVS tags: REL_5_5_1, DEB_5_5_1_1_1, DEB_5_5_1
Diff to: previous 2.283: preferred, colored
Changes since revision 2.283: +9 -2 lines
    * Added a new "scratchd" test type.  This is the same as "scratch"
      except that it deletes the variable from the scratchpad after
      testing.

Revision 2.283: download - view: text, markup, annotated - select for diffs
Fri Aug 10 08:41:22 2007 UTC (16 months, 4 weeks ago) by thunder
Branches: MAIN
Diff to: previous 2.282: preferred, colored
Changes since revision 2.282: +3 -3 lines
pass  to labeled_list  fixing behaviour of fly-list to be matching other x-list tags (#89)

Revision 2.282: download - view: text, markup, annotated - select for diffs
Fri Jul 6 10:08:58 2007 UTC (18 months ago) by racke
Branches: MAIN
Diff to: previous 2.281: preferred, colored
Changes since revision 2.281: +2 -24 lines
Superfluous Vend::Interpolate::sort_cart function removed (#70).

Revision 2.281: download - view: text, markup, annotated - select for diffs
Wed Jun 20 16:02:28 2007 UTC (18 months, 2 weeks ago) by mheins
Branches: MAIN
Diff to: previous 2.280: preferred, colored
Changes since revision 2.280: +59 -30 lines
* Add templated more-list feature. Completely compatible with default,
  but allows a list like:

		{FIRST_LINK?}{FIRST_LINK} {/FIRST_LINK?}
		{PREV_LINK?}{PREV_LINK} {/PREV_LINK?}
		{DECADE_PREV?}{DECADE_PREV} {/DECADE_PREV?}
			{MORE_LIST}
		{DECADE_NEXT?} {DECADE_NEXT}{/DECADE_NEXT?}
		{NEXT_LINK?} {NEXT_LINK}{/NEXT_LINK?}
		{LAST_LINK?} {LAST_LINK}{/LAST_LINK?});

  Supports following:

  	  {MATCH_COUNT}           Same as [match-count], number of matches
  	  {MATCHES}               Same as [matches]
  	  {LAST_PAGE}             Last page number
  	  {CURRENT_PAGE}          Current page number
  	  {DECADE_FIRST}          First page of decade
  	  {DECADE_LAST}           Last page of decade
	  {FIRST_MATCH}           First match displayed on this page
	  {LAST_MATCH}            Last match displayed on this page
	  {FIRST_LINK}            Link to first page
	  {PREV_LINK}             Link to previous page
	  {DECADE_PREV}           Link to decade previous
	  {MORE_LIST}             The page list
	  {DECADE_NEXT}           Link to next decade
	  {NEXT_LINK}             Link to next page
	  {LAST_LINK}             Link to last page

* Add ability for custom more routine with $opt->{more_routine} name
  passed in [search-region] or [query].

* Example for a simple match display:

	[search-region]
	[search-list]
	[item-param sku] - [item-param description]<br>
	[/search-list]
	[more-list /icons/right.gif /icons/left.gif 0 0]
	<p>
	{PREV_LINK}
		Page {CURRENT_PAGE} of {TOTAL_PAGES}
	{NEXT_LINK}
	</p>
	[/more-list]
	[/search-region]

We may want to add an additional subtemplate for the different match
types, but we will wait to see how this works.

Developed with generous support of Paradigm CC -- thanks Peter!

Revision 2.280: download - view: text, markup, annotated - select for diffs
Thu May 24 16:21:26 2007 UTC (19 months, 2 weeks ago) by markj
Branches: MAIN
Diff to: previous 2.279: preferred, colored
Changes since revision 2.279: +4 -4 lines
Adding support for negative indexes on PREFIX-pos constructs.

Revision 2.261.2.6: download - view: text, markup, annotated - select for diffs
Fri Mar 30 12:15:28 2007 UTC (21 months, 1 week ago) by pajamian
Branches: STABLE_5_4-branch
Diff to: previous 2.261.2.5: preferred, colored; branchpoint 2.261: preferred, colored
Changes since revision 2.261.2.5: +4 -4 lines
New Free Software Foundation Address in headers of various files

Revision 2.279: download - view: text, markup, annotated - select for diffs
Fri Mar 30 11:39:45 2007 UTC (21 months, 1 week ago) by pajamian
Branches: MAIN
Diff to: previous 2.278: preferred, colored
Changes since revision 2.278: +4 -4 lines
New Free Software Foundation Address in headers of various files

Revision 2.278: download - view: text, markup, annotated - select for diffs
Tue Feb 27 11:32:08 2007 UTC (22 months, 1 week ago) by racke
Branches: MAIN
Diff to: previous 2.277: preferred, colored
Changes since revision 2.277: +3 -3 lines
issue error message if subroutine for PREFIX-exec is missing

Revision 2.277: download - view: text, markup, annotated - select for diffs
Thu Feb 15 15:13:59 2007 UTC (22 months, 3 weeks ago) by racke
Branches: MAIN
Diff to: previous 2.276: preferred, colored
Changes since revision 2.276: +11 -5 lines
Fix [on-match]/[no-match] for loop lists without matchlimit generated from
embedded Perl objects

Revision 2.261.2.5: download - view: text, markup, annotated - select for diffs
Wed Sep 20 12:36:13 2006 UTC (2 years, 3 months ago) by kwalsh
Branches: STABLE_5_4-branch
CVS tags: REL_5_4_2
Diff to: previous 2.261.2.4: preferred, colored; branchpoint 2.261: preferred, colored
Changes since revision 2.261.2.4: +3 -3 lines
    * The [sql-quote] sub-tag (in the [query] tag) didn't work properly
      if the column data spanned multiple lines, as it may do with an
      INSERT or UPDATE etc.
      (back-ported from CVS HEAD)

Revision 2.276: download - view: text, markup, annotated - select for diffs
Tue Aug 8 07:20:42 2006 UTC (2 years, 5 months ago) by kwalsh
Branches: MAIN
Diff to: previous 2.275: preferred, colored
Changes since revision 2.275: +3 -3 lines
    * Added a new $Vend::LockedOut internal flag to test for locked out
      users instead of testing for "http://127.0.0.1".  This avoids a
      side-effect that could be felt by people running Interchange on
      their local workstation.

Revision 2.275: download - view: text, markup, annotated - select for diffs
Tue Aug 8 02:01:02 2006 UTC (2 years, 5 months ago) by kwalsh
Branches: MAIN
Diff to: previous 2.274: preferred, colored
Changes since revision 2.274: +7 -3 lines
    * Fix an issue, reported by Carl Bailey, where links containing
      127.0.0.1 can get saved into [timed-build] cache files.

Revision 2.274: download - view: text, markup, annotated - select for diffs
Mon Aug 7 18:30:44 2006 UTC (2 years, 5 months ago) by mheins
Branches: MAIN
Diff to: previous 2.273: preferred, colored
Changes since revision 2.273: +3 -3 lines
* Add [if config UserDB.captcha] per request by Jon.

Revision 2.273: download - view: text, markup, annotated - select for diffs
Sun Aug 6 19:46:39 2006 UTC (2 years, 5 months ago) by mheins
Branches: MAIN
Diff to: previous 2.272: preferred, colored
Changes since revision 2.272: +10 -3 lines
* Allow lookups of multiple levels of config setting, i.e:

	[if config UserDB->captcha]
		[captcha function=imagetag]
	[/if]

Revision 2.272: download - view: text, markup, annotated - select for diffs
Sun Jul 30 23:37:38 2006 UTC (2 years, 5 months ago) by kwalsh
Branches: MAIN
Diff to: previous 2.271: preferred, colored
Changes since revision 2.271: +3 -3 lines
    * The [sql-quote] sub-tag (in the [query] tag) didn't work properly
      if the column data spanned multiple lines, as it may do with an
      INSERT or UPDATE etc.

Revision 2.271: download - view: text, markup, annotated - select for diffs
Wed Apr 26 12:04:59 2006 UTC (2 years, 8 months ago) by racke
Branches: MAIN
Diff to: previous 2.270: preferred, colored
Changes since revision 2.270: +2 -6 lines
frames code has been removed from Interchange a long time ago,
so this is a no-op unless session is manipulated manually

Revision 2.270: download - view: text, markup, annotated - select for diffs
Wed Apr 5 14:42:19 2006 UTC (2 years, 9 months ago) by mheins
Branches: MAIN
Diff to: previous 2.269: preferred, colored
Changes since revision 2.269: +5 -5 lines
* Add lockout to list of SpecialSub routines allowed.

* If user-configured lockout routine returns true, it replaces the
  current routine completely. If it returns false, the normal one
  is run as well.

* Move the logging out of Vend::Dispatch to the do_lockout routine, so
  that you can avoid the log entry if your user-configured routine handles
  the lockout.

* Make the number of seconds for robot reset adjustable from its
  current hardcoded 30:

  	Limit   lockout_reset_seconds

  Maybe that should be robot_reset_seconds, I don't know.

* Change use of $Vend::Cfg->{Limit}{member} to $::Limit->{member}. As
  Limit is used in iterative routines like chain_cost, this should
  improve performance.

Revision 2.269: download - view: text, markup, annotated - select for diffs
Mon Apr 3 23:30:59 2006 UTC (2 years, 9 months ago) by docelic
Branches: MAIN
Diff to: previous 2.268: preferred, colored
Changes since revision 2.268: +3 -3 lines

* s/ESLASH/SLASH/ as should have always been

Revision 2.268: download - view: text, markup, annotated - select for diffs
Mon Mar 27 18:42:50 2006 UTC (2 years, 9 months ago) by jon
Branches: MAIN
Diff to: previous 2.267: preferred, colored
Changes since revision 2.267: +4 -8 lines
Remove legacy [/page] and [/order] macros.

Revision 2.267: download - view: text, markup, annotated - select for diffs
Thu Feb 16 16:25:18 2006 UTC (2 years, 10 months ago) by mheins
Branches: MAIN
Diff to: previous 2.266: preferred, colored
Changes since revision 2.266: +3 -3 lines
* Incompatible change, but unavoidable. Change variable setting determining
  country for tax basis.

  Problem was that MV_COUNTRY_FIELD was determining the country for
  the multistate order check. Since some installations were changing that
  to "tax_country" and manipulating that variable for taxing purposes,
  there was interactin.

  Change MV_COUNTRY_FIELD in Interpolate.pm to MV_COUNTRY_TAX_VAR.

* TODO: make change in UPGRADE.

Revision 2.266: download - view: text, markup, annotated - select for diffs
Wed Feb 1 15:37:47 2006 UTC (2 years, 11 months ago) by jon
Branches: MAIN
Diff to: previous 2.265: preferred, colored
Changes since revision 2.265: +16 -3 lines
Add "env" base to conditionals, allowing [if env HTTPS], etc.

Revision 2.261.2.4: download - view: text, markup, annotated - select for diffs
Mon Dec 12 18:16:09 2005 UTC (3 years ago) by mheins
Branches: STABLE_5_4-branch
CVS tags: REL_5_4_1, REL_5_4_0, REL_5_3_3
Diff to: previous 2.261.2.3: preferred, colored; branchpoint 2.261: preferred, colored
Changes since revision 2.261.2.3: +3 -3 lines
* Prevent crash when $::Discounts not defined.

Revision 2.265: download - view: text, markup, annotated - select for diffs
Mon Dec 12 18:15:29 2005 UTC (3 years ago) by mheins
Branches: MAIN
Diff to: previous 2.264: preferred, colored
Changes since revision 2.264: +3 -3 lines
* Prevent crash when $::Discounts not defined.

Revision 2.261.2.3: download - view: text, markup, annotated - select for diffs
Sat Dec 3 19:31:38 2005 UTC (3 years, 1 month ago) by mheins
Branches: STABLE_5_4-branch
Diff to: previous 2.261.2.2: preferred, colored; branchpoint 2.261: preferred, colored
Changes since revision 2.261.2.2: +2 -9 lines
* Fix syntax error introduced by improper application of patch.

Revision 2.264: download - view: text, markup, annotated - select for diffs
Sat Dec 3 19:30:43 2005 UTC (3 years, 1 month ago) by mheins
Branches: MAIN
Diff to: previous 2.263: preferred, colored
Changes since revision 2.263: +2 -9 lines
* Fix syntax error introduced with improper application of patch.

Revision 2.263: download - view: text, markup, annotated - select for diffs
Fri Dec 2 18:57:23 2005 UTC (3 years, 1 month ago) by mheins
Branches: MAIN
Diff to: previous 2.262: preferred, colored
Changes since revision 2.262: +17 -4 lines
* Fix error logging problem with switch_discount_space().

Revision 2.261.2.2: download - view: text, markup, annotated - select for diffs
Fri Dec 2 18:56:44 2005 UTC (3 years, 1 month ago) by mheins
Branches: STABLE_5_4-branch
Diff to: previous 2.261.2.1: preferred, colored; branchpoint 2.261: preferred, colored
Changes since revision 2.261.2.1: +17 -4 lines
* Patch error log problems with switch_discount_space().

Revision 2.262: download - view: text, markup, annotated - select for diffs
Mon Nov 21 20:41:46 2005 UTC (3 years, 1 month ago) by racke
Branches: MAIN
Diff to: previous 2.261: preferred, colored
Changes since revision 2.261: +3 -3 lines
merged changes 2.261 vs 2.261.2.1
+++ 2.261.2.1 +++
fixed typo

Revision 2.261.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 21 20:39:56 2005 UTC (3 years, 1 month ago) by racke
Branches: STABLE_5_4-branch
Diff to: previous 2.261: preferred, colored
Changes since revision 2.261: +3 -3 lines
fixed typo

Revision 2.261: download - view: text, markup, annotated - select for diffs
Tue Nov 8 01:39:37 2005 UTC (3 years, 2 months ago) by mheins
Branches: MAIN
CVS tags: STABLE_5_4-root, REL_5_3_2
Branch point for: STABLE_5_4-branch
Diff to: previous 2.260: preferred, colored
Changes since revision 2.260: +25 -8 lines
* Add mv_shipping_when_taxable member to "multi" taxing, so that you
  can tax shipping only when taxable items are in the total.

Revision 2.260: download - view: text, markup, annotated - select for diffs
Mon Nov 7 22:08:50 2005 UTC (3 years, 2 months ago) by jon
Branches: MAIN
Diff to: previous 2.259: preferred, colored
Changes since revision 2.259: +4 -2 lines
From Ethan Rowe <ethan@endpoint.com>:

Fixed bug in &Vend::Interpolate::iterate_array_list that could cause
the $Row object to be an empty hashref in the event of certain looping
conditions that cause the field hash to be populated but not the
fieldname array.

Revision 2.259: download - view: text, markup, annotated - select for diffs
Mon Nov 7 22:06:25 2005 UTC (3 years, 2 months ago) by jon
Branches: MAIN
Diff to: previous 2.258: preferred, colored
Changes since revision 2.258: +17 -6 lines
From Ethan Rowe <ethan@endpoint.com>:

Fixed some issues in the discount-related code to ensure that the
$::Discounts hashref is used appropriately and to maximize robustness of
discount-spaces function.

Revision 2.258: download - view: text, markup, annotated - select for diffs
Mon Nov 7 21:22:24 2005 UTC (3 years, 2 months ago) by racke
Branches: MAIN
Diff to: previous 2.257: preferred, colored
Changes since revision 2.257: +13 -5 lines
added flypage SpecialSub according to the discussion on interchange-core in
November 2003

Revision 2.257: download - view: text, markup, annotated - select for diffs
Mon Oct 31 18:00:38 2005 UTC (3 years, 2 months ago) by mheins
Branches: MAIN
Diff to: previous 2.256: preferred, colored
Changes since revision 2.256: +5 -5 lines

* Fix bug where VAT was being calculated on item price before discount.

Revision 2.256: download - view: text, markup, annotated - select for diffs
Tue Oct 18 15:38:47 2005 UTC (3 years, 2 months ago) by jon
Branches: MAIN
CVS tags: DEB_5_3_0_20051028_1
Diff to: previous 2.255: preferred, colored
Changes since revision 2.255: +2 -4 lines
Remove duplicate settings of $opt->{login}, which is already forced earlier
in the function for $opt->{auto}.

Revision 2.255: download - view: text, markup, annotated - select for diffs
Sat Oct 15 01:25:23 2005 UTC (3 years, 2 months ago) by jon
Branches: MAIN
Diff to: previous 2.254: preferred, colored
Changes since revision 2.254: +6 -2 lines
Add new $Sub object that allows access to catalog subs and globalsubs
from within [calc] and [perl] blocks.

May need tweaking for Safe::Hole later, but that would make it more
capable, not less, so I want to get this in for now.

Revision 2.254: download - view: text, markup, annotated - select for diffs
Thu Oct 13 16:31:33 2005 UTC (3 years, 2 months ago) by mheins
Branches: MAIN
Diff to: previous 2.253: preferred, colored
Changes since revision 2.253: +16 -8 lines
* Add transfer-encoding parameter as suggested by Lars Tode.

Revision 2.253: download - view: text, markup, annotated - select for diffs
Tue Oct 4 19:34:29 2005 UTC (3 years, 3 months ago) by jon
Branches: MAIN
Diff to: previous 2.252: preferred, colored
Changes since revision 2.252: +8 -2 lines
Add new quoting mechanism for the [query] tag, from Kevin Walsh.

An example:

[query
    list=1
    sql=|
        SELECT * FROM products WHERE sku = [sql-quote][cgi sku][/sql-quote]
    |
]
    ...

It uses the query's database handle to access DBI's quote method.

Revision 2.252: download - view: text, markup, annotated - select for diffs
Tue Oct 4 11:11:32 2005 UTC (3 years, 3 months ago) by racke
Branches: MAIN
CVS tags: DEB_5_3_0_20051004_1
Diff to: previous 2.251: preferred, colored
Changes since revision 2.251: +10 -4 lines
workaround for shadow tables and dbh method

Revision 2.251: download - view: text, markup, annotated - select for diffs
Sat Aug 20 02:54:54 2005 UTC (3 years, 4 months ago) by jon
Branches: MAIN
Diff to: previous 2.250: preferred, colored
Changes since revision 2.250: +3 -3 lines
Correct debug message; this no longer uses &Vend::Interpolate::do_tag.

Revision 2.250: download - view: text, markup, annotated - select for diffs
Fri Aug 5 12:20:04 2005 UTC (3 years, 5 months ago) by mheins
Branches: MAIN
Diff to: previous 2.249: preferred, colored
Changes since revision 2.249: +6 -5 lines
* Fix bug introduced in discount_space change -- mv_discount would not
  work in all instances (for individual product pricing).

* Make item-difference work with mv_discount -- I don't believe it previously
  could or did, as it had no way to know of a discount.

Revision 2.249: download - view: text, markup, annotated - select for diffs
Thu Jun 9 18:23:21 2005 UTC (3 years, 7 months ago) by docelic
Branches: MAIN
Diff to: previous 2.248: preferred, colored
Changes since revision 2.248: +26 -26 lines
- XHTML-compliance:

  - lowercased some HTML tags (all containers, so no ">" vs. "/>" issues)

Revision 2.248: download - view: text, markup, annotated - select for diffs
Mon May 30 16:22:21 2005 UTC (3 years, 7 months ago) by mheins
Branches: MAIN
Diff to: previous 2.247: preferred, colored
Changes since revision 2.247: +11 -4 lines
* Allow levies to mark themselves as inclusive.

* Don't pay attention to whitespace in the return of ITL exclude_if
  and include_if members.

Revision 2.247: download - view: text, markup, annotated - select for diffs
Sun May 29 15:30:19 2005 UTC (3 years, 7 months ago) by mheins
Branches: MAIN
Diff to: previous 2.246: preferred, colored
Changes since revision 2.246: +17 -20 lines

* 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 2.246: download - view: text, markup, annotated - select for diffs
Tue May 17 16:59:33 2005 UTC (3 years, 7 months ago) by mheins
Branches: MAIN
Diff to: previous 2.245: preferred, colored
Changes since revision 2.245: +5 -2 lines
* Make TaxInclusive work for Levies.

Revision 2.245: download - view: text, markup, annotated - select for diffs
Tue May 3 06:03:26 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.244: preferred, colored
Changes since revision 2.244: +5 -4 lines

* Implement new AccumulateCode and TagRepository directives. The rationale
  is:

    -- There is a huge base of Interchange code, much of which is not
       needed in even the standard catalog with full UI. This causes a
       larger memory profile than necessary.

    -- It is difficult to determine from the page code what code is
       needed, especially when a [tag] can call a $Tag can call
       a filter can call some sort of Action.

    -- A feature is needed to allow building catalogs with a more
       nearly optimal set of code than just "everything".

  If AccumulateCode is no, operation is exactly as before. There have
  been some code initialization changes and routine calling changes,
  but the data structures are identical and no difference in operation
  should be seen.

  If you set AccumulateCode to "Yes" and specify a TagRepository that
  contains all known UserTag, ActionMap, Filter, Widget, etc. etc.
  code, Interchange starts accumulating and compiling these as
  needed.

  The code is sent to the master process for compilation and
  incorporation, so that the next iteration of a page after HouseKeeping
  seconds will find the code already compiled and ready to go.

  It also copies the code file to the "code" (actually $Global::TagDir)
  directory in the "Accumulated" subdirectory tree. When you restart
  Interchange, these tags/filters/widgets/checks are read normally
  and need not be recompiled on the fly.

  Over time, as you access pages and routines, a full set of tags
  will be developed and you can turn AccumulateCode to "No".

* There can be failures due to calling a $Tag from within embedded
  Perl for the first time, particularly when it uses a MapRoutine or
  calls another $Tag within. This is due to Safe, and there is probably
  not much to be done about it. The good news is that the error should
  go away after HouseKeeping seconds when the tag gets compiled by the
  master.

  This could be avoided in the case of an AllowGlobal catalog, and it
  might be possible to make a directive that turns on AllowGlobal only
  when in AccumulateCode mode.

  The area, tmp, tmpn, and image tags are known to fail in this
  way in the standard catalog. Tags that are frequently called
  in this fashion should probably be placed in a "code/Vital"
  directory and not be accumulated.

* This is only recommended for development -- it might
  be possible to remove a tag/filter/etc. from the master
  and recompile these on the fly, but I haven't looked at that
  yet.

  Another nice feature is that you can easily add a tag simply
  by adding its code to the TagRepository and having it
  compiled.

* WARNING: Nice features are often dangerous! Don't run this in
  production -- you have been warned!

* WARNING: OrderCheck is not yet implemented, and a full audit has
  not been done on all compiled code directives.

* WARNING: Not fully tested in Prefork mode, and really not intended for
  that mode.

* WARNING: Including multiple tags in a file may have unpredictable
  behavior. You should try to keep related Alias and tag things in
  the same file.

* This feature only applies to Global code -- Catalog-based code
  shows no change.

* Passes the regression tests 100% when called with an empty "code"
  directory, compiling every tested tag and executing without error.

Revision 2.244: download - view: text, markup, annotated - select for diffs
Mon May 2 14:13:51 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.243: preferred, colored
Changes since revision 2.243: +4 -4 lines
* Move improperly-positioned glob mapping.

Revision 2.243: download - view: text, markup, annotated - select for diffs
Sat Apr 30 15:09:58 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.242: preferred, colored
Changes since revision 2.242: +49 -43 lines
* We had been running without warnings so long, we had gotten a bit sloppy
  in our code in some places.

  Because we do lots of uninitialized hash member stuff with arrays
  of fields and $opt, it is basically unreasonable for us to run with
  the "use of uninitialized variable" warnings. Because we do a fair
  amount of numerical comparisons on empty string values, it seemed
  unreasonable to run with "string value in numeric gt" enabled.

  Also, because Safe, HTML::Entities, and some other modules have
  these checks enabled, page code is bound to have warnings issued
  no matter what you do.

  It seems better to run with some warnings enabled so that we can
  catch bad code practice.

  So I have made the code run without warnings prior to and after
  interpolate_html(), and turned off warnings by default in the
  page code.

  If it is desirable to turn on warnings for pages, you can use
  [pragma perl_warnings_in_page] and see warnings for that page
  (or by default if you put in catalog.cfg).

* In general these changes are:

	 no warnings qw(uninitialized numeric);

  in most pages.

* Add $::Pragma->{perl_warnings_in_page}.

* Remove defined checks when simple set tests will do.

* Streamline some code.

Revision 2.242: download - view: text, markup, annotated - select for diffs
Thu Apr 28 01:54:44 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.241: preferred, colored
Changes since revision 2.241: +5 -2 lines

* Various variable initializations and tests to avoid warnings.

Revision 2.241: download - view: text, markup, annotated - select for diffs
Wed Apr 27 22:12:45 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.240: preferred, colored
Changes since revision 2.240: +6 -2 lines
* Turn off warnings in strategic places so that we don't get inundated with
  uninitialized variable warnings

Revision 2.240: download - view: text, markup, annotated - select for diffs
Wed Apr 27 20:18:45 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.239: preferred, colored
Changes since revision 2.239: +5 -4 lines
* More unitialzed variable warnings dealt with.

Revision 2.239: download - view: text, markup, annotated - select for diffs
Tue Apr 12 19:08:01 2005 UTC (3 years, 8 months ago) by jon
Branches: MAIN
Diff to: previous 2.238: preferred, colored
Changes since revision 2.238: +3 -3 lines
Patch from Ethan Rowe <ethan@endpoint.com>:

Test 60 was failing due to an oversite on my part in
Vend::Interpolate::subtotal(). The pre-discount-space logic had a check:
my $discounts = defined $Vend::Session->{discount};

Later on, while looping through the products, it checks if $discounts is
true, and if so, adds the item's discounted subtotal to the running subtotal;
otherwise, it adds the item's full-price subtotal.

The discount spaces expect the $::Discounts hash to always exist. Therefore,
I changed the check to be based on:
my $discounts = (defined $::Discounts and %$::Discounts);

The discount_price sub forces the discount hash into exist when it encounters
an item with an mv_price attribute. However, the logic is now expecting the
discount hash to actually contain members, because it will always exist.
Therefore, the following patch to Interpolate.pm struck me as the right fix.
Let me know if you think there's a better way to do it. In any case, it
fixes the problem specific to test #60.

Revision 2.238: download - view: text, markup, annotated - select for diffs
Tue Apr 12 15:14:39 2005 UTC (3 years, 8 months ago) by mheins
Branches: MAIN
Diff to: previous 2.237: preferred, colored
Changes since revision 2.237: +3 -3 lines
* Make the start of XHTML support for Interchange.

* Add global XHTML and catalog XHTML options. Global is false/off by
  default, and catalog option is defaulted from global option.

* The only effect is that Dispatch.pm sets $Vend::Xtrailer to the
  appropriate value of '/' or ''.

* Use $Vend::Xtrailer to set any <br/> or <br> we use.

* Change some generated HTML to:

	-- lowercase tags
	-- quote parms
	-- use $Vend::Xtrailer

* Supply [br] tag which returns the proper <br/> or <br>.

Revision 2.237: download - view: text, markup, annotated - select for diffs
Thu Apr 7 22:51:33 2005 UTC (3 years, 9 months ago) by jon
Branches: MAIN
Diff to: previous 2.236: preferred, colored
Changes since revision 2.236: +40 -34 lines
Patch from Ethan Rowe <ethan@endpoint.com>, which I've been sitting on
for far too long. His comments:

Discount-space rework according to agreements reached between involved
core team members; modified initialization logic and configuration such
that discount spaces do not make an impact on page processing for catalogs
that do not explicitly make use of the feature. Changes include:

DiscountSpacesOn -- boolean catalog configuration directive. This is
FALSE by default. When set to true, a dispatch routine is added
to the (relatively new) dispatch routine stack, to be evaluated
per page process prior to autoloads; this routine initializes the
current discount space to 'main', and then checks all CGI variables
specified in the DiscountSpaceVar configuration array in the event
that an alternate discount space has been specified via CGI variables.
When DiscountSpacesOn is FALSE, *all* discount space functions become
a no-op; attempts to specify an alternate discount space will have no
effect, and will result in an error message in the catalog's error log.

DiscountSpaceVar -- array catalog configuration directive, with a default
entry of 'mv_discount_space'; the members of this array are treated as
names of CGI variables to check per page process, such that a CGI variable
can be used to specify the discount space to use for that page process
in a manner akin to values space ('mv_values_space') or named shopping
cart ('mv_cartname'). The CGI variables will *not* be checked unless
DiscountSpacesOn is true. While default behavior of 'mv_discount_space'
is likely to suffice for most purposes, people can tie the discount space
to other things, such as the cart, by including other variable names in
this array (for instance, 'mv_cartname' would tie the discount space to
the cart name, which could be convenient in some situations).

A new global object has been introduced: $::Discounts. This will always
point to the current discount hash; changing the discount space via
CGI variables or the [discount-space] tag will update $::Discounts.
Furthermore, a new Safe object has been introduced for accessing the
current discount space in [perl] and [calc] blocks: $Discounts.

Any code that works directly with the $Vend::Session->{discount} hash
should be updated to work with the $::Discounts variable (in global
space) and the $Discounts variable (in Safe space such as [perl] and
[calc]). Care has been taken to maintain backwards compatibility,
and working directly with the {discount} session member will generally
not cause problems (changing the discount space will in fact change the
hash to which $Vend::Session->{discount} points), except in the case of
reassigning the hash (i.e., $Session->{discount} = { 'SOMEITEM' => ' %s *
0.80 ' }); reassigning the hash will break the $::Discounts reference and
result in unpredictable behavior for the remainder of the page process.
Therefore, it is strongly advised that all such code be updated at some
point to use the new objects. Furthermore, any actions such as clearing
the discounts should be done by dereferencing rather than assigning a
new hashref.

Thus:
%$Discounts = ();
and not:
$Discounts = {};

Furthermore, you can clear the discount space via:
[discount-space name=some_spacename clear=1]

The current discount space name can be checked via:
[discount-space current=1]

Sessions: to maintain backwards compatibility, sessions continue to use a
{discount} member. However, at session initialization, all sessions will
receive a {discount_space}{main} member, and {discount} will point to it.
The session read process is essentially unchanged, with the exception of
a minor assignment in which $::Discounts is initialized to point to the
{discount} member. The modification to discount-spaces was driven in
part to reduce the number of assignments necessary at session read time,
and this new implementation is a reflection of that.

For the future, it may be worthwhile to revise the logic to eliminate
the {discount} session member entirely, and simply expect all code to
work directly through the $::Discounts/$Discounts variables. This would
allow some slight adjustments to the implementation of the discount space
initialization and switching logic, making it slightly more efficient
and certainly cleaner.

Revision 2.236: download - view: text, markup, annotated - select for diffs
Tue Mar 29 17:40:56 2005 UTC (3 years, 9 months ago) by jon
Branches: MAIN
Diff to: previous 2.235: preferred, colored
Changes since revision 2.235: +13 -2 lines
Add new "if" type, "control", with tests.

By Ethan Rowe <ethan@endpoint.com>.

Revision 2.235: download - view: text, markup, annotated - select for diffs
Wed Mar 16 18:50:59 2005 UTC (3 years, 9 months ago) by jon
Branches: MAIN
Diff to: previous 2.234: preferred, colored
Changes since revision 2.234: +6 -8 lines
Restore behavior of an empty [link-template][/link-template] block,
which used to fall back to the default link template, but then started
suppressing links altogether.

This was inadvertently changed in revision 2.119 of Vend::Interpolate
as part of a bug fix. The bug is now fixed in a different, compatible way.

Revision 2.234: download - view: text, markup, annotated - select for diffs
Tue Mar 8 16:10:07 2005 UTC (3 years, 10 months ago) by racke
Branches: MAIN
Diff to: previous 2.233: preferred, colored
Changes since revision 2.233: +4 -4 lines
lowercase HTML tags as suggested by jojo

Revision 2.233: download - view: text, markup, annotated - select for diffs
Sun Mar 6 04:14:08 2005 UTC (3 years, 10 months ago) by mheins
Branches: MAIN
Diff to: previous 2.232: preferred, colored
Changes since revision 2.232: +11 -22 lines

* Add "permanent more" feature so that you can create pageable searches
  that are shared between people and are cacheable by search engines.

* To activate, put in search URL/form:

	pm=1  or  mv_more_permanent=1

* To activate in [query ...], use pm=1.

* Changes hashing to two levels so that it will handle larger sets of
  searches.

* Depends on consistent spacing of queries, caches query for
  mv_cache_key that determines location. The change of a single
  bit of whitespace will change the key!

* When your data changes, a saved search could be wrong when referenced
  from a bookmark/saved link and no initializing search has been done.

* WARNING: Could generate very large file sets, watch your inodes!

Revision 2.232: download - view: text, markup, annotated - select for diffs
Tue Feb 1 02:07:15 2005 UTC (3 years, 11 months ago) by jon
Branches: MAIN
Diff to: previous 2.231: preferred, colored
Changes since revision 2.231: +8 -5 lines
Patch from Ethan Rowe <ethan@endpoint.com>:

Update the DiscountSpaceVar configuration directive to allow for an
array of different CGI variable names. These are the names of CGI
variables that will be checked per page process in order to determine
the initial discount namespace; defaults to 'main' if the CGI variables
are empty/undefined. The discount space initialization logic based on
CGI variables will only be used for catalogs in which the DiscountSpaces
directive is set to true ("yes").

Tied the session {discount} member to the current discount
namespace subhash from {discount_space}{<spacename>} to maximize
compatibility of discount namespaces with existing code dependent
upon $Session->{discount}; switching the discount namespace will
always result in $::Discounts = $Vend::Session->{discount} =
$Vend::Session->{discount_space}{<SPACENAME>} ||= {};

Updated read_session to ensure that $::Discounts and
$Vend::Session->{discount} always refer to the default ('main') discount
namespace from $Vend::Session->{discount_space}{main} at the start of
page processing.

Revision 2.231: download - view: text, markup, annotated - select for diffs
Tue Jan 25 04:17:58 2005 UTC (3 years, 11 months ago) by mheins
Branches: MAIN
Diff to: previous 2.230: preferred, colored
Changes since revision 2.230: +15 -7 lines

* Re-add [PREFIX-alternate] changes blown away by discount changes
  commit made without CVS update.

Revision 2.230: download - view: text, markup, annotated - select for diffs
Tue Jan 25 03:54:19 2005 UTC (3 years, 11 months ago) by jon
Branches: MAIN
Diff to: previous 2.229: preferred, colored
Changes since revision 2.229: +27 -7 lines
New Perl object $Row available in PREFIX-calc blocks for access to the
current loop row. Avoids quoting problems.

Contributed by Ethan Rowe <ethan@endpoint.com>. His description:

Introduces a new Perl object, defined only in the context of [PREFIX-calc]
loop subtags, providing a hashref to the current row. The application
programmer can use this new object, $Row, to directly retrieve values
from the different fields within the current row, rather than quoting
the interpolated values of [PREFIX-param], [PREFIX-code], etc.

Thus, instead of:
[sql-calc]
    my $value = q{[sql-param some_column]} * 5;
    return "The value times five is $value";
[/sql-calc]

The application programmer can instead use:
[sql-calc]
    my $value = $Row->{some_column} * 5;
    return "The value times five is $value";
[/sql-calc]

The $Row hashref will be undefined when accessed in standard [perl]
or [calc] blocks; it is only valid in the context of a loop ([loop],
[query], [item-list]). Note further that, when used in a search-type loop
(e.g. [loop search="..."]), return fields should be specified within the
search in order for the row hash to be populated correctly; otherwise,
only the sku/primary key will have a value in the $Row hash.

Revision 2.229: download - view: text, markup, annotated - select for diffs
Tue Jan 25 01:02:59 2005 UTC (3 years, 11 months ago) by jon
Branches: MAIN
Diff to: previous 2.228: preferred, colored
Changes since revision 2.228: +88 -26 lines
New discount-space functionality by Ethan Rowe <ethan@endpoint.com>.
His notes follow.

Implements discount namespaces, in a manner consistent with the
values-space functionality. The [discount-space] usertag can be used
to change the current discount namespace, causing all subsequent
discount-related tags and calculations to operate from that particular
namespace. Usage:

[discount-space name=<space>]
Changes the current discount namespace to <space>.

[discount-space current=1]
Returns the name of the current namespace.

[discount-space name=<space> clear=1]
Clears all discount information from the specified namespace.

The discount space is initialized, per page process, in a manner
similar to values-space; if a CGI value exists under the variable name
"mv_discount_space", the discount space will be initialized to that
value. Furthermore, a catalog-level variable MV_DISCOUNT_SPACE can be
used to specify the name of an additional CGI variable to check in this
manner. When MV_DISCOUNT_SPACE is defined, it has higher precedence than
mv_discount_space for determining the initial namespace.

The discount-space logic is designed to integrate well with the cart. The
default discount spacename is "main". Setting the catalog variable
MV_DISCOUNT_SPACE to 'mv_cartname' allows the current discount namespace
to match the current cart when the current cart is set via CGI variables.

The discount namespaces are stored in the session at
$Vend::Session->{discount_space}{<spacename>}. Note that, for backwards
compatibility, the default space is always at $Vend::Session->{discount},
and that this will always serve as the master for he "main"
namespace such that $Vend::Session->{discount_space}{main}
= $Vend::Session->{discount}. Reassigning the hashref
for $Vend::Session->{discount_space}{<spacename>}
or $Vend::Session->{discount} can take Interchange internal
variables out of sync, and is thus discouraged (just as performing
a $Session->{scratch} = {} mid-page could cause odd behavior. Use
[discount-space name=<space> clear=1] instead, or assign to the
dereferenced hash (%{$Vend::Session->{discount}} = ()).

For further support, a discount_space parameter has been added to each
of the following tags; these tags all can be affected by discounts,
either in the calculation of a discount, a taxable sum, or an item
price (passing a discount namespace to these tags via the discount_space
parameter will only affect the current discount space within the context
of the tag itself):

[discount]
[fly-tax] (Also added named cart support to this tag in the process)
[item-list] (namespace specified will be used throughout the tag and its subtags)
[salestax]
[subtotal]
[total_cost]

EXAMPLES:

Set the current discount space to the default (which is 'main')
[discount-space]
OR
[discount-space main]

Set the current discount space to space "alt_discount"
[discount name=alt_discount]

Clear discount namespace "garbage"
[discount-space name=garbage clear=1]

Show the current discount namespace
[discount-space current=1]

Use the discount namespace "other" for this loop through the cart
[item-list discount_space=other]
...
[/item-list]

Revision 2.228: download - view: text, markup, annotated - select for diffs
Wed Dec 29 20:06:46 2004 UTC (4 years ago) by ton
Branches: MAIN
Diff to: previous 2.227: preferred, colored
Changes since revision 2.227: +6 -2 lines
	Add code to tax_vat function to enable proper
	tax calculations when TaxInclusive is set.

Revision 2.227: download - view: text, markup, annotated - select for diffs
Tue Dec 14 20:55:38 2004 UTC (4 years ago) by racke
Branches: MAIN
Diff to: previous 2.226: preferred, colored
Changes since revision 2.226: +3 -3 lines
uc and lc filters are now working according to the current locale, e.g.
umlauts will now properly modified

Revision 2.226: download - view: text, markup, annotated - select for diffs
Fri Oct 29 13:20:18 2004 UTC (4 years, 2 months ago) by racke
Branches: MAIN
Diff to: previous 2.225: preferred, colored
Changes since revision 2.225: +2 -7 lines
moved filter aliases to corresponding filter files, use similar
syntax as usertag aliases

Revision 2.225: download - view: text, markup, annotated - select for diffs
Fri Oct 29 05:02:01 2004 UTC (4 years, 2 months ago) by danb
Branches: MAIN
Diff to: previous 2.224: preferred, colored
Changes since revision 2.224: +3 -3 lines
 * Fix [query] causes [more] to generate non-unique mv_cache_key.

The [more] tag generates a unique mv_cache_key for [list], [search-region],
etc., but when used with [query],