diff options
| -rw-r--r-- | BitNewsletter.php | 90 | ||||
| -rw-r--r-- | BitNewsletterEdition.php | 115 | ||||
| -rw-r--r-- | admin/send.php | 96 | ||||
| -rw-r--r-- | templates/admin_newsletters.tpl | 82 | ||||
| -rw-r--r-- | templates/send_newsletters.tpl | 26 |
5 files changed, 154 insertions, 255 deletions
diff --git a/BitNewsletter.php b/BitNewsletter.php index 0c8e023..1c5cc25 100644 --- a/BitNewsletter.php +++ b/BitNewsletter.php @@ -1,12 +1,12 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletter.php,v 1.2 2005/12/09 19:15:49 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletter.php,v 1.3 2005/12/09 20:24:55 spiderr 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.2 2005/12/09 19:15:49 spiderr Exp $ + * $Id: BitNewsletter.php,v 1.3 2005/12/09 20:24:55 spiderr Exp $ * * Virtual base class (as much as one can have such things in PHP) for all * derived tikiwiki classes that require database access. @@ -16,7 +16,7 @@ * * @author drewslater <andrew@andrewslater.com>, spiderr <spider@steelsun.com> * - * @version $Revision: 1.2 $ $Date: 2005/12/09 19:15:49 $ $Author: spiderr $ + * @version $Revision: 1.3 $ $Date: 2005/12/09 20:24:55 $ $Author: spiderr $ */ /** @@ -25,7 +25,6 @@ require_once( LIBERTY_PKG_PATH.'LibertyContent.php' ); define( 'BITNEWSLETTER_CONTENT_TYPE_GUID', 'bitnewsletter' ); -define( 'BITNEWSLETTEREDITION_CONTENT_TYPE_GUID', 'bitnewsletteredition' ); class BitNewsletter extends LibertyContent { function BitNewsletter( $pNlId=NULL, $pContentId=NULL ) { @@ -246,10 +245,6 @@ class BitNewsletter extends LibertyContent { $result = $this->mDb->query( $query, $bindVars, $pListHash['max_records'], $pListHash['offset'] ); $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_newsletters` $mid"; - $pListHash['total_records'] = $this->mDb->getOne( $query_cant, $bindVars ); - $pListHash['block_pages'] = 5; - $pListHash['total_pages'] = ceil( $pListHash['total_records'] / $pListHash['max_records'] ); - $pListHash['current_page'] = (!empty( $pListHash['offset'] ) ? floor( $pListHash['offset'] / $pListHash['max_records'] ) + 1 : 1 ); $ret = array(); @@ -322,83 +317,4 @@ class BitNewsletter extends LibertyContent { } - - - - - - - - - - - - -class BitNewsletterEdition extends LibertyContent { - function BitNewsletterEdition( $pEditionId, $pContentId=NULL ) { - parent::LibertyContent(); - $this->registerContentType( BITNEWSLETTEREDITION_CONTENT_TYPE_GUID, array( - 'content_type_guid' => BITNEWSLETTEREDITION_CONTENT_TYPE_GUID, - 'content_description' => 'Newsletter', - 'handler_class' => 'BitNewsletter', - 'handler_package' => 'newsletters', - 'handler_file' => 'BitNewsletter.php', - 'maintainer_url' => 'http://www.bitweaver.org' - ) ); - $this->mEditionId = $pEditionId; - $this->mContentId = $pContentId; - $this->mContentTypeGuid = BITNEWSLETTEREDITION_CONTENT_TYPE_GUID; - } - - function replace_edition($nl_id, $subject, $data, $users) { - $now = date("U"); - $query = "insert into `".BIT_DB_PREFIX."tiki_sent_newsletters`(`nl_id`,`subject`,`data`,`sent`,`users`) values(?,?,?,?,?)"; - $result = $this->mDb->query($query,array((int)$nl_id,$subject,$data,(int)$now,$users)); - } - - function get_edition($edition_id) { - $query = "select * from `".BIT_DB_PREFIX."tiki_sent_newsletters` where `edition_id`=?"; - $result = $this->mDb->query($query,array((int)$edition_id)); - if (!$result->numRows()) return false; - $res = $result->fetchRow(); - return $res; - } - - function list_editions($offset, $maxRecords, $sort_mode, $find) { - $bindVars = array(); - if ($find) { - $findesc = '%' . $find . '%'; - $mid = " and (`subject` like ? or `data` like ?)"; - $bindVars[] = $findesc; - $bindVars[] = $findesc; - } else { - $mid = " "; - } - - $query = "select tsn.`edition_id`,tn.`nl_id`,`subject`,`data`,tsn.`users`,`sent`,`name` from `".BIT_DB_PREFIX."tiki_newsletters` tn, `".BIT_DB_PREFIX."tiki_sent_newsletters` tsn "; - $query.= " where tn.`nl_id`=tsn.`nl_id` $mid order by ".$this->mDb->convert_sortmode("$sort_mode"); - $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_newsletters` tn, `".BIT_DB_PREFIX."tiki_sent_newsletters` tsn where tn.`nl_id`=tsn.`nl_id` $mid"; - $result = $this->mDb->query($query,$bindVars,$maxRecords,$offset); - $cant = $this->mDb->getOne($query_cant,$bindVars); - $ret = array(); - - while ($res = $result->fetchRow()) { - $ret[] = $res; - } - - $retval = array(); - $retval["data"] = $ret; - $retval["cant"] = $cant; - return $retval; - } - - function remove_edition($edition_id) { - $query = "delete from `".BIT_DB_PREFIX."tiki_sent_newsletters` where `edition_id`=$edition_id"; - $result = $this->mDb->query($query,array((int)$edition_id)); - } - -} - -$BitNewsletter = new BitNewsletter(); - ?> diff --git a/BitNewsletterEdition.php b/BitNewsletterEdition.php new file mode 100644 index 0000000..999aa41 --- /dev/null +++ b/BitNewsletterEdition.php @@ -0,0 +1,115 @@ +<?php +/** + * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletterEdition.php,v 1.1 2005/12/09 20:24:55 spiderr 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: BitNewsletterEdition.php,v 1.1 2005/12/09 20:24:55 spiderr 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 + * + * created 2004/10/20 + * + * @author drewslater <andrew@andrewslater.com>, spiderr <spider@steelsun.com> + * + * @version $Revision: 1.1 $ $Date: 2005/12/09 20:24:55 $ $Author: spiderr $ + */ + +/** + * required setup + */ +require_once( NEWSLETTERS_PKG_PATH.'BitNewsletter.php' ); +require_once( LIBERTY_PKG_PATH.'LibertyContent.php' ); + +define( 'BITNEWSLETTEREDITION_CONTENT_TYPE_GUID', 'bitnewsletteredn' ); + +class BitNewsletterEdition extends LibertyContent { + function BitNewsletterEdition( $pEditionId=NULL, $pContentId=NULL, $pNlId=NULL ) { + parent::LibertyContent(); + $this->registerContentType( BITNEWSLETTEREDITION_CONTENT_TYPE_GUID, array( + 'content_type_guid' => BITNEWSLETTEREDITION_CONTENT_TYPE_GUID, + 'content_description' => 'Newsletter', + 'handler_class' => 'BitNewsletter', + 'handler_package' => 'newsletters', + 'handler_file' => 'BitNewsletter.php', + 'maintainer_url' => 'http://www.bitweaver.org' + ) ); + $this->mEditionId = $pEditionId; + $this->mContentId = $pContentId; + $this->mContentTypeGuid = BITNEWSLETTEREDITION_CONTENT_TYPE_GUID; + $this->mNewsletter = new BitNewsletter( $pNlId ); + } + + function replace_edition($nl_id, $subject, $data, $users) { + $now = date("U"); + $query = "insert into `".BIT_DB_PREFIX."tiki_newsletters_editions`(`nl_id`,`subject`,`data`,`sent`,`users`) values(?,?,?,?,?)"; + $result = $this->mDb->query($query,array((int)$nl_id,$subject,$data,(int)$now,$users)); + } + + function load() { + if( !empty( $this->mNlId ) || !empty( $this->mContentId ) ) { + global $gBitSystem; + + $bindVars = array(); $selectSql = ''; $joinSql = ''; $whereSql = ''; + + $lookupColumn = !empty( $this->mNlId )? 'nl_id' : 'content_id'; + $lookupId = !empty( $this->mNlId )? $this->mNlId : $this->mContentId; + array_push( $bindVars, $lookupId ); + + $this->getServicesSql( 'content_load_function', $selectSql, $joinSql, $whereSql, $bindVars ); + + $query = "SELECT * + FROM `".BIT_DB_PREFIX."tiki_newsletters_editions` tne + INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON( tne.`content_id`=tc.`content_id` ) + WHERE `$lookupColumn`=? $whereSql"; + $result = $this->mDb->query($query,$bindVars); + if ($result->numRows()) { + $this->mInfo = $result->fetchRow(); + $this->mNlId = $this->mInfo['nl_id']; + $this->mContentId = $this->mInfo['content_id']; + $this->mNewsletter = new BitNewsletter( $this->mInfo['nl_id'] ); + } + } + return( count( $this->mInfo ) ); + } + + function getList( &$pListHash ) { + $bindVars = array(); + $this->prepGetList( $pListHash ); + $mid = ''; + if( $pListHash['find'] ) { + $findesc = '%' . $pListHash['find'] . '%'; + $mid = " WHERE (tc.`title` like ? or tc.`data` like ?)"; + $bindVars[] = $findesc; + $bindVars[] = $findesc; + } + + $query = "SELECT `edition_id` AS `has_key`, * + FROM `".BIT_DB_PREFIX."tiki_newsletters` tn + INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON( tc.`content_id`=tn.`content_id` ) + INNER JOIN `".BIT_DB_PREFIX."tiki_newsletters_editions` tsn ON( tn.`nl_id`=tsn.`nl_id` ) + $mid ORDER BY ".$this->mDb->convert_sortmode( $pListHash['sort_mode'] ); + + $query_cant = "select count(*) from `".BIT_DB_PREFIX."tiki_newsletters` tn, `".BIT_DB_PREFIX."tiki_newsletters_editions` tsn where tn.`nl_id`=tsn.`nl_id` $mid"; + $ret = $this->mDb->getAssoc( $query, $bindVars, $pListHash['max_records'], $pListHash['offset'] ); + + $pListHash['total_records'] = $this->mDb->getOne( $query_cant, $bindVars ); + $pListHash['block_pages'] = 5; + $pListHash['total_pages'] = ceil( $pListHash['total_records'] / $pListHash['max_records'] ); + $pListHash['current_page'] = (!empty( $pListHash['offset'] ) ? floor( $pListHash['offset'] / $pListHash['max_records'] ) + 1 : 1 ); + + return $ret; + } + + function remove_edition($edition_id) { + $query = "delete from `".BIT_DB_PREFIX."tiki_newsletters_editions` where `edition_id`=$edition_id"; + $result = $this->mDb->query($query,array((int)$edition_id)); + } + +} + +?> diff --git a/admin/send.php b/admin/send.php index df64c6f..56d2914 100644 --- a/admin/send.php +++ b/admin/send.php @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/send.php,v 1.1 2005/12/09 13:30:48 spiderr Exp $ +// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/send.php,v 1.2 2005/12/09 20:24:55 spiderr 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. @@ -14,36 +14,25 @@ include_once( UTIL_PKG_PATH.'htmlMimeMail.php' ); $gBitSystem->verifyPackage( 'newsletters' ); -require_once( NEWSLETTERS_PKG_PATH.'lookup_newsletter_inc.php' ); +require_once( NEWSLETTERS_PKG_PATH.'lookup_newsletter_edition_inc.php' ); $listHash = array(); -$newsletters = $nllib->getList( $listHash ); -$gBitSmarty->assign('newsletters', $newsletters["data"]); +$newsletters = $gContent->mNewsletter->getList( $listHash ); +$gBitSmarty->assign( 'newsletters', $newsletters ); -$nl_info = $nllib->get_newsletter($_REQUEST["nl_id"]); -// $nl_info["name"] = ''; -// $nl_info["description"] = ''; -// $nl_info["allow_user_sub"] = 'y'; -// $nl_info["allow_any_sub"] = 'n'; -// $nl_info["unsub_msg"] = 'y'; -// $nl_info["validate_addr"] = 'y'; - -if (!isset($_REQUEST["edition_id"])) - $_REQUEST["edition_id"] = 0; - -if ($_REQUEST["edition_id"]) { - $info = $nllib->get_edition($_REQUEST["edition_id"]); -} else { - $info = array(); - - $info["data"] = ''; - $info["subject"] = ''; -} - -$gBitSmarty->assign('info', $info); - -if (isset($_REQUEST["remove"])) { - $nllib->remove_edition($_REQUEST["remove"]); +if (isset($_REQUEST["remove"] ) && $gContent->isValid() ) { + if( !empty( $_REQUEST['cancel'] ) ) { + // user cancelled - just continue on, doing nothing + } elseif( empty( $_REQUEST['confirm'] ) ) { + $formHash['remove'] = TRUE; + $formHash['edition_id'] = $gContent->mEditionId; + $gBitSystem->confirmDialog( $formHash, array( 'warning' => 'Are you sure you want to delete the newsletter edition '.$gContent->getTitle().'?' ) ); + } else { + if( $gContent->expunge() ) { + header( "Location: ".NEWSLETTERS_PKG_URL.'admin/' ); + die; + } + } } if (isset($_REQUEST["template_id"]) && $_REQUEST["template_id"] > 0) { @@ -114,56 +103,17 @@ if (isset($_REQUEST["send"])) { $nllib->replace_edition($_REQUEST["nl_id"], $_REQUEST["subject"], $_REQUEST["data"], $sent); } -if ( empty( $_REQUEST["sort_mode"] ) ) { - $sort_mode = 'sent_desc'; -} else { - $sort_mode = $_REQUEST["sort_mode"]; -} - -if (!isset($_REQUEST["offset"])) { - $offset = 0; -} else { - $offset = $_REQUEST["offset"]; -} - -$gBitSmarty->assign_by_ref('offset', $offset); - -if (isset($_REQUEST["find"])) { - $find = $_REQUEST["find"]; -} else { - $find = ''; -} - -$gBitSmarty->assign('find', $find); - -$gBitSmarty->assign_by_ref('sort_mode', $sort_mode); -$channels = $nllib->list_editions($offset, $maxRecords, $sort_mode, $find); - -$cant_pages = ceil($channels["cant"] / $maxRecords); -$gBitSmarty->assign_by_ref('cant_pages', $cant_pages); -$gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); - -if ($channels["cant"] > ($offset + $maxRecords)) { - $gBitSmarty->assign('next_offset', $offset + $maxRecords); -} else { - $gBitSmarty->assign('next_offset', -1); -} - -// If offset is > 0 then prev_offset -if ($offset > 0) { - $gBitSmarty->assign('prev_offset', $offset - $maxRecords); -} else { - $gBitSmarty->assign('prev_offset', -1); -} - -$gBitSmarty->assign_by_ref('channels', $channels["data"]); +$gEdition = new BitNewsletterEdition(); +$listHash = array(); +$editions = $gEdition->getList( $listHash ); +$gBitSmarty->assign_by_ref( 'editions', $editions ); +$gBitSmarty->assign( 'listInfo', $listHash ); if( $gBitSystem->isFeatureActive( 'tiki_p_use_content_templates' ) ) { $templates = $tikilib->list_templates('newsletters', 0, -1, 'name_asc', ''); + $gBitSmarty->assign_by_ref('templates', $templates["data"]); } -$gBitSmarty->assign_by_ref('templates', $templates["data"]); - // Display the template $gBitSystem->display( 'bitpackage:newsletters/send_newsletters.tpl'); diff --git a/templates/admin_newsletters.tpl b/templates/admin_newsletters.tpl index 4cbb2d9..bc0ea9e 100644 --- a/templates/admin_newsletters.tpl +++ b/templates/admin_newsletters.tpl @@ -1,7 +1,6 @@ {strip} <div class="floaticon">{bithelp}</div> -<<<<<<< admin_newsletters.tpl <div class="edit ___"> <div class="header"> <h1>{tr}Netsletter Settings{/tr}</h1> @@ -105,84 +104,3 @@ </div><!-- end .body --> </div><!-- end .___ --> {/strip} -======= -{if $gBitSystemPrefs.feature_help eq 'y'} -<a href="http://bitweaver.org/wiki/PackageNewsletters" target="help" title="{tr}Tikiwiki.org help{/tr}: {tr}Newsletters{/tr}"><img class="icon" src="{$smarty.const.IMG_PKG_URL}icons/help.gif" alt="help" /></a> -{/if} - -{if $gBitSystemPrefs.feature_view_tpl eq 'y'} -<a href="{$smarty.const.THEMES_PKG_URL}edit_templates.php?template=templates/admin_newsletters.tpl" target="help" title="{tr}View tpl{/tr}: {tr}admin newsletters tpl{/tr}"><img class="icon" src="{$smarty.const.IMG_PKG_URL}icons/info.gif" alt="edit tpl" /></a> -{/if} -<br /><br /> - -<a href="{$smarty.const.NEWSLETTERS_PKG_URL}index.php">{tr}list newsletters{/tr}</a> -<a href="{$smarty.const.NEWSLETTERS_PKG_URL}send.php">{tr}send newsletters{/tr}</a> -<br /><br /> - -<h2>{tr}Create/edit newsletters{/tr}</h2> -{if $individual eq 'y'} -<a href="{$smarty.const.KERNEL_PKG_URL}object_permissions.php?objectName=newsletter%20{$gContent->mInfo.name}&object_type=newsletter&permType=newsletters&object_id={$gContent->mInfo.nl_id}">{tr}There are individual permissions set for this newsletter{/tr}</a><br /><br /> -{/if} - -<form action="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php" method="post"> -<input type="hidden" name="nl_id" value="{$gContent->mInfo.nl_id|escape}" /> -<table class="panel"> -<tr><td>{tr}Name{/tr}:</td><td><input type="text" name="title" value="{$gContent->mInfo.title|escape}" /></td></tr> -<tr><td>{tr}Description{/tr}:</td><td><textarea name="edit" rows="4" cols="40">{$gContent->mInfo.data|escape:html}</textarea></td></tr> -<tr><td>{tr}Users can subscribe/unsubscribe to this list{/tr}</td><td> -<input type="checkbox" name="allow_user_sub" {if $gContent->mInfo.allow_user_sub eq 'y'}checked="checked"{/if} /></td></tr> -<tr><td>{tr}Users can subscribe any email address{/tr}</td><td> -<input type="checkbox" name="allow_any_sub" {if $gContent->mInfo.allow_any_sub eq 'y'}checked="checked"{/if} /></td></tr> -<tr><td>{tr}Add unsubscribe instructions to each newsletter{/tr}</td><td> -<input type="checkbox" name="unsub_msg" {if $gContent->mInfo.unsub_msg eq 'y'}checked="checked"{/if} /></td></tr> -<tr><td>{tr}Validate email addresses{/tr}</td><td> -<input type="checkbox" name="validate_addr" {if $gContent->mInfo.validate_addr eq 'y'}checked="checked"{/if} /></td></tr> -<tr class="panelsubmitrow"><td colspan="2"><input type="submit" name="save" value="{tr}Save{/tr}" /></td></tr> -</table> -</form> - -<h2>{tr}Newsletters{/tr}</h2> -<table class="find"> -<tr><td>{tr}Find{/tr}</td> - <td> - <form method="get" action="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php"> - <input type="text" name="find" value="{$find|escape}" /> - <input type="submit" value="{tr}find{/tr}" name="search" /> - <input type="hidden" name="sort_mode" value="{$sort_mode|escape}" /> - </form> - </td> -</tr> -</table> - - -<table class="panel"> -<tr> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={if $sort_mode eq 'nl_id_desc'}nl_id_asc{else}nl_id_desc{/if}">{tr}ID{/tr}</a></th> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></th> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={if $sort_mode eq 'description_desc'}description_asc{else}description_desc{/if}">{tr}description{/tr}</a></th> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={if $sort_mode eq 'users_desc'}users_asc{else}users_desc{/if}">{tr}users{/tr}</a></th> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={if $sort_mode eq 'editions_desc'}editions_asc{else}editions_desc{/if}">{tr}editions{/tr}</a></th> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={if $sort_mode eq 'last_sent_desc'}last_sent_asc{else}last_sent_desc{/if}">{tr}last sent{/tr}</a></th> -<th>{tr}action{/tr}</th> -</tr> -{cycle values="even,odd" print=false} -{foreach key=nlId from=$newsletters item=nl} -<tr class="{cycle}"> -<td>{$nlIid}</td> -<td>{$nl.title}</td> -<td>{$nl.data}</td> -<td>{$nl.users} ({$channels[user].confirmed})</td> -<td>{$nl.editions}</td> -<td>{$nl.last_sent|bit_short_datetime}</td> -<td> - <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={$sort_mode}&remove=1&nl_id={$nlId}">{tr}remove{/tr}</a> - <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={$sort_mode}&nl_id={$nlId}">{tr}edit{/tr}</a> - <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/admin_newsletter_subscriptions.php?nl_id={$nlId}">{tr}subscriptions{/tr}</a> - {if $channels[user].individual eq 'y'}({/if}<a href="{$smarty.const.KERNEL_PKG_URL}object_permissions.php?objectName=newsletter%20{$nl.title}&object_type={$smarty.const.BITNEWSLETTER_CONTENT_TYPE_GUID}&permType=newsletters&object_id={$nlId}">{tr}perms{/tr}</a>{if $nl.individual eq 'y'}){/if} -</td> -</tr> -{/foreach} -</table> - -{pagination} ->>>>>>> 1.4 diff --git a/templates/send_newsletters.tpl b/templates/send_newsletters.tpl index 8d9f273..22c3449 100644 --- a/templates/send_newsletters.tpl +++ b/templates/send_newsletters.tpl @@ -27,12 +27,12 @@ <h2>{tr}Prepare a newsletter to be sent{/tr}</h2> <form action="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php" method="post" id='editpageform'> <table class="panel"> -<tr><td>{tr}Subject{/tr}:</td><td><input type="text" maxlength="250" size="40" name="subject" value="{$info.subject|escape}" /></td></tr> +<tr><td>{tr}Subject{/tr}:</td><td><input type="text" maxlength="250" size="40" name="title" value="{$info.subject|escape}" /></td></tr> <tr><td>{tr}Newsletter{/tr}:</td><td> <select name="nl_id"> -{section loop=$newsletters name=ix} -<option value="{$newsletters[ix].nl_id|escape}" {if $newsletters[ix].nl_id eq $nl_id}selected="selected"{/if}>{$newsletters[ix].name}</option> -{/section} +{foreach from=$newsletters item=nl key=nlId} +<option value="{$nlId|escape}" {if $nlId eq $nl_id}selected="selected"{/if}>{$nl.title}</option> +{/foreach} </select> </td></tr> {if $tiki_p_use_content_templates eq 'y'} @@ -45,7 +45,7 @@ </select> </td></tr> {/if} -<tr><td>{tr}Data{/tr}:</td><td><textarea name="data" rows="25" cols="60">{$info.data|escape}</textarea></td></tr> +<tr><td>{tr}Data{/tr}:</td><td><textarea name="edit" rows="25" cols="60">{$info.data|escape}</textarea></td></tr> <tr class="panelsubmitrow"><td colspan="2"> <input type="submit" name="preview" value="{tr}Preview{/tr}" /> <input type="submit" name="save" value="{tr}Send Newsletters{/tr}" /> </td></tr> @@ -75,18 +75,18 @@ <th>{tr}action{/tr}</th> </tr> {cycle values="even,odd" print=false} -{section name=user loop=$channels} +{foreach from=$editions key=edId item=ed} <tr class="{cycle}"> -<td>{$channels[user].name}</td> -<td>{$channels[user].subject}</td> -<td>{$channels[user].users}</td> -<td>{$channels[user].sent|bit_short_datetime}</td> +<td>{$ed.title}</td> +<td>{$ed.subject}</td> +<td>{$ed.users}</td> +<td>{$ed.sent|bit_short_datetime}</td> <td> - <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].edition_id}">{tr}remove{/tr}</a> - <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={$sort_mode}&edition_id={$channels[user].edition_id}">{tr}use{/tr}</a> + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={$sort_mode}&remove={$ed.edition_id}">{tr}remove{/tr}</a> + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={$sort_mode}&edition_id={$ed.edition_id}">{tr}use{/tr}</a> </td> </tr> -{/section} +{/foreach} </table> <div class="pagination"> |
