]> git.imager.perl.org - bse.git/commitdiff
0.15_13 commit
authorTony Cook <tony@develop-help.com>
Wed, 15 Jun 2005 13:11:36 +0000 (13:11 +0000)
committertony <tony@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Wed, 15 Jun 2005 13:11:36 +0000 (13:11 +0000)
14 files changed:
Makefile
schema/bse.sql
site/cgi-bin/modules/Article.pm
site/cgi-bin/modules/BSE/DB/Mysql.pm
site/cgi-bin/modules/BSE/Edit/Article.pm
site/docs/.cvsignore
site/docs/bse.pod
site/htdocs/admin/help/edit.html
site/templates/admin/edit_1.tmpl
site/templates/admin/edit_catalog.tmpl
site/templates/admin/edit_product.tmpl
site/templates/admin/edit_seminar.tmpl
site/templates/base.tmpl
site/util/initial.pl

index a37e40375c53b58fd2d6ef336b762122d3fbb601..d38c5fe0ed0fa107a458f9a1601498765b4af80b 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.15_12
+VERSION=0.15_13
 DISTNAME=bse-$(VERSION)
 DISTBUILD=$(DISTNAME)
 DISTTAR=../$(DISTNAME).tar
index 1cfb97e22e638ca6fe78959ae4a5c74628f49dc5..0a03880d41b2926f8998551836e6a099dfc1f99d 100644 (file)
@@ -73,6 +73,13 @@ CREATE TABLE article (
   customInt3 integer null,
   customInt4 integer null,
 
+  -- added by adrian
+  lastModifiedBy varchar(60) default '' not null,
+  created datetime default '0000-00-00 00:00:00' not null,
+  createdBy varchar(60) default '' not null,
+  author varchar(255) default '' not null,
+  pageTitle varchar(255) default '' not null,
+
   PRIMARY KEY (id),
 
   -- if we keep id in the indexes MySQL will sometimes be able to
index 7b1c7630c27fa14a8e2485942f98edd9d3341708..d0dc4bf5fa7bf227d225b2991336fa3716b01866 100644 (file)
@@ -11,7 +11,8 @@ sub columns {
     release expire keyword template link admin threshold
     summaryLength generator level listed lastModified flags
     customDate1 customDate2 customStr1 customStr2
-    customInt1 customInt2 customInt3 customInt4/;
+    customInt1 customInt2 customInt3 customInt4 
+    lastModifiedBy created createdBy author pageTitle/;
 }
 
 sub numeric {
index a6693b761fe1c71c8e216a8c47a719637866f80a..9724b1b0ffcbe80e8b9cda37c6770db86672cced 100644 (file)
@@ -18,9 +18,9 @@ my %statements =
   (
    Articles => 'select * from article',
    replaceArticle =>
-     'replace article values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+     'replace article values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    addArticle =>  
-     'insert article values (null, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+     'insert article values (null, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    deleteArticle => 'delete from article where id = ?',
    getArticleByPkey => 'select * from article where id = ?',
    
index ef90b32fe2b4c5298ef638653bfd661315cbac85..c5b5c4d72f9e399e381cab50b042683f14270800 100644 (file)
@@ -1256,6 +1256,13 @@ sub validate {
   custom_class($self->{cfg})
     ->article_validate($data, undef, $self->typename, $errors);
 
+  if (!defined $data->{parentid} || $data->{parentid} eq '') {
+    $errors->{parentid} = "Please select a parent";
+  }
+  elsif ($data->{parentid} !~ /^(?:-1|\d+)$/) {
+    $errors->{parentid} = "Invalid parent selection (template bug)";
+  }
+
   return !keys %$errors;
 }
 
@@ -1378,6 +1385,13 @@ sub save_new {
   $data{lastModified} = now_sqldatetime();
   $data{listed} = 1 unless defined $data{listed};
 
+# Added by adrian
+  $data{pageTitle} = '' unless defined $data{pageTitle};
+  my $user = $req->getuser;
+  $data{createdBy} = $user ? $user->{logon} : '';
+  $data{lastModifiedBy} = $user ? $user->{logon} : '';
+  $data{created} =  now_sqldatetime();
+
   $self->fill_new_data($req, \%data, $articles);
   for my $col (qw(titleImage imagePos template keyword)) {
     defined $data{$col} 
@@ -1527,6 +1541,10 @@ sub save {
     $article->setLink($article_uri);
   }
 
+# Added by adrian
+  my $user = $req->getuser;
+  $article->{lastModifiedBy} = $user ? $user->{logon} : '';
+
   $article->save();
 
   use Util 'generate_article';
@@ -1976,11 +1994,11 @@ sub save_image_changes {
       if ($name ne '') {
        if ($name =~ /^[a-z_]\w*$/i) {
          if ($used{lc $name}++) {
-           $errors{"name$index"} = 'Names must be empty, or alphanumeric and unique to the article';
+           $errors{"name$index"} = 'Image name must be empty or alphanumeric and unique to the article';
          }
        }
        else {
-         $errors{"name$index"} = 'Image identifiers must be unique to the article';
+         $errors{"name$index"} = 'Image name must be unique to the article';
        }
       }
       unless ($errors{"name$index"}) {
@@ -2028,13 +2046,13 @@ sub add_image {
       my @images = $self->get_images($article);
       for my $img (@images) {
        if (defined $img->{name} && lc $img->{name} eq lc $imageref) {
-         $errors{name} = 'Duplicate image name';
+         $errors{name} = 'Image name must be unique to the article';
          last;
        }
       }
     }
     else {
-      $errors{name} = 'Name must be empty or alphanumeric';
+      $errors{name} = 'Image name must be empty or alphanumeric beginning with an alpha character';
     }
   }
   else {
index 79dd32b973dec7315a8239baef5d265111e2e0e0..a666280733c451e433170e95825a8471bd5b5728 100644 (file)
@@ -22,3 +22,5 @@ affiliate.html
 future_plans.html
 thumbnails.html
 formmail.html
+pod2htmd.tmp
+pod2htmi.tmp
index b8e72bd1affef1829accf72dfae0e7ec34ef4df3..ebbf57bb412ece855e7c3f5b5f341f80478d6ca5 100644 (file)
@@ -60,7 +60,31 @@ body text.
 =item *
 
 t/t40images.t now uses the links() method instead of the internal
-extract_links() method.
+extract_links() method.  (this is part of the test suite and doesn't
+have an effect on most users)
+
+=item *
+
+articles now store their creation date, the user who created them the
+user who last modified them. (implemented by Adrian Oldham)
+
+=item *
+
+articles now have author and pageTitle attributes.  The pageTitle
+attribute overrides the value of the title field in the HTML header
+title tag.  Currently these are not indexed or searched by the search
+engine. (implemented by Adrian Oldham)
+
+=item *
+
+error messages for invalid image identifiers have been changed
+(implemented by Adrian Oldham)
+
+=item *
+
+previously the parentid wasn't being properly validated when adding a
+new article, possible causing a 500 error.  We validate the value and
+report an error on invalid values now.
 
 =back
 
index 58b08b3f130a8077c46d9d2b086e1712b4efdbae..f6710c24bcd7029832300aa15644a8fb87fbabf3 100644 (file)
@@ -48,6 +48,21 @@ text. (The &#145;body&#146; is indexed by the built-in search engine).</p>
 
 </div>
 
+<div>
+  <h2><a name="pageTitle"></a>Page Title</h2>
+
+<p>Alternate page title.  If this is set it is used for the page's
+<b>&lt;title&gt;</b> tag.</p>
+
+</div>
+
+<div>
+  <h2><a name="author"></a>Author</h2>
+
+<p>Author of the content.</p>
+
+</div>
+
 <div>
   <h2><a name="release"></a>Release date</h2>
 
index db3df38da2731219b49d7f9248b98e84c6d7e10e..e1daad5cc4050e4d0cce68462fab87c98b82d189 100644 (file)
               <:eif:> /><:or FieldPerm:><:ifFlagSet [flag id]:>Yes<:or:>No<:eif:>
               <:eif FieldPerm:><:flag desc:><:iterator separator flags:><br /><:iterator end flags:></td>
             <td nowrap="nowrap" bgcolor="#FFFFFF"><:help edit flags:> <:error_img flags:></td>
+          </tr>
+          <tr>
+            <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Page title:</th>
+            <td width="100%" bgcolor="#FFFFFF">
+              <:ifFieldPerm pageTitle:><input type="text" name="pageTitle" value='<:old pageTitle article pageTitle:>' size="60" maxlength="255" tabindex="7" /> (alternate title)<:or:><:article pageTitle:><:eif:>
+            </td>
+           <td nowrap="nowrap" bgcolor="#FFFFFF"><:help edit pageTitle:> <:error_img pageTitle:></td>
+          </tr>
+          <tr>
+            <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Author name:</th>
+            <td width="100%" bgcolor="#FFFFFF" >
+              <:if FieldPerm author:><input type="text" name="author" value='<:ifCfg editor auto_author:><:old author adminuser name:><:or:><:old author:><:eif:>' size="40" maxlength="255" tabindex="7" /><:or FieldPerm:><:article author:><:eif FieldPerm:>
+            </td>
+            <td nowrap="nowrap" bgcolor="#FFFFFF" ><:help edit author:> <:error_img author:></td>
           </tr>
                  <tr> 
             <th nowrap="nowrap" bgcolor="#FFFFFF" align="left">Release date:</th>
index 9e18bdc8dddc9dc1bc15414f831ed524a75e70f1..c10a8fcf4b38f8eeebcff1c37f88e9b9e5f518a1 100644 (file)
               <:eif FieldPerm:><:flag desc:><:iterator separator flags:><br /><:iterator end flags:></td>
             <td nowrap bgcolor="#FFFFFF"><:help edit flags:> <:error_img flags:></td>
           </tr>
+          <tr>
+            <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Page title:</th>
+            <td width="100%" bgcolor="#FFFFFF">
+              <:ifFieldPerm pageTitle:><input type="text" name="pageTitle" value='<:old pageTitle article pageTitle:>' size="60" maxlength="255" tabindex="7" /> (alternate title)<:or:><:article pageTitle:><:eif:>
+            </td>
+           <td nowrap="nowrap" bgcolor="#FFFFFF"><:help edit pageTitle:> <:error_img pageTitle:></td>
+          </tr>
+          <tr>
+            <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Author name:</th>
+            <td width="100%" bgcolor="#FFFFFF" >
+              <:ifFieldPerm author:><input type="text" name="author" value='<:ifCfg editor auto_author:><:old author adminuser name:><:or:><:old author:><:eif:>' size="40" maxlength="255" tabindex="7" /><:or:><:article author:><:eif:>
+            </td>
+            <td nowrap="nowrap" bgcolor="#FFFFFF" ><:help edit author:> <:error_img author:></td>
+          </tr>
           <tr> 
             <th bgcolor="#FFFFFF" nowrap align="left"> Release date: </th>
             <td bgcolor="#FFFFFF" width="100%"> 
index 27c4f4bbcf72859f8fe3fd563dd838bf6dffb3fc..a328a9663200ce1293c85757de788ffb70962b14 100644 (file)
               <:eif FieldPerm:><:flag desc:><:iterator separator flags:><br /><:iterator end flags:></td>
             <td bgcolor="#FFFFFF"><:help edit flags:> <:error_img flags:></td>
           </tr>
+          <tr>
+            <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Page title:</th>
+            <td width="100%" bgcolor="#FFFFFF">
+              <:ifFieldPerm pageTitle:><input type="text" name="pageTitle" value='<:old pageTitle article pageTitle:>' size="60" maxlength="255" tabindex="7" /> (alternate title)<:or:><:article pageTitle:><:eif:>
+            </td>
+           <td nowrap="nowrap" bgcolor="#FFFFFF"><:help edit pageTitle:> <:error_img pageTitle:></td>
+          </tr>
+          <tr>
+            <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Author name:</th>
+            <td width="100%" bgcolor="#FFFFFF" >
+              <:if FieldPerm author:><input type="text" name="author" value='<:ifCfg editor auto_author:><:old author adminuser name:><:or:><:old author:><:eif:>' size="40" maxlength="255" tabindex="7" /><:or FieldPerm:><:article author:><:eif FieldPerm:>
+            </td>
+            <td nowrap="nowrap" bgcolor="#FFFFFF" ><:help edit author:> <:error_img author:></td>
+          </tr>
           <tr> 
             <th nowrap align="left" bgcolor="#FFFFFF">Lead time:</th>
             <td nowrap bgcolor="#FFFFFF"> 
index 92ac769a18cf67b266a0da95f23ce84b8299395d..d8a850b7950640fc972ddcc6bb5ceea793dd64a6 100644 (file)
               <:eif FieldPerm:><:flag desc:><:iterator separator flags:><br /><:iterator end flags:></td>
             <td bgcolor="#FFFFFF"><:help edit flags:> <:error_img flags:></td>
           </tr>
+          <tr>
+            <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Page title:</th>
+            <td width="100%" bgcolor="#FFFFFF">
+              <:ifFieldPerm pageTitle:><input type="text" name="pageTitle" value='<:old pageTitle article pageTitle:>' size="60" maxlength="255" tabindex="7" /> (alternate title)<:or:><:article pageTitle:><:eif:>
+            </td>
+           <td nowrap="nowrap" bgcolor="#FFFFFF"><:help edit pageTitle:> <:error_img pageTitle:></td>
+          </tr>
+          <tr>
+            <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Author name:</th>
+            <td width="100%" bgcolor="#FFFFFF" >
+              <:if FieldPerm author:><input type="text" name="author" value='<:ifCfg editor auto_author:><:old author adminuser name:><:or:><:old author:><:eif:>' size="40" maxlength="255" tabindex="7" /><:or FieldPerm:><:article author:><:eif FieldPerm:>
+            </td>
+            <td nowrap="nowrap" bgcolor="#FFFFFF" ><:help edit author:> <:error_img author:></td>
+          </tr>
           <tr> 
             <th nowrap align="left" bgcolor="#FFFFFF">Lead time:</th>
             <td nowrap bgcolor="#FFFFFF"> 
index 0d4839e4b4716654fd7defb971f6b2e540f278b9..16ad63408de31e7e4e045ea2880f69c97269b28f 100644 (file)
@@ -1,6 +1,6 @@
 <html>
 <head>
-<title><:siteName:> - <:article title:></title>
+<title><:ifArticle pageTitle:><:article pageTitle:><:or:><:article title:><:eif:> - <:siteName:></title>
 <meta name="ROBOTS" content="ALL">
 <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">
index 970171abfd064d912dfdfa0159fb9a961957f135..6414c40fddea7af080d2617d12170a1ef342c2ec 100644 (file)
@@ -41,6 +41,11 @@ my @prebuilt =
     level=>1,
     listed=>0,
     flags=>'',
+    lastModifiedBy=>'',
+    created=>'0000-00-00 00:00:00',
+    createdBy=>'',
+    author=>'',
+    pageTitle=>'',
    },
    {
     # the invisible subsection for what's hot
@@ -67,6 +72,11 @@ my @prebuilt =
     level=>2,
     listed=>2,
     flags=>'',
+    lastModifiedBy=>'',
+    created=>'0000-00-00 00:00:00',
+    createdBy=>'',
+    author=>'',
+    pageTitle=>'',
    },
    {
     id=>3,
@@ -92,6 +102,11 @@ my @prebuilt =
     level=>1,
     listed=>1,
     flags=>'',
+    lastModifiedBy=>'',
+    created=>'0000-00-00 00:00:00',
+    createdBy=>'',
+    author=>'',
+    pageTitle=>'',
    },
    {
     id=>4,
@@ -117,6 +132,11 @@ my @prebuilt =
     level=>2,
     listed=>2,
     flags=>'',
+    lastModifiedBy=>'',
+    created=>'0000-00-00 00:00:00',
+    createdBy=>'',
+    author=>'',
+    pageTitle=>'',
    },
    {
     id=>5,
@@ -142,6 +162,11 @@ my @prebuilt =
     level=>2,
     listed=>0,
     flags=>'',
+    lastModifiedBy=>'',
+    created=>'0000-00-00 00:00:00',
+    createdBy=>'',
+    author=>'',
+    pageTitle=>'',
    },
    {
     id=>6,
@@ -397,6 +422,11 @@ EOS
     level=>3,
     listed=>0,
     flags=>'',
+    lastModifiedBy=>'',
+    created=>'0000-00-00 00:00:00',
+    createdBy=>'',
+    author=>'',
+    pageTitle=>'',
    },
    {
     id=>7,
@@ -426,6 +456,11 @@ EOS
     level=>3,
     listed=>0,
     flags=>'',
+    lastModifiedBy=>'',
+    created=>'0000-00-00 00:00:00',
+    createdBy=>'',
+    author=>'',
+    pageTitle=>'',
    },
    {
     id=>8,
@@ -455,6 +490,11 @@ EOS
     level=>3,
     listed=>1,
     flags=>'',
+    lastModifiedBy=>'',
+    created=>'0000-00-00 00:00:00',
+    createdBy=>'',
+    author=>'',
+    pageTitle=>'',
    },
   );