[chronojump] compujump change person will load actual session if admin user changed it



commit c6c6cea1743f7539da05a1e50f23faff1a230271
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jan 8 17:53:25 2019 +0100

    compujump change person will load actual session if admin user changed it

 src/gui/networks.cs | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 2d4c48d5..77e1c096 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -653,6 +653,9 @@ public partial class ChronoJumpWindow
                                selectRowTreeView_persons(treeview_persons, rowToSelect);
                        */
                        getTasksExercisesAndPopup();
+
+                       //load current session if MONTHLY and current session is not current month and 
currentPerson is not compumpAdminID
+                       compujumpPersonChangedShouldChangeSession();
                }
 
                //Wakeup screen if it's off
@@ -666,6 +669,20 @@ public partial class ChronoJumpWindow
                return true;
        }
 
+       //load current session if MONTHLY and current session is not current month and currentPerson is not 
compumpAdminID
+       private void compujumpPersonChangedShouldChangeSession()
+       {
+               string yearMonthStr = UtilDate.GetCurrentYearMonthStr();
+               if(
+                               configChronojump.SessionMode == Config.SessionModeEnum.MONTHLY &&
+                               currentSession.Name != yearMonthStr &&
+                               ! configChronojump.CompujumpUserIsAdmin(currentPerson) )
+               {
+                       currentSession = SqliteSession.SelectByName(yearMonthStr);
+                       on_load_session_accepted();
+               }
+       }
+
        private void insertAndAssignPersonSessionIfNeeded(Json json)
        {
                PersonSession ps = SqlitePersonSession.Select(false, currentPerson.UniqueID, 
currentSession.UniqueID);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]