Commit 4f641aac authored by Sebastian Castro's avatar Sebastian Castro

Some adjustement re DynamicImported Data

parent 84edbd1f
parameters:
app.version: 2.0.7
\ No newline at end of file
app.version: 2.0.9
\ No newline at end of file
......@@ -100,3 +100,6 @@ db.Option.updateMany({}, { $unset: { displayOption: "" } })
# Convert static data to new customizable fields
db.Element.updateMany( { } , { $rename: { 'website': 'data.website', 'telephone':'data.telephone', 'commitment':'data.commitment', 'description':'data.description', 'descriptionMore':'data.descriptionMore', 'openHoursMoreInfos':'data.openHoursMoreInfos', 'urls':'data.urls', 'email':'data.email' } } )
db.Element.updateMany({ 'data.openhours_more_infos': null }, { $unset: { 'data.openhours_more_infos': "" } })
db.Element.find({ 'data.openhours_more_infos': null })
\ No newline at end of file
......@@ -2883,9 +2883,9 @@
}
},
"gogocarto-js": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/gogocarto-js/-/gogocarto-js-1.1.4.tgz",
"integrity": "sha512-Bso8d6iVrjk0lPFtgNKh1TrSN2bqp/R1cY+9p2sI5b+bOhPOUnDeX6o8z87japmdC2eLLnRKG6plN2kuQQ3R9w=="
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/gogocarto-js/-/gogocarto-js-1.1.8.tgz",
"integrity": "sha512-R8BX/+txsukkhOXgwQphN3phQ2uxZg/eA4td5awho9W1qHtUlWJU5SxsRR/yeLJIY4ZKtSPQ83nEYSvT5kquwQ=="
},
"graceful-fs": {
"version": "3.0.11",
......
......@@ -31,6 +31,6 @@
"watchify": "^3.8.0"
},
"dependencies": {
"gogocarto-js": "^1.1.4"
"gogocarto-js": "^1.1.8"
}
}
......@@ -224,6 +224,7 @@ class ElementRepository extends DocumentRepository
$qb = $this->createQueryBuilder('BiopenGeoDirectoryBundle:Element');
$radius = $distance / 110;
$qb->field('geo')->withinCenter((float)$lat, (float)$lng, $radius);
$qb->field('status')->notEqual(ElementStatus::DynamicImport);
$qb->field('createdAt')->gt($date);
$qb = $this->filterVisibles($qb);
if ($limit) $qb->limit($limit);
......
......@@ -55,7 +55,7 @@ class ElementActionService
if ($status === null) $status = ElementStatus::AddedByAdmin;
$this->addContribution($element, $message, InteractType::Import, $status);
$element->setStatus($status);
if($sendMail) $this->mailService->sendAutomatedMail('add', $element, $message);
if ($sendMail) $this->mailService->sendAutomatedMail('add', $element, $message);
$element->updateTimestamp();
}
......@@ -108,13 +108,14 @@ class ElementActionService
$import = $element->getSource();
$import->addIdToIgnore($element->getOldId());
$this->em->persist($import);
}
} else {
if($sendMail) $this->mailService->sendAutomatedMail('delete', $element, $message);
}
$this->addContribution($element, $message, InteractType::Deleted, ElementStatus::Deleted);
$newStatus = $element->isPotentialDuplicate() ? ElementStatus::Duplicate : ElementStatus::Deleted;
$element->setStatus($newStatus);
$this->resolveReports($element, $message);
if($sendMail) $this->mailService->sendAutomatedMail('delete', $element, $message);
$this->resolveReports($element, $message);
$element->updateTimestamp();
}
......
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