0.15_01 commit r0_15_01
authorTony Cook <tony@develop-help.com>
Mon, 8 Nov 2004 00:22:24 +0000 (00:22 +0000)
committertony <tony@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Mon, 8 Nov 2004 00:22:24 +0000 (00:22 +0000)
24 files changed:
Makefile
schema/bse.sql
site/cgi-bin/modules/BSE/AdminSiteUsers.pm
site/cgi-bin/modules/BSE/DB/Mysql.pm
site/cgi-bin/modules/BSE/TB/Order.pm
site/cgi-bin/modules/BSE/UserReg.pm
site/cgi-bin/modules/BSE/Util/Tags.pm
site/cgi-bin/modules/DevHelp/Formatter.pm
site/cgi-bin/modules/Generate.pm
site/cgi-bin/modules/Generate/Article.pm
site/cgi-bin/modules/SiteUser.pm
site/docs/bse.pod
site/templates/admin/order_detail.tmpl
site/templates/admin/users/add.tmpl
site/templates/admin/users/edit.tmpl
site/templates/checkout_base.tmpl
site/templates/mailconfirm.tmpl
site/templates/mailorder.tmpl
site/templates/user/options_base.tmpl
site/templates/user/options_billing_base.tmpl
site/templates/user/register_base.tmpl
t/t050format.t
t/t080escape.t
t/t20gen.t

index 5175bec4374edad5ef0b1c1e162fda1ac48a5baf..ee8fffddc64e1f8b90a6c7b689e1939ad938f04d 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.15
+VERSION=0.15_01
 DISTNAME=bse-$(VERSION)
 DISTBUILD=$(DISTNAME)
 DISTTAR=../$(DISTNAME).tar
index 4ce687751048f06d5832ce0db8f76ea1ff705497..38239342697adc4271fdeb86e6ee755d27bc446e 100644 (file)
@@ -242,6 +242,9 @@ create table orders (
 
   shipping_cost integer not null default 0,
 
+  delivMobile varchar(80) not null default '',
+  billMobile varchar(80) not null default '',
+
   primary key (id),
   index order_cchash(ccNumberHash),
   index order_userId(userId, orderDate)
@@ -496,6 +499,9 @@ create table site_users (
 
   affiliate_name varchar(40) not null default '',
 
+  delivMobile varchar(80) not null default '',
+  billMobile varchar(80) not null default '',
+
   primary key (id),
   unique (userId),
   index (affiliate_name)
index 2547c51e0b04451e70317274e7f78727c5b4319c..6f2eecff2286a250697954d0e263d23db813ccc4 100644 (file)
@@ -588,7 +588,7 @@ sub req_add {
       $r = $req->url('siteusers', { list => 1, 
                                    'm' => "User $user->{userId} added" });
     }
-    $r .= "&m=".escape_url($msg) if $msg;
+    $r .= "&m=".escape_uri($msg) if $msg;
     return BSE::Template->get_refresh($r, $cfg);
   }
   else {
index d434ba41ac895471dd7fc455d60b5160fbdb990d..45f9ed1343f6e8a8dc256cdeb2feff8125925eba 100644 (file)
@@ -84,8 +84,8 @@ SQL
    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 = ?',
 
@@ -128,8 +128,8 @@ SQL
    'select * from site_users where id = ?',
    getSiteUserByAffiliate_name =>
    'select * from site_users where affiliate_name = ?',
-   addSiteUser => 'insert site_users values(null,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
-   replaceSiteUser => 'replace site_users values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+   addSiteUser => 'insert site_users values(null,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+   replaceSiteUser => 'replace site_users values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    'SiteUsers.removeSubscriptions'=>
    'delete from subscribed_users where userId = ?',
    'SiteUsers.removeSub'=>
index bc66a226524e94985232e1390941d04313fa953b..0bdfcb8f40e3a6f9aca8b110c3eb7ec49403e828 100644 (file)
@@ -19,7 +19,8 @@ sub columns {
            customInt1 customInt2 customInt3 customInt4 customInt5
            customStr1 customStr2 customStr3 customStr4 customStr5
            instructions billTelephone billFacsimile billEmail
-           siteuser_id affiliate_code shipping_cost/;
+           siteuser_id affiliate_code shipping_cost
+           delivMobile billMobile/;
 }
 
 =item siteuser
index aa83b440ce7ec7a7db98c3f49706829457ed521b..52376f77690490df225b834e4e32741f16aa8e58 100644 (file)
@@ -44,7 +44,7 @@ sub user_tags {
         return $user;
        }
      },
-     user => sub { $user && CGI::escapeHTML($user->{$_[0]}) },
+     user => $user ? [ \&tag_hash, $user ] : '',
     );
 }
 
