1 b) Gesamtstundenaufwand pro Gerät
authorJoey Schulze <joey@infodrom.org>
Fri, 5 Mar 2010 10:27:01 +0000 (11:27 +0100)
committerJoey Schulze <joey@infodrom.org>
Fri, 5 Mar 2010 10:27:01 +0000 (11:27 +0100)
masks/overview_geraete.php [new file with mode: 0644]

diff --git a/masks/overview_geraete.php b/masks/overview_geraete.php
new file mode 100644 (file)
index 0000000..c4ffadb
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+
+$jscode[] = <<<EOC
+
+function select_year_calback(data)
+{
+  grid_update(grid);
+}
+
+function select_year_status(obj, value, html)
+{
+  if (value.length)
+    info('Jahr ' + value + ' ausgewählt');
+  else
+    info('');
+}
+EOC;
+
+include_once($_SESSION['sys']['basedir'].'/lib/overview_utils.php');
+
+if (empty($_SESSION['overview_geraete.year'])) $_SESSION['overview_geraete.year'] = 0;
+
+$mask = array(
+             'table' => 'einsatz',
+             'title' => 'Einsatzübersicht pro Gerät',
+             'join' => array('gerate ON einsatz.geraet = gerate.id',
+                             'anbaugeraete ON einsatz.anbaugeraet = anbaugeraete.id',
+                             'arbeitsarten ON einsatz.arbeiten = arbeitsarten.id',
+                             ),
+             'where' => "arbeitsarten.arbeitsart <> 'Urlaub' AND arbeitsarten.arbeitsart <> 'Krank' AND arbeitsarten.arbeitsart <> 'Sonstige Fehltage'"
+                      . " AND date_part('year', datum) = " . $_SESSION['overview_geraete.year'],
+             'select' => array(
+                               'title' => 'Auswahl',
+                               'options' => discover_years(),
+                               'default' => 'Jahr wählen',
+                               'selected' => $_SESSION['overview_geraete.year'],
+                               'onchange' => "setvar(this,'year',select_year_calback,select_year_status)",
+                               ),
+             'variables' => array(
+                                  'year' => array(),
+                                  ),
+             'list' => array(
+                             'id' => array(
+                                           'name' => 'ID',
+                                           'visible' => false,
+                                           'sql' => 'einsatz.id',
+                                           ),
+                             'datum' => array(
+                                           'name' => 'Datum',
+                                           'type' => 'date',
+                                           'width' => 70,
+                                           ),
+                             'geraet' => array(
+                                           'name' => 'Gerät',
+                                           'sql' => "gerate.geraet",
+                                           'width' => 150,
+                                           'specs' => "filterUI: 's'",
+                                           ),
+                             'anbaugeraet' => array(
+                                           'name' => 'Anbaugerät',
+                                           'sql' => "anbaugeraete.anbaugeraet",
+                                           'width' => 150,
+                                           'specs' => "filterUI: 's'",
+                                           ),
+                             'arbeitsarten' => array(
+                                           'name' => 'Arbeiten',
+                                           'sql' => "arbeitsarten.arbeitsart",
+                                           'width' => 150,
+                                           'specs' => "filterUI: 's'",
+                                           ),
+                             'geraetstunden' => array(
+                                           'name' => 'Gerätstunden',
+                                           'type' => 'number',
+                                           'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
+                                           'width' => 60,
+                                           ),
+                             'anbaugeraetstunden' => array(
+                                           'name' => 'Anbaugerätstunden',
+                                           'type' => 'number',
+                                           'specs' => "decPlaces: 2, ClassName: 'alignright', suffix: '&nbsp;', canSort: false",
+                                           'width' => 60,
+                                           ),
+                             ),
+             );
+
+?>