changeset 10:6272ca0cacea

Make editing of custom timetable easier.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 11 Jan 2011 22:30:59 +0200
parents fe5b563eaae5
children 03c393c347c7
files beta.php
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/beta.php	Tue Jan 11 22:24:01 2011 +0200
+++ b/beta.php	Tue Jan 11 22:30:59 2011 +0200
@@ -20,7 +20,7 @@
 function checkClassID(&$id)
 {
   global $luokkaDefault;
-  if (!preg_match("#^[A-Z]{3}\d\S+#", $id)) {
+  if (!preg_match("#^[A-Z]{3}\d\S+|ccr#", $id)) {
     errorMsg("Virhe! Luokan täytyy olla muotoa <b>XXXnXXX</b>, käytetään vakioavoa <b>".$luokkaDefault."</b>.");
     $id = $luokkaDefault;
     return FALSE;
@@ -182,11 +182,11 @@
       $h = $classHourTable[$hour][$day];
         
       if ($h < 1) {
-        if ($h == 0) {
+        if ($h > -9999) {
           $n = 0;
           for ($i = $hour; $i < $classInfo["maxhours"]; $i++)
           if ($classHourTable[$i][$day] == $h) {
-            $classHourTable[$i][$day] = -1;
+            $classHourTable[$i][$day] = -9999;
             $n++;
           } else
             break;