Changeset 2449


Ignore:
Timestamp:
Nov 2, 2011, 7:01:14 AM (9 years ago)
Author:
komodo
Message:

fix display link amdmts

File:
1 edited

Legend:

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

    r2448 r2449  
    293293                                                  'return' => 'value')));
    294294        if ($lois) for ($i = 0 ; $i < count($match[0]) ; $i++) {
    295           $match_protected = preg_replace('/(\s*)([ABICOM\-]*\d[\d\s\à]*rectifiés?|[ABICOM\-]*\d[\d\s\à]*)(,\s*|\s*et\s*)*/', '\1%\2%\3', $match[3][$i]);
     295          $match_protected = preg_replace('/(n[°os<\/up>\s]+)?([ABICOM\-]*\d[\d\s\à]*rectifiés?|[ABICOM\-]*\d\d*)(,|(et|à))*/', '%\1\2%\3', $match[3][$i]);
    296296          if (preg_match_all('/\s*%([^%]+)%(,\s*|\s*et\s*)*/', $match_protected, $amends)) {
    297297            $replace = $match_protected;
     
    311311
    312312      //Repère les documents parlementaires (pour les linkifier)
    313       if (preg_match_all('/(projet|proposition|annexe|rapport|avis)[^<°]+[<i>]*(n[os°\s<\/up>]+)(([\s,;\w°]{0,8}\W*\d+([\s,\d\(\)\[\]\-])?)+)/i', $inter, $matches)) {
    314         $match = $matches[3];
    315         sfProjectConfiguration::getActive()->loadHelpers(array('Url'));
    316         for($i = 0 ; $i < count($match) ; $i++) if (!preg_match('/ du /', $match[$i]) && !preg_match('/^\D*\d\d\d\d\D*$/', $match[$i])) {
     313      if (preg_match_all('/(projet|proposition|annexe|rapport|avis)[^<°]*(<i>|\s|\[|\()(n[os°\s<\/up>]+)(([\s,;\w°<>i]{0,8}\W*\d+[\s,\d\(\[\]\-<>i\/]*)+)/i', $inter, $matches)) {
     314        $match = $matches[4];
     315        for($i = 0 ; $i < count($match) ; $i++) if (!preg_match('/ (à|du) /', $match[$i]) && !preg_match('/^\D*\d[\d\.]+\d\d\d\D*$/', $match[$i])) {
    317316                $match[$i] = preg_replace('/[, ]+et[, ]+/', ', ', $match[$i]);
    318317                $matche = explode(';', $match[$i]);
    319                 if (count($matche) == 1 && preg_match('/\d\d\d(\d|\D+\d\d\d)/', $match[$i]))
     318                if (count($matche) == 1 && !preg_match('/\d[,\s\(\(]+\d\d\d\d\D+\d\d\d\d/', $match[$i]))
    320319                        $matche = explode(',', $matche[0]);
    321320                $loie = $matche;
     
    327326                                $loie[$y] = $this->getSeance()->getSession().'-'.preg_replace('/\D/', '', $loie[$y]);
    328327                        }
    329                         $loie[$y] = trim($loie[$y]);
     328                        $loie[$y] = trim(preg_replace('/<[^>]*>/', '', $loie[$y]));
    330329                        if (strlen($loie[$y]) < 10) continue;
    331330                        $matche[$y] = preg_replace('/\D/', '.', trim($matche[$y]));
Note: See TracChangeset for help on using the changeset viewer.