Changeset 2414


Ignore:
Timestamp:
Oct 29, 2011, 3:57:14 PM (9 years ago)
Author:
roux
Message:

gestion titres sections qui commencent avec un accent

Location:
cpc/trunk/project
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/intervention/templates/seanceSuccess.php

    r2410 r2414  
    2727if ($table['section_id'] != $table['id']) {
    2828  if ($table['section_id'] != $lastparent) {
    29     echo '<li><a href="#table_'.$table['id'].'">'.ucfirst(preg_replace('/ > .*$/', '', $table['titre_complet'])).'</a></li>';
     29    echo '<li><a href="#table_'.$table['id'].'">'.myTools::betterUCFirst(preg_replace('/ > .*$/', '', $table['titre_complet'])).'</a></li>';
    3030    $lastparent = $table['section_id'];
    3131  }
     
    3636echo $table['id'];
    3737?>"><?php
    38 echo ucfirst($table['titre']);
     38echo myTools::betterUCFirst($table['titre']);
    3939?></a> <?php }
    4040if ($table['nb_interventions']) echo '<span class="dossier">('.link_to('voir le dossier', '@section?id='.$table['id']).')</span>'; ?></li>
     
    7070    if ($titre != 2) {
    7171      if ($lasttitre != 1) {
    72         echo '<h2 class="section">'.link_to(ucfirst($intervention->Section->Section->titre),'@section?id='.$intervention->Section->Section->id);
     72        echo '<h2 class="section">'.link_to(myTools::betterUCFirst($intervention->Section->Section->titre),'@section?id='.$intervention->Section->Section->id);
    7373        echo '</h2>';
    7474      }
    7575      if ($intervention->Section->id != $intervention->Section->section_id) {
    7676        echo '<h3 class="sous-section">';
    77         echo link_to(ucfirst($intervention->Section->titre),'@section?id='.$intervention->Section->id);
     77        echo link_to(myTools::betterUCFirst($intervention->Section->titre),'@section?id='.$intervention->Section->id);
    7878        echo '</h3><br/>';
    7979      }
  • cpc/trunk/project/lib/model/doctrine/Section.class.php

    r1424 r2414  
    9090
    9191  public function getTitre() {
    92     return ucfirst(preg_replace('/\s*\?$/', '', $this->_get('titre')));
     92    return myTools::betterUCFirst(preg_replace('/\s*\?$/', '', $this->_get('titre')));
    9393  }
    9494
  • cpc/trunk/project/lib/model/doctrine/myTools.class.php

    r2117 r2414  
    11<?php
    22class myTools {
     3
     4  public static function betterUCFirst($str) {
     5    $str = ucfirst($str);
     6    $str = preg_replace('/^é/', 'É', $str);
     7    $str = preg_replace('/^ê/', 'Ê', $str);
     8    $str = preg_replace('/^â/', 'Â', $str);
     9    $str = preg_replace('/^à/', 'À', $str);
     10    return $str;
     11  }
    312
    413  public static function convertYamlToArray($string) {
Note: See TracChangeset for help on using the changeset viewer.