<?php require_once('includes/requirecompere.inc.php'); require_once('includes/phptools/calendar.inc.php'); require_once('includes/timeavail.inc.php'); $CMD_TMPL_NAME='timeavail.manage'; if ($_SESSION['reserv.inputcache.domain']!='timeavail.repeat') { redirect("./"); return; } $timezone_bias_seconds=get_user_time_zone()*60; $mb_id=current_mb_id(); $ta_ids=$_SESSION['reserv.inputcache.data']['ta_ids']; $dataset['DELCOURSE']=array(0); $DBConn->connect(true); $timeavails=db_load_timeavails($DBConn,$ta_ids); $ta_ids=array_projection($timeavails,'ta_id'); $tacsidlist=db_load_timeavail_course_ids($DBConn,$ta_ids); $cs_ids=array_projection($tacsidlist,'cs_id'); $ta_cs_id_map=rowset2multimap($tacsidlist,'ta_id','cs_id'); $team_mb_ids=array_projection(db_load_team($DBConn,$mb_id,'VALID','ALIAS'),'mb_id_member'); array_push($team_mb_ids,$mb_id); $cslist=db_load_course_by_staff($DBConn,$team_mb_ids); $csmap=rowset2map($cslist,'cs_id'); $monthtable=distribute_timeavail_into_calendar($timeavails,$mb_id,$ta_cs_id_map,$csmap,$timezone_bias_seconds); $dataset['MONTH']=array_projection($monthtable,'dataset'); $dataset['COURSE']=$cslist; ?>