Changeset 3068


Ignore:
Timestamp:
Jan 15, 2013, 2:35:10 AM (8 years ago)
Author:
roux
Message:

fix ref_loi for 'même code'

Location:
cpc/trunk/project/lib
Files:
2 edited

Legend:

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

    r3065 r3068  
    9595    foreach (self::$code_legif as $code => $legif) if (preg_match('/'.$code.'/', $texte)) {
    9696      $this->ref_loi = $code;
    97       return $code;
     97      if ($this->numero < 3)
     98        return $code;
     99      return $refcode;
    98100    }
    99     if (preg_match('/(loi\sn°\s?[\d\-]+\sdu\s\d+e?r?\s[a-zéû]+\s\d{4})/', $texte, $match)) {
     101    if (preg_match('/((ordonnance|loi)\sn°\s?[\d\-]+\sdu\s\d+e?r?\s[a-zéû]+\s\d{4})/', $texte, $match)) {
    100102      $this->ref_loi = $match[1];
    101103      return $match[1];
  • cpc/trunk/project/lib/task/loadLoiTask.class.php

    r3065 r3068  
    5959            } else if ($json->type == 'alinea') {
    6060              $ali = Doctrine::getTable('Alinea')->findOrCreate($json->loi, $json->article, $json->alinea, array($json->level1, $json->level2, $json->level3, $json->level4));
    61               if ($json->alinea == 1)
     61              if ($json->alinea == 1) {
     62                if ($refcode) $oldcode = $refcode;
    6263                $refcode = '';
     64              }
     65              if (!$refcode && preg_match('/ même (code|loi|ordonnance)/', $json->texte))
     66                $refcode = $oldcode;
    6367              if ($json->texte) $refcode = $ali->setTexteCode($json->texte, $refcode);
    6468              $ali->save();
Note: See TracChangeset for help on using the changeset viewer.