fix: [analyst-data:add] Allow not providing a language when creating a note

notes
Sami Mokaddem 2024-02-13 15:41:57 +01:00
parent 1afd609581
commit 8c59b9897d
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 3 additions and 4 deletions

View File

@ -36,6 +36,8 @@ class AnalystDataController extends AppController
$this->set(compact('dropdownData'));
$this->set('modelSelection', $this->modelSelection);
$this->set('distributionLevels', $this->Event->distributionLevels);
App::uses('LanguageRFC5646Tool', 'Tools');
$this->set('languageRFC5646', ['' => __('- No language -'), LanguageRFC5646Tool::getLanguages()]);
}
public function add($type = 'Note', $object_uuid = null, $object_type = null)
@ -57,10 +59,7 @@ class AnalystDataController extends AppController
return $this->restResponsePayload;
}
$this->_setViewElements();
if ($type == 'Note') {
App::uses('LanguageRFC5646Tool', 'Tools');
$this->set('languageRFC5646', LanguageRFC5646Tool::getLanguages());
} else if ($type == 'Relationship') {
if ($type == 'Relationship') {
$this->set('existingRelations', $this->AnalystData->getExistingRelationships());
}
$this->set('menuData', array('menuList' => 'analyst_data', 'menuItem' => 'add_' . strtolower($type)));