0.12_09 commit r0_12_09
authorTony Cook <tony@develop-help.com>
Wed, 21 Aug 2002 11:08:32 +0000 (11:08 +0000)
committertony <tony@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Wed, 21 Aug 2002 11:08:32 +0000 (11:08 +0000)
59 files changed:
MANIFEST
Makefile
schema/bse.sql
site/cgi-bin/admin/subs.pl
site/cgi-bin/bse.cfg
site/cgi-bin/modules/Article.pm
site/cgi-bin/modules/BSE/AdminUsers.pm
site/cgi-bin/modules/BSE/DB.pm
site/cgi-bin/modules/BSE/DB/Mysql.pm
site/cgi-bin/modules/BSE/Edit/Article.pm
site/cgi-bin/modules/BSE/Permissions.pm [new file with mode: 0644]
site/cgi-bin/modules/BSE/SubscriptionType.pm
site/cgi-bin/modules/BSE/TB/AdminGroup.pm
site/cgi-bin/modules/BSE/TB/AdminUser.pm
site/cgi-bin/modules/BSE/Util/Tags.pm
site/cgi-bin/modules/Order.pm
site/cgi-bin/modules/Squirrel/Template.pm
site/cgi-bin/shop.pl
site/docs/access.pod
site/docs/bse.pod
site/docs/config.pod
site/htdocs/admin/help/catalog.html
site/htdocs/admin/help/edit.html
site/htdocs/admin/help/image.html [new file with mode: 0644]
site/htdocs/admin/help/product.html
site/templates/admin/article_img.tmpl
site/templates/admin/edit_0.tmpl
site/templates/admin/edit_1.tmpl
site/templates/admin/edit_2.tmpl
site/templates/admin/edit_catalog.tmpl
site/templates/admin/edit_product.tmpl
site/templates/admin/edit_steps.tmpl
site/templates/admin/filelist.tmpl
site/templates/admin/grouplist.tmpl
site/templates/admin/order_detail.tmpl
site/templates/admin/showgroup.tmpl
site/templates/admin/showgroup_del.tmpl [new file with mode: 0644]
site/templates/admin/showgroup_glob.tmpl [new file with mode: 0644]
site/templates/admin/showgroupart.tmpl [new file with mode: 0644]
site/templates/admin/showuser.tmpl
site/templates/admin/showuser_del.tmpl [new file with mode: 0644]
site/templates/admin/showuser_glob.tmpl [new file with mode: 0644]
site/templates/admin/showuserart.tmpl [new file with mode: 0644]
site/templates/admin/userlist.tmpl
site/templates/cart_base.tmpl
site/templates/checkout_base.tmpl
site/templates/checkoutfinal_base.tmpl
site/templates/common/default.tmpl
site/templates/common/defsteps.tmpl
site/templates/common/downloads.tmpl
site/templates/common/news_item.tmpl
site/templates/common/sidebar.tmpl
site/templates/common/sidebar_section.tmpl
site/templates/htmlemail/basic.tmpl
site/templates/mailconfirm.tmpl
site/templates/mailorder.tmpl
site/templates/shopitem.tmpl
site/templates/user/userpage_base.tmpl
t/t00smoke.t

index 2df7fb4a1ec9f1eddf7c6b2aa4609c431d9c3c77..875d8fb8f6ba73c78cb420d98038f17470470b01 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -54,6 +54,7 @@ site/cgi-bin/modules/BSE/Mail.pm
 site/cgi-bin/modules/BSE/Mail/SMTP.pm
 site/cgi-bin/modules/BSE/Mail/Sendmail.pm
 site/cgi-bin/modules/BSE/Message.pm
+site/cgi-bin/modules/BSE/Permissions.pm
 site/cgi-bin/modules/BSE/Request.pm
 site/cgi-bin/modules/BSE/Session.pm
 site/cgi-bin/modules/BSE/Shop/Util.pm
@@ -144,6 +145,7 @@ site/htdocs/admin/help/body.html
 site/htdocs/admin/help/catalog.html
 site/htdocs/admin/help/edit.html
 site/htdocs/admin/help/file.html
+site/htdocs/admin/help/image.html
 site/htdocs/admin/help/product.html
 site/htdocs/admin/help/subs.html
 site/htdocs/admin/help/subssend.html
@@ -200,7 +202,13 @@ site/templates/admin/product_detail.tmpl
 site/templates/admin/product_list.tmpl
 site/templates/admin/regenerror.tmpl
 site/templates/admin/showgroup.tmpl
+site/templates/admin/showgroupart.tmpl
+site/templates/admin/showgroup_del.tmpl
+site/templates/admin/showgroup_glob.tmpl
 site/templates/admin/showuser.tmpl
+site/templates/admin/showuserart.tmpl
+site/templates/admin/showuser_del.tmpl
+site/templates/admin/showuser_glob.tmpl
 site/templates/admin/subs/add.tmpl
 site/templates/admin/subs/edit.tmpl
 site/templates/admin/subs/list.tmpl
index cc3c40fcfed4d075a672401e5e382ab5bd7d9dd7..977bface51bc3a2c8455c6e27c778ab9a429de70 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.12_08
+VERSION=0.12_09
 DISTNAME=bse-$(VERSION)
 DISTBUILD=$(DISTNAME)
 DISTTAR=../$(DISTNAME).tar
index 42f31e59be5f0489ed524f4e049ba03e2b51ee4a..a91e595ddab2ad59558550b1eeca81b1f2c30fa6 100644 (file)
@@ -194,6 +194,21 @@ create table orders (
   -- an empty string if there's no user
   userId varchar(40) not null,
 
+  paymentType integer not null default 0,
+
+  -- intended for custom uses
+  customInt1 integer null,
+  customInt2 integer null,
+  customInt3 integer null,
+  customInt4 integer null,
+  customInt5 integer null,
+
+  customStr1 varchar(255) null,
+  customStr2 varchar(255) null,
+  customStr3 varchar(255) null,
+  customStr4 varchar(255) null,
+  customStr5 varchar(255) null,
+
   primary key (id),
   index order_cchash(ccNumberHash),
   index order_userId(userId, orderDate)
index a637c38975e7adebec1095f82a220e0b322a399a..865da5f149f46ed64abdb5f772afd99a7b75de20 100755 (executable)
@@ -428,5 +428,6 @@ sub send_message {
             sub {
               print "<div>",CGI::escapeHTML($_[0]),"</div>\n";
             });
+  print qq!<p><a target="_top" href="/admin/">Back to Admin Menu</a></p>\n!;
   print "</body></html>\n";
 }
index 0f750ba907eaa0882084fbc18c2807353ca7b8d5..8814c5ed6e14fca3bdfa48aa44e99109a81376d7 100644 (file)
@@ -6,6 +6,7 @@ secureurl=$(url)
 
 [basic]
 randomdata = /dev/urandom
+accesscontrol=0
 
 [paths]
 ; the following needs to be set to a path writable by the BSE processes
@@ -87,6 +88,12 @@ override=1
 [articles]
 shop=3
 
+[shop]
+payment_types=0,1,2
+address1=First address line in configuration
+address2=Second address line in configuration
+address3=Third address line in configuration
+
 [level 1]
 template=common/default.tmpl
 
@@ -107,3 +114,37 @@ template=catalog.tmpl
 
 [products]
 template=shopitem.tmpl
+
+[Global permissions]
+shop_access = 1
+all_but_shop = 3
+
+[Article permissions]
+full_access = 0
+change_body = 2
+
+[permission full_access]
+help=Full access to the article.  The user can modify all modifiable fields, delete and add articles at will.
+brief=Full access
+permissions=*
+descendants=1
+
+[permission change_body]
+help=The user only has permission to change the body of the article or product.
+permissions=edit_field_body
+brief=Change body
+
+[permission shop_access]
+help=The user has complete access to articles in the shop
+articles=3
+descendants=1
+permissions=!admin_*
+brief=Shop admin
+
+[permission all_but_shop]
+help=The user has complete access to all articles but the shop.
+articles=!3
+descendants=1
+brief=All but shop admin
+permissions=!admin_*
+
index ffa0407e8c0777c7c6bbdb09efd49d6b95e01323..ae59c38672f6ddecf947ac7d11dbe41536d910b6 100644 (file)
@@ -115,4 +115,10 @@ sub files {
   return ArticleFiles->getBy(articleId=>$self->{id});
 }
 
+sub parent {
+  my ($self) = @_;
+  $self->{parentid} == -1 and return;
+  return Articles->getByPkey($self->{parentid});
+}
+
 1;
index 89f476b33ddb70b8aa80434b745a14882901d302..79834a4edade6d3b8a532ccb614616b4881876de 100644 (file)
@@ -8,12 +8,19 @@ my %actions =
   (
    users=>1,
    showuser=>1,
+   showuserart=>1,
    saveuser=>1,
+   saveuserart=>1,
    adduser=>1,
    groups=>1,
+   showgroupart=>1,
    showgroup=>1,
    savegroup=>1,
+   savegroupart=>1,
+   showobjectart=>1,
    addgroup=>1,
+   deluser=>1,
+   delgroup=>1,
   );
 
 sub dispatch {
@@ -104,6 +111,7 @@ sub req_groups {
 
   my %acts;
   %acts = $class->common_tags($req, $msg);
+
   return BSE::Template->get_response('admin/grouplist', $req->cfg, \%acts);
 }
 
@@ -160,7 +168,7 @@ sub req_adduser {
   shift @cols;
   my $user = BSE::TB::AdminUsers->add(@user{@cols});
   return $class->refresh($req, 'a_showuser', userid=>$user->{id},
-                        m=>"User $logon created");
+                        'm'=>"User $logon created");
 }
 
 sub req_addgroup {
@@ -187,7 +195,54 @@ sub req_addgroup {
   shift @cols;
   my $group = BSE::TB::AdminGroups->add(@group{@cols});
   return $class->refresh($req, 'a_showgroup', groupid=>$group->{id},
-                        m=>"Group $name created");
+                        'm' =>"Group $name created");
+}
+
+sub tag_if_user_member_of {
+  my ($members, $arg, $acts, $funcname, $templater) = @_;
+
+  my $groupid = $templater->perform($acts, $arg, 'id')
+    or return;
+
+  return exists $members->{$groupid};
+}
+
+sub iter_get_gperms {
+  my ($cfg) = @_;
+
+  require BSE::Permissions;
+  my $perms = BSE::Permissions->new($cfg);
+
+  return $perms->global_perms;
+}
+
+sub tag_if_gperm_set {
+  my ($obj, $arg, $acts, $funcname, $templater) = @_;
+
+  my $id = $templater->perform($acts, $arg, 'id');
+  $id =~ /\d/
+    or return;
+
+  return unless $id < length($obj->{perm_map});
+
+  substr($obj->{perm_map}, $id, 1);
+}
+
+sub showuser_tags {
+  my ($class, $req, $user, $msg) = @_;
+
+  my %members = map { $_->{group_id} => 1 } 
+    BSE::DB->query(userGroups=>$user->{id});
+  return
+    (
+     $class->common_tags($req, $msg),
+     user => [ \&hash_tag, $user ],
+     ifMemberof => [ \&tag_if_user_member_of, \%members ],
+     DevHelp::Tags->make_iterator2
+     ([ \&iter_get_gperms, $req->cfg ], 'gperm', 'gperms' ),
+     ifGperm_set =>
+     [ \&tag_if_gperm_set, $user ],
+    );
 }
 
 sub req_showuser {
@@ -196,36 +251,444 @@ sub req_showuser {
   my $cgi = $req->cgi;
   my $userid = $cgi->param('userid');
   $userid
-    or return $class->req_users($req, $msg, 'No userid supplied');
+    or return $class->req_users($req, 'No userid supplied');
   require BSE::TB::AdminUsers;
   my $user = BSE::TB::AdminUsers->getByPkey($userid)
-    or return $class->req_users($req, $msg, "User id $userid not found");
+    or return $class->req_users($req, "User id $userid not found");
   my %acts;
   %acts =
     (
-     $class->common_tags($req, $msg),
-     user => [ \&hash_tag, $user ],
+     $class->showuser_tags($req, $user, $msg),
     );
-  return BSE::Template->get_response('admin/showuser', $req->cfg, \%acts);
+
+  my $template = 'admin/showuser';
+  my $t = $cgi->param('_t');
+  $template .= "_$t" if $t && $t =~ /^\w+$/;
+
+  return BSE::Template->get_response($template, $req->cfg, \%acts);
 }
 
-sub req_showgroup {
+sub iter_get_kids {
+  my ($article) = @_;
+
+  require Articles;
+  return sort { $b->{displayOrder} <=> $a->{displayOrder} } 
+    Articles->children($article->{id});
+}
+
+sub iter_get_aperms {
+  my ($perms) = @_;
+
+  return $perms->article_perms;
+}
+
+sub tag_if_aperm_set {
+  my ($perm, $arg, $acts, $funcname, $templater) = @_;
+
+  return unless $perm;
+
+  my $id = $templater->perform($acts, $arg, 'id');
+  $id =~ /\d/
+    or return '';
+
+  return '' unless $id < length($perm->{perm_map});
+
+  substr($perm->{perm_map}, $id, 1);
+}
+
+sub article_tags {
+  my ($class, $req, $user, $article) = @_;
+
+  my @children;
+  my $child_index;
+  my $parent;
+  if ($article->{id} != -1) {
+    if ($article->{parentid} != -1) {
+      $parent = $article->parent;
+    }
+    else {
+      $parent =
+       {
+        id=>-1,
+        title=>'Your site',
+       };
+    }
+  }
+  require BSE::Permissions;
+  my $perms = BSE::Permissions->new($req->cfg);
+  my $perm = $perms->get_article_perm($article->{id}, $user);
+  return
+    (
+     article => [ \&hash_tag, $article ],
+     DevHelp::Tags->make_iterator2
+     ([ \&iter_get_kids, $article ], 'child', 'children',
+      \@children, \$child_index),
+     ifParent => !!$parent,
+     parent => [ \&hash_tag, $parent ],
+     DevHelp::Tags->make_iterator2
+     ([ \&iter_get_aperms, $perms ], 'aperm', 'aperms' ),
+     ifAperm_set =>
+     [ \&tag_if_aperm_set, $perm ],
+    );
+}
+
+sub get_article {
+  my ($self, $id) = @_;
+
+  if ($id eq '-1') {
+    return
+      {
+       id=>-1,
+       title=>'Your site',
+      };
+  }
+  else {
+    require Articles;
+    return Articles->getByPkey($id);
+  }
+}
+
+sub req_showuserart {
+  my ($class, $req, $msg) = @_;
+
+  my $cgi = $req->cgi;
+  my $userid = $cgi->param('userid');
+  $userid
+    or return $class->req_users($req, 'No userid supplied');
+  require BSE::TB::AdminUsers;
+  my $user = BSE::TB::AdminUsers->getByPkey($userid)
+    or return $class->req_users($req, "User id $userid not found");
+  my $artid = $cgi->param('id');
+  $artid
+    or return $class->req_showuser($req, 'No article id supplied');
+  my $article = $class->get_article($artid)
+    or return $class->req_showuser($req, 'No such article');
+    
+  my %acts;
+  %acts =
+    (
+     $class->showuser_tags($req, $user, $msg),
+     $class->article_tags($req, $user, $article),
+    );
+
+  my $template = 'admin/showuserart';
+  my $t = $cgi->param('_t');
+  $template .= "_$t" if $t && $t =~ /^\w+$/;
+
+  return BSE::Template->get_response($template, $req->cfg, \%acts);
+}
+
+sub req_showgroupart {
   my ($class, $req, $msg) = @_;
 
   my $cgi = $req->cgi;
   my $groupid = $cgi->param('groupid');
   $groupid
-    or return $class->req_groups($req, $msg, 'No groupid supplied');
+    or return $class->req_groups($req, 'No groupid supplied');
   require BSE::TB::AdminGroups;
   my $group = BSE::TB::AdminGroups->getByPkey($groupid)
-    or return $class->req_groups($req, $msg, "Group id $groupid not found");
+    or return $class->req_groups($req, "Group id $groupid not found");
+  my $artid = $cgi->param('id');
+  $artid
+    or return $class->req_showgroup($req, 'No article id supplied');
+  my $article = $class->get_article($artid)
+    or return $class->req_showgroup($req, 'No such article');
+    
   my %acts;
   %acts =
+    (
+     $class->showgroup_tags($req, $group, $msg),
+     $class->article_tags($req, $group, $article),
+    );
+
+  my $template = 'admin/showgroupart';
+  my $t = $cgi->param('_t');
+  $template .= "_$t" if $t && $t =~ /^\w+$/;
+
+  return BSE::Template->get_response($template, $req->cfg, \%acts);
+}
+
+sub req_showobjectart {
+  my ($class, $req) = @_;
+
+  my $cgi = $req->cgi;
+  my $adminid = $cgi->param('adminid');
+  $adminid && $adminid =~ /^\d+$/
+    or return $class->req_users($req, 'No adminid supplied');
+  require BSE::TB::AdminBases;
+  my $base = BSE::TB::AdminBases->getByPkey($adminid)
+    or return $class->req_users($req, 'Unknown adminid');
+  my $artid = $cgi->param('id');
+  $artid
+    or return $class->req_users($req, 'No article id supplied');
+  my $article = $class->get_article($artid)
+    or return $class->req_users($req, 'No such article');
+
+  if ($base->{type} eq 'u') {
+    return $class->refresh($req, a_showuserart => 
+                          userid=>$adminid,
+                          id=>$artid);
+  }
+  else {
+    return $class->refresh($req, a_showgroupart => 
+                          groupid=>$adminid,
+                          id=>$artid);
+  }
+}
+
+sub tag_if_member_of_group {
+  my ($members, $arg, $acts, $funcname, $templater) = @_;
+
+  my $userid = $templater->perform($acts, $arg, 'id')
+    or return;
+
+  return exists $members->{$userid};
+}
+
+sub showgroup_tags {
+  my ($class, $req, $group, $msg) = @_;
+
+  my %members = map { $_->{user_id} => 1 } 
+    BSE::DB->query(groupUsers=>$group->{id});
+  return
     (
      $class->common_tags($req, $msg),
      group => [ \&hash_tag, $group ],
+     ifMemberof => [ \&tag_if_member_of_group, \%members ],
+     DevHelp::Tags->make_iterator2
+     ([ \&iter_get_gperms, $req->cfg ], 'gperm', 'gperms' ),
+     ifGperm_set =>
+     [ \&tag_if_gperm_set, $group ],
+    );
+}
+
+sub req_showgroup {
+  my ($class, $req, $msg) = @_;
+
+  my $cgi = $req->cgi;
+  my $groupid = $cgi->param('groupid');
+  $groupid
+    or return $class->req_groups($req, 'No groupid supplied');
+  require BSE::TB::AdminGroups;
+  my $group = BSE::TB::AdminGroups->getByPkey($groupid)
+    or return $class->req_groups($req, "Group id $groupid not found");
+  my %acts;
+  %acts =
+    (
+     $class->showgroup_tags($req, $group, $msg),
     );
-  return BSE::Template->get_response('admin/showgroup', $req->cfg, \%acts);
+
+  my $template = 'admin/showgroup';
+  my $t = $cgi->param('_t');
+  $template .= "_$t" if $t && $t =~ /^\w+$/;
+
+  return BSE::Template->get_response($template, $req->cfg, \%acts);
+}
+
+sub req_saveuser {
+  my ($class, $req) = @_;
+
+  my $cgi = $req->cgi;
+  my $userid = $cgi->param('userid');
+  $userid
+    or return $class->req_users($req, 'No userid supplied');
+  require BSE::TB::AdminUsers;
+  my $user = BSE::TB::AdminUsers->getByPkey($userid)
+    or return $class->req_users($req, "User id $userid not found");
+  my $name = $cgi->param('name');
+  my $password = $cgi->param('password');
+  my $confirm = $cgi->param('confirm');
+  $user->{name} = $name if defined $name and length $name;
+  if (defined $password && defined $confirm
+     && length $password) {
+    length $confirm
+      or return $class->req_showuser($req, "Enter both password and confirmation to change password");
+    $password eq $confirm
+      or return $class->req_showuser($req, "Password and confirmation password don't match");
+    $user->{password} = $password;
+  }
+  if ($cgi->param('savegperms')) {
+    my $perms = '';
+    my @gperms = $cgi->param('gperms');
+    for my $id (@gperms) {
+      if (length($perms) < $id) {
+       $perms .= '0' x ($id - length $perms);
+      }
+      substr($perms, $id, 1) = '1';
+    }
+    $user->{perm_map} = $perms;
+  }
+  $user->save;
+
+  if ($cgi->param('savegroups')) {
+    require BSE::TB::AdminGroups;
+    require BSE::TB::AdminUsers;
+    my @group_ids = map $_->{id}, BSE::TB::AdminGroups->all;
+    my %want_groups = map { $_ => 1 } $cgi->param('groups');
+    my %current_groups = map { $_->{group_id} => 1 }
+      BSE::DB->query(userGroups=>$user->{id});
+    
+    for my $group_id (@group_ids) {
+      if ($want_groups{$group_id} && !$current_groups{$group_id}) {
+       BSE::DB->run(addUserToGroup=>$user->{id}, $group_id);
+      }
+      elsif (!$want_groups{$group_id} && $current_groups{$group_id}) {
+       BSE::DB->run(delUserFromGroup=>$user->{id}, $group_id);
+      }
+    }
+  }
+
+  return $class->refresh($req, a_showuser => userid => $user->{id},
+                       'm' => 'User saved');
+}
+
+sub req_saveuserart {
+  my ($class, $req) = @_;
+
+  my $cgi = $req->cgi;
+  my $userid = $cgi->param('userid');
+  $userid
+    or return $class->req_users($req, 'No userid supplied');
+  require BSE::TB::AdminUsers;
+  my $user = BSE::TB::AdminUsers->getByPkey($userid)
+    or return $class->req_users($req, "User id $userid not found");
+  my $artid = $cgi->param('id');
+  $artid
+    or return $class->req_showuser($req, 'No article id supplied');
+  my $article = $class->get_article($artid)
+    or return $class->req_showuser($req, 'No such article');
+
+  require BSE::Permissions;
+  my $perms = BSE::Permissions->new($req->cfg);
+  my $perm_map = '';
+  my @aperms = $cgi->param('aperms');
+  for my $id (@aperms) {
+    if (length($perm_map) < $id) {
+      $perm_map .= '0' x ($id - length $perm_map);
+    }
+    substr($perm_map, $id, 1) = '1';
+  }
+
+  $perms->set_article_perm($artid, $user, $perm_map);
+
+  return $class->refresh($req, a_showuserart => userid => $user->{id},
+                        id=>$artid, 'm' => 'Permissions saved');
+}
+
+sub req_savegroup {
+  my ($class, $req, $msg) = @_;
+
+  my $cgi = $req->cgi;
+  my $groupid = $cgi->param('groupid');
+  $groupid
+    or return $class->req_groups($req, 'No groupid supplied');
+  require BSE::TB::AdminGroups;
+  my $group = BSE::TB::AdminGroups->getByPkey($groupid)
+    or return $class->req_groups($req, "Group id $groupid not found");
+  my $description = $cgi->param('description');
+  $group->{description} = $description if defined $description;
+
+  if ($cgi->param('savegperms')) {
+    my $perms = '';
+    my @gperms = $cgi->param('gperms');
+    for my $id (@gperms) {
+      if (length($perms) < $id) {
+       $perms .= '0' x ($id - length $perms);
+      }
+      substr($perms, $id, 1) = '1';
+    }
+    $group->{perm_map} = $perms;
+  }
+  $group->save;
+
+  require BSE::TB::AdminGroups;
+  require BSE::TB::AdminUsers;
+  my @member_ids = map $_->{id}, BSE::TB::AdminUsers->all;
+  my %want_users = map { $_ => 1 } $cgi->param('users');
+  my %current_users = map { $_->{user_id} => 1 }
+    BSE::DB->query(groupUsers=>$group->{id});
+
+  for my $user_id (@member_ids) {
+    if ($want_users{$user_id} && !$current_users{$user_id}) {
+      BSE::DB->run(addUserToGroup=>$user_id, $group->{id});
+    }
+    elsif (!$want_users{$user_id} && $current_users{$user_id}) {
+      BSE::DB->run(delUserFromGroup=>$user_id, $group->{id});
+    }
+  }
+
+  return $class->refresh($req, a_showgroup => groupid => $group->{id},
+                       'm' => 'Group saved');
+}
+
+sub req_savegroupart {
+  my ($class, $req) = @_;
+
+  my $cgi = $req->cgi;
+  my $userid = $cgi->param('userid');
+  my $groupid = $cgi->param('groupid');
+  $groupid
+    or return $class->req_groups($req, 'No groupid supplied');
+  require BSE::TB::AdminGroups;
+  my $group = BSE::TB::AdminGroups->getByPkey($groupid)
+    or return $class->req_groups($req, "Group id $groupid not found");
+  my $artid = $cgi->param('id');
+  $artid
+    or return $class->req_showuser($req, 'No article id supplied');
+  my $article = $class->get_article($artid)
+    or return $class->req_showuser($req, 'No such article');
+
+  require BSE::Permissions;
+  my $perms = BSE::Permissions->new($req->cfg);
+  my $perm_map = '';
+  my @aperms = $cgi->param('aperms');
+  for my $id (@aperms) {
+    if (length($perm_map) < $id) {
+      $perm_map .= '0' x ($id - length $perm_map);
+    }
+    substr($perm_map, $id, 1) = '1';
+  }
+
+  $perms->set_article_perm($artid, $group, $perm_map);
+
+  return $class->refresh($req, a_showgroupart => groupid => $group->{id},
+                        id=>$artid, 'm' => 'Permissions saved');
+}
+
+sub req_deluser {
+  my ($class, $req) = @_;
+
+  my $cgi = $req->cgi;
+  my $userid = $cgi->param('userid');
+  $userid
+    or return $class->req_users($req, 'No userid supplied');
+  require BSE::TB::AdminUsers;
+  my $user = BSE::TB::AdminUsers->getByPkey($userid)
+    or return $class->req_users($req, "User id $userid not found");
+
+  my $logon = $user->{logon};
+  $user->remove;
+
+  return $class->refresh($req, a_users =>
+                        'm' => "User '$logon' deleted");
+}
+
+sub req_delgroup {
+  my ($class, $req, $msg) = @_;
+
+  my $cgi = $req->cgi;
+  my $groupid = $cgi->param('groupid');
+  $groupid
+    or return $class->req_groups($req, 'No groupid supplied');
+  require BSE::TB::AdminGroups;
+  my $group = BSE::TB::AdminGroups->getByPkey($groupid)
+    or return $class->req_groups($req, "Group id $groupid not found");
+
+  my $name = $group->{name};
+  $group->remove;
+
+  return $class->refresh($req, a_groups =>
+                        'm' => "Group '$name' deleted");
 }
 
 1;
index d1b0cb8e32b3892db3cda4f8f5978d33fa7235b6..ce29064db81746aec7254af5bedb35a3883a84e7 100644 (file)
@@ -2,6 +2,7 @@ package BSE::DB;
 require 5.005;
 use strict;
 use Carp qw(croak);
+use Carp qw/confess/;
 
 use vars qw($VERSION);
 $VERSION = '1.00';
@@ -32,6 +33,18 @@ sub query {
   return @results;
 }
 
+sub run {
+  my ($self, $name, @args) = @_;
+
+  $self = BSE::DB->single unless ref $self;
+
+  my $sth = $self->stmt($name);
+
+  $sth->execute(@args)
+    or confess "Cannot execute statement $name: ",$sth->errstr;
+}
+
+
 1;
 
 __END__
index 67011e649790dc6007828a5bb5250123b20d4c18..806661fe3b640836875c87c9c61a146244e55626 100644 (file)
@@ -71,8 +71,8 @@ EOS
    Orders => 'select * from orders',
    getOrderByPkey => 'select * from orders where id = ?',
    getOrderItemByOrderId => 'select * from order_item where orderId = ?',
-   addOrder => 'insert orders values(null,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
-   replaceOrder => 'replace orders values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+   addOrder => 'insert orders values(null,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+   replaceOrder => 'replace orders values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    addOrderItem => 'insert order_item values(null,?,?,?,?,?,?,?)',
    getOrderByUserId => 'select * from orders where userId = ?',
 
@@ -148,6 +148,9 @@ EOS
    'select * from email_requests where genEmail = ?',
 
    addAdminBase => 'insert into admin_base values(null, ?)',
+   replaceAdminBase => 'replace into admin_base values(?, ?)',
+   deleteAdminBase => 'delete from admin_base where id = ?',
+   getAdminBaseByPkey => 'select * from admin_base where id=?',
    
    AdminUsers => <<SQL,
 select bs.*, us.* from admin_base bs, admin_users us
@@ -163,12 +166,16 @@ select bs.*, us.* from admin_base bs, admin_users us
   where bs.id = us.base_id and bs.id = ?
 SQL
    addAdminUser => 'insert into admin_users values(?,?,?,?,?)',
+   replaceAdminUser => 'replace into admin_users values(?,?,?,?,?)',
+   deleteAdminUser => 'delete from admin_users where base_id = ?',
    adminUsersGroups => <<SQL,
 select bs.*, gr.*
   from admin_base bs, admin_groups gr, admin_membership am
   where bs.id = gr.base_id && am.user_id = ? and am.group_id = bs.id
   order by gr.name
 SQL
+   userGroups => 'select * from admin_membership where user_id = ?',
+   deleteUserGroups => 'delete from admin_membership where user_id = ?',
 
    AdminGroups => <<SQL,
 select bs.*, gr.* 
@@ -191,6 +198,21 @@ select bs.*, gr.* from admin_base bs, admin_groups gr
   where bs.id = gr.base_id and bs.id = ?
 SQL
    addAdminGroup => 'insert into admin_groups values(?,?,?,?)',
+   replaceAdminGroup => 'replace into admin_groups values(?,?,?,?)',
+   deleteAdminGroup => 'delete from admin_groups where base_id = ?',
+   groupUsers => 'select * from admin_membership where group_id = ?',
+
+   addUserToGroup => 'insert into admin_membership values(?,?)',
+   delUserFromGroup => <<SQL,
+delete from admin_membership where user_id = ? and group_id = ?
+SQL
+   deleteGroupUsers => 'delete from admin_membership where group_id = ?',
+
+   articleObjectPerm => <<SQL,
+select * from admin_perms where object_id = ? and admin_id = ?
+SQL
+   addArticleObjectPerm => 'insert into admin_perms values(?,?,?)',
+   replaceArticleObjectPerm => 'replace into admin_perms values(?,?,?)',
   );
 
 sub _single
index f2aa4be8cda04f707d574ecbe246251e942dd286..23a3b471e770358405e21b54393bfdcd626594fa 100644 (file)
@@ -764,6 +764,18 @@ sub tag_error_img {
   return qq!<img src="$images_uri/admin/error.gif" alt="$encoded" title="$encoded" border="0" align="top">!; 
 }
 
+sub iter_admin_users {
+  require BSE::TB::AdminUsers;
+
+  BSE::TB::AdminUsers->all;
+}
+
+sub iter_admin_groups {
+  require BSE::TB::AdminGroups;
+
+  BSE::TB::AdminGroups->all;
+}
+
 sub low_edit_tags {
   my ($self, $acts, $request, $article, $articles, $msg, $errors) = @_;
 
@@ -856,6 +868,10 @@ sub low_edit_tags {
      DevHelp::Tags->make_iterator2
      ([ \&iter_files, $article ], 'file', 'files', \@files, \$file_index ),
      movefiles => [ \&tag_movefiles, $self, $article, \@files, \$file_index ],
+     DevHelp::Tags->make_iterator2
+     (\&iter_admin_users, 'iadminuser', 'adminusers'),
+     DevHelp::Tags->make_iterator2
+     (\&iter_admin_groups, 'iadmingroup', 'admingroups'),
      edit => \&tag_edit_link,
      error => [ \&tag_hash, $errors ],
      error_img => [ \&tag_error_img, $self, $errors ],
diff --git a/site/cgi-bin/modules/BSE/Permissions.pm b/site/cgi-bin/modules/BSE/Permissions.pm
new file mode 100644 (file)
index 0000000..bc293f6
--- /dev/null
@@ -0,0 +1,169 @@
+package BSE::Permissions;
+use strict;
+
+sub new {
+  my ($class, $cfg) = @_;
+
+  # load global permissions
+  my @gobjs;
+  my %gobjs;
+  my %gvalues = $cfg->entries('global permissions');
+  my $maxgid = 0;
+  for my $name (keys %gvalues) {
+    my $id = $gvalues{$name};
+    if ($id > 250) {
+      print STDERR "permission id for $name out of range\n";
+      next;
+    }
+    $id > $maxgid and $maxgid = $id;
+    my %obj = ( name => $name, id => $id );
+    my $section = "permission $name";
+    $obj{help} = $cfg->entry($section, 'help', '');
+    $obj{descendants} = $cfg->entry($section, 'descendants', 0);
+    $obj{brief} = $cfg->entry($section, 'brief', $name);
+    $obj{permissions} = $cfg->entry($section, 'permissions')
+      or next; # ignore it
+    $obj{articles} = $cfg->entry($section, 'articles')
+      or next;
+    $obj{perminfo} = _make_perm_info($obj{permissions});
+    $obj{artinfo} = _make_art_info($obj{permissions});
+
+    push @gobjs, \%obj;
+    $gobjs{$name} = \%obj;
+  }
+
+  # load article permissions
+  my @aobjs;
+  my %aobjs;
+  my %avalues = $cfg->entries('article permissions');
+  my $maxaid = 0;
+  for my $name (keys %avalues) {
+    my $id = $avalues{$name};
+    if ($id > 250) {
+      print STDERR "permission id for $name out of range\n";
+      next;
+    }
+    $id > $maxaid and $maxaid = $id;
+    my %obj = ( name => $name, id => $id );
+    my $section = "permission $name";
+    $obj{help} = $cfg->entry($section, 'help', '');
+    $obj{descendants} = $cfg->entry($section, 'descendants', 0);
+    $obj{brief} = $cfg->entry($section, 'brief', $name);
+    $obj{permissions} = $cfg->entry($section, 'permissions')
+      or next; # ignore it
+    $obj{perminfo} = _make_perm_info($obj{permissions});
+
+    push @aobjs, \%obj;
+    $aobjs{$name} = \%obj;
+  }
+
+  return bless {
+               gobj_array => \@gobjs,
+               gobj_hash  => \%gobjs,
+               max_gid    => $maxgid,
+               aobj_array => \@aobjs,
+               aobj_hash  => \%aobjs,
+               max_aid    => $maxaid,
+               cfg        => $cfg,
+              }, $class;
+}
+
+sub global_perms {
+  my ($self) = @_;
+
+  return @{$self->{gobj_array}};
+}
+
+sub max_global_perm_id {
+  my ($self) = @_;
+
+  return $self->{max_gid};
+}
+
+sub article_perms {
+  my ($self) = @_;
+
+  return @{$self->{aobj_array}};
+}
+
+sub max_article_perm_id {
+  my ($self) = @_;
+
+  return $self->{max_aid};
+}
+
+sub get_article_perm {
+  my ($self, $artid, $object) = @_;
+
+  my ($result) = BSE::DB->query(articleObjectPerm => $artid, $object->{id});
+
+  return $result;
+}
+
+sub set_article_perm {
+  my ($self, $artid, $object, $perm_map) = @_;
+
+  my $perm = $self->get_article_perm($artid, $object);
+  if ($perm) {
+    BSE::DB->run(replaceArticleObjectPerm =>$artid, $object->{id},
+                $perm_map);
+  }
+  else {
+    BSE::DB->run(addArticleObjectPerm =>$artid, $object->{id}, $perm_map);
+  }
+}
+
+sub can_user {
+  my ($self, $user, $article, @actions) = @_;
+
+  
+}
+
+sub _make_perm_info {
+  my ($perm) = @_;
+
+  my $not = $perm =~ s/^!//;
+  my @tests = split /,/, $perm;
+  my @res;
+  for my $test (@tests) {
+    (my $re = $test) =~ s/\*/.*/;
+    $re = "^$re\$";
+    eval {
+      $re = qr/$re/;
+    };
+    if ($@) {
+      print STDERR "Bad permission test '$test'\n";
+    }
+    else {
+      push @res, $re;
+    }
+  }
+
+  return { not=>$not, res=>\@res };
+}
+
+sub _make_art_info {
+  my ($art) = @_;
+
+  my $not = $art =~ s/^!//;
+  my @tests = split /,/, $art;
+  my @arts;
+  for my $test (@tests) {
+    if ($test =~ /^(?:\d+|-1|[a-z]\w+)$/) {
+      push @arts, { type=>'exact', article=>$test };
+    }
+    elsif ($test =~ /^childof\((\d+|-1|[a-z]\w+)\)$/) {
+      push @arts, { type=>'childof', article=>$1 };
+    }
+    elsif ($test =~ /^typeof\((\w+)\)$/) {
+      push @arts, { type=>'typeof', name=>$1 };
+    }
+    else {
+      print STDERR "Unrecognized article match '$test'\n";
+    }
+  }
+
+  return { not=>$not, arts=>\@arts };
+}
+
+1;
index 05d31698c44ab2b722a6864f0c35bef0a53907c4..0bd705b411e7ba1432c678f85e137d97f1d5185a 100644 (file)
@@ -161,7 +161,8 @@ sub send {
     my $content;
     push(@headers, "MIME-Version: 1.0");
     if ($html) {
-      my $boundary = time . "=_=" .int(rand(10000))."=";
+      $html =~ tr/\cM/\cJ/;
+      my $boundary = "====" . time . "=_=" .int(rand(10000))."=";
       push(@headers, qq!Content-Type: multipart/alternative; boundary="$boundary"!);
       $content = "This is a multi-part message in MIME format\n\n"
        . "--$boundary\n"
index aadac1227b4e394260f808c5aecaf7b7f3480983..5f47e3fd1ee0e01ae4c26adb49fb8d3585c3a51f 100644 (file)
@@ -11,4 +11,12 @@ sub bases {
   return { base_id=>{ class=>'BSE::TB::AdminBase' } };
 }
 
+sub remove {
+  my ($self) = @_;
+
+  BSE::DB->run(deleteGroupUsers => $self->{id});
+
+  $self->SUPER::remove();
+}
+
 1;
index d714977f312cb97248a23a309ac2455114749945..adcc95816fa93f321382f4a07497fa31b70ffe8a 100644 (file)
@@ -11,4 +11,13 @@ sub bases {
   return { base_id=>{ class=>'BSE::TB::AdminBase' } };
 }
 
+sub remove {
+  my ($self) = @_;
+
+  BSE::DB->run(deleteUserGroups => $self->{id});
+
+  $self->SUPER::remove();
+}
+
 1;
+
index 89c94bc1d75c40e397ab119b1c5bd704b7ced092..01b7139546d927512b9d9d201daa4d4ad270cbf1 100644 (file)
@@ -87,10 +87,11 @@ sub static {
      ifEq =>
      sub {
        my ($arg, $acts, $name, $templater) = @_;
-       (my ($left, $right) = DevHelp::Tags->get_parms($arg, $acts, $templater)) == 2
-        or die; # leaves if in place
+       my @args = DevHelp::Tags->get_parms($arg, $acts, $templater);
+       @args == 2
+        or die "wrong number of args (@args)";
        #print STDERR "ifEq >$left< >$right<\n";
-       $left eq $right;
+       $args[0] eq $args[1];
      },
      ifMatch =>
      sub {
index 9325c290d0f169f46a97fad2bd57291e7f10df90..0b0c47151102c7486279be382d6ba136112cdca5 100644 (file)
@@ -15,7 +15,9 @@ sub columns {
            total wholesaleTotal gst orderDate
            ccNumberHash ccName ccExpiryHash ccType
            filled whenFilled whoFilled paidFor paymentReceipt
-           randomId cancelled userId/;
+           randomId cancelled userId paymentType
+           customInt1 customInt2 customInt3 customInt4 customInt5
+           customStr1 customStr2 customStr3 customStr4 customStr5/;
 }
 
 1;
index ea8694c31ac4f52fbe4c5d93fc10fb6d7bf6e1b5..23c965f8850f548f337bfebf7f0224d84256db90 100644 (file)
@@ -1,7 +1,7 @@
 package Squirrel::Template;
 use vars qw($VERSION);
 use strict;
-use Carp;
+use Carp qw/cluck confess/;
 
 $VERSION="0.05";
 
@@ -11,19 +11,16 @@ sub new {
   return bless \%opts, $class;
 }
 
-sub perform {
+sub low_perform {
   my ($self, $acts, $func, $args, $orig) = @_;
 
-  $args = '' unless defined $args;
-
-  #print STDERR "perform $func $args\n";
   my $fmt;
   if ($acts->{_format} && $args =~ s/\|(\S+)\s*$//) {
     $fmt = $1;
   }
+  $args = '' unless defined $args;
 
   if (exists $acts->{$func}) {
-    $args = '' unless defined $args;
     $args =~ s/^\s+|\s+$//g;
     my $value;
     my $action = $acts->{$func};
@@ -43,10 +40,7 @@ sub perform {
     else {
       $value = $action;
     }
-    unless (defined $value) {
-      use Carp 'cluck';
-      cluck "** undefined value returned by $func $args tag";
-    }
+    return unless defined $value;
     return $fmt ? $acts->{_format}->($value, $fmt) : $value;
   }
   for my $match (keys %$acts) {
@@ -55,9 +49,12 @@ sub perform {
       if ($func =~ /$re/) {
        $args =~ s/^\s+|\s+$//g;
        my $value = $acts->{$match}->($func, $args);
-       defined $value
-         or return "** function $func $args returned undef **";
-       return $fmt ? $acts->{_format}->($value, $fmt) : $value;
+       #defined $value
+       #  or return "** function $func $args returned undef **";
+       if (defined($value) && $fmt) {
+         $value = $acts->{_format}->($value, $fmt);
+       }
+       return $value;
       }
     }
   }
@@ -78,9 +75,25 @@ sub perform {
     }
     # otherwise fall through
   }
+
   return $self->{verbose} ? "** unknown function $func **" : $orig;
 }
 
+sub perform {
+  my ($self, $acts, $func, $args, $orig) = @_;
+
+  $args = '' unless defined $args;
+
+  #print STDERR "perform $func $args\n";
+  my $value = $self->low_perform($acts, $func, $args, $orig);
+
+  unless (defined $value) {
+    cluck "** undefined value returned by $func $args **";
+  }
+
+  return $value;
+}
+
 sub iterate {
   my ($self, $name, $args, $input, $sep, $acts, $orig) = @_;
 
@@ -128,11 +141,11 @@ sub cond {
   my $result =
     eval {
       if (exists $acts->{"if$name"}) {
-       my $cond = $self->perform($acts, "if$name", $args, '');
+       my $cond = $self->low_perform($acts, "if$name", $args, '');
        return $cond ? $true : $false;
       }
       elsif (exists $acts->{lcfirst $name}) {
-       my $cond = $self->perform($acts, lcfirst $name, $args, '');
+       my $cond = $self->low_perform($acts, lcfirst $name, $args, '');
        return $cond ? $true : $false;
       }
       else {
index 4891e2c0270f1aeef91d70983ef00710ad4dce31..04075c7bebd0843333832d56e199aad4b8a6dc93 100755 (executable)
@@ -1,4 +1,6 @@
 #!/usr/bin/perl -w
+# -d:ptkdb
+BEGIN { $ENV{DISPLAY} = '192.168.32.15:0.0' }
 use strict;
 use FindBin;
 use lib "$FindBin::Bin/modules";
@@ -39,6 +41,17 @@ my $from = $SHOP_FROM;
 my $toName = $SHOP_TO_NAME;
 my $toEmail= $SHOP_TO_EMAIL;
 
+use constant PAYMENT_CC => 0;
+use constant PAYMENT_CHEQUE => 1;
+use constant PAYMENT_CALLME => 2;
+my %valid_payment_types = 
+  ( 
+   PAYMENT_CC()     =>1, 
+   PAYMENT_CHEQUE() =>1, 
+   PAYMENT_CALLME() =>1
+  );
+my %payment_names = qw(CC 0 Cheque 1 CallMe 2);
+
 my $cfg = BSE::Cfg->new();
 my $urlbase = $cfg->entryVar('site', 'url');
 my $securlbase = $cfg->entryVar('site', 'secureurl');
@@ -234,6 +247,11 @@ sub checkout {
   my %custom_state = %{$session{custom}};
 
   BSE::Custom->enter_cart(\@cart, \@cart_prods, \%custom_state); 
+  my @payment_types = split /,/, $cfg->entry('shop', 'payment_types', '0');
+  @payment_types = grep $valid_payment_types{$_}, @payment_types;
+  @payment_types or @payment_types = ( 0 );
+  @payment_types = sort { $a <=> $b } @payment_types;
+  my %payment_types = map { $_=> 1 } @payment_types;
 
   my $item_index = -1;
   my @options;
@@ -247,7 +265,14 @@ sub checkout {
      old => sub { CGI::escapeHTML($olddata ? param($_[0]) : 
                    $user && defined $user->{$_[0]} ? $user->{$_[0]} : '') },
      BSE::Custom->checkout_actions(\%acts, \@cart, \@cart_prods, \%custom_state, $CGI::Q),
+     ifMultPaymentTypes => @payment_types > 1,
     );
+  for my $name (keys %payment_names) {
+    my $id = $payment_names{$name};
+    $acts{"if${name}Payments"} = exists $payment_types{$id};
+    $acts{"if${name}FirstPayment"} = $payment_types[0] == $id;
+    $acts{"checkedIfFirst$name"} = $payment_types[0] == $id ? "checked " : "";
+  }
   $session{custom} = \%custom_state;
 
   page('checkout.tmpl', \%acts);
@@ -480,16 +505,32 @@ sub prePurchase {
 sub purchase {
   # some basic validation, in case the user switched off javascript
   my @required = 
-    (BSE::Custom->required_fields($CGI::Q, $session{custom}), 
-     qw(cardHolder cardExpiry) );
+    BSE::Custom->required_fields($CGI::Q, $session{custom});
+
+  my @payment_types = split /,/, $cfg->entry('shop', 'payment_types', '0');
+  @payment_types = grep $valid_payment_types{$_}, @payment_types;
+  @payment_types or @payment_types = ( 0 );
+  @payment_types = sort { $a <=> $b } @payment_types;
+  my %payment_types = map { $_=> 1 } @payment_types;
+
+  my $paymentType = param('paymentType');
+  defined $paymentType or $paymentType = $payment_types[0];
+  $payment_types{$paymentType}
+    or return checkout("Invalid payment type");
+
+  push @required, qw(cardHolder cardExpiry)
+    if $paymentType == PAYMENT_CC;
+
   for my $field (@required) {
     defined(param($field)) && length(param($field))
       or return checkout("Field $field is required", 1);
   }
   defined(param('email')) && param('email') =~ /.\@./
     or return checkout("Please enter a valid email address", 1);
-  defined(param('cardNumber')) && param('cardNumber') =~ /^\d+$/
-    or return checkout("Please enter a credit card number", 1);
+  if ($paymentType == PAYMENT_CC) {
+    defined(param('cardNumber')) && param('cardNumber') =~ /^\d+$/
+      or return checkout("Please enter a credit card number", 1);
+  }
 
   use Orders;
   use Order;
@@ -531,7 +572,9 @@ sub purchase {
   }
 
   my $ccNumber = param('cardNumber');
+  defined $ccNumber or $ccNumber = '';
   my $ccExpiry = param('cardExpiry');
+  defined $ccExpiry or $ccExpiry = '';
 
   use Digest::MD5 'md5_hex';
   $ccNumber =~ tr/0-9//cd;
@@ -576,6 +619,7 @@ sub purchase {
   $order{orderDate} = $today;
   $order{total} += BSE::Custom->total_extras(\@cart, \@products, 
                                             $session{custom});
+  $order{paymentType} = $paymentType;
   ++$session{changed};
 
   # blank anything else
@@ -667,6 +711,10 @@ sub purchase {
      ifOptions => sub { @options },
      options => sub { nice_options(@options) },
     );
+  for my $name (keys %payment_names) {
+    my $id = $payment_names{$name};
+    $acts{"if${name}Payment"} = $order->{paymentType} == $id;
+  }
   send_order($order, \@items, \@products);
   $session{cart} = []; # empty the cart
   page('checkoutfinal.tmpl', \%acts);
@@ -687,11 +735,13 @@ sub send_order {
   my $item_index = -1;
   my @options;
   my $option_index;
+  require BSE::Util::Tags;
   my %acts;
   %acts =
     (
      %extras,
 
+     BSE::Util::Tags->static(\%acts, $cfg),
      iterate_items_reset => sub { $item_index = -1; },
      iterate_items => 
      sub { 
index 6008d438f850cb3ad54d94fdbb5929417d4321e2..9df7f34e7599bda90facf385c45d6d0ea4045424 100644 (file)
@@ -115,3 +115,28 @@ The everyone group, and the administrator user, both have the macro
 "Full Access" on all descendants of article -1.
 
 
+=head1 MACRO STORAGE
+
+To simplify processing we have two sections in the config file:
+
+=over
+
+=item *
+
+[Global permissions] - keeps permissions that have all article
+references resolved
+
+=item *
+
+[Article permissions] - permissions which have to reference an article
+
+=back
+
+The [permission ids] section is used to translate permission indexes to
+permission ids.
+
+The [permission names] section is used to translate permission indexes
+to descriptive permission names.
+
+=cut
+
index e08f3da75b678058d73b40e5bd5dec9d1d450b0a..7a35d49cab98049e38ae89da1329b243aff63f02 100644 (file)
@@ -10,6 +10,55 @@ Maybe I'll add some other bits here.
 
 =head1 CHANGES
 
+=head2 0.12_09
+
+=over
+
+=item *
+
+ability to control permissions each admin user and group has access to
+
+=item *
+
+new help for image manager, other updated help files, many template
+changes, thanks to Adrian.
+
+=item *
+
+deleting admin users and groups
+
+=item *
+
+selectable payment types
+
+=item *
+
+when sending a subscription with HTML content, the boundary between
+MIME parts has been changed to hopefully prevent problems with some
+mail clients
+
+=item *
+
+when sending a subscription with HTML content, any carriage-returns
+are converted into linefeed to hopefully prevent problems when sending
+subscriptions based on Macintosh format files to some mail clients.
+
+=item *
+
+htmlemail/basic.tmpl now includes a DOCTYPE, which will hopefully
+prevent problems with some mail clients.
+
+=item *
+
+conditionals are now handled differently in the templating system to
+avoid some of the undefined value warnings it was producing.
+
+=item *
+
+added fields intended for custom processing to the orders table
+
+=back
+
 =head2 0.12_08
 
 This is a development release.  If you want stable try 0.12_01, since
index c1320cf2906a95969b6cd7babee460a91eaaa4af..7f2c1ed5337864630a6da3a965a5288fd99de181 100644 (file)
@@ -382,6 +382,37 @@ If true the customer is required to be logged on before checkout,
 whether or not for sale files are attached to products in the cart.
 Default: False.
 
+=item payment_types
+
+A comma-separated list of acceptable payment types.  Default: 0
+
+The possible payment types are:
+
+=over
+
+=item *
+
+0 - the user enters a credit card number, name and expiry date
+
+=item *
+
+1 - the customer will send a cheque
+
+=item *
+
+2 - contact customer for details
+
+=back
+
+=item address1
+
+=item address2
+
+=item address3
+
+These are used by various shop templates to present an address that a
+cheque payment should be sent to.
+
 =back
 
 =head2 [fields]
index e056ca69563c7e30d2a33d3c851f59d978d0d4cf..5137345170860f988016374bed3e079d31714860 100644 (file)
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
+Transitional//EN">
 <html>
   <head>
-    <title>Catalog Editor - BSE</title>
+    <title>Catalog Editor - 
+BSE</title>
     <link rel="stylesheet" href="/css/admin.css">
-  </head>
+</head>
 <body>
 <h1>Catalog Editor</h1>
 <div>
-  <h2><a name="section">Parent</h2>
+  <h2><a 
+name="section">Parent</h2>
 
-  <p>The parent this article will be placed under..</p>
+  <p>The parent this article will be 
+placed under..</p>
 
 </div>
 
 <div>
-  <h2><a name="title">Catalog title</h2>
+  <h2><a name="title">Catalog 
+title</h2>
 
   <p>The title of the catalog.</p>
 
 </div>
 
 <div>
-<h2><a name="template">Template</h2>
+<h2><a 
+name="template">Template</h2>
 
-  <p>The template used to present this catalog.</p>
+  <p>The template used to present this 
+catalog.</p>
 
 </div>
 <div>
 <h2><a name="body">Body</h2>
 
-  <p>The content of your catalog. There are a number of <a
-href="body.html">tags</a> you can use to markup your article text.</p>
+  <p>The 
+content of your catalog. There are a number of 
+<a
+href="body.html">tags</a> you can use to markup your article 
+text.</p>
 
 </div>
 
 <div>
   <h2><a name="release">Release date</h2>
 
-  <p>The date that your catalog is released to the world. Your article will only 
-    appear in menus after this date and before the expiry date. If you don't enter 
-    a release date it will default to the current date.</p>  <p><b>Note</b>: Unreleased catalogs can be accessed via a direct URL to the 
+<p>The date that your catalog is released to the world. Your article 
+will only 
+    appear in menus after this date and before the expiry 
+date. If you don't enter 
+    a release date it will default to the 
+current date.</p>  <p><b>Note</b>: Unreleased catalogs can be 
+accessed via a direct URL to the 
     catalog.</p>
 
 </div>
 
 <div>
-  <h2><a name="expire">Expiry date</h2>
+<h2><a name="expire">Expiry date</h2>
 
-  <p>The date from which you don't want the catalog to appear on your site.</p>
+  <p>The date from which you 
+don't want the catalog to appear on your site.</p>
 
-  <p><b>Note:</b> Expired catalogs can be found through the search engine.</p>
+  <p><b>Note:</b> 
+Expired catalogs can be found through the search 
+engine.</p>
 
 </div>
 
 <div>
-<h2><a name="summary">Summary length</h2>
+<h2><a name="summary">Summary 
+length</h2>
 
-  <p>The length of the summary displayed for sub catalogs by the &lt;:summary:&gt; 
+  <p>The length of the summary displayed for sub 
+catalogs by the &lt;:summary:&gt; 
     tag.</p>
 
 </div>
 
 <div>
-  <h2><a name="threshold">Display threshold</h2>
-
-  <p>This is used by the &lt;:if UnderThreshold :&gt; conditional tag. If the 
-    number of sub-catalogs is less than this value the condition is true.</p>
-  <p>Typically your templates will embed sub-catalogs if there are fewer than 
-    this number of sub-catalogs, otherwise a menu of sub-catalogs will be displayed.</p>
+<h2><a name="threshold">Display threshold</h2>
+
+  <p>This is used by 
+the &lt;:if UnderThreshold :&gt; conditional tag. If the 
+    number 
+of sub-catalogs is less than this value the condition is true.</p>
+<p>Typically your templates will embed sub-catalogs if there are 
+fewer than 
+    this number of sub-catalogs, otherwise a menu of 
+sub-catalogs will be displayed.</p>
 
 </div>
 
 <div>
-<h2><a name="keywords">Keywords</h2>
+<h2><a 
+name="keywords">Keywords</h2>
 
-<p>This is a comma-separated list of extra keywords used by the search
+<p>This is a comma-separated list of 
+extra keywords used by the search
 engine.</p>
 
 </div>
 
 <div>
-  <h2><a name="listed">List article</h2>
+  <h2><a 
+name="listed">List article</h2>
 
-  <p>Choose how the catalog is listed in the sidebar menus, or in lists of sub-catalogs 
-    in the parent.</p>
+  <p>Choose how the catalog is 
+listed in the sidebar menus, or in lists of sub-catalogs 
+    in the 
+parent.</p>
 
 </div>
 
 <div>
-  <h2><a name="thumb">Thumbnail image</h2>
+  <h2><a name="thumb">Thumbnail 
+image</h2>
 
-  <p>An image that can be used with the &lt;:thumbnail:&gt; tag to display a small 
-    image for the catalog in menus.</p>
+  <p>An image that can be used with the 
+&lt;:thumbnail:&gt; tag to display a small 
+    image for the catalog 
+in menus.</p>
 
 </div>
 
 <div>
-  <h2><a name="images">Uploaded images</h2>
-
-  <p>Images attached to the catalog.</p>
+  <h2><a name="images">Images</h2>
 
+<div>
+    <p>Images attached to the product. This isn't available 
+until the product has 
+    been created.</p>
+    <p>You can modify 
+the images by clicking the &quot;Manage Images&quot; link.</p>
+</div>
 </div>
 
 </body></html>
\ No newline at end of file
index a19801a63e8f1a1a06b7aaa29f3f08c20767bdfe..008e03a6a3ed479e9df70c51135caff9a988750f 100644 (file)
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
+Transitional//EN">
 <html>
   <head>
-    <title>Article Editor - BSE</title>
+    <title>Article Editor - 
+BSE</title>
     <link rel="stylesheet" href="/css/admin.css">
-  </head>
+</head>
 <body>
 <h1>Article Editor</h1>
 <div>
-<h2><a name="section">Section</h2>
+<h2><a 
+name="section">Section</h2>
 
-<p>The section this article will be placed under..</p>
+<p>The section this article will be 
+placed under..</p>
 
 </div>
 
 <div>
-<h2><a name="title">Title</h2>
+<h2><a 
+name="title">Title</h2>
 
-<p>The title of the article.</p>
+<p>The title of the 
+article.</p>
 
 </div>
 
 <div>
-<h2><a name="template">Template</h2>
+<h2><a 
+name="template">Template</h2>
 
-<p>The template used to present this article.</p>
+<p>The template used to present this 
+article.</p>
 
 </div>
 <div>
 <h2><a name="body">Body</h2>
 
-<p>The content of your article.  There are a number of <a
-href="body.html">tags</a> you can use to markup your article text.</p>
+<p>The 
+content of your article.  There are a number of 
+<a
+href="body.html">tags</a> you can use to markup your article 
+text.</p>
 
 </div>
 
 <div>
   <h2><a name="release">Release date</h2>
 
-  <p>The date that your article is released to the world. Your article will only 
-    appear in menus after this date and before the expiry date. If you don't enter 
-    a release date it will default to the current date.</p>
+<p>The date that your article is released to the world. Your article 
+will only 
+    appear in menus after this date and before the expiry 
+date. If you don't enter 
+    a release date it will default to the 
+current date.</p>
 
-<p><b>Note</b>: Unreleased articles can be accessed via a direct URL to
+<p><b>Note</b>: Unreleased articles can be 
+accessed via a direct URL to
 the article.</p>
 
 </div>
 
 <div>
-  <h2><a name="expire">Expire date</h2>
+  <h2><a 
+name="expire">Expire date</h2>
 
-<p>The date from which you don't want the article to appear on your site.</p>
+<p>The date from which you don't want 
+the article to appear on your site.</p>
 
-<p><b>Note:</b> Expired articles can be found through the search engine.</p>
+<p><b>Note:</b> Expired 
+articles can be found through the search 
+engine.</p>
 
 </div>
 
 <div>
-<h2><a name="summary">Summary length</h2>
+<h2><a name="summary">Summary 
+length</h2>
 
-<p>The length of the summary displayed for child articles by the
+<p>The length of the summary displayed for child 
+articles by the
 &lt;:summary:&gt; tag.</p>
 
 </div>
 
 <div>
-  <h2><a name="threshold">Display threshold</h2>
-
-<p>This is used by the &lt;:if UnderThreshold :&gt; conditional tag.
-If the number of children is less than this value the condition is
+  <h2><a 
+name="threshold">Display threshold</h2>
+
+<p>This is used by the 
+&lt;:if UnderThreshold :&gt; conditional tag.
+If the number of 
+children is less than this value the condition 
+is
 true.</p>
 
-<p>Typically your templates will embed child articles if there are
-fewer than this number of child articles, otherwise a menu of child
+<p>Typically your templates will embed child articles 
+if there are
+fewer than this number of child articles, otherwise a 
+menu of child
 articles will be displayed.</p>
 
 </div>
 
 <div>
-<h2><a name="keywords">Keywords</h2>
+<h2><a 
+name="keywords">Keywords</h2>
 
-<p>This is a comma-separated list of extra keywords used by the search
+<p>This is a comma-separated list of 
+extra keywords used by the search
 engine.</p>
 
 </div>
 
 <div>
-  <h2><a name="listed">List article</h2>
+  <h2><a 
+name="listed">List article</h2>
 
-<p>Choose how the article is listed in the sidebar menus, or in lists
-of child articles in the parent.</p>
+<p>Choose how the article is listed 
+in the sidebar menus, or in lists
+of child articles in the 
+parent.</p>
 
 </div>
 
 <div>
-  <h2><a name="thumb">Thumbnail image</h2>
+  <h2><a name="thumb">Thumbnail 
+image</h2>
 
-  <p>An image that can be used with the &lt;:thumbnail:&gt; tag to display a small 
-    image for the article in menus.</p>
+  <p>An image that can be used with the 
+&lt;:thumbnail:&gt; tag to display a small 
+    image for the article 
+in menus.</p>
 
 </div>
 
 <div>
-<h2><a name="files">Files</h2>
-
-<p>Files attached to the article.  This isn't available until the
-article has been created.</p>
+  <div>
+    <h2><a 
+name="files">Files</h2>
+    <p>Files attached to the product. This 
+isn't available until the product has 
+    been created.</p>
+<p>You can modify the files by clicking the &quot;Manage Files&quot; 
+link.</p>
+  </div>
+  <div>
+    <h2><a name="images">Images</h2>
+<p>Images attached to the product. This isn't available until the 
+product has 
+    been created.</p>
+    <p>You can modify the images 
+by clicking the &quot;Manage Images&quot; link.</p>
+  </div>
+<h2>&nbsp;</h2>
 
 </div>
 
-<div>
-  <h2><a name="images">Uploaded images</h2>
-
-<p>Images attached to the article.</p>
-
-</div>
+<div></div>
 
 </body></html>
\ No newline at end of file
diff --git a/site/htdocs/admin/help/image.html b/site/htdocs/admin/help/image.html
new file mode 100644 (file)
index 0000000..510a991
--- /dev/null
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
+Transitional//EN">
+<html>
+  <head>
+    <title>Files Wizard - 
+BSE</title>
+    <link rel="stylesheet" href="/css/admin.css">
+</head>
+<body>
+<h1>Image Wizard</h1>
+<div>
+  <h2><a name="file">Image 
+file to add</h2>
+
+  <p>Either enter the name of an image on your 
+machine, or use the Browse
+button to select an image  file (Usually 
+with a .GIF, .JPG, .PNG file extension).</p>
+  <p>Please note that if 
+you select a large image, it may take several
+minutes to upload to 
+the web server unless you have a large link.
+eg. on a 56K link a 1 
+megabyte file will take 4 minutes to upload,
+assuming you have a 
+perfect ISP.</p>
+
+</div>
+
+<div>
+  <h2><a name="alt">Alt text for 
+image</h2>
+
+  <p>Image Alt (alternate) text is only displayed when 
+your browser does not display images. Setting Alt text is also 
+helpful for sight impared users who use screen 
+readers.</p>
+
+</div>
+<div>
+  <h2><a name="url">URL for image</h2>
+<p>An image can be used as a link. Input the desired URL (web 
+address) in this field to make the image a clickable link to this 
+URL.</p>
+
+</div>
+
+<div>
+  <h2><a name="position">First image 
+position</h2>
+
+<p>This option positions the first article image, 
+based on this choice BSE attempts to arrange susequent images as 
+alternately staggered down the page.</p>
+
+  <p>Relying on BSE to get 
+a page layout to look good with multiple images is far from ideal, 
+typically you will achieve much better results if you position images 
+in the article body text manually. Refer to the <a 
+href="body.html">body text markup</a> and look for 
+&quot;image[<i>index</i>]&quot;.</p>
+
+</div>
+
+</body></html>
\ No newline at end of file
index 5693435222d921397ed2c14e65dc234edd4c2521..afbbb2ec282bae732190e640b2ee90d3332f005d 100644 (file)
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 
+Transitional//EN">
 <html>
   <head>
-    <title>Product Editor - BSE</title>
+    <title>Product Editor - 
+BSE</title>
     <link rel="stylesheet" href="/css/admin.css">
-  </head>
+</head>
 <body>
 <h1>Product Editor</h1>
 <div>
-  <h2><a name="title">Title</h2>
+  <h2><a 
+name="title">Title</h2>
 
-  <p>The name of the product (NB: the title cannot be changed once an order has 
-    been placed that includes this product).</p>
+  <p>The name of the product (NB: the title 
+cannot be changed once an order has 
+    been placed that includes 
+this product).</p>
 
 </div>
 
 <div>
-  <h2><a name="summary">Summary</h2>
-  <p>The extended name of the product (NB: the summary cannot be changed once 
-    an order has been placed that includes this product).</p>
+  <h2><a 
+name="summary">Summary</h2>
+  <p>The extended name of the product 
+(NB: the summary cannot be changed once 
+    an order has been placed 
+that includes this product).</p>
 
 </div>
 
 <div>
-  <h2><a name="catalog">Catalog</h2>
+  <h2><a 
+name="catalog">Catalog</h2>
 
-  <p>The catalog in which this product should be listed.</p>
+  <p>The catalog in which this product 
+should be listed.</p>
 
 </div>
 <div>
-<h2><a name="body">Body</h2>
+<h2><a 
+name="body">Body</h2>
 
-<p>The content of your article.  There are a number of <a
-href="body.html">tags</a> you can use to markup your article text.</p>
+<p>The content of your article.  There are a 
+number of <a
+href="body.html">tags</a> you can use to markup your 
+article text.</p>
 
 </div>
 
 <div>
-<h2><a name="leadtime">Lead time</h2>
+<h2><a name="leadtime">Lead 
+time</h2>
 
-<p>The time required to prepare this product for shipping.</p>
+<p>The time required to prepare this product for 
+shipping.</p>
 
 </div>
 
 <div>
-<h2><a name="retail">Retail price</h2>
+<h2><a name="retail">Retail 
+price</h2>
 
-<p>The total cost of the product to the customer.</p>
+<p>The total cost of the product to the 
+customer.</p>
 
 </div>
 
 <div>
-<h2><a name="wholesale">Wholesale price</h2>
+<h2><a name="wholesale">Wholesale 
+price</h2>
 
-<p>The price this product costs to wholesalers.</p>
+<p>The price this product costs to 
+wholesalers.</p>
 
 </div>
 
 <div>
 <h2><a name="gst">GST</h2>
 
-<p>The Goods and Services Tax on this product (in dollars).</p>
+<p>The 
+Goods and Services Tax on this product (in 
+dollars).</p>
 
 </div>
 
 <div>
-  <h2><a name="release">Release date</h2>
+  <h2><a name="release">Release 
+date</h2>
 
-  <p>The date that your product is released to the world. Your product will only 
-    appear in menus after this date and before the expiry date. If you don't enter 
-    a release date it will default to the current date.</p>
-  <p><b>Note</b>: Unreleased products can be accessed via a direct URL to the 
-    product.</p>
+  <p>The date that your product is released to the world. 
+Your product will only 
+    appear in menus after this date and 
+before the expiry date. If you don't enter 
+    a release date it 
+will default to the current date.</p>
+  <p><b>Note</b>: Unreleased 
+products can be accessed via a direct URL to the 
+product.</p>
 
 </div>
 
 <div>
   <h2><a name="expire">Expiry date</h2>
 
-  <p>The date from which you don't want the product to appear on your site.</p>
+<p>The date from which you don't want the product to appear on your 
+site.</p>
 
-  <p><b>Note:</b> Expired products can be found through the search engine.</p>
+  <p><b>Note:</b> Expired products can be found through 
+the search engine.</p>
 
 </div>
 
 <div>
-<h2><a name="summary">Summary length</h2>
+<h2><a name="summary">Summary 
+length</h2>
 
-  <p>The length of the summary displayed for products by the &lt;:summary:&gt; 
-    tag (typically this is only seen when the product is a stepkid of a non-shop 
+  <p>The length of the summary displayed for products by 
+the &lt;:summary:&gt; 
+    tag (typically this is only seen when the 
+product is a stepkid of a non-shop 
     section).</p>
 
 </div>
 
 <div>
-  <h2><a name="threshold">Display threshold</h2>
+<h2><a name="threshold">Display threshold</h2>
 
-<p>This is used by the &lt;:if UnderThreshold :&gt; conditional tag.
-If the number of children is less than this value the condition is
+<p>This is used by 
+the &lt;:if UnderThreshold :&gt; conditional tag.
+If the number of 
+children is less than this value the condition is
 true.</p>
 
-  <p>Typically your templates will embed child articles if there are fewer than 
-    this number of child articles, otherwise a menu of child articles will be 
-    displayed (typically this is only seen when the product is a stepkid of a 
-    non-shop section.</p>
+<p>Typically your templates will embed child articles if there are 
+fewer than 
+    this number of child articles, otherwise a menu of 
+child articles will be 
+    displayed (typically this is only seen 
+when the product is a stepkid of a 
+    non-shop 
+section.</p>
 
 </div>
 
 <div>
 <h2><a name="options">Options</h2>
 
-  <p>Options available with this product, like sizes and colors (the options are 
+<p>Options available with this product, like sizes and colors (the 
+options are 
     set in Constants.pm).</p>
 
 </div>
 
 <div>
-  <h2><a name="thumb">Thumbnail image</h2>
+  <h2><a 
+name="thumb">Thumbnail image</h2>
 
-  <p>An image that can be used with the &lt;:thumbnail:&gt; tag to display a small 
-    image for the product in menus.</p>
+  <p>An image that can be used 
+with the &lt;:thumbnail:&gt; tag to display a small 
+    image for 
+the product in menus.</p>
 
 </div>
 
 <div>
-<h2><a name="files">Files</h2>
+<h2><a 
+name="files">Files</h2>
 
-  <p>Files attached to the product. This isn't available until the product has 
+  <p>Files attached to the product. This 
+isn't available until the product has 
     been created.</p>
+  <p>You 
+can modify the files by clicking the &quot;Manage Files&quot; 
+link.</p>
 
 </div>
 
 <div>
-  <h2><a name="images">Uploaded images</h2>
+  <h2><a name="images">Images</h2>
 
-  <p>Images attached to the product.</p>
+<p>Images attached to the product. This isn't available until the 
+product has 
+    been created.</p>
+  <p>You can modify the images by 
+clicking the &quot;Manage Images&quot; 
+link.</p>
 
 </div>
 
index 6beaa5bb2038c3eaaf466f3f1547eba4eb757c24..c89963a69c16cd0c0169fd27f4988e72147c50e0 100644 (file)
             <td bgcolor="#FFFFFF"> 
               <input type="file" name="image">
             </td>
+            <td bgcolor="#FFFFFF"><:help image file:> </td>
           </tr>
           <tr> 
             <th bgcolor="#FFFFFF" align="left"> Alt text for image: </th>
             <td bgcolor="#FFFFFF"> 
               <input type="text" name="altIn">
             </td>
+            <td bgcolor="#FFFFFF"><:help image alt:> </td>
           </tr>
           <tr> 
             <th bgcolor="#FFFFFF" align="left"> URL for image: </th>
             <td bgcolor="#FFFFFF"> 
               <input type="text" name="url" width="40">
             </td>
+            <td bgcolor="#FFFFFF"><:help image url:> </td>
           </tr>
           <tr> 
-            <td bgcolor="#FFFFFF" colspan="2" align="right"> 
+            <td bgcolor="#FFFFFF" colspan="3" align="right"> 
               <input type="submit" name="addimg" value="  Add Image  ">
             </td>
           </tr>
             <th valign="top" bgcolor="#FFFFFF" colspan="3">First Image Position</th>
           </tr>
           <tr> 
-            <td align="center" bgcolor="#FFFFFF" colspan="3"> <input type="radio" name="imagePos" value="tl" <: ifEq [article imagePos] "tl":>checked<:or:><:eif:>
+            <td bgcolor="#FFFFFF" colspan="3"> 
+              <table width="100%" border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td width="100%" align="center"><input type="radio" name="imagePos" value="tl" <: ifEq [article imagePos] "tl":>checked<:or:><:eif:>
              >Top Left &nbsp;<input type="radio" name="imagePos" value="tr"  <: ifEq [article imagePos] "tr":>checked<:or:><:eif:>
              >Top Right &nbsp; <input type="radio" name="imagePos" value="bl"  <: ifEq [article imagePos] "bl":>checked<:or:><:eif:>
              >Bottom Left &nbsp; <input type="radio" name="imagePos" value="br"  <: ifEq [article imagePos] "br":>checked<:or:><:eif:>
-             >Bottom Right
+             >Bottom Right</td>
+                  <td bgcolor="#FFFFFF"><:help image file:> </td>
+                </tr>
+              </table>
+
            </td>
           </tr>
           <tr bgcolor="#FFFFFF"> 
               image width :>" height="<: image height :>"></td>
           </tr>
           <tr bgcolor="#FFFFFF"> 
-            <th width="50%"> Alt Text</th>
+            <th> Alt Text</th>
             <th width="50%"> URL</th>
             <th nowrap> Modify</th>
           </tr>
           <tr bgcolor="#FFFFFF"> 
-            <td valign="top" width="50%"
+            <td valign="top"> 
               <input type="text" name="alt" value="<: image alt :>" size="32">
             </td>
             <td valign="top" width="50%"> 
               <input type="text" name="url" value="<: image url :>" size="32">
             </td>
             <td valign="bottom" nowrap> 
-              <b><a href="<:script:>?level=<: level :>&parentid=<: article parentid :>&id=<:article id:>&imgtype=<: articleType :>&removeimg_<: image id :>">Delete</a></b>
+              <b><a href="<:script:>?level=<: level :>&parentid=<: article parentid :>&id=<:article id:>&imgtype=<: articleType :>&removeimg_<: image id :>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b>
 <:imgmove:> </td>
           </tr>
           <: iterator separator images :> 
index 97e09363effa98bbeb5f8cbac40ccc5e72ec267f..99f100da728efb9d2438c816f134163f114f5ffa 100644 (file)
 <:ifMessage:> 
 <p><b><:message:></b></p>
 <:or:><:eif:>
-<p>| <a href="/admin/">Admin menu</a> | <:if children:> <a name="children"></a> 
-</p>
+<p>| <a href="/admin/">Admin menu</a> | </p>
+<form action="/cgi-bin/admin/adminusers.pl"><input type=submit name="a_showobjectart" value="Manage access for"><input type=hidden name=id value="<: article id:>">
+<select name=adminid>
+<:iterator begin adminusers:>
+<option value=<:iadminuser id:>>User <:iadminuser logon:>
+<:iterator end adminusers:>
+<:iterator begin admingroups:>
+<option value=<:iadmingroup id:>>Group <:iadmingroup name:>
+<:iterator end admingroups:>
+</select>
+
+</form>
+
+<:if children:> <a name="children"></a> 
 <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" width="100%" class="table">
   <tr>
       <td>
index 0421917e6c448cda650f30a2748e05b74c220ebc..f43366107ad1ad8310dbd78f96f0766898a8a48f 100644 (file)
 
   <h2><:articleType:> Details</h2>
 
+<:ifnew:><:or:>
+<form action="/cgi-bin/admin/adminusers.pl"><input type=submit name="a_showobjectart" value="Manage access for"><input type=hidden name=id value="<: article id:>">
+<select name=adminid>
+<:iterator begin adminusers:>
+<option value=<:iadminuser id:>>User <:iadminuser logon:>
+<:iterator end adminusers:>
+<:iterator begin admingroups:>
+<option value=<:iadmingroup id:>>Group <:iadmingroup name:>
+<:iterator end admingroups:>
+</select>
+</form><:eif:>
+
   <form enctype="multipart/form-data" method="POST" action="<:script:>">
 
     <input type="hidden" name="level" value="<: level :>">
index 0421917e6c448cda650f30a2748e05b74c220ebc..f43366107ad1ad8310dbd78f96f0766898a8a48f 100644 (file)
 
   <h2><:articleType:> Details</h2>
 
+<:ifnew:><:or:>
+<form action="/cgi-bin/admin/adminusers.pl"><input type=submit name="a_showobjectart" value="Manage access for"><input type=hidden name=id value="<: article id:>">
+<select name=adminid>
+<:iterator begin adminusers:>
+<option value=<:iadminuser id:>>User <:iadminuser logon:>
+<:iterator end adminusers:>
+<:iterator begin admingroups:>
+<option value=<:iadmingroup id:>>Group <:iadmingroup name:>
+<:iterator end admingroups:>
+</select>
+</form><:eif:>
+
   <form enctype="multipart/form-data" method="POST" action="<:script:>">
 
     <input type="hidden" name="level" value="<: level :>">
index d1ca5e6be5601d9107716812077787c253aff620..5117a8a4bdc8162cd36f040eca85200bb5b7d7aa 100644 (file)
   catalogs</a> | <:if new:><:or new:><a href="<:script:>?id=<:article id:>&_t=steps">Manage 
   step children/parents</a> | <:eif new:></p>
 
-  <form enctype="multipart/form-data" method="POST" action="<:script:>">
   <h2>Catalog Details</h2>
 
+<:ifnew:><:or:>
+<form action="/cgi-bin/admin/adminusers.pl"><input type=submit name="a_showobjectart" value="Manage access for"><input type=hidden name=id value="<: article id:>">
+<select name=adminid>
+<:iterator begin adminusers:>
+<option value=<:iadminuser id:>>User <:iadminuser logon:>
+<:iterator end adminusers:>
+<:iterator begin admingroups:>
+<option value=<:iadmingroup id:>>Group <:iadmingroup name:>
+<:iterator end admingroups:>
+</select>
+</form><:eif:>
+
+  <form enctype="multipart/form-data" method="POST" action="<:script:>">
   <input type=hidden name=type value="Catalog">
   <input type="hidden" name="level" value="<: level :>">
   <input type="hidden" name="id" value="<: article id :>">
           <td width="30%"><a href="<:child admin:>"><:child title:></a></td>
           <td width="70%"><: summary child body :></td>
           <td align="center"><: is child listed :></td>
-          <td nowrap> <: edit child Edit :> <a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this Sub-catalog')">Delete</a><:movechild:> </td>
+          <td nowrap> <: edit child Edit :> <a href="/cgi-bin/admin/add.pl?id=<:child id:>&remove=1" onClick="return window.confirm('Are you sure you want to delete this <:ifMatch [child generator] "Product":>Product<:or:>Sub-catalog<:eif:>')">Delete</a><:movechild:> </td>
         </tr>
         <:iterator separator children:> <:iterator end children:> 
       </table>
index 2c54debc77b49bdad736623d07dc34dd76ce85ed..669da50c67bf4d9dffc7980f3519a341fe13441c 100644 (file)
   <:eif Product:>| <a href="/cgi-bin/admin/add.pl?id=<:product id:>&_t=steps">Manage 
   step parents</a> | <:ifProduct listed:><:or:>Hidden<:eif:></p>
   <h2>Edit Product</h2>
+<:ifnew:><:or:>
+<form action="/cgi-bin/admin/adminusers.pl"><input type=submit name="a_showobjectart" value="Manage access for"><input type=hidden name=id value="<: article id:>">
+<select name=adminid>
+<:iterator begin adminusers:>
+<option value=<:iadminuser id:>>User <:iadminuser logon:>
+<:iterator end adminusers:>
+<:iterator begin admingroups:>
+<option value=<:iadmingroup id:>>Group <:iadmingroup name:>
+<:iterator end admingroups:>
+</select>
+</form><:eif:>
 <form action="<:script:>" enctype="multipart/form-data" method="POST">
     <input type="hidden" name="id" value="<:product id:>">
   <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
index 3433cfc7145e7fcc6d5e2d3170f7ae3e00f78fe3..59d80cc3a7c9f7c4a54114d3edb57940093250b7 100644 (file)
@@ -52,7 +52,7 @@
             <td><:ifStepKid:> 
               <input type="text" name="expire_<:stepkid childId:>" value="<:date "%d/%m/%Y" stepkid expire:>" size=10>
               <:or:>&nbsp;<:eif:></td>
-            <td nowrap><:edit kid Edit:> <:ifStepKid:><a href="<:script:>?del_stepkid=1&id=<:stepkid parentId:>&stepkid=<:stepkid childId:>&_t=steps">Delete</a><:or:><:eif:> 
+            <td nowrap><:edit kid Edit:> <:ifStepKid:><a href="<:script:>?del_stepkid=1&id=<:stepkid parentId:>&stepkid=<:stepkid childId:>&_t=steps" onClick="return window.confirm('Are you sure you want to delete this Step child')">Delete</a><:or:><:eif:> 
               <:movestepkid:></td>
           </tr>
           <:iterator end kids:> 
               <input type="text" name="expire_<:stepparent parentId:>" value="<:date "%d/%m/%Y" stepparent expire:>" size="10">
             </td>
             <td nowrap><a href="/cgi-bin/admin/add.pl?id=<:stepparent parentId:>">Edit</a> 
-              <a href="<:script:>?del_stepparent=1&id=<:stepparent childId:>&stepparent=<:stepparent parentId:>&_t=steps">Delete</a> 
+              <a href="<:script:>?del_stepparent=1&id=<:stepparent childId:>&stepparent=<:stepparent parentId:>&_t=steps" onClick="return window.confirm('Are you sure you want to delete this Step parent')">Delete</a> 
               <:movestepparent:></td>
           </tr>
           <:iterator end stepparents:> 
index 1898a6bbe53771620cdba1b00cd8e60012544d1e..ff55416d334bd5e7683a06f10312ca9d653d03db 100644 (file)
                   <td valign="top" align="center" nowrap> <input type="checkbox" name="requireUser_<:file id:>"
                     <:ifFile requireUser:> checked<:or:><:eif:> />Require login 
                     &nbsp;&nbsp;&nbsp;</td>
-                  <td nowrap align="right" width="100%"> <b><a href="<:script:>?filedel=1&amp;id=<:article id:>&amp;file=<:file id:>">Remove</a></b> 
+                  <td nowrap align="right" width="100%"> <b><a href="<:script:>?filedel=1&amp;id=<:article id:>&amp;file=<:file id:>" onClick="return window.confirm('Are you sure you want to delete this File')">Delete</a></b> 
                     <:movefiles:></td>
                 </tr>
               </table>
index 6a9b95830630b4d746f79492ee5537529531a8e2..d5ef698b716ac1a701661ec39295b4f20d061dea 100644 (file)
             <th bgcolor="#FFFFFF" nowrap> Name</th>
             <th bgcolor="#FFFFFF" nowrap> Description</th>
             <th bgcolor="#FFFFFF" nowrap> Users</th>
+            <th bgcolor="#FFFFFF" nowrap>&nbsp;</th>
           </tr>
           <:if Groups:> <: iterator begin groups :> 
           <tr bgcolor="#FFFFFF"> 
             <td nowrap> <a href="<:script:>?a_showgroup=1&groupid=<:igroup id:>"><:igroup name:></a></td>
             <td valign="top"><:igroup description:></td>
-            <td valign="top"><:ifGroup_users igroup:><:iterator begin group_users igroup:><:group_user logon:> <:iterator separator group_users:>, <:iterator end group_users:><:or:>(none)<:eif:>
+            <td valign="top"><:ifGroup_users igroup:><:iterator begin group_users igroup:><:group_user logon:><:iterator separator group_users:>, <:iterator end group_users:><:or:>(none)<:eif:>
             </td>
+            <td valign="top"><a href="<:script:>?a_showgroup=1&groupid=<:igroup id:>&_t=del">Delete</a></td>
           </tr>
           <: iterator end groups :> 
           <:or Groups:> 
index f68aa9e2f89307cb9fa4271b815193e6ce9ce20a..df530eca67b8bff99179169611c2d727161b19b8 100644 (file)
 </td>
 </tr>
 </table>
+<:ifEq [order paymentType] "0":><p>Payment made by credit card.</p><:or:><:eif:>
+<:ifEq [order paymentType] "1":><p>Payment will be made by cheque.</p><:or:><:eif:>
+<:ifEq [order paymentType] "2":><p>Contact the customer to arrange for payment.</p><:or:><:eif:>
+
 <:if Order filled:>
 <p>This order was filled on <:date order whenFilled:> by <:order whoFilled:>.</p>
 <:or Order:>
index 582e9e636c05a18521dac37d024e0d4817347d01..fe5bcd9ec65fcd1090a9c1f1637387800fa99b8e 100644 (file)
 <h1>Edit Group</h1>
 <p>
 | <a href="/admin/">Admin menu</a>
+| <a href="<:script:>">User list</a>
 | <a href="<:script:>?a_groups=1">Group list</a> |
 </p>
+<p>
+| Group Details
+| <a href="<:script:>?a_showgroup=1&groupid=<:group id:>&_t=glob">Global Permissions</a>
+| <a href="<:script:>?a_showgroupart=1&groupid=<:group id:>&id=-1">Article Permissions</a> |
+</p>
 <:ifMessage:>
 <p><b><:message:></b></p>
 <:or:><:eif:> 
 
 <form method="POST" action="<:script:>">
-
+<input type=hidden name=groupid value=<:group id:>>
   <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
     <tr> 
       <td> 
             </td>
             <td bgcolor="#FFFFFF"><:help editgroup description:> </td>
           </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left"> Members: </th>
+            <td bgcolor="#FFFFFF"> 
+             <:iterator begin users:>
+               <input type=checkbox name=users value=<:iuser id:> <:ifMemberof iuser:>checked<:or:><:eif:> /> <:iuser name:>
+             <:iterator separator users:>
+             <br>
+             <:iterator end users:>
+            </td>
+            <td bgcolor="#FFFFFF" valign="top"><:help editgroup members:> </td>
+          </tr>
           <tr> 
             <td bgcolor="#FFFFFF" colspan="3" align="right"> 
               <input type="submit" name="a_savegroup" value="  Save Group  " />
diff --git a/site/templates/admin/showgroup_del.tmpl b/site/templates/admin/showgroup_del.tmpl
new file mode 100644 (file)
index 0000000..91a78e6
--- /dev/null
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+  <title>Administration - Delete Group</title>
+
+  <link rel="stylesheet" type="text/css" href="/css/admin.css" />
+
+</head>
+
+<body>
+<h1>Delete Group</h1>
+<p>
+| <a href="/admin/">Admin menu</a>
+| <a href="<:script:>">User list</a>
+| <a href="<:script:>?a_groups=1">Group list</a> |
+</p>
+
+<form method="POST" action="<:script:>">
+<input type=hidden name=groupid value=<:group id:>>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+    <tr> 
+      <td> 
+        <table cellpadding="6" border="0" cellspacing="1">
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Name: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:group name:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editgroup name:> </td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Description: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:group description:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editgroup description:> </td>
+          </tr>
+          <tr> 
+            <td bgcolor="#FFFFFF" colspan="3" align="right"> 
+             Are you sure you want to delete this group?
+            </td>
+          </tr>
+          <tr> 
+            <td bgcolor="#FFFFFF" colspan="3" align="right"> 
+              <input type="submit" name="a_delgroup" value="  Delete Group  " />
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+  
+<p><font size="-1">BSE Release <:release:></font></p>
+</body
+></html>
diff --git a/site/templates/admin/showgroup_glob.tmpl b/site/templates/admin/showgroup_glob.tmpl
new file mode 100644 (file)
index 0000000..6599c2a
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+  <title>Administration - Edit Group</title>
+
+  <link rel="stylesheet" type="text/css" href="/css/admin.css" />
+
+</head>
+
+<body>
+<h1>Edit Group <:group name:></h1>
+<p>
+| <a href="/admin/">Admin menu</a>
+| <a href="<:script:>">User list</a>
+| <a href="<:script:>?a_groups=1">Group list</a> |
+</p>
+<p>
+| <a href="<:script:>?a_showgroup=1&groupid=<:group id:>">Group Details</a> | Global Permissions
+| <a href="<:script:>?a_showgroupart=1&groupid=<:group id:>&id=-1">Article Permissions</a> |
+</p>
+<:ifMessage:>
+<p><b><:message:></b></p>
+<:or:><:eif:> 
+
+<form method="POST" action="<:script:>">
+<input type=hidden name=groupid value=<:group id:>>
+<input type=hidden name=savegperms value=1>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+    <tr> 
+      <td> 
+        <table cellpadding="6" border="0" cellspacing="1">
+          <:iterator begin gperms:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left"><:gperm brief:> </th>
+            <td bgcolor="#FFFFFF"> 
+              <input type=checkbox name=gperms value=<:gperm id:> <:ifGperm_set gperm:>checked <:or:><:eif:>/>
+            </td>
+            <td bgcolor="#FFFFFF"><img src="/images/admin/help.gif" title="<:gperm help:>" /></td>
+          </tr>
+          <:iterator end gperms:>
+          <tr> 
+            <td bgcolor="#FFFFFF" colspan="3" align="right"> 
+              <input type="submit" name="a_savegroup" value="  Save Permissions  " />
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+  
+<p><font size="-1">BSE Release <:release:></font></p>
+</body
+></html>
diff --git a/site/templates/admin/showgroupart.tmpl b/site/templates/admin/showgroupart.tmpl
new file mode 100644 (file)
index 0000000..8851c36
--- /dev/null
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+  <title>Administration - Edit Group - Article permissions</title>
+
+  <link rel="stylesheet" type="text/css" href="/css/admin.css" />
+
+</head>
+
+<body>
+<h1>Edit Group <:group name:></h1>
+<p>
+| <a href="/admin/">Admin menu</a>
+| <a href="<:script:>">User list</a>
+| <a href="<:script:>?a_groups=1">Group list</a> |
+</p>
+<p>
+| <a href="<:script:>?a_showgroup=1&groupid=<:group id:>">Group Details</a> 
+| <a href="<:script:>?a_showgroup=1&groupid=<:group id:>&_t=glob">Global Permissions</a>
+| Article Permissions |
+</p>
+<:ifParent:><p>| <a href="<:script:>?a_showgroupart=1&groupid=<:group id:>&id=<:parent id:>">Parent permissions</a> |</p><:or:><:eif:>
+<:ifMessage:>
+<p><b><:message:></b></p>
+<:or:><:eif:> 
+
+<h2>Permissions for <:ifEq [article id] "-1":>the site<:or:>article <:article title:><:eif:></h2>
+
+<form method="POST" action="<:script:>">
+<input type=hidden name=groupid value=<:group id:>>
+<input type=hidden name=saveaperms value=1>
+<input type=hidden name=id value=<:article id:>>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+    <tr> 
+      <td> 
+        <table cellpadding="6" border="0" cellspacing="1">
+          <:iterator begin aperms:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left" width="100%"><:aperm brief:> </th>
+            <td bgcolor="#FFFFFF"> 
+              <input type=checkbox name=aperms value=<:aperm id:> <:ifAperm_set aperm:>checked <:or:><:eif:>/>
+            </td>
+            <td bgcolor="#FFFFFF"><img src="/images/admin/help.gif" title="<:aperm help:>" /></td>
+          </tr>
+          <:iterator end aperms:>
+          <tr> 
+            <td bgcolor="#FFFFFF" colspan="3" align="right"> 
+              <input type="submit" name="a_savegroupart" value="  Save Group permissions  " />
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+
+<:if Children:>
+<h2>Children</h2>
+<table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+  <tr>
+      <td>
+      <table border=0 cellpadding="6" cellspacing="1" width="100%">
+        <tr bgcolor="#FFFFFF"> 
+          <th>Title</th>
+          <th>Summary</th>
+          <th nowrap>Permissions</th>
+        </tr>
+        <:iterator begin children:> 
+        <tr bgcolor="#FFFFFF"> 
+          <td><a href="<:child admin:>"><:child title:></a></td>
+          <td><: summary child body :></td>
+          <td nowrap><a href="<:script:>?a_showgroupart=1&groupid=<:group id:>&id=<:child id:>">Permissions</a></td>
+        </tr>
+        <:iterator separator children:> <:iterator end children:> 
+      </table>
+</td>
+</tr>
+</table>
+<:or Children:><:eif Children:>
+  
+<p><font size="-1">BSE Release <:release:></font></p>
+</body
+></html>
index c551ee7e2d28765a9d6c05ba69e3438d757f0c92..2efbeaa8c65710dc40389df213f28989e06cc4fa 100644 (file)
 | <a href="/admin/">Admin menu</a>
 | <a href="<:script:>">User list</a> |
 </p>
+<p>
+| User Details | <a href="<:script:>?a_showuser=1&userid=<:user id:>&_t=glob">Global Permissions</a>
+| <a href="<:script:>?a_showuserart=1&userid=<:user id:>&id=-1">Article Permissions</a> |
+</p>
 <:ifMessage:>
 <p><b><:message:></b></p>
 <:or:><:eif:> 
 
 <form method="POST" action="<:script:>">
-
+<input type=hidden name=userid value=<:user id:>>
+<input type=hidden name=savegroups value=1>
   <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
     <tr> 
       <td> 
@@ -34,7 +39,7 @@
           <tr> 
             <th bgcolor="#FFFFFF" align="left">Name: </th>
             <td bgcolor="#FFFFFF"> 
-              <input type="text" name="name" value="<:user logon:>" />
+              <input type="text" name="name" value="<:user name:>" />
             </td>
             <td bgcolor="#FFFFFF"><:help edituser name:> </td>
           </tr>
             </td>
             <td bgcolor="#FFFFFF"><:help edituser confirm:> </td>
           </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left" valign="top"> Groups: </th>
+            <td bgcolor="#FFFFFF"> 
+             <:iterator begin groups:>
+               <input type=checkbox name=groups value=<:igroup id:> <:ifMemberof igroup:>checked<:or:><:eif:> /> <:igroup name:>
+             <:iterator separator groups:>
+             <br>
+             <:iterator end groups:>
+            </td>
+            <td bgcolor="#FFFFFF" valign="top"><:help edituser groups:> </td>
+          </tr>
           <tr> 
             <td bgcolor="#FFFFFF" colspan="3" align="right"> 
               <input type="submit" name="a_saveuser" value="  Save User  " />
diff --git a/site/templates/admin/showuser_del.tmpl b/site/templates/admin/showuser_del.tmpl
new file mode 100644 (file)
index 0000000..cb1f5d6
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+  <title>Administration - Delete User</title>
+
+  <link rel="stylesheet" type="text/css" href="/css/admin.css" />
+
+</head>
+
+<body>
+<h1>Delete User</h1>
+<p>
+| <a href="/admin/">Admin menu</a>
+| <a href="<:script:>">User list</a> |
+</p>
+<form method="POST" action="<:script:>">
+<input type=hidden name=userid value=<:user id:>>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+    <tr> 
+      <td> 
+        <table cellpadding="6" border="0" cellspacing="1">
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Logon: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:user logon:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help edituser logon:> </td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Name: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:user name:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help edituser name:> </td>
+          </tr>
+          <tr> 
+            <td colspan="3" bgcolor="#FFFFFF" align="left">
+             Are you sure you want to delete this user?
+           </td>
+          </tr>
+          <tr> 
+            <td bgcolor="#FFFFFF" colspan="3" align="right"> 
+              <input type="submit" name="a_deluser" value="  Delete User  " />
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+  
+<p><font size="-1">BSE Release <:release:></font></p>
+</body
+></html>
diff --git a/site/templates/admin/showuser_glob.tmpl b/site/templates/admin/showuser_glob.tmpl
new file mode 100644 (file)
index 0000000..3562d8c
--- /dev/null
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+  <title>Administration - Edit User</title>
+
+  <link rel="stylesheet" type="text/css" href="/css/admin.css" />
+
+</head>
+
+<body>
+<h1>Edit User <:user logon:></h1>
+<p>
+| <a href="/admin/">Admin menu</a>
+| <a href="<:script:>">User list</a> |
+</p>
+<p>
+| <a href="<:script:>?a_showuser=1&userid=<:user id:>">User Details</a> | Global Permissions
+| <a href="<:script:>?a_showuserart=1&userid=<:user id:>&id=-1">Article Permissions</a> |
+</p>
+<:ifMessage:>
+<p><b><:message:></b></p>
+<:or:><:eif:> 
+
+<form method="POST" action="<:script:>">
+<input type=hidden name=userid value=<:user id:>>
+<input type=hidden name=savegperms value=1>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+    <tr> 
+      <td> 
+        <table cellpadding="6" border="0" cellspacing="1">
+          <:iterator begin gperms:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left"><:gperm brief:> </th>
+            <td bgcolor="#FFFFFF"> 
+              <input type=checkbox name=gperms value=<:gperm id:> <:ifGperm_set gperm:>checked <:or:><:eif:>/>
+            </td>
+            <td bgcolor="#FFFFFF"><img src="/images/admin/help.gif" title="<:gperm help:>" /></td>
+          </tr>
+          <:iterator end gperms:>
+          <tr> 
+            <td bgcolor="#FFFFFF" colspan="3" align="right"> 
+              <input type="submit" name="a_saveuser" value="  Save Permissions  " />
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+  
+<p><font size="-1">BSE Release <:release:></font></p>
+</body
+></html>
diff --git a/site/templates/admin/showuserart.tmpl b/site/templates/admin/showuserart.tmpl
new file mode 100644 (file)
index 0000000..7275dcf
--- /dev/null
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+
+  <title>Administration - Edit User - Article permissions</title>
+
+  <link rel="stylesheet" type="text/css" href="/css/admin.css" />
+
+</head>
+
+<body>
+<h1>Edit User <:user logon:></h1>
+<p>
+| <a href="/admin/">Admin menu</a>
+| <a href="<:script:>">User list</a> |
+</p>
+<p>
+| <a href="<:script:>?a_showuser=1&userid=<:user id:>">User Details</a> 
+| <a href="<:script:>?a_showuser=1&userid=<:user id:>&_t=glob">Global Permissions</a>
+| Article Permissions |
+</p>
+<:ifParent:><p>| <a href="<:script:>?a_showuserart=1&userid=<:user id:>&id=<:parent id:>">Parent permissions</a> |</p><:or:><:eif:>
+<:ifMessage:>
+<p><b><:message:></b></p>
+<:or:><:eif:> 
+
+<h2>Permissions for <:ifEq [article id] "-1":>the site<:or:>article <:article title:><:eif:></h2>
+
+<form method="POST" action="<:script:>">
+<input type=hidden name=userid value=<:user id:>>
+<input type=hidden name=saveaperms value=1>
+<input type=hidden name=id value=<:article id:>>
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+    <tr> 
+      <td> 
+        <table cellpadding="6" border="0" cellspacing="1">
+          <:iterator begin aperms:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left"><:aperm brief:> </th>
+            <td bgcolor="#FFFFFF"> 
+              <input type=checkbox name=aperms value=<:aperm id:> <:ifAperm_set aperm:>checked <:or:><:eif:>/>
+            </td>
+            <td bgcolor="#FFFFFF"><img src="/images/admin/help.gif" title="<:aperm help:>" /></td>
+          </tr>
+          <:iterator end aperms:>
+          <tr> 
+            <td bgcolor="#FFFFFF" colspan="3" align="right"> 
+              <input type="submit" name="a_saveuserart" value="  Save User permissions  " />
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
+
+<:if Children:>
+<h2>Children</h2>
+<table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+  <tr>
+      <td>
+      <table border=0 cellpadding="6" cellspacing="1" width="100%">
+        <tr bgcolor="#FFFFFF"> 
+          <th>Title</th>
+          <th>Summary</th>
+          <th nowrap>Permissions</th>
+        </tr>
+        <:iterator begin children:> 
+        <tr bgcolor="#FFFFFF"> 
+          <td><a href="<:child admin:>"><:child title:></a></td>
+          <td><: summary child body :></td>
+          <td nowrap><a href="<:script:>?a_showuserart=1&userid=<:user id:>&id=<:child id:>">Permissions</a></td>
+        </tr>
+        <:iterator separator children:> <:iterator end children:> 
+      </table>
+</td>
+</tr>
+</table>
+<:or Children:><:eif Children:>
+  
+<p><font size="-1">BSE Release <:release:></font></p>
+</body
+></html>
index ecba5f456ff604ed697c925d84f43d17d90b18ae..7304d157d17688c25241ae0e7fef88ec2514e82e 100644 (file)
             <th bgcolor="#FFFFFF" nowrap> Logon</th>
             <th bgcolor="#FFFFFF" nowrap> Name</th>
             <th bgcolor="#FFFFFF" nowrap> In Groups</th>
+            <th bgcolor="#FFFFFF" nowrap>&nbsp;</th>
           </tr>
           <:if Users:> <: iterator begin users :> 
           <tr bgcolor="#FFFFFF"> 
             <td nowrap> <a href="<:script:>?a_showuser=1&userid=<:iuser id:>"><:iuser logon:></a></td>
             <td valign="top"><:iuser name:></td>
-            <td valign="top"><:ifUser_groups iuser:><:iterator begin user_groups iuser:><:user_group name:> <:iterator separator user_groups:>, <:iterator end user_groups:><:or:>(none)<:eif:>
+            <td valign="top"><:ifUser_groups iuser:><:iterator begin user_groups iuser:><:user_group name:><:iterator separator user_groups:>, <:iterator end user_groups:><:or:>(none)<:eif:>
             </td>
+           <td>
+             <a href="<:script:>?a_showuser=1&userid=<:iuser id:>&_t=del">Delete</a>
+           </td>
           </tr>
           <: iterator end users :> 
           <:or Users:> 
           <tr bgcolor="#FFFFFF"> 
-            <td colspan="3" align="center">Your system has no users.</td>
+            <td colspan="4" align="center">Your system has no users.</td>
           </tr>
           <:eif Users:> 
         </table>
index e9a34efc6e60dd624879e1130de890208dd738d1..d967a2a4498bc011880adc4f9bacc31dcf545ea1 100644 (file)
@@ -42,6 +42,7 @@
             <td height="18"> &nbsp;<font face="Verdana, Arial, Helvetica, sans-serif" size="-2" color="#FFFFFF"><b>Price:</b></font>&nbsp;</td>
             <td height="18">&nbsp; </td>
           </tr>
+          <:ifCount:>
           <:iterator begin items:> 
           <tr valign="middle" align="center" bgcolor="#FFFFFF"> 
             <td width="100%" align="left"> &nbsp;<font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><a href="<:item link:>"><:item 
               <input type="submit" name="delete_<:index:>" value="Remove">
             </td>
           </tr>
-          <:iterator end items:> 
+          <:iterator end items:>
+          <:or:>
+          <tr valign="middle" align="center" bgcolor="#FFFFFF"> 
+            <td width="100%" height="20" align="center" colspan="4"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">You have no items in your shopping cart!</font></td>
+           </tr>
+          <:eif:>
         </table>
       </td>
     </tr>
index 1ef06f3a5ce74f62a3be73301a48d90fa3d297e8..59b19dd060b783f496e8991a05997eb11c0604ef 100644 (file)
@@ -24,6 +24,18 @@ function MM_validateForm() { //v4.0
   } if (errors) alert('The following error(s) occurred:\n'+errors);
   document.MM_returnValue = (errors == '');
 }
+
+function BSE_validateForm {
+  var typeEl = MM_findObj('paymentType');
+  var type = typeEl.value;
+  if (type == 0) {
+    MM_validateForm('name1','','R','name2','','R','address','','R','city','','R','postcode','','R','state','','R','country','','R','email','','RisEmail','cardHolder','','R','cardNumber','','R','cardExpiry','','R');
+  }
+  else {
+    MM_validateForm('name1','','R','name2','','R','address','','R','city','','R','postcode','','R','state','','R','country','','R','email','','RisEmail');
+  }
+}
+
 //-->
 </script>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
@@ -115,7 +127,7 @@ function MM_validateForm() { //v4.0
   </tr>
 </table>
 <p>&nbsp;</p>
-<form action="/cgi-bin/shop.pl" method="POST" onSubmit="MM_validateForm('name1','','R','name2','','R','address','','R','city','','R','postcode','','R','state','','R','country','','R','email','','RisEmail','cardHolder','','R','cardNumber','','R','cardExpiry','','R');return document.MM_returnValue">
+<form action="/cgi-bin/shop.pl" method="POST" onSubmit="BSE_validateForm();return document.MM_returnValue">
   <font face="Verdana, Arial, Helvetica, sans-serif" size="3"> <b>Shipping Details:</b></font> 
   <hr noshade size="1">
   <table border="0" cellspacing="0" cellpadding="0">
@@ -196,6 +208,8 @@ function MM_validateForm() { //v4.0
   <p>&nbsp; </p>
   <font face="Verdana, Arial, Helvetica, sans-serif" size="3"> <b>Payment Details:</b></font> 
   <hr size="1" noshade>
+  <:if CCPayments :>
+  <:if MultPaymentTypes:><p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><input type=radio name=paymentType value=0 <:checkedIfFirstCC:>> Credit Card</font></p><:or MultPaymentTypes:><input type=hidden name=paymentType value=0><:eif MultPaymentTypes:>
   <table border="0" cellspacing="0" cellpadding="0">
     <tr> 
       <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> Name on 
@@ -229,6 +243,24 @@ function MM_validateForm() { //v4.0
         &nbsp;*</font></td>
     </tr>
   </table>
+  <:or CCPayments:><:eif CCPayments:>
+  <:if ChequePayments:>
+  <:if MultPaymentTypes:><p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <input type=radio name=paymentType value=1 <:checkedIfFirstCheque:>/>
+    Cheque</font></p><:or MultPaymentTypes:><input type=hidden name=paymentType value=1><:eif MultPaymentTypes:>
+  <p> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> Please send your cheque to:</font></p>
+  <ul> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> <:cfg shop address1:><br />
+     <:cfg shop address2:><br />
+     <:cfg shop address3:></font></ul>
+  <:or ChequePayments:><:eif ChequePayments:>
+  <:if CallMePayments:>
+   <:if MultPaymentTypes:><p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><input type=radio name=paymentType value=2 <:checkedIfFirstCallMe:>/> Contact me for billing details</font></p>
+   <:or MultPaymentTypes:>
+     <input type=hidden name=paymentType value=2>
+     <p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">We will call you to arrange for payment.</font></p>
+   <:eif MultPaymentTypes:>
+  <:or CallMePayments:>
+
+  <:eif CallMePayments:>
   <p>&nbsp; </p>
   <font face="Verdana, Arial, Helvetica, sans-serif" size="3"> <b>Tax Invoice 
   / Receipt &amp; Delivery Costs:</b></font> 
index a098ed2cb123d1884613f156e8c4e0e143b57f86..9257519a74eec0df96f869b4201a3eda1bd5be8e 100644 (file)
 <p> The <:siteName:> store is run on a secure encrypted server, your details are 
   safe with us.<br>
 </p>
+<:if CCPayment:><:or CCPayment:><:eif CCPayment:>
+<:if ChequePayment:>
+<p>Please send your cheque to:</p>
+<ul><:cfg shop address1 |h:><br>
+<:cfg shop address2 |h:><br>
+<:cfg shop address3 |h:></ul>
+<:or ChequePayment:><:eif ChequePayment:>
+<:if CallMePayment:>
+<p>We will call you to arrange payment.</p>
+<:or CallMePayment:><:eif CallMePayment:>
 </font> 
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr> 
index 4ac560462161e82581be5ef8a6505f45accaf584..91462e289a7b5134f127f9ad68585ac961c9a8fe 100644 (file)
@@ -60,7 +60,7 @@ Embedded:> <br>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Description</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Filename</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Size</font></th>
-          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Download</font></th>
+          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Status</font></th>
         </tr>
         <:iterator begin files:> 
         <tr bgcolor="#FFFFFF"> 
@@ -71,10 +71,8 @@ Embedded:> <br>
             <:file displayName:></a><:eif File:></font></td>
           <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:kb 
             file sizeInBytes:></font></td>
-          <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:if 
-            File forSale:> Sorry, this document cannot be downloaded <:or File:> 
-            <a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>">Download</a> 
-            <:eif File:> </font></td>
+          <td nowrap align="center"> <:if 
+            File forSale:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><img src="/images/filestatus/forSale.gif" width="15" height="15" alt="File must be purchased" title="File must be purchased"><:or File:><a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:ifFile requireUser:><img src="/images/filestatus/requireUser.gif" width="15" height="15" alt="For registered users only" title="For registered users only"><:or:><img src="/images/trans_pixel.gif" width="15" height="15" title="For registered users only"><:eif:><:eif File:></td>
         </tr>
         <:iterator end files:> 
       </table>
index 790f9f153c514cc7e837fb69b252ced9343586ec..68c91e3677f650c509f8fb3962204189749b3557 100644 (file)
@@ -68,7 +68,7 @@ Stepparents:>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Description</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Filename</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Size</font></th>
-          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Download</font></th>
+          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Status</font></th>
         </tr>
         <:iterator begin files:> 
         <tr bgcolor="#FFFFFF"> 
@@ -79,10 +79,8 @@ Stepparents:>
             <:file displayName:></a><:eif File:></font></td>
           <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:kb 
             file sizeInBytes:></font></td>
-          <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:if 
-            File forSale:> Sorry, this document cannot be downloaded <:or File:> 
-            <a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>">Download</a> 
-            <:eif File:> </font></td>
+          <td nowrap align="center"> <:if 
+            File forSale:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><img src="/images/filestatus/forSale.gif" width="15" height="15" alt="File must be purchased" title="File must be purchased"><:or File:><a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:ifFile requireUser:><img src="/images/filestatus/requireUser.gif" width="15" height="15" alt="For registered users only" title="For registered users only"><:or:><img src="/images/trans_pixel.gif" width="15" height="15" title="For registered users only"><:eif:><:eif File:></td>
         </tr>
         <:iterator end files:> 
       </table>
index e95044e2aed16933088e973261484c245e7acb5f..d3b6f1d6e036b9e6e7a1691d1e5b97fa68f81d8f 100644 (file)
@@ -95,8 +95,8 @@ Stepparents:>
             <:file displayName:></a><:eif File:></font></td>
           <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:kb 
             file sizeInBytes:></font></td>
-          <td nowrap> <:if 
-            File forSale:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><:or File:><a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:eif File:><:if File requireUser:><img src="/images/filestatus/requireUser.gif" width="15" height="15" alt="For registered users only" title="For registered users only"><:or File:><img src="/images/trans_pixel.gif" width="15" height="15"><:eif File:><:if File forSale:><img src="/images/filestatus/forSale.gif" width="15" height="15" alt="File must be purchased" title="File must be purchased"><:or File:><img src="/images/trans_pixel.gif" width="15" height="15"><:eif File:></td>
+          <td nowrap align="center"> <:if 
+            File forSale:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><img src="/images/filestatus/forSale.gif" width="15" height="15" alt="File must be purchased" title="File must be purchased"><:or File:><a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:ifFile requireUser:><img src="/images/filestatus/requireUser.gif" width="15" height="15" alt="For registered users only" title="For registered users only"><:or:><img src="/images/trans_pixel.gif" width="15" height="15" title="For registered users only"><:eif:><:eif File:></td>
         </tr>
         <:iterator end files:> 
       </table>
index 98eae481c50a961aca24311e1017c5d7a2108e23..007d17ed6202d77f719cc382a1d517c838ef8945 100644 (file)
@@ -122,7 +122,7 @@ Embedded:><:if Files:> <br>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Description</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Filename</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Size</font></th>
-          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Download</font></th>
+          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Status</font></th>
         </tr>
         <:iterator begin files:> 
         <tr bgcolor="#FFFFFF"> 
@@ -133,10 +133,8 @@ Embedded:><:if Files:> <br>
             <:file displayName:></a><:eif File:></font></td>
           <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:kb 
             file sizeInBytes:></font></td>
-          <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:if 
-            File forSale:> Sorry, this document cannot be downloaded <:or File:> 
-            <a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>">Download</a> 
-            <:eif File:> </font></td>
+          <td nowrap align="center"> <:if 
+            File forSale:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><img src="/images/filestatus/forSale.gif" width="15" height="15" alt="File must be purchased" title="File must be purchased"><:or File:><a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:ifFile requireUser:><img src="/images/filestatus/requireUser.gif" width="15" height="15" alt="For registered users only" title="For registered users only"><:or:><img src="/images/trans_pixel.gif" width="15" height="15" title="For registered users only"><:eif:><:eif File:></td>
         </tr>
         <:iterator end files:> 
       </table>
index 614e28de7bd0d38951c2ddb7d253e409a1f5792f..315d0bf2b8c431f1cb317159e723acc0fb2bb460 100644 (file)
@@ -121,7 +121,7 @@ Embedded:><:if Files:> <br>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Description</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Filename</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Size</font></th>
-          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Download</font></th>
+          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Status</font></th>
         </tr>
         <:iterator begin files:> 
         <tr bgcolor="#FFFFFF"> 
@@ -132,10 +132,8 @@ Embedded:><:if Files:> <br>
             <:file displayName:></a><:eif File:></font></td>
           <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:kb 
             file sizeInBytes:></font></td>
-          <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:if 
-            File forSale:> Sorry, this document cannot be downloaded <:or File:> 
-            <a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>">Download</a> 
-            <:eif File:> </font></td>
+          <td nowrap align="center"> <:if 
+            File forSale:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><img src="/images/filestatus/forSale.gif" width="15" height="15" alt="File must be purchased" title="File must be purchased"><:or File:><a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:ifFile requireUser:><img src="/images/filestatus/requireUser.gif" width="15" height="15" alt="For registered users only" title="For registered users only"><:or:><img src="/images/trans_pixel.gif" width="15" height="15" title="For registered users only"><:eif:><:eif File:></td>
         </tr>
         <:iterator end files:> 
       </table>
index 48b5a3c13432b84d41c224d128c37ccc38b109ff..e0f7e5fd3631c8be3dae71ce82da6c1aa48546d9 100644 (file)
@@ -62,7 +62,7 @@
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Description</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Filename</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Size</font></th>
-          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Download</font></th>
+          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Status</font></th>
         </tr>
         <:iterator begin files:> 
         <tr bgcolor="#FFFFFF"> 
             <:file displayName:></a><:eif File:></font></td>
           <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:kb 
             file sizeInBytes:></font></td>
-          <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:if 
-            File forSale:> Sorry, this document cannot be downloaded <:or File:> 
-            <a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>">Download</a> 
-            <:eif File:> </font></td>
+          <td nowrap align="center"> <:if 
+            File forSale:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><img src="/images/filestatus/forSale.gif" width="15" height="15" alt="File must be purchased" title="File must be purchased"><:or File:><a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:ifFile requireUser:><img src="/images/filestatus/requireUser.gif" width="15" height="15" alt="For registered users only" title="For registered users only"><:or:><img src="/images/trans_pixel.gif" width="15" height="15" title="For registered users only"><:eif:><:eif File:></td>
         </tr>
         <:iterator end files:> 
       </table>
index 5fa454398a1e292857874734fe45ba68d7c6f385..390a4916bad304cdba945bafb090b85292238f60 100644 (file)
@@ -1,3 +1,4 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
   <head>
     <title><:article title:></title>
index 19a07a98cffe4b95e2ace58fccf2c25488644081..289094642d7811576fac5a8e7e5bfb2c47aea10a 100644 (file)
@@ -19,3 +19,8 @@ Product                                   Units  Price   Extended
 :>-----------------------------------------------------------------
                                                 Total: <:order total |m10:>
                                                  GST: <:order gst   |m10:>
+
+<:ifEq [order paymentType] "0" :>Paid by credit card.<:or:><:eif
+:><:ifEq [order paymentType] "1" :>Will be paid by cheque<:or
+:><:eif:><:ifEq [order paymentType] "2"
+:>We will call you to arrange for payment<:or:><:eif:>
index ca8013136e7bef24468920c816277a970f873418..266d0b409a270de009736e39419033b715ac608b 100644 (file)
@@ -20,7 +20,11 @@ Product                                   Units  Price   Extended
                                                 Total: <:order total |m10:>
                                                  GST: <:order gst   |m10:>
 
+<:ifEq [order paymentType] "0":>Paid by credit card:
 Card No.     : <:cardNumber:>
 Expires      : <:cardExpiry:>
 Name on Card : <:order ccName:>
-Card Type    : <:order ccType :>
+Card Type    : <:order ccType :><:or:><:eif
+:><:ifEq [order paymentType] "1" :>Will be paid by cheque<:or
+:><:eif:><:ifEq [order paymentType] "2"
+:>Please call the customer to arrange for payment<:or:><:eif:>
index a677cb9f4cd44b3f50f16a00a2c2e48e8583a1fe..4151d533400ee6a09dae13f44d3f278b23565ee8 100644 (file)
@@ -67,6 +67,7 @@
   </table>
 </form>
 <:or Product:><br>
+<br>
 <table border="0" cellspacing="0" cellpadding="1" bgcolor="#CCCCCC">
   <tr>
     <td>
@@ -121,7 +122,7 @@ Product:>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Description</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Filename</font></th>
           <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Size</font></th>
-          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Download</font></th>
+          <th><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Status</font></th>
         </tr>
         <:iterator begin files:> 
         <tr bgcolor="#FFFFFF"> 
@@ -132,9 +133,8 @@ Product:>
             <:file displayName:></a><:eif File:></font></td>
           <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:kb 
             file sizeInBytes:></font></td>
-          <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><:if 
-            File forSale:>Downloadable on purchase<:or File:> <a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>">Download</a> 
-            <:eif File:> </font></td>
+          <td nowrap align="center"> <:if 
+            File forSale:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><img src="/images/filestatus/forSale.gif" width="15" height="15" alt="File must be purchased" title="File must be purchased"><:or File:><a href="/cgi-bin/user.pl?download_file=1&file=<:file id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:ifFile requireUser:><img src="/images/filestatus/requireUser.gif" width="15" height="15" alt="For registered users only" title="For registered users only"><:or:><img src="/images/trans_pixel.gif" width="15" height="15" title="For registered users only"><:eif:><:eif File:></td>
         </tr>
         <:iterator end files:> 
       </table>
index 2236cacdd9bb25316f0c2cc191e3eda88a534a50..fe7a60911c4d39ba2d726e43f620e879da3f4071 100644 (file)
@@ -83,7 +83,7 @@
           <:if Prodfiles:> 
         <table width="100%" cellpadding="3" cellspacing="1">
           <tr bgcolor="#CCCCCC"> 
-            <th colspan="3"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#666666"><:if 
+            <th colspan="4"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#666666"><:if 
               Order filled:>Files available<:or Order:><:ifEq [cfg downloads must_be_filled] 
               "yes":>Files available when order status is &#145;Complete&#146;<:or:>Files<:eif:><:eif 
               Order:></font></th>
@@ -91,7 +91,7 @@
 
           <tr bgcolor="#EEEEEE"> 
             <th width="50%" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Description</font></th>
-            <th nowrap width="50%" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">File</font></th>
+            <th nowrap width="50%" align="left" colspan="2"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">File</font></th>
             <th><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Size</font></th>
           </tr>
 <:iterator begin items:>
             <td nowrap width="50%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><:if 
               FileAvail:><a href="/cgi-bin/user.pl?download=1&file=<:prodfile id:>&order=<:order id:>&item=<:item id:>"><:prodfile 
               displayName:></a><:or FileAvail:><:prodfile displayName:><:eif FileAvail:></font></td>
+            <td><:if FileAvail:><a href="/cgi-bin/user.pl?download=1&file=<:prodfile id:>&order=<:order id:>&item=<:item id:>"><img src="/images/filestatus/download.gif" width="15" height="15" alt="Download now" title="Download now" border="0"></a><:or FileAvail:><img src="/images/filestatus/locked.gif" width="15" height="15" alt="Locked" title="Locked"><:eif FileAvail:></td>
             <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><:kb 
               prodfile sizeInBytes:></font></td>
           </tr>
index 4d34c2c8e13626abbd204a4adc15c43421e8c6b8..74c80e1d6b68a0cd160924779c67a41f9ddb899a 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use BSE::Test;
 
 ++$|;
-print "1..39\n";
+print "1..43\n";
 my $baseurl = base_url;
 ok($baseurl =~ /^http:/, "basic check of base url");
 my $ua = make_ua;
@@ -41,4 +41,8 @@ fetch_ok($ua, "edit article form", "$baseurl/cgi-bin/admin/add.pl?id=1",
         qr!Section\sDetails!s);
 fetch_ok($ua, "edit catalog form", "$baseurl/cgi-bin/admin/add.pl?id=4",
         qr!Catalog\sDetails!s);
+fetch_ok($ua, "user list", "$baseurl/cgi-bin/admin/adminusers.pl",
+        qr!Admin\sUsers!s);
+fetch_ok($ua, "group list", "$baseurl/cgi-bin/admin/adminusers.pl?a_groups=1",
+        qr!Admin\sGroups!s);