Changeset 2731


Ignore:
Timestamp:
May 18, 2012, 7:03:28 PM (8 years ago)
Author:
goya
Message:

fix backend flip photo tool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/backend/modules/photos/actions/actions.class.php

    r2386 r2731  
    1919      $ids .= ','.$i;
    2020    }
    21     if ($ids) $query = Doctrine_Query::create()
    22       ->update('Parlementaire')
    23       ->set('autoflip', 1)
    24       ->whereIn('id', explode(',', $ids))
    25       ->execute();
     21    if ($ids) {
     22      $query = Doctrine_Query::create()->select('id, autoflip')->from('Parlementaire')->whereIn('id', explode(',', $ids));
     23      foreach ($query->fetchArray() as $dep)
     24        $query = Doctrine_Query::create()
     25          ->update('Parlementaire')
     26          ->set('autoflip', 1-$dep['autoflip'])
     27          ->where('id = ?', $dep['id'])
     28          ->execute();
     29    }
    2630    $this->parlementaires = Doctrine::getTable('Parlementaire')
    2731      ->createQuery()
Note: See TracChangeset for help on using the changeset viewer.