diff --git a/content/planner.overlay.xul.php b/content/planner.overlay.xul.php
index 8b6ecab44..a7d25c6a9 100755
--- a/content/planner.overlay.xul.php
+++ b/content/planner.overlay.xul.php
@@ -11,7 +11,7 @@ echo '';
echo '';
echo '';
-/*echo '';*/
+echo '';
?>
@@ -109,9 +109,9 @@ echo '
+
@@ -121,9 +121,9 @@ echo '
+
diff --git a/content/projekt/ressource.overlay.xul.php b/content/projekt/ressource.overlay.xul.php
index 58c9e30e1..5b6826f8f 100755
--- a/content/projekt/ressource.overlay.xul.php
+++ b/content/projekt/ressource.overlay.xul.php
@@ -25,12 +25,12 @@ header("Pragma: no-cache");
header("Content-type: application/vnd.mozilla.xul+xml");
require_once('../../config/vilesci.config.inc.php');
-require_once('../../include/projektbenutzer.class.php');
+/*require_once('../../include/projektbenutzer.class.php');
$pb= new projektbenutzer();
$pb->load();
-$pb->getUIDs();
-$datum=$pb->jump_week(time(),0);
-$showWeeks=15;
+$pb->getUIDs();*/
+//$datum=$pb->jump_week(time(),0);
+//$showWeeks=15;
echo '';
?>
@@ -50,56 +50,31 @@ echo '';
-
-
-
-
+
-
-
-
-
+
+
+
-
-
-
- ';
- ?>
-
-
-
-
-
';
- ?>
-
- uids);
- foreach ($pb->uids as $uid)
- {
- echo '
- ';
- for ($j=0; $j<$showWeeks; $j++)
- echo '';
- echo '
';
- }
- ?>
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/content/projekt/ressourcenauslastung.php b/content/projekt/ressourcenauslastung.php
new file mode 100755
index 000000000..4bdad1b4d
--- /dev/null
+++ b/content/projekt/ressourcenauslastung.php
@@ -0,0 +1,137 @@
+
+ */
+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');
+
+$showweeks=15;
+$timestamp = time();
+$ressource = new ressource();
+$ressource_arr = array();
+
+$datum_obj = new datum();
+$datum = date('Y-m-d',$timestamp);
+
+if(isset($_GET['typ']) && $_GET['typ']=='projekt')
+{
+ $ressource->getProjektRessoureDatum($datum);
+ $typ = 'projekt';
+ $anzahl_warnung = 6;
+}
+else
+{
+ $ressource->getProjektphaseRessoureDatum($datum);
+ $typ = 'phase';
+ $anzahl_warnung = 3;
+}
+
+foreach($ressource->result as $row)
+ $ressource_arr[]=$row->bezeichnung;
+
+$ressource_arr = array_unique($ressource_arr);
+
+echo '
+
+
+
+ Auslastung
+
+
+
+
+
+ | Ressource ('.$typ.') | ';
+for($i=0;$i<$showweeks;$i++)
+{
+ $timestamp_kw = jump_week($timestamp,$i);
+ echo 'KW '.kalenderwoche($timestamp_kw).' | ';
+}
+
+echo '
';
+
+foreach($ressource_arr as $bezeichnung)
+{
+ echo '';
+ echo '| '.$bezeichnung.' | ';
+ for($i=0;$i<$showweeks;$i++)
+ {
+ $timestamp_kw = jump_week($timestamp,$i);
+ $anzahl=0;
+ $title='';
+ reset($ressource->result);
+
+ foreach($ressource->result as $row)
+ {
+
+ $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.',';
+ }
+ elseif($typ=='phase' && $row->projektphase_id!='')
+ {
+ $anzahl++;
+ $phase = new projektphase();
+ $phase->load($row->projektphase_id);
+ $title .= $phase->bezeichnung.'('.$row->projektphase_id.'),';
+ }
+ }
+ }
+ $title = mb_substr($title,0,-1);
+
+ echo '';
+ if($anzahl>=$anzahl_warnung)
+ echo ''.$anzahl.'';
+ else
+ echo $anzahl;
+ echo ' | ';
+ }
+ echo '
';
+}
+
+echo '
+
+';
+?>
\ No newline at end of file
diff --git a/include/ressource.class.php b/include/ressource.class.php
index 84fce627d..aa30871d0 100644
--- a/include/ressource.class.php
+++ b/include/ressource.class.php
@@ -419,5 +419,95 @@ class ressource extends basis_db
return false;
}
}
+
+ /**
+ * Liefert die Ressourcen aller Projekte die zu einem bestimmten Datum aktiv sind
+ *
+ * @param $datum
+ */
+ public function getProjektRessoureDatum($datum)
+ {
+ $qry = "
+ SELECT
+ distinct
+ tbl_projekt_ressource.*, tbl_projekt.beginn as start, tbl_projekt.ende,
+ tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id,
+ tbl_ressource.bezeichnung, tbl_ressource.beschreibung
+ FROM
+ fue.tbl_ressource
+ LEFT JOIN fue.tbl_projekt_ressource USING(ressource_id)
+ LEFT JOIN fue.tbl_projekt USING(projekt_kurzbz)
+ WHERE
+ (tbl_projekt.beginn<='".addslashes($datum)."' OR tbl_projekt.beginn is null) AND
+ (tbl_projekt.ende>='".addslashes($datum)."' OR tbl_projekt.ende is null) ";
+
+ if($result = $this->db_query($qry))
+ {
+ while($row = $this->db_fetch_object($result))
+ {
+ $obj = new ressource();
+ $obj->projekt_ressource_id = $row->projekt_ressource_id;
+ $obj->projekt_kurzbz = $row->projekt_kurzbz;
+ $obj->projektphase_id = $row->projektphase_id;
+ $obj->start = $row->start;
+ $obj->ende = $row->ende;
+
+ $obj->ressource_id = $row->ressource_id;
+ $obj->student_uid = $row->student_uid;
+ $obj->mitarbeiter_uid = $row->mitarbeiter_uid;
+ $obj->betriebsmittel_id = $row->betriebsmittel_id;
+ $obj->firma_id = $row->firma_id;
+ $obj->bezeichnung = $row->bezeichnung;
+ $obj->beschreibung = $row->beschreibung;
+
+ $this->result[] = $obj;
+ }
+ }
+ }
+
+ /**
+ * Liefert die Ressourcen aller Projektphasen die zu einem bestimmten Datum aktiv sind
+ *
+ * @param $datum
+ */
+ public function getProjektphaseRessoureDatum($datum)
+ {
+ $qry = "
+ SELECT
+ distinct
+ tbl_projekt_ressource.*, tbl_projektphase.start, tbl_projektphase.ende,
+ tbl_ressource.student_uid, tbl_ressource.mitarbeiter_uid, tbl_ressource.betriebsmittel_id, tbl_ressource.firma_id,
+ tbl_ressource.bezeichnung, tbl_ressource.beschreibung
+ FROM
+ fue.tbl_ressource
+ LEFT JOIN fue.tbl_projekt_ressource USING(ressource_id)
+ LEFT JOIN fue.tbl_projektphase USING(projektphase_id)
+ WHERE
+ (tbl_projektphase.start<='".addslashes($datum)."' OR tbl_projektphase.start is null) AND
+ (tbl_projektphase.ende>='".addslashes($datum)."' OR tbl_projektphase.ende is null) ";
+
+ if($result = $this->db_query($qry))
+ {
+ while($row = $this->db_fetch_object($result))
+ {
+ $obj = new ressource();
+ $obj->projekt_ressource_id = $row->projekt_ressource_id;
+ $obj->projekt_kurzbz = $row->projekt_kurzbz;
+ $obj->projektphase_id = $row->projektphase_id;
+ $obj->start = $row->start;
+ $obj->ende = $row->ende;
+
+ $obj->ressource_id = $row->ressource_id;
+ $obj->student_uid = $row->student_uid;
+ $obj->mitarbeiter_uid = $row->mitarbeiter_uid;
+ $obj->betriebsmittel_id = $row->betriebsmittel_id;
+ $obj->firma_id = $row->firma_id;
+ $obj->bezeichnung = $row->bezeichnung;
+ $obj->beschreibung = $row->beschreibung;
+
+ $this->result[] = $obj;
+ }
+ }
+ }
}
?>
\ No newline at end of file
diff --git a/vilesci/top.php b/vilesci/top.php
index 2015685f4..d5bfbeb9d 100644
--- a/vilesci/top.php
+++ b/vilesci/top.php
@@ -41,7 +41,8 @@
$berechtigung->isBerechtigt('support') ||
$berechtigung->isBerechtigt('preinteressent') ||
$berechtigung->isBerechtigt('lehre') ||
- $berechtigung->isBerechtigt('basis/statistik') ||
+ $berechtigung->isBerechtigt('basis/statistik') ||
+ $berechtigung->isBerechtigt('assistenz') ||
$berechtigung->isBerechtigt('lv-plan') ))
die ('Keine Berechtigung!');