Commit f175ced0 authored by lphuberdeau's avatar lphuberdeau

[MRG] Automatic merge, branches/10.x 44551 to 44617

parent 24cfabd8
......@@ -231,7 +231,7 @@ class Comments extends TikiLib
if ( empty($att['data']) && !empty($att['path']) && !empty($att['forum_info']['att_store_dir']) ) {
unlink($att['forum_info']['att_store_dir'] . $att['path']);
}
$this->table('tiki_forum_attachments')->delete('forumId', array('attId' => $attId));
$this->table('tiki_forum_attachments')->delete(array('attId' => $attId));
}
function parse_output(&$obj, &$parts, $i)
......@@ -2019,9 +2019,6 @@ class Comments extends TikiLib
} else {
$ret = $this->fetchAll($query, array_merge($bind_mid, $bind_time));
$cant = $this->getOne($query_cant, array_merge($bind_mid_cant, $bind_time));
foreach ($ret as $i=>$row) {
$this->add_comments_extras($ret[$i]);
}
}
foreach ($ret as $key=>$res) {
......@@ -2127,6 +2124,10 @@ class Comments extends TikiLib
$this->flatten_comment_replies($r, $rf);
}
foreach ($retval['data'] as & $row) {
$this->add_comments_extras($row);
}
return $retval;
}
......
......@@ -139,8 +139,9 @@ class Search_ContentSource_UserSource implements Search_ContentSource_Interface
$handlers = array();
foreach ($result as $row) {
$definition = Tracker_Definition::get($row['usersTrackerId']);
$handlers = array_merge($handlers, Search_ContentSource_TrackerItemSource::getIndexableHandlers($definition));
if ($definition = Tracker_Definition::get($row['usersTrackerId'])) {
$handlers = array_merge($handlers, Search_ContentSource_TrackerItemSource::getIndexableHandlers($definition));
}
}
return $handlers;
......@@ -154,13 +155,18 @@ class Search_ContentSource_UserSource implements Search_ContentSource_Interface
users_usergroups
INNER JOIN users_groups USING(groupName)
INNER JOIN tiki_tracker_item_fields ON usersFieldId = fieldId
WHERE value = ?
WHERE value = ? AND usersTrackerId IS NOT NULL
", array($user)
);
$data = array();
foreach ($result as $row) {
$definition = Tracker_Definition::get($row['trackerId']);
if (! $definition) {
continue;
}
$item = $this->trk->get_tracker_item($row['itemId']);
foreach (Search_ContentSource_TrackerItemSource::getIndexableHandlers($definition, $item) as $baseKey => $handler) {
......
......@@ -9,7 +9,7 @@ class Search_GlobalSource_Geolocation implements Search_GlobalSource_Interface
{
function getData($objectType, $objectId, Search_Type_Factory_Interface $typeFactory, array $data = array())
{
if (isset($data['geo_location']) || isset($data['geo_location'])) {
if (isset($data['geo_location'])) {
return false;
}
......
......@@ -27,6 +27,10 @@ class GeoLib
'lon' => $attributes['tiki.geo.lon'],
);
if ($coords['lat'] == 0 && $coords['lon'] == 0) {
return;
}
if (! empty($attributes['tiki.geo.google.zoom'])) {
$coords['zoom'] = $attributes['tiki.geo.google.zoom'];
}
......@@ -54,6 +58,10 @@ class GeoLib
function build_location_string($coords)
{
if (! empty($coords['lat']) && ! empty($coords['lon'])) {
if ($coords['lat'] == 0 && $coords['lon'] == 0) {
return;
}
$string = "{$coords['lon']},{$coords['lat']}";
if (! empty($coords['zoom'])) {
......
......@@ -768,7 +768,16 @@
});
}
$(container).closest('.tab, #appframe, #tiki-center').find('form.search-box')
var searchboxes = $(container)
.closest('.tab, #appframe, #tiki-center')
.find('form.search-box')
.filter(function () {
return $(this).closest('.map-container').size() === 0;
});
searchboxes = searchboxes.add($('form.search-box', container));
searchboxes
.unbind('submit')
.submit(function () {
var form = this;
......
......@@ -182,7 +182,7 @@ function smarty_modifier_userlink($other_user, $class='link', $idletime='not_set
$lon = $userlib->get_user_preference($other_user, 'lon');
$zoom = $userlib->get_user_preference($other_user, 'zoom');
if ($lat || $lon) {
if (! ($lat == 0 && $lon == 0)) {
$class .= " geolocated";
$metadata .= " data-geo-lat='$lat' data-geo-lon='$lon'";
......
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