Ignore:
Timestamp:
12/29/14 22:06:33 (10 years ago)
Author:
tbretz
Message:
If only have of the schedule is trasmitted, also the first entry must be checked about the limit not just the order of all entries.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/schedule/save.php

    r17707 r18044  
    9696// Note that there is no sanity check yet, therefore the data and the
    9797// time variable must be consistent
     98// FIXME: This should be 11:59:59 the prev day to allow for 12:00 being
     99// the first possible entry, but this makes things below more complicated
    98100$time = isset($_POST['t']) ? $_POST['t'] : "12:00:00";
    99101
     
    160162// ----------------------------------------------------------------
    161163
     164$last = $cut;
     165
    162166foreach ($data as $row)
    163167{
     
    183187    $t = $d['hour']<12 ? $nextDay." ".$t : $day." ".$t;
    184188
    185     if (!isset($last))
    186     {
    187         $last = $t;
    188     }
    189     else
    190     {
    191         // Check all but the last task in a measurement whether
    192         // the are not unlimited
    193         if ($last==$t)
    194         {
    195             if ($measurements[$m]['fIsUnlimited']==true)
    196                 die("Unlimited task '".$measurements[$m]['fMeasurement']."' detected before end of observation\n[".$last."|".($id-1)."]");
    197         }
    198 
    199         if ($last>$t)
    200             die("Times not sequential\n[".$last."|".$t."]");
    201         $last = $t;
    202     }
     189    // Check all but the last task in a measurement whether
     190    // the are not unlimited
     191    if ($last==$t)
     192    {
     193        if ($measurements[$m]['fIsUnlimited']==true)
     194            die("Unlimited task '".$measurements[$m]['fMeasurement']."' detected before end of observation\n[".$last."|".($id-1)."]");
     195    }
     196
     197    if ($last>$t)
     198        die("Times not sequential\n[".$last."|".$t."]");
     199
     200    $last = $t;
    203201
    204202    $m = $row[1]; // measurement
Note: See TracChangeset for help on using the changeset viewer.