- Fix GoogleMaps links -FRU
- #663: Link to Xnet's map from the "My groups" page -FRU
- #689: Edit my profile from Xnet -FRU
+ - #692: Layout of the profile -FRU
* Xnet:
- #694: Color of 'Promotion' groups -ALK
protected function encodeArgs(array $args, $encode = false)
{
$qs = '?';
- $sep = $encode ? '&' : '&';
+ $sep = '&';
foreach ($args as $k=>$v) {
if (!$encode) {
$k = urlencode($k);
return false;
}
$args = $view->args();
+ if (!isset($args['rechercher'])) {
+ $args['rechercher'] = 'Chercher';
+ }
$page->changeTpl('core/plset.tpl');
$page->assign('plset_base', $baseurl);
$page->assign('plset_mods', $this->mods);
private $order = null;
private $quick = false;
- public function __construct($quick = false, $no_search = false)
+ public function __construct($quick = false, $no_search = false, $join = '', $where = '')
{
require_once dirname(__FILE__).'/../modules/search/search.inc.php';
$this->quick = $quick;
if ($quick) {
- $this->getQuick();
+ $this->getQuick($join, $where);
} else {
- $this->getAdvanced();
+ $this->getAdvanced($join, $where);
}
}
- private function getQuick()
+ private function getQuick($join, $where)
{
require_once dirname(__FILE__).'/../modules/search/search.inc.php';
global $globals;
new ThrowError('Recherche trop générale.');
}
$this->score = $qSearch->get_score_statement();
- parent::__construct("{$fields->get_select_statement()}",
- $fields->get_where_statement() .
+ parent::__construct($join . ' ' . $fields->get_select_statement(),
+ $where . ' ' . $fields->get_where_statement() .
(S::logged() && Env::has('nonins') ? ' AND u.perms="pending" AND u.deces=0' : ''));
$this->order = implode(',',array_filter(array($fields->get_order_statement(),
if ($fields->too_large()) {
new ThrowError('Recherche trop générale.');
}
- parent::__construct($fields->get_select_statement(),
- $fields->get_where_statement());
+ parent::__construct($join . ' ' . $fields->get_select_statement(),
+ $where . ' ' . $fields->get_where_statement());
$this->order = implode(',',array_filter(array($fields->get_order_statement(),
'promo DESC, NomSortKey, prenom')));
}
$page->changeTpl('geoloc/city.tpl', NO_SKIN);
header('Content-Type: text/xml');
header('Pragma:');
+ $only_current = Env::v('only_current', false)? ' AND FIND_IN_SET(\'active\', adrf.statut)' : '';
$it =& $this->set->get('u.user_id AS id, u.prenom, u.nom, u.promo, al.alias',
- "INNER JOIN adresses AS adrf ON (adrf.uid = u.user_id)
+ "INNER JOIN adresses AS adrf ON (adrf.uid = u.user_id $only_current)
LEFT JOIN aliases AS al ON (u.user_id = al.id
AND FIND_IN_SET('bestalias', al.flags))
INNER JOIN adresses AS avg ON (" . getadr_join('avg') . ")",
if (!$this->use_map()) {
$page->assign('request_geodesix', true);
}
- if (!empty($GLOBALS['IS_XNET_SITE'])) {
- $page->assign('no_annu', true);
- }
+ $page->assign('annu', @$this->params['with_annu']);
$page->assign('protocole', @$_SERVER['HTTPS'] ? 'https' : 'http');
$this->set->get('u.user_id', null, "u.perms != 'pending' AND u.deces = 0", "u.user_id", null);
return 'include/plview.geoloc.tpl';
return Array($total, $list);
}
- function handler_contacts(&$page, $action = null, $subaction = null)
+ function handler_contacts(&$page, $action = null, $subaction = null, $ssaction = null)
{
$page->assign('xorg_title','Polytechnique.org - Mes contacts');
$this->_add_rss_link($page);
}
}
- $view = new UserSet("INNER JOIN contacts AS c2 ON (u.user_id = c2.contact)", " c2.uid = $uid ");
+ $search = false;
+ if ($action == 'search') {
+ $action = $subaction;
+ $subaction = $ssaction;
+ $search = true;
+ }
+ if ($search && trim(Env::v('quick'))) {
+ require_once 'userset.inc.php';
+ $base = 'carnet/contacts/search';
+ $view = new SearchSet(true, false, "INNER JOIN contacts AS c2 ON (u.user_id = c2.contact)", " c2.uid = $uid AND ");
+ } else {
+ $base = 'carnet/contacts';
+ $view = new UserSet("INNER JOIN contacts AS c2 ON (u.user_id = c2.contact)", " c2.uid = $uid ");
+ }
$view->addMod('minifiche', 'Mini-Fiches', true);
$view->addMod('trombi', 'Trombinoscope', false, array('with_admin' => false, 'with_promo' => true));
- $view->addMod('geoloc', 'Planisphère');
- $view->apply('carnet/contacts', $page, $action, $subaction);
- if ($action != 'geoloc' || !$subaction) {
+ $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'carnet/contacts/search'));
+ $view->apply($base, $page, $action, $subaction);
+ if ($action != 'geoloc' || ($search && !$ssaction) || (!$search && !$subaction)) {
$page->changeTpl('carnet/mescontacts.tpl');
}
}
$view->addMod('minifiche', 'Minifiches', true, array('with_score' => true));
if (S::logged() && !Env::i('nonins')) {
$view->addMod('trombi', 'Trombinoscope', false, array('with_promo' => true, 'with_score' => true));
- $view->addMod('geoloc', 'Planisphère');
+ $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'search/adv'));
}
$view->apply('search', $page, $action, $subaction);
$view = new SearchSet(false, $action == 'geoloc' && substr($subaction, -3) == 'swf');
$view->addMod('minifiche', 'Minifiches', true);
$view->addMod('trombi', 'Trombinoscope', false, array('with_promo' => true));
- $view->addMod('geoloc', 'Planisphère');
+ $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'search/adv'));
$view->apply('search/adv', $page, $action, $subaction);
if ($subaction) {
*/
class ThrowError
{
+ public static $throwHook = array('ThrowError', 'defaultHandler');
+
/** constuctor
* @param $explain string the error (in natural language)
*/
public function __construct($explain)
{
+ call_user_func(ThrowError::$throwHook, $explain);
+ }
+
+ /** defaut error handler
+ */
+ private static function defaultHandler($explain)
+ {
global $page, $globals;
$page->changeTpl('search/index.tpl');
$page->assign('xorg_title','Polytechnique.org - Annuaire');
$this->mapId = Env::v($_fieldFormName, '');
else
$this->mapId = $_mapId;
+ $this->value = $this->mapId;
$this->RefSField($_fieldFormName, $_fieldDbName, $_refTable, $_refAlias, $_refCondition, true, false);
}
+
function get_select_statement()
{
if ($this->mapId === '') return false;
function too_large()
{
$b = true;
- for ($i=0; $b && $i<count($this->fields); $i++) {
- $b &= $this->fields[$i]->too_large();
+ for ($i=0 ; $b && $i<count($this->fields) ; $i++) {
+ $b = $b && $this->fields[$i]->too_large();
}
return $b;
}
$cityIdField = new RefSField('cityid',array('av.cityid'),'adresses','av',getadr_join('av'));
$countryField = new RefSField('country',array('ap.country'),'adresses','ap',getadr_join('ap'));
$regionField = new RefSField('region',array('ar.region'),'adresses','ar',getadr_join('ar'));
-
+ $mapField = new MapSField('mapid', array('sgcim.map_id'), array('adresses','geoloc_city_in_maps'), array('amp','sgcim'), array(getadr_join('amp'), 'amp.cityid = sgcim.city_id'));
+
$entrepriseField = new RefSField('entreprise',array('ee.entreprise'),'entreprises','ee','u.user_id=ee.uid',false);
$posteField = new RefSField('poste',array('ep.poste'),'entreprises','ep','u.user_id=ep.uid', false);
$fonctionField = new RefSField('fonction',array('en.fonction'),'entreprises','en','u.user_id=en.uid');
return array(
$nameField, $firstnameField, $nicknameField, $promo1Field,
$promo2Field, $womanField, $subscriberField, $aliveField,
- $townField, $countryField, $regionField, $entrepriseField,
+ $townField, $countryField, $regionField, $mapField, $entrepriseField,
$posteField, $secteurField, $cvField, $natField, $binetField,
$groupexField, $sectionField, $schoolField, $diplomaField,
$freeField, $fonctionField, $cityIdField);
{* *}
{**************************************************************************}
-<script type="text/javascript">
+<script type="text/javascript">//<![CDATA[
{literal}
function ficheXorg(id)
{
- window.open('{/literal}{if $no_annu}https://{#globals.core.secure_domain#}/{/if}{literal}profile/'+id,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=840,height=600');
+ window.open('{/literal}{if !$annu}https://{#globals.core.secure_domain#}/{/if}{literal}profile/'+id,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=840,height=600');
}
{/literal}
-{if !$no_annu}
+{if $annu}
+var search_url = platal_baseurl + "{$platal->ns}{$annu}{$plset_search|smarty:nodefaults}";
{literal}
function clickOnCity(id)
{
- var f = document.getElementById('search_form');
- var url = f.action;
- f.action += unescape('%26')+'cityid=' + id;
- f.submit();
- f.action = url;
- document.getElementById('search_results').style.height = '250px';
+ window.open(search_url + unescape('%26')+'cityid=' + id, '_blank', '');
}
var mapid = 0;
function goToCountry(id)
{
- mapid = id;
+ mapid = id;
}
-function searchMapId(f)
+function searchMapId()
{
- var url = f.action;
- f.action += unescape('%26')+'mapid=' + mapid;
- f.submit();
- f.action = url;
- document.getElementById('search_results').style.height = '250px';
+ window.open(search_url + unescape('%26')+'mapid=' + mapid, '_blank', '');
}
{/literal}
{/if}
-</script>
+//]]></script>
{if !$request_geodesix}
pluginspage="{$protocole}://www.macromedia.com/go/getflashplayer"/>
</object>
</p>
+ {if $annu}
+ <p class="center">
+ <a href="javascript:searchMapId()">Lister les X présents sur cette carte</a>
+ </p>
+ {/if}
<p class="smaller">Carte fournie gracieusement par <a href="http://www.geodesix.com/">Geodesix</a>.</p>
{else}
<p>Le moteur de carte n'a pas été installé sur cette version de plat/al. Veuillez contacter <a href="http://www.geodesix.com/">Geodesix</a>.</p>