addded openreplay to thetool

This commit is contained in:
Luca Haid
2026-01-29 14:34:23 +01:00
parent 8395ba570b
commit 9eb7e1c83c
6 changed files with 156 additions and 0 deletions

View File

@@ -1,4 +1,12 @@
<?php
// Prepare OpenReplay user data
$openreplayUserId = '';
if (class_exists('mfUser') && class_exists('mfLoginController') && mfLoginController::isLoggedIn()) {
$user = mfUser::singleton();
if ($user && $user->id) {
$openreplayUserId = (string) $user->id;
}
}
?>
<!DOCTYPE html>
<html lang="de">
@@ -32,6 +40,34 @@
}
</script>
<!-- OpenReplay Session Recording -->
<script>
var initOpts = {
projectKey: "96MdXVcId8Ph3eOirMWj",
ingestPoint: "https://openreplay.xinon.at/ingest",
defaultInputMode: 2,
obscureTextNumbers: false,
obscureTextEmails: true,
};
var startOpts = { userID: <?= json_encode($openreplayUserId) ?> };
(function(A,s,a,y,e,r){
r=window.OpenReplay=[e,r,y,[s-1, e]];
s=document.createElement('script');s.src=A;s.async=!a;
document.getElementsByTagName('head')[0].appendChild(s);
r.start=function(v){r.push([0])};
r.stop=function(v){r.push([1])};
r.setUserID=function(id){r.push([2,id])};
r.setUserAnonymousID=function(id){r.push([3,id])};
r.setMetadata=function(k,v){r.push([4,k,v])};
r.event=function(k,p,i){r.push([5,k,p,i])};
r.issue=function(k,p){r.push([6,k,p])};
r.isActive=function(){return false};
r.getSessionToken=function(){};
})("//static.openreplay.com/17.0.0/openreplay.js",1,0,initOpts,startOpts);
window.OpenReplay.setMetadata('userType', 'internal');
window.OpenReplay.setMetadata('app', 'warehouse-stocktake-pwa');
</script>
<style>
html, body {
overscroll-behavior: none;

View File

@@ -1,4 +1,13 @@
<?php
// Prepare OpenReplay user data for external company users
$openreplayUserId = '';
$openreplayCompanyId = $JSGlobals['COMPANY_ID'] ?? '';
if (class_exists('mfUser') && class_exists('mfLoginController') && mfLoginController::isLoggedIn()) {
$user = mfUser::singleton();
if ($user && $user->id) {
$openreplayUserId = 'company_' . $user->id;
}
}
?>
<!DOCTYPE html>
<html lang="de">
@@ -34,6 +43,34 @@
}
</script>
<!-- OpenReplay Session Recording -->
<script>
var initOpts = {
projectKey: "96MdXVcId8Ph3eOirMWj",
ingestPoint: "https://openreplay.xinon.at/ingest",
defaultInputMode: 2,
obscureTextNumbers: false,
obscureTextEmails: true,
};
var startOpts = { userID: <?= json_encode($openreplayUserId) ?> };
(function(A,s,a,y,e,r){
r=window.OpenReplay=[e,r,y,[s-1, e]];
s=document.createElement('script');s.src=A;s.async=!a;
document.getElementsByTagName('head')[0].appendChild(s);
r.start=function(v){r.push([0])};
r.stop=function(v){r.push([1])};
r.setUserID=function(id){r.push([2,id])};
r.setUserAnonymousID=function(id){r.push([3,id])};
r.setMetadata=function(k,v){r.push([4,k,v])};
r.event=function(k,p,i){r.push([5,k,p,i])};
r.issue=function(k,p){r.push([6,k,p])};
r.isActive=function(){return false};
r.getSessionToken=function(){};
})("//static.openreplay.com/17.0.0/openreplay.js",1,0,initOpts,startOpts);
window.OpenReplay.setMetadata('userType', 'external');
window.OpenReplay.setMetadata('companyId', <?= json_encode($openreplayCompanyId) ?>);
</script>
<style>
html, body {
/* Prevents the rubber-band scroll effect on iOS and pull-to-refresh on Android */