0.15_45 commit r0_15_45
authorTony Cook <tony@develop-help.com>
Thu, 12 Oct 2006 12:56:34 +0000 (12:56 +0000)
committertony <tony@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Thu, 12 Oct 2006 12:56:34 +0000 (12:56 +0000)
37 files changed:
MANIFEST
Makefile
schema/bse.sql
site/cgi-bin/admin/shopadmin.pl
site/cgi-bin/bse.cfg
site/cgi-bin/modules/BSE/AdminSiteUsers.pm
site/cgi-bin/modules/BSE/CfgInfo.pm
site/cgi-bin/modules/BSE/DB/Mysql.pm
site/cgi-bin/modules/BSE/Edit/Product.pm
site/cgi-bin/modules/BSE/Shop/Util.pm
site/cgi-bin/modules/BSE/TB/Location.pm
site/cgi-bin/modules/BSE/TB/SeminarSession.pm
site/cgi-bin/modules/BSE/Template.pm
site/cgi-bin/modules/BSE/UI/AdminSeminar.pm
site/cgi-bin/modules/BSE/UI/Shop.pm
site/cgi-bin/modules/BSE/Util/DynamicTags.pm
site/cgi-bin/modules/BSE/Util/Tags.pm
site/cgi-bin/modules/BSE/WebUtil.pm
site/cgi-bin/modules/Generate/Article.pm
site/cgi-bin/modules/Generate/Product.pm
site/cgi-bin/modules/SiteUser.pm
site/cgi-bin/search.pl
site/data/db/sql_statements.data [new file with mode: 0644]
site/data/db/sql_statements.pkey [new file with mode: 0644]
site/docs/bse.pod
site/templates/admin/addattendee2.tmpl
site/templates/admin/locations/list.tmpl
site/templates/admin/locations/view.tmpl [new file with mode: 0644]
site/templates/admin/locations/view_sessions.tmpl [new file with mode: 0644]
site/templates/admin/users/add.tmpl
site/templates/admin/users/edit.tmpl
site/templates/admin/users/edit_orders.tmpl
site/templates/admin/users/view.tmpl [new file with mode: 0644]
site/templates/admin/users/view_bookings.tmpl [new file with mode: 0644]
site/templates/base.tmpl
site/templates/search_base.tmpl
test.cfg

index 2a300c951cd549658dda9318a7d9320f83f115e6..adb625134f1c9dd335742026d9d5fcd7edf470de 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -191,6 +191,8 @@ site/cgi-bin/search.pl
 site/cgi-bin/shop.pl
 site/cgi-bin/user.pl
 site/data/stopwords.txt
+site/data/db/sql_statements.pkey
+site/data/db/sql_statements.data
 site/docs/BSE::UI::Affiliate.html
 site/docs/Generate.html
 site/docs/Generate::Article.html
@@ -322,6 +324,8 @@ site/templates/admin/locations/add.tmpl
 site/templates/admin/locations/delete.tmpl
 site/templates/admin/locations/edit.tmpl
 site/templates/admin/locations/list.tmpl
+site/templates/admin/locations/view.tmpl
+site/templates/admin/locations/view_sessions.tmpl
 site/templates/admin/order_detail.tmpl
 site/templates/admin/order_list.tmpl
 site/templates/admin/order_list_filled.tmpl
@@ -372,6 +376,8 @@ site/templates/admin/users/groupedit.tmpl
 site/templates/admin/users/grouplist.tmpl
 site/templates/admin/users/groupmembers.tmpl
 site/templates/admin/users/list.tmpl
+site/templates/admin/users/view.tmpl
+site/templates/admin/users/view_bookings.tmpl
 site/templates/admin/xbase.tmpl
 site/templates/affiliate.tmpl
 site/templates/base.tmpl
index 33ccba78d4f9b682db8427068829dd4f85473df3..c562c9088a1187a4eeab3dd8aa80f90e867e8bf5 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.15_44
+VERSION=0.15_45
 DISTNAME=bse-$(VERSION)
 DISTBUILD=$(DISTNAME)
 DISTTAR=../$(DISTNAME).tar
@@ -94,10 +94,12 @@ site/cgi-bin/modules/BSE/Version.pm: Makefile
 testinst: distdir
        perl localinst.perl $(DISTBUILD)
        perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
+       cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl loaddata.pl ../data/db
 
 testfiles: distdir
        perl localinst.perl $(DISTBUILD) leavedb
        perl -MExtUtils::Command -e rm_rf $(DISTBUILD)
+       cd `perl -lne 'do { print $$1; exit; } if /^base_dir\s*=\s*(.*)/' test.cfg`/util ; perl loaddata.pl ../data/db
 
 test: testinst
        perl -MTest::Harness=runtests -Isite/cgi-bin/modules -It -e 'runtests glob q!t/*.t!'
index 2f32970ee38c373cd8d2463bba42f39347a7ed56..1c494e474885abf02c552d6bc738f12aa118339e 100644 (file)
@@ -752,6 +752,10 @@ create table bse_seminar_bookings (
   siteuser_id integer not null,
   roll_present integer not null default 0,
 
+  options varchar(255) not null default '',
+  customer_instructions text not null default '',
+  support_notes text not null default '',
+
   primary key(session_id, siteuser_id),
   index (siteuser_id)
 );
index d71d6ab3bd28787f8b041891c1c434f685c6a367..a0e14f01cb9bfe56f0888377b770299e3ff12227 100755 (executable)
@@ -24,6 +24,7 @@ use BSE::Request;
 use BSE::WebUtil 'refresh_to_admin';
 use DevHelp::HTML;
 use BSE::Arrows;
+use BSE::CfgInfo 'product_options';
 
 my $req = BSE::Request->new;
 my $cfg = $req->cfg;
