diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css index 2625fea5..735977d7 100644 --- a/src/messenger/webim/default.css +++ b/src/messenger/webim/default.css @@ -393,6 +393,13 @@ textarea.wide { width: 95%; } +input.wide { + border: 1px solid #878787; + color: #333; + line-height: normal; + width: 95%; +} + input.formauth { border: 1px solid #878787; color: #333; diff --git a/src/messenger/webim/install/dbinfo.php b/src/messenger/webim/install/dbinfo.php index 03ed8a3c..dc053acb 100644 --- a/src/messenger/webim/install/dbinfo.php +++ b/src/messenger/webim/install/dbinfo.php @@ -110,6 +110,7 @@ $dbtables = array( "id" => "INT NOT NULL auto_increment PRIMARY KEY", "locale" => "varchar(8)", "groupid" => "int references ${mysqlprefix}chatgroup(groupid)", + "vctitle" => "varchar(100) NOT NULL DEFAULT ''", "vcvalue" => "varchar(1024) NOT NULL", ), @@ -158,7 +159,7 @@ $dbtables_can_update = array( "${mysqlprefix}chatban" => array(), "${mysqlprefix}chatgroup" => array("vcemail"), "${mysqlprefix}chatgroupoperator" => array(), - "${mysqlprefix}chatresponses" => array(), + "${mysqlprefix}chatresponses" => array("vctitle"), "${mysqlprefix}chatsitevisitor" => array(), "${mysqlprefix}visitedpage" => array(), ); diff --git a/src/messenger/webim/install/dbperform.php b/src/messenger/webim/install/dbperform.php index 5d987dce..915a6eea 100644 --- a/src/messenger/webim/install/dbperform.php +++ b/src/messenger/webim/install/dbperform.php @@ -151,6 +151,10 @@ if ($act == "silentcreateall") { runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD vcrestoretoken varchar(64)", $link); } + if (in_array("${mysqlprefix}chatresponses.vctitle", $absent)) { + runsql("ALTER TABLE ${mysqlprefix}chatresponses ADD vctitle varchar(100) NOT NULL DEFAULT '' AFTER groupid", $link); + } + if (in_array("${mysqlprefix}chatthread.groupid", $absent)) { runsql("ALTER TABLE ${mysqlprefix}chatthread ADD groupid int references ${mysqlprefix}chatgroup(groupid)", $link); } diff --git a/src/messenger/webim/install/index.php b/src/messenger/webim/install/index.php index fa68a531..cbb4ed6c 100644 --- a/src/messenger/webim/install/index.php +++ b/src/messenger/webim/install/index.php @@ -258,23 +258,31 @@ function check_admin($link) function add_canned_messages($link){ global $mysqlprefix; + $localesresult = mysql_query("select locale from ${mysqlprefix}chatresponses", $link); + $existlocales = array(); + for ($i = 0; $i < mysql_num_rows($localesresult); $i++) { + $existlocales[] = mysql_result($localesresult, $i, 'locale'); + } + $result = array(); foreach (get_available_locales() as $locale) { - $result = array(); - foreach (explode("\n", getstring_('chat.predefined_answers', $locale)) as $answer) { - $result[] = array('id' => '', 'vcvalue' => $answer); - } - if (count($result) > 0) { - $updatequery = "insert into ${mysqlprefix}chatresponses (vcvalue,locale,groupid) values "; - for ($i = 0; $i < count($result); $i++) { - if ($i > 0) { - $updatequery .= ", "; - } - $updatequery .= "('" . db_escape_string($result[$i]['vcvalue'], $link) . "','$locale', NULL)"; + if (! in_array($locale, $existlocales)) { + foreach (explode("\n", getstring_('chat.predefined_answers', $locale)) as $answer) { + $result[] = array('locale' => $locale, 'vctitle' => cutstring($answer, 97, '...'), 'vcvalue' => $answer); } - mysql_query($updatequery, $link); } } - return; + if (count($result) > 0) { + $updatequery = "insert into ${mysqlprefix}chatresponses (vctitle,vcvalue,locale,groupid) values "; + for ($i = 0; $i < count($result); $i++) { + if ($i > 0) { + $updatequery .= ", "; + } + $updatequery .= "('" . mysql_real_escape_string($result[$i]['vctitle'], $link) . "', " + . "'" . mysql_real_escape_string($result[$i]['vcvalue'], $link) . "', " + . "'" . mysql_real_escape_string($result[$i]['locale'], $link) . "', NULL)"; + } + mysql_query($updatequery, $link); + } } function check_status() diff --git a/src/messenger/webim/js/164/chat.js b/src/messenger/webim/js/164/chat.js index c96c5396..3ce4ead1 100644 --- a/src/messenger/webim/js/164/chat.js +++ b/src/messenger/webim/js/164/chat.js @@ -1,24 +1,24 @@ /* 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(a){return a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document?a.document:null},initFrame:function(a){var b=this.getDocument(a);b.open();b.write("
");b.write('');b.write("");b.write("