Index: /trunk/www/dch/shiftinfo.php
===================================================================
--- /trunk/www/dch/shiftinfo.php	(revision 18879)
+++ /trunk/www/dch/shiftinfo.php	(revision 18880)
@@ -3,5 +3,5 @@
   <meta name="Author" content="The FACT Group" />
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-  <title>FACT Project</title>
+  <title>FACT Contact Info</title>
   <link rel="StyleSheet" type="text/css" href="../style.css" />
 </head>
@@ -18,6 +18,12 @@
 <?php
 
-if ($argv)
+//find out if php was started with command-line or on browswer
+//echo php_sapi_name();
+//echo PHP_SAPI;
+if (strcmp(php_sapi_name(), "cli")==0 && $argv)
+{
     parse_str(implode('&', array_slice($argv, 1)), $_GET);
+    $_SERVER["REMOTE_USER"]="FACT";
+}
 
 if (isset($_GET['date']))
@@ -46,6 +52,8 @@
 {
     // this is getting exactly one entry from the DB, since we get only
-    // one username, which is unique in the DB.
-    $query="SELECT username as login, usertitle as name, email, fid5 as mobile, fid7 as skype
+    //   one username, which is unique in the DB.
+    // contactinfo and availability need to be queried as else PHP complains
+    //   in the function userinfo_to_string(), but for shifter they can/should be empty
+    $query="SELECT username as login, usertitle as name, email, fid5 as mobile, fid7 as skype, '' as contactinfo, '' as availability
         FROM logbook.userfields
         LEFT JOIN logbook.users
@@ -61,5 +69,5 @@
 function get_expertinfo($db)
 {
-    $query="SELECT username as login, usertitle as name, email, fid5 as mobile, fid7 as skype
+    $query="SELECT username as login, usertitle as name, email, fid5 as mobile, fid7 as skype, fid8 as contactinfo, fid6 as availability
         FROM logbook.userfields
         LEFT JOIN logbook.users ON (uid=ufid)
@@ -76,7 +84,14 @@
 {
     $s = $userinfo['name'] . "[" .$userinfo['login']."]" . ": <br>";
-    $s .= "    email:" . $userinfo['email'] . "<br>";
-    $s .= "    mobile:" . $userinfo['mobile'] . "<br>";
-    $s .= "    skype:" . $userinfo['skype'] . "<br>";
+    if (str_replace(' ', '', $userinfo['contactinfo']))
+        $s .= $userinfo['contactinfo']."<br>";
+    else
+    {
+        $s .= "    email:" . $userinfo['email'] . "<br>";
+        $s .= "    mobile:" . $userinfo['mobile'] . "<br>";
+        $s .= "    skype:" . $userinfo['skype'] . "<br>";
+    }
+    if ((strcmp($_SERVER['REMOTE_USER'], "FACT")==0) && str_replace(' ', '', $userinfo['availability']))
+        $s .= "availability information: <br>".$userinfo['availability']."<br>";
     return $s;
 }
@@ -105,7 +120,7 @@
 while ($row = $result->fetch_assoc())
 {
-    
     $userinfo = get_userinfo($db, $row['u']);
-    if ($userinfo['name']){
+    if ($userinfo['name'])
+    {
         echo "<li>".userinfo_to_string($userinfo)."</li>\n";
         if (!$userinfo['mobile'])
@@ -118,5 +133,6 @@
 echo "Expert-On-Call Contact Info: <br>\n <ul>\n";
 
-foreach (get_expertinfo($db) as $expertinfo) {
+foreach (get_expertinfo($db) as $expertinfo)
+{
     echo "<li>".userinfo_to_string($expertinfo)."</li><br>\n";
 
