Verified Commit 54611ea8 authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Add extended description fields in admin panel, displayed in list only

parent b7c5f7b1
Pipeline #11145 failed with stages
in 42 seconds
......@@ -61,7 +61,16 @@ class descriptionField
*/
public function index()
{
$descriptionFields = \laabs::callService('recordsManagement/descriptionField/readIndex');
$baseDescriptionFields = \laabs::callService('recordsManagement/descriptionField/readIndex');
$extendedDescriptionFields = \laabs::callService('recordsManagement/descriptionScheme/read_name_descriptionFields');
$descriptionFields = array_map(
function ($field) use ($baseDescriptionFields) {
$field->extended = !isset($baseDescriptionFields[$field->name]);
return $field;
},
$extendedDescriptionFields
);
$this->view->addContentFile('recordsManagement/descriptionField/index.html');
......
......@@ -32,6 +32,12 @@ msgstr "Date"
msgid "With time"
msgstr "Avec heure"
msgid "array"
msgstr "Tableau"
msgid "object"
msgstr "Objet"
msgid "Today's date by default"
msgstr "Date du jour par défaut"
......@@ -139,3 +145,6 @@ msgstr "Non"
msgid "Yes"
msgstr "Oui"
msgid "This field is defined on an extension and can not be managed in this panel. Contact the system operator to know more."
msgstr "Ce champ est défini dans une configuration d'extension et ne peut être géré à partir de cet écran. Contactez l'opérateur du système pour en savoir plus."
......@@ -43,6 +43,7 @@ file that was distributed with this source code.
<?merge .translateType.bool().not() ?>
<td><?merge .type ?></td>
<td class="action_btn">
<?merge .extended.not() ?>
<div class="btn-group pull-right">
<button type="button" data-descriptionFieldName="[?merge .name ?]" class="editDescriptionField btn btn-warning" title="Edit">
<span class="fa fa-fw fa-edit"></span>
......@@ -51,6 +52,10 @@ file that was distributed with this source code.
<span class="fa fa-fw fa-trash"></span>
</button>
</div>
<?merge .extended ?>
<button type="button" data-descriptionFieldName="[?merge .name ?]" class="extendedDescriptionField btn btn-info pull-right" title="This field is defined on an extension and can not be managed in this panel. Contact the system operator to know more.">
<span class="fa fa-fw fa-info"></span>
</button>
</td>
</tr>
</tbody>
......@@ -247,6 +252,10 @@ file that was distributed with this source code.
clearForm();
});
$("#descriptionField_tableList").on('click', '.extendedDescriptionField', function () {
clearForm();
});
$("#descriptionField_tableList").on('click', '.editDescriptionField', function () {
var descriptionFieldName = $(this).attr("data-descriptionFieldName");
......
Supports Markdown
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