much clearer handling of disabled and dead pple for the search+contact
authorx2000habouzit <x2000habouzit>
Thu, 18 Nov 2004 15:17:40 +0000 (15:17 +0000)
committerx2000habouzit <x2000habouzit>
Thu, 18 Nov 2004 15:17:40 +0000 (15:17 +0000)
htdocs/advanced_search.php
htdocs/carnet/mescontacts.php
htdocs/search.php
include/search.classes.inc.php
templates/carnet/mescontacts.tpl
templates/include/minifiche.tpl
templates/include/minifiche_pvt.tpl
templates/search.tpl

index e7e087a..313cb4c 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: advanced_search.php,v 1.30 2004-11-13 14:16:15 x2000habouzit Exp $
+        $Id: advanced_search.php,v 1.31 2004-11-18 15:17:40 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -106,7 +106,6 @@ else {
     $where = $fields->get_where_statement();
     $sql = 'SELECT SQL_CALC_FOUND_ROWS
                        DISTINCT u.matricule,u.matricule_ax,u.user_id,
-                       perms!=\'non-inscrit\' AS inscrit,
                        u.nom,
                        u.prenom,
                        u.promo,
index e9a486a..7fa912a 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: mescontacts.php,v 1.2 2004-11-13 14:16:17 x2000habouzit Exp $
+        $Id: mescontacts.php,v 1.3 2004-11-18 15:17:41 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -86,6 +86,8 @@ if(isset($_GET['trombi'])) {
 } else {
     $sql = "SELECT contact AS id,
                   a.*, l.alias AS forlife,
+                  1 AS inscrit,
+                  a.perms != 'non-inscrit' AS wasinscrit,
                   a.deces != 0 AS dcd, a.deces, a.matricule_ax, FIND_IN_SET('femme', a.flags) AS sexe,
                   e.entreprise, es.label AS secteur, ef.fonction_fr AS fonction,
                   IF(n.nat='',n.pays,n.nat) AS nat, n.a2 AS iso3166,
index d1512ad..a2f2cfb 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.php,v 1.49 2004-11-13 14:16:16 x2000habouzit Exp $
+        $Id: search.php,v 1.50 2004-11-18 15:17:40 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -48,7 +48,6 @@ if (array_key_exists('quick', $_REQUEST)) {
    
     $sql = 'SELECT SQL_CALC_FOUND_ROWS
                        DISTINCT r.matricule,u.matricule_ax,u.user_id,
-                       u.perms!="non-inscrit" AS inscrit,
                        UPPER(IF(u.nom!="",u.nom,u.nom_ini)) AS nom,
                        IF(u.prenom!="",u.prenom,u.prenom_ini) AS prenom,
                        u.promo AS promo,
index 8ba1676..15b84dc 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.classes.inc.php,v 1.35 2004-11-13 13:19:38 x2000habouzit Exp $
+        $Id: search.classes.inc.php,v 1.36 2004-11-18 15:17:41 x2000habouzit Exp $
  ***************************************************************************/
 
 require_once("xorg.misc.inc.php");
@@ -30,6 +30,8 @@ $globals->search_result_fields = '
                if(u.epouse=\'\', u.nom, u.epouse) AS NomSortKey,
                 u.epouse,u.date,u.web,u.mobile,
                 u.deces!=0 AS dcd,u.deces,
+               u.perms IN (\'admin\',\'user\') AS inscrit,
+               u.perms != \'non-inscrit\' AS wasinscrit,
                FIND_IN_SET(\'femme\', u.flags) AS sexe,
                 ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type,
                 ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type,
index 1065483..4027bbb 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: mescontacts.tpl,v 1.3 2004-11-17 22:03:56 x2000habouzit Exp $
+        $Id: mescontacts.tpl,v 1.4 2004-11-18 15:17:42 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -74,7 +74,7 @@ Pour afficher le trombi de tes contacts : [<a href="?trombi=1"><strong>vue sous
 
 <div class="contact-list">
 {foreach item=contact from=$contacts}
-{include file=include/minifiche.tpl c=$contact show_action="retirer" inscrit=1}
+{include file=include/minifiche.tpl c=$contact show_action="retirer"}
 {/foreach}
 </div>
 
index b792057..4f66ef0 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: minifiche.tpl,v 1.17 2004-11-17 15:22:14 x2000habouzit Exp $
+        $Id: minifiche.tpl,v 1.18 2004-11-18 15:17:42 x2000habouzit Exp $
  ***************************************************************************}
 
 
-{if !$inscrit || $c.dcd}<div class='grayed'>{/if}
-<div class="contact" {if $inscrit}{min_auth level='cookie'}title="fiche mise à jour le {$c.date|date_format:"%d %b %Y"}"{/min_auth}{/if}>
+{if !$c.inscrit || $c.dcd}<div class='grayed'>{/if}
+<div class="contact" {if $c.inscrit}{min_auth level='cookie'}title="fiche mise à jour le {$c.date|date_format:"%d %b %Y"}"{/min_auth}{/if}>
   <div class="nom">
     {if $c.sexe}&bull;{/if}
     {min_auth level="cookie"}
-    {if !$c.dcd && $inscrit}
+    {if !$c.dcd && $c.inscrit}
     <a href="{"fiche.php"|url}?user={$c.forlife}" class="popup2">
     {/if}
     {/min_auth}
     {if $c.epouse}{$c.epouse} {$c.prenom}<br />(née {$c.nom}){else}{$c.nom} {$c.prenom}{/if}
     {min_auth level="cookie"}
-    {if !$c.dcd && $inscrit}
+    {if !$c.dcd && $c.inscrit}
     </a>
     {/if}
     {/min_auth}
     {if $c.iso3166}
     <img src='{"images/"|url}flags/{$c.iso3166}.gif' alt='{$c.nat}' height='14' title='{$c.nat}' />&nbsp;
     {/if}
-    (X {$c.promo}{if $c.app0text},
-      {applis_fmt type=$c.app0type text=$c.app0text url=$c.app0url}
-    {/if}{if $c.app1text},
-      {applis_fmt type=$c.app1type text=$c.app1text url=$c.app1url}
-    {/if})
+    (X {$c.promo}{if $c.app0text}, {applis_fmt type=$c.app0type text=$c.app0text url=$c.app0url}
+    {/if}{if $c.app1text}, {applis_fmt type=$c.app1type text=$c.app1text url=$c.app1url}{/if})
     {if $c.dcd}décédé{if $c.sexe}e{/if} le {$c.deces|date_format:"%d %B %Y"}{/if}
     {min_auth level="cookie"}
-    {if !$c.dcd && !$inscrit}
-    <a href="{"marketing/public.php"|url}?num={$c.matricule}" class='popup'>clique ici si tu connais son adresse email !
-    </a>
+    {if !$c.dcd && !$c.inscrit}
+    <a href="{"marketing/public.php"|url}?num={$c.matricule}" class='popup'>clique ici si tu connais son adresse email !</a>
     {/if}
     {/min_auth}
   </div>
-  {min_auth level="cookie"}
-  {include file="include/minifiche_pvt.tpl"}
-  {/min_auth}
-  {only_public}
-  <div class="long"></div>
-  {/only_public}
+  {min_auth level="cookie"}{include file="include/minifiche_pvt.tpl"}{/min_auth}
+  {only_public}<div class="long"></div>{/only_public}
 </div>
-{if !$inscrit || $c.dcd}</div>{/if}
+{if !$c.inscrit || $c.dcd}</div>{/if}
 
 {* vim:set et sw=2 sts=2 sws=2: *}
index 25fa2f1..33c33c8 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: minifiche_pvt.tpl,v 1.15 2004-11-13 15:56:37 x2000habouzit Exp $
+        $Id: minifiche_pvt.tpl,v 1.16 2004-11-18 15:17:42 x2000habouzit Exp $
  ***************************************************************************}
 
 
-{if !$inscrit}
+{if !$c.wasinscrit}
   {if !$c.dcd}
   <div class='bits'>
     {if $show_action eq ajouter}
     <a href="{"carnet/notifs.php"|url}?add_nonins={$c.user_id}">{*
-      *}<img src="{"images"|url}/ajouter.gif" alt="Ajouter à la liste de mes surveillances" title="Ajouter à la liste de mes surveillances" />{*
-    *}</a>
+      *}<img src="{"images"|url}/ajouter.gif" alt="Ajouter à la liste de mes surveillances" title="Ajouter à la liste de mes surveillances" /></a>
     {else}
     <a href="{"carnet/notifs.php"|url}?del_nonins={$c.user_id}">{*
-      *}<img src="{"images"|url}/retirer.gif" alt="Retirer de la liste de mes surveillances" title="Retirer de la liste de mes surveillances" />{*
-    *}</a>
+      *}<img src="{"images"|url}/retirer.gif" alt="Retirer de la liste de mes surveillances" title="Retirer de la liste de mes surveillances" /></a>
     {/if}
     {perms level='admin'}
     <a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&amp;anc_id={$c.matricule_ax}">{*
-      *}<img src="{"images/ax.png"|url}" alt='AX' title="fiche AX" />{*
-    *}</a>
+      *}<img src="{"images/ax.png"|url}" alt='AX' title="fiche AX" /></a>
     {/perms}
   </div>
   {/if}
 {else}
   <div class="bits">
     <a href="{"fiche.php"|url}?user={$c.forlife}" class="popup2">{*
-      *}<img src="{"images/loupe.gif"|url}" alt="Afficher la fiche" title="Afficher la fiche" />{*
-    *}</a>
+      *}<img src="{"images/loupe.gif"|url}" alt="Afficher la fiche" title="Afficher la fiche" /></a>
     <a href="vcard.php/{$c.forlife}.vcf?x={$c.forlife}">{*
-      *}<img src="{"images/vcard.png"|url}" alt="Afficher la carte de visite" title="Afficher la carte de visite" />{*
-    *}</a>
+      *}<img src="{"images/vcard.png"|url}" alt="Afficher la carte de visite" title="Afficher la carte de visite" /></a>
     <a href="{"carnet/mescontacts.php"|url}?action={$show_action}&amp;user={$c.forlife}">{*
       *}<img src="{"images"|url}/{$show_action}.gif" alt="{if $show_action eq "ajouter"}Ajouter à mes{else}Retirer de mes{/if} contacts"
