@@ -991,7 +991,7 @@ public function UpdateCustomNoteListsPositions($user_id, $customListsPositions)
991
991
}
992
992
993
993
// Emulate a global force refresh by updating a modified/archived timestamp to the special `zero` entry
994
- public function EmulateForceRefresh ()
994
+ public function EmulateForceRefresh ($ type = ' projects ' )
995
995
{
996
996
// Get current unixtime
997
997
$ timestamp = time ();
@@ -1001,13 +1001,13 @@ public function EmulateForceRefresh()
1001
1001
->eq ('user_id ' , 0 )
1002
1002
->eq ('position ' , 0 )
1003
1003
->eq ('is_active ' , -1 )
1004
- ->update (array ('date_modified ' => $ timestamp ));
1004
+ ->update (array ('category ' => $ type , ' date_modified ' => $ timestamp ));
1005
1005
1006
1006
$ this ->db ->table (self ::TABLE_NOTES_ARCHIVE_ENTRIES )
1007
1007
->eq ('project_id ' , 0 )
1008
1008
->eq ('user_id ' , 0 )
1009
1009
->eq ('date_modified ' , -1 )
1010
- ->update (array ('date_archived ' => $ timestamp ));
1010
+ ->update (array ('category ' => $ type , ' date_archived ' => $ timestamp ));
1011
1011
1012
1012
return $ timestamp ;
1013
1013
}
@@ -1031,21 +1031,28 @@ public function GetLastModifiedTimestamp($project_id, $user_id)
1031
1031
}
1032
1032
1033
1033
$ forceRefresh = $ this ->db ->table (self ::TABLE_NOTES_ENTRIES )
1034
- ->columns ('date_modified ' )
1034
+ ->columns ('date_modified ' , ' category ' )
1035
1035
->eq ('project_id ' , 0 )
1036
1036
->eq ('user_id ' , 0 )
1037
1037
->eq ('position ' , 0 )
1038
1038
->eq ('is_active ' , -1 )
1039
1039
->findOne ();
1040
1040
1041
1041
$ timestampProjects = 0 ;
1042
- if ($ forceRefresh && count ($ forceRefresh ) == 1 ) {
1043
- $ timestampProjects = $ forceRefresh ['date_modified ' ];
1042
+ $ timestampPermissions = 0 ;
1043
+ if ($ forceRefresh && count ($ forceRefresh ) == 2 ) {
1044
+ if ($ forceRefresh ['category ' ] == "projects " ) {
1045
+ $ timestampProjects = $ forceRefresh ['date_modified ' ];
1046
+ }
1047
+ if ($ forceRefresh ['category ' ] == 'permissions ' ) {
1048
+ $ timestampPermissions = $ forceRefresh ['date_modified ' ];
1049
+ }
1044
1050
}
1045
1051
1046
1052
return array (
1047
1053
'notes ' => $ timestampNotes ,
1048
1054
'projects ' => $ timestampProjects ,
1055
+ 'permissions ' => $ timestampPermissions ,
1049
1056
'max ' => max ($ timestampNotes , $ timestampProjects ),
1050
1057
);
1051
1058
}
@@ -1262,20 +1269,27 @@ public function GetLastArchivedTimestamp($project_id, $user_id)
1262
1269
}
1263
1270
1264
1271
$ forceRefresh = $ this ->db ->table (self ::TABLE_NOTES_ARCHIVE_ENTRIES )
1265
- ->columns ('date_archived ' )
1272
+ ->columns ('date_archived ' , ' category ' )
1266
1273
->eq ('project_id ' , 0 )
1267
1274
->eq ('user_id ' , 0 )
1268
1275
->eq ('date_modified ' , -1 )
1269
1276
->findOne ();
1270
1277
1271
1278
$ timestampProjects = 0 ;
1272
- if ($ forceRefresh && count ($ forceRefresh ) == 1 ) {
1273
- $ timestampProjects = $ forceRefresh ['date_archived ' ];
1279
+ $ timestampPermissions = 0 ;
1280
+ if ($ forceRefresh && count ($ forceRefresh ) == 2 ) {
1281
+ if ($ forceRefresh ['category ' ] == 'projects ' ) {
1282
+ $ timestampProjects = $ forceRefresh ['date_archived ' ];
1283
+ }
1284
+ if ($ forceRefresh ['category ' ] == 'permissions ' ) {
1285
+ $ timestampPermissions = $ forceRefresh ['date_archived ' ];
1286
+ }
1274
1287
}
1275
1288
1276
1289
return array (
1277
1290
'notes ' => $ timestampNotes ,
1278
1291
'projects ' => $ timestampProjects ,
1292
+ 'permissions ' => $ timestampPermissions ,
1279
1293
'max ' => max ($ timestampNotes , $ timestampProjects ),
1280
1294
);
1281
1295
}
0 commit comments