Added web information to the sledrun lists.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 16 Jan 2014 20:53:16 +0000 (20:53 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 16 Jan 2014 20:53:16 +0000 (20:53 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrreport/trunk@1888 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrreport.body.php

index 5bdf8fbaaa657c1688d9086cb7eef2aa19bd6fbf..73b419bc504a6e6cc8b6d370e3160a30ea270b83 100644 (file)
@@ -676,7 +676,7 @@ class WrReport {
                        foreach ($page_titles as $page_title) $mysql_page_ids[] = $page_title->getArticleID();
                        $where_array[] = 'page.page_id in (' . implode(', ', $mysql_page_ids) . ')';
                } else $where_array[] = 'false';
-               $res = $dbr->select(array('page', 'wrsledruncache'), array('page.page_id', 'page.page_title', 'page_namespace', 'length', 'walkup_time', 'top_elevation', 'bottom_elevation', 'walkup_possible', 'walkup_separate', 'lift', 'night_light', 'public_transport', 'sled_rental', 'information_phone'), $where_array, 'bahnentabelleParserHook', array('ORDER BY' => 'page.page_title'));
+               $res = $dbr->select(array('page', 'wrsledruncache'), array('page.page_id', 'page.page_title', 'page_namespace', 'length', 'walkup_time', 'top_elevation', 'bottom_elevation', 'walkup_possible', 'walkup_separate', 'lift', 'night_light', 'public_transport', 'sled_rental', 'information_phone', 'information_web'), $where_array, 'bahnentabelleParserHook', array('ORDER BY' => 'page.page_title'));
 
                global $wgUser;
                global $wgWrReportMode; // e.g. 'summer'
@@ -762,15 +762,22 @@ class WrReport {
                        }
 
                        $td = $tr->appendElement('td');
-                       $info = $row->information_phone;
-                       if ($info) {
-                               $info_parts = explode(';', $info);
+                       $info_phone = $row->information_phone;
+                       if ($info_phone) {
+                               $info_parts = explode(';', $info_phone);
                                $info_parts = explode('(', $info_parts[0], 2);
                                if (count($info_parts) == 2 && substr($info_parts[1], -1) == ')') {
                                        $td->appendText($info_parts[0]);
                                        $td->appendElement('span', array('class' => 'wrtelinfo'))->appendText(substr($info_parts[1], 0, -1));
-                               } else $td->appendText($info);
+                               } else $td->appendText($info_phone);
                        }
+                       $info_web = $row->information_web;
+                       if ($info_web === 'Nein') $info_web = null;
+                       if ($info_phone && $info_web) $td->appendText('; ');
+                       if ($info_web) {
+                               $td->appendElement('a', array('href' => $info_web))->appendText('web');
+                       }
+
 
                        $tr->appendElement('td')->appendText($row->walkup_time ? $row->walkup_time . ' min' : '');