diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c96495915bc3a4c92a763a47b90f13362b07b7d..9ad8f8b0408b36e84a8c56fd67f0d3c4b996bbfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ v2.3.1 ====== +* FEATURE: Add license url for the data * BUG: Fix using images in marker popup template v2.3 diff --git a/src/Biopen/CoreBundle/Admin/ConfigurationAdmin.php b/src/Biopen/CoreBundle/Admin/ConfigurationAdmin.php index 92dd6faaed69763e30feab102a0e3f2f604705b1..8c54ccd1b6a2d82d06d86c528c1d48e238347295 100755 --- a/src/Biopen/CoreBundle/Admin/ConfigurationAdmin.php +++ b/src/Biopen/CoreBundle/Admin/ConfigurationAdmin.php @@ -36,10 +36,11 @@ class ConfigurationAdmin extends AbstractAdmin $apiProperties = $dm->getRepository('BiopenGeoDirectoryBundle:Element')->findAllCustomProperties(); $formMapper - ->with('Le site', array('class' => 'col-md-6', "description" => '
')) + ->with('Le site', array('class' => 'col-md-6', "description" => '
')) ->add('appName', null, array('label' => 'Nom du site')) ->add('appBaseline', null, array('label' => 'Description du site (baseline)','required' => false)) ->add('appTags', null, array('label' => 'Mot clés pour le référencement (séparés par une virgule)', 'required' => false)) + ->add('dataLicenseUrl', null, array('label' => 'Url de la licence qui protège vos données', 'required' => false)) ->end() ->with('Images générales', array('class' => 'col-md-6')) ->add('logo', 'sonata_type_model', $imagesOptions) diff --git a/src/Biopen/CoreBundle/Command/MigrationCommand.php b/src/Biopen/CoreBundle/Command/MigrationCommand.php index 2653cc7214aa1c2cc4cceb3b782bc2887a99c9e6..98cccc26ac929c37a5cf9bb78fe634dfa248e17c 100644 --- a/src/Biopen/CoreBundle/Command/MigrationCommand.php +++ b/src/Biopen/CoreBundle/Command/MigrationCommand.php @@ -15,6 +15,30 @@ use Symfony\Component\Process\Process; */ class MigrationCommand extends GoGoAbstractCommand { + // ----------------------------------------------------------------- + // DO NOT REMOVE A SINGLE ELEMENT OF THOSE ARRAYS, ONLY ADD NEW ONES + // ----------------------------------------------------------------- + public $migrations = [ + // March 2019 + // "db.Category.renameCollection('CategoryGroup')", + // "db.Option.renameCollection('Category')" + ]; + + public $commands = [ + // v2.3.1 + "app:elements:updateJson all" + ]; + + public $messages = [ + // v2.3.0 + "Un champ Image (url) est maintenant disponible dans la confiugration du formulaire !", + "Vous pouvez désormais customizer la popup qui s'affiche au survol d'un marqueur. Allez dans Personnalisation -> Marqueur / Popup", + "Nouvelle option pour le menu (Personnalisation -> La Carte -> onglet Menu) : afficher à côté de chaque catégories le nombre d'élements disponible pour cette catégorie", + // v2.3.1 + "Vous pouvez maintenant renseigner la licence qui protège vos données dans Personnalisation -> Configuration Générale" + ]; + + protected function gogoConfigure() { $this->setName('db:migrate') @@ -84,25 +108,4 @@ class MigrationCommand extends GoGoAbstractCommand $process = new Process("mongo {$db} --eval \"{$command}\""); return $process->start(); } - - // ----------------------------------------------------------------- - // DO NOT REMOVE A SINGLE ELEMENT OF THOSE ARRAYS, ONLY ADD NEW ONES - // ----------------------------------------------------------------- - public $migrations = [ - // March 2019 - // "db.Category.renameCollection('CategoryGroup')", - // "db.Option.renameCollection('Category')" - ]; - - public $commands = [ - // v2.3.1 - "app:elements:updateJson all" - ]; - - public $messages = [ - // v2.3.0 - "Un champ Image (url) est maintenant disponible dans la confiugration du formulaire !", - "Vous pouvez désormais customizer la popup qui s'affiche au survol d'un marqueur. Allez dans Personnalisation -> Marqueur / Popup", - "Nouvelle option pour le menu (Personnalisation -> La Carte -> onglet Menu) : afficher à côté de chaque catégories le nombre d'élements disponible pour cette catégorie" - ]; } \ No newline at end of file diff --git a/src/Biopen/CoreBundle/Document/Configuration.php b/src/Biopen/CoreBundle/Document/Configuration.php index ad961ca3cd468f2110aed5f4e4c822fa283ed2ad..b5e624939556ef08c417484a4a68f01f4a050d14 100644 --- a/src/Biopen/CoreBundle/Document/Configuration.php +++ b/src/Biopen/CoreBundle/Document/Configuration.php @@ -47,6 +47,9 @@ class Configuration implements \JsonSerializable // For meta keywords header protected $appTags; + /** @MongoDB\Field(type="string") */ + protected $dataLicenseUrl = "https://opendatacommons.org/licenses/odbl/summary/"; + // ---------------------------- // --------- IMAGES ----------- // ---------------------------- @@ -2981,4 +2984,26 @@ class Configuration implements \JsonSerializable if(!$this->marker) $this->marker = new ConfigurationMarker(); return $this->marker; } + + /** + * Set dataLicenseUrl + * + * @param string $dataLicenseUrl + * @return $this + */ + public function setDataLicenseUrl($dataLicenseUrl) + { + $this->dataLicenseUrl = $dataLicenseUrl; + return $this; + } + + /** + * Get dataLicenseUrl + * + * @return string $dataLicenseUrl + */ + public function getDataLicenseUrl() + { + return $this->dataLicenseUrl; + } } diff --git a/src/Biopen/GeoDirectoryBundle/Controller/APIController.php b/src/Biopen/GeoDirectoryBundle/Controller/APIController.php index c1b61d68a5416a356673c2a87727cfbbf34bdba7..3e2da7bb5028a050d9120af284ad88c1154c8359 100755 --- a/src/Biopen/GeoDirectoryBundle/Controller/APIController.php +++ b/src/Biopen/GeoDirectoryBundle/Controller/APIController.php @@ -96,16 +96,16 @@ class APIController extends GoGoController else { $responseJson = '{ - "data":' . $elementsJson . ', - "ontology":"'. $ontology .'"'; + "licence": "' . $config->getDataLicenseUrl() . '", + "ontology":"'. $ontology . '"'; if (!$fullRepresentation) { $mapping = ['id', $config->getMarker()->getFieldsUsedByTemplate(), 'latitude', 'longitude', 'status', 'moderationState']; $responseJson .= ', "mapping":' . json_encode($mapping); } - - $responseJson .= '}'; + + $responseJson .= ', "data":' . $elementsJson . '}'; } // TODO count how much a user is using the API