Przeglądaj źródła

Merge branch 'master' of ssh://gitea.spawntree.de:1122/spawntree/probuddy-master

master
Florian Eisenmenger 2 lat temu
rodzic
commit
0642a9b256
3 zmienionych plików z 52 dodań i 3 usunięć
  1. +1
    -1
      src/client/app/index.php
  2. +13
    -2
      src/client/app/js/app/util/OneSignal.js
  3. +38
    -0
      tools/patches/addActiveStateToProfile.php

+ 1
- 1
src/client/app/index.php Wyświetl plik

@@ -191,7 +191,7 @@ foreach( $incs as $jspath )
<?php if ( isset( $_GET[ 'fromCordova' ] ) ): ?>
<script type="text/javascript" src="cordova.js"></script>
<!-- <script type="text/javascript" src="cordova.js"></script>-->
<script type="text/javascript">
function onDeviceReady()
{


+ 13
- 2
src/client/app/js/app/util/OneSignal.js Wyświetl plik

@@ -17,6 +17,7 @@ app.util.OneSignal = (function(){
*/
cbNotificationOpened = function( jsonData )
{
console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
if ( jsonData &&
jsonData.notification &&
jsonData.notification.payload &&
@@ -82,7 +83,19 @@ app.util.OneSignal = (function(){
if (window.navigator.userAgent === "ProBuddy/2.0 (Android)") {
// New cordova app (version 3)
// Uncomment to set OneSignal device logging to VERBOSE
//OneSignal.setLogLevel(6, 0);
// NOTE: Update the setAppId value below with your OneSignal AppId.
OneSignal.setAppId(appId);
OneSignal.setNotificationOpenedHandler(cbNotificationOpened);
//Prompts the user for notification permissions.
// * Since this shows a generic native prompt, we recommend instead using an In-App Message to prompt for notification permission (See step 6) to better communicate to your users what notifications they will get.
// OneSignal.promptForPushNotificationsWithUserResponse(function(accepted) {
// console.log("User accepted notifications: " + accepted);
// });
} else {
// Old cordova app (version 2)
OneSignal
@@ -92,8 +105,6 @@ app.util.OneSignal = (function(){
OneSignal.getIds( cbGetIds );
}
//OneSignal.getIds( cbGetIds );
}
}
,


+ 38
- 0
tools/patches/addActiveStateToProfile.php Wyświetl plik

@@ -0,0 +1,38 @@
<?php

require_once __DIR__ . '/../../src/server/server/config/boot_global.php';
require_once __DIR__ . '/../../src/server/server/config/boot_local.php';

function patch_addStatusToProfileArrays()
{

$db = TB_Shared_Db_TeamData::get();
$sql = 'SELECT * FROM profile';
$stmt = $db->query( $sql );
$res = $stmt->fetchAll();

$db->beginTransaction();
foreach( $res as $row )
{
if ( is_array( $row ) && isset( $row[ 'id' ] ) )
{

$entProfile = TB_Shared_Ent_TeamData_Profile::get( $row[ 'id' ] );
$resTeam = [];
foreach ($entProfile->teams_js as $team) {
$tmpTeam = $team;
$tmpTeam['status'] = 'active';
$resTeam[] = $tmpTeam;
}
$entProfile->teams_js = $resTeam;
$entProfile->save();
unset($team);
unset( $entProfile );
}
}
$db->commit();

echo "DONE...";
}

patch_addStatusToProfileArrays();

Ładowanie…
Anuluj
Zapisz