index e1fd52240eb70e7eb65cbe3ecfee24b264395105..eae92d31ac1c926b897a1ac033a56bb96033f26d 100644 (file)
@@ -258,6 +258,7 @@ sub static {
      },
      adminbase => [ \&tag_adminbase, $cfg ],
      help => [ \&tag_help, $cfg, 'user' ],
+     $it->make_iterator(\&DevHelp::Tags::iter_get_repeat, 'strepeat', 'strepeats'),
      
      _format => 
      sub {
@@ -315,6 +316,9 @@ sub tag_arithmetic {
   elsif ($prefix eq 'r') {
     $result = sprintf("%.0f", $result);
   }
+  elsif ($prefix =~ /^d(\d+)$/) {
+    $result = sprintf("%.*f", $1, $result);
+  }
 
   return escape_html($result);
 }
index 20fd685d907464c8661643d34d69292772580001..57ce380017c9651e7a69d6a18a064b982450e16b 100644 (file)
@@ -109,6 +109,30 @@ sub _format_ol {
   return "$ol<li>".join("</li><li>", @points)."</li></ol>";
 }
 
+sub _format_lists {
+  my ($text) = @_;
+
+  my $out = '';
+
+  while (length $text) {
+    if ($text =~ s!^((?: *\#\#[^\n]+(?:\n|$)\n?[^\S\n]*)+)\n?!!) {
+      $out .= _format_ol($1);
+    }
+    elsif ($text =~ s#^((?: *\*\*[^\n]+(?:\n|$)\n?[^\S\n]*)+)\n?##) {
+      $out .= _format_bullets($1);
+    }
+    elsif ($text =~ s!^((?: *%%[^\n]+(?:\n|$)\n?[^\S\n]*)+)\n?!!) {
+      $out .= _format_ol($1, 'a', '%%');
+    }
+    else {
+      $out .= $text;
+      $text = '';
+    }
+  }
+
+  return $out;
+}
+
 # raw html - this has some limitations
 # the input text has already been escaped, so we need to unescape it
 # too bad if you want [] in your html (but you can use entities)
@@ -209,11 +233,7 @@ sub format {
          and next TRY;
        $part =~ s#table\[([^\]\[]+)\|([^\]\[|]+)\]#_make_table($1, "|$2")#ieg
          and next TRY;
-       $part =~ s#(?:^|\n{1,2})((?: *\*\*[^\n]+(?:\n|$)\n?[^\S\n]*)+)\n?#_format_bullets($1)#eg
-         and next TRY;
-       $part =~ s!(?:^|\n{1,2})((?: *##[^\n]+(?:\n|$)\n?[^\S\n]*)+)\n?!_format_ol($1)!eg
-         and next TRY;
-       $part =~ s!(?:^|\n{1,2})((?: *%%[^\n]+(?:\n|$)\n?[^\S\n]*)+)\n?!_format_ol($1, 'a', '%%')!eg
+       $part =~ s#(?:^|\n{1,2})((?: *(?:\*\*|\#\#|\%\%)[^\n]+(?:\n|$)\n?[^\S\n]*)+)\n?#_format_lists($1)#eg
          and next TRY;
        $part =~ s#indent\[([^\]\[]+)\]#<ul>$1</ul>#ig
          and next TRY;
@@ -252,7 +272,8 @@ sub remove_format {
 
   my $out = '';
   for my $part (split /((?:html\[(?:[^\[\]]*(?:(?:\[[^\[\]]*\])[^\[\]]*)*)\])
-                       |embed\[(?:[^,\[\]]*)(?:,(?:[^,\[\]]*)){0,2}\])/ix, $body) {
+                       |embed\[(?:[^,\[\]]*)(?:,(?:[^,\[\]]*)){0,2}\]
+                        |pre\[(?:[^\[\]]*(?:(?:\[[^\[\]]*\])[^\[\]]*)*)\])/ix, $body) {
     #print STDERR "Part is $part\n";
     if ($part =~ /^html\[([^\[\]]*(?:(?:\[[^\[\]]*\])[^\[\]]*)*)\]$/i) {
       $out .= _strip_html($1);
@@ -263,6 +284,10 @@ sub remove_format {
     elsif ($part =~ /^embed\[([^,\[\]]*)\]$/i) {
       $out .= "";
     }
+    elsif ($part =~ /^pre\[([^\[\]]*(?:(?:\[[^\[\]]*\])[^\[\]]*)*)\]$/i) {
+      my $work = $1;
+      $out .= $self->remove_format($work);
+    }
     else {
     TRY: while (1) {
        $self->remove(\$part)
@@ -279,7 +304,9 @@ sub remove_format {
          and next TRY;
        $part =~ s#link\[([^|\]\[]+)\]#$1#ig
          and next TRY;
-       $part =~ s#([bi])\[([^\]\[]+)\]#$2#ig
+       $part =~ s#[bi]\[([^\]\[]+)\]#$1#ig
+         and next TRY;
+       $part =~ s#tt\[([^\]\[]+)\]#$1#ig
          and next TRY;
        $part =~ s#align\[([^|\]\[]+)\|([^\]\[]+)\]#$2#ig
          and next TRY;
index a4a155fb387202aad266e10d1fac93a3e1d097de..c8d45e4e5f7111a3d83182a24940908a674f237f 100644 (file)
@@ -583,6 +583,8 @@ sub excerpt {
   $self->remove_block('Articles', [], \$body);
   1 while $body =~ s/[bi]\[([^\]\[]+)\]/$1/g;
 
+  $body = escape_html($body);
+
   my @found = find_terms(\$body, $case_sensitive, @terms);
 
   my @reterms = @terms;
index bf3b2342c4edf9ab55b9edfeac5d5f6763ff8247..26eb2200fe2f4235c3c899a310ab725175ec5ad2 100644 (file)
@@ -269,7 +269,7 @@ sub baseActs {
            .'" width="'.$acts->{$which}->('thumbWidth')
              .'" height="'.$acts->{$which}->('thumbHeight').'"';
          $result .= qq! class="$class"! if $class;
-         $result .= ' border="0" />';
+         $result .= ' border="0" alt="" />';
          return $result;
        }
        else {
index 35ceb689dd9f5929f16c838bc633d20bf6f50663..04508a6f33980df588d21dddd2ea3bb79545e531 100644 (file)
@@ -21,7 +21,7 @@ sub columns {
             billEmail adminNotes disabled flags
             customText1 customText2 customText3
             customStr1 customStr2 customStr3
-            affiliate_name/;
+            affiliate_name delivMobile billMobile/;
 }
 
 sub valid_fields {
@@ -43,6 +43,8 @@ sub valid_fields {
      title => { description=>'Title', rules=>"dh_one_line", maxlen=>127  },
      organization => { description=>'Organization', rules=>"dh_one_line", 
                       maxlen=>127  },
+     delivMobile => { description => "Mobile", rules=>"phone",
+                     maxlen => 80 },
      textOnlyEmail => { description => "Text Only Email", type=>"boolean" },
      referral => { description=>'Referral', rules=>"natural"  },
      otherReferral => { description=>'Other Referral', rules=>"dh_one_line",
@@ -73,6 +75,8 @@ sub valid_fields {
                        maxlen=>80 },
      billEmail => { description => "Billing Email", rules=>"email", 
                    maxlen=>255 },
+     billMobile => { description => "Billing Mobile", rules=>"phone",
+                    maxlen => 80 },
      customText1 => { description => "Custom Text 1" },
      customText2 => { description => "Custom Text 2" },
      customText3 => { description => "Custom Text 3" },
index 258d7137cd69b12204798cd7a43d86fbe86eee77..b53bbeee4fc7d99f295b82aba03882ebcd851c38 100644 (file)
@@ -10,6 +10,69 @@ Maybe I'll add some other bits here.
 
 =head1 CHANGES
 
+=head2 0.15_01
+
+=over
+
+=item *
+
+formatted lists where there was no other text between the lists would
+produce mis-formatted lists.
+
+=item *
+
+the tt[] and pre[] tags were not removed from search result except
+text. (#460)
+
+=item *
+
+creating a new user with subscriptions enabled could sometimes cause a
+500 server error.  This was due to calling escape_url() instead of
+escape_uri().  Thanks to Piers Johnson from Might Media for reporting
+and patching this.
+
+=item *
+
+added the billMobile and delivMobile fields to the orders and site
+users tables
+
+=item *
+
+the user tag in user.pl could sometimes produce undefined value
+warnings in the error log.
+
+=item *
+
+search excerpt text is now correctly HTML escaped
+
+=item *
+
+added the strepeats iterator for use on all pages (resolved on the
+first build when pre-building templates for dynamic pages)
+
+=item *
+
+added the dI<digits> prefix to the arithmetic tag, which rounds the
+result, so for example:
+
+  <:arithmetic d2:1.234:>
+
+results in:
+
+  1.23
+
+=item *
+
+C<img> elements produced by the thumbnail tag now include an empty alt
+parameter.
+
+=item *
+
+the tt[...] tag is now removed from body text in those cases where
+we're removing other tags
+
+=back
+
 =head2 0.15
 
 No changes since 0.14_37, no issues reported with 0.14_37.
index 1d77627d4632164c83e6c442f4e6ea9cdfb427e4..c6df8d46beca422ae2dda87c10f3b49c91f2b9f0 100644 (file)
     <td>&nbsp;</td>
     <td align="left"><b>Phone:</b></td>
     <td><:order telephone:></td>
-    <!--<td rowspan=3>&nbsp;&nbsp;</td>-->
   </tr>
   <tr> 
     <td align="left"><b>Date:</b></td>
     <td><:date order orderDate:></td>
+    <td>&nbsp;</td>
+    <td align="left"><b>Mobile:</b></td>
+    <td><:order delivMobile:></td>
   </tr>
   <tr> 
     <td align="left"><b>Delivery:</b></td>
index 4813b812dce79ded5dc2e6e47bed1a2a9143868f..69639dc37f7060fe3764a439bc7e5620fea6d0bb 100644 (file)
             </td>
             <td bgcolor="#FFFFFF"><:help editsiteuser telephone:>  <:error_img telephone:></td>
           </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">mobile: </th>
+            <td bgcolor="#FFFFFF"> 
+              <input type="text" name="delivMobile" value="<:old delivMobile:>" /><:ifRequired delivMobile:>*<:or:><:eif:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser delivMobile:>  <:error_img delivMobile:></td>
+          </tr>
           <tr> 
             <th bgcolor="#FFFFFF" align="left">facsimile: </th>
             <td bgcolor="#FFFFFF"> 
             </td>
             <td bgcolor="#FFFFFF"><:help editsiteuser billTelephone:>  <:error_img billTelephone:></td>
           </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billMobile: </th>
+            <td bgcolor="#FFFFFF"> 
+              <input type="text" name="billMobile" value="<:old billMobile:>" /><:ifRequired billMobile:>*<:or:><:eif:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billMobile:>  <:error_img billMobile:></td>
+          </tr>
           <tr> 
             <th bgcolor="#FFFFFF" align="left">billFacsimile: </th>
             <td bgcolor="#FFFFFF"> 
index 0e840a41548bd0194cbebf81b92fc53dbf629d19..a7506134a6b02cedcaff62b1a8972cc336c63a54 100644 (file)
             </td>
             <td bgcolor="#FFFFFF"><:help editsiteuser telephone:>  <:error_img telephone:></td>
           </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">mobile: </th>
+            <td bgcolor="#FFFFFF"> 
+              <input type="text" name="delivMobile" value="<:old delivMobile siteuser delivMobile:>" /><:ifRequired delivMobile:>*<:or:><:eif:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser delivMobile:>  <:error_img delivMobile:></td>
+          </tr>
           <tr> 
             <th bgcolor="#FFFFFF" align="left">facsimile: </th>
             <td bgcolor="#FFFFFF"> 
             </td>
             <td bgcolor="#FFFFFF"><:help editsiteuser billTelephone:>  <:error_img billTelephone:></td>
           </tr>
+          <tr> 
+            <th bgcolor="#FFFFFF" align="left">billMobile: </th>
+            <td bgcolor="#FFFFFF"> 
+              <input type="text" name="billMobile" value="<:old billMobile siteuser billMobile:>" /><:ifRequired billMobile:>*<:or:><:eif:>
+            </td>
+            <td bgcolor="#FFFFFF"><:help editsiteuser billMobile:>  <:error_img billMobile:></td>
+          </tr>
           <tr> 
             <th bgcolor="#FFFFFF" align="left">billFacsimile: </th>
             <td bgcolor="#FFFFFF"> 
index 07fbbedbfbf29bd174051f1375caf8ed32798f8d..cecf8848515a1f3170cb1fbb904bb29e844228f6 100644 (file)
@@ -198,6 +198,12 @@ function BSE_validateForm {
         <input type="Text" name="telephone" size=20 value="<:old telephone:>">
         *</font></td>
     </tr>
+    <tr> 
+      <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> Mobile:</font></td>
+      <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 
+        <input type="Text" name="delivMobile" size=20 value="<:old delivMobile:>">
+        </font></td>
+    </tr>
     <tr> 
       <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> Facsimile:</font></td>
       <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 
@@ -281,6 +287,12 @@ function BSE_validateForm {
         <input type="Text" name="billTelephone" size=20 value="<:old billTelephone:>">
         *</font></td>
     </tr>
+    <tr> 
+      <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> Mobile:</font></td>
+      <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 
+        <input type="Text" name="billMobile" size=20 value="<:old billMobile:>">
+        </font></td>
+    </tr>
     <tr> 
       <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> Facsimile:</font></td>
       <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 
index c3011dcb3d146f553551ea0dd5b5d79f92700029..12e0e66989aaafb5d92c8faedafe6e2f1580bbef 100644 (file)
@@ -8,7 +8,8 @@ Delivery: <:order delivFirstName :> <:order delivLastName :>
           <:order delivCountry:>
 
 Phone   : <:order telephone:>
-Fax     : <:order facsimile:>
+<:ifOrder delivMobile:>Mobile  : <:order delivMobile:>
+<:or:><:eif:>Fax     : <:order facsimile:>
 Email   : <:order emailAddress:>
 
 Product                                   Units  Price   Extended
index 521a000429d4012e51d28b0aa8f79bee8f8fd861..f9c9a725daa71cd2f4d2129ea0f6579168fd13da 100644 (file)
@@ -8,7 +8,8 @@ Delivery: <:order delivFirstName :> <:order delivLastName :>
           <:order delivCountry:>
 
 Phone   : <:order telephone:>
-Fax     : <:order facsimile:>
+<:ifOrder delivMobile:>Mobile  : <:order delivMobile:>
+<:or:><:eif:>Fax     : <:order facsimile:>
 Email   : <:order emailAddress:>
 
 Product                                   Units  Price   Extended
index fb0cc938007c0962c7e886ef5aa0ed496cba61e8..e9f4622735b8ee9d224dfa19bb8f16cbdc6ce1fb 100644 (file)
           <input type="text" name="telephone" value="<:last telephone:>" size="32" maxlength="80" /><:error_img telephone:>
         </td>
       </tr>
+      <tr> 
+        <th nowrap="nowrap" align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Mobile:</font></b></th>
+        <td width="100%" nowrap="nowrap"> 
+          <input type="text" name="delivMobile" value="<:last delivMobile:>" size="32" maxlength="80" /><:error_img delivMobile:>
+        </td>
+      </tr>
       <tr> 
         <th nowrap="nowrap" align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Facsimile:</font></b></th>
         <td width="100%" nowrap="nowrap"> 
           <input type="text" name="billTelephone" value="<:last billTelephone:>" size="40" maxlength="127" /><:error_img billTelephone:>
         </td>
       </tr>
+      <tr> 
+        <th>Mobile:</th>
+        <td width="100%" nowrap="nowrap"> 
+          <input type="text" name="billMobile" value="<:last billMobile:>" size="40" maxlength="80" /><:error_img billMobile:>
+        </td>
+      </tr>
       <tr> 
         <th>Facsimile:</th>
         <td width="100%" nowrap="nowrap"> 
index e28b3332060e5846a6e6e4eb8b251afda39a75b4..efe0568380155272c75b7ae87a30f087fafa03bd 100644 (file)
           <input type="text" name="billTelephone" value="<:last billTelephone:>" size="40" maxlength="127" /><:error_img billTelephone:>
         </td>
       </tr>
+      <tr> 
+        <th>Mobile:</th>
+        <td width="100%" nowrap="nowrap"> 
+          <input type="text" name="billMobile" value="<:last billMobile:>" size="40" maxlength="127" /><:error_img billMobile:>
+        </td>
+      </tr>
       <tr> 
         <th>Facsimile:</th>
         <td width="100%" nowrap="nowrap"> 
index 0338ee4c5e9de8cdd0d709ad45a172910f5a4b37..0b8e8103d2a0575eeaf46e548e66682fe5bb047f 100644 (file)
           <input type="text" name="telephone" value="<:old telephone:>" size="32" maxlength="80" /> <:error_img telephone:><:ifRequired telephone:><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">*</font><:or:><:eif:>
         </td>
       </tr>
+      <tr> 
+        <th nowrap align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Mobile:</font></b></th>
+        <td width="100%" nowrap="nowrap"> 
+          <input type="text" name="delivMobile" value="<:old delivMobile:>" size="32" maxlength="80" /> <:error_img delivMobile:><:ifRequired delivMobile:><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">*</font><:or:><:eif:>
+        </td>
+      </tr>
       <tr> 
         <th nowrap align="left"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Facsimile:</font></b></th>
         <td width="100%" nowrap="nowrap"> 
index 5a2309ff96fdfb02aabaa1584d5bbc7627b466b0..e1271c22332f2eb6bb8e8bbdd2b9b4513756adea 100644 (file)
@@ -1,6 +1,6 @@
 #!perl -w
 use strict;
-use Test::More tests => 42;
+use Test::More tests => 43;
 
 sub format_test($$$;$);
 
@@ -158,6 +158,15 @@ this shouldn't be a bullet ** some text
 ** so should this
 IN
 this shouldn't be a bullet ** some text<ul><li>this should be a bullet</li><li>so should this</li></ul>
+OUT
+
+  format_test <<IN, <<OUT, 'mixed', 'both';
+** joe
+** bob
+## one
+## two
+IN
+<ul><li>joe</li><li>bob</li></ul><ol><li>one</li><li>two</li></ol>
 OUT
 
   format_test 'indent[text]', '<ul>text</ul>', 'indent';
index 55288bea51eaeb1b407e5611cdc3c490b2f3cd87..88332793f4b044b290cb0198848c920b68e0c402 100644 (file)
@@ -9,5 +9,5 @@ SKIP: {
 
   DevHelp::HTML->import('escape_xml');
 
-  is(escape_xml("<&\xE9"), '&lt;&amp;&#233;', "don't escape like html");
+  is(escape_xml("<&\xE9"), "&lt;&amp;\xE9", "don't escape like html");
 }
index 82f308139c213a95daccdb1c54db2f513af3b83b..4497803a70c8d8a9f38087e513a331f11a45ff33 100644 (file)
@@ -1,7 +1,7 @@
 #!perl -w
 use strict;
 use BSE::Test ();
-use Test::More tests=>58;
+use Test::More tests=>64;
 use File::Spec;
 use FindBin;
 my $cgidir = File::Spec->catdir(BSE::Test::base_dir, 'cgi-bin');
@@ -171,10 +171,12 @@ EXPECTED
 template_test "arithmetic", $top, <<'TEMPLATE', <<EXPECTED;
 <:arithmetic 2+2:>
 <:arithmetic 2+[add 1 1]:>
+<:arithmetic d2:1.234+1.542:>
 <:arithmetic 2+[add 1 2]+[undefinedtag x]+[add 1 1]+[undefinedtag2]:>
 TEMPLATE
 4
 4
+2.78
 <:arithmetic 2+3+[undefinedtag x]+2+[undefinedtag2]:>
 EXPECTED
 
@@ -190,6 +192,26 @@ TEMPLATE
 Thu 23/09/2004
 EXPECTED
 
+template_test "strepeats", $parent, <<'TEMPLATE', <<EXPECTED;
+<:iterator begin strepeats [arithmetic 1+1]:><:strepeat index:> <:strepeat value:>
+<:iterator end strepeats:>
+TEMPLATE
+0 1
+1 2
+
+EXPECTED
+
+template_test "strepeats2", $parent, <<'TEMPLATE', <<EXPECTED;
+<:iterator begin strepeats [arithmetic 1+1] 5:><:strepeat index:> <:strepeat value:>
+<:iterator end strepeats:>
+TEMPLATE
+0 2
+1 3
+2 4
+3 5
+
+EXPECTED
+
 BSE::Admin::StepParents->del($parent, $parent);
 for my $kid (reverse @kids) {
   my $name = $kid->{title};