mirror of
https://github.com/Mibew/tray.git
synced 2025-01-22 18:10:34 +03:00
fix groupids in visitors update; fix DB error reporting in installer; smaller opaway/oponline image
This commit is contained in:
parent
66130ec312
commit
79b37c720f
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 905 B |
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 906 B |
@ -25,14 +25,14 @@ require_once('dbinfo.php');
|
||||
|
||||
function runsql($query, $link)
|
||||
{
|
||||
$res = mysql_query($query, $link) or show_install_err(' Query failed: ' . mysql_error());
|
||||
$res = mysql_query($query, $link) or show_install_err(' Query failed: ' . mysql_error($link));
|
||||
return $res;
|
||||
}
|
||||
|
||||
$act = verifyparam("act", "/^(silentcreateall|createdb|ct|dt|addcolumns)$/");
|
||||
|
||||
$link = @mysql_connect($mysqlhost, $mysqllogin, $mysqlpass)
|
||||
or show_install_err('Could not connect: ' . mysql_error($link));
|
||||
or show_install_err('Could not connect: ' . mysql_error());
|
||||
|
||||
if ($act == "silentcreateall") {
|
||||
mysql_query("CREATE DATABASE $mysqldb", $link) or show_install_err(' Query failed: ' . mysql_error($link));
|
||||
@ -79,12 +79,12 @@ if ($act == "silentcreateall") {
|
||||
|
||||
if (in_array("${mysqlprefix}chatmessage.agentId", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD agentId int NOT NULL DEFAULT 0 AFTER ikind", $link);
|
||||
runsql("update ${mysqlprefix}chatmessage,${mysqlprefix}chatoperator set agentId = operatorid where agentId = 0 AND ikind = 2 AND (vclocalename = tname OR vccommonname = tname)", $link);
|
||||
runsql("update ${mysqlprefix}chatmessage, ${mysqlprefix}chatoperator set agentId = operatorid where agentId = 0 AND ikind = 2 AND (vclocalename = tname OR vccommonname = tname)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.agentId", $absent)) {
|
||||
runsql("ALTER TABLE ${mysqlprefix}chatthread ADD agentId int NOT NULL DEFAULT 0 AFTER agentName", $link);
|
||||
runsql("update ${mysqlprefix}chatthread,${mysqlprefix}chatoperator set agentId = operatorid where agentId = 0 AND (vclocalename = agentName OR vccommonname = agentName)", $link);
|
||||
runsql("update ${mysqlprefix}chatthread, ${mysqlprefix}chatoperator set agentId = operatorid where agentId = 0 AND (vclocalename = agentName OR vccommonname = agentName)", $link);
|
||||
}
|
||||
|
||||
if (in_array("${mysqlprefix}chatthread.agentTyping", $absent)) {
|
||||
@ -164,4 +164,4 @@ if ($act == "silentcreateall") {
|
||||
mysql_close($link);
|
||||
header("Location: $webimroot/install/index.php");
|
||||
exit;
|
||||
?>
|
||||
?>
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE project [<!ENTITY buildfile SYSTEM "file:./build-user.xml">]>
|
||||
|
||||
<project basedir="." default="update" name="Obfuscator">
|
||||
<property name="obfuscator.location" value="."/>
|
||||
|
@ -1,3 +1,11 @@
|
||||
/**
|
||||
* @preserve This file is part of Mibew Messenger project.
|
||||
* http://mibew.org
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* License: http://mibew.org/license.php
|
||||
*/
|
||||
|
||||
var FrameUtils = {
|
||||
getDocument: function(frm) {
|
||||
if (frm.contentDocument) {
|
||||
@ -21,7 +29,7 @@ var FrameUtils = {
|
||||
doc.write("</body></html>");
|
||||
doc.close();
|
||||
frm.onload = function() {
|
||||
if( frm./**/myHtml ) {
|
||||
if( frm.myHtml ) {
|
||||
FrameUtils.getDocument(frm).getElementById('content').innerHTML += frm.myHtml;
|
||||
FrameUtils.scrollDown(frm);
|
||||
}
|
||||
|
@ -1,9 +1,14 @@
|
||||
/*
|
||||
* Mibew Messenger common script
|
||||
* http://sourceforge.net/projects/webim
|
||||
/**
|
||||
* @preserve This file is part of Mibew Messenger project.
|
||||
* http://mibew.org
|
||||
*
|
||||
* Based on Prototype JavaScript framework, version 1.3.1
|
||||
* http://prototype.conio.net/ (c) 2005 Sam Stephenson <sam@conio.net>
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* License: http://mibew.org/license.php
|
||||
*/
|
||||
|
||||
/*
|
||||
* common.js Based on Prototype JavaScript framework, version 1.3.1
|
||||
* http://prototype.conio.net/ (c) 2005 Sam Stephenson <sam@conio.net>
|
||||
*/
|
||||
|
||||
//- getEl, myAgent, myRealAgent
|
||||
@ -18,12 +23,12 @@
|
||||
var Class = {
|
||||
create: function() {
|
||||
return function() {
|
||||
this./**/initialize./**/apply(this, arguments);
|
||||
this.initialize.apply(this, arguments);
|
||||
};
|
||||
},
|
||||
|
||||
inherit: function(child,parent,body) {
|
||||
Object./**/extend(Object.extend(child.prototype, parent.prototype), body );
|
||||
Object.extend(Object.extend(child.prototype, parent.prototype), body );
|
||||
}
|
||||
};
|
||||
|
||||
@ -38,21 +43,21 @@ Object.prototype.extend = function(_object) {
|
||||
return Object.extend.apply(this, [this, _object]);
|
||||
};
|
||||
|
||||
Function.prototype./**/bind = function(_object) {
|
||||
Function.prototype.bind = function(_object) {
|
||||
var __method = this;
|
||||
return function() {
|
||||
return __method.apply(_object, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
Function.prototype./**/bindAsEventListener = function(_object) {
|
||||
Function.prototype.bindAsEventListener = function(_object) {
|
||||
var __method = this;
|
||||
return function(event) {
|
||||
__method.call(_object, event || window.event);
|
||||
}
|
||||
};
|
||||
|
||||
Number.prototype./**/toColorPart = function() {
|
||||
Number.prototype.toColorPart = function() {
|
||||
var digits = this.toString(16);
|
||||
if (this < 16) return '0' + digits;
|
||||
return digits;
|
||||
@ -81,9 +86,9 @@ PeriodicalExecuter.prototype = {
|
||||
initialize: function(callback, frequency) {
|
||||
this.callback = callback;
|
||||
this.frequency = frequency;
|
||||
this./**/currentlyExecuting = false;
|
||||
this.currentlyExecuting = false;
|
||||
|
||||
this./**/registerCallback();
|
||||
this.registerCallback();
|
||||
},
|
||||
|
||||
registerCallback: function() {
|
||||
@ -119,7 +124,7 @@ function findObj( id )
|
||||
return x;
|
||||
}
|
||||
|
||||
if (!Array.prototype./**/push) {
|
||||
if (!Array.prototype.push) {
|
||||
Array.prototype.push = function() {
|
||||
var startLength = this.length;
|
||||
for (var i = 0; i < arguments.length; i++)
|
||||
@ -172,7 +177,7 @@ var Ajax = {
|
||||
emptyFunction: function() {}
|
||||
};
|
||||
|
||||
Ajax./**/Base = function() {};
|
||||
Ajax.Base = function() {};
|
||||
Ajax.Base.prototype = {
|
||||
setOptions: function(_options) {
|
||||
this._options = {
|
||||
@ -198,8 +203,8 @@ Ajax.Base.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
Ajax./**/Request = Class.create();
|
||||
Ajax.Request./**/Events =
|
||||
Ajax.Request = Class.create();
|
||||
Ajax.Request.Events =
|
||||
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
||||
|
||||
Class.inherit( Ajax.Request, Ajax.Base, {
|
||||
|
@ -1,3 +1,11 @@
|
||||
/**
|
||||
* @preserve This file is part of Mibew Messenger project.
|
||||
* http://mibew.org
|
||||
*
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* License: http://mibew.org/license.php
|
||||
*/
|
||||
|
||||
Ajax.PeriodicalUpdater = Class.create();
|
||||
Class.inherit( Ajax.PeriodicalUpdater, Ajax.Base, {
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* This file is part of Mibew Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2010 Mibew Messenger Community
|
||||
* Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
* All rights reserved. The contents of this file are subject to the terms of
|
||||
* the Eclipse Public License v1.0 which accompanies this distribution, and
|
||||
* is available at http://www.eclipse.org/legal/epl-v10.html
|
||||
|
14
src/messenger/webim/libs/operator.php
Normal file → Executable file
14
src/messenger/webim/libs/operator.php
Normal file → Executable file
@ -171,7 +171,8 @@ function has_online_operators($groupid = "")
|
||||
$link = connect();
|
||||
$query = "select count(*) as total, min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time from ${mysqlprefix}chatoperator";
|
||||
if ($groupid) {
|
||||
$query .= ", ${mysqlprefix}chatgroupoperator where groupid = $groupid and ${mysqlprefix}chatoperator.operatorid = ${mysqlprefix}chatgroupoperator.operatorid and istatus = 0";
|
||||
$query .= ", ${mysqlprefix}chatgroupoperator where groupid = $groupid and ${mysqlprefix}chatoperator.operatorid = " .
|
||||
"${mysqlprefix}chatgroupoperator.operatorid and istatus = 0";
|
||||
} else {
|
||||
$query .= " where istatus = 0";
|
||||
}
|
||||
@ -377,13 +378,16 @@ function get_groups($link, $checkaway)
|
||||
{
|
||||
global $mysqlprefix;
|
||||
$query = "select ${mysqlprefix}chatgroup.groupid as groupid, vclocalname, vclocaldescription" .
|
||||
", (SELECT count(*) from ${mysqlprefix}chatgroupoperator where ${mysqlprefix}chatgroup.groupid = ${mysqlprefix}chatgroupoperator.groupid) as inumofagents" .
|
||||
", (SELECT count(*) from ${mysqlprefix}chatgroupoperator where ${mysqlprefix}chatgroup.groupid = " .
|
||||
"${mysqlprefix}chatgroupoperator.groupid) as inumofagents" .
|
||||
", (SELECT min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time " .
|
||||
"from ${mysqlprefix}chatgroupoperator, ${mysqlprefix}chatoperator where istatus = 0 and ${mysqlprefix}chatgroup.groupid = ${mysqlprefix}chatgroupoperator.groupid " .
|
||||
"from ${mysqlprefix}chatgroupoperator, ${mysqlprefix}chatoperator where istatus = 0 and " .
|
||||
"${mysqlprefix}chatgroup.groupid = ${mysqlprefix}chatgroupoperator.groupid " .
|
||||
"and ${mysqlprefix}chatgroupoperator.operatorid = ${mysqlprefix}chatoperator.operatorid) as ilastseen" .
|
||||
($checkaway
|
||||
? ", (SELECT min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time " .
|
||||
"from ${mysqlprefix}chatgroupoperator, ${mysqlprefix}chatoperator where istatus <> 0 and ${mysqlprefix}chatgroup.groupid = ${mysqlprefix}chatgroupoperator.groupid " .
|
||||
"from ${mysqlprefix}chatgroupoperator, ${mysqlprefix}chatoperator where istatus <> 0 and " .
|
||||
"${mysqlprefix}chatgroup.groupid = ${mysqlprefix}chatgroupoperator.groupid " .
|
||||
"and ${mysqlprefix}chatgroupoperator.operatorid = ${mysqlprefix}chatoperator.operatorid) as ilastseenaway"
|
||||
: ""
|
||||
) .
|
||||
@ -401,4 +405,4 @@ function get_operator_groupids($operatorid)
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -173,7 +173,7 @@ $showonline = verifyparam("showonline", "/^1$/", 0);
|
||||
|
||||
$link = connect();
|
||||
loadsettings_($link);
|
||||
if (!isset($_SESSION['operatorgroups'])) {
|
||||
if (!isset($_SESSION["${mysqlprefix}operatorgroups"])) {
|
||||
$_SESSION["${mysqlprefix}operatorgroups"] = get_operator_groupslist($operator['operatorid'], $link);
|
||||
}
|
||||
mysql_close($link);
|
||||
|
@ -50,7 +50,7 @@ function threads_by_userid($userid)
|
||||
"from ${mysqlprefix}chatthread " .
|
||||
"where userid=\"$userid\" order by created DESC", $userid);
|
||||
|
||||
$result = mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link) /*.": ".$query*/);
|
||||
$result = mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link));
|
||||
|
||||
$foundThreads = array();
|
||||
while ($thread = mysql_fetch_array($result, MYSQL_ASSOC)) {
|
||||
|
Loading…
Reference in New Issue
Block a user