Permalink
Browse files

Removed smarty from mailings_history and related files

  • Loading branch information...
1 parent 49d97dd commit b4af968adc680b922f9431559ce9ece869ee37b6 @soonick committed Dec 4, 2011
View
@@ -1,38 +1,42 @@
<?php
/**
- * Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * Original Code Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * released originally under GPLV2
*
- * This file is part of poMMo (http://www.pommo.org)
+ * This file is part of poMMo.
+ *
+ * poMMo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * poMMo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
- * poMMo is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or any later version.
- *
- * poMMo is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with program; see the file docs/LICENSE. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * This fork is from https://github.com/soonick/poMMo
+ * Please see docs/contribs for Contributors
+ *
*/
/**********************************
INITIALIZATION METHODS
*********************************/
-require ('../bootstrap.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Mailing.php');
+require '../bootstrap.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Mailing.php';
Pommo::init();
-$logger = & Pommo::$_logger;
-
+$logger = Pommo::$_logger;
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
-require_once(Pommo::$_baseDir.'classes/Pommo_Template.php');
-$smarty = new Pommo_Template();
+require_once Pommo::$_baseDir.'classes/Pommo_Template.php';
+$view = new Pommo_Template();
// fetch the mailing IDs
$mailingIDS = $_REQUEST['mailings'];
@@ -43,7 +47,7 @@
/**********************************
JSON OUTPUT INITIALIZATION
*********************************/
-require_once(Pommo::$_baseDir.'classes/Pommo_Json.php');
+require_once Pommo::$_baseDir.'classes/Pommo_Json.php';
$json = new Pommo_Json(false); // do not toggle escaping
// EXAMINE CALL
@@ -97,14 +101,14 @@
$logger->addMsg(Pommo::_T('Please Wait').'...');
$params = $json->encode(array('ids' => $mailingIDS));
- $smarty->assign('callbackFunction','deleteMailing');
- $smarty->assign('callbackParams',$params);
+ $view->assign('callbackFunction','deleteMailing');
+ $view->assign('callbackParams',$params);
break;
default:
$logger->AddErr('invalid call');
break;
}
-$smarty->display('admin/rpc.tpl');
-?>
+$view->display('admin/rpc');
+
View
@@ -1,49 +1,54 @@
<?php
/**
- * Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * Original Code Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * released originally under GPLV2
*
- * This file is part of poMMo (http://www.pommo.org)
+ * This file is part of poMMo.
+ *
+ * poMMo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * poMMo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
- * poMMo is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or any later version.
- *
- * poMMo is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with program; see the file docs/LICENSE. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * This fork is from https://github.com/soonick/poMMo
+ * Please see docs/contribs for Contributors
+ *
*/
-
+
/**********************************
INITIALIZATION METHODS
*********************************/
-require ('../bootstrap.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Mailing.php');
+require '../bootstrap.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Mailing.php';
Pommo::init();
-$logger = & Pommo::$_logger;
-$dbo = & Pommo::$_dbo;
+$logger = Pommo::$_logger;
+$dbo = Pommo::$_dbo;
if(isset($_REQUEST['mailings'])) {
if(is_array($_REQUEST['mailings']))
$_REQUEST['mailings'] = $_REQUEST['mailings'][0];
$mailing = current(Pommo_Mailing::get(array('id' => $_REQUEST['mailings'])));
}
else
+{
$mailing = Pommo::$_session['state']['mailing'];
+}
-
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
-require_once(Pommo::$_baseDir.'classes/Pommo_Template.php');
-$smarty = new Pommo_Template();
+require_once Pommo::$_baseDir.'classes/Pommo_Template.php';
+$view = new Pommo_Template();
+
+$view->assign($mailing);
+$view->display('inc/mailing');
-$smarty->assign($mailing);
-$smarty->display('inc/mailing.tpl');
-Pommo::kill();
-?>
View
@@ -1,28 +1,33 @@
<?php
/**
- * Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * Original Code Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <bhb@iceburg.net>
+ * released originally under GPLV2
*
- * This file is part of poMMo (http://www.pommo.org)
+ * This file is part of poMMo.
+ *
+ * poMMo is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * poMMo is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Pommo. If not, see <http://www.gnu.org/licenses/>.
*
- * poMMo is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or any later version.
- *
- * poMMo is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with program; see the file docs/LICENSE. If not, write to the
- * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * This fork is from https://github.com/soonick/poMMo
+ * Please see docs/contribs for Contributors
+ *
*/
/**********************************
INITIALIZATION METHODS
*********************************/
-require ('bootstrap.php');
-require_once(Pommo::$_baseDir.'classes/Pommo_Mailing.php');
+require 'bootstrap.php';
+require_once Pommo::$_baseDir.'classes/Pommo_Mailing.php';
Pommo::init();
$logger = Pommo::$_logger;
@@ -31,10 +36,9 @@
/**********************************
SETUP TEMPLATE, PAGE
*********************************/
-require_once(Pommo::$_baseDir.'classes/Pommo_Template.php');
-$smarty = new Pommo_Template();
-$smarty->assign('returnStr', Pommo::_T('Mailings Page'));
-
+require_once Pommo::$_baseDir.'classes/Pommo_Template.php';
+$view = new Pommo_Template();
+$view->assign('returnStr', Pommo::_T('Mailings Page'));
/** SET PAGE STATE
* limit - # of mailings per page
@@ -84,10 +88,9 @@
ceil($tally/$state['limit']) :
0;
-$smarty->assign('state',$state);
-$smarty->assign('tally',$tally);
-$smarty->assign('mailings', $mailings);
+$view->assign('state',$state);
+$view->assign('tally',$tally);
+$view->assign('mailings', $mailings);
-$smarty->display('admin/mailings/mailings_history.tpl');
-Pommo::kill();
+$view->display('admin/mailings/mailings_history');
@@ -106,7 +106,7 @@ class="navimage right" alt="thunderbolt icon" />
var pommo = {
status: null,
- poll: function(get){get = get || ''; $.getJSON("ajax/status_poll.php?id={/literal}<?php echo $this->mailing['id']; ?>{literal}&"+get,pommo.process)},
+ poll: function(get){get = get || ''; $.getJSON("ajax/status_poll.php?id=<?php echo $this->mailing['id']; ?>&"+get,pommo.process)},
process: function(mailing) {
$('#status').html(mailing.statusText);
@@ -0,0 +1,136 @@
+<?php
+
+ob_start();
+
+include $this->template_dir.'/inc/ui.dialog.php';
+include $this->template_dir.'/inc/ui.grid.php';
+
+$this->capturedHead = ob_get_clean();
+
+$this->sidebar = false;
+include $this->template_dir.'/inc/admin.header.php';
+
+?>
+
+<ul class="inpage_menu">
+ <li>
+ <a href="admin_mailings.php">
+ <?php
+ echo sprintf(_('Return to %s'), $this->returnStr);
+ ?>
+ </a>
+ </li>
+</ul>
+
+<h2><?php echo _('Mailings History'); ?></h2>
+<?php
+
+include $this->template_dir.'/inc/messages.php';
+
+if ($this->tally > 0)
+{
+?>
+ <table id="grid" class="scroll" cellpadding="0" cellspacing="0"></table>
+ <div id="gridPager" class="scroll" style="text-align:center;"></div>
+
+ <ul class="inpage_menu">
+ <li><a href="ajax/mailing_preview.php" class="modal visit"><img src="<?php echo $this->url['theme']['shared']; ?>images/icons/mailing_small.png"/><?php echo _('View Mailing'); ?></a></li>
+ <li><a href="ajax/history.rpc.php?call=notice" class="modal"><img src="<?php echo $this->url['theme']['shared']; ?>images/icons/examine_small.png"/><?php echo _('View Last Notices'); ?></a></li>
+ <li><a href="ajax/history.rpc.php?call=reload" class="modal visit"><img src="<?php echo $this->url['theme']['shared']; ?>images/icons/typewritter_small.png"/><?php echo _('Reload Checked Mailing'); ?></a></li>
+ <li><a href="ajax/history.rpc.php?call=delete" class="modal confirm"><img src="<?php echo $this->url['theme']['shared']; ?>images/icons/delete.png"/><?php echo _('Delete Checked Mailings'); ?></a></li>
+ </ul>
+
+ <script type="text/javascript">
+ $().ready(function() {
+
+ var p = {
+ colNames: [
+ 'ID',
+ '<?php echo _('Subject'); ?>',
+ '<?php echo _('Group (count)'); ?>',
+ '<?php echo _('Sent'); ?>',
+ '<?php echo _('Started'); ?>',
+ '<?php echo _('Finished'); ?>',
+ '<?php echo _('Status'); ?>',
+ '<?php echo _('Hits'); ?>',
+ ],
+ colModel: [
+ {name: 'id', index: 'id', hidden: true, width: 1},
+ {name: 'subject', width: 110},
+ {name: 'group', width: 120},
+ {name: 'sent', width: 40},
+ {name: 'start', width: 130},
+ {name: 'end', width: 100},
+ {name: 'status', width: 70},
+ {name: 'hits', width: 70}
+ ],
+ url: 'ajax/history.list.php'
+ };
+
+ poMMo.grid = PommoGrid.init('#grid',p);
+ });
+ </script>
+
+ <script type="text/javascript">
+ $().ready(function(){
+
+ // Setup Modal Dialogs
+ PommoDialog.init();
+
+ $('a.modal').click(function(){
+ var rows = poMMo.grid.getRowIDs();
+ if(rows) {
+
+ // check for confirmation
+ if($(this).hasClass('confirm') && !poMMo.confirm())
+ return false;
+
+ // serialize the data
+ var data = $.param({'mailings[]': rows});
+
+ // rewrite the HREF of the clicked element
+ var oldHREF = this.href;
+ this.href += (this.href.match(/\?/) ? "&" : "?") + data
+
+ // trigger the modal dialog, or visit the URL
+ if($(this).hasClass('visit'))
+ window.location = this.href;
+ else
+ $('#dialog').jqmShow(this);
+
+ // restore the original HREF
+ this.href = oldHREF;
+
+ poMMo.grid.reset();
+
+ }
+ return false;
+ });
+ });
+
+ poMMo.callback.deleteMailing = function(p) {
+ poMMo.grid.delRow(p.ids);
+ $('#dialog').jqmHide();
+ }
+
+ </script>
+<?php
+}
+else
+{
+?>
+ <strong><?php echo _('No records returned.'); ?></strong>
+<?php
+}
+
+ob_start();
+
+$this->dialogId = 'dialog';
+$this->dialogWide = true;
+$this->dialogTall = true;
+include $this->template_dir.'/inc/dialog.php';
+
+$this->capturedDialogs = ob_get_clean();
+
+include $this->template_dir.'/inc/admin.footer.php';
+
Oops, something went wrong.

0 comments on commit b4af968

Please sign in to comment.