*/ require_once('../../config/vilesci.config.inc.php'); require_once('../../include/functions.inc.php'); require_once('../../include/ressource.class.php'); require_once('../../include/datum.class.php'); require_once('../../include/projektphase.class.php'); require_once('../../include/projekttask.class.php'); $showweeks=52; $timestamp = time(); $ressource = new ressource(); $ressource_arr = array(); $datum_obj = new datum(); $datum = date('Y-m-d',$timestamp); $endetimestamp = jump_week($timestamp,$showweeks); $endedatum = date('Y-m-d',$endetimestamp); if(isset($_GET['empty'])) { echo '


'; exit; } elseif(isset($_GET['projekt_kurzbz']) && $_GET['projekt_kurzbz']!='') { $projekt_kurzbz=$_GET['projekt_kurzbz']; } else $projekt_kurzbz=null; if(isset($_GET['typ']) && $_GET['typ']=='projekt') { $ressource->getProjektRessourceDatum($datum, $endedatum); $typ = 'projekt'; $anzahl_warnung = 6; } elseif(isset($_GET['typ']) && $_GET['typ']=='task') { $ressource->getTaskRessoureDatum($datum, $endedatum, $projekt_kurzbz); $typ = 'task'; $anzahl_warnung = 6; } else { $ressource->getProjektphaseRessourceDatum($datum, $endedatum, $projekt_kurzbz); $typ = 'phase'; $anzahl_warnung = 6; } foreach($ressource->result as $row) { $ressource_arr[]=$row->bezeichnung; } $ressource_arr = array_unique($ressource_arr); echo ' Auslastung '; for($i=0;$i<$showweeks;$i++) { $timestamp_kw = jump_week($timestamp,$i); echo ''; } echo ''; foreach($ressource_arr as $bezeichnung) { $showrow=false; $htmlrow=''; $htmlrow.=''; for($i=0;$i<$showweeks;$i++) { $timestamp_kw = jump_week($timestamp,$i); $anzahl=0; $title=''; reset($ressource->result); $aufwandssumme=0; foreach($ressource->result as $row) { $beistrich=false; $start = $datum_obj->mktime_fromdate($row->start); $ende = $datum_obj->mktime_fromdate($row->ende); if($row->bezeichnung == $bezeichnung && ($row->start=='' || $start<=$timestamp_kw) && ($row->ende=='' || $ende>=$timestamp_kw) ) { if($typ=='projekt' && $row->projekt_kurzbz!='') { $anzahl++; $title .= $row->projekt_kurzbz; $beistrich=true; $showrow=true; } elseif($typ=='phase' && $row->projektphase_id!='') { $anzahl++; $showrow=true; $phase = new projektphase(); $phase->load($row->projektphase_id); $title .= $phase->bezeichnung.'('.$phase->projekt_kurzbz.')'; $beistrich=true; } elseif($typ=='task' && $row->projekttask_id!='') { $anzahl++; $showrow=true; $task = new projekttask(); $task->load($row->projekttask_id); $title.=$task->bezeichnung; $beistrich=true; } if($typ!='projekt' && $row->aufwand!='' && $row->aufwand!=0) { $title.='['.$row->aufwand.']'; $beistrich=true; $aufwandssumme +=$row->aufwand; } if($beistrich) $title.=', '; } } $title = mb_substr($title,0,-1); $htmlrow.=''; } $htmlrow.=''; if ($showrow) echo $htmlrow; ob_flush(); } echo '
Ressource ('.$typ.(!is_null($projekt_kurzbz)?'/'.$projekt_kurzbz:'').')KW '.kalenderwoche($timestamp_kw).'
'.$bezeichnung.''; if($anzahl>=$anzahl_warnung) $htmlrow.=''.$anzahl.($typ!='projekt'?'/'.$aufwandssumme:'').''; else $htmlrow.= $anzahl.($typ!='projekt'?'/'.$aufwandssumme:''); $htmlrow.= '
'; echo ' '; ?>