1{title help="Live Support"}{tr}Live support system{/tr}{/title}
2
3<div class="t_navbar mb-4">
4	{button href='#' _onclick="javascript:window.open('tiki-live_support_console.php','','menubar=no,scrollbars=yes,resizable=yes,height=400,width=600');" class="btn btn-primary" _text="{tr}Open operator console{/tr}"}
5	{button href='#' _onclick="javascript:window.open('tiki-live_support_client.php','','menubar=no,scrollbars=yes,resizable=yes,height=450,width=300');" class="btn btn-primary" _text="{tr}Open client window{/tr}"}
6	{button href="?show_html" class="btn btn-primary" _text="{tr}Generate HTML{/tr}"}
7	{button href="tiki-live_support_transcripts.php" class="btn btn-info" _type="link" _icon_name="file-text-o" _text="{tr}Transcripts{/tr}"}
8</div>
9
10{if $html}
11	<b>Generated HTML code:</b><br>
12	Copy-paste the following XHTML snippet in the pages where you want to provide live support.<br>
13	<table>
14	<tr>
15		<td>
16		<small>HTML code</small><br>
17		<textarea rows="5" cols="60">{$html|escape}</textarea>
18		</td>
19		<td>
20		<small>result</small><br>
21		{$html}
22		</td>
23	</tr>
24	</table>
25{/if}
26{if count($online_operators) > 0}
27<h2>{tr}Online operators{/tr}</h2>
28<div class="table-responsive">
29<table class="table">
30	<tr>
31		<th style="text-align:center;">
32		{tr}Operator{/tr}
33		</th>
34		<th colspan='2'>
35		{tr}Stats{/tr}
36		</th>
37	</tr>
38{cycle values='odd,even' print=false}
39{section name=ix loop=$online_operators}
40<tr>
41		<td style="text-align:center;">
42			{$online_operators[ix].user|avatarize}<br>
43			<b>{$online_operators[ix].user|escape}</b>
44		</td>
45		<td>
46			<table>
47				<tr>
48					<td>{tr}Accepted requests:{/tr}</td>
49					<td>{$online_operators[ix].accepted_requests}</td>
50				</tr>
51				<tr>
52					<td>{tr}{$online_operators[ix].status}{/tr} {tr}since:{/tr}</td>
53					<td>{if $online_operators[ix].status_since ne "0"}{$online_operators[ix].status_since|tiki_short_datetime}{else}{tr}unknown{/tr}{/if}</td>
54				</tr>
55				<tr>
56					<td><a class="link" href="tiki-live_support_transcripts.php?filter_operator={$online_operators[ix].user|escape}">{tr}transcripts{/tr}</a></td>
57				</tr>
58			</table>
59		</td>
60		<td style="text-align:right;">
61		{if $tiki_p_live_support_admin eq 'y'}
62			<a href='tiki-live_support_admin.php?removeuser={$online_operators[ix].user|escape}'><img src='img/icons/trash.gif' alt="{tr}Del{/tr}" title="{tr}Del{/tr}"></a>
63<a href='tiki-live_support_admin.php?offline={$online_operators[ix].user|escape}'><img src='img/icons/icon_unwatch.png' alt="{tr}offline{/tr}" title="{tr}offline{/tr}"></a>
64		{else}
65			&nbsp;
66		{/if}
67		</td>
68	</tr>
69{/section}
70</table>
71</div>
72{/if}
73
74{if count($offline_operators) > 0}
75	<h2>{tr}Offline operators{/tr}</h2>
76	{cycle values='odd,even' print=false}
77	<div class="table-responsive">
78		<table class="table">
79			<tr>
80				<th style="text-align:center;">
81				{tr}Operator{/tr}
82				</th>
83				<th colspan='2'>
84				{tr}Stats{/tr}
85				</th>
86			</tr>
87			{section name=ix loop=$offline_operators}
88				<tr>
89					<td style="text-align:center;">
90						{$offline_operators[ix].user|avatarize}<br>
91						<b>{$offline_operators[ix].user|escape}</b>
92					</td>
93					<td>
94						<table >
95							<tr>
96								<td>{tr}Accepted requests:{/tr}</td>
97								<td>{$offline_operators[ix].accepted_requests}</td>
98							</tr>
99							<tr>
100								<td>{tr}{$offline_operators[ix].status}{/tr} {tr}since:{/tr}</td>
101								<td>{if $offline_operators[ix].status_since ne "0"}{$offline_operators[ix].status_since|tiki_short_datetime}{else}{tr}unknown{/tr}{/if}</td>
102							</tr>
103						</table>
104					</td>
105					<td style="text-align:right;">
106						{if $tiki_p_live_support_admin eq 'y'}
107							<a href='tiki-live_support_admin.php?removeuser={$offline_operators[ix].user|escape}'><img src='img/icons/trash.gif' alt="{tr}Del{/tr}" title="{tr}Del{/tr}"></a>
108						{else}
109							&nbsp;
110						{/if}
111					</td>
112				</tr>
113			{/section}
114		</table>
115	</div>
116{/if}
117
118{if $tiki_p_live_support_admin eq 'y'}
119	<h2>{tr}Add an operator to the system{/tr}</h2>
120	<br>
121	<form method="post" action="tiki-live_support_admin.php">
122		<div class="form-group row">
123			<label class="col-sm-3 col-form-label">{tr}User{/tr}</label>
124			<div class="col-sm-7">
125				<select name="user" class="form-control">
126					{section name=ix loop=$users}
127						<option value="{$users[ix].user|escape}">{$users[ix].user|escape}</option>
128					{/section}
129				</select>
130				<div class="form-text">
131					{tr}Operators must be tiki users{/tr}
132				</div>
133			</div>
134		</div>
135		<div class="form-group row">
136			<label class="col-sm-3 col-form-label"></label>
137			<div class="col-sm-7">
138				<input type="submit" class="btn btn-primary btn-sm" name="adduser" value="{tr}Set as Operator{/tr}">
139			</div>
140		</div>
141	</form>
142{/if}
143
144