Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
MiniVend 3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
perusionmike authored and jonjensen committed Jan 2, 2009
1 parent 7c705c0 commit c9babdb
Show file tree
Hide file tree
Showing 38 changed files with 796 additions and 103 deletions.
2 changes: 2 additions & 0 deletions MANIFEST
Expand Up @@ -162,6 +162,7 @@ dist/simple/images/bg.gif
dist/simple/images/blue_pap.gif
dist/simple/images/coolad1.gif
dist/simple/images/coolbits.gif
dist/simple/images/download.gif
dist/simple/images/mini.gif
dist/simple/images/mvlogo.gif
dist/simple/images/mvlogo_dark.gif
Expand Down Expand Up @@ -297,6 +298,7 @@ extra/URI/URL.pm
lib/Vend/Cart.pm
lib/Vend/Config.pm
lib/Vend/Data.pm
lib/Vend/DbSearch.pm
lib/Vend/FlyCat.pm
lib/Vend/Glimpse.pm
lib/Vend/Http.pm
Expand Down
9 changes: 0 additions & 9 deletions Makefile.PL
Expand Up @@ -416,15 +416,6 @@ EOF
unless $install;

# Do the extra library checks
eval {
require File::Spec;
};
if ($@) {
push @extra_lib_dirs, 'File', 'File/Spec';
my (@f) = glob 'extra/File/Spec/*';
for (@f) { s:extra/:: }
push @extra_lib_files, 'File/Spec.pm', @f;
}

# We will use our own version of File::CounterFile always
push @extra_lib_dirs, 'File';
Expand Down
86 changes: 86 additions & 0 deletions dist/WHATSNEW
@@ -1,6 +1,92 @@

W H A T ' S N E W

MiniVend 3.14 is a bug fix release with a couple of new features:

* You can now specify a database in minivend.cfg. It becomes
global and is available in all catalogs. It also remains connected
all of the time, so no connection overhead exists. Careful;
it is writable by any catalog unless you use WRITE_CONTROL
defined below.

* Added write control to all databases including SQL. If you wish to
control writing of a global database, or to a certain catalog within
a series of subcatalogs, or make one read only, you can do so.

To enable write control:

Database products WRITE_CONTROL 1

Once that is done, you can make a database read only, which won't
allow writing even if [tag flag write]products[/tag] is specified:

Database products READ_ONLY 1

If you want to have control with [tag flag write]products[/tag]:

Database products WRITE_TAGGED 1

If you want to limit write to certain catalogs, you can set:

Database products WRITE_CATALOG simple=0, sample=1

The "simple" catalog will not be able to write, while "sample"
will if [tag flag write]products[/tag] is enabled.

If you want a database to be always writable without having
to specify [tag flag write] ... [/tag], then you can
define:

Database products WRITE_ALWAYS 1

The default behavior of SQL datbases is equivalent to
WRITE_ALWAYS, while the default for GDBM_File, DB_File,
and Memory databases is equivalent to:

Database products WRITE_CONTROL 1
Database products WRITE_TAGGED 1

As a side effect, I also removed the server error if a write
fails on a DBM database. It simply doesn't write and logs
the problem.

* Added a DbSearch.pm module which adds a new search type called
"db". This searches a SQL database with MiniVend search types,
or searches a MiniVend database instead of the ASCII file.

If it is a SQL table being searched, you can specify a coordinated
search and any "==" or "eq" operators will be used to filter the
initial search return. Otherwise, all rows of the database are
scanned upon each search. This can get slow, so you won't want to
do this for large tables.

The major difference between this and the TextSearch type is that
you must set base_directory to the table name/identifier of the
default database being searched; it defaults to 'products', which
is probably not what you want. This sets the field specifications
for the SQL qualification, so you must be careful. You can search
multiple tables, which will work well if the column names and orders
are the same. It will not work well if they are different, so it will
be rare when you want to search multiple tables.

Bug fixes:

* Set default for NewReport to "yes", which prevents the occasional
problem with returning a bogus error report if mv_order_report is
not set.

* Fixed some weirdness in parsing certain search parameters, notably
mv_sql_query and index search specifications.

* Changed sort variables to globals so that sorting should be
reliable. I hope.

* Fixed quantity problem for [price code].

* Made mv_order_subject work for order routing.

* Order tracking now can be done in order routing.

MiniVend 3.12 is a major release with multiple new features,
particularly in the area of user access control.

Expand Down
2 changes: 1 addition & 1 deletion dist/bin/dump
Expand Up @@ -2,7 +2,7 @@
#
# MiniVend session dumper
#
# $Id: dump,v 1.11 1999/01/23 19:52:33 mike Exp $
# $Id: dump,v 1.14 1999/06/07 08:08:56 mike Exp mike $
#
# This program is largely based on Vend 0.2
# Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
Expand Down
2 changes: 1 addition & 1 deletion dist/bin/expire
Expand Up @@ -2,7 +2,7 @@
#
# MiniVend session expiration
#
# $Id: expire,v 1.13 1999/01/23 19:52:35 mike Exp $
# $Id: expire,v 1.16 1999/06/07 08:09:03 mike Exp mike $
#
# This program is largely based on Vend 0.2
# Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
Expand Down
30 changes: 25 additions & 5 deletions dist/bin/minivend
Expand Up @@ -151,7 +151,7 @@ sub debug {
}

