Skip to content

Commit

Permalink
Merge branch 'master' into v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gerald2545 authored Feb 12, 2019
2 parents cddeaae + 3013ccc commit 9ca677e
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 32 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Application web permettant aux cyclistes de signaler les problèmes sur les amé
VelObs est en production à
* Toulouse pour 2 pieds 2 roues sur : http://velobs.2p2r.org/
* Montpellier pour VéloCité : http://www.velocite-montpellier.fr/velobs/
* Pays d’Aix : http://adava.fr/velobs/ (avril 2018), application android (avril 2018)
* Les Ardennes : https://velobs08.ouvaton.org/ (mai 2018), application android (mai 2018)
* Lyon : en cours de test (https://lavilleavelo.org/velobs/)

# Quelques commentaires sur l'application :
* VelObs est une application web nécessitant un serveur web avec php et MySQL/MariaDB comme base de données (versions minimum à venir)
Expand Down
2 changes: 1 addition & 1 deletion lib/js/admin/mapadmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ function getCheckChild(tab) {
var currentTreeNodesChecked = treePanel.getChecked('id').join();
if (previousTreeNodesChecked!=currentTreeNodesChecked && treeLoaderFinished == 1){
previousTreeNodesChecked = treePanel.getChecked('id').join();
getMarker(tabcheckchild,comboPrioritePOIMapItemMenu.getValue());
getMarker();
}
console.debug("getCheckChild fin");
}
Expand Down
1 change: 1 addition & 0 deletions lib/js/admin/poi1.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ function endDrag(feat) {
var arrayItemsCenterPanel = [POIListingEditorGrid,PrioriteListingEditorGrid,StatusListingEditorGrid,BasketListingEditorGrid];
var arrayItemsMenuTopAdminMap = ['Filtres : ',dateFieldModifiedSince,CancelDateFilterItem,'&', StatusPOIFieldMapItemMenu,CancelStatusFilterItem,'&',comboPrioritePOIMapItemMenu,CancelPrioriteFilterItem,'&',checkboxDisplayObservationsWithCommentToModerate,'&',numberFieldNbSupport,CancelVoteFilterItem];
var arrayItemsMenuBottomAdminMap = [searchObservationField,'->', comboALL];

var arrayItemsPhotoManagement = [hiddenIdPOI,
{
html: "<center><img id='photo' height='350' src='resources/images/logo_blank.png'/></center><br/>"
Expand Down
2 changes: 2 additions & 0 deletions lib/js/admin/poi2.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,10 @@ function saveThePOI(oGrid_event) {


var arrayItemsCenterPanel = [POIListingEditorGrid];

var arrayItemsMenuTopAdminMap = ['Filtres : ',dateFieldModifiedSince,CancelDateFilterItem,'&',StatusPOIFieldMapItemMenu,CancelStatusFilterItem,'&',comboPrioritePOIMapItemMenu,CancelPrioriteFilterItem,'&',checkboxDisplayObservationsToBeAnalyzedByComCom,'&',numberFieldNbSupport,CancelVoteFilterItem];
var arrayItemsMenuBottomAdminMap = [searchObservationField, '->', comboALL];

var arrayItemsPhotoManagement = [hiddenIdPOI,
{
html: "<center><img id='photo' height='350' src='resources/images/logo_blank.png'/></center><br/>"
Expand Down
2 changes: 2 additions & 0 deletions lib/js/admin/poi3.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,10 @@ function saveThePOI(oGrid_event) {
}

var arrayItemsCenterPanel = [POIListingEditorGrid];

var arrayItemsMenuTopAdminMap = ['Filtres : ',dateFieldModifiedSince,CancelDateFilterItem,'&',StatusPOIFieldMapItemMenu,CancelStatusFilterItem,'&',comboPrioritePOIMapItemMenu,CancelPrioriteFilterItem,'&',checkboxDisplayObservationsToBeAnalyzedByPole,'&',numberFieldNbSupport,CancelVoteFilterItem]
var arrayItemsMenuBottomAdminMap = [searchObservationField, '->',comboALL]

var arrayItemsPhotoManagement = [hiddenIdPOI,
{
html: "<center><img id='photo' height='350' src='resources/images/logo_blank.png'/></center><br/>"
Expand Down
2 changes: 2 additions & 0 deletions lib/js/admin/poi4.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,10 @@ function endDrag(feat) {
}

var arrayItemsCenterPanel = [POIListingEditorGrid,BasketListingEditorGrid];

var arrayItemsMenuTopAdminMap = ['Filtres : ',dateFieldModifiedSince,CancelDateFilterItem,'&',StatusPOIFieldMapItemMenu,CancelStatusFilterItem,'&', comboPrioritePOIMapItemMenu,CancelPrioriteFilterItem,'&',checkboxDisplayObservationsWithCommentToModerate,'&',numberFieldNbSupport,CancelVoteFilterItem];
var arrayItemsMenuBottomAdminMap = [searchObservationField, '->',comboALL];

var arrayItemsPhotoManagement = [hiddenIdPOI,
{
html: "<center><img id='photo' height='350' src='resources/images/logo_blank.png'/></center><br/>"
Expand Down
6 changes: 0 additions & 6 deletions lib/js/admin/poiCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ var PolePOIList2 = new Ext.data.JsonStore({
]
});


//priorite combo in the grid
var comboPrioritePOIGrid = new Ext.form.ComboBox({
fieldLabel: T_priorite,
Expand All @@ -155,9 +154,6 @@ var PolePOIList2 = new Ext.data.JsonStore({
emptyText: 'Filter par priorité'
});




//combobox in the moderation interface of the observation
var StatusPOIField = new Ext.form.ComboBox({
id:'StatusPOIField',
Expand All @@ -172,8 +168,6 @@ var StatusPOIField = new Ext.form.ComboBox({
allowBlank: false,
emptyText: ''
});


//combobox in the grid listing the observations
var comboStatusPOI = new Ext.form.ComboBox({
fieldLabel: T_status,
Expand Down
6 changes: 4 additions & 2 deletions lib/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var dateFieldModifiedSince = new Ext.form.DateField(
{
id: 'dateFieldModifiedSince',
xtype: 'datefield',
format: 'd-M-Y',
format: 'd/m/Y',
editable: false,
emptyText: T_modifiedSince,
listeners: {
Expand All @@ -24,7 +24,7 @@ var CancelDateFilterItem = new Ext.Button({
text:'',
handler: function() {
dateFieldModifiedSince.reset();
dateLastModif ='1900-01-01';
dateLastModif ='1900-01-01';
getMarker();
}
});
Expand Down Expand Up @@ -123,6 +123,7 @@ var prioritePOIList = new Ext.data.JsonStore({
comboPrioritePOIMapItemMenu.reset();
getMarker();
}

});
//Status displaying (given by the collectivity)
var statusPOIList = new Ext.data.JsonStore({
Expand Down Expand Up @@ -164,6 +165,7 @@ var prioritePOIList = new Ext.data.JsonStore({
getMarker();
}
});

function showTooltip(event){
var feature = event.feature;
//Display Tooltip
Expand Down
6 changes: 4 additions & 2 deletions lib/js/public/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ function getMarker() {
if (tabcheckchild != '') {
console.log("before display block");
document.getElementById("loader").style.display = "block";

var uri = 'lib/php/public/getMarker.php?listType='+tabcheckchild+'&dateLastModif='+dateLastModif+'&status='+StatusPOIFieldMapItemMenu.getValue()+'&priorite='+comboPrioritePOIMapItemMenu.getValue()+'&nbSupportMinimum='+nbSupportMinimum;

OpenLayers.loadURL(uri, '', this, displayMarker);

}
Expand Down Expand Up @@ -742,7 +744,6 @@ var geoNameSearchCombo = new GeoExt.ux.GeoNamesSearchCombo({
map: publicMap, zoom: 12
});


//baselayers combo
var storeALL = new Ext.data.ArrayStore({
fields: ['abbr', 'layername', 'nick'],
Expand All @@ -765,7 +766,6 @@ var comboboxSelectMapLayer = new Ext.form.ComboBox({
}
});


//checkbox affichage des limites geographiques des communes sur la carte
var checkBoxdisplayLayerLimitesGeographiquesCommunes = new Ext.form.Checkbox({
boxLabel: T_geographicalCommunesBounds,
Expand Down Expand Up @@ -958,13 +958,15 @@ var mapGeoExtPanel = new GeoExt.MapPanel({
tbar: new Ext.Toolbar({
height: '20',
cls: 'x-panel-header',

items: [dateFieldModifiedSince,CancelDateFilterItem,'&',StatusPOIFieldMapItemMenu,CancelStatusFilterItem, '&',comboPrioritePOIMapItemMenu,CancelPrioriteFilterItem,'&', numberFieldNbSupport,CancelVoteFilterItem]
}),
bbar: new Ext.Toolbar({
height: '20',
cls: 'x-panel-header',
items: [searchObservationField, ' ', checkBoxdisplayLayerLimitesGeographiquesCommunes,' ',checkBoxDisplaylayerLimitesGeographiquesPoles,'->' ,comboboxSelectMapLayer]
})

});

//le border panel
Expand Down
13 changes: 5 additions & 8 deletions lib/php/admin/getJsonTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@
AND p.delete_poi = FALSE ";
}

$sql = "SELECT count(p.id_poi) as nbpoi, c.* FROM category AS c
INNER JOIN subcategory sc ON c.id_category = sc.category_id_category
INNER JOIN poi p ON p.subcategory_id_subcategory = sc.id_subcategory
INNER JOIN priorite ON (p.priorite_id_priorite = priorite.id_priorite)
WHERE $whereClauseSQL
GROUP BY
c.id_category, c.lib_category, c.icon_category, c.treerank_category, c.display_category
ORDER BY c.treerank_category ASC";
$sql = "SELECT c.*
FROM category AS c
WHERE c.display_category = TRUE
ORDER BY c.treerank_category ASC";

$sql2 = "SELECT distinct(subcategory.id_subcategory),
subcategory.lib_subcategory,
subcategory.icon_subcategory,
Expand Down
28 changes: 16 additions & 12 deletions lib/php/admin/getMarker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
$link = mysql_connect ( DB_HOST, DB_USER, DB_PASS );
mysql_select_db ( DB_NAME );
mysql_query ( "SET NAMES utf8mb4" );
$sql = "SELECT poi.*,
$sql = "SELECT DISTINCT(poi.id_poi) AS idd,
poi.*,
commune.lib_commune,
x(poi.geom_poi) AS X,
y(poi.geom_poi) AS Y,
Expand All @@ -39,31 +40,32 @@
}
$sqlappend .= " delete_poi = FALSE AND poi.id_poi = " . $_GET ['id'];
} else {
if (isset ( $_GET ['commentToModerate'] ) && $_GET ['commentToModerate'] == 1 && ($_SESSION ["type"] == 4 || $_SESSION ["type"] == 1)) {
$sqlappend = " INNER JOIN commentaires ON (poi.id_poi = commentaires.poi_id_poi) " . $sqlappend . " commentaires.display_commentaires = 'Non modéré' AND ";
} elseif (isset ( $_GET ['priority'] ) && $_GET ['priority'] != '') {
$sqlappend .= " poi.priorite_id_priorite = " . $_GET ['priority'] . " AND ";
}
$listType = $_GET ['listType'];
if (DEBUG) {
error_log ( date ( "Y-m-d H:i:s" ) . " - admin/getMarker.php avec listType $listType\n", 3, LOG_FILE );
}
// $tabListType = preg_split ( '#,#', $listType );
$sqlappend .= " poi.geom_poi IS NOT NULL AND subcategory_id_subcategory IN ( " . $listType . ") AND poi.display_poi = TRUE AND poi.fix_poi = FALSE AND delete_poi = FALSE ";
if (isset ( $_GET ['displayObservationsToBeAnalyzedByComCom'] ) && $_GET ['displayObservationsToBeAnalyzedByComCom'] == 1 && $_SESSION ["type"] == 2) {
$sqlappend .= " AND reponse_collectivite_poi = '' AND (transmission_poi IS NULL OR transmission_poi = 0) ";
$sqlappend .= " AND (reponse_collectivite_poi IS NULL OR reponse_collectivite_poi = '') AND (transmission_poi IS NULL OR transmission_poi = 0) ";
}
if (isset ( $_GET ['commentToModerate'] ) && $_GET ['commentToModerate'] == 1 && ($_SESSION ["type"] == 4 || $_SESSION ["type"] == 1)) {
$sql .= " INNER JOIN commentaires ON (poi.id_poi = commentaires.poi_id_poi) ";
$sqlappend .= " AND commentaires.display_commentaires = 'Non modéré' ";
}
if (isset ( $_GET ['priority'] ) && $_GET ['priority'] != '') {
$sqlappend .= " AND poi.priorite_id_priorite = " . $_GET ['priority'] . ' ';
}

if (DEBUG) {
error_log ( date ( "Y-m-d H:i:s" ) . " - admin/getMarker.php displayObservationsToBeAnalyzedByPole = " . $_GET ['displayObservationsToBeAnalyzedByPole'] . ", type = " . $_SESSION ["type"] . "\n", 3, LOG_FILE );
}
if (isset ( $_GET ['displayObservationsToBeAnalyzedByPole'] ) && $_GET ['displayObservationsToBeAnalyzedByPole'] == 1 && $_SESSION ["type"] == 3) {
$sqlappend .= " AND reponsepole_poi = '' AND (traiteparpole_poi IS NULL OR traiteparpole_poi = 0) ";
$sqlappend .= " AND (reponsepole_poi is NULL OR reponsepole_poi = '') AND (traiteparpole_poi IS NULL OR traiteparpole_poi = 0) ";
}
}
$whereSelectCommentAppend = '';
if ($_SESSION ["type"] == 1 && isset ( $_POST ["priority"] )) { // is admin
$sqlappend .= ' AND priorite.id_priorite = ' . $_POST ["priority"];
} elseif ($_SESSION ["type"] == 2) { // is communaute de communes
if ($_SESSION ["type"] == 2) { // is communaute de communes
$sqlappend .= ' AND moderation_poi = 1
AND commune_id_commune IN (' . str_replace ( ';', ',', $_SESSION ['territoire'] ) . ')
AND priorite.non_visible_par_collectivite = 0 ';
Expand All @@ -90,13 +92,15 @@
error_log ( date ( "Y-m-d H:i:s" ) . " - admin/getMarker.php datesqlappend = " . $datesqlappend . "\n", 3, LOG_FILE );
}
}

if (DEBUG) {
error_log ( date ( "Y-m-d H:i:s" ) . " - admin/getMarker.php nbSupportMinimum = " . $_GET ["nbSupportMinimum"] . "\n", 3, LOG_FILE );
}
if (isset ( $_GET ["nbSupportMinimum"] ) && $_GET ["nbSupportMinimum"] != '' && $_GET ["nbSupportMinimum"] > 0) { // filter by status given by the collectivity
$sqlappend .= ' AND poi.id_poi IN (select poi_poi_id from support_poi group by poi_poi_id having count(*) >= '.$_GET ["nbSupportMinimum"].')';
}
$sql .= $datesqlappend . $sqlappend;

if (DEBUG) {
error_log ( date ( "Y-m-d H:i:s" ) . " - admin/getMarker.php sql = $sql\n", 3, LOG_FILE );
}
Expand Down Expand Up @@ -241,4 +245,4 @@
}
}

?>
?>
9 changes: 9 additions & 0 deletions lib/php/commonfunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,15 @@ function getObservationDetailsInString($arrayObservation){
case 'priorite_id_priorite' :
$OldValue = $arrayObservation['lib_priorite'];
break;
case 'adherent_poi' :
$OldValue = 'Information uniquement accessible aux personnes en charge du traitement de l\'observation';
break;
case 'mail_poi' :
$OldValue = 'Information uniquement accessible aux personnes en charge du traitement de l\'observation';
break;
case 'tel_poi' :
$OldValue = 'Information uniquement accessible aux personnes en charge du traitement de l\'observation';
break;
}
if ($arrayColumns[$i]['dataType'] == 'boolean'){
$OldValue = 'Oui';
Expand Down
12 changes: 11 additions & 1 deletion lib/php/public/getJsonTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
error_log(date("Y-m-d H:i:s") . " - getJsonTree.php $sql \n", 3, LOG_FILE);
}
$result = mysql_query($sql);
#for each category = branch of the tree
while ($row = mysql_fetch_array($result)){
$sql2 = "SELECT distinct(subcategory.id_subcategory),
subcategory.lib_subcategory,
Expand All @@ -37,6 +38,7 @@
error_log(date("Y-m-d H:i:s") . " - getJsonTree.php $sql2 \n", 3, LOG_FILE);
}
$result2 = mysql_query($sql2);
#for each sub category, add a leaf
if (mysql_num_rows($result2) > 0){
if (DEBUG){
error_log(date("Y-m-d H:i:s") . " - getJsonTree.php ". $row['id_category'], 3, LOG_FILE);
Expand All @@ -61,7 +63,15 @@
$json .= "]";
$json .= "},";
} else {
$json .= "leaf: true";
$json .= "{";
$json .= "'id_': '".$row['id_category']."',";
$json .= "text: '".addslashes($row['lib_category'])."',";
$json .= "iconCls: '".$row['icon_category']."',";
$json .= "expanded: true,";
$json .= "checked: false,";
$json .= "leaf: true,";
$json .= "children: [";
$json .= "]";
$json .= "},";
}
}
Expand Down

0 comments on commit 9ca677e

Please sign in to comment.