@@ -365,6 +366,7 @@ sub product_form {
 #    @images = $imageEditor->images()
 #      if $product->{id};
   my $image_index;
+  my $avail_options = product_options($cfg);
 
   my $blank = qq!<img src="$IMAGES_URI/trans_pixel.gif" width="17" height="13" border="0" align="absbottom" />!;
 
@@ -389,7 +391,7 @@ sub product_form {
      ifImage => sub { $product->{imageName} },
      hiddenNote => sub { $product->{listed} ? "&nbsp;" : "Hidden" },
      alloptions => 
-     sub { CGI::escapeHTML(join(',', sort keys %SHOP_PRODUCT_OPTS)) },
+     sub { CGI::escapeHTML(join(',', sort keys %$avail_options)) },
      templates => 
      sub {
        return CGI::popup_menu(-name=>'template', -values=>\@templates,
@@ -601,11 +603,13 @@ sub order_list_incomplete {
 sub cart_item_opts {
   my ($cart_item, $product) = @_;
 
+  my $avail_options = product_options($cfg);
+
   my @options = ();
   my @values = split /,/, $cart_item->{options};
   my @ids = split /,/, $product->{options};
   for my $opt_index (0 .. $#ids) {
-    my $entry = $SHOP_PRODUCT_OPTS{$ids[$opt_index]};
+    my $entry = $avail_options->{$ids[$opt_index]};
     my $option = {
                  id=>$ids[$opt_index],
                  value=>$values[$opt_index],
index ebf3e0d38f40c4a282c99f9bb2833a9838bea604..0f62549d52e68f7e77553ea145684d378fd4c0eb 100644 (file)
@@ -147,6 +147,10 @@ admin/edit_5=admin/edit_1
 admin/edit_img=admin/article_img
 admin/edit_file=admin/filelist
 
+; this used to be handled via the edit target, but since CVS sucks
+; I won't rename the template
+admin/users/view_orders=admin/users/edit_orders
+
 [Global permissions]
 change_body = 8
 change_body_no_shop = 9
@@ -343,6 +347,15 @@ display_address=Street
 display_postcode=Post code
 display_telephone=Phone
 
+[nonajax user agents]
+ie4=MSIE
+
+[ajax user agents]
+mozilla=^Mozilla/5.0
+
+[ajax definitions]
+includes=inline:<script type="text/javascript" src="/js/prototype.js"></script>
+
 [includes]
 00bsecfg_d=bsecfg_d/
 50local=bse-local.cfg
\ No newline at end of file
index 70b0c2f2a42392085eda45ed2e04929f0f7a56e7..55a881b71dc308e6737e78c176bd34f2449cbd44 100644 (file)
@@ -1,6 +1,6 @@
 package BSE::AdminSiteUsers;
 use strict;
-use base qw(BSE::UI::SiteuserCommon);
+use base qw(BSE::UI::AdminDispatch BSE::UI::SiteuserCommon);
 use BSE::Util::Tags qw(tag_error_img tag_hash);
 use DevHelp::HTML;
 use SiteUsers;
@@ -13,42 +13,34 @@ use constant SITEUSER_GROUP_SECT => 'BSE Siteuser groups validation';
 
 my %actions =
   (
-   list=>1,
-   edit=>1,
-   save=>1,
-   addform=>1,
-   add=>1,
-   grouplist=>1,
-   addgroupform=>1,
-   addgroup => 1,
-   editgroup=>1,
-   savegroup => 1,
-   deletegroupform =>1,
-   deletegroup=>1,
-   groupmemberform => 1,
-   savegroupmembers => 1,
+   list                     => 'bse_members_user_list',
+   edit                     => 'bse_members_user_edit',
+   save                     => 'bse_members_user_edit',
+   addform          => 'bse_members_user_add',
+   add              => 'bse_members_user_add',
+   view              => 'bse_members_user_view',
+   grouplist        => 'bse_members_group_list',
+   addgroupform             => 'bse_members_group_add',
+   addgroup         => 'bse_members_group_add',
+   editgroup        => 'bse_members_group_edit',
+   savegroup        => 'bse_members_group_edit',
+   deletegroupform   => 'bse_members_group_delete',
+   deletegroup      => 'bse_members_group_delete',
+   groupmemberform   => 'bse_members_user_edit',
+   savegroupmembers  => 'bse_members_user_edit',
   );
 
 my @donttouch = qw(id userId password email confirmed confirmSecret waitingForConfirmation flags affiliate_name previousLogon); # flags is saved separately
 my %donttouch = map { $_, $_ } @donttouch;
 
-sub dispatch {
-  my ($class, $req) = @_;
+sub default_action { 'list' }
 
-  $req->check_admin_logon()
-    or return BSE::Template->get_refresh($req->url('logon'), $req->cfg);
+sub actions {
+  \%actions
+}
 
-  my $cgi = $req->cgi;
-  my $action;
-  for my $check (keys %actions) {
-    if ($cgi->param("a_$check")) {
-      $action = $check;
-      last;
-    }
-  }
-  $action ||= 'list';
-  my $method = "req_$action";
-  $class->$method($req);
+sub rights {
+  \%actions
 }
 
 sub flags {
@@ -175,6 +167,18 @@ sub tag_ifUserMember {
 sub req_edit {
   my ($class, $req, $msg, $errors) = @_;
 
+  $class->_display_user($req, $msg, $errors, 'admin/users/edit');
+}
+
+sub req_view {
+  my ($class, $req, $msg, $errors) = @_;
+
+  $class->_display_user($req, $msg, $errors, 'admin/users/view');
+}
+
+sub _display_user {
+  my ($class, $req, $msg, $errors, $template) = @_;
+
   my $cgi = $req->cgi;
   my $id = $cgi->param('id');
   defined $id
@@ -231,15 +235,22 @@ sub req_edit {
      $it->make_iterator(\&iter_groups, 'group', 'groups', 
                        undef, undef, undef, \$current_group),
      ifMember => [ \&tag_ifUserMember, $siteuser, \$current_group ],
+     $it->make_iterator([ \&iter_seminar_bookings, $siteuser],
+                       'booking', 'bookings'),
     );  
 
-  my $template = 'admin/users/edit';
   my $t = $req->cgi->param('_t');
   $template .= "_$t" if defined($t) && $t =~ /^\w+$/;
 
   return BSE::Template->get_response($template, $req->cfg, \%acts);
 }
 
+sub iter_seminar_bookings {
+  my ($siteuser) = @_;
+
+  return $siteuser->seminar_bookings_detail;
+}
+
 sub req_save {
   my ($class, $req) = @_;
 
index 9a3dfb8f4b796c6e6be660d3fe8c60d70a133e33..742bc414b17416b201ef29e0faf993d8a7509681 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use vars qw(@ISA @EXPORT_OK);
 require Exporter;
 @ISA = qw(Exporter);
-@EXPORT_OK = qw(custom_class admin_base_url cfg_image_dir credit_card_class);
+@EXPORT_OK = qw(custom_class admin_base_url cfg_image_dir credit_card_class product_options);
 
 =head1 NAME
 
@@ -89,6 +89,30 @@ sub credit_card_class {
   return $class->new($cfg);
 }
 
+sub product_options {
+  my ($cfg) = @_;
+
+  my %options = %Constants::SHOP_PRODUCT_OPTS;
+
+  my %cfg_opts = $cfg->entriesCS('shop product options');
+  for my $option (keys %cfg_opts) {
+    my ($option_desc, @values) = split /;/, $cfg_opts{$option};
+    my %value_labels;
+    for my $value (@values) {
+      $value_labels{$value} = $cfg->entry("shop product option $option",
+                                         $value, $value);
+    }
+    $options{$option} =
+      {
+       desc => $option_desc,
+       values => \@values,
+       labels => \%value_labels,
+      };
+  }
+
+  \%options;
+}
+
 1;
 
 __END__
index fd814225dcbf3627f4e952a4b73707ce83b729f3..b615b2d258af6f46c58c70c5fb24b869f48eed49 100644 (file)
@@ -448,7 +448,7 @@ SQL
 select * from bse_seminar_bookings where session_id = ?
 SQL
    seminarSessionBookUser => <<SQL,
-insert bse_seminar_bookings values(?,?,?)
+insert bse_seminar_bookings values(?,?,?,?,?,?)
 SQL
    seminarSessionRollCallEntries => <<SQL,
 select bo.roll_present, su.id, su.userId, su.name1, su.name2, su.email
index befe997baeaccde118c65c56df2a4b2fd15b9ece..5ab578c2ea5133b54deee47b6bae2a2d24ac9a4c 100644 (file)
@@ -6,6 +6,7 @@ use HTML::Entities;
 use BSE::Template;
 use BSE::Util::Iterate;
 use DevHelp::HTML;
+use BSE::CfgInfo 'product_options';
 
 my %money_fields =
   (
@@ -66,6 +67,8 @@ sub tag_hash_mbcs {
 sub low_edit_tags {
   my ($self, $acts, $req, $article, $articles, $msg, $errors) = @_;
 
+  my $product_opts = product_options($req->cfg);
+
   my $cfg = $req->cfg;
   my $mbcs = $cfg->entry('html', 'mbcs', 0);
   my $tag_hash = $mbcs ? \&tag_hash_mbcs : \&hash_tag;
@@ -75,7 +78,7 @@ sub low_edit_tags {
      product => [ $tag_hash, $article ],
      $self->SUPER::low_edit_tags($acts, $req, $article, $articles, $msg,
                                $errors),
-     alloptions => join(",", sort keys %Constants::SHOP_PRODUCT_OPTS),
+     alloptions => join(",", sort keys %$product_opts),
      $it->make_iterator
      ([ \&iter_subs, $req ], 'subscription', 'subscriptions'),
     );
@@ -123,9 +126,11 @@ sub _validate_common {
       $errors->{$col} = "$money_fields{$col} invalid";
     }
   }
-  
+
   if (defined $data->{options}) {
-    my @bad_opts =grep !$Constants::SHOP_PRODUCT_OPTS{$_}, 
+    my $avail_options = product_options($self->{cfg});
+  
+    my @bad_opts = grep !$avail_options->{$_}, 
       split /,/, $data->{options};
     if (@bad_opts) {
       $errors->{options} = "Bad product options '". join(",", @bad_opts)."' entered";
index 874e892dd8b209b4ee691580d1fa235e34c770e4..abfe4433bff8a13453616b6d407abd540ed3cf27 100644 (file)
@@ -36,7 +36,8 @@ sub shop_cart_tags {
      sub { 
        if (++$item_index < @$cart) {
         $option_index = -1;
-        @options = cart_item_opts($cart->[$item_index], 
+        @options = cart_item_opts($req,
+                                  $cart->[$item_index], 
                                   $cart_prods->[$item_index]);
         undef $sem_session;
         undef $location;
@@ -120,13 +121,15 @@ sub tag_location {
 }
 
 sub cart_item_opts {
-  my ($cart_item, $product) = @_;
+  my ($req, $cart_item, $product) = @_;
+
+  my $avail_options = product_options($req->cfg);
 
   my @options = ();
   my @values = split /,/, $cart_item->{options};
   my @ids = split /,/, $product->{options};
   for my $opt_index (0 .. $#ids) {
-    my $entry = $SHOP_PRODUCT_OPTS{$ids[$opt_index]};
+    my $entry = $avail_options->{$ids[$opt_index]};
     my $option = {
                  id=>$ids[$opt_index],
                  value=>$values[$opt_index],
index 675628a5c8f8f4cb5912d3f9847c51500264db47..8175bc6562c3690d82b1b4a92046d00b8e1c0cad 100644 (file)
@@ -63,4 +63,10 @@ sub is_removable {
   return 1; # this will change
 }
 
+sub sessions_detail {
+  my ($self) = @_;
+
+  BSE::DB->query(bse_locationSessionDetail => $self->{id});
+}
+
 1;
index 42691a9b3ed32976a2160cdc779505c2d398e64b..de5a476969263f139aec30a457632235135c7d18 100644 (file)
@@ -69,13 +69,30 @@ sub set_roll_present {
   BSE::DB->run(updateSessionRollPresent => $present, $self->{id}, $userid);
 }
 
+my @attendee_attributes = 
+  qw/roll_present options customer_instructions support_notes/;
+my %attendee_defaults =
+  (
+   roll_present => 0,
+   options => '',
+   customer_instructions => '',
+   support_notes => '',
+  );
+
 sub add_attendee {
-  my ($self, $user, $present) = @_;
+  my ($self, $user, %attr) = @_;
+
+  my %work_attr = %attendee_defaults;
+  for my $key (keys %attr) {
+    exists $work_attr{$key} or 
+      Carp::confess("Unknown attendee attribute '$key'");
+    $work_attr{$key} = $attr{$key};
+  }
 
-  $present ||= 0;
   my $user_id = ref $user ? $user->{id} : $user;
 
-  BSE::DB->run(seminarSessionBookUser => $self->{id}, $user_id, $present);
+  BSE::DB->run(seminarSessionBookUser => $self->{id}, $user_id, 
+              @work_attr{@attendee_attributes});
 }
 
 1;
index f7a0e391132acf153910bdb3039e4fae47be1a58..a3886651a6daea4986a552a1131ac9b93e9fe5ca 100644 (file)
@@ -101,6 +101,16 @@ sub get_response {
 sub get_refresh {
   my ($class, $url, $cfg) = @_;
 
+
+  return
+    {
+     content => '',
+     headers => [ 
+                "Location: $url",
+                "Status: 302"
+               ],
+    };
+
   # the commented out headers were meant to help Opera, but they didn't
   return
     {
@@ -112,16 +122,6 @@ sub get_refresh {
                #qq/Expires: Thu, 01 Jan 1970 00:00:00 GMT/
              ],
     };
-
-  return
-    {
-     content => '',
-     headers => [ 
-                "Location: $url",
-                "Status: 302"
-               ],
-    };
-
 }
 
 sub template_dirs {
index 54b197180b7e61f014d2fb6229efdf58bd8f7e17..79f4cc1369bf977d9b139d2a8a2c88b2de3bd18d 100644 (file)
@@ -6,8 +6,9 @@ use BSE::Util::DynSort qw(sorter tag_sorthelp);
 use BSE::Template;
 use BSE::Util::Iterate;
 use BSE::TB::Locations;
-use DevHelp::HTML;
+use DevHelp::HTML qw(:default popup_menu);
 use constant SECT_LOCATION_VALIDATION => "BSE Location Validation";
+use BSE::CfgInfo 'product_options';
 
 my %rights =
   (
@@ -16,6 +17,7 @@ my %rights =
    locadd => 'bse_location_add',
    locedit => 'bse_location_edit',
    locsave => 'bse_location_edit',
+   locview => 'bse_location_view',
    locdelask => 'bse_location_delete',
    locdelete => 'bse_location_delete',
 #    detail => 'bse_subscr_detail',
@@ -155,6 +157,8 @@ sub _loc_show_common {
   my %fields = BSE::TB::Location->valid_fields();
   my $cfg_fields = $req->configure_fields(\%fields, SECT_LOCATION_VALIDATION);
 
+  my $it = BSE::Util::Iterate->new;
+
   my %acts;
   %acts =
     (
@@ -166,11 +170,24 @@ sub _loc_show_common {
      error_img => [ \&tag_error_img, $req->cfg, $errors ],
      location => [ \&tag_hash, $location ],
      field => [ \&tag_field, $cfg_fields ],
+     $it->make_iterator([ \&iter_locsessions, $location ],
+                       'session', 'sessions'),
     );
 
+  my $t = $req->cgi->param('_t');
+  if ($t && $t =~ /^\w+$/) {
+    $template .= "_$t";
+  }
+
   return $req->dyn_response($template, \%acts);
 }
 
+sub iter_locsessions {
+  my ($location) = @_;
+
+  $location->sessions_detail;
+}
+
 sub req_locedit {
   my ($class, $req, $errors) = @_;
 
@@ -219,6 +236,12 @@ sub req_locsave {
   return BSE::Template->get_refresh($r, $req->cfg);
 }
 
+sub req_locview {
+  my ($class, $req, $errors) = @_;
+
+  return $class->_loc_show_common($req, $errors, 'admin/locations/view');
+}
+
 sub req_locdelask {
   my ($class, $req, $errors) = @_;
 
@@ -326,6 +349,12 @@ sub req_addattendsession {
       ($req, { seminar_id => "Unknown seminar_id" });
   my $msg = $req->message($errors);
 
+  my $avail_options = product_options($req->cfg);
+
+  my @sem_options = map +{ id => $_, %{$avail_options->{$_}} },
+    split /,/, $seminar->{options};
+  my $current_option;
+
   my @sessions = $seminar->session_info;
   my %user_booked = map { $_=>1 } 
     $siteuser->seminar_sessions_booked($seminar_id);
@@ -344,11 +373,33 @@ sub req_addattendsession {
      message => $msg,
      error_img => [ \&tag_error_img, $req->cfg, $errors ],
      $it->make_iterator(undef, 'session', 'sessions', \@sessions),
+     $it->make_iterator(undef, 'option', 'options', \@sem_options, 
+                       undef, undef, \$current_option),
+     option_popup => [ \&tag_option_popup, $req->cgi, \$current_option ],
     );
   
   return $req->dyn_response('admin/addattendee2.tmpl', \%acts);
 }
 
+sub tag_option_popup {
+  my ($cgi, $roption) = @_;
+
+  $$roption 
+    or return '** popup_option not in options iterator **';
+
+  my $option = $$roption;
+
+  my @extras;
+  if ($cgi->param($option->{id})) {
+    push @extras, -default => $cgi->param($option->{id});
+  }
+
+  return popup_menu(-name => $option->{id},
+                   -values => $option->{values},
+                   -labels => $option->{labels},
+                   @extras);
+}
+
 sub req_addattendsave {
   my ($class, $req, $errors) = @_;
 
@@ -389,8 +440,30 @@ sub req_addattendsave {
     or return $class->req_addattendsession
       ($req, { session_id => "Unknown session_id" });
 
+  # accumulate the options
+  my %errors;
+  my @options;
+  for my $opt_name (split /,/, $seminar->{options}) {
+    my $value = $cgi->param($opt_name);
+    defined $value
+      or return $class->req_addattendsession
+       ($req, { opt_name => "Missing value for $opt_name" });
+    
+    push @options, $value;
+  }
+
+  my %more;
+  for my $name (qw/customer_instructions support_notes roll_present/) {
+    my $value = $cgi->param($name);
+    $value and $more{$name} = $value;
+  }
+  $more{roll_present} ||= 0;
+
   eval {
-    $session->add_attendee($siteuser, 1);
+    $session->add_attendee($siteuser, 
+                          %more,
+                          options => join(',', @options)
+                         );
   };
   if ($@) {
     if ($@ =~ /duplicate/i) {
index 1e192707008e261e87d7d818075a8164bcd8e6bc..7a017863bc269eee49eec1370e9fe1f909876aad 100644 (file)
@@ -678,7 +678,9 @@ sub req_payment {
       require BSE::TB::SeminarSessions;
       my $session = BSE::TB::SeminarSessions->getByPkey($item->{session_id});
       eval {
-       $session->add_attendee($user, 0);
+       $session->add_attendee($user, 
+                              instructions => $order->{instructions},
+                              options => $item->{options});
       };
     }
   }
@@ -814,7 +816,8 @@ sub req_orderdone {
      sub { 
        if (++$item_index < @items) {
         $option_index = -1;
-        @options = cart_item_opts($items[$item_index], 
+        @options = cart_item_opts($req, 
+                                  $items[$item_index], 
                                   $products[$item_index]);
         undef $sem_session;
         undef $location;
index 0eee22c9a8d23e8013bb570e6b23a97459de5213..25896517b6698ecf3eb0e83d6a9acf60e31095f1 100644 (file)
@@ -371,7 +371,8 @@ sub _cart {
     my $product = Products->getByPkey($item->{productId});
     my $extended = $product->{retailPrice} * $item->{units};
     my $link = $product->{link};
-    $link =~ /^\w+:/ or $link = $self->{req}->cfg->entryErr('site', 'url');
+    $link =~ /^\w+:/ 
+      or $link = $self->{req}->cfg->entryErr('site', 'url') . $link;
     push @cart,
       {
        ( map { $_ => $product->{$_} } $product->columns ),
index b6adfeab254d904d90db05e0171d373b975d3f7b..13f80a5e4a0c590743638dd4cbbabc43daf1161a 100644 (file)
@@ -274,6 +274,9 @@ sub static {
      # report conflicts with a tag name used within reports
      subreport => [ \&tag_report, $cfg ],
 
+     ajax => '',
+     ifAjax => 0,
+
      _format => 
      sub {
        my ($value, $fmt) = @_;
@@ -428,6 +431,8 @@ sub basic {
      dynreplace => \&tag_replace,
      dyntoday => \&tag_today,
      dynreport => [ \&tag_report, $cfg ],
+     ajax => [ \&tag_ajax, $cfg ],
+     ifAjax => [ \&tag_ifAjax, $cfg ],
     );
 }
 
@@ -855,5 +860,66 @@ sub tag_report {
   return BSE::Template->replace($html, $cfg, \%acts);
 }
 
+sub _if_ajax {
+  my ($cfg) = @_;
+
+  return
+    unless $cfg->entry('basic', 'ajax', 0);
+
+  return 1
+    if $cfg->entry('basic', 'allajax', 0);
+
+  my $ua = $ENV{HTTP_USER_AGENT};
+
+  my %fail_entries = $cfg->entries('nonajax user agents');
+  for my $re (values %fail_entries) {
+    return
+      if $ua =~ /$re/;
+  }
+
+  my %entries = $cfg->entries('ajax user agents');
+  for my $re (values %entries) {
+    return 1
+      if $ua =~ /$re/;
+  }
+
+  return;
+}
+
+sub tag_ifAjax {
+  my ($cfg) = @_;
+
+  return _if_ajax($cfg) ? 1 : 0;
+}
+
+sub tag_ajax {
+  my ($cfg, $args, $acts, $tag_name, $templater) = @_;
+
+  return '' unless _if_ajax($cfg);
+  
+  my ($name, $arg_rest) = split ' ', $args, 2;
+  my $defn = $cfg->entry('ajax definitions', $name)
+    or return "** unknown ajax definition $name **";
+  my ($type, $rest) = split ':', $defn, 2;
+
+  if ($type eq 'inline') {
+    # just replace $1, $2, etc in the rest of the text
+    my @args = DevHelp::Tags->get_parms($arg_rest, $acts, $templater);
+    my $macro = $rest;
+    eval {
+      $macro =~ s/(\$([1-9\$]))/
+       $2 eq '$' ? '$' : $2 <= @args 
+         ? die "** not enough parameters for ajax definition $name **\n" : $args[$1-1]/xge;
+    };
+    $@ and return $@;
+
+    return $macro;
+  }
+  else {
+    return "** invalid type $type for ajax definition $name **";
+  }
+}
+
 1;
 
index f86942ee6eba2f980142fb28a6f81b51862dc99d..d5f7ce466d8dd9b1a2d368ca2648b8e2e6f9aed3 100644 (file)
@@ -9,8 +9,10 @@ require Exporter;
 sub refresh_to {
   my ($where) = @_;
 
-  print "Content-Type: text/html\n";
-  print qq!Refresh: 0; url=$where\n\n<html></html>\n!;
+  #print "Content-Type: text/html\n";
+  #print qq!Refresh: 0; url=$where\n\n<html></html>\n!;
+  print "Status: 302\n";
+  print "Location: $where\n\n";
 }
 
 sub refresh_to_admin {
index 83cd74cd823fba0b5931abcba3aea2caf1a3be6a..32782bc792bd00dce8acc9cd25f5b59ce610898d 100644 (file)
@@ -203,6 +203,8 @@ sub tag_admin {
 sub baseActs {
   my ($self, $articles, $acts, $article, $embedded) = @_;
 
+  my $cfg = $self->{cfg} || BSE::Cfg->new;
+
   # used to generate the list (or not) of children to this article
   my $child_index = -1;
   my @children = $articles->listedChildren($article->{id});
@@ -239,6 +241,9 @@ sub baseActs {
   my $top = $self->{top} || $article;
   my $abs_urls = $self->abs_urls($article);
 
+  my $dynamic = $self->{force_dynamic}
+    || (UNIVERSAL::isa($top, 'Article') ? $top->is_dynamic : 0);
+
   my @stepkids;
   my @allkids;
   my @stepparents;
@@ -531,13 +536,12 @@ HTML
      BSE::Util::Tags->make_iterator(\@allkids, 'allkid', 'allkids', \$allkids_index),
      BSE::Util::Tags->make_iterator(\@stepparents, 'stepparent', 'stepparents'),
      top => [ \&tag_top, $self, $article ],
-     ifDynamic => [ \&tag_ifDynamic, $self, $top ],
+     ifDynamic => $dynamic,
      ifAccessControlled => [ \&tag_ifAccessControlled, $article ],
     );
 
   if ($abs_urls) {
     my $oldurl = $acts{url};
-    my $cfg = $self->{cfg} || BSE::Cfg->new;
     my $urlbase = $cfg->entryErr('site', 'url');
     $acts{url} =
       sub {
@@ -550,6 +554,11 @@ HTML
         return $value;
       };
   }
+  if ($dynamic && $cfg->entry('basic', 'ajax', 0)) {
+    # make sure the ajax tags are left until we do dynamic replacement
+    delete @acts{qw/ajax ifAjax/};
+  }
+
   return %acts;
 }
 
index cf2d04e3a085c17e7d80a1ffa9f0e2d08e89d246..3ee5ea07b2ddbb9b9520390ed35cd0522271a8a9 100644 (file)
@@ -8,6 +8,7 @@ use Constants qw(:shop $CGI_URI $ADMIN_URI);
 use Carp qw(confess);
 use DevHelp::HTML;
 use BSE::Util::Tags qw(tag_hash);
+use BSE::CfgInfo 'product_options';
 
 sub edit_link {
   my ($self, $id) = @_;
@@ -52,9 +53,10 @@ sub baseActs {
 
   my @stepcats = $product->step_parents();
   my $stepcat_index;
+  my $avail_options = product_options($self->{cfg});
   my @options = 
-    map { +{ id=>$_, %{$SHOP_PRODUCT_OPTS{$_}} } } 
-      grep $SHOP_PRODUCT_OPTS{$_},
+    map { +{ id=>$_, %{$avail_options->{$_}} } } 
+      grep $avail_options->{$_},
       split /,/, $product->{options};
   my $option_index;
 
index 6cbcd305c6387401968f60e5b6b6a0b025d09634..ee17ad985d4d0652ba51601e3e666e2246f9d62f 100644 (file)
@@ -425,4 +425,10 @@ sub allow_html_email {
   !$self->{textOnlyMail};
 }
 
+sub seminar_bookings_detail {
+  my ($self) = @_;
+
+  BSE::DB->query(bse_siteuserSeminarBookingsDetail => $self->{id});
+}
+
 1;
index 51c8eae7ff0f664acdf35af45639fcd05514de03..4b7dcc1fe0763594e964e0a821226d4b80187b20 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 # -d:ptkdb
-BEGIN { $ENV{DISPLAY} = '192.168.32.15:0.0' }
+BEGIN { $ENV{DISPLAY} = '192.168.32.50:0.0' }
 use strict;
 use FindBin;
 use lib "$FindBin::Bin/modules";
diff --git a/site/data/db/sql_statements.data b/site/data/db/sql_statements.data
new file mode 100644 (file)
index 0000000..0e49fce
--- /dev/null
@@ -0,0 +1,38 @@
+--
+name: bse_siteuserSeminarBookingsDetail
+sql_statement: <<SQL
+select ar.*, pr.*, se.*, ss.*, sb.*,
+      lo.description as loc_description,
+      lo.room as loc_room,
+      lo.street1 as loc_street1,
+      lo.street2 as loc_street2,
+      lo.suburb as loc_suburb,
+      lo.state as loc_state,
+      lo.country as loc_country,
+      lo.postcode as loc_postcode,
+      lo.public_notes as loc_public_notes,
+      lo.bookings_name as loc_bookings_name,
+      lo.bookings_phone as loc_bookings_phone,
+      lo.bookings_fax as loc_bookings_fax,
+      lo.bookings_url as loc_bookings_url
+  from article ar, product pr, bse_seminars se, bse_seminar_sessions ss,
+       bse_locations lo, bse_seminar_bookings sb
+  where sb.siteuser_id = ?
+    and sb.session_id = ss.id
+    and ss.seminar_id = ar.id
+    and ss.seminar_id = pr.articleId
+    and ss.seminar_id = se.seminar_id
+    and ss.location_id = lo.id
+SQL
+
+name: bse_locationSessionDetail
+sql_statement: <<SQL
+select ar.*, pr.*, se.*, ss.*,
+   ss.id as session_id
+  from article ar, product pr, bse_seminars se, bse_seminar_sessions ss
+  where ss.location_id = ?
+    and ss.seminar_id = ar.id
+    and ss.seminar_id = pr.articleId
+    and ss.seminar_id = se.seminar_id
+  order by ss.when_at desc
+SQL
diff --git a/site/data/db/sql_statements.pkey b/site/data/db/sql_statements.pkey
new file mode 100644 (file)
index 0000000..f121bdb
--- /dev/null
@@ -0,0 +1 @@
+name
index 79532509855f8c6eaf83b712a56a7bb026185204..4de626325e9c1ab213a35c68b0cee292b82af793 100644 (file)
@@ -10,6 +10,45 @@ Maybe I'll add some other bits here.
 
 =head1 CHANGES
 
+=head2 0.15_45
+
+Note: you need to cd to the util directory and run:
+
+  perl loaddata.pl ../data/db
+
+from this release onwards.
+
+=over
+
+=item *
+
+partial implementation of non-shop seminar booking (database changes,
+modifying the shop to fill in the new booking fields)
+
+=item *
+
+partial implementation of Seminar Administration (access checks, extra
+fields on the booking form, view member detail, display of booked
+seminars for a user)
+
+=item *
+
+added view location target (a_locview) to admin_seminar.pl
+
+=item *
+
+added session list for a given location (available to all location
+displays, including edit, view, implemented as a_locview with
+_t=sessions)
+
+=item *
+
+new shop product options can now be configured in bse.cfg, so you
+don't need to touch bse.cfg.  I'll document this later, see
+modules/BSE/CfgInfo.pm to see the code that does the work
+
+=back
+
 =head2 0.15_44
 
 =over
index 99b19a3dd14ffb184e213de13d458d5ad57e4ba6..3f4d5c126cc398f931995912c98b220900c0716c 100644 (file)
         </select></td>
     <td><:error_img session_id:></td>
   </tr>
+<:iterator begin options:>
+  <tr>
+   <th><:option desc:></th>
+   <td><:option_popup:></td>
+   <td></td>
+  </tr>
+<:iterator end options:>
+  <tr>
+   <th>Customer<br />Instructions:</th>
+   <td><textarea name="customer_instructions" cols="70" rows="10" /><:old customer_instructions:></textarea></td>
+   <td><:error_img customer_instructions:></td>
+  </tr>
+  <tr>
+   <th>Support<br />Notes:</th>
+   <td><textarea name="support_notes" cols="70" rows="10" /><:old support_notes:></textarea></td>
+   <td><:error_img support_notes:></td>
+  </tr>
   <tr>
     <td colspan="3"><input type="submit" name="a_addattendsave" value="Select Session &gt;&gt;" /></td>
   </tr>
index 08bdfea1a64c883d593a4ec2c22bb7551ed2b7ec..43c041bc62890f5e9dfef93290fd95aa7d8f2fad 100644 (file)
@@ -23,7 +23,9 @@
       <td><:ilocation street1:> <:ilocation street2:></td>
       <td><:ilocation suburb:></td>
       <td align="center"><:ifIlocation disabled:>Disabled<:or:><:eif:></td>
-      <td><:ifUserCan bse_location_edit:><a href="<:script:>?a_locedit=1&amp;id=<:ilocation id:>">Edit</a><:or:><:eif:> <:ifAnd [ifRemovable] [ifUserCan bse_location_delete]:><a href="<:script:>?a_locdelask=1&amp;id=<:ilocation id:>">Delete</a><:or:><:eif:></td>
+      <td><:ifUserCan bse_location_edit:><a href="<:script:>?a_locedit=1&amp;id=<:ilocation id:>">Edit</a><:or:><:eif:> 
+<:ifUserCan bse_location_view:><a href="<:script:>?a_locview=1&amp;id=<:ilocation id:>">View</a> <a href="<:script:>?a_locview=1&amp;id=<:ilocation id:>&amp;_t=sessions">Sessions</a><:or:><:eif:> 
+<:ifAnd [ifRemovable] [ifUserCan bse_location_delete]:><a href="<:script:>?a_locdelask=1&amp;id=<:ilocation id:>">Delete</a><:or:><:eif:></td>
     </tr>
 <:iterator end locations:>
 <:or Locations:>
diff --git a/site/templates/admin/locations/view.tmpl b/site/templates/admin/locations/view.tmpl
new file mode 100644 (file)
index 0000000..61177e5
--- /dev/null
@@ -0,0 +1,105 @@
+<:wrap admin/xbase.tmpl title=>"View Location":>
+<h1>View Location</h1>
+<p>
+| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> |
+<:if UserCan bse_location_list :>
+<a href="<:script:>?a_loclist=1">List Locations</a> |<:or UserCan:><:eif UserCan:>
+<a href="<:script:>?a_locview=1&amp;id=<:location id:>&amp;_t=sessions">Sessions</a> |
+<:ifMessage:>
+<p><b><:message:></b></p>
+<:or:><:eif:> 
+
+<table>
+<tr>
+  <th><:field description description:>:</th>
+  <td><:location description:></td>
+  <td><:help addlocation description:></td>
+</tr>
+<tr>
+  <th><:field room description:>:</th>
+  <td><:location room:></td>
+  <td><:help addlocation room:></td>
+</tr>
+<tr>
+  <th><:field street1 description:>:</th>
+  <td><:location street1:></td>
+  <td><:help addlocation street1:></td>
+</tr>
+<tr>
+  <th><:field street2 description:>:</th>
+  <td><:location street2:></td>
+  <td><:help addlocation street2:></td>
+</tr>
+<tr>
+  <th><:field suburb description:>:</th>
+  <td><:location suburb:></td>
+  <td><:help addlocation suburb:></td>
+</tr>
+<tr>
+  <th><:field state description:>:</th>
+  <td><:location state:></td>
+  <td><:help addlocation state:></td>
+</tr>
+<tr>
+  <th><:field country description:>:</th>
+  <td><:location country:></td>
+  <td><:help addlocation country:></td>
+</tr>
+<tr>
+  <th><:field postcode description:>:</th>
+  <td><:location postcode:></td>
+  <td><:help addlocation postcode:></td>
+</tr>
+<tr>
+  <th><:field public_notes description:>:</th>
+  <td><textarea name="public_notes" rows="<:field public_notes height:>" cols="<:field public_notes width:>" wrap="virtual" readonly="readonly"><:location public_notes:></textarea></td>
+  <td><:help addlocation public_notes:></td>
+</tr>
+<tr>
+  <th>Disabled:</th>
+  <td><img src="/images/admin/<:ifLocation disabled:>checked.gif<:or:>unchecked.gif<:eif:>" /></td>
+  <td><:help addlocation disabled:></td>
+</tr>
+<tr>
+  <th colspan="2">Bookings</th>
+</tr>
+<tr>
+  <th><:field bookings_name description:>:</th>
+  <td><:location bookings_name:></td>
+  <td><:help addlocation bookings_name:></td>
+</tr>
+<tr>
+  <th><:field bookings_phone description:>:</th>
+  <td><:location bookings_phone:></td>
+  <td><:help addlocation bookings_phone:></td>
+</tr>
+<tr>
+  <th><:field bookings_fax description:>:</th>
+  <td><:location bookings_fax:></td>
+  <td><:help addlocation bookings_fax:></td>
+</tr>
+<tr>
+  <th><:field bookings_url description:>:</th>
+  <td><:location bookings_url:></td>
+  <td><:help addlocation bookings_url:></td>
+</tr>
+<tr>
+  <th colspan="2">Facilities</th>
+</tr>
+<tr>
+  <th><:field facilities_name description:>:</th>
+  <td><:location facilities_name:></td>
+  <td><:help addlocation facilities_name:></td>
+</tr>
+<tr>
+  <th><:field facilities_phone description:>:</th>
+  <td><:location facilities_phone:></td>
+  <td><:help addlocation facilities_phone:></td>
+</tr>
+<tr>
+  <th><:field admin_notes description:>:</th>
+  <td><textarea name="admin_notes" rows="<:field admin_notes height:>" cols="<:field admin_notes width:>" wrap="virtual" readonly="readonly"><:location admin_notes:></textarea></td>
+  <td><:help addlocation admin_notes:></td>
+</tr>
+
+</table>
diff --git a/site/templates/admin/locations/view_sessions.tmpl b/site/templates/admin/locations/view_sessions.tmpl
new file mode 100644 (file)
index 0000000..acd7f7e
--- /dev/null
@@ -0,0 +1,35 @@
+<:wrap admin/xbase.tmpl title=>"View Location Sessions":>
+<h1>View Location Sessions: <:location description:></h1>
+<p>
+| <a href="/cgi-bin/admin/menu.pl">Admin menu</a>
+<:if UserCan bse_location_list :>
+| <a href="<:script:>?a_loclist=1">List Locations</a><:or UserCan:><:eif UserCan:>
+| <a href="<:script:>?a_locview=1&amp;id=<:location id:>">Location Detail</a> |</p>
+<:ifMessage:>
+<p><b><:message:></b></p>
+<:or:><:eif:> 
+
+<table>
+  <tr>
+   <th>Seminar</th>
+   <th>Date</th>
+   <th>Time</th>
+   <th></th>
+  </tr>
+<:if Sessions:>
+<:iterator begin sessions:>
+  <tr>
+   <td><a href="/cgi-bin/admin/add.pl?id=<:session seminar_id:>"><:session title:></a></td>
+   <td><:date session when_at:></td>
+   <td><:date "%I:%M %P" session when_at:></td>
+   <td>
+     <a href="/cgi-bin/admin/add.pl?a_semsessionbookings=1&amp;id=<:session seminar_id:>&amp;session_id=<:session session_id:>">Bookings</a>
+   </td>
+  </tr>
+<:iterator end sessions:>
+<:or Sessions:>
+  <tr>
+    <td colspan="4" align="center">No Sessions at this location</td>
+  </tr>
+<:eif Sessions:>
+</table>
\ No newline at end of file
index 69639dc37f7060fe3764a439bc7e5620fea6d0bb..fd834f03dac583c3b9c84365cc15d1bc1cdbcf66 100644 (file)
@@ -2,8 +2,7 @@
 <h1>Add Site Member</h1>
 <p>
 | <a href="/cgi-bin/admin/menu.pl">Admin menu</a> |
-<a href="/cgi-bin/admin/siteusers.pl">Site Members</a> |
-<a href="mailto:<:siteuser email:>">Email</a> |</p>
+<a href="/cgi-bin/admin/siteusers.pl">Site Members</a> |</p>
 
 <:ifMessage:>
 <p><b><:message:></b></p>
index a9ffd33e2d2ce99ab017e9a35efe5ff2cd827eb2..bd6c11e3932af088637f3e35af07e6134beb3421 100644 (file)
@@ -4,8 +4,9 @@
 | <a href="/cgi-bin/admin/menu.pl">Admin menu</a> |
 <a href="/cgi-bin/admin/siteusers.pl">Site Members</a> |
 <a href="mailto:<:siteuser email:>">Email</a>
-<:ifUserorders:>| <a href="/cgi-bin/admin/siteusers.pl?a_edit=1&amp;id=<:siteuser id:>&amp;_t=orders">Orders</a><:or:><:eif:> |
+<:ifUserorders:>| <a href="/cgi-bin/admin/siteusers.pl?a_view=1&amp;id=<:siteuser id:>&amp;_t=orders">Orders</a><:or:><:eif:> |
 <a href="/cgi-bin/admin/admin_seminar.pl?a_addattendseminar=1&amp;siteuser_id=<:siteuser id:>">Add to seminar</a> |
+<a href="/cgi-bin/admin/siteusers.pl?a_view=1&amp;id=<:siteuser id:>&amp;_t=bookings">Seminar Bookings</a> |
 <a href="<:script:>?a_edit=1&amp;id=<:siteuser id:>&amp;_t=groups">Groups</a> |
 </p>
 
index 0d6e61b1d0ea30cc7f4a26736ee82c7d667af70b..5def5f7a23fd63e8b280d5080a73848101f30a04 100644 (file)
@@ -3,8 +3,9 @@
 <p>
 | <a href="/cgi-bin/admin/menu.pl">Admin menu</a> |
 <a href="/cgi-bin/admin/siteusers.pl">Site Members</a> |
-<a href="mailto:<:siteuser email:>">Email</a>
-| <a href="/cgi-bin/admin/siteusers.pl?a_edit=1&amp;id=<:siteuser id:>">Edit User</a> |</p>
+<a href="mailto:<:siteuser email:>">Email</a> |
+<:ifUserCan bse_members_user_edit:><a href="/cgi-bin/admin/siteusers.pl?a_edit=1&amp;id=<:siteuser id:>">Edit User</a> |<:or:><:eif:>
+<a href="/cgi-bin/admin/siteusers.pl?a_view=1&amp;id=<:siteuser id:>">User Details</a> |</p>
 
 <:ifMessage:>
 <p><b><:message:></b></p>
diff --git a/site/templates/admin/users/view.tmpl b/site/templates/admin/users/view.tmpl
new file mode 100644 (file)
index 0000000..20858b0
--- /dev/null
@@ -0,0 +1,267 @@
+<:wrap admin/xbase.tmpl title=>"Edit Site Member":>
+<h1>Edit Site Member</h1>
+<p>
+| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> |
+<a href="/cgi-bin/admin/siteusers.pl">Site Members</a> |
+<a href="mailto:<:siteuser email:>">Email</a>
+<:ifUserorders:>| <a href="/cgi-bin/admin/siteusers.pl?a_edit=1&amp;id=<:siteuser id:>&amp;_t=orders">Orders</a><:or:><:eif:> |
+<a href="/cgi-bin/admin/admin_seminar.pl?a_addattendseminar=1&amp;siteuser_id=<:siteuser id:>">Add to seminar</a> |
+<a href="/cgi-bin/admin/siteusers.pl?a_view=1&amp;id=<:siteuser id:>&amp;_t=bookings">Seminar Bookings</a> |
+<a href="<:script:>?a_edit=1&amp;id=<:siteuser id:>&amp;_t=groups">Groups</a> |
+</p>
+
+<:ifMessage:>
+<p><b><:message:></b></p>
+<:or:><:eif:> 
+
+  <table border="0" cellspacing="0" cellpadding="0" bgcolor="#000000" class="table">
+    <tr> 
+      <td> 
+        <table cellpadding="6" border="0" cellspacing="1">
+<:ifCfg "site users" nopassword:><:or:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Logon: </th>
+            <td bgcolor="#FFFFFF"> 
+             <:siteuser userId:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser userId:></td>
+          </tr>
+<:eif:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Email: </th>
+            <td bgcolor="#FFFFFF"> 
+              <a href="mailto:<:siteuser email:>"><:siteuser email:></a>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser email:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Disabled: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:ifSiteuser disabled:>User disabled<:or:>User enabled<:eif:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser disabled:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">First Name: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser name1:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser name1:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Last Name: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser name2:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser name2:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">address: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser address:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser address:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">city: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser city:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser city:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">state: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser state:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser state:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">postcode: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser postcode:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser postcode:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">telephone: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser telephone:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser telephone:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">mobile: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser delivMobile:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser delivMobile:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">facsimile: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser facsimile:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser facsimile:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">country: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser country:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser country:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">title: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser title:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser title:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">organization: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser organization:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser organization:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billFirstName: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billFirstName:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billFirstName:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billLastName: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billLastName:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billLastName:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billStreet: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billStreet:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billStreet:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billSuburb: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billSuburb:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billSuburb:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billState: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billState:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billState:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billPostCode: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billPostCode:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billPostCode:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billCountry: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billCountry:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billCountry:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">instructions: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser instructions:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser instructions:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billTelephone: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billTelephone:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billTelephone:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billMobile: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billMobile:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billMobile:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billFacsimile: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billFacsimile:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billFacsimile:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billEmail: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser billEmail:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billEmail:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">Affiliate Name: </th>
+            <td bgcolor="#FFFFFF"> 
+              <:siteuser affiliate_name:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser affiliate_name:></td>
+          </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left" valign="top">Admin Notes: </th>
+            <td bgcolor="#FFFFFF"> 
+              <textarea name="adminNotes" wrap="soft" rows="5" cols="60" readonly="readonly"><:siteuser adminNotes:></textarea>
+            </td>
+            <td bgcolor="#FFFFFF" valign="top"><:help editsiteuser adminNotes:></td>
+          </tr>
+<:if Flags:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left" valign="top">Flags: </th>
+            <td bgcolor="#FFFFFF">
+           <:iterator begin flags:>
+           <img src="/images/admin/<:ifFlagSet [flag id]:>checked.gif<:or:>unchecked.gif<:eif:>" /> <:flag desc:>
+           <:iterator separator flags:>
+           <br />
+           <:iterator end flags:>
+            </td>
+            <td bgcolor="#FFFFFF" valign="top"><:help editsiteuser flags:></td>
+          </tr>
+<:or Flags:><:eif Flags:>
+<:if Subscriptions:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left" valign="top">Subscriptions: </th>
+            <td bgcolor="#FFFFFF">
+           <:iterator begin subscriptions:>
+           <img src="/images/admin/<:ifSubscribed:>checked.gif<:or:>unchecked.gif<:eif:>" /> <:subscription name:>
+           <:iterator separator subscriptions:>
+           <br />
+           <:iterator end subscriptions:>
+            </td>
+            <td bgcolor="#FFFFFF" valign="top"><:help editsiteuser subscriptions:></td>
+          </tr>
+<:or Subscriptions:><:eif Subscriptions:>
+<:iterator begin imagetemplates:>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left"> <:imagetemplate description:>: </th>
+            <td bgcolor="#FFFFFF"> 
+              Alt: <:siteuser_image [imagetemplate id] alt:><br />
+       <:ifSiteuser_image [imagetemplate id]:><br /><img src="<:siteuser_image [imagetemplate id] url:>" /><:or:><:eif:>
+              </td>
+            <td bgcolor="#FFFFFF"> <:help editsiteuser images:></td>
+          </tr>
+<:iterator end imagetemplates:>
+<:include admin/users/custom_view.tmpl optional:>
+        </table>
+      </td>
+    </tr>
+  </table>
+</form>
diff --git a/site/templates/admin/users/view_bookings.tmpl b/site/templates/admin/users/view_bookings.tmpl
new file mode 100644 (file)
index 0000000..de11c2c
--- /dev/null
@@ -0,0 +1,33 @@
+<:wrap admin/xbase.tmpl title=>"Site Member Seminar Bookings":>
+<h1>Site Member Seminar Bookings</h1>
+<p>
+| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> |
+<a href="/cgi-bin/admin/siteusers.pl">Site Members</a> |
+<a href="mailto:<:siteuser email:>">Email</a> |
+<:ifUserCan bse_members_user_edit:><a href="/cgi-bin/admin/siteusers.pl?a_edit=1&amp;id=<:siteuser id:>">Edit User</a> |<:or:><:eif:>
+<a href="/cgi-bin/admin/siteusers.pl?a_view=1&amp;id=<:siteuser id:>">User Details</a> |
+<a href="/cgi-bin/admin/siteusers.pl?a_view=1&amp;id=<:siteuser id:>&amp;_t=orders">Orders</a> |</p>
+
+<:ifMessage:>
+<p><b><:message:></b></p>
+<:or:><:eif:> 
+
+      <table border=0 cellpadding="6" cellspacing="1" width="100%">
+        <tr bgcolor="#FFFFFF"> 
+          <th>Id</th>
+          <th width="50%">Seminar</th>
+          <th width="50%">Location</th>
+          <th>Time</th>
+          <th>Date</th>
+        </tr>
+        <:iterator begin bookings:> 
+        <tr bgcolor="#FFFFFF"> 
+          <td align="center" nowrap><a href="/cgi-bin/admin/add.pl?id=<:booking seminar_id:>"><:booking 
+            seminar_id:></a></td>
+          <td><:booking title:></td>
+          <td><a href="/cgi-bin/admin/admin_seminar.pl?a_locview=1&amp;id=<:booking location_id:>"><:booking loc_description:></a></td>
+          <td nowrap="nowrap"><:date "%I:%M %p" booking when_at:></td>
+          <td nowrap="nowrap"><:date booking when_at:></td>
+        </tr>
+        <:iterator end bookings:> 
+      </table>
index 8d8a190c4f44114c98234135800eca8c74528aef..a1ef2ed8b5d2a6833711b0af076ffee392df57a7 100644 (file)
@@ -5,7 +5,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <meta http-equiv="Expires" content="Thu, 01 Jan 1970 00:00:00 GMT">
 <link rel="stylesheet" href="/css/style-main.css">
-<:ifCfg basic ajax:><script type="text/javascript" src="/js/prototype.js"></script><:or:><:eif:>
+<:ajax includes:>
 </head>
 <script>
 var bse_image_popup;
index bc31a6e3acc93f5787c9b6b1b6eb0e8d7848ae06..62b0467858a2849a7427e1a0ff23ff0d1448fa03 100644 (file)
@@ -48,7 +48,7 @@
       <td><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><input type="checkbox" name="match_all" value="1" <:ifCgi match_all:>checked="checked"<:or:><:eif:> /><b> Match all terms</b></font></td>
     </tr>
   </table>
-<:ifCfg basic ajax:>
+<:if Ajax:>
 <script>
 new Form.Element.Observer($('q'), 1.5, 
    function(term) {
@@ -69,7 +69,7 @@ new Form.Element.Observer($('q'), 1.5,
        });
    });
 </script>
-<:or:><:eif:>
+<:or Ajax:><:eif Ajax:>
 </form>
 <div id="results">
 <:include include/search_results.tmpl:>
index 3637ec55042acd393814e882a3acc8581206f77e..ca091d6188942833eef6bc4ef9048d7e13a47413 100644 (file)
--- a/test.cfg
+++ b/test.cfg
@@ -231,3 +231,6 @@ search highlight.body_prefix=<i>
 search highlight.body_suffix=</i>
 search highlight.title_prefix=<i>
 search highlight.title_suffix=</i>
+valid child types.Article=Article,Seminar
+
+shop product options.book_flight=Flight Booking;Book a flight;Don't book a flight