Changeset 1274


Ignore:
Timestamp:
Aug 22, 2010, 8:42:40 PM (11 years ago)
Author:
roux
Message:

doctrine au lieu de Doctrine ne semble plus marcher sous linux avec la 1.4

Location:
cpc/trunk/project
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/amendement/actions/actions.class.php

    r1186 r1274  
    77  public function executeShow(sfWebRequest $request)
    88  {
    9     $query = doctrine::getTable('Amendement')->createquery('a')
     9    $query = Doctrine::getTable('Amendement')->createquery('a')
    1010      ->where('a.texteloi_id = ?', $request->getParameter('loi'))
    1111      ->andWhere('a.numero = ?', $request->getParameter('numero'))
     
    2121     else $this->section = $section->getSection(1);
    2222
    23      $this->identiques = doctrine::getTable('Amendement')->createQuery('a')
     23     $this->identiques = Doctrine::getTable('Amendement')->createQuery('a')
    2424       ->where('content_md5 = ?', $this->amendement->content_md5)
    2525       ->orderBy('numero')
     
    4848       ->fetchArray();
    4949   
    50      $this->loi = doctrine::getTable('TitreLoi')->findLightLoi($this->amendement->texteloi_id);
     50     $this->loi = Doctrine::getTable('TitreLoi')->findLightLoi($this->amendement->texteloi_id);
    5151  }
    5252
    5353  public function executeParlementaire(sfWebRequest $request)
    5454  {
    55     $this->parlementaire = doctrine::getTable('Parlementaire')
     55    $this->parlementaire = Doctrine::getTable('Parlementaire')
    5656      ->findOneBySlug($request->getParameter('slug'));
    5757    $this->forward404Unless($this->parlementaire);
    58     $this->amendements = doctrine::getTable('Amendement')->createQuery('a')
     58    $this->amendements = Doctrine::getTable('Amendement')->createQuery('a')
    5959      ->leftJoin('a.ParlementaireAmendement pa')
    6060      ->where('pa.parlementaire_id = ?', $this->parlementaire->id)
     
    6969  public function executeParlementaireSection(sfWebRequest $request)
    7070  {
    71     $this->parlementaire = doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
     71    $this->parlementaire = Doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
    7272    $this->forward404Unless($this->parlementaire);
    7373
    74     $this->section = doctrine::getTable('Section')->find($request->getParameter('id'));
     74    $this->section = Doctrine::getTable('Section')->find($request->getParameter('id'));
    7575    $this->forward404Unless($this->section);
    7676
     
    8080                                          'return' => 'value'));
    8181
    82     $this->qamendements = doctrine::getTable('Amendement')->createQuery('a')
     82    $this->qamendements = Doctrine::getTable('Amendement')->createQuery('a')
    8383      ->leftJoin('a.ParlementaireAmendement pa')
    8484      ->where('pa.parlementaire_id = ?', $this->parlementaire->id)
     
    117117      $ids[] = $s['id'];
    118118   
    119     $this->query = doctrine::getTable('Amendement')->createQuery('a');
     119    $this->query = Doctrine::getTable('Amendement')->createQuery('a');
    120120    if (count($ids))
    121121      $this->query->whereIn('a.id', $ids);
     
    129129
    130130    if ($slug = $request->getParameter('parlementaire')) {
    131       $this->parlementaire = doctrine::getTable('Parlementaire')
     131      $this->parlementaire = Doctrine::getTable('Parlementaire')
    132132        ->findOneBySlug($slug);
    133133      if ($this->parlementaire)
     
    149149    if ($amdt == 'all' || $amdt == 'new' ) {
    150150      if (count($this->lois) == 1)
    151         $this->loi = doctrine::getTable('TitreLoi')->findLightLoi($this->lois[0]);
    152       $this->amendements_query = doctrine::getTable('Amendement')
     151        $this->loi = Doctrine::getTable('TitreLoi')->findLightLoi($this->lois[0]);
     152      $this->amendements_query = Doctrine::getTable('Amendement')
    153153        ->createQuery('a')
    154154        ->whereIn('a.texteloi_id', $this->lois)
  • cpc/trunk/project/apps/frontend/modules/api/actions/actions.class.php

    r1216 r1274  
    7272  public function executeListParlementaires(sfWebRequest $request)
    7373  {
    74     $deputes = doctrine::getTable('Parlementaire')->createQuery('p')->execute();
     74    $deputes = Doctrine::getTable('Parlementaire')->createQuery('p')->execute();
    7575    $this->res = array('deputes' => array());
    7676    $this->champs = array();
     
    104104    $this->forward404Unless($slug);
    105105
    106     $depute = doctrine::getTable('Parlementaire')->findOneBySlug($slug);
     106    $depute = Doctrine::getTable('Parlementaire')->findOneBySlug($slug);
    107107    $this->res = array();
    108108    $this->multi = array();
  • cpc/trunk/project/apps/frontend/modules/commentaire/actions/actions.class.php

    r1265 r1274  
    8686
    8787  // On teste l'existence préalable du même commentaire
    88     if ($existing = doctrine::getTable('Commentaire')->createQuery('c')
     88    if ($existing = Doctrine::getTable('Commentaire')->createQuery('c')
    8989      ->select('created_at')
    9090      ->where('citoyen_id = ?', $this->getUser()->getAttribute('user_id'))
     
    104104    $commentaire->object_id = $this->id;
    105105    $commentaire->lien = $redirect_url[$this->type].$this->id;
    106     $object = doctrine::getTable($this->type)->find($this->id);
     106    $object = Doctrine::getTable($this->type)->find($this->id);
    107107    if (isset($object->texteloi_id)) {
    108       $loi = doctrine::getTable('TitreLoi')->findLightLoi($object->texteloi_id);
     108      $loi = Doctrine::getTable('TitreLoi')->findLightLoi($object->texteloi_id);
    109109      if ($this->type != 'Amendement') {
    110110        $present = preg_replace('/<br\/>.*$/', '', $loi['titre']).' - A propos de l\'article ';
    111111        if ($this->type == 'Alinea') {
    112           $article = doctrine::getTable('ArticleLoi')->createQuery('a')
     112          $article = Doctrine::getTable('ArticleLoi')->createQuery('a')
    113113            ->select('titre')
    114114            ->where('texteloi_id = ?', $object->texteloi_id)
     
    164164        $commentaire->addObject('Section', $section->getSection(1)->id);
    165165      if (!($seance = $object->getIntervention($object->numero))) {
    166         $identiques = doctrine::getTable('Amendement')->createQuery('a')
     166        $identiques = Doctrine::getTable('Amendement')->createQuery('a')
    167167          ->where('content_md5 = ?', $object->content_md5)
    168168          ->orderBy('numero')->execute();
     
    177177        if (preg_match('/^Article\s+(.*)$/', $object->sujet, $match)) {
    178178          $art = preg_replace('/premier/i', '1er', $match[1]);
    179           if ($art_obj = doctrine::getTable('ArticleLoi')->findOneByLoiTitre($object->texteloi_id,$art))
     179          if ($art_obj = Doctrine::getTable('ArticleLoi')->findOneByLoiTitre($object->texteloi_id,$art))
    180180            $commentaire->addObject('ArticleLoi', $art_obj->id);
    181181        } else $commentaire->addObject('TitreLoi', $loi->id);
  • cpc/trunk/project/apps/frontend/modules/commentaire/actions/components.class.php

    r1212 r1274  
    4545    $id = $this->object->id;
    4646    $type = get_class($this->object);
    47     $query = doctrine::getTable('Commentaire')->createQuery('c')
     47    $query = Doctrine::getTable('Commentaire')->createQuery('c')
    4848      ->leftJoin('c.Objects co')
    4949      ->where('co.object_type = ?', $type)
  • cpc/trunk/project/apps/frontend/modules/intervention/actions/actions.class.php

    r964 r1274  
    1414  {
    1515    if (!$this->type = $request->getParameter('type')) $this->type = 'all';
    16     $this->parlementaire = doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
     16    $this->parlementaire = Doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
    1717    $this->forward404Unless($this->parlementaire);
    18     $this->interventions = doctrine::getTable('Intervention')->createQuery('i')
     18    $this->interventions = Doctrine::getTable('Intervention')->createQuery('i')
    1919      ->where('i.parlementaire_id = ?', $this->parlementaire->id);
    2020    if (preg_match('/(commission|question|loi)$/', $this->type)) {
     
    3939 
    4040  public function executeParlementaireOrganisme(sfWebRequest $request) {
    41     $this->parlementaire = doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
     41    $this->parlementaire = Doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
    4242    $this->forward404Unless($this->parlementaire);
    43     $this->orga = doctrine::getTable('Organisme')->find($request->getParameter('orga'));
     43    $this->orga = Doctrine::getTable('Organisme')->find($request->getParameter('orga'));
    4444    $this->forward404Unless($this->orga);
    45     $this->interventions = doctrine::getTable('Intervention')->createQuery('i')
     45    $this->interventions = Doctrine::getTable('Intervention')->createQuery('i')
    4646      ->leftJoin('i.Seance s')
    4747      ->where('i.parlementaire_id = ?', $this->parlementaire->id)
     
    5454
    5555  public function executeShow(sfWebRequest $request) {
    56     $this->intervention = doctrine::getTable('Intervention')->createquery('i')
     56    $this->intervention = Doctrine::getTable('Intervention')->createquery('i')
    5757      ->where('i.id = ?', $request->getParameter('id'))
    5858      ->fetchOne();
     
    7272  public function executeSeance(sfWebRequest $request) {
    7373    $seance_id = $request->getParameter('seance');
    74     $this->seance = doctrine::getTable('Seance')->find($seance_id);
     74    $this->seance = Doctrine::getTable('Seance')->find($seance_id);
    7575    $this->forward404Unless($this->seance);
    7676    if ($this->seance->type == 'commission') $this->orga = $this->seance->getOrganisme();
    77     $query = doctrine::getTable('Intervention')->createquery('i')
     77    $query = Doctrine::getTable('Intervention')->createquery('i')
    7878        ->where('i.seance_id = ?', $seance_id)
    7979        ->orderBy('i.timestamp ASC');
     
    9090    $this->tags = split('\|', $request->getParameter('tags'));
    9191   
    92     if (doctrine::getTable('Tag')->findOneByName($this->tags[0]))
     92    if (Doctrine::getTable('Tag')->findOneByName($this->tags[0]))
    9393      $query = PluginTagTable::getObjectTaggedWithQuery('Intervention', $this->tags);
    9494    else
    95       $query = doctrine::getTable('Intervention')
     95      $query = Doctrine::getTable('Intervention')
    9696        ->createQuery('Intervention')->where('0');
    9797
    9898    if ($slug = $request->getParameter('parlementaire')) {
    99       $this->parlementaire = doctrine::getTable('Parlementaire')
     99      $this->parlementaire = Doctrine::getTable('Parlementaire')
    100100        ->findOneBySlug($slug);
    101101      if ($this->parlementaire)
     
    145145    }
    146146
    147     $this->query = doctrine::getTable('Intervention')->createQuery('i');
     147    $this->query = Doctrine::getTable('Intervention')->createQuery('i');
    148148    if (count($ids))
    149149      $this->query->whereIn('i.id', $ids);
     
    157157
    158158    if ($slug = $request->getParameter('parlementaire')) {
    159       $this->parlementaire = doctrine::getTable('Parlementaire')
     159      $this->parlementaire = Doctrine::getTable('Parlementaire')
    160160        ->findOneBySlug($slug);
    161161      if ($this->parlementaire)
  • cpc/trunk/project/apps/frontend/modules/intervention/actions/components.class.php

    r876 r1274  
    88  public function executeParlementaireQuestion()
    99  {
    10     $this->questions = doctrine::getTable('Intervention')->createQuery('i')
     10    $this->questions = Doctrine::getTable('Intervention')->createQuery('i')
    1111      ->where('i.parlementaire_id = ?', $this->parlementaire->id)
    1212      ->andWhere('i.type = ?', 'question')
  • cpc/trunk/project/apps/frontend/modules/loi/actions/actions.class.php

    r1242 r1274  
    1414  private function getAmendements($loi, $articles = 'all', $alineas = 0) {
    1515    $amendements = array();
    16     $admts = doctrine::getTable('Amendement')->createquery('a')
     16    $admts = Doctrine::getTable('Amendement')->createquery('a')
    1717      ->where('a.texteloi_id = ?', $loi)
    1818      ->andWhere('a.sort <> ?', 'Rectifié')
     
    4646  public function executeLoi(sfWebRequest $request) {
    4747    $loi_id = $this->getLoi($request);
    48     $this->soussections = doctrine::getTable('TitreLoi')->createquery('t')
     48    $this->soussections = Doctrine::getTable('TitreLoi')->createquery('t')
    4949      ->where('t.texteloi_id = ?', $loi_id)
    5050      ->andWhere('t.id != t.titre_loi_id')
    5151      ->orderBy('t.chapitre, t.section')
    5252      ->execute();
    53     $this->articles = doctrine::getTable('ArticleLoi')->createquery('a')
     53    $this->articles = Doctrine::getTable('ArticleLoi')->createquery('a')
    5454      ->where('a.texteloi_id = ?', $loi_id)
    5555      ->orderBy('a.ordre')
    5656      ->fetchArray();
    57     $this->amendements = count(doctrine::getTable('Amendement')->createquery('a')
     57    $this->amendements = count(Doctrine::getTable('Amendement')->createquery('a')
    5858      ->where('a.texteloi_id = ?', $loi_id)
    5959      ->andWhere('a.sort <> ?', 'Rectifié')
     
    6969    $loi_id = $this->getLoi($request, 1);
    7070    $n_chapitre = $request->getParameter('chapitre');
    71     $this->chapitre = doctrine::getTable('TitreLoi')->findChapitre($loi_id, $n_chapitre);
     71    $this->chapitre = Doctrine::getTable('TitreLoi')->findChapitre($loi_id, $n_chapitre);
    7272    $this->forward404Unless($this->chapitre);
    7373    $n_section = $request->getParameter('section');
    74     $artquery = doctrine::getTable('ArticleLoi')->createquery('a');
     74    $artquery = Doctrine::getTable('ArticleLoi')->createquery('a');
    7575    if ($n_section && $n_section != 0) {
    76       $this->section = doctrine::getTable('TitreLoi')->findSection($loi_id, $n_chapitre, $n_section);
     76      $this->section = Doctrine::getTable('TitreLoi')->findSection($loi_id, $n_chapitre, $n_section);
    7777      $this->forward404Unless($this->section);
    7878      $artquery->where('a.titre_loi_id = ?', $this->section->id);
    7979    } else {
    80       $this->soussections = doctrine::getTable('TitreLoi')->createquery('t')
     80      $this->soussections = Doctrine::getTable('TitreLoi')->createquery('t')
    8181        ->where('t.texteloi_id = ?', $loi_id)
    8282        ->andWhere('t.chapitre = ?', $n_chapitre)
     
    9999      if (preg_match('/^(\d+)\s+bis$/',$n_section, $match)) {
    100100        $this->precedent = $match[1];
    101         if (doctrine::getTable('TitreLoi')->findSection($loi_id, $n_chapitre, $match[1]+1))
     101        if (Doctrine::getTable('TitreLoi')->findSection($loi_id, $n_chapitre, $match[1]+1))
    102102          $this->suivant = $match[1] + 1;
    103103      } else {
    104104        $pre = $n_section - 1;
    105         $voisins = doctrine::getTable('TitreLoi')->createQuery('c')
     105        $voisins = Doctrine::getTable('TitreLoi')->createQuery('c')
    106106          ->select('c.section')
    107107          ->where('c.texteloi_id = ?', $loi_id)
     
    143143      if (preg_match('/^(\d+)\s+bis$/',$n_chapitre, $match)) {
    144144        $this->precedent = $match[1];
    145         if (doctrine::getTable('TitreLoi')->findChapitre($loi_id, $match[1]+1)) $this->suivant = $match[1]+1;
     145        if (Doctrine::getTable('TitreLoi')->findChapitre($loi_id, $match[1]+1)) $this->suivant = $match[1]+1;
    146146      } else {
    147147        $pre = $n_chapitre - 1;
    148         $voisins = doctrine::getTable('TitreLoi')->createQuery('c')
     148        $voisins = Doctrine::getTable('TitreLoi')->createQuery('c')
    149149          ->select('c.chapitre')
    150150          ->where('c.texteloi_id = ?', $loi_id)
     
    188188 public function executeAlinea(sfWebRequest $request) {
    189189    $id = $request->getParameter('id');
    190     $this->alinea = doctrine::getTable('Alinea')->find($id);
     190    $this->alinea = Doctrine::getTable('Alinea')->find($id);
    191191    $this->forward404Unless($this->alinea);
    192192    $article = $this->alinea->getArticle();
    193193    $this->forward404Unless($article);
    194     $this->loi = doctrine::getTable('TitreLoi')->findLightLoi($article->texteloi_id);
     194    $this->loi = Doctrine::getTable('TitreLoi')->findLightLoi($article->texteloi_id);
    195195    $loi_id = $this->loi->texteloi_id;
    196196    $index = array();
     
    198198      if ($i > 0) $index[] = $i;
    199199    }
    200     $this->alineas = doctrine::getTable('Alinea')
     200    $this->alineas = Doctrine::getTable('Alinea')
    201201      ->createquery('a')
    202202      ->where('a.article_loi_id = ?', $article->id)
     
    213213  public function executeArticle(sfWebRequest $request) {
    214214    if ($id = $request->getParameter('id'))
    215       $this->article = doctrine::getTable('ArticleLoi')->find($id);
     215      $this->article = Doctrine::getTable('ArticleLoi')->find($id);
    216216    else {
    217217      $loi_id = $this->getLoi($request, 1);
    218218      $slug_article = $request->getParameter('article');
    219       $this->article = doctrine::getTable('ArticleLoi')->findOneByLoiSlug($loi_id, $slug_article);
     219      $this->article = Doctrine::getTable('ArticleLoi')->findOneByLoiSlug($loi_id, $slug_article);
    220220    }
    221221    $this->forward404Unless($this->article);
    222222    if (!(isset($slug_article))) {
    223       $this->loi = doctrine::getTable('TitreLoi')->findLightLoi($this->article->texteloi_id);
     223      $this->loi = Doctrine::getTable('TitreLoi')->findLightLoi($this->article->texteloi_id);
    224224      $loi_id = $this->loi->texteloi_id;
    225225    }
    226     $this->alineas = doctrine::getTable('Alinea')
     226    $this->alineas = Doctrine::getTable('Alinea')
    227227      ->createquery('a')
    228228      ->where('a.article_loi_id = ?', $this->article->id)
     
    243243    $loi_id = $request->getParameter('loi');
    244244    if ($light)
    245       $this->loi = doctrine::getTable('TitreLoi')->findLightLoi($loi_id);
    246     else $this->loi = doctrine::getTable('TitreLoi')->findLoi($loi_id);
     245      $this->loi = Doctrine::getTable('TitreLoi')->findLightLoi($loi_id);
     246    else $this->loi = Doctrine::getTable('TitreLoi')->findLoi($loi_id);
    247247    $this->forward404Unless($this->loi);
    248248    return $loi_id;
  • cpc/trunk/project/apps/frontend/modules/parlementaire/actions/actions.class.php

    r1257 r1274  
    178178      }
    179179    } else {
    180       $ctquery = doctrine_query::create()
     180      $ctquery = Doctrine_Query::create()
    181181        ->from('Parlementaire p')
    182182        ->select('count(distinct p.id) as ct')
    183183        ->fetchOne();
    184184      $this->total = $ctquery['ct'];
    185       $ctquery = doctrine_query::create()
     185      $ctquery = Doctrine_Query::create()
    186186        ->from('Parlementaire p')
    187187        ->select('count(distinct p.id) as ct')
  • cpc/trunk/project/apps/frontend/modules/presence/actions/actions.class.php

    r1238 r1274  
    3838    $this->seance = Doctrine::getTable('Seance')->findOneById($seance_id);
    3939    $this->forward404Unless($this->seance);
    40     $this->preuves = doctrine::getTable('PreuvePresence')
     40    $this->preuves = Doctrine::getTable('PreuvePresence')
    4141      ->createQuery('pp')
    4242      ->leftJoin('pp.Presence p')
     
    5050    $seance_id = $request->getParameter('seance');
    5151    $this->forward404Unless($seance_id);
    52     $this->seance = doctrine::getTable('Seance')->createQuery('s')
     52    $this->seance = Doctrine::getTable('Seance')->createQuery('s')
    5353      ->where('s.id = ?', $seance_id)
    5454      ->leftJoin('s.Organisme')
    5555      ->fetchOne();
    5656    $this->forward404Unless($this->seance);
    57     $this->intervenants = doctrine::getTable('Presence')->createQuery('p')     
     57    $this->intervenants = Doctrine::getTable('Presence')->createQuery('p')     
    5858      ->leftJoin('p.Parlementaire pa')
    5959      ->leftJoin('p.Preuves pr')
     
    6363      ->orderBy('pa.nom_de_famille')
    6464      ->execute();
    65     $this->presents = doctrine::getTable('Presence')->createQuery('p')
     65    $this->presents = Doctrine::getTable('Presence')->createQuery('p')
    6666      ->where('p.seance_id = ?', $seance_id)
    6767      ->leftJoin('p.Parlementaire pa')
  • cpc/trunk/project/apps/frontend/modules/questions/actions/actions.class.php

    r1186 r1274  
    1515    //respect de l'existant : il est possible d'appeler les questions ecrites par leur id
    1616    //Mais lorsque c'est le cas on redirige vers une url plus parlante utilisant le numéro définit par l'AN
    17     $question = doctrine::getTable('QuestionEcrite')->find($request->getParameter('id'));
     17    $question = Doctrine::getTable('QuestionEcrite')->find($request->getParameter('id'));
    1818    $this->forward404Unless($question);
    1919    return $this->redirect('@question_numero?numero='.$question->numero);
     
    2222  {
    2323    $numero = $request->getParameter('numero');
    24     $this->question = doctrine::getTable('QuestionEcrite')
     24    $this->question = Doctrine::getTable('QuestionEcrite')
    2525      ->createquery('q')
    2626      ->where('q.numero = ?', $numero)
     
    2828      ->fetchOne();
    2929    $this->forward404Unless($this->question);
    30     $this->parlementaire = doctrine::getTable('Parlementaire')->find($this->question->parlementaire_id);
     30    $this->parlementaire = Doctrine::getTable('Parlementaire')->find($this->question->parlementaire_id);
    3131    $this->forward404Unless($this->parlementaire);
    3232  }
     
    3434  public function executeParlementaire(sfWebRequest $request)
    3535  {
    36     $this->parlementaire = doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
     36    $this->parlementaire = Doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
    3737    $this->forward404Unless($this->parlementaire);
    38     $this->questions = doctrine::getTable('QuestionEcrite')->createQuery('q')
     38    $this->questions = Doctrine::getTable('QuestionEcrite')->createQuery('q')
    3939      ->where('q.parlementaire_id = ?', $this->parlementaire->id)
    4040      ->orderBy('q.date DESC, q.numero DESC');
     
    7777    }
    7878
    79     $this->query = doctrine::getTable('QuestionEcrite')->createQuery('i');
     79    $this->query = Doctrine::getTable('QuestionEcrite')->createQuery('i');
    8080    if (count($ids))
    8181      $this->query->whereIn('i.id', $ids);
     
    9191
    9292    if ($slug = $request->getParameter('parlementaire')) {
    93       $this->parlementaire = doctrine::getTable('Parlementaire')
     93      $this->parlementaire = Doctrine::getTable('Parlementaire')
    9494        ->findOneBySlug($slug);
    9595      if ($this->parlementaire)
     
    104104  }
    105105}
     106?>
  • cpc/trunk/project/apps/frontend/modules/section/actions/actions.class.php

    r1120 r1274  
    1818  public function executeParlementaire(sfWebRequest $request)
    1919  {
    20     $this->parlementaire = doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
     20    $this->parlementaire = Doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
    2121    $this->forward404Unless($this->parlementaire);
    2222    $this->titre = 'Dossiers parlementaires';
     
    2626  public function executeParlementaireSection(sfWebRequest $request)
    2727  {
    28     $this->parlementaire = doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
     28    $this->parlementaire = Doctrine::getTable('Parlementaire')->findOneBySlug($request->getParameter('slug'));
    2929    $this->forward404Unless($this->parlementaire);
    3030
    31     $this->section = doctrine::getTable('Section')->find($request->getParameter('id'));
     31    $this->section = Doctrine::getTable('Section')->find($request->getParameter('id'));
    3232    $this->forward404Unless($this->section);
    3333
    34     $this->qinterventions = doctrine::getTable('Intervention')->createQuery('i')
     34    $this->qinterventions = Doctrine::getTable('Intervention')->createQuery('i')
    3535      ->where('i.parlementaire_id = ?', $this->parlementaire->id)
    3636      ->leftJoin('i.Section s')
     
    4141  public function executeShow(sfWebRequest $request)
    4242  {
    43     $this->section = doctrine::getTable('Section')->find($request->getParameter('id'));
     43    $this->section = Doctrine::getTable('Section')->find($request->getParameter('id'));
    4444    $this->forward404Unless($this->section);
    4545
     
    9999    if (!($this->order = $request->getParameter('order')))
    100100      $this->order = 'plus';
    101     $query = doctrine::getTable('Section')->createQuery('s')
     101    $query = Doctrine::getTable('Section')->createQuery('s')
    102102      ->where('s.id = s.section_id')
    103103      ->andWhere('s.nb_interventions > 5');
  • cpc/trunk/project/apps/frontend/modules/section/actions/components.class.php

    r1113 r1274  
    99  public function executeParlementaire()
    1010  {
    11     $sql = doctrine_query::create()
     11    $sql = Doctrine_Query::create()
    1212      ->from('Section s')
    1313      ->select('s.section_id, sp.titre, count(i.id) as nb')
  • cpc/trunk/project/apps/frontend/modules/solr/actions/actions.class.php

    r1160 r1274  
    6666      $res = $this->results['docs'][$i];
    6767      $this->results['docs'][$i]['highlighting'] = implode('...', $results['highlighting'][$res['id']]['text']);
    68       //      $this->results['docs'][$i]['object'] = doctrine::getTable($res['object_name'])->find($res['object_id']);
     68      //      $this->results['docs'][$i]['object'] = Doctrine::getTable($res['object_name'])->find($res['object_id']);
    6969    }
    7070    $this->results['end'] = $deb + $nb;
  • cpc/trunk/project/lib/model/doctrine/Amendement.class.php

    r1215 r1274  
    5454      if ($debug) echo $nom."//".$sexe."//".$groupe."//".$circo." => ";
    5555      $depute = Doctrine::getTable('Parlementaire')->findOneByNomSexeGroupeCirco($nom, $sexe, $groupe, $circo, $this);
    56       if (!$depute) print "ERROR: Auteur introuvable in ".$this->source." : ".$nom." // ".$sexe." // ".$groupe."\n";
     56      if (!$depute) print "ERROR: Auteur introuvable in ".$this->source."/".$this->numero." : ".$nom." // ".$sexe." // ".$groupe."\n";
    5757      else {
    5858        if ($debug) echo $depute->nom."\n";
     
    6666
    6767  public function addParlementaire($depute, $signataireindex) {
    68     foreach(doctrine::getTable('ParlementaireAmendement')->createQuery('pa')->select('parlementaire_id')->where('amendement_id = ?', $this->id)->fetchArray() as $parlamdt) if ($parlamdt['parlementaire_id'] == $depute->id) return true;
     68    foreach(Doctrine::getTable('ParlementaireAmendement')->createQuery('pa')->select('parlementaire_id')->where('amendement_id = ?', $this->id)->fetchArray() as $parlamdt) if ($parlamdt['parlementaire_id'] == $depute->id) return true;
    6969   
    7070    $pa = new ParlementaireAmendement();
  • cpc/trunk/project/lib/model/doctrine/Intervention.class.php

    r1154 r1274  
    101101
    102102  public function setContexte($context, $date = null, $timestamp = null) {
    103     return $this->setSection(doctrine::getTable('Section')->findOneByContexteOrCreateIt($context, $date, $timestamp));
     103    return $this->setSection(Doctrine::getTable('Section')->findOneByContexteOrCreateIt($context, $date, $timestamp));
    104104  }
    105105
  • cpc/trunk/project/lib/model/doctrine/OrganismeTable.class.php

    r1028 r1274  
    4444   
    4545
    46     $orgs = doctrine::getTable('Organisme')->createQuery('o')->where('type = ?', $type)->execute();
     46    $orgs = Doctrine::getTable('Organisme')->createQuery('o')->where('type = ?', $type)->execute();
    4747    foreach($orgs as $o) {
    4848      $res = similar_text($o->nom, $nom, $pc);
  • cpc/trunk/project/lib/model/doctrine/Seance.class.php

    r1004 r1274  
    9999  }
    100100  public function getInterventions() {
    101     $q = doctrine::getTable('Intervention')->createQuery('i')->where('seance_id = ?', $this->id)->leftJoin('i.Personnalite p')->leftJoin('i.Parlementaire pa')->orderBy('i.timestamp ASC');
     101    $q = Doctrine::getTable('Intervention')->createQuery('i')->where('seance_id = ?', $this->id)->leftJoin('i.Personnalite p')->leftJoin('i.Parlementaire pa')->orderBy('i.timestamp ASC');
    102102    return $q->execute();
    103103  }
  • cpc/trunk/project/lib/model/doctrine/Section.class.php

    r908 r1274  
    1313    if (count($titres) > 1) {
    1414      $parent_titre = array_shift($titres);
    15       $parent = doctrine::getTable('Section')->findOneByContexteOrCreateIt($parent_titre);
     15      $parent = Doctrine::getTable('Section')->findOneByContexteOrCreateIt($parent_titre);
    1616    }
    1717    $this->_set('titre', $titres[0]);
     
    2323  }
    2424  public function getSubSections() {
    25     return $q = doctrine::getTable('Section')->createQuery('s')
     25    return $q = Doctrine::getTable('Section')->createQuery('s')
    2626      ->where('s.section_id = ?', $this->id)
    2727      ->orderBy('s.min_date ASC, s.timestamp ASC')->execute();
    2828  }
    2929  public function getFirstSeance() {
    30     $q = doctrine_query::create()
     30    $q = Doctrine_Query::create()
    3131      ->from('Seance s, Section st, Intervention i')
    3232      ->select('s.id')
     
    3939  }
    4040  public function getSeances() {
    41     $q = doctrine_query::create()
     41    $q = Doctrine_Query::create()
    4242      ->from('Seance s, Section st, Intervention i')
    4343      ->select('s.*')
  • cpc/trunk/project/lib/task/correctCommentairesTask.class.php

    r1102 r1274  
    1313    $manager = new sfDatabaseManager($this->configuration);
    1414    $about = array('Intervention' => "Suite aux propos d", 'Amendement' => "Au sujet d'un amendement déposé", 'QuestionEcrite' => "A propos d'une question écrite d");
    15     $comments = doctrine::getTable('Commentaire')->findAll();
     15    $comments = Doctrine::getTable('Commentaire')->findAll();
    1616    $loi = '';
    1717    foreach($comments as $comment) {
    1818      unset($loi);
    19       $object = doctrine::getTable($comment->object_type)->find($comment->object_id);
     19      $object = Doctrine::getTable($comment->object_type)->find($comment->object_id);
    2020      if (isset($object->texteloi_id)) {
    21         $loi = doctrine::getTable('TitreLoi')->findLightLoi($object->texteloi_id);
     21        $loi = Doctrine::getTable('TitreLoi')->findLightLoi($object->texteloi_id);
    2222        if ($comment->object_type != 'Amendement') {
    2323          $present = preg_replace('/<br\/>.*$/', '', $loi['titre']).' - A propos de l\'article ';
    2424          if ($comment->object_type == 'Alinea') {
    25             $article = doctrine::getTable('ArticleLoi')->createQuery('a')
     25            $article = Doctrine::getTable('ArticleLoi')->createQuery('a')
    2626              ->select('titre')
    2727              ->where('texteloi_id = ?', $object->texteloi_id)
     
    7272          $comment->addObject('Section', $section->getSection(1)->id);
    7373        if (!($seance = $object->getIntervention($object->numero))) {
    74           $identiques = doctrine::getTable('Amendement')->createQuery('a')
     74          $identiques = Doctrine::getTable('Amendement')->createQuery('a')
    7575            ->where('content_md5 = ?', $object->content_md5)
    7676            ->orderBy('numero')->execute();
     
    8585          if (preg_match('/^Article\s+(.*)$/', $object->sujet, $match)) {
    8686            $art = preg_replace('/premier/i', '1er', $match[1]);
    87             if ($art_obj = doctrine::getTable('ArticleLoi')->findOneByLoiTitre($object->texteloi_id,$art))
     87            if ($art_obj = Doctrine::getTable('ArticleLoi')->findOneByLoiTitre($object->texteloi_id,$art))
    8888              $comment->addObject('ArticleLoi', $art_obj->id);
    8989          } else $comment->addObject('TitreLoi', $loi->id);
  • cpc/trunk/project/lib/task/indexSolrTask.class.php

    r1161 r1274  
    3737    foreach(array("Parlementaire", "QuestionEcrite", "Amendement", "Intervention") as $table) {
    3838      while (1) {
    39         $q = doctrine::getTable($table)
     39        $q = Doctrine::getTable($table)
    4040          ->createQuery('o')
    4141          ->orderBy('o.id ASC');
  • cpc/trunk/project/lib/task/loadHemicycleTask.class.php

    r1170 r1274  
    5757              $p = null;
    5858              if ($json->intervenant_url) {
    59             $p = doctrine::getTable('Parlementaire')
     59            $p = Doctrine::getTable('Parlementaire')
    6060                  ->findOneByUrlAn($json->intervenant_url);
    6161            if ($p) {
  • cpc/trunk/project/lib/task/tagSeanceTask.class.php

    r990 r1274  
    7777    unset($words);
    7878
    79     $qs = doctrine::getTable('Seance')->createQuery()->select('id')->where('tagged IS NULL');
     79    $qs = Doctrine::getTable('Seance')->createQuery()->select('id')->where('tagged IS NULL');
    8080
    8181    foreach($qs->fetchArray() as $s) {
     
    176176          if (preg_match('/'.$tag.'/i', $inter['intervention'])) {
    177177            if (!$i)
    178               $i = doctrine::getTable('Intervention')->find($inter['id']);
     178              $i = Doctrine::getTable('Intervention')->find($inter['id']);
    179179            $i->addTag($tag);
    180180          }
     
    187187      }
    188188      if ($tagged == 1) {
    189         $seance = doctrine::getTable('Seance')->find($s['id']);
     189        $seance = Doctrine::getTable('Seance')->find($s['id']);
    190190        $seance->tagged = 1;
    191191        $seance->save();
  • cpc/trunk/project/lib/task/topDeputesTask.class.php

    r1209 r1274  
    162162  protected function executeDeputesInfo() {
    163163    foreach (array_keys($this->deputes) as $id) {
    164       $dep = doctrine::getTable('Parlementaire')->find($id);
     164      $dep = Doctrine::getTable('Parlementaire')->find($id);
    165165      //Bidouille pour avoir les paramètres dans le bon ordre
    166166      $this->deputes[$id]['01_nom']['value'] = $dep->nom;
     
    235235    if (isset($arguments['month']) && preg_match('/(\d{4})-(\d{2})-01/', $arguments['month'], $m)) {
    236236      $this->executeMonth($arguments['month']);
    237       $globale = doctrine::getTable('VariableGlobale')->findOneByChamp('stats_month_'.$m[1]);
     237      $globale = Doctrine::getTable('VariableGlobale')->findOneByChamp('stats_month_'.$m[1]);
    238238      if (!$globale) {
    239239        $globale = new VariableGlobale();
     
    315315    }
    316316
    317     $globale = doctrine::getTable('VariableGlobale')->findOneByChamp('stats_groupes');
     317    $globale = Doctrine::getTable('VariableGlobale')->findOneByChamp('stats_groupes');
    318318    if (!$globale) {
    319319      $globale = new VariableGlobale();
  • cpc/trunk/project/lib/task/updateDeputesTask.class.php

    r1035 r1274  
    3838              next;
    3939//          echo "-".$json->nom." ".$json->id_an."\n";
    40             $parl = doctrine::getTable('Parlementaire')->findOneByNom($json->nom);
     40            $parl = Doctrine::getTable('Parlementaire')->findOneByNom($json->nom);
    4141            if (!$parl) {
    4242              $parl = new Parlementaire();
Note: See TracChangeset for help on using the changeset viewer.