Example #1
0
			
				<div class="pull-right" style="margin-bottom: 8px;margin-left: 8px;">
					<i>
						<?php 
        echo FSS_Helper::Date($message['posted'], FSS_DATETIME_MID);
        ?>
					</i>
				</div>
				
				<div id="message_<?php 
        echo (int) $message['id'];
        ?>
">
					<?php 
        $msg = $message['body'];
        $msg = FSS_Helper::ParseBBCode($msg, $message);
        echo $msg;
        ?>
				</div>
				
				<?php 
        if (array_key_exists("attach", $message)) {
            ?>
					<?php 
            foreach ($message['attach'] as &$attach) {
                ?>
						<div class="padding-mini">
							<a href='<?php 
                echo FSSRoute::_('index.php?option=com_fss&view=ticket&fileid=' . $attach['id']);
                ?>
'>
Example #2
0
 static function ParseMessageRows(&$messages, $ishtml, $foruser = false)
 {
     $template = self::Get_Template('messagerow');
     $result = "";
     foreach ($messages as &$message) {
         $vars = array();
         //print_p($message);
         if ($message['name']) {
             $vars[] = self::BuildVar('name', $message['name']);
             $vars[] = self::BuildVar('email', $message['email']);
             $vars[] = self::BuildVar('username', $message['username']);
         } else {
             $vars[] = self::BuildVar('name', 'Unknown');
             $vars[] = self::BuildVar('email', 'Unknown');
             $vars[] = self::BuildVar('username', 'Unknown');
         }
         $vars[] = self::BuildVar('subject', $message['subject']);
         $vars[] = self::BuildVar('posted', FSS_Helper::Date($message['posted']));
         $message['body'] = FSS_Helper::ParseBBCode($message['body'], null, false, false, $foruser);
         if ($ishtml) {
             $message['body'] = str_replace("\n", "<br>\n", $message['body']);
             $vars[] = self::BuildVar('body', $message['body'] . "<br />");
         } else {
             $vars[] = self::BuildVar('body', $message['body'] . "\n");
         }
         $result .= self::ParseText($template['body'], $vars);
     }
     return $result;
 }
Example #3
0
 static function parseTitle($title, $ticketid)
 {
     // This needs updating to use loaded messages if we have them
     if (trim($title) != "") {
         return $title;
     } else {
         // no title for the ticket, so load the oldest message, and display the first part of that
         $db = JFactory::getDBO();
         $qry = "SELECT * FROM #__fss_ticket_messages WHERE ticket_ticket_id = " . $db->escape($ticketid) . " ORDER BY posted ASC LIMIT 1";
         $db->setQuery($qry);
         $message = $db->loadObject();
         $msg = $message->body;
         $msg = FSS_Helper::ParseBBCode($msg);
         $msg = strip_tags($msg);
         if (trim($msg) != "") {
             if (strlen($msg) > 50) {
                 return substr($msg, 0, 50) . "...";
             }
             return $msg;
         } else {
             return JText::_('NO_SUBJECT');
         }
     }
 }
Example #4
0
 static function ParseSig($text, $ticket, $bbcode = true)
 {
     if (!is_object($ticket)) {
         echo "CALLING PARSESIG WITHOUT TICKET OBJECT!";
         exit;
     }
     $parser = new FSSParser();
     $parser->template = $text;
     $parser->Clear();
     FSSParserTicket::core($parser, $ticket);
     $user = JFactory::getUser();
     $parser->SetVar('handlername', $user->name);
     $parser->SetVar('handlerusername', $user->username);
     $parser->SetVar('handleremail', $user->email);
     $text = $parser->Parse();
     if ($bbcode) {
         return FSS_Helper::ParseBBCode($text);
     }
     return $text;
 }
Example #5
0
<?php 
if (FSS_Permission::auth("core.create", "com_fss.faq")) {
    ?>
	<div style="display: none;">
		<form id="ticket_to_faq" action="<?php 
    echo JRoute::_("index.php?option=com_fss&view=admin_content&type=faqs&what=new");
    ?>
" method="POST" target="_blank">
			<input name="option" value="com_fss" />
			<input name="view" value="admin_content" />
			<input name="type" value="faqs" />
			<input name="what" value="new" />
			<input name="question" value="<?php 
    echo FSS_Helper::escape($this->ticket->title);
    ?>
" />
			<textarea name="answer"><?php 
    foreach ($this->ticket->messages as $message) {
        if ($message->admin == 3) {
            continue;
        }
        $msg = FSS_Helper::ParseBBCode($message->body, $message);
        echo FSS_Helper::escape($msg) . "\n";
        //echo "<hr />\n";
    }
    ?>
</textarea>
		</form>
	</div>
<?php 
}
Example #6
0
				<div class="pull-right" style="margin-bottom: 8px;margin-left: 8px;">
					<i>
						<?php 
    echo FSS_Helper::TicketTime($message['posted'], FSS_DATETIME_MID);
    ?>
					</i>
				</div>
				
				<?php 
    if (strpos($message['body'], "[cid:") !== false) {
        require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'cron' . DS . 'emailcheck.php';
        $ec = new FSSCronEMailCheck();
        $message['body'] = $ec->processInlineImages($message['id']);
    }
    $msg = $message['body'];
    $msg = FSS_Helper::ParseBBCode($msg, $message, false, false, true);
    echo $msg;
    ?>
				
				<?php 
    if (array_key_exists("attach", $message)) {
        ?>
					<?php 
        foreach ($message['attach'] as &$attach) {
            ?>
					<?php 
            if ($attach['inline']) {
                continue;
            }
            ?>
						<div class="padding-mini">
<?php

/**
 * @package Freestyle Joomla
 * @author Freestyle Joomla
 * @copyright (C) 2013 Freestyle Joomla
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
defined('_JEXEC') or die;
echo FSS_Helper::PageStylePopup(true);
echo FSS_Helper::PageTitlePopup('Signature Preview');
?>

<?php 
echo FSS_Helper::ParseBBCode(trim($this->signature));
?>

<?php 
echo FSS_Helper::PageStylePopupEnd();
Example #8
0
function OutputField($field, $value)
{
    if (!isset($field->format)) {
        echo $value;
        return;
    }
    if ($field->format == "date") {
        if ($value != "" && $value != "0000-00-00" && $value != "0000-00-00 00:00:00") {
            $format = "Y-m-d";
            if (isset($field->dateformat)) {
                $format = $field->dateformat;
            }
            if (substr($format, 0, 5) == "DATE_") {
                $format = JText::_($format);
            }
            $jdate = new JDate($value);
            echo $jdate->format($format);
        } elseif (isset($field->blank)) {
            echo $field->blank;
        }
    } elseif ($field->format == "messagetime") {
        if ($value < 1) {
            echo "";
        } else {
            if ($value > 0 && $value < 86400 * 10) {
                echo date("H:i", $value);
            } else {
                $format = "Y-m-d";
                if (isset($field->dateformat)) {
                    $format = $field->dateformat;
                }
                $jdate = new JDate($value);
                echo $jdate->format($format);
            }
        }
    } elseif ($field->format == "hm") {
        $val = $value;
        $mins = $val % 60;
        $hrs = floor($val / 60);
        echo sprintf("%d:%02d", $hrs, $mins);
    } elseif ($field->format == "bbcode") {
        echo FSS_Helper::ParseBBCode($value);
    } else {
        echo $value;
    }
}