From 3994b924de9f1ad694e31382e0dfab75d00a8639 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Wed, 22 May 2013 14:34:58 +0000 Subject: [PATCH] Completely rewrite invitations --- src/messenger/build.xml | 10 +- src/messenger/webim/client.php | 21 +- src/messenger/webim/default.css | 14 - src/messenger/webim/images/ajax-loader.gif | Bin 6820 -> 0 bytes src/messenger/webim/install/dbinfo.php | 10 +- src/messenger/webim/install/dbperform.php | 4 + src/messenger/webim/js/compiled/chat/app.js | 4 +- .../js/compiled/chat/layouts/invitation.js | 8 + .../js/compiled/chat/modules/invitation.js | 10 + src/messenger/webim/js/compiled/chat_app.js | 20 +- .../js/compiled/default/models/thread.js | 2 +- .../webim/js/compiled/default_app.js | 2 +- src/messenger/webim/js/compiled/invite/app.js | 9 - .../invite/mibewapi_invite_interaction.js | 8 - src/messenger/webim/js/compiled/invite_app.js | 15 - src/messenger/webim/js/compiled/widget.js | 6 +- src/messenger/webim/js/source/chat/app.js | 3 + .../js/source/chat/layouts/invitation.js | 36 +++ .../js/source/chat/modules/invitation.js | 114 +++++++ .../webim/js/source/default/models/thread.js | 6 +- src/messenger/webim/js/source/invite/app.js | 67 ---- .../invite/mibewapi_invite_interaction.js | 30 -- src/messenger/webim/js/source/widget.js | 32 +- src/messenger/webim/libs/chat.php | 65 ++-- src/messenger/webim/libs/classes/thread.php | 28 ++ .../webim/libs/classes/users_processor.php | 32 +- src/messenger/webim/libs/invitation.php | 290 ++++++++++++++---- src/messenger/webim/locales/en/properties | 2 + src/messenger/webim/locales/ru/properties | 2 + src/messenger/webim/operator/invite.php | 15 +- .../webim/styles/dialogs/default/chat.css | 39 ++- .../invitation/layout.handlebars | 1 + .../dialogs/default/js/compiled/templates.js | 14 +- .../styles/dialogs/default/templates/chat.tpl | 3 + .../styles/invitations/default/invite.css | 7 + src/messenger/webim/view/invite.php | 67 ---- src/messenger/webim/widget.php | 9 +- 37 files changed, 659 insertions(+), 346 deletions(-) delete mode 100644 src/messenger/webim/images/ajax-loader.gif create mode 100644 src/messenger/webim/js/compiled/chat/layouts/invitation.js create mode 100644 src/messenger/webim/js/compiled/chat/modules/invitation.js delete mode 100644 src/messenger/webim/js/compiled/invite/app.js delete mode 100644 src/messenger/webim/js/compiled/invite/mibewapi_invite_interaction.js delete mode 100644 src/messenger/webim/js/compiled/invite_app.js create mode 100644 src/messenger/webim/js/source/chat/layouts/invitation.js create mode 100644 src/messenger/webim/js/source/chat/modules/invitation.js delete mode 100644 src/messenger/webim/js/source/invite/app.js delete mode 100644 src/messenger/webim/js/source/invite/mibewapi_invite_interaction.js create mode 100644 src/messenger/webim/styles/dialogs/default/handlebars_templates/invitation/layout.handlebars delete mode 100644 src/messenger/webim/view/invite.php diff --git a/src/messenger/build.xml b/src/messenger/build.xml index 86ff4c01..00166ed6 100644 --- a/src/messenger/build.xml +++ b/src/messenger/build.xml @@ -334,14 +334,6 @@ - - - - - - Invite JavaScript application built. - - @@ -430,7 +422,7 @@ - + Mibew Messenger built. diff --git a/src/messenger/webim/client.php b/src/messenger/webim/client.php index b0f4eed4..428a6fa7 100644 --- a/src/messenger/webim/client.php +++ b/src/messenger/webim/client.php @@ -47,6 +47,24 @@ if (get_remote_level($_SERVER['HTTP_USER_AGENT']) == 'old') { exit; } +if (verifyparam("act", "/^(invitation)$/", "default") == 'invitation') { + // Check if user invited to chat + $invitation_state = invitation_state($_SESSION['visitorid']); + + if ($invitation_state['invited'] && $invitation_state['threadid']) { + $thread = Thread::load($invitation_state['threadid']); + + // Prepare page + $page = setup_invitation_view($thread); + + // Build js application options + $page['invitationOptions'] = json_encode($page['invitation']); + // Expand page + expand("styles/dialogs", getchatstyle(), "chat.tpl"); + exit; + } +} + if( !isset($_GET['token']) || !isset($_GET['thread']) ) { $thread = NULL; @@ -107,8 +125,7 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) { // Get invitation info if (Settings::get('enabletracking')) { $invitation_state = invitation_state($_SESSION['visitorid']); - $visitor_is_invited = $invitation_state['invited'] - && !$invitation_state['threadid']; + $visitor_is_invited = $invitation_state['invited']; } else { $visitor_is_invited = false; } diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css index 8bc641b5..6982313b 100644 --- a/src/messenger/webim/default.css +++ b/src/messenger/webim/default.css @@ -986,17 +986,3 @@ table.awaiting .no-threads, table.awaiting .no-visitors { float:left; padding-left:10px; } - -/* invitation wait */ - -.ajaxWait { - z-index: -1; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-image: url(images/ajax-loader.gif); - background-repeat: no-repeat; - background-position: center; -} diff --git a/src/messenger/webim/images/ajax-loader.gif b/src/messenger/webim/images/ajax-loader.gif deleted file mode 100644 index 2f6eff25e7d46b1d453a3995449b6d6b349a3da3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6820 zcma)>cRbba-^Y)$95RmM;5Z#RD0|PNq+{=OI6AUt_TE&--q~A5R*B54BqMu7gpi1= zC<)PWtKawj@BV!s_x1Pn_+0-yAJ5nO_5P@7sN!U;6#X5>8XfcuIs&)wC17r zANT4<=1#u

C!Xd%F(!zYfRgIb9VaLnQ@$6>(uv5XIRYj^Ah{Z+mNBdpm4^ldmJz z+SxkL)x+9O*vZ|&1Hf?trlLN(CHUuSe;x&ZPvL_akDeJ}MxUNCc_C-&iG9{&SFJc6 z`z*?prDE%OZ^3SX0=OuOBw1!*?+GWtx;fMW@WpwVCJsho@IZpDCL99DWaLLJM@3(O zCe`1(=XfdhX_@(L(|swVwg!U4sO=MCd5ZuBC3+)aKtEJ^rmH2hMdAf*JB};Xq2`t@ zf?hh65v6%ZH+S5_Vkg)=A!u7|MT;yNSb4iV!K3k69~f5OhtBD7dLhgQNwj#0YVYkv z@ac@t3R?^>TtinauM7N0y%o- zY$4C{Xh?(l4B-hZRCx-b%h~Dim{W|RtSX*kkne|XmDx~3xz;tHjdUFA*Yb;rIN4xV zZ*1yV0nUw@O|!|dFYTQ%kjA9gR=Y@u0om0`Pf?G~SZnV1W%H2n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)4IB1X31!yct^{p?j=iwvHZmkp53DVP!TtnzSE~q#nj9=;4`V! zWhJ{;6N3D#M8oh){@erc539`J`}4bLCgQa{!Cn(Rtn(K($xVo?$NJ76vtCzgR2&to z9v~?^qIsRA&-*L)vIh2y>)YvUk6pT|Hb#r}X}hI`6uTq+GaTpN!o}p3x~Jwv{)#H) zjG=aPC>|qz`*Aga6CJ-)Kf4ucrv6dteMN5(K}Hq)$ diff --git a/src/messenger/webim/install/dbinfo.php b/src/messenger/webim/install/dbinfo.php index 16105282..f1e38851 100644 --- a/src/messenger/webim/install/dbinfo.php +++ b/src/messenger/webim/install/dbinfo.php @@ -42,6 +42,7 @@ $dbtables = array( "dtmmodified" => "int NOT NULL DEFAULT 0", "lrevision" => "int NOT NULL DEFAULT 0", "istate" => "int NOT NULL DEFAULT 0", + "invitationstate" => "int NOT NULL DEFAULT 0", "ltoken" => "int NOT NULL", "remote" => "varchar(255)", "referer" => "text", @@ -167,15 +168,12 @@ $dbtables = array( "${mysqlprefix}chatsitevisitor" => array( "visitorid" => "INT NOT NULL auto_increment PRIMARY KEY", - "userid" => "varchar(64) NOT NULL", - "username" => "varchar(255)", + "userid" => "varchar(255) NOT NULL", + "username" => "varchar(64)", "firsttime" => "int NOT NULL DEFAULT 0", "lasttime" => "int NOT NULL DEFAULT 0", "entry" => "text NOT NULL", "details" => "text NOT NULL", - "invited" => "tinyint(1) NOT NULL DEFAULT 0", - "invitationtime" => "int NOT NULL DEFAULT 0", - "invitedby" => "INT references ${mysqlprefix}chatoperator(operatorid) on delete set null", "invitations" => "INT NOT NULL DEFAULT 0", "chats" => "INT NOT NULL DEFAULT 0", "threadid" => "INT references ${mysqlprefix}chatthread(threadid) on delete set null" @@ -233,7 +231,7 @@ $dbtables_indexes = array( $memtables = array(); $dbtables_can_update = array( - "${mysqlprefix}chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid", "dtmchatstarted"), + "${mysqlprefix}chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid", "dtmchatstarted", "invitationstate"), "${mysqlprefix}chatthreadstatistics" => array(), "${mysqlprefix}requestbuffer" => array("requestid", "requestkey", "request"), "${mysqlprefix}chatmessage" => array("agentId"), diff --git a/src/messenger/webim/install/dbperform.php b/src/messenger/webim/install/dbperform.php index 9566ab39..3831d667 100644 --- a/src/messenger/webim/install/dbperform.php +++ b/src/messenger/webim/install/dbperform.php @@ -128,6 +128,10 @@ if ($act == "silentcreateall") { runsql("ALTER TABLE ${mysqlprefix}chatthread ADD userid varchar(255) DEFAULT \"\"", $link); } + if (in_array("${mysqlprefix}chatthread.invitationstate", $absent_columns)) { + runsql("ALTER TABLE ${mysqlprefix}chatthread ADD invitationstate int NOT NULL DEFAULT 0 AFTER istate", $link); + } + if (in_array("${mysqlprefix}chatoperator.iperm", $absent_columns)) { runsql("ALTER TABLE ${mysqlprefix}chatoperator ADD iperm int DEFAULT 65535", $link); } diff --git a/src/messenger/webim/js/compiled/chat/app.js b/src/messenger/webim/js/compiled/chat/app.js index a1967eea..8f464b80 100644 --- a/src/messenger/webim/js/compiled/chat/app.js +++ b/src/messenger/webim/js/compiled/chat/app.js @@ -5,5 +5,5 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 */ -(function(a,d){var c=a.Application;c.addRegions({mainRegion:"#main-region"});c.addInitializer(function(b){a.PluginOptions=b.plugins||{};a.Objects.server=new a.Server(d.extend({interactionType:MibewAPIChatInteraction},b.server));a.Objects.Models.page=new a.Models.Page(b.page);switch(b.startFrom){case "chat":c.Chat.start(b.chatOptions);break;case "survey":c.Survey.start(b.surveyOptions);break;case "leaveMessage":c.LeaveMessage.start(b.leaveMessageOptions);break;default:throw Error("Dont know how to start!"); -}});c.on("start",function(){a.Objects.server.runUpdater()})})(Mibew,_); +(function(b,d){var c=b.Application;c.addRegions({mainRegion:"#main-region"});c.addInitializer(function(a){b.PluginOptions=a.plugins||{};b.Objects.server=new b.Server(d.extend({interactionType:MibewAPIChatInteraction},a.server));b.Objects.Models.page=new b.Models.Page(a.page);switch(a.startFrom){case "chat":c.Chat.start(a.chatOptions);break;case "survey":c.Survey.start(a.surveyOptions);break;case "leaveMessage":c.LeaveMessage.start(a.leaveMessageOptions);break;case "invitation":c.Invitation.start(a.invitationOptions); +break;default:throw Error("Dont know how to start!");}});c.on("start",function(){b.Objects.server.runUpdater()})})(Mibew,_); diff --git a/src/messenger/webim/js/compiled/chat/layouts/invitation.js b/src/messenger/webim/js/compiled/chat/layouts/invitation.js new file mode 100644 index 00000000..cb4ef85d --- /dev/null +++ b/src/messenger/webim/js/compiled/chat/layouts/invitation.js @@ -0,0 +1,8 @@ +/* + Copyright 2005-2013 the original author or authors. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +*/ +(function(a,b){a.Layouts.Invitation=b.Marionette.Layout.extend({template:Handlebars.templates.invitation_layout,regions:{messagesRegion:{selector:"#invitation-messages-region",regionType:a.Regions.Messages}}})})(Mibew,Backbone); diff --git a/src/messenger/webim/js/compiled/chat/modules/invitation.js b/src/messenger/webim/js/compiled/chat/modules/invitation.js new file mode 100644 index 00000000..cf3dfcdb --- /dev/null +++ b/src/messenger/webim/js/compiled/chat/modules/invitation.js @@ -0,0 +1,10 @@ +/* + Copyright 2005-2013 the original author or authors. + + Licensed under the Apache License, Version 2.0 (the "License"). + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +*/ +(function(a){var d=[],e=a.Application,b=e.module("Invitation",{startWithParent:!1});b.addInitializer(function(f){var c=a.Objects,b=a.Objects.Models;b.thread=new a.Models.Thread(f.thread);b.user=new a.Models.ChatUser(f.user);c.invitationLayout=new a.Layouts.Invitation;e.mainRegion.show(c.invitationLayout);c.Collections.messages=new a.Collections.Messages;c.invitationLayout.messagesRegion.show(new a.Views.MessagesCollection({collection:c.Collections.messages}));d.push(c.server.callFunctionsPeriodically(function(){var b= +a.Objects.Models.thread;return[{"function":"update",arguments:{"return":{},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:!1,user:!0}}]},function(){}))});b.on("start",function(){a.Objects.server.restartUpdater()});b.addFinalizer(function(){a.Objects.invitationLayout.close();for(var b=0;b

'; -d&&(b+='

'+d+"

");e&&(b+=''+d+'');b=b+('

'+a+"

")+'
';if(a=document.getElementById("mibewinvitation"))a.innerHTML=b};a.Invitation={};a.Invitation.hide=function(){var a=document.getElementById("mibewinvitationpopup");a&&(a.style.display="none")};a.Invitation.accept=function(){document.getElementById("mibewAgentButton")&& -(document.getElementById("mibewAgentButton").onclick(),a.Invitation.hide())};a.Invitation.reject=function(){a.Objects.widget.sendToServer({invitation_rejected:1});a.Invitation.hide()}})(Mibew); +document.cookie=""+b+"="+a+"; path=/; "+(d?"domain="+d+";":"")};a.Utils.readCookie=function(b){var a=document.cookie.split("; ");b+="=";for(var d=!1,e=0;e