Commit c6c6cea1 authored by Xavier de Blas's avatar Xavier de Blas

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

parent a4c9ab6e
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment