Changeset 2419


Ignore:
Timestamp:
Oct 29, 2011, 5:16:50 PM (9 years ago)
Author:
roux
Message:

fix pbs possible min_date sections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/lib/model/doctrine/Intervention.class.php

    r2364 r2419  
    136136
    137137  public function setContexte($contexte, $date = null, $timestamp = null, $tlois = null, $debug = 0) {
     138
     139    if ($date && preg_match("/^(\d{4}-\d\d-\d\d)/", $date, $annee)) {
     140      if (!preg_match("/^".$annee[1]."\d\d:\d\d$/")
     141        $date = $annee[1]."00:00";
     142    } else print "WARNING : Intervention $this->id has incorrect date : $date";
     143
    138144    $tlois = preg_replace('/[^,\d]+/', '', $tlois);
    139145    $tlois = preg_replace('/\s+,/', ',', $tlois);
Note: See TracChangeset for help on using the changeset viewer.