Commit 91998997 authored by lrargerich's avatar lrargerich

minor

parent 380a4ef3
......@@ -1879,6 +1879,7 @@ tiki/lib/commentslib.php -text
tiki/lib/dcs/dcslib.php -text
tiki/lib/diff.php -text
tiki/lib/directory/dirlib.php -text
tiki/lib/drawings/drawlib.php -text
tiki/lib/ephemerides/ephlib.php -text
tiki/lib/faqs/faqlib.php -text
tiki/lib/filegals/filegallib.php -text
......@@ -2848,6 +2849,7 @@ tiki/tiki-live_support_chat_frame.php -text
tiki/tiki-live_support_chat_window.php -text
tiki/tiki-live_support_client.php -text
tiki/tiki-live_support_console.php -text
tiki/tiki-live_support_message.php -text
tiki/tiki-live_support_server.php -text
tiki/tiki-login.php -text
tiki/tiki-login_scr.php -text
......
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_live_support_admin','support','Admin live support system','admin');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_live_support','support','Can use live support system','basic');
### Wiki drawings versioning
drop table if exists tiki_drawings;
create table tiki_drawings(
......@@ -14,6 +17,51 @@ create table tiki_drawings(
### Live support chat system
### under construction
drop table if exists tiki_live_support_messages;
create table tiki_live_support_messages(
msgId integer(12) not null auto_increment,
data text,
timestamp integer(14),
user varchar(200),
username varchar(200),
priority integer(2),
status char(1),
assigned_to varchar(200),
resolution varchar(100),
title varchar(200),
module integer(4),
email varchar(250),
primary key(msgId)
);
### Support canned responses for chat
drop table if exists tiki_live_support_modules;
create table tiki_live_support_modules(
modId integer(4) not null auto_increment,
name varchar(90),
primary key(modId)
);
insert into tiki_live_support_modules(name) values('wiki');
insert into tiki_live_support_modules(name) values('forums');
insert into tiki_live_support_modules(name) values('image galleries');
insert into tiki_live_support_modules(name) values('file galleries');
insert into tiki_live_support_modules(name) values('directory');
insert into tiki_live_support_modules(name) values('workflow');
insert into tiki_live_support_modules(name) values('charts');
drop table if exists tiki_live_support_message_comments;
create table tiki_live_support_message_comments(
cId integer(12) not null auto_increment,
msgId integer(12),
data text,
timestamp integer(14),
primary key(cId)
);
drop table if exists tiki_live_support_operators;
create table tiki_live_support_operators(
......
<?php
class DrawLib extends TikiLib {
function DrawLib($db)
{
if(!$db) {
die("Invalid db object passed to DrawLib constructor");
}
$this->db = $db;
}
}
$drawlib= new DrawLib($dbTiki);
?>
\ No newline at end of file
......@@ -6,10 +6,10 @@ function sound() {
var audioEnabled = NSsound || IEsound;
if(audioEnabled) {
if(IEsound) {
document.write('<BGSOUND SRC="sound/aladdin.mid" />');
document.write('<BGSOUND SRC="img/icons/mission.mid" />');
}
if(NSsound) {
document.write('<EMBED SRC="sound/aladdin.mid" HIDDEN="true" AUTOSTART="true" />');
document.write('<EMBED SRC="img/icons/mission.mid" HIDDEN="true" AUTOSTART="true" />');
}
} else {
alert('no sound');
......
......@@ -41,6 +41,53 @@ class LsAdminlib extends Tikilib{
}
return $ret;
}
function post_support_message($username,$user,$user_email,$title,$data,$priority,$module,$resolution,$assigned_to='')
{
die("MISSING CODE");
}
function list_support_messages($offset,$maxRecords,$sort_mode,$find,$where)
{
$sort_mode = str_replace("_desc"," desc",$sort_mode);
$sort_mode = str_replace("_asc"," asc",$sort_mode);
if($find) {
$mid=" where (data like '%".$find."%' or username like '%".$find."%')";
} else {
$mid="";
}
if($where) {
if($mid) {
$mid = ' and '.$where;
} else {
$mid = ' where '.$where;
}
}
$query = "select * from tiki_live_support_messages $mid order by $sort_mode limit $offset,$maxRecords";
$query_cant = "select count(*) from tiki_user_notes $mid";
$result = $this->query($query);
$cant = $this->getOne($query_cant);
$ret = Array();
while($res = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$ret[] = $res;
}
$retval = Array();
$retval["data"] = $ret;
$retval["cant"] = $cant;
return $retval;
}
function get_modules()
{
$query = "select * from tiki_live_support_modules";
$result = $this->query($query);
$ret = Array();
while($res = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$ret[] = $res;
}
return $ret;
}
}
......
......@@ -137,7 +137,7 @@ class Lslib {
$now = date("U");
$query = "update tiki_live_support_requests set operator_id='$operator_id',operator='$user',status='op_accepted',timestamp=$now,chat_started=$now where reqId='$reqId'";
$this->query($query);
$query = "update tiki_live_support_operators set accepted_requests = accepted_requests + 1 where operator='$user'";
$query = "update tiki_live_support_operators set accepted_requests = accepted_requests + 1 where user='$user'";
$this->query($query);
}
......@@ -210,7 +210,8 @@ class Lslib {
{
return $this->getOne("select count(*) from tiki_live_support_operators where status='online'");
}
}
$lslib= new Lslib($dbTiki);
......
......@@ -14,6 +14,7 @@
&nbsp;<a href="tiki-contact.php" class="linkmenu">{tr}contact us{/tr}</a><br/>
{/if}
{if $feature_stats eq 'y' and $tiki_p_view_stats eq 'y'}
&nbsp;<a href="tiki-stats.php" class="linkmenu">{tr}stats{/tr}</a><br/>
{/if}
......@@ -352,11 +353,16 @@
$tiki_p_edit_html_pages eq 'y' or
$tiki_p_view_referer_stats eq 'y' or
$tiki_p_admin_drawings eq 'y' or
$tiki_p_admin_shoutbox eq 'y'
$tiki_p_admin_shoutbox eq 'y' or
$tiki_p_admin_live_support eq 'y' or
$user_is_operator eq 'y'
}
<div class="separator"><a class='separator' href="javascript:setCookie('admmnu','c');hide('admmnu');">[-]</a>{if $tiki_p_admin eq 'y'}<a class='separator' href='tiki-admin.php'>{/if} {tr}Admin (click!){/tr}{if $tiki_p_admin eq 'y'}</a>{/if} <a class='separator' href="javascript:setCookie('admmnu','o');show('admmnu');">[+]</a></div>
<div id='admmnu' style="{$mnu_admmnu}">
{if $feature_live_support eq 'y' and ($tiki_p_live_support_admin eq 'y' or $user_is_operator eq 'y')}
&nbsp;<a href="tiki-live_support_admin.php" class="linkmenu">{tr}Live support{/tr}</a><br/>
{/if}
{if $tiki_p_admin eq 'y'}
&nbsp;<a href="tiki-adminusers.php" class="linkmenu">{tr}Users{/tr}</a><br/>
......
......@@ -90,6 +90,7 @@
<a class="link" href="tiki-assignpermission.php?sort_mode={$sort_mode}&amp;group={$group}&amp;type=workflow">{tr}Workflow{/tr}</a>|
<a class="link" href="tiki-assignpermission.php?sort_mode={$sort_mode}&amp;group={$group}&amp;type=charts">{tr}Charts{/tr}</a>
<a class="link" href="tiki-assignpermission.php?sort_mode={$sort_mode}&amp;group={$group}&amp;type=extwiki">{tr}ExtWikis{/tr}</a>
<a class="link" href="tiki-assignpermission.php?sort_mode={$sort_mode}&amp;group={$group}&amp;type=support">{tr}Live support{/tr}</a>
]
</td>
</tr>
......
......@@ -2,7 +2,9 @@
<br/><br/>
[ <a class="link" {jspopup href="tiki-live_support_console.php"}>{tr}Open operator console{/tr}</a> |
<a class="link" {jspopup width="300" height="450" href="tiki-live_support_client.php"}>{tr} Open client window{/tr}</a> |
<a class="link" href="tiki-live_support_admin.php?show_html">{tr}Generate HTML{/tr}</a> ]
<a class="link" href="tiki-live_support_admin.php?show_html">{tr}Generate HTML{/tr}</a>
<!--<a class="link" href="tiki-live_support_messages.php">{tr}Support tickets{/tr}</a>-->
]
<br/><br/>
{if $html}
<b>Generated HTML code:</b><br/>
......@@ -51,7 +53,11 @@
</table>
</td>
<td class="{cycle}" style="text-align:right;">
<a href='tiki-live_support_admin.php?removeuser={$offline_operators[ix].user}'><img src='img/icons/trash.gif' border='0' alt='{tr}del{/tr}' title='{tr}del{/tr}' /></a>
{if $tiki_p_live_support_admin eq 'y'}
<a href='tiki-live_support_admin.php?removeuser={$offline_operators[ix].user}'><img src='img/icons/trash.gif' border='0' alt='{tr}del{/tr}' title='{tr}del{/tr}' /></a>
{else}
&nbsp;
{/if}
</td>
</tr>
{/section}
......@@ -89,13 +95,18 @@
</table>
</td>
<td class="{cycle}" style="text-align:right;">
<a href='tiki-live_support_admin.php?removeuser={$offline_operators[ix].user}'><img src='img/icons/trash.gif' border='0' alt='{tr}del{/tr}' title='{tr}del{/tr}' /></a>
{if $tiki_p_live_support_admin eq 'y'}
<a href='tiki-live_support_admin.php?removeuser={$offline_operators[ix].user}'><img src='img/icons/trash.gif' border='0' alt='{tr}del{/tr}' title='{tr}del{/tr}' /></a>
{else}
&nbsp;
{/if}
</td>
</tr>
{/section}
</table>
{/if}
{if $tiki_p_live_support_admin eq 'y'}
<h3>{tr}Add an operator to the system{/tr}</h3>
<small>{tr}Operators must be tiki users{/tr}</small>
<form method="post" action="tiki-live_support_admin.php">
......@@ -118,5 +129,5 @@
</tr>
</table>
</form>
{/if}
......@@ -60,13 +60,15 @@
<br/><br/>
<input onClick="request_chat(document.getElementById('user').value,document.getElementById('tiki_user').value,document.getElementById('email').value,document.getElementById('reason').value);" type="button" value="{tr}Request support{/tr}" />
<br/><br/>
<!--<a href="tiki-live_support_message.php" class="link">{tr}Open a support ticket instead{/tr}</a>-->
</div>
<div id='requesting_chat' style='display:none;'>
<b>{tr}Your request is being processed{/tr}....</b>
<br/><br/>
<a onClick="javascript:client_close();window.close();" class="link">{tr}cancel request and exit{/tr}</a><br/>
<a href="tiki-live_support_message.php" class="link">{tr}cancel request and leave a message{/tr}</a></br>
<!--<a href="tiki-live_support_message.php" class="link">{tr}cancel request and leave a message{/tr}</a></br>-->
</div>
</body>
......
......@@ -37,12 +37,7 @@
<h3>{tr}Support requests{/tr}</h3>
{if $new_requests eq 'y'}
<script>
var NSsound = navigator.plugins && navigator.plugins["LiveAudio"];
var IEsound = navigator.plugins && document.all;
var audioEnabled = NSsound || IEsound;
if (audioEnabled) {
<EMBED SRC="aladdin.mid" HIDDEN="true" AUTOSTART="true" STARTTIME="00:10" ENDTIME="00:15">
}
sound();
</script>
{/if}
<table id='reqs' class="normal">
......@@ -61,6 +56,7 @@
<td class="{cycle}">
{if $status eq 'online'}
<a class="link" {jspopup href="tiki-live_support_chat_window.php?reqId=$requests[ix].reqId&role=operator" width="300" height="450"}>{tr}Accept{/tr}</a>
<a class="link" {jspopup href="tiki-live_support_chat_window.php?reqId=$requests[ix].reqId&role=observer" width="300" height="450"}>{tr}Join{/tr}</a>
{else}
&nbsp;
{/if}
......
<?php
// Initialization
require_once('tiki-setup.php');
include('lib/live_support/lsadminlib.php');
include('lib/live_support/lslib.php');
include_once('lib/live_support/lsadminlib.php');
include_once('lib/live_support/lslib.php');
if($feature_live_support != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
......@@ -10,7 +10,7 @@ if($feature_live_support != 'y') {
die;
}
if($tiki_p_admin != 'y' && !$lsadminlib->user_is_operator($user)) {
if($tiki_p_live_support_admin != 'y' && !$lsadminlib->user_is_operator($user)) {
$smarty->assign('msg',tra("You dont have permission to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
......@@ -22,11 +22,13 @@ if(isset($_REQUEST['show_html'])) {
$smarty->assign('html',$html);
}
if(isset($_REQUEST['adduser'])) {
$lsadminlib->add_operator($_REQUEST['user']);
}
if(isset($_REQUEST['removeuser'])) {
$lsadminlib->remove_operator($_REQUEST['removeuser']);
if($tiki_p_live_support_admin == 'y') {
if(isset($_REQUEST['adduser'])) {
$lsadminlib->add_operator($_REQUEST['user']);
}
if(isset($_REQUEST['removeuser'])) {
$lsadminlib->remove_operator($_REQUEST['removeuser']);
}
}
// Get the list of operators
......
<?php
// Initialization
require_once('tiki-setup.php');
include('lib/live_support/lslib.php');
include_once('lib/live_support/lslib.php');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
......
<?php
// Initialization
require_once('tiki-setup.php');
include('lib/live_support/lslib.php');
include_once('lib/live_support/lslib.php');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
......
<?php
// Initialization
require_once('tiki-setup.php');
include('lib/live_support/lslib.php');
include_once('lib/live_support/lslib.php');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
......@@ -14,6 +14,12 @@ if($feature_live_support != 'y') {
die;
}
if($tiki_p_live_support_admin != 'y' && !$lsadminlib->user_is_operator($user)) {
$smarty->assign('msg',tra("You dont have permission to use this feature"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
$max_active_request = $lslib->get_max_active_request();
$smarty->assign('new_requests','n');
......
<?php
// Initialization
require_once('tiki-setup.php');
include_once('lib/live_support/lsadminlib.php');
if($feature_live_support != 'y') {
$smarty->assign('msg',tra("This feature is disabled"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
$smarty->assign('sent','n');
$smarty->assign('nomsg','y');
if(isset($_REQUEST['save'])) {
$lsadminlib->post_support_message($_REQUEST['username'],$user,$_REQUEST['user_email'],$_REQUEST['data'],$_REQUEST['priority'],$_REQUEST['module'],'o','');
$smarty->assign('sent','y');
}
if($user) {
$smarty->assign('user_email',$tikilib->get_user_email($user));
}
$smarty->assign('modules',$lsadminlib->get_modules());
// Display the template
$smarty->display("tiki-live_support_message.tpl");
?>
\ No newline at end of file
......@@ -11,8 +11,8 @@
// Long includes and heavy operations should be avoided to maximize the
// response time of this script which is critical.
include('db/tiki-db.php');
include('lib/live_support/lslib.php');
include_once('db/tiki-db.php');
include_once('lib/live_support/lslib.php');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
......@@ -39,10 +39,10 @@ if(isset($_REQUEST['set_operator_status'])) {
if(isset($_REQUEST['operators_online'])) {
if($lslib->operators_online()) {
header("Content-type: image/gif");
readfile('img/icons/support_on.gif');
readfile('img/icons/live-support-on.png');
} else {
header("Content-type: image/gif");
readfile('img/icons/support_off.gif');
readfile('img/icons/live-support-off.png');
}
}
......
......@@ -1088,8 +1088,15 @@ if($user) {
$smarty->assign('allowMsgs',$allowMsgs);
}
if($feature_live_support == 'y') {
$smarty->assign('user_is_operator','n');
if($user) {
include_once('lib/live_support/lsadminlib.php');
if($lsadminlib->is_operator($user)) {
$smarty->assign('user_is_operator','y');
}
}
}
if($feature_referer_stats != 'y') {
// Referer tracking
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment