mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-30 21:10:29 +03:00
Fix issue with invitation to chat from inaccessible operator
This commit is contained in:
parent
74e69aa520
commit
42f5c1a20a
@ -76,14 +76,22 @@
|
||||
var visitorId = this.model.id;
|
||||
var page = Mibew.Objects.Models.page;
|
||||
|
||||
// Open invite window
|
||||
Mibew.Popup.open(
|
||||
page.get('inviteLink')
|
||||
+ '?visitor='
|
||||
+ visitorId,
|
||||
'ImCenter' + visitorId,
|
||||
Mibew.Utils.buildWindowParams(page.get('inviteWindowParams'))
|
||||
);
|
||||
// Check whether operator could actually chat
|
||||
// (see libs/operator.php, has_online_operators function for details)
|
||||
if (page.get('operatorCouldNotInvite')) {
|
||||
Mibew.Utils.alert(Mibew.Localization.trans('Unable to invite user: groups are enabled, and you don\'t belong to any of them.'));
|
||||
}
|
||||
else {
|
||||
|
||||
// Open invite window
|
||||
Mibew.Popup.open(
|
||||
page.get('inviteLink')
|
||||
+ '?visitor='
|
||||
+ visitorId,
|
||||
'ImCenter' + visitorId,
|
||||
Mibew.Utils.buildWindowParams(page.get('inviteWindowParams'))
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -124,6 +124,8 @@ class UsersController extends AbstractController
|
||||
'banLink' => $request->getBaseUrl() . '/operator/ban',
|
||||
'inviteLink' => $request->getBaseUrl() . '/operator/invite',
|
||||
|
||||
'operatorCouldNotInvite' => (Settings::get('enablegroups') == 1) && !count(get_operator_group_ids($operator['operatorid'])),
|
||||
|
||||
'chatWindowParams' => $chat_style_config['chat']['window'],
|
||||
'trackedUserWindowParams' => $page_style_config['tracked']['user_window'],
|
||||
'trackedVisitorWindowParams' => $page_style_config['tracked']['visitor_window'],
|
||||
|
Loading…
Reference in New Issue
Block a user