function displayTLCUsers($which, $display_type = '')
{
    $users = getTLCUsers($which);
    if ($display_type == 'admin') {
        $template_name = 'admin/list_tlc_users_admin.tpl';
    } else {
        $template_name = 'admin/list_tlc_users.tpl';
    }
    $tpl = new PSU\Template();
    $tpl->assign('users', $users);
    return $tpl->fetch($template_name);
}
 public static function mail($id)
 {
     $tpl = new PSU\Template();
     $f = PSU::db('myplymouth')->GetRow("SELECT * FROM anejf WHERE id_ = ?", array($id));
     $form = new AnejfApply($f, true);
     $form->readonly(true);
     $tpl->assign('form', $form);
     $message = $tpl->fetch('email.tpl');
     $to = '*****@*****.**';
     if (PSU::isdev()) {
         $to = '*****@*****.**';
     }
     $subject = sprintf("[ANEJF %d] Application for %s %s", $GLOBALS['ANEJF']['YEAR'], $form->first_name->value(), $form->last_name->value());
     PSU::mail($to, $subject, $message, 'Content-Type: text/html');
 }
 function __construct($title = null)
 {
     parent::__construct($title);
     $this->assign('user_type', $_SESSION['user_type']);
 }
Пример #4
0
 * Bring in Zend since it is external.
 * Also bring in our own included API
 */
require_once 'autoload.php';
require_once $GLOBALS['BASE_DIR'] . '/includes/RSSAPI.class.php';
/**
 * Start our PSU Session handler
 */
PSU::session_start();
/**
 * Start the translation to handle this as an object...??
 */
ob_start('RSSAPI::translate');
use PSU\Feed;
$id = $_GET['channel_id'] ?: 'rsschannel';
$tpl = new PSU\Template();
$tpl->channel(array('channel_js_callback' => "\$.my.rss.init('" . $id . "')"));
/**
 * Go through, and assess if variables different from the defaults have been passed in, 
 * and set them accordingly.
 */
$num = $_GET['num'] ?: 5;
// records to show
$open = $_GET['open'] ?: 0;
// initially expanded items
$expand = isset($_GET['expand']) ? $_GET['expand'] : Feed::EXPAND_DISABLED;
// 0 is a valid value; use isset
$summary = isset($_GET['summary']) ? $_GET['summary'] : Feed::BODY_FULL;
$title = $_GET['title'] ? Feed::FIELD_SHOW : Feed::FIELD_HIDE;
$read_more = $_GET['read_more'] ?: 'Read more';
$desc = isset($_GET['desc']) ? $_GET['desc'] : Feed::FIELD_HIDE;
<?php

respond(function ($request, $response, $app) {
    PSU::session_start();
    $GLOBALS['BASE_URL'] = '/app/festivals/music-career-day';
    $app->event_year = 2012;
    $GLOBALS['TITLE'] = "{$app->event_year} Music Technology and Education Career Day";
    $GLOBALS['TEMPLATES'] = PSU_BASE_DIR . '/app/festivals/music-career-day/templates';
    if (!isset($_SESSION['mtecd'])) {
        $_SESSION['mtecd'] = array();
    }
    $app->mail = function ($id) {
        $tpl = new PSU\Template();
        $f = PSU::db('myplymouth')->GetRow("SELECT * FROM mte_career_day WHERE id_ = ?", array($id));
        $form = new PSU\Festivals\MusicCareerDay\Model($f, true);
        $form->readonly(true);
        $tpl->assign('form', $form);
        $message = $tpl->fetch('email.tpl');
        $to = array('*****@*****.**');
        if (PSU::isdev()) {
            $to[0] = '*****@*****.**';
        }
        $subject = sprintf("[MTECD {$app->event_year}] Application for %s %s", $form->first_name->value(), $form->last_name->value());
        PSU::mail($to, $subject, $message, 'Content-Type: text/html');
    };
    $app->tpl = new PSU\Template();
    $app->tpl->assign('event_year', $app->event_year);
});
respond('/apply', function ($request, $response, $app) {
    $f = isset($_SESSION['mtecd']['f']) ? $_SESSION['mtecd']['f'] : array();
    $form = new PSU\Festivals\MusicCareerDay\Model($f);
Пример #6
0
require dirname(__DIR__) . '/webapp/calllog/includes/functions/tlc_users_functions.php';
// needed to fetch all the active users
require dirname(__DIR__) . '/webapp/calllog/includes/functions/user.class.php';
// needed to fetch high priority user groups
require dirname(__DIR__) . '/webapp/calllog/includes/functions/open_call_functions.php';
// needed to fetch open calls
$GLOBALS['db'] = PSU::db('calllog');
$GLOBALS['BANNER'] = PSU::db('banner');
$GLOBALS['BannerGeneral'] = new BannerGeneral($GLOBALS['BANNER']);
$GLOBALS['user'] = new User(PSU::db('calllog'));
$HOST = 'https://www.plymouth.edu';
$GLOBALS['BASE_URL'] = $HOST . '/webapp/calllog';
$GLOBALS['BASE_DIR'] = dirname(__FILE__);
$GLOBALS['TEMPLATES'] = dirname(__DIR__) . '/webapp/calllog/templates';
$GLOBALS['CALLLOG_WEB'] = $GLOBALS['BASE_URL'] . '/calls/my/';
$tpl = new PSU\Template();
$users = getTLCUsers('active');
foreach ($users as $person) {
    $reminder = $GLOBALS['user']->getReminderSetting($person['user_name']);
    if ($reminder == 'yes') {
        $options = array('which' => 'my', 'who' => $person['user_name']);
        $calls = getOpenCalls($options);
        if (count($calls) > 0) {
            $tpl->assign('calls', $calls);
            $tpl->assign('user', $person);
            $html = $tpl->fetch('email.calls.tpl');
            $text = 'This email is optimized for HTML.  View your open calls here: ' . $GLOBALS['CALLLOG_WEB'];
            $p = new PSUPerson($person['user_name']);
            PSU::mail($p->email['CA'][0], '[CallLog] Daily Open Call Report', array($text, $html));
        }
        // end if