Skip to content

Commit

Permalink
Merge pull request #67 from neo-garaix/update-adresseListener
Browse files Browse the repository at this point in the history
Update compatibility for 3.8
  • Loading branch information
neo-garaix authored Oct 8, 2024
2 parents 7a442eb + 08c7bf1 commit 1518089
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 28 deletions.
38 changes: 18 additions & 20 deletions adresse/classes/adresse.listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,35 @@ public function ongetMapAdditions($event)
$user_login = $juser->login;
}

$adresseConfig = array();

$adresseConfig['user'] = $user_login;

$player = $utils->getLayer($lizmap_project, 'v_point_adresse');
$vlayer = $utils->getLayer($lizmap_project, 'voie');

$adresseConfig['point_adresse'] = array();
$adresseConfig['point_adresse']['id'] = $player->getId();
$adresseConfig['point_adresse']['name'] = $player->getName();

$adresseConfig['voie'] = array();
$adresseConfig['voie']['id'] = $vlayer->getId();
$adresseConfig['voie']['name'] = $vlayer->getName();

$adresseConfig['urls'] = array();
$adresseConfig['urls']['select'] = jUrl::get('adresse~service:select');
$adresseConfig['urls']['update'] = jUrl::get('adresse~service:update');
$jsvars = array(
'adresseConfig' => array(
'user' => $user_login,
'point_adresse' => array(
'id' => $player->getId(),
'name' => $player->getName()
),
'voie' => array(
'id' => $vlayer->getId(),
'name' => $vlayer->getName()
),
'urls' => array(
'select' => jUrl::get('adresse~service:select'),
'update' => jUrl::get('adresse~service:update')
)
)
);

$js = array();
$css = array();
$js[] = jUrl::get('jelix~www:getfile', array('targetmodule' => 'adresse', 'file' => 'adresse.js'));

$jscode = array(
'var adresseConfig = ' . json_encode($adresseConfig),
);

$event->add(
array(
'js' => $js,
'jscode' => $jscode,
'jsvars' => $jsvars,
'css' => $css,
)
);
Expand Down
4 changes: 2 additions & 2 deletions adresse/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<label lang="en_US">adresse</label>
<description lang="en_US" />
<license URL="">Mozilla Public Licence (MPL)</license>
<copyright>2020-2023 3liz</copyright>
<copyright>2020-2024 3liz</copyright>
<creator name="your name" email="[email protected]" />
<!--<contributor name="hisname" email="[email protected]" since="" role=""/>-->
<homepageURL>http://3liz.com</homepageURL>
</info>
<dependencies>
<module name="lizmap" minversion="3.7.0" maxversion="3.7.*"/>
<module name="lizmap" minversion="3.8.0" maxversion="3.8.*"/>
</dependencies>
<autoload>
<class name="adresseSearch" file="lib/adresseSearch.php"/>
Expand Down
10 changes: 5 additions & 5 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ LIZMAP_DIR=$(shell pwd)/lizmap
LIZMAP_USER_ID:=$(shell id -u)
LIZMAP_USER_GID:=$(shell id -g)

LIZMAP_VERSION_TAG:=3.5
QGIS_VERSION_TAG:=3.22
LIZMAP_VERSION_TAG:=3.8
QGIS_VERSION_TAG:=3.34
POSTGIS_VERSION_TAG:=13-3

QGIS_MAP_WORKERS:=1
Expand Down Expand Up @@ -58,13 +58,13 @@ env: dirs
EOF

run: stop env install-plugins
docker-compose up -d
docker compose up -d

stop:
docker-compose down || true
docker compose down || true

clean: stop
docker-compose down -v
docker compose down -v
rm -rf $(LIZMAP_DIR)/www/*
rm -rf $(LIZMAP_DIR)/var/*

Expand Down
1 change: 0 additions & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
pgsql:
image: 3liz/postgis:${POSTGIS_VERSION_TAG}
Expand Down

0 comments on commit 1518089

Please sign in to comment.