From: Pascal Corpet Date: Tue, 22 Jul 2008 21:12:01 +0000 (+0200) Subject: merge with master X-Git-Tag: xorg/1.0.0~332^2~551 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7f12e3b4113791f3372f11572a205925d7bb6b97;p=platal.git merge with master --- 7f12e3b4113791f3372f11572a205925d7bb6b97 diff --cc htdocs/xorg.php index 396185f,3dc92b2..b5e0726 --- a/htdocs/xorg.php +++ b/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; } diff --cc include/userset.inc.php index ab8cb89,f45cf48..31358d2 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@@ -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'; diff --cc modules/profile.php index c28ef27,63e3370..894578a --- a/modules/profile.php +++ b/modules/profile.php @@@ -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'); @@@ -818,18 -808,8 +832,18 @@@ $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); diff --cc modules/profile/general.inc.php index 8eb098e,8227f36..42dc5cd --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@@ -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()); } } diff --cc modules/profile/jobs.inc.php index 652181d,ad1e921..90f05cf --- a/modules/profile/jobs.inc.php +++ b/modules/profile/jobs.inc.php @@@ -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 diff --cc templates/include/plview.referent.tpl index 481e0f7,76dce26..871afaf --- a/templates/include/plview.referent.tpl +++ b/templates/include/plview.referent.tpl @@@ -21,10 -21,10 +21,10 @@@ {**************************************************************************}
- {iterate from=$set item=p} + {foreach from=$set item=p}
- {$p.nom} {$p.prenom} + {$p.name_display}
X{$p.promo} diff --cc templates/include/plview.trombi.tpl index e97375e,d0db912..b5b301f --- a/templates/include/plview.trombi.tpl +++ b/templates/include/plview.trombi.tpl @@@ -25,34 -25,78 +25,78 @@@ Aucun des camarades concernés n'a de photographie sur sa fiche

{else} - - {iterate from=$set item=p} - {cycle values="1,2,3" assign="loop"} - {if $loop eq "1"} +
+ {section name=trombi loop=$set start=1} + {if $smarty.section.trombi.iteration % 3 == 1} - {/if} - + + - {if $loop eq "3"} + + + + + + + {elseif ($smarty.section.trombi.iteration % 3 == 0) && ($smarty.section.trombi.last)} + + + + + + + {/if} - {/iterate} - {if $loop neq "3"} - {if $lopp eq "1"} - - {/if} - - {/if} + {/section}
- -  [ PHOTO ] + + +  [ PHOTO ] {if $trombi_with_admin && hasPerm('admin')} - {icon name=wrench title="[admin]"} + {icon name=wrench title="[admin]"} {/if} -
- - {$p.name_display}{if $trombi_with_promo} ({$p.promo}){/if} +
+ +  [ PHOTO ] + {if $trombi_with_admin && hasPerm('admin')} + {icon name=wrench title="[admin]"} + {/if} + + {if $set[trombi.index_next]} + +  [ PHOTO ] + + {if $trombi_with_admin && hasPerm('admin')} + {icon name=wrench title="[admin]"} + {/if} + {/if}
+ - {$set[trombi.index_prev].prenom} {$set[trombi.index_prev].nom}{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if} ++ {$set[trombi.index_prev].name_display}{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if} + + + - {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if} ++ {$set[trombi].name_display}{if $trombi_with_promo} ({$set[trombi].promo}){/if} + + + {if $set[trombi.index_next]} + - {$set[trombi.index_next].prenom} {$set[trombi.index_next].nom}{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if} ++ {$set[trombi.index_next].name_display}{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if} + + {/if} +
+ +  [ PHOTO ] + + {if $trombi_with_admin && hasPerm('admin')} + {icon name=wrench title="[admin]"} + {/if} +
+ - {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if} ++ {$set[trombi].name_display}{if $trombi_with_promo} ({$set[trombi].promo}){/if} + +
{/if}