Added another overview page that displays vacant jobs.
authorJoey Schulze <joey@infodrom.org>
Sun, 19 May 2002 07:28:58 +0000 (07:28 +0000)
committerJoey Schulze <joey@infodrom.org>
Sun, 19 May 2002 07:28:58 +0000 (07:28 +0000)
src/LinuxTag/2002/supporter/open.wml [new file with mode: 0644]
src/LinuxTag/2002/supporter/submenu.inc

diff --git a/src/LinuxTag/2002/supporter/open.wml b/src/LinuxTag/2002/supporter/open.wml
new file mode 100644 (file)
index 0000000..1e7a02b
--- /dev/null
@@ -0,0 +1,193 @@
+#include <lt2002.style>
+#include "../edit.style"
+#include "jobs.inc"
+
+<build_timeframe>
+<tab_frag_stubs>
+<fragment_ok>
+<page func="LinuxTag 2002 Organisation" title="Supporter -- Open Jobs">
+
+<?
+  $limit = '';
+  reset ($ltdays);
+  while (list($key,$day) = each ($ltdays)) {
+    if ($GLOBALS["day_".$key] == 1) {
+      $foo = explode (",", $day);
+      if (strlen ($limit) == 0) {
+        $limit = $foo[0];
+     } else {
+        $limit .= ", " . $foo[0];
+      }
+    }
+  }
+
+  if (strlen ($limit) > 0) {
+    printf ("<p><b>Output limited to</b>: %s</p>", $limit);
+  }
+
+?>
+
+<p>
+<table cellpadding=0 cellspacing=1>
+<?
+  printf ($f_header_head, "<colh>");
+  reset ($ltdays);
+  $col = array();
+  while (list($key,$day) = each ($ltdays)) {
+    if ($limitation != 1 || $GLOBALS["day_".$key] == 1) {
+      $foo = explode (",", $day);
+      printf ($f_header_day, $foo[0]);
+      $col[] = $key;
+    }
+  }
+  echo ($f_header_tail);
+
+  $dbh = pg_pconnect ("<dbconnstring>")
+               or die("Unable to connect to SQL server");
+
+  pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
+
+  $query = "SELECT job.id,title,starttime,endtime,fragment.id as fragment FROM job,fragment "
+                  ."WHERE job.id = fragment.job ORDER BY title";
+
+  $sth = pg_exec ($dbh, $query) or die ("Datenbank-Abfrage!");
+
+  $thisname = '';
+  for ($nr = 0; $nr < pg_NumRows($sth); $nr++)
+  {
+    $row = pg_fetch_array($sth, $nr);
+
+    if ($thisname != $row['title']) {
+      if ($thisname != '') {
+        $available[$thisname] = $avail;
+      }
+      $avail = array ('id' => $row['id']);
+      $thisname = $row['title'];
+    }
+
+    $miss = missing_supporters ($dbh, $row['fragment']);
+    if ($miss > 0) {
+      # FIXME: Link setzen
+      $foo = explode (" ", $row['starttime']);
+      $time = build_timeframe ($row['starttime'], $row['endtime']);
+      if (strlen ($avail[$foo[0]]) > 0) {
+       $avail[$foo[0]] .= "&nbsp;" . $time;
+       if ($miss > 1) {
+         $avail[$foo[0]] .= "(" . $miss . ")";
+       }
+      } else {
+       $avail[$foo[0]] = $time;
+       if ($miss > 1) {
+         $avail[$foo[0]] .= "(" . $miss . ")";
+       }
+      }
+    }
+  }
+  $available[$thisname] = $avail;
+
+  $colindex = count ($col);
+  $color = "<cold>";
+  $empty = true;
+  $line = '';
+  reset ($available);
+  while (list($name,) = each ($available)) {
+
+    reset ($col);
+    while (list(,$day) = each ($col)) {
+      if (strlen ($available[$name][$day]) > 0) {
+        $empty = false;
+        $line .= sprintf ($f_row_day, $available[$name][$day]);
+      } else {
+        $line .= sprintf ($f_row_day, "&nbsp;");
+      }
+    }
+
+    if ($empty) {
+      $line = '';
+    } else {
+      $color = $color=="<cold>"?"<coln>":"<cold>";
+      printf ($f_row_head, $color, "job", $available[$name]['id'], $name);
+      echo ($line);
+      echo ($f_row_tail);
+      $empty = true;
+      $line = '';
+    }
+  }
+?>
+</table>
+</p>
+
+<p>
+<b>Limit Output</b>.  You can limit the output to certain days and
+people working on certain tasks.</p>
+<p>Warning: Limiting to sections is not yet implemented.</p>
+
+<form method=get action=jobs.php3>
+<input type=hidden name=limitation value=1>
+
+<center><table cellpadding=0 cellspacing=1>
+
+<?
+  $first = true;
+  reset ($ltdays);
+  while (list($key,$day) = each ($ltdays)) {
+    if ($first) {
+      $first = false;
+?>
+<row_checkbox  name="day_<? echo $key; ?>"
+               title="<b>Days</b>"
+               descr="<? echo $day; ?>"
+               checked="<? echo (!isset ($limitation) || $GLOBALS["day_".$key] == 1)?"checked":''; ?>"
+               >
+<?
+    } else {
+?>
+<row_checkbox  name="day_<? echo $key; ?>"
+               title="&nbsp;"
+               descr="<? echo $day; ?>"
+               checked="<? echo (!isset ($limitation) || $GLOBALS["day_".$key] == 1)?"checked":''; ?>"
+               >
+<?
+    }
+  }
+?>
+
+<row_checkbox  name="section_<? echo $nr; ?>"
+               title="<b>Sections</b>"
+               descr="Any section"
+               value="any"
+               checked="checked"
+               >
+
+<?
+  $query = "SELECT DISTINCT section FROM job WHERE section <> '' ORDER BY section";
+  $sth = pg_exec ($dbh, $query) or die ("Datenbank-Abfrage!");
+
+  for ($nr = 0; $nr < pg_NumRows($sth); $nr++)
+  {
+    $row = pg_fetch_array($sth, $nr);
+?>
+<row_checkbox  name="section_<? echo $nr; ?>"
+               title="&nbsp;"
+               descr="<? echo $row['section']; ?>"
+               value="<? echo $row['section']; ?>"
+               checked=""
+               >
+<?
+    printf ("<input type=\"hidden\" name=\"maxsection\" value=\"%d\">", $nr);
+  }
+?>
+
+<row_submit_plain>
+
+</table></center>
+
+</form>
+
+</page>
+
+# Local variables:
+# mode: text
+# mode: auto-fill
+# end:
+
index d92a32e..b835d71 100644 (file)
@@ -16,6 +16,7 @@
 &nbsp;<menu-item base=accounts text="Accounts" href=accounts.php3><br>
 &nbsp;<menu-item base=availability text="Availability" href=availability.php3><br>
 &nbsp;<menu-item base=jobs text="Jobs" href=jobs.php3><br>
+&nbsp;<menu-item base=open text="Open&nbsp;Jobs" href=open.php3><br>
 
 <p><line height=2>