-        title="{if $show_action eq "ajouter"}Ajouter à mes{else}Retirer de mes{/if} contacts" />{*
-    *}</a>
-    {if $c.dcd neq 1}
+        title="{if $show_action eq "ajouter"}Ajouter à mes{else}Retirer de mes{/if} contacts" /></a>
     {perms level='admin'}
     <a href="{"admin/utilisateurs.php"|url}?login={$c.forlife}">{*
-      *}<img src="{"images/admin.png"|url}" alt='admin' title="administrer user" />{*
-    *}</a>
+      *}<img src="{"images/admin.png"|url}" alt='admin' title="administrer user" /></a>
     <a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&amp;anc_id={$c.matricule_ax}">{*
-      *}<img src="{"images/ax.png"|url}" alt='AX' title="fiche AX" />{*
-    *}</a>
+      *}<img src="{"images/ax.png"|url}" alt='AX' title="fiche AX" /></a>
     {/perms}
-    {/if}
   </div>
   <div class="long">
     {if $c.web || $c.mobile || $c.pays || $c.ville || $c.region || $c.entreprise || $c.libre}
index 6c072fe..e22358c 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: search.tpl,v 1.29 2004-11-17 15:22:13 x2000habouzit Exp $
+        $Id: search.tpl,v 1.30 2004-11-18 15:17:42 x2000habouzit Exp $
  ***************************************************************************}
 
 {dynamic}
@@ -41,7 +41,7 @@
       {else}
         {assign var="show_action" value="ajouter"}
       {/if}
-      {include file=include/minifiche.tpl c=$resultats[resultat] show_action=$show_action inscrit=$resultats[resultat].inscrit}
+      {include file=include/minifiche.tpl c=$resultats[resultat] show_action=$show_action}
     {/section}
     {/capture}
     {$smarty.capture.list|smarty:nodefaults}