merge with master
authorPascal Corpet <pascal.corpet@m4x.org>
Tue, 22 Jul 2008 21:12:01 +0000 (23:12 +0200)
committerPascal Corpet <pascal.corpet@m4x.org>
Tue, 22 Jul 2008 21:12:01 +0000 (23:12 +0200)
24 files changed:
1  2 
htdocs/css/default.css
htdocs/xorg.php
include/notifs.inc.php
include/user.func.inc.php
include/userset.inc.php
modules/email.php
modules/geoloc.php
modules/marketing.php
modules/payment/money/paypal.inc.php
modules/profile.php
modules/profile/addresses.inc.php
modules/profile/general.inc.php
modules/profile/jobs.inc.php
modules/profile/page.inc.php
modules/search.php
modules/search/classes.inc.php
templates/core/vcard.tpl
templates/emails/redirect.tpl
templates/include/minifiche.tpl
templates/include/plview.referent.tpl
templates/include/plview.trombi.tpl
templates/marketing/private.tpl
templates/profile/profile.tpl
templates/search/adv.form.tpl

Simple merge
diff --cc htdocs/xorg.php
@@@ -28,10 -26,8 +26,9 @@@ if (!($path = Env::v('n')) || ($path{0
                           'geoloc', 'lists', 'marketing', 'payment', 'platal',
                           'profile', 'register', 'search', 'stats', 'admin',
                           'newsletter', 'axletter', 'bandeau', 'survey',
 +                         'fusionax',
                           'gadgets', 'googleapps');
      $platal->run();
      exit;
  }
  
Simple merge
Simple merge
@@@ -231,17 -246,28 +247,34 @@@ class MentorView extends MultipageVie
  
      public function fields()
      {
 -        return "m.uid, u.prenom, u.nom, u.promo,
 -                a.alias AS forlife, m.expertise, mp.pid,
 -                ms.secteur, ms.ss_secteur";
 +        return "m.uid, u.promo,
 +                a.alias AS bestalias, m.expertise, mp.pid,
 +                ms.secteur, ms.ss_secteur,
 +                nd.display AS name_display, nd.tooltip AS name_tooltip, nd.sort AS name_sort";
 +    }
 +
 +    public function joins()
 +    {
 +        return "INNER JOIN  profile_names_display AS nd ON (nd.user_id = u.user_id)";
      }
  
+     public function bounds()
+     {
+         $order = Env::v('order', $this->defaultkey);
+         $show_bounds = 0;
+         if (($order == "name") || ($order == "-name")) {
+             $this->bound_field = "nom";
+             $show_bounds = 1;
+         } elseif (($order == "promo") || ($order == "-promo")) {
+             $this->bound_field = "promo";
+             $show_bounds = -1;
+         }
+         if ($order{0} == '-') {
+             $show_bounds = -$show_bounds;
+         }
+         return $show_bounds;
+     }
      public function templateName()
      {
          return 'include/plview.referent.tpl';
@@@ -269,10 -295,26 +302,27 @@@ class TrombiView extends MultipageVie
  
      public function joins()
      {
 -        return "INNER JOIN  photo AS p ON (p.uid = u.user_id) ";
 +        return "INNER JOIN  photo AS p ON (p.uid = u.user_id)
 +                INNER JOIN  profile_names_display AS nd ON (nd.user_id = u.user_id)";
      }
  
+     public function bounds()
+     {
+         $order = Env::v('order', $this->defaultkey);
+         $show_bounds = 0;
+         if (($order == "name") || ($order == "-name")) {
+             $this->bound_field = "nom";
+             $show_bounds = 1;
+         } elseif (($order == "promo") || ($order == "-promo")) {
+             $this->bound_field = "promo";
+             $show_bounds = -1;
+         }
+         if ($order{0} == '-') {
+             $show_bounds = -$show_bounds;
+         }
+         return $show_bounds;
+     }
      public function templateName()
      {
          return 'include/plview.trombi.tpl';
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -126,21 -123,9 +126,22 @@@ class ProfileModule extends PLModul
          exit;
      }
  
 +    function handler_networking(&$page, $mid)
 +    {
 +        $res = XDB::query("SELECT  icon
 +                             FROM  profile_networking_enum
 +                            WHERE  network_type = {?}",
 +                          $mid);
 +        $img  = dirname(__FILE__) . '/../htdocs/images/networking/' . $res->fetchOneCell();
 +        $type = mime_content_type($img);
 +        header("Content-Type: $type");
 +        echo file_get_contents($img);
 +        exit;
 +    }
 +
      function handler_photo_change(&$page)
      {
+         global $globals;
          $page->changeTpl('profile/trombino.tpl');
  
          require_once('validations.inc.php');
          $table_editor->describe('label', 'intitulé', true);
          $table_editor->apply($page, $action, $id);
      }
 +    function handler_admin_networking(&$page, $action = 'list', $id = null) {
 +        $page->assign('xorg_title', 'Polytechnique.org - Administration - Networking');
 +        $page->assign('title', 'Gestion des types de networking');
 +        $table_editor = new PLTableEditor('admin/networking', 'profile_networking_enum', 'network_type');
 +        $table_editor->describe('name', 'intitulé', true);
 +        $table_editor->describe('icon', 'nom de l\'icône', false);
 +        $table_editor->describe('filter', 'filtre', true);
 +        $table_editor->describe('link', 'lien web', true);
 +        $table_editor->apply($page, $action, $id);
 +    }
      function handler_admin_medals(&$page, $action = 'list', $id = null) {
-         $page->assign('xorg_title','Polytechnique.org - Administration - Distinctions');
+         $page->setTitle('Polytechnique.org - Administration - Distinctions');
          $page->assign('title', 'Gestion des Distinctions');
          $table_editor = new PLTableEditor('admin/medals','profile_medals','id');
          $table_editor->describe('text', 'intitulé',  true);
Simple merge
@@@ -357,33 -194,11 +356,33 @@@ class ProfileGeneral extends ProfilePag
                             WHERE  uid = {?}",
                           $this->values['photo_pub'], S::v('uid'));
          }
 +        if ($this->changed['yourself'] || $this->changed['sort_name'] ||
 +            $this-> changed['display_name'] || $this->changed['tooltip_name']) {
 +          XDB::execute("UPDATE  profile_names_display AS n
 +                           SET  n.yourself = {?},
 +                                n.sort = {?}, ". // SET
 +                               "n.display = {?}, ". // SET
 +                               "n.tooltip = {?} ". // SET
 +                        "WHERE  n.user_id = {?}",
 +                       $this->values['yourself'],
 +                       $this->values['sort_name'],
 +                       $this->values['display_name'],
 +                       $this->values['tooltip_name'],
 +                        S::v('uid'));
 +        }
      }
  
