Changeset 18044 for trunk/FACT++/www


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.
Location:
trunk/FACT++/www/schedule
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/schedule/index.js

    r17724 r18044  
    3131        if (!el.valueAsDate)
    3232        {
    33             el.setAttribute("style", "color:#000000");
    34             return;
     33//            el.setAttribute("style", "color:#000000");
     34            continue;
    3535        }
    3636
     
    144144        input1p.setAttribute("hidden", "true");
    145145    // FIXME: Enable if this is the last "+" in tonight
    146     if (disabled)
     146    if (disabled && ! (table.isTonight && row.last))
    147147        input1p.setAttribute("disabled", "true");
    148148    input1p.onclick = function()
     
    453453        table.cutTime = "12:00:00";
    454454
    455     // Now loop over all rows and add them oine by one to the table
     455    // Now loop over all rows and add them one by one to the table
    456456    for (var i=0; i<schedule.length; i++)
    457457    {
     458        schedule[i].last   = schedule[schedule.length-1].fStart==schedule[i].fStart;
    458459        schedule[i].fStart = schedule[i].fStart.replace('-', '/');
    459460        schedule[i].fStart = schedule[i].fStart.replace('-', '/');
  • 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.