BEGIN {
$VERSION = '3.12';
$VERSION = '3.14';
}
use strict;
use Fcntl;
Expand Down Expand Up @@ -229,6 +229,7 @@ use Vend::Glimpse;

use Vend::Scan;
use Vend::TextSearch;
use Vend::DbSearch;
use Vend::Order;
use Vend::Data;
use Vend::Util;
Expand Down Expand Up @@ -1654,11 +1655,14 @@ EOF
unless ($Vend::Cfg->{Locale}) {
for(@n) {
next unless $Vend::Cfg->{Locale_repository}{$_}{'default'};
$Vend::Cfg->{DefaultLocale} = $_;
$Vend::Cfg->{Locale} = $Vend::Cfg->{Locale_repository}{$_};
last;
}
$Vend::Cfg->{Locale} = $Vend::Cfg->{Locale_repository}{$n[0]}
unless $Vend::Cfg->{Locale};
unless ($Vend::Cfg->{Locale}) {
$Vend::Cfg->{Locale} = $Vend::Cfg->{Locale_repository}{$n[0]};
$Vend::Cfg->{DefaultLocale} = $n[0];
}
}
}

Expand Down Expand Up @@ -2257,6 +2261,11 @@ sub dispatch {
undef $Vend::Cfg->{$_};
}
copyref $c, $Vend::Cfg;
if($Vend::Cfg->{Variable}{MV_LANG}) {
my $loc = $Vend::Cfg->{Variable}{MV_LANG};
$Vend::Cfg->{Locale} = $Vend::Cfg->{Locale_repository}{$loc}
if defined $Vend::Cfg->{Locale_repository}{$loc};
}
$Vend::Cfg->{StaticPage} = {}
unless $Vend::Cfg->{Static};
}
Expand Down Expand Up @@ -2464,12 +2473,18 @@ EOF
last COOKIELOGIN unless
$password = Vend::Util::read_cookie('MV_PASSWORD');
$CGI::values{mv_password} = $password;
eval {
Vend::UserDB::userdb('login');
};
if($@) {
$Vend::Session->{failure} .= $@;
}
}
}

$Vend::Session->{'id'} = $Vend::SessionID;
$Vend::Session->{'arg'} = $Vend::Argument;
$Vend::Session->{'arg'} =
$Vend::Argument ? ($Vend::Argument) : $CGI::values{mv_arg} || '';
$Vend::Session->{'source'} = $rest
if ! $Vend::Session->{source} &&
$rest && $rest =~ /[A-Za-z]/;
Expand Down Expand Up @@ -2518,6 +2533,11 @@ EOF
defined $Vend::Cfg->{Locale_repository}->{$locale}
)
{
$Global::Variable->{LANG}
= $Vend::Cfg->{Variable}->{LANG}
= $::Scratch->{mv_language}
= $locale
if ! $::Scratch->{mv_language};
Vend::Util::setlocale( $locale,
($Vend::Session->{scratch}{mv_currency} || undef)
);
Expand Down Expand Up @@ -2677,7 +2697,7 @@ sub parse_multipart {

DOMULTI: {
for (@parts) {
last if ! $_ || $_ eq '--';
last if ! $_ || ($_ =~ /^--(\r?\n)?$/);
s/^\s+//;
my($header, $data) = split /\r?\n\r?\n/, $_, 2;
my $token = '[-\w!\#$%&\'*+.^_\`|{}~]';
Expand Down
2 changes: 1 addition & 1 deletion dist/bin/offline
Expand Up @@ -2,7 +2,7 @@
#
# offline - MiniVend database builder and indexer
#
# $Id: offline,v 1.8 1998/07/18 11:48:28 mike Exp $
# $Id: offline,v 1.9 1999/06/07 08:09:25 mike Exp mike $
#
# This program is largely based on Vend 0.2
# Copyright 1995 by Andrew M. Wilcox <awilcox@world.std.com>
Expand Down
Binary file added dist/simple/images/download.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions dist/simple/pages/ord/basket.html
Expand Up @@ -51,7 +51,9 @@
<BR>[page quantity [item-code]]
<FONT SIZE=1 COLOR=RED>QUANTITY PRICING</FONT>
</A>
[if-field weight]
[summary amount="[calc][item-quantity] * ([item-field weight] || 0)[/calc]" hide=1]
[/if-field]
<BR><FONT SIZE="-1">
[if-field related]
[loop arg="[item-field related]"]
Expand Down

0 comments on commit c9babdb

Please sign in to comment.