-     public function _prepare(PlatalPage &$page, $id)
+     public function _prepare(PlPage &$page, $id)
      {
          require_once "applis.func.inc.php";
 +
 +        require_once "emails.combobox.inc.php";
 +        fill_email_combobox($page);
 +
 +        $res = XDB::iterator("SELECT  nw.network_type AS type, nw.name
 +                                FROM  profile_networking_enum AS nw
 +                            ORDER BY  name");
 +        $page->assign('network_list', $res->fetchAllAssoc());
      }
  }
  
@@@ -253,11 -202,8 +253,11 @@@ class ProfileJobs extends ProfilePag
          }
      }
  
-     public function _prepare(PlatalPage &$page, $id)
+     public function _prepare(PlPage &$page, $id)
      {
 +        require_once "emails.combobox.inc.php";
 +        fill_email_combobox($page);
 +
          $page->assign('secteurs', XDB::iterator("SELECT  id, label
                                                     FROM  emploi_secteur"));
          $page->assign('fonctions', XDB::iterator("SELECT  id, fonction_fr, FIND_IN_SET('titre', flags) AS title
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  {**************************************************************************}
  
  <div class="contact-list" style="clear: both">
- {iterate from=$set item=p} 
+ {foreach from=$set item=p} 
    <div class="contact"> 
      <div class="nom"> 
 -      {$p.nom} {$p.prenom} 
 +      <span {if $p.name_tooltip}class="hinted" title="{$p.name_tooltip}"{/if}>{$p.name_display}</span>
      </div> 
      <div class="appli"> 
        X{$p.promo} 
    Aucun des camarades concernés n'a de photographie sur sa fiche
  </p>
  {else}
- <table cellpadding="8" cellspacing="2" style="width: 100%">
-   {iterate from=$set item=p}
-   {cycle values="1,2,3" assign="loop"}
-   {if $loop eq "1"}
+ <table cellpadding="0" cellspacing="2" style="width: 100%">
+   {section name=trombi loop=$set start=1}
+   {if $smarty.section.trombi.iteration % 3 == 1}
    <tr>
-   {/if}
-     <td class="center">
-       <a href="{$mainsiteurl}profile/{$p.forlife}" class="popup2">
-         <img src="photo/{$p.forlife}" width="110" alt=" [ PHOTO ] " />
+     <td class="center" style="vertical-align: middle">
+       <a href="{$mainsiteurl}profile/{$set[trombi.index_prev].forlife}" class="popup2">
+         <img src="photo/{$set[trombi.index_prev].forlife}" width="110" alt=" [ PHOTO ] " />
        </a>
        {if $trombi_with_admin && hasPerm('admin')}
-       <a href="{$mainsiteurl}admin/trombino/{$p.user_id}">{icon name=wrench title="[admin]"}</a>
+       <a href="{$mainsiteurl}admin/trombino/{$set[trombi.index_prev].user_id}">{icon name=wrench title="[admin]"}</a>
        {/if}
-       <br />
-       <a href="{$mainsiteurl}profile/{$p.forlife}" class="popup2">
-         <span {if $p.name_tooltip}class="hinted" title="{$p.name_tooltip}"{/if}>{$p.name_display}</span>{if $trombi_with_promo} ({$p.promo}){/if}
+     </td>
+     <td class="center" style="vertical-align: middle">
+       <a href="{$mainsiteurl}profile/{$set[trombi].forlife}" class="popup2">
+         <img src="photo/{$set[trombi].forlife}" width="110" alt=" [ PHOTO ] " />
        </a>
+       {if $trombi_with_admin && hasPerm('admin')}
+       <a href="{$mainsiteurl}admin/trombino/{$set[trombi].user_id}">{icon name=wrench title="[admin]"}</a>
+       {/if}
+     </td>
+     <td class="center" style="vertical-align: middle">
+     {if $set[trombi.index_next]}
+       <a href="{$mainsiteurl}profile/{$set[trombi.index_next].forlife}" class="popup2">
+         <img src="photo/{$set[trombi.index_next].forlife}" width="110" alt=" [ PHOTO ] " />
+       </a>
+       {if $trombi_with_admin && hasPerm('admin')}
+       <a href="{$mainsiteurl}admin/trombino/{$set[trombi.index_next].user_id}">{icon name=wrench title="[admin]"}</a>
+       {/if}
+     {/if}
      </td>
-   {if $loop eq "3"}
+   </tr>
+   <tr>
+     <td class="center" style="vertical-align: bottom; padding-bottom: 15px">
+       <a href="{$mainsiteurl}profile/{$set[trombi.index_prev].forlife}" class="popup2">
 -        {$set[trombi.index_prev].prenom} {$set[trombi.index_prev].nom}{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if}
++        <span {if $set[trombi.index_prev].name_tooltip}class="hinted" title="{$set[trombi.index_prev].name_tooltip}"{/if}>{$set[trombi.index_prev].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if}
+       </a>
+     </td>
+     <td class="center" style="vertical-align: bottom; padding-bottom: 15px">
+       <a href="{$mainsiteurl}profile/{$set[trombi].forlife}" class="popup2">
 -        {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if}
++        <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo}){/if}
+       </a>
+     </td>
+     <td class="center" style="vertical-align: bottom; padding-bottom: 15px">
+     {if $set[trombi.index_next]}
+       <a href="{$mainsiteurl}profile/{$set[trombi.index_next].forlife}" class="popup2">
 -        {$set[trombi.index_next].prenom} {$set[trombi.index_next].nom}{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if}
++        <span {if $set[trombi.index_next].name_tooltip}class="hinted" title="{$set[trombi.index_next].name_tooltip}"{/if}>{$set[trombi.index_next].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if}
+       </a>
+     {/if}
+     </td>
+   </tr>
+   {elseif ($smarty.section.trombi.iteration % 3 == 0) && ($smarty.section.trombi.last)}
+   <tr>
+     <td class="center" style="vertical-align: middle; padding-bottom: 15px">
+       <a href="{$mainsiteurl}profile/{$set[trombi].forlife}" class="popup2">
+         <img src="photo/{$set[trombi].forlife}" width="110" alt=" [ PHOTO ] " />
+       </a>
+       {if $trombi_with_admin && hasPerm('admin')}
+       <a href="{$mainsiteurl}admin/trombino/{$set[trombi].user_id}">{icon name=wrench title="[admin]"}</a>
+       {/if}
+     </td>
+     <td></td><td></td>
+   </tr>
+   <tr style="margin-top: 0; padding-top: 0">
+     <td class="center" style="vertical-align: bottom">
+       <a href="{$mainsiteurl}profile/{$set[trombi].forlife}" class="popup2">
 -        {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if}
++        <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo}){/if}
+       </a>
+     </td>
+     <td></td><td></td>
    </tr>
    {/if}
-   {/iterate}
-   {if $loop neq "3"}
-   {if $lopp eq "1"}
-   <td></td>
-   {/if}
-   <td></td></tr>
-   {/if}
+   {/section}
  </table>
  {/if}
  
Simple merge
Simple merge
Simple merge