projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Table editor fills the new entry form with the default values of the fields
[platal.git]
/
modules
/
geoloc.php
diff --git
a/modules/geoloc.php
b/modules/geoloc.php
index
8228bd9
..
f54f57e
100644
(file)
--- a/
modules/geoloc.php
+++ b/
modules/geoloc.php
@@
-46,7
+46,7
@@
class GeolocModule extends PLModule
$querystring = "";
foreach ($_GET as $v => $a) {
$querystring = "";
foreach ($_GET as $v => $a) {
- if ($v != 'initfile' && $v != '
p
' && $v != 'mapid') {
+ if ($v != 'initfile' && $v != '
n
' && $v != 'mapid') {
$querystring .= urlencode($v).'='.urlencode($a).'&';
}
}
$querystring .= urlencode($v).'='.urlencode($a).'&';
}
}
@@
-54,25
+54,31
@@
class GeolocModule extends PLModule
return $querystring;
}
return $querystring;
}
+ function use_map()
+ {
+ return is_file(dirname(__FILE__).'/geoloc/dynamap.swf') &&
+ is_file(dirname(__FILE__).'/geoloc/icon.swf');
+ }
+
function handler_default(&$page)
{
global $globals;
function handler_default(&$page)
{
global $globals;
- if (!is_file(dirname(__FILE__).'/geoloc/dynamap.swf') ||
- !is_file(dirname(__FILE__).'/geoloc/icon.swf'))
+ if (!$this->use_map())
$page->assign('request_geodesix', 1);
if (!empty($GLOBALS['IS_XNET_SITE'])) {
$page->assign('request_geodesix', 1);
if (!empty($GLOBALS['IS_XNET_SITE'])) {
- $page->useMenu();
- $page->setType($globals->asso('cat'));
$page->assign('no_annu', 1);
$page->assign('no_annu', 1);
+ new_annu_page('geoloc/index.tpl');
+ } else {
+ $page->changeTpl('geoloc/index.tpl');
}
}
- require_once
'
search.inc.php';
- $page->changeTpl('geoloc/index.tpl');
+ require_once
dirname(__FILE__).'/search/
search.inc.php';
+
$fields = new SFieldGroup(true, advancedSearchFromInput());
$search = str_replace('&','&',$fields->get_url());
$fields = new SFieldGroup(true, advancedSearchFromInput());
$search = str_replace('&','&',$fields->get_url());
- if (
!Env::has('only_current')
)
+ if (
(!Env::has('only_current') && !Env::has('rechercher')) || Env::v('only_current') == 'on'
)
$search .= '&only_current=on';
elseif (Env::i('only_current') != 'on')
$search .= '&only_current=';
$search .= '&only_current=on';
elseif (Env::i('only_current') != 'on')
$search .= '&only_current=';
@@
-121,7
+127,7
@@
class GeolocModule extends PLModule
{
global $globals;
{
global $globals;
- $page->changeTpl('geoloc/
geolocI
nit.tpl', NO_SKIN);
+ $page->changeTpl('geoloc/
i
nit.tpl', NO_SKIN);
header('Content-type: text/xml');
header('Pragma:');
header('Content-type: text/xml');
header('Pragma:');
@@
-137,10
+143,10
@@
class GeolocModule extends PLModule
header("Content-type: text/xml");
header("Pragma:");
header("Content-type: text/xml");
header("Pragma:");
- $page->changeTpl('geoloc/
getCityInfos
.tpl', NO_SKIN);
+ $page->changeTpl('geoloc/
city
.tpl', NO_SKIN);
+ require_once dirname(__FILE__).'/search/search.inc.php';
require_once('geoloc.inc.php');
require_once('geoloc.inc.php');
- require_once('search.inc.php');
if (empty($GLOBALS['IS_XNET_SITE'])) {
$usual_fields = advancedSearchFromInput();
if (empty($GLOBALS['IS_XNET_SITE'])) {
$usual_fields = advancedSearchFromInput();
@@
-156,10
+162,11
@@
class GeolocModule extends PLModule
if ($where) $where = "WHERE ".$where;
$users = XDB::iterator("
if ($where) $where = "WHERE ".$where;
$users = XDB::iterator("
- SELECT u.user_id AS id, u.prenom, u.nom, u.promo
+ SELECT u.user_id AS id, u.prenom, u.nom, u.promo
, alias
FROM adresses AS a
INNER JOIN auth_user_md5 AS u ON(u.user_id = a.uid)
INNER JOIN auth_user_quick AS q ON(q.user_id = a.uid)
FROM adresses AS a
INNER JOIN auth_user_md5 AS u ON(u.user_id = a.uid)
INNER JOIN auth_user_quick AS q ON(q.user_id = a.uid)
+ LEFT JOIN aliases ON(u.user_id = aliases.id AND FIND_IN_SET(aliases.flags,'bestalias'))
".$fields->get_select_statement()."
".$where."
GROUP BY u.user_id LIMIT 11", $id);
".$fields->get_select_statement()."
".$where."
GROUP BY u.user_id LIMIT 11", $id);
@@
-173,15
+180,15
@@
class GeolocModule extends PLModule
// to debug sql use the next line
if (Env::has('debug')) {
// to debug sql use the next line
if (Env::has('debug')) {
- $page->changeTpl('geoloc/
getData
.tpl', SIMPLE);
+ $page->changeTpl('geoloc/
country
.tpl', SIMPLE);
} else {
header("Content-type: text/xml");
header("Pragma:");
} else {
header("Content-type: text/xml");
header("Pragma:");
- $page->changeTpl('geoloc/
getData
.tpl', NO_SKIN);
+ $page->changeTpl('geoloc/
country
.tpl', NO_SKIN);
}
}
+ require_once dirname(__FILE__).'/search/search.inc.php';
require_once 'geoloc.inc.php';
require_once 'geoloc.inc.php';
- require_once 'search.inc.php';
$querystring = $this->_make_qs();
$page->assign('searchvars', $querystring);
$querystring = $this->_make_qs();
$page->assign('searchvars', $querystring);