Overview
SHA1:9211225bb19185142108103a8dbc730352abe619
Date: 2017-10-02 00:48:09
User: bohwaz
Comment:Correction recherche de membre
Timelines: family | ancestors | descendants | both | dev
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2017-10-02
23:03
[8b5dae6458] Permettre de supprimer un exercice vide, même clôturé (user: bohwaz, tags: dev)
00:48
[9211225bb1] Correction recherche de membre (user: bohwaz, tags: dev)
2017-09-25
23:22
[313fc97f1e] Afficher le bon lien selon si rubrique/article (user: bohwaz, tags: dev)
Changes

Modified src/include/lib/Garradin/Membres.php from [fe70506edd] to [655cc8c2c5].

   303    303           if (!$champs->get($field))
   304    304           {
   305    305               throw new \UnexpectedValueException($field . ' is not a valid field');
   306    306           }
   307    307   
   308    308           $champ = $champs->get($field);
   309    309   
   310         -        if ($champ['type'] == 'multiple')
          310  +        if ($champ->type == 'multiple')
   311    311           {
   312    312               $where = 'WHERE '.$field.' & (1 << '.(int)$query.')';
   313    313               $order = false;
   314    314           }
   315         -        elseif ($champ['type'] == 'tel')
          315  +        elseif ($champ->type == 'tel')
   316    316           {
   317    317               $query = Utils::normalizePhoneNumber($query);
   318    318               $query = preg_replace('!^0+!', '', $query);
   319    319   
   320    320               if ($query == '')
   321    321               {
   322    322                   return false;
................................................................................
   332    332           }
   333    333           else
   334    334           {
   335    335               $where = sprintf('WHERE transliterate_to_ascii(%s) LIKE %s', $field, $db->quote('%' . Utils::transliterateToAscii($query) . '%'));
   336    336               $order = sprintf('transliterate_to_ascii(%s) COLLATE NOCASE', $field);
   337    337           }
   338    338   
   339         -        $fields = array_keys($champs->getListedFields());
          339  +        $fields = array_keys((array)$champs->getListedFields());
   340    340   
   341    341           if (!in_array($field, $fields))
   342    342           {
   343    343               $fields[] = $field;
   344    344           }
   345    345   
   346    346           if (!in_array('email', $fields))

Modified src/templates/admin/membres/recherche.tpl from [fc0fa13904] to [f0aae1c0da].

    77     77           <tbody>
    78     78               {foreach from=$liste item="membre"}
    79     79                   <tr>
    80     80                       {if $session->canAccess('membres', Garradin\Membres::DROIT_ADMIN)}<td class="check"><input type="checkbox" name="selected[]" value="{$membre.id}" /></td>{/if}
    81     81                       <td class="num"><a href="{$admin_url}membres/fiche.php?id={$membre.id}">{$membre.id}</a></th>
    82     82                       {foreach from=$champs_entete key="c" item="cfg"}
    83     83                           {if $champ == $c}
    84         -                            <th><strong>{$membre[$c]|raw|display_champ_membre:$cfg}</strong></th>
           84  +                            <th><strong>{$membre->$c|raw|display_champ_membre:$cfg}</strong></th>
    85     85                           {else}
    86         -                            <td>{$membre[$c]|raw|display_champ_membre:$cfg}</td>
           86  +                            <td>{$membre->$c|raw|display_champ_membre:$cfg}</td>
    87     87                           {/if}
    88     88                       {/foreach}
    89     89                       <td class="actions">
    90     90                           {if !empty($membre.email)}<a class="icn" href="{$www_url}admin/membres/message.php?id={$membre.id}" title="Envoyer un message">✉</a> {/if}
    91     91                           <a class="icn" href="modifier.php?id={$membre.id}" title="Modifier la fiche membre">✎</a>
    92     92                       </td>
    93     93                   </tr>