-VERSION=0.15_12
+VERSION=0.15_13
DISTNAME=bse-$(VERSION)
DISTBUILD=$(DISTNAME)
DISTTAR=../$(DISTNAME).tar
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
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 {
(
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 = ?',
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;
}
$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}
$article->setLink($article_uri);
}
+# Added by adrian
+ my $user = $req->getuser;
+ $article->{lastModifiedBy} = $user ? $user->{logon} : '';
+
$article->save();
use Util 'generate_article';
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"}) {
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 {
future_plans.html
thumbnails.html
formmail.html
+pod2htmd.tmp
+pod2htmi.tmp
=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
</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><title></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>
<: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>
<: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%">
<: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">
<: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">
<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">
level=>1,
listed=>0,
flags=>'',
+ lastModifiedBy=>'',
+ created=>'0000-00-00 00:00:00',
+ createdBy=>'',
+ author=>'',
+ pageTitle=>'',
},
{
# the invisible subsection for what's hot
level=>2,
listed=>2,
flags=>'',
+ lastModifiedBy=>'',
+ created=>'0000-00-00 00:00:00',
+ createdBy=>'',
+ author=>'',
+ pageTitle=>'',
},
{
id=>3,
level=>1,
listed=>1,
flags=>'',
+ lastModifiedBy=>'',
+ created=>'0000-00-00 00:00:00',
+ createdBy=>'',
+ author=>'',
+ pageTitle=>'',
},
{
id=>4,
level=>2,
listed=>2,
flags=>'',
+ lastModifiedBy=>'',
+ created=>'0000-00-00 00:00:00',
+ createdBy=>'',
+ author=>'',
+ pageTitle=>'',
},
{
id=>5,
level=>2,
listed=>0,
flags=>'',
+ lastModifiedBy=>'',
+ created=>'0000-00-00 00:00:00',
+ createdBy=>'',
+ author=>'',
+ pageTitle=>'',
},
{
id=>6,
level=>3,
listed=>0,
flags=>'',
+ lastModifiedBy=>'',
+ created=>'0000-00-00 00:00:00',
+ createdBy=>'',
+ author=>'',
+ pageTitle=>'',
},
{
id=>7,
level=>3,
listed=>0,
flags=>'',
+ lastModifiedBy=>'',
+ created=>'0000-00-00 00:00:00',
+ createdBy=>'',
+ author=>'',
+ pageTitle=>'',
},
{
id=>8,
level=>3,
listed=>1,
flags=>'',
+ lastModifiedBy=>'',
+ created=>'0000-00-00 00:00:00',
+ createdBy=>'',
+ author=>'',
+ pageTitle=>'',
},
);