summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-12-16 17:22:59 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-12-16 17:22:59 +0000
commit3bef30938264b531891202b30eba459a9b41ef0d (patch)
tree21b9da65938f419d8ceb2f84bdb3e3a6ec9d3b23
parent58760602ab94f4ec443a2d42aa69a153d0e45b88 (diff)
downloadnewsletters-3bef30938264b531891202b30eba459a9b41ef0d.tar.gz
newsletters-3bef30938264b531891202b30eba459a9b41ef0d.tar.bz2
newsletters-3bef30938264b531891202b30eba459a9b41ef0d.zip
template maintenance and fix BitNewsletters::getEditions()
-rw-r--r--BitNewsletter.php14
-rw-r--r--admin/index.php4
-rw-r--r--templates/admin_newsletters.tpl36
-rw-r--r--templates/edit_newsletter.tpl2
-rw-r--r--templates/list_editions.tpl5
-rw-r--r--templates/list_editions_inc.tpl41
-rw-r--r--templates/send_newsletters.tpl128
-rw-r--r--templates/view_edition.tpl5
-rw-r--r--templates/view_newsletter.tpl2
9 files changed, 105 insertions, 132 deletions
diff --git a/BitNewsletter.php b/BitNewsletter.php
index 31fca79..a819f43 100644
--- a/BitNewsletter.php
+++ b/BitNewsletter.php
@@ -1,22 +1,22 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletter.php,v 1.5 2005/12/11 06:34:18 spiderr Exp $
+ * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletter.php,v 1.6 2005/12/16 17:22:57 squareing Exp $
*
* Copyright (c) 2004 bitweaver.org
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: BitNewsletter.php,v 1.5 2005/12/11 06:34:18 spiderr Exp $
+ * $Id: BitNewsletter.php,v 1.6 2005/12/16 17:22:57 squareing Exp $
*
* Virtual base class (as much as one can have such things in PHP) for all
* derived tikiwiki classes that require database access.
- * @package blogs
+ * @package newsletters
*
* created 2004/10/20
*
* @author drewslater <andrew@andrewslater.com>, spiderr <spider@steelsun.com>
*
- * @version $Revision: 1.5 $ $Date: 2005/12/11 06:34:18 $ $Author: spiderr $
+ * @version $Revision: 1.6 $ $Date: 2005/12/16 17:22:57 $ $Author: squareing $
*/
/**
@@ -255,8 +255,8 @@ class BitNewsletter extends LibertyContent {
$ret = array();
- while ($res = $result->fetchRow()) {
- $res["confirmed"] = $this->mDb->getOne("select count(*) from `".BIT_DB_PREFIX."tiki_newsletter_subscriptions` where `valid`=? and `nl_id`=?",array('y',(int)$res["nl_id"]));
+ while( $res = $result->fetchRow() ) {
+ $res["confirmed"] = $this->mDb->getOne( "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."tiki_newsletter_subscriptions` WHERE `valid`=? AND `nl_id`=?",array( 'y', (int)$res["nl_id"] ) );
$ret[$res['nl_id']] = $res;
}
@@ -326,7 +326,7 @@ class BitNewsletter extends LibertyContent {
$ret = array();
if( $this->isValid() ) {
$listHash = array( 'nl_id' => $this->mNlId );
- BitNewsletterEdition::getList( $listHash );
+ $ret = BitNewsletterEdition::getList( $listHash );
}
return $ret;
}
diff --git a/admin/index.php b/admin/index.php
index a8d1c3e..b3d4910 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/Attic/index.php,v 1.6 2005/12/16 06:34:55 spiderr Exp $
+// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/Attic/index.php,v 1.7 2005/12/16 17:22:58 squareing Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
@@ -64,6 +64,6 @@ include_once( CATEGORIES_PKG_PATH.'categorize_list_inc.php' );
*/
// Display the template
-$gBitSystem->display( 'bitpackage:newsletters/edit_newsletters.tpl');
+$gBitSystem->display( 'bitpackage:newsletters/edit_newsletter.tpl');
?>
diff --git a/templates/admin_newsletters.tpl b/templates/admin_newsletters.tpl
index 2806a7b..cf891bf 100644
--- a/templates/admin_newsletters.tpl
+++ b/templates/admin_newsletters.tpl
@@ -1,27 +1,19 @@
{strip}
-{form}
- {jstabs}
- {jstab title="Newsletter Features"}
- {legend legend="Newsletter Features"}
- <input type="hidden" name="page" value="{$page}" />
+{form legend="Newsletter Features"}
+ <input type="hidden" name="page" value="{$page}" />
- {foreach from=$formNewsletterFeatures key=item item=output}
- <div class="row">
- {formlabel label=`$output.label` for=$item}
- {forminput}
- <input type="text" name="{$item}" value="{$gBitSystem->getPreference($item,$output.default)}" id=$item />
- {formhelp note=`$output.note` page=`$output.page`}
- {/forminput}
- </div>
- {/foreach}
+ {foreach from=$formNewsletterFeatures key=item item=output}
+ <div class="row">
+ {formlabel label=`$output.label` for=$item}
+ {forminput}
+ <input type="text" name="{$item}" value="{$gBitSystem->getPreference($item,$output.default)}" id="{$item}" />
+ {formhelp note=`$output.note` page=`$output.page`}
+ {/forminput}
+ </div>
+ {/foreach}
- <div class="row submit">
- <input type="submit" name="featuresTabSubmit" value="{tr}Change preferences{/tr}" />
- </div>
- {/legend}
- {/jstab}
-
- {/jstabs}
+ <div class="row submit">
+ <input type="submit" name="featuresTabSubmit" value="{tr}Change preferences{/tr}" />
+ </div>
{/form}
-
{/strip}
diff --git a/templates/edit_newsletter.tpl b/templates/edit_newsletter.tpl
index d68d824..e2f9800 100644
--- a/templates/edit_newsletter.tpl
+++ b/templates/edit_newsletter.tpl
@@ -92,9 +92,9 @@
<td style="text-align:right;"><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/admin_newsletter_subscriptions.php?nl_id={$nlId}">{$nl.users|default:0} [ {$channels[user].confirmed|default:0} ]</a></td>
<td style="text-align:right;">
<a href="{$smarty.const.NEWSLETTERS_PKG_URL}edition_edit.php?nl_id={$nlId}">{biticon ipackage=liberty iname=new iexplain="New Edition"}</a>
- <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?remove=1&amp;nl_id={$nlId}">{biticon ipackage=liberty iname=delete iexplain=Remove}</a>
<a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?&amp;nl_id={$nlId}">{biticon ipackage=liberty iname=edit iexplain=Edit}</a>
{if $channels[user].individual eq 'y'}({/if}<a href="{$smarty.const.KERNEL_PKG_URL}object_permissions.php?objectName=newsletter%20{$nl.title}&amp;object_type={$smarty.const.BITNEWSLETTER_CONTENT_TYPE_GUID}&amp;permType=newsletters&amp;object_id={$nlId}">{biticon ipackage=liberty iname=permissions iexplain=Permissions}</a>{if $nl.individual eq 'y'}){/if}
+ <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?remove=1&amp;nl_id={$nlId}">{biticon ipackage=liberty iname=delete iexplain=Remove}</a>
</td>
</tr>
{foreachelse}
diff --git a/templates/list_editions.tpl b/templates/list_editions.tpl
index b611701..23a65b9 100644
--- a/templates/list_editions.tpl
+++ b/templates/list_editions.tpl
@@ -1,5 +1,5 @@
{strip}
-<div class="listing fisheye">
+<div class="listing newsletters">
<div class="header">
<h1>{tr}Newsletter Editions{/tr}</h1>
</div>
@@ -9,8 +9,7 @@
{include file='bitpackage:newsletters/list_editions_inc.tpl'}
- <div class="clear"></div>
{libertypagination page=$curPage numPages=$numPages find=$find}
</div> <!-- end .body -->
-</div> <!-- end .fisheye -->
+</div> <!-- end .newsletters -->
{/strip}
diff --git a/templates/list_editions_inc.tpl b/templates/list_editions_inc.tpl
index 5a783bc..af79bb4 100644
--- a/templates/list_editions_inc.tpl
+++ b/templates/list_editions_inc.tpl
@@ -1,24 +1,21 @@
- <ul class="clear data">
- {foreach from=$editionList key=editionId item=ed}
- <li class="item {cycle values='odd,even'} {$ed.content_type_guid}">
- <div class="floaticon">
- <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?edition_id={$ed.edition_id}">{biticon ipackage=liberty iname="mail_send" iexplain="Send"}</a>
- </div>
- <h2><a href="{$ed.display_url}">{$ed.title}</a></h2>
- {if $ed.newsletter_title}
- {tr}in{/tr} <a href="{$smarty.const.NEWSLETTERS_PKG_URL}?nl_id={$ed.nl_id}">{$ed.newsletter_title}</a></h3>
- {/if}
+<ul class="clear data">
+ {foreach from=$editionList key=editionId item=ed}
+ <li class="item {cycle values='odd,even'} {$ed.content_type_guid}">
+ <div class="floaticon">
+ <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?edition_id={$ed.edition_id}">{biticon ipackage=liberty iname="mail_send" iexplain="Send"}</a>
+ </div>
- {if $fisheye_list_description eq 'y'}
- <p>{$ed.data|truncate:200}</p>
- {/if}
-
- <div class="clear"></div>
- </li>
- {foreachelse}
- <li class="item norecords">
- {tr}No editions{/tr}
- </li>
- {/foreach}
- </ul>
+ <h2><a href="{$ed.display_url}">{$ed.title}</a></h2>
+ <p>
+ {$ed.data|truncate:200}
+ <br />
+ {tr}in{/tr} <a href="{$smarty.const.NEWSLETTERS_PKG_URL}?nl_id={$ed.nl_id}">{$ed.newsletter_title}</a></h3>
+ </p>
+ </li>
+ {foreachelse}
+ <li class="item norecords">
+ {tr}No editions{/tr}
+ </li>
+ {/foreach}
+</ul>
diff --git a/templates/send_newsletters.tpl b/templates/send_newsletters.tpl
index b4cc3df..44e803c 100644
--- a/templates/send_newsletters.tpl
+++ b/templates/send_newsletters.tpl
@@ -7,80 +7,68 @@
</div>
<div class="body">
+ {if $gContent->isValid()}
+ {form}
+ <input type="hidden" name="edition_id" value="{$gContent->mEditionId|escape}" />
-{if $gContent->isValid()}
-{form}
- <input type="hidden" name="edition_id" value="{$gContent->mEditionId|escape}" />
+ {if $smarty.request.emited eq 'y'}
+ {tr}The newsletter was sent to {$sent} email addresses{/tr}
+ {elseif $smarty.request.preview}
+ {jstabs}
+ {jstab title="Preview Newsletter"}
+ {legend legend="Preview Newsletter"}
+ {include file="bitpackage:newsletters/view_edition.tpl"}
+ {/legend}
+ {/jstab}
- {if $smarty.request.emited eq 'y'}
- {tr}The newsletter was sent to {$sent} email addresses{/tr}<br /><br />
- {elseif $smarty.request.preview}
+ {jstab title="Preview Recipient List"}
+ {legend legend="Preview Recipient List"}
+ <div class="row">
+ {foreach from=$smarty.request.send_group item=groupId key=i}
+ <input type="hidden" name="send_group[]" value="{$groupId}" />
+ {/foreach}
- <div class="row submit">
- {forminput}
- <input type="submit" name="cancel" value="{tr}Cancel{/tr}" />
- <input type="submit" name="send" value="{tr}send{/tr}" />
- {/forminput}
- </div>
- {jstabs}
- {jstab title="Preview Newsletter"}
- {legend legend="Preview Newsletter"}
- {include file="bitpackage:newsletters/view_edition.tpl"}
- {/legend}
- {/jstab}
- {jstab title="Preview Recipient List"}
- {legend legend="Preview Recipient List"}
- <div class="row">
- {foreach from=$smarty.request.send_group item=groupId key=i}
- <input type="hidden" name="send_group[]" value="{$groupId}" />
- {/foreach}
- {formlabel label="Actual Recipients"}
- {forminput}
- <ol>
- {foreach from=$recipientList item=recipient key=email}
- <li>"{$recipient.login}" <{$email}></li>
- {/foreach}
- </ol>
- {/forminput}
- </div>
- {/legend}
- {/jstab}
- {/jstabs}
-
- </div>
- {else}
- <div class="row">
- {formlabel label="Groups"}
- {forminput}
- {tr}This newsletter will be sent to members of the checked groups below:{/tr}
- <ul class="data">
- {foreach from=$groupList item=group key=groupId }
- <li class="item"><input type="checkbox" name="send_group[]" value="{$groupId}" />{$group.group_name}</li>
- {/foreach}
- </ul>
- {/forminput}
- </div>
- <div class="row submit">
- {forminput}
- <input type="submit" name="preview" value="{tr}Preview{/tr}" />
- {/forminput}
- </div>
- {/if}
-{/form}
-
-{else}
-
-<h2>{tr}Sent editions{/tr}</h2>
-
-{include file="bitpackage:newsletters/list_editions_inc.tpl"}
-
-{pagination}
-
-{minifind}
-
-{/if}
+ {formlabel label="Actual Recipients"}
+ {forminput}
+ <ol>
+ {foreach from=$recipientList item=recipient key=email}
+ <li>{$recipient.login} &nbsp; <small>&lt;{$email}&gt;</small></li>
+ {/foreach}
+ </ol>
+ {/forminput}
+ </div>
+ {/legend}
+ {/jstab}
+ {/jstabs}
+ <div class="row submit">
+ <input type="submit" name="cancel" value="{tr}Cancel{/tr}" />
+ <input type="submit" name="send" value="{tr}Send{/tr}" />
+ </div>
+ {else}
+ {legend legend="Recipient Groups"}
+ <div class="row">
+ {formlabel label="Groups"}
+ {forminput}
+ {foreach from=$groupList item=group key=groupId }
+ <label><input type="checkbox" name="send_group[]" value="{$groupId}" /> {$group.group_name}</label><br />
+ {/foreach}
+ {formhelp note="This newsletter will be sent to members of the checked groups."}
+ {/forminput}
+ </div>
+ <div class="row submit">
+ <input type="submit" name="preview" value="{tr}Preview{/tr}" />
+ </div>
+ {/legend}
+ {/if}
+ {/form}
+ {else}
+ {minifind}
+ <h2>{tr}Sent editions{/tr}</h2>
+ {include file="bitpackage:newsletters/list_editions_inc.tpl"}
+ {pagination}
+ {/if}
</div>
</div>
-{/strip} \ No newline at end of file
+{/strip}
diff --git a/templates/view_edition.tpl b/templates/view_edition.tpl
index 00ff9ba..3ba9247 100644
--- a/templates/view_edition.tpl
+++ b/templates/view_edition.tpl
@@ -1,4 +1,4 @@
-<div class="display blogs">
+<div class="display newsletters">
<div class="floaticon">
{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='icon'}
@@ -24,5 +24,4 @@
{$gContent->parseData()}
</div> <!-- end .content -->
</div> <!-- end .body -->
-
-</div> \ No newline at end of file
+</div><!-- end .newsletters -->
diff --git a/templates/view_newsletter.tpl b/templates/view_newsletter.tpl
index a138924..67c5290 100644
--- a/templates/view_newsletter.tpl
+++ b/templates/view_newsletter.tpl
@@ -24,11 +24,9 @@
<div class="body">
<div class="content">
-
{$gContent->parseData()}
{include file="bitpackage:newsletters/list_editions_inc.tpl" editionList=$gContent->getEditions()}
-
</div> <!-- end .content -->
</div> <!-- end .body -->
</div> <!-- end .newsletters -->