[MKDoc-commit] fix 1.8 newsletter.
bruno at mkdoc.demon.co.uk
bruno at mkdoc.demon.co.uk
Fri Nov 26 16:10:36 GMT 2004
Log Message:
-----------
fix 1.8 newsletter. Revert long-standing bug introduced 2004-03-29.
use MKDoc::SQL, stop using flo::plugin::Reminder
Modified Files:
--------------
mkd/resources/templates/newsletter:
en.xml
mkd/tools/cron:
020..newsletter.pl
-------------- next part --------------
Index: en.xml
===================================================================
RCS file: /var/spool/cvs/mkd/resources/templates/newsletter/en.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lresources/templates/newsletter/en.xml -Lresources/templates/newsletter/en.xml -u -r1.2 -r1.3
--- resources/templates/newsletter/en.xml
+++ resources/templates/newsletter/en.xml
@@ -4,9 +4,7 @@
petal:define="root_user user_root:;
details plugin: flo::plugin::Account::Details;
preferences plugin: flo::plugin::Account::Preferences;
- reminder plugin: flo::plugin::Account::Reminder;
- user_domain config: USER_DOMAIN;
- public_domain config: PUBLIC_DOMAIN">
+ reminder plugin: MKDoc::Auth::Plugin::Recover_Password">
<Content-Type>text/plain; charset=utf-8; format=flowed</Content-Type>
<Content-Disposition>inline</Content-Disposition>
@@ -30,7 +28,7 @@
>MKDoc Monthly Email Update</Subject>
<User-Agent>MKDoc Mailer v1.6</User-Agent>
<Precedence>bulk</Precedence>
- <List-Unsubscribe petal:content="string: <${details/user_domain_notrailingslash}/${preferences/name}>"><http://www.example.com/.preferences.mumble></List-Unsubscribe>
+ <List-Unsubscribe petal:content="string: <${self/env/PUBLIC_DOMAIN}${preferences/name}>"><http://www.example.com/.preferences.mumble></List-Unsubscribe>
<List-Id petal:content="string:${self/root/title} newsletter">MKDoc newsletter</List-Id>
<Organization petal:content="self/root/title">MKDoc</Organization>
@@ -66,14 +64,14 @@
change your preferences you will need to edit your account at:
</p>
- <pre><span petal:replace="string: <${details/user_domain_notrailingslash}/${preferences/name}>"><http://example.com/preferences.mumble></span></pre>
+ <pre><span petal:replace="string: <${self/env/PUBLIC_DOMAIN}${preferences/name}>"><http://example.com/preferences.mumble></span></pre>
<p>
If you can't remember your account password, you can get an email
reminder by visiting this link:
</p>
- <pre><span petal:replace="string: <${public_domain}${reminder/name}>"><http://www.example.com/></span></pre>
+ <pre><span petal:replace="string: <${self/env/PUBLIC_DOMAIN}.${reminder/uri_hint}>"><http://www.example.com/></span></pre>
<pre>--
Best Regards,
Index: 020..newsletter.pl
===================================================================
RCS file: /var/spool/cvs/mkd/tools/cron/020..newsletter.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -Ltools/cron/020..newsletter.pl -Ltools/cron/020..newsletter.pl -u -r1.6 -r1.7
--- tools/cron/020..newsletter.pl
+++ tools/cron/020..newsletter.pl
@@ -7,6 +7,7 @@
use Encode;
use base qw /flo::Plugin/;
use Petal::Mail;
+use MKDoc::SQL;
sub template_path { '/newsletter' }
@@ -50,7 +51,9 @@
my $date_since = $self->compute_date_since();
my $sql = <<SQL;
-SELECT Document.ID AS ID, SUM(Preference_Audience.Value) AS Pref_Score
+SELECT DISTINCT Document.Title, Document.Date_Created, Document.Full_Path, Document.Description,
+ Editor.First_Name, Editor.Family_Name, Editor.Login,
+ Creator.First_Name as Creator_First_Name, Creator.Family_Name as Creator_Family_Name
FROM Document, Document_Audience, Audience, Preference_Audience, Editor, Editor as Creator, Preference_Language
WHERE
-- join the tables together
@@ -82,11 +85,9 @@
$sth->execute ($user_login, $date_since);
my @res = ();
- my $doc_t = flo::Standard::table ('Document');
while (my $h = $sth->fetchrow_hashref)
{
- next unless ($h->{Pref_Score} > 0);
- my $doc = $doc_t->get ( $h->{ID} );
+ my $doc = bless $h, 'flo::Record::Document';
next unless ($doc->is_showable());
$Text::Wrap::columns = 72;
@@ -240,7 +241,7 @@
my $sth = $dbh->prepare_cached ($sql);
$sth->execute (periodicity());
- my $query = new lib::sql::Query
+ my $query = new MKDoc::SQL::Query
sth => $sth,
bless_into => 'flo::Record::Editor';
More information about the MKDoc-commit
mailing list