<div class="columns small-8">
		<div class="row">
			<div class="columns small-8">
				<select name="CannedMessage-<?php 
echo $chat->id;
?>
" id="id_CannedMessage-<?php 
echo $chat->id;
?>
">
					<option value=""><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Select a canned message');
?>
</option>
				<?php 
foreach (erLhcoreClassModelCannedMsg::getList() as $item) {
    ?>
					<option data-delay="<?php 
    echo $item->delay;
    ?>
" value="<?php 
    echo $item->id;
    ?>
"><?php 
    echo htmlspecialchars($item->msg);
    ?>
</option>
				<?php 
}
?>
				</select>
<?php

$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('user/account') . '/(tab)/canned';
$pages->items_total = erLhcoreClassModelCannedMsg::getCount(array('filter' => array('user_id' => $user->id)));
$pages->setItemsPerPage(10);
$pages->paginate();
$cannedMessages = array();
if ($pages->items_total > 0) {
    $cannedMessages = erLhcoreClassModelCannedMsg::getList(array('filter' => array('user_id' => $user->id), 'offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id ASC'));
}
?>

<table class="twelve" cellpadding="0" cellspacing="0">
<thead>
<tr>
    <th width="1%">ID</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/cannedmsg', 'Message');
?>
</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/cannedmsg', 'Delay');
?>
</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/cannedmsg', 'Position');
?>
</th>
    <th width="1%">&nbsp;</th>
    <th width="1%">&nbsp;</th>
예제 #3
0
if (is_numeric($Params['user_parameters_unordered']['id']) && $Params['user_parameters_unordered']['action'] == 'delete') {
    // Delete selected canned message
    try {
        if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
            die('Invalid CSRF Token');
            exit;
        }
        $Msg = erLhcoreClassChat::getSession()->load('erLhcoreClassModelCannedMsg', (int) $Params['user_parameters_unordered']['id']);
        if ($userDepartments === true || in_array($Msg->department_id, $userDepartments)) {
            $Msg->removeThis();
        }
    } catch (Exception $e) {
        // Do nothing
    }
    erLhcoreClassModule::redirect('chat/cannedmsg');
    exit;
}
$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('chat/cannedmsg');
$pages->items_total = erLhcoreClassModelCannedMsg::getCount($departmentParams);
$pages->setItemsPerPage(20);
$pages->paginate();
$items = array();
if ($pages->items_total > 0) {
    $items = erLhcoreClassModelCannedMsg::getList(array_merge(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id ASC'), $departmentParams));
}
$tpl->set('items', $items);
$tpl->set('pages', $pages);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/cannedmsg', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('chat/cannedmsg'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/cannedmsg', 'Canned messages')));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.cannedmsg_path', array('result' => &$Result));