Changeset 3073


Ignore:
Timestamp:
Jan 21, 2013, 3:29:32 AM (8 years ago)
Author:
roux
Message:

mariage post-commission

Location:
cpc/trunk/project
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/loi/templates/loiSuccess.php

    r3069 r3073  
    4848    $nbart = $ss->nb_articles;
    4949    if ($ss->nb_commentaires > 0) {
    50       echo '(<span class="coms_loi_txt">'.$ss->nb_commentaires.' commentaire';
     50      echo ' (<span class="coms_loi_txt">'.$ss->nb_commentaires.' commentaire';
    5151      if ($ss->nb_commentaires > 1) echo 's';
    5252      echo '</span>)';
  • cpc/trunk/project/batch/loi/parse_loi.pl

    r3065 r3073  
    129129  $leveltype = lc(shift);
    130130  $levelvalue = romans(shift);
     131  $more = shift || "";
     132  $more =~ s/<[^>]*>//g;
    131133  $oldlevel = $curlevel;
    132134  if (!$hierarchy{$leveltype}) {
     
    136138    $curlevel = $hierarchy{$leveltype};
    137139  }
    138   $levels[$curlevel-1] = $levelvalue;
     140  $levels[$curlevel-1] = $levelvalue.$more;
    139141  for ($i=$curlevel; $i<4; $i++) {
    140142    $levels[$i] = 0;
    141143  }
    142   #print "TEST $leveltype ; $levelvalue ; $curlevel ; $hierarchy ; $levels\n";
     144  #print "TEST $leveltype ; $levelvalue.$more ; $curlevel ; $hierarchy ; $levels\n";
    143145}
    144146
    145147sub handle_text {
    146148  if ($deftitre == 0) {
    147     if ($content =~ /^\s*((chap|t)itre|volume|livre|tome|(sous-)?section)\s+(\d+|[ivx]+)(er?)?/i) {
    148       set_level($1, $4);
     149    if ($content =~ /^\s*((chap|t)itre|volume|livre|tome|(sous-)?section)\s+(\d+|[ivx]+)(e?r?\s*(<i>\s*)?(un|duo|tre)?(bis|qua|quint|quinqu|sex|oct|nov|non|dec)?(ter|ies)?)/i) {
     150      set_level($1, $4, $5);
    149151      $deftitre = 1;
    150152    } elsif ($align =~ /center/ && $content =~ /<b>\s*Article/) {
  • cpc/trunk/project/lib/model/doctrine/TitreLoi.class.php

    r3066 r3073  
    104104    for ($i = 1; $i < $level; $i++)
    105105      $levels[$i-1] = $this->_get('level'.$i);
    106     if (preg_match('/^(\d+)\s+bis$/',$levelvalue, $match)) {
     106    if (preg_match('/^(\d+e?r?)\s+bis$/',$levelvalue, $match)) {
    107107      $result[0] = $match[1];
    108       $levels[$levelvalue] = $match[1] + 1;
    109       if (Doctrine::getTable('TitreLoi')->findLevel($this->texteloi_id, $levels))
    110         $result[1] = $match[1] + 1;
     108      $levelnumber = preg_replace('/\D/', '', $result[0]);
     109      $levels[$level-1] = $levelnumber + 1;
     110      if (Doctrine::getTable('TitreLoi')->findLevel($this->texteloi_id, $level, $levels))
     111        $result[1] = $levelnumber + 1;
    111112    } else {
    112       $pre = $levelvalue - 1;
     113      $levelnumber = preg_replace('/\D/', '', $levelvalue);
     114      $pre = $levelnumber - 1;
    113115      $qvoisins = Doctrine::getTable('TitreLoi')->createQuery('c')
    114116        ->select('c.'.$levelstr)
     
    118120      for ($i = $level + 1; $i < 5; $i++)
    119121        $qvoisins->andWhere('c.level'.$i.' IS NULL');
    120       $voisins = $qvoisins->andWhereIn('c.'.$levelstr, array($pre, $pre." bis", $levelvalue." bis", $levelvalue + 1))
     122      $voisins = $qvoisins->andWhereIn('c.'.$levelstr, array($pre, $pre."e", $pre."er", $pre." bis", $pre."e bis", $pre."er bis", $levelvalue." bis", $levelnumber."e", $levelnumber."er", $levelnumber." bis", $levelnumber + 1))
    121123        ->orderBy('c.'.$levelstr)
    122124        ->fetchArray();
     
    128130        if ($levelvalue == 1)
    129131          $result[1] = $voisins[0][$levelstr];
    130         else if (preg_match('/^(\d+)\s+bis$/', $voisins[1][$levelstr], $match) && $match[1] < $levelvalue)
     132        else if (preg_match('/^(\d+)e?r?\s+bis$/', $voisins[1][$levelstr], $match) && $match[1] < $levelvalue)
    131133          $result[0] = $voisins[1][$levelstr];
    132134        else {
     
    140142        } else {
    141143          $result[0] = $voisins[0][$levelstr];
    142           if (preg_match('/'.$n_section.'/', $voisins[1][$levelstr])) {
     144          if (preg_match('/'.$levelvalue.'/', $voisins[1][$levelstr])) {
    143145            $result[0] = $voisins[0][$levelstr];
    144146            $result[1] = $voisins[1][$levelstr];
Note: See TracChangeset for help on using the changeset viewer.