mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 05:20:30 +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 visitorId = this.model.id;
|
||||||
var page = Mibew.Objects.Models.page;
|
var page = Mibew.Objects.Models.page;
|
||||||
|
|
||||||
// Open invite window
|
// Check whether operator could actually chat
|
||||||
Mibew.Popup.open(
|
// (see libs/operator.php, has_online_operators function for details)
|
||||||
page.get('inviteLink')
|
if (page.get('operatorCouldNotInvite')) {
|
||||||
+ '?visitor='
|
Mibew.Utils.alert(Mibew.Localization.trans('Unable to invite user: groups are enabled, and you don\'t belong to any of them.'));
|
||||||
+ visitorId,
|
}
|
||||||
'ImCenter' + visitorId,
|
else {
|
||||||
Mibew.Utils.buildWindowParams(page.get('inviteWindowParams'))
|
|
||||||
);
|
// 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',
|
'banLink' => $request->getBaseUrl() . '/operator/ban',
|
||||||
'inviteLink' => $request->getBaseUrl() . '/operator/invite',
|
'inviteLink' => $request->getBaseUrl() . '/operator/invite',
|
||||||
|
|
||||||
|
'operatorCouldNotInvite' => (Settings::get('enablegroups') == 1) && !count(get_operator_group_ids($operator['operatorid'])),
|
||||||
|
|
||||||
'chatWindowParams' => $chat_style_config['chat']['window'],
|
'chatWindowParams' => $chat_style_config['chat']['window'],
|
||||||
'trackedUserWindowParams' => $page_style_config['tracked']['user_window'],
|
'trackedUserWindowParams' => $page_style_config['tracked']['user_window'],
|
||||||
'trackedVisitorWindowParams' => $page_style_config['tracked']['visitor_window'],
|
'trackedVisitorWindowParams' => $page_style_config['tracked']['visitor_window'],
|
||||||
|
Loading…
Reference in New Issue
Block a user