Commit ae1c9a47 authored by OnceUponAFoodsharingTime's avatar OnceUponAFoodsharingTime Committed by Matthias Larisch

Resolve "Change request: Disable the view of every foodsaver for every foodsaver in the map"

parent f4d48977
Pipeline #22142136 passed with stages
in 10 minutes and 40 seconds
......@@ -16,6 +16,7 @@
- fixed stripping of whitespace on email field for registration #58 @nigeldgreen
- use babel polyfills to support more browsers !359 @nicksellen
- fixed check for allowed attachment types in the mail app. !363 #183 by @peter.toennies
- data privacy : removed foodsaver / ambassador selection from map. #165 by @k.miklobusec
## Refactoring
- complete tidying up of all team related files !321 by @peter.toennies
......
......@@ -139,15 +139,15 @@ class XhrMethods
UNIX_TIMESTAMP(n.zeit) AS zeit,
fs.photo,
n.milestone
FROM fs_betrieb_notiz n,
fs_foodsaver fs
WHERE fs.id = n.foodsaver_id
AND n.betrieb_id = ' . (int)$data['bid'] . '
ORDER BY n.zeit DESC
LIMIT 50')
) {
//$out = array_reverse($out);
......@@ -398,7 +398,7 @@ class XhrMethods
' . $edit . '
</ul>
</div>
' . $this->xhrViewUtils->set($data, 'Kontaktdaten') . '
<div style="clear:both;"></div>
' . $pers . '
......@@ -486,9 +486,7 @@ class XhrMethods
if (isset($data['types']) && is_array($data['types'])) {
$out['status'] = 1;
foreach ($data['types'] as $t) {
if ($t == 'foodsaver') {
$out['foodsaver'] = $this->model->q(' SELECT `id`, `photo_public`,`lat`,`lon` FROM `fs_foodsaver` WHERE `active` = 1 AND rolle IN(1,2,3,4) AND `photo_public` != 4 AND lat != "" ');
} elseif ($t == 'betriebe') {
if ($t == 'betriebe') {
$team_status = array();
$nkoorp = '';
if (isset($data['options']) && is_array($data['options'])) {
......@@ -510,28 +508,15 @@ class XhrMethods
}
$out['betriebe'] = $this->model->q(' SELECT `id`,lat,lon FROM fs_betrieb WHERE lat != "" ' . $team_status . $nkoorp);
} elseif ($t == 'botschafter') {
$out['botschafter'] = $this->model->q('
SELECT DISTINCT fs.`id`, fs.`photo_public`,fs.`lat`,fs.`lon`
FROM `fs_foodsaver` fs,
`fs_botschafter` b,
`fs_bezirk` bz
WHERE fs.`id` = b.`foodsaver_id`
AND b.bezirk_id = bz.id
AND lat != ""
AND bz.`type` != 7
');
} elseif ($t == 'fairteiler') {
$out['fairteiler'] = $this->model->q(' SELECT `id`,lat,lon,bezirk_id AS bid FROM fs_fairteiler WHERE lat != "" AND status = 1 ');
} elseif ($t == 'baskets') {
if ($baskets = $this->model->q('
SELECT id, lat, lon, location_type
FROM fs_basket
WHERE `status` = 1
')
) {
/*
......@@ -1075,9 +1060,9 @@ class XhrMethods
{
return json_encode($this->model->update('
UPDATE `fs_bezirk`
SET `email` = ' . $this->model->strval($data['email']) . ',
`email_pass` = ' . $this->model->strval($data['email_pass']) . '
SET `email` = ' . $this->model->strval($data['email']) . ',
`email_pass` = ' . $this->model->strval($data['email_pass']) . '
WHERE `id` = ' . $this->model->intval($data['bezirk_id']) . '
'));
}
......@@ -1174,14 +1159,14 @@ class XhrMethods
$this->v_utils->v_input_wrapper('Master-Update', '<a class="button" href="#" onclick="if(confirm(\'Master-Update wirklich starten?\')){ajreq(\'masterupdate\',{app:\'geoclean\',id:' . (int)$data['id'] . '});}return false;">Master-Update starten</a>', 'masterupdate', array('desc' => 'Bei allen Kindbezirken ' . $g_data['name'] . ' als Master eintragen'));
$out['script'] = '
$("#bezirkform-form").unbind("submit");
$("#bezirkform-form").unbind("submit");
$("#bezirkform-form").submit(function(ev){
ev.preventDefault();
$("#dialog-confirm-msg").html("Sicher, dass Du die &Auml;nderungen am Bezirk speichern m&ouml;chtest?");
$( "#dialog-confirm" ).dialog("option","buttons",{
"Ja, Speichern": function()
"Ja, Speichern": function()
{
showLoader();
$.ajax({
......@@ -1204,25 +1189,25 @@ class XhrMethods
$( "#dialog-confirm" ).dialog( "close" );
}
});
$("#dialog-confirm").dialog("open");
});
$("input[type=\'submit\']").button();
$("#' . $id . ' input").tagedit({
autocompleteURL: "xhr.php?f=getRecip",
allowEdit: false,
allowAdd: false
});
});
$(window).keydown(function(event){
if(event.keyCode == 13) {
event.preventDefault();
return false;
}
});
});
';
if ($foodsaver = $this->model->getFsMap($data['id'])) {
......
......@@ -25,13 +25,10 @@ class MapView extends View
public function mapControl()
{
$foodsaver = '';
$betriebe = '';
$botschafter = '';
$additional = '';
if (S::may('fs')) {
$foodsaver = '<li><a name="foodsaver" class="ui-corner-all foodsaver"><span class="icon orange"><i class="img img-smile"></i></span><span>Foodsaver</span></a></li>';
$betriebe = '<li><a name="betriebe" class="ui-corner-all betriebe"><span class="icon brown"><i class="img img-store"></i></span><span>Betriebe</span></a>
<div id="map-options">
<label><input type="checkbox" name="viewopt[]" value="allebetriebe" /> Alle Betriebe</label>
......@@ -40,7 +37,6 @@ class MapView extends View
<label><input type="checkbox" name="viewopt" value="nkoorp" /> in Verhandlung</label>
</div>
</li>';
$botschafter = '<li><a name="botschafter" class="ui-corner-all botschafter"><span class="icon red"><i class="img img-smile"></i></span><span>Botschafter</span></a></li>';
}
return '
......@@ -50,13 +46,10 @@ class MapView extends View
<div id="map-control">
<ul class="linklist">
<li><a name="baskets" class="ui-corner-all baskets"><span class="icon green"><i class="img img-basket"></i></span><span>Essenskörbe</span></a></li>
' . $foodsaver . '
' . $botschafter . '
' . $betriebe . '
<li><a name="fairteiler" class="ui-corner-all fairteiler"><span class="icon yellow"><i class="img img-recycle"></i></span><span>Fair-Teiler</span></a></li>
</ul>
</div>
</ul>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment