Skill: Fix name -> title issues when importing - refs BT#21568

pull/5897/head
Angel Fernando Quiroz Campos 3 weeks ago
parent 677d739504
commit 2425eae0a6
No known key found for this signature in database
GPG Key ID: B284841AE3E562CD
  1. 2
      public/main/skills/skill_example.csv
  2. 14
      public/main/skills/skills_import.php
  3. 2
      translations/messages.ar.po
  4. 2
      translations/messages.ast_ES.po
  5. 2
      translations/messages.bg.po
  6. 2
      translations/messages.bn.po
  7. 2
      translations/messages.bo.po
  8. 2
      translations/messages.bs.po
  9. 2
      translations/messages.ca_ES.po
  10. 2
      translations/messages.cs.po
  11. 2
      translations/messages.da.po
  12. 2
      translations/messages.de.po
  13. 2
      translations/messages.el.po
  14. 4
      translations/messages.en.po
  15. 2
      translations/messages.eo.po
  16. 2
      translations/messages.es.po
  17. 2
      translations/messages.es_MX.po
  18. 2
      translations/messages.eu_ES.po
  19. 2
      translations/messages.fa.po
  20. 2
      translations/messages.fa_AF.po
  21. 2
      translations/messages.fi.po
  22. 2
      translations/messages.fo.po
  23. 2
      translations/messages.fr.po
  24. 2
      translations/messages.fur_IT.po
  25. 2
      translations/messages.gl_ES.po
  26. 2
      translations/messages.he.po
  27. 2
      translations/messages.hi.po
  28. 2
      translations/messages.hr.po
  29. 2
      translations/messages.hu.po
  30. 2
      translations/messages.id.po
  31. 2
      translations/messages.it.po
  32. 2
      translations/messages.ja.po
  33. 2
      translations/messages.ka.po
  34. 2
      translations/messages.ko.po
  35. 2
      translations/messages.lt.po
  36. 2
      translations/messages.lv.po
  37. 2
      translations/messages.mk.po
  38. 2
      translations/messages.ms.po
  39. 2
      translations/messages.nl.po
  40. 2
      translations/messages.nn.po
  41. 2
      translations/messages.oc_FR.po
  42. 2
      translations/messages.pl.po
  43. 2
      translations/messages.pot
  44. 2
      translations/messages.ps.po
  45. 2
      translations/messages.pt.po
  46. 2
      translations/messages.pt_BR.po
  47. 2
      translations/messages.qu_PE.po
  48. 2
      translations/messages.ro.po
  49. 2
      translations/messages.ru.po
  50. 2
      translations/messages.sk.po
  51. 2
      translations/messages.sl.po
  52. 2
      translations/messages.so.po
  53. 2
      translations/messages.sr.po
  54. 2
      translations/messages.sv.po
  55. 2
      translations/messages.sw.po
  56. 2
      translations/messages.th.po
  57. 2
      translations/messages.tl.po
  58. 2
      translations/messages.tr.po
  59. 2
      translations/messages.uk.po
  60. 2
      translations/messages.vi.po
  61. 2
      translations/messages.xh.po
  62. 2
      translations/messages.yo.po
  63. 2
      translations/messages.zh_CN.po
  64. 2
      translations/messages.zh_TW.po

@ -1,4 +1,4 @@
id;parent_id;name;description
id;parent_id;title;description
2;1;Reflection;
3;1;Manage learning;
4;1;Information literacy;

1 id parent_id name title description
2 2 1 Reflection
3 3 1 Manage learning
4 4 1 Information literacy

@ -22,7 +22,7 @@ function validate_data($skills)
{
$errors = [];
// 1. Check if mandatory fields are set.
$mandatory_fields = ['id', 'parent_id', 'name'];
$mandatory_fields = ['id', 'parent_id', 'title'];
foreach ($skills as $index => $skill) {
foreach ($mandatory_fields as $field) {
if (empty($skill[$field])) {
@ -41,8 +41,8 @@ function validate_data($skills)
$errors[] = $skill;
}
// 4. Check skill Name
if (!isset($skill['name'])) {
$skill['error'] = get_lang('The skill had no name set');
if (!isset($skill['title'])) {
$skill['error'] = get_lang('The skill had no title set');
$errors[] = $skill;
}
}
@ -96,6 +96,10 @@ function parse_csv_data($file)
{
$skills = Import::csvToArray($file);
foreach ($skills as $index => $skill) {
if (isset($skill['name'])) {
$skill['title'] = $skill['name'];
}
$skills[$index] = $skill;
}
@ -144,7 +148,7 @@ if (!empty($_POST['formSent']) && 0 !== $_FILES['import_file']['size']) {
}
if (is_array($skills)) {
foreach ($skills as $my_skill) {
if (isset($my_skill['name']) && !in_array($my_skill['name'], $skill_id_error)) {
if (isset($my_skill['title']) && !in_array($my_skill['title'], $skill_id_error)) {
$skills_to_insert[] = $my_skill;
}
}
@ -214,7 +218,7 @@ $form->display();
$contents = '
<p>'.get_lang('The CSV file must look like this').' ('.get_lang('Fields in <strong>bold</strong> are mandatory.').') :</p>
<pre>
<b>id</b>;<b>parent_id</b>;<b>name</b>;<b>description</b>
<b>id</b>;<b>parent_id</b>;<b>title</b>;<b>description</b>
<b>2</b>;<b>1</b>;<b>Chamilo Expert</b>;Chamilo is an open source LMS;<br />
</pre>
';

@ -15809,7 +15809,7 @@ msgstr "IP عنوان"
msgid "Only skills that were not registered were imported"
msgstr "فقط المهارات غير المسجلة تم استيرادها"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "لايوجد اسم للمهارة"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "Adreça IP"
msgid "Only skills that were not registered were imported"
msgstr "Només les competències que no estaven registrades han estat importades"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "El nom de la competència no està definit"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15869,7 +15869,7 @@ msgstr "IP-Adresse"
msgid "Only skills that were not registered were imported"
msgstr "Nur Fähigkeiten, die noch nicht registriert waren, wurden importiert"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "Die Fähigkeit hat keinen Namen"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "IP address"
msgid "Only skills that were not registered were imported"
msgstr "Μόνο οι δεξιότητες που δεν είχαν καταχωρηθεί εισήχθησαν"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "Δεν δόθηκε όνομα στο επίπεδο ικανότητας"
msgid "The parent skill was not set"

@ -15815,8 +15815,8 @@ msgstr "IP address"
msgid "Only skills that were not registered were imported"
msgstr "Only skills that were not registered were imported"
msgid "The skill had no name set"
msgstr "The skill had no name set"
msgid "The skill had no title set"
msgstr "The skill had no title set"
msgid "The parent skill was not set"
msgstr "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15826,7 +15826,7 @@ msgstr "Dirección IP"
msgid "Only skills that were not registered were imported"
msgstr "Solo las competencias que no estaban registradas fueron importadas"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "El nombre de la competencia no está definido"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "IP helbidea"
msgid "Only skills that were not registered were imported"
msgstr "Erregistraturik ez zeuden gaitasunak bakarrik inportatu ziren"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "Ez da gaitasunaren izena zehaztu"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "آدرس آی پی"
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -16344,7 +16344,7 @@ msgstr "Adresse IP"
msgid "Only skills that were not registered were imported"
msgstr "Seuls les nouvelles compétences ont été importées"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "La compétence n'a pas de nom"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "Enderezo IP"
msgid "Only skills that were not registered were imported"
msgstr "Só foron importadas as competencias que non estaban rexistradas"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "O nome da competencia non está definido"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "כתובת IP"
msgid "Only skills that were not registered were imported"
msgstr "יובאו רק מיומנויות שלא נרשמו"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "למיומנות לא הוגדר שם"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "Indirizzo IP"
msgid "Only skills that were not registered were imported"
msgstr "Solo le competenze non registrate saranno importate"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "La competenza non ha un nome impostato"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15864,7 +15864,7 @@ msgstr "IP adres"
msgid "Only skills that were not registered were imported"
msgstr "Alleen vaardigheden die nog niet waren geregistreerd werden geïmporteerd."
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "De vaardigheid had nog geen naam"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "Adres IP"
msgid "Only skills that were not registered were imported"
msgstr "Tylko umiejętności, które nie zostały zarejestrowane zostały importowane"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "Umiejętność nie nie miała ustawionej nazwy"
msgid "The parent skill was not set"

@ -15808,7 +15808,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "Endereço IP"
msgid "Only skills that were not registered were imported"
msgstr "Apenas foram importadas as competências ainda não registadas"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "Não existe um nome definido para a competência"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "Endereço IP"
msgid "Only skills that were not registered were imported"
msgstr "Apenas habilidades não registradas foram importadas."
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "A habilidade não tem nome definido."
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr "Numai competențele care nu au fost înregistrate au fost importate"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "Numele de concurență nu este definită"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "IP adresa"
msgid "Only skills that were not registered were imported"
msgstr "Iba zručnosti, ktoré neboli registrované boli importované"
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "Zručnosť nemá nastavené žiadne meno"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr "IP naslov"
msgid "Only skills that were not registered were imported"
msgstr "Uvožene so bile zgolj veščine, ki predhodno še niso bile definirane."
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr "Ime veščine ni definirano"
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

@ -15809,7 +15809,7 @@ msgstr ""
msgid "Only skills that were not registered were imported"
msgstr ""
msgid "The skill had no name set"
msgid "The skill had no title set"
msgstr ""
msgid "The parent skill was not set"

Loading…
Cancel
Save