summaryrefslogtreecommitdiff
path: root/admin/send.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2005-12-09 20:26:01 +0000
committerChristian Fowler <spider@viovio.com>2005-12-09 20:26:01 +0000
commitc92dac62ef584adc12fc21a4bb16d1b87cf3e653 (patch)
tree43f7c4092a6b23d660b7a4dd1ef989011c6f4c04 /admin/send.php
parent49bb4c05a88dbda1f3cc3db8486fbcf938eeb081 (diff)
downloadnewsletters-c92dac62ef584adc12fc21a4bb16d1b87cf3e653.tar.gz
newsletters-c92dac62ef584adc12fc21a4bb16d1b87cf3e653.tar.bz2
newsletters-c92dac62ef584adc12fc21a4bb16d1b87cf3e653.zip
creation of BitNewsletterEdition and get send.php warmed up. paused on thought of how to deal with sending a arbitrary content_id instead...
Diffstat (limited to 'admin/send.php')
-rw-r--r--admin/send.php96
1 files changed, 23 insertions, 73 deletions
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');