Beispiel #1
0
        $log = _MD_EVALS . " ({$eval})";
        $log .= "\n" . sprintf(_CC_LOG_STATUS, $msg_status[$s], $msg_status[_STATUS_CLOSE]);
        $evalmsg = _MD_EVALS . " ({$eval})\n{$com}";
        $tags = array('X_COMMENT_URL' => XOOPS_URL . "/modules/" . basename(dirname(__FILE__)) . "/message.php?id={$msgid}\n\n" . $evalmsg);
        $notification_handler =& xoops_gethandler('notification');
        $notification_handler->triggerEvent('message', $msgid, 'comment', $tags);
        cc_log_message($formid, $log, $msgid);
        redirect_header($redirect, 1, _MD_EVAL_THANKYOU);
    } else {
        redirect_header($redirect, 3, _NOPERM);
    }
} elseif (!empty($_POST['status'])) {
    $stat = $myts->stripSlashesGPC($_POST['status']);
    $res = $xoopsDB->query("SELECT fidref FROM " . CCMES . " WHERE msgid={$msgid}");
    list($fid) = $xoopsDB->fetchRow($res);
    if (change_message_status($msgid, $uid, $stat)) {
        if ($stat == 'x') {
            $redirect = "reception.php?form={$fid}";
        }
        // delete the message
        redirect_header($redirect, 1, _MD_UPDATE_STATUS);
        exit;
    }
    redirect_header($redirect, 3, _MD_UPDATE_FAILED);
} else {
    switch ($_POST['op']) {
        case 'myself':
            $res = $xoopsDB->query("SELECT fidref,status,title FROM " . CCMES . " LEFT JOIN " . FORMS . " ON formid=fidref WHERE msgid={$msgid} AND touid=0");
            if ($res && $xoopsDB->getRowsNum($res)) {
                list($fid, $s, $title) = $xoopsDB->fetchRow($res);
                $now = time();
Beispiel #2
0
<?php

// show messages file
// $Id: message.php,v 1.28 2012/01/21 16:55:15 nobu Exp $
include "../../mainfile.php";
include "functions.php";
$myts =& MyTextSanitizer::getInstance();
$xoopsOption['template_main'] = "ccenter_message.html";
$uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
$msgid = intval($_GET['id']);
$data = cc_get_message($msgid);
// change to accept status when change user access
if ($uid && $uid == $data['touid'] && $data['status'] == _STATUS_NONE) {
    change_message_status($msgid, $uid, _STATUS_ACCEPT);
    $data['status'] = _STATUS_ACCEPT;
}
// recording contactee access time
$now = time();
if ($uid == $data['uid'] && $now > $data['atime']) {
    $xoopsDB->queryF("UPDATE " . CCMES . " SET atime={$now} WHERE msgid={$msgid}");
}
include XOOPS_ROOT_PATH . "/header.php";
$breadcrumbs = new XoopsBreadcrumbs(_MD_CCENTER_RECEPTION, 'reception.php');
$pass = isset($_GET['p']) ? $_GET['p'] : '';
$add = $pass ? "p=" . urlencode($pass) : "";
$to_uname = XoopsUser::getUnameFromId($data['touid']);
$res = $xoopsDB->query("SELECT * FROM " . FORMS . " WHERE formid=" . $data['fidref']);
$form = $xoopsDB->fetchArray($res);
$items = get_form_attribute($form['defs']);
$raws = unserialize_text($data['body']);
$values = cc_display_values($raws, $items, $data['msgid'], $add);
Beispiel #3
0
                // switch person in charge
                $notification_handler =& xoops_gethandler('notification');
                $notification_handler->subscribe('message', $msgid, 'comment', null, null, $touid);
                $notification_handler->subscribe('message', $msgid, 'status', null, null, $touid);
            }
            cc_log_message($data['fidref'], $log, $msgid);
            redirect_header($back, 1, _AM_MSG_UPDATED);
            exit;
        }
    }
    redirect_header($back, 3, _AM_MSG_UPDATE_FAIL);
    exit;
} elseif (!empty($op)) {
    $uid = $xoopsUser->getVar('uid');
    foreach ($_POST['ids'] as $msgid) {
        change_message_status(intval($msgid), 0, $op);
    }
    $back = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "msgadm.php";
    redirect_header($back, 1, _AM_MSG_UPDATED);
    exit;
}
xoops_cp_header();
include "mymenu.php";
if (empty($_GET['msgid'])) {
    msg_list();
} else {
    msg_detail(intval($_GET['msgid']));
}
xoops_cp_footer();
function msg_list()
{