public static function getSubject($id) { $dbo =& Pommo::$_dbo; $query = "\n SELECT subject FROM " . $dbo->table['mailings'] . "WHERE mailing_id = %i"; $query = $dbo->prepare($query, array($id)); return $dbo->query($query, 0); }
// fetch the mailing IDs $mailingIDS = $_REQUEST['mailings']; if (!is_array($mailingIDS)) { $mailingIDS = array($mailingIDS); } /********************************** JSON OUTPUT INITIALIZATION *********************************/ require_once Pommo::$_baseDir . 'classes/Pommo_Json.php'; $json = new Pommo_Json(false); // do not toggle escaping // EXAMINE CALL switch ($_REQUEST['call']) { case 'notice': foreach ($mailingIDS as $id) { $logger->AddMsg('<br /><br />###' . sprintf(Pommo::_T('Displaying notices for mailing %s'), Pommo_Mailing::getSubject($id)) . ' ###<br /><br />'); $notices = Pommo_Mailing::getNotices($id); $logger->AddMsg($notices); } break; case 'reload': require_once Pommo::$_baseDir . 'classes/Pommo_Groups.php'; $mailing = current(Pommo_Mailing::get(array('id' => $_REQUEST['mailings']))); // change group name to ID $groups = Pommo_Groups::getNames(); $gid = 'all'; foreach ($groups as $group) { if ($group['name'] == $mailing['group']) { $gid = $group['id']; } }