diff --git a/.editorconfig b/.editorconfig index 9f62084fe..5ec095c88 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,4 +13,4 @@ indent_size = 4 [*.{html,js,json}] indent_style = space -indent_size = 2 \ No newline at end of file +indent_size = 2 diff --git a/.phpactor.json b/.phpactor.json index 014b6a372..29a055dcf 100644 --- a/.phpactor.json +++ b/.phpactor.json @@ -1,3 +1,4 @@ { "$schema": "/phpactor.schema.json", "language_server_php_cs_fixer.enabled": true +} diff --git a/docs/actions/lang/actionsbuilder_en.inc.php b/docs/actions/lang/actionsbuilder_en.inc.php index c39621e1d..c1f4db919 100644 --- a/docs/actions/lang/actionsbuilder_en.inc.php +++ b/docs/actions/lang/actionsbuilder_en.inc.php @@ -565,7 +565,7 @@ 'AB_buttons_action_button_pull_right' => 'Right', 'AB_attach_link_label' => 'Associated link', 'AB_attach_caption_label' => 'Text displayed on hovering', - 'AB_attach_nofullimagelink_label' => 'Add a link to only display the full image', + 'AB_attach_nofullimagelink_label' => 'Enable to click on the image to display the full image', 'AB_attach_class_position_left' => 'Left', 'AB_attach_class_position_center' => 'Center', 'AB_attach_class_position_right' => 'Right', diff --git a/handlers/DuplicateHandler.php b/handlers/DuplicateHandler.php index 1e0f8bd3b..c3829555d 100644 --- a/handlers/DuplicateHandler.php +++ b/handlers/DuplicateHandler.php @@ -2,6 +2,7 @@ use YesWiki\Bazar\Controller\EntryController; use YesWiki\Bazar\Service\EntryManager; +use YesWiki\Bazar\Service\FormManager; use YesWiki\Bazar\Service\ListManager; use YesWiki\Core\Controller\AuthController; use YesWiki\Core\Service\AclService; @@ -33,9 +34,9 @@ public function run() ]); } elseif (!$this->getService(AclService::class)->hasAccess('read', $this->wiki->GetPageTag())) { // if no read access to the page - if ($contenu = $this->getService(PageManager::class)->getOne('PageLogin')) { + if ($content = $this->getService(PageManager::class)->getOne('PageLogin')) { // si une page PageLogin existe, on l'affiche - $error .= $this->wiki->Format($contenu['body']); + $error .= $this->wiki->Format($content['body']); } else { // sinon on affiche le formulaire d'identification minimal $error .= '
' . "\n" @@ -50,7 +51,7 @@ public function run() $data = $this->duplicationManager->checkPostData($_POST); $this->duplicationManager->duplicateLocally($data); if ($data['duplicate-action'] == 'edit') { - $this->wiki->Redirect($this->wiki->href('edit', $data['pageTag'])); + $this->wiki->Redirect($this->wiki->href('edit', $data['newTag'])); return; } elseif ($data['duplicate-action'] == 'return') { @@ -58,10 +59,10 @@ public function run() return; } - $this->wiki->Redirect($this->wiki->href('', $data['pageTag'])); + $this->wiki->Redirect($this->wiki->href('', $data['newTag'])); return; - } catch (\Throwable $th) { + } catch (Throwable $th) { $error .= $this->render('@templates\alert-message-with-back.twig', [ 'type' => 'warning', 'message' => $th->getMessage(), @@ -79,23 +80,24 @@ public function run() $pageTitle = ''; if ($isEntry) { $title = _t('TEMPLATE_DUPLICATE_ENTRY') . ' ' . $this->wiki->GetPageTag(); - $pageContent = $this->getService(EntryManager::class)->getOne($this->wiki->GetPageTag()); + $originalContent = $this->getService(EntryManager::class)->getOne($this->wiki->GetPageTag()); if ($toExternalWiki) { - $pageTitle = $pageContent['bf_titre']; + $pageTitle = $originalContent['bf_titre']; $proposedTag = $this->wiki->GetPageTag(); - $pageContent = $this->wiki->page['body']; + $originalContent = $this->wiki->page['body']; + $form = $this->getService(FormManager::class)->getOne($this->getService(EntryManager::class)->getOne($proposedTag)['id_typeannonce']); } else { - $pageTitle = $pageContent['bf_titre'] . ' (' . _t('DUPLICATE') . ')'; + $pageTitle = $originalContent['bf_titre'] . ' (' . _t('DUPLICATE') . ')'; $proposedTag = genere_nom_wiki($pageTitle); } } elseif ($isList) { $title = _t('TEMPLATE_DUPLICATE_LIST') . ' ' . $this->wiki->GetPageTag(); - $pageContent = $this->getService(ListManager::class)->getOne($this->wiki->GetPageTag()); + $originalContent = $this->getService(ListManager::class)->getOne($this->wiki->GetPageTag()); if ($toExternalWiki) { - $pageTitle = $pageContent['titre_liste']; + $pageTitle = $originalContent['titre_liste']; $proposedTag = $this->wiki->GetPageTag(); } else { - $pageTitle = $pageContent['titre_liste'] . ' (' . _t('DUPLICATE') . ')'; + $pageTitle = $originalContent['titre_liste'] . ' (' . _t('DUPLICATE') . ')'; $proposedTag = genere_nom_wiki('Liste ' . $pageTitle); } } else { // page @@ -105,7 +107,7 @@ public function run() } else { $proposedTag = genere_nom_wiki($this->wiki->GetPageTag() . ' ' . _t('DUPLICATE')); } - $pageContent = $this->wiki->page['body']; + $originalContent = $this->wiki->page['body']; } $attachments = $this->duplicationManager->findFiles($this->wiki->page['tag']); $totalSize = 0; @@ -130,9 +132,10 @@ public function run() 'proposedTag' => $proposedTag ?? '', 'attachments' => $attachments ?? [], 'pageTitle' => $pageTitle ?? '', - 'pageContent' => $pageContent ?? '', + 'originalContent' => $originalContent ?? '', 'totalSize' => $this->duplicationManager->humanFilesize($totalSize ?? 0), 'type' => $type ?? '', + 'form' => $form ?? '', 'baseUrl' => preg_replace('/\?$/Ui', '', $this->wiki->config['base_url']), 'toExternalWiki' => $toExternalWiki, ]); diff --git a/includes/services/DuplicationManager.php b/includes/services/DuplicationManager.php index 1a7396b73..053bc7bc1 100644 --- a/includes/services/DuplicationManager.php +++ b/includes/services/DuplicationManager.php @@ -56,7 +56,7 @@ private function getLocalFileUploadPath() * * @return array keys of fields that may contain attachments to import */ - public function getUploadFieldsFromEntry($id) + private function getUploadFieldsFromEntry($id) { $fields = []; $entry = $this->wiki->services->get(EntryManager::class)->getOne($id); @@ -65,11 +65,8 @@ public function getUploadFieldsFromEntry($id) $form = $formManager->getOne($entry['id_typeannonce']); // find fields that are textareas foreach ($form['prepared'] as $field) { - if ($field instanceof TextareaField or $field instanceof ImageField or $field instanceof FileField) { - $fields[] = [ - 'id' => $field->getPropertyName(), - 'type' => $field->getType(), - ]; + if ($field instanceof TextareaField || $field instanceof ImageField || $field instanceof FileField) { + $fields[] = $field; } } } @@ -77,7 +74,7 @@ public function getUploadFieldsFromEntry($id) return $fields; } - public function findFilesInUploadField($fieldValue) + private function findFilesInUploadField($fieldValue) { $f = $this->uploadPath . '/' . $fieldValue; if ($f !== $this->uploadPath . '/' && file_exists($f)) { @@ -98,7 +95,7 @@ public function findFilesInUploadField($fieldValue) * * @return array files */ - public function findFilesInWikiText($tag, $wikiText) + private function findFilesInWikiText($tag, $wikiText) { $filesMatched = []; $regex = '#\{\{attach.*file="(.*)".*\}\}#Ui'; @@ -149,7 +146,7 @@ public function findFilesInWikiText($tag, $wikiText) } /** - * Get file attachements from pageTag. + * Get file attachements from newTag. * * @param string $tag page id * @@ -166,12 +163,12 @@ public function findFiles($tag = '') $fields = $this->getUploadFieldsFromEntry($tag); $entry = $this->wiki->services->get(EntryManager::class)->getOne($tag); foreach ($fields as $f) { - if ($f['type'] == 'image' || $f['type'] == 'fichier') { - if (!empty($fi = $this->findFilesInUploadField($entry[$f['id']]))) { + if ($f instanceof ImageField || $f instanceof FileField) { + if (!empty($fi = $this->findFilesInUploadField($entry[$f->getPropertyName()]))) { $files[] = $fi; } - } elseif ($f['type'] == 'textelong') { - if (!empty($fi = $this->findFilesInWikiText($tag, $entry[$f['id']]))) { + } elseif ($f instanceof TextareaField) { + if (!empty($fi = $this->findFilesInWikiText($tag, $entry[$f->getPropertyName()]))) { $files = array_merge($files, $fi); } } @@ -212,21 +209,21 @@ public function duplicateFiles($fromTag, $toTag) public function checkPostData($data) { - if (empty($data['type']) || !in_array($data['type'], ['page', 'list', 'entry'])) { + if (empty($data['type']) || !in_array($data['type'], ['form', 'page', 'list', 'entry'])) { throw new \Exception(_t('NO_VALID_DATA_TYPE')); } - if (empty($data['pageTag'])) { + if (empty($data['newTag'])) { throw new \Exception(_t('EMPTY_PAGE_TAG')); } - if ($data['type'] != 'page' && empty($data['pageTitle'])) { + if ($data['type'] != 'page' && empty($data['newTitle'])) { throw new \Exception(_t('EMPTY_PAGE_TITLE')); } if (!$this->wiki->UserIsAdmin()) { throw new \Exception(_t('ONLY_ADMINS_CAN_DUPLICATE') . '.'); } - $page = $this->wiki->services->get(PageManager::class)->getOne($data['pageTag']); + $page = $this->wiki->services->get(PageManager::class)->getOne($data['newTag']); if ($page) { - throw new \Exception($data['pageTag'] . ' ' . _t('ALREADY_EXISTING')); + throw new \Exception($data['newTag'] . ' ' . _t('ALREADY_EXISTING')); } if (empty($data['duplicate-action']) || !in_array($data['duplicate-action'], ['open', 'edit', 'return'])) { throw new \Exception(_t('NO_DUPLICATE_ACTION') . '.'); @@ -242,21 +239,21 @@ public function duplicateLocally($data) } switch ($data['type']) { case 'list': - $list = $this->wiki->services->get(ListManager::class)->getOne($this->wiki->getPageTag()); - $this->wiki->services->get(ListManager::class)->create($data['pageTitle'], $list['label'], $data['pageTag']); + $list = $this->wiki->services->get(ListManager::class)->getOne($data['originalTag']); + $this->wiki->services->get(ListManager::class)->create($data['newTitle'], $list['label'], $data['newTag']); break; case 'entry': - $files = $this->duplicateFiles($this->wiki->getPageTag(), $data['pageTag']); + $files = $this->duplicateFiles($data['originalTag'], $data['newTag']); $entry = $this->wiki->services->get(EntryManager::class)->getOne($this->wiki->getPageTag()); $fields = $this->getUploadFieldsFromEntry($this->wiki->GetPageTag()); foreach ($fields as $f) { foreach ($files as $fi) { - $entry[$f['id']] = str_replace($fi['originalFile'], $fi['duplicatedFile'], $entry[$f['id']]); + $entry[$f->getPropertyName()] = str_replace($fi['originalFile'], $fi['duplicatedFile'], $entry[$f->getPropertyName()]); } } - $entry['id_fiche'] = $data['pageTag']; - $entry['bf_titre'] = $data['pageTitle']; + $entry['id_fiche'] = $data['newTag']; + $entry['bf_titre'] = $data['newTitle']; $entry['antispam'] = 1; $this->wiki->services->get(EntryManager::class)->create($entry['id_typeannonce'], $entry); break; @@ -264,11 +261,11 @@ public function duplicateLocally($data) default: case 'page': $newBody = $this->wiki->page['body']; - $files = $this->duplicateFiles($this->wiki->getPageTag(), $data['pageTag']); + $files = $this->duplicateFiles($data['originalTag'], $data['newTag']); foreach ($files as $f) { $newBody = str_replace($f['originalFile'], $f['duplicatedFile'], $newBody); } - $this->wiki->services->get(PageManager::class)->save($data['pageTag'], $newBody); + $this->wiki->services->get(PageManager::class)->save($data['newTag'], $newBody); break; } @@ -280,7 +277,7 @@ public function duplicateLocally($data) ); $this->wiki->services->get(AclService::class)->save( - $data['pageTag'], + $data['newTag'], $privilege, $values['list'] ); @@ -292,9 +289,9 @@ public function duplicateLocally($data) 'http://outils-reseaux.org/_vocabulary/tag', ]; foreach ($properties as $prop) { - $values = $this->wiki->services->get(TripleStore::class)->getAll($this->wiki->GetPageTag(), $prop, '', ''); + $values = $this->wiki->services->get(TripleStore::class)->getAll($data['originalTag'], $prop, '', ''); foreach ($values as $val) { - $this->wiki->services->get(TripleStore::class)->create($data['pageTag'], $prop, $val['value'], '', ''); + $this->wiki->services->get(TripleStore::class)->create($data['newTag'], $prop, $val['value'], '', ''); } } } @@ -303,15 +300,11 @@ public function importDistantContent($tag, $request) { if ($this->wiki->services->get(PageManager::class)->getOne($tag)) { throw new Exception(_t('ACEDITOR_LINK_PAGE_ALREADY_EXISTS')); - - return; } $req = $request->request->all(); - foreach (['pageContent', 'sourceUrl', 'originalTag', 'type'] as $key) { + foreach (['originalContent', 'sourceUrl', 'originalTag', 'type'] as $key) { if (empty($req[$key])) { throw new Exception(_t('NOT_FOUND_IN_REQUEST', $key)); - - return; } } foreach ($req['files'] as $fileUrl) { @@ -319,14 +312,14 @@ public function importDistantContent($tag, $request) } $newUrl = explode('/?', $this->wiki->config['base_url'])[0]; - $newBody = str_replace($req['sourceUrl'], $newUrl, $req['pageContent']); + $newBody = str_replace($req['sourceUrl'], $newUrl, $req['originalContent']); if ($req['type'] === 'page') { $this->wiki->services->get(PageManager::class)->save($tag, $newBody); } elseif ($req['type'] === 'entry') { $entry = json_decode($newBody, true); $entry['id_fiche'] = $tag; $entry['antispam'] = 1; - $this->wiki->services->get(EntryManager::class)->create($entry['id_typeannonce'], $entry); + $this->wiki->services->get(EntryManager::class)->create($entry['id_typeannonce'], $entry, false, $req['sourceUrl']); } } diff --git a/index.php b/index.php index b9c524a7a..8b2fe5c16 100755 --- a/index.php +++ b/index.php @@ -8,9 +8,9 @@ * * @category Wiki * - * @license GNU/GPL version 3 + * @license GNU/GPL version 3 * - * @see https://yeswiki.net + * @see https://yeswiki.net */ use YesWiki\Core\YesWikiLoader; diff --git a/javascripts/handlers/duplicate.js b/javascripts/handlers/duplicate.js index 5d690d917..8dbeb7cae 100644 --- a/javascripts/handlers/duplicate.js +++ b/javascripts/handlers/duplicate.js @@ -9,15 +9,19 @@ function isValidUrl(string) { } } +function arrayIncludesAllRequiredFields(arr, fields) { + return fields.every((v) => arr.some((i) => i.id === v.id && i.type === v.type)) +} + function blockDuplicationName(tag) { $('[name=duplicate-action]').attr('disabled', 'disabled').addClass('disabled') - $('#pageTag').parents('.form-group').removeClass('has-success').addClass('has-error') + $('#newTag').parents('.form-group').removeClass('has-success').addClass('has-error') $('#pagetag-message').html(_t('PAGE_NOT_AVAILABLE', { tag })) } function validateDuplicationName(tag) { $('[name=duplicate-action]').removeAttr('disabled').removeClass('disabled') - $('#pageTag').parents('.form-group').removeClass('has-error').addClass('has-success') + $('#newTag').parents('.form-group').removeClass('has-error').addClass('has-success') $('#pagetag-message').html(_t('PAGE_AVAILABLE', { tag })) } @@ -43,7 +47,7 @@ function handleLoginResponse(data) { .addClass('has-success') $('.login-fields').addClass('hide') $('.duplication-fields').removeClass('hide') - checkPageExistence(`${shortUrl}/?api/pages/${$('#pageTag').val()}`) + checkPageExistence(`${shortUrl}/?api/pages/${$('#newTag').val()}`) } else { $('#login-message').html(_t('CONNECTED_BUT_NOT_ADMIN', { user: data.user })).parents('.form-group') .removeClass('has-success') @@ -58,7 +62,7 @@ document.addEventListener('DOMContentLoaded', () => { e.stopPropagation() return false }) - $('#urlWiki').on('change', () => { + $('#url-wiki').on('change', () => { $('.login-fields, .duplication-fields').addClass('hide') $('#login-message').html('') }) @@ -84,19 +88,19 @@ document.addEventListener('DOMContentLoaded', () => { }) $('[name="duplicate-action"]').on('click', (e) => { - var btnAction = e.currentTarget.value + const btnAction = e.currentTarget.value $.ajax({ method: 'POST', - url: `${shortUrl}/?api/pages/${$('#pageTag').val()}/duplicate`, + url: `${shortUrl}/?api/pages/${$('#newTag').val()}/duplicate`, data: $('#form-duplication').serialize() - }).done((data) => { - if (btnAction == 'open') { - location = `${shortUrl}/?${data.pageTag}` - } else if (btnAction == 'edit') { - location = `${shortUrl}/?${data.pageTag}/edit` + }).done((d) => { + if (btnAction === 'open') { + document.location = `${shortUrl}/?${d.newTag}` + } else if (btnAction === 'edit') { + document.location = `${shortUrl}/?${d.newTag}/edit` } else { - let url = location.href.replace(/\/duplicate.*/, '') - location = url + const url = document.location.href.replace(/\/duplicate.*/, '') + document.location = url } }).fail((jqXHR) => { toastMessage(`${_t('ERROR')} ${jqXHR.status}`, 3000, 'alert alert-danger') @@ -105,11 +109,11 @@ document.addEventListener('DOMContentLoaded', () => { }) $('.btn-verify-tag').on('click', () => { - checkPageExistence(`${shortUrl}/?api/pages/${$('#pageTag').val()}`) + checkPageExistence(`${shortUrl}/?api/pages/${$('#newTag').val()}`) }) $('.btn-verify-wiki').on('click', () => { - let url = $('#urlWiki').val() + let url = $('.duplication-wiki-form').find('#url-wiki').val() if (isValidUrl(url)) { let taburl = [] @@ -119,13 +123,40 @@ document.addEventListener('DOMContentLoaded', () => { taburl = url.split('?') } shortUrl = taburl[0].replace(/\/+$/g, '') - $('#baseUrl').text(`${shortUrl}/?`) + $('#base-url').text(`${shortUrl}/?`) url = `${shortUrl}/?api/auth/me` $.ajax({ method: 'GET', url }).done((data) => { handleLoginResponse(data) + + // if case of entry, we need to check if form id is available and compatible + // or propose another id + const formId = $('#form-id').val() + if (typeof formId !== 'undefined') { + const formUrl = `${shortUrl}/?api/forms/${formId}` + $.ajax({ + method: 'GET', + url: formUrl + }).done((form) => { + const requiredFields = form.prepared.filter((field) => field.required === true) + // we check if the found formId is compatible + if (arrayIncludesAllRequiredFields(window.sourceForm.prepared, requiredFields)) { + $('#form-message').removeClass('has-error').addClass('has-success').find('.help-block') + .html(_t('FORM_ID_IS_COMPATIBLE', { id: formId })) + } else { + $('#form-message').removeClass('has-success').addClass('has-error').find('.help-block') + .html(_t('FORM_ID_NOT_AVAILABLE', { id: formId })) + } + }).fail((jqXHR) => { + if (jqXHR.status === 404) { + // the formId is available + $('#form-message').removeClass('has-error').addClass('has-success').find('.help-block') + .html(_t('FORM_ID_AVAILABLE', { id: formId })) + } + }) + } }).fail((jqXHR) => { if (jqXHR.status === 401) { $('#login-message').html(`
${_t('NOT_CONNECTED')}
`) @@ -138,4 +169,4 @@ document.addEventListener('DOMContentLoaded', () => { toastMessage(_t('NOT_VALID_URL', { url }), 3000, 'alert alert-danger') } }) -}) \ No newline at end of file +}) diff --git a/javascripts/users-table.js b/javascripts/users-table.js index 3dc85030a..2a458ff01 100644 --- a/javascripts/users-table.js +++ b/javascripts/users-table.js @@ -35,7 +35,7 @@ const usersTableService = { '' ]).draw() if (userLink !== '') { - $(`#users-table-link-change-password`).html("

"+userLink+"") + $('#users-table-link-change-password').html(`

${userLink}`) } toastMessage(_t('USERSTABLE_USER_CREATED', { name: userName }), 1100, 'alert alert-success') }, diff --git a/javascripts/yeswiki-base.js b/javascripts/yeswiki-base.js index 542fb9624..558d6ad7d 100755 --- a/javascripts/yeswiki-base.js +++ b/javascripts/yeswiki-base.js @@ -921,4 +921,4 @@ $('#yw-a11y-jump-content').click(() => { setTimeout(() => { $('#yw-topnav').removeClass('nav-down').addClass('nav-up') }, 300) -}) \ No newline at end of file +}) diff --git a/lang/yeswikijs_fr.php b/lang/yeswikijs_fr.php index c66bab516..59c4ccbe2 100644 --- a/lang/yeswikijs_fr.php +++ b/lang/yeswikijs_fr.php @@ -159,4 +159,7 @@ 'CONNECTED_AS_ADMIN' => 'L\'utilisateurice {user} est bien connecté.e sur le YesWiki de destination, avec des droits d\'administration.', 'CONNECTED_BUT_NOT_ADMIN' => 'L\'utilisateurice {user} est bien connecté.e sur le YesWiki de destination, mais n\'a pas les droits d\'administration. Veuillez-vous connecter avec un compte admin.', 'NOT_WIKI_OR_OLD_WIKI' => 'Le site indiqué ne semble pas être un YesWiki, ou sa version est antérieure à 4.5.0', + 'FORM_ID_AVAILABLE' => 'Le formulaire avec l\'identifiant {id} n\'existant pas encore sur l\'url indiqué, il sera créé.', + 'FORM_ID_NOT_AVAILABLE' => 'Le formulaire avec l\'identifiant {id} n\'est plus disponible sur l\'url indiqué, il faut changer d\'identifiant.', + 'FORM_ID_IS_COMPATIBLE' => 'Un formulaire du même identifiant ({id}) existe sur l\'url indiqué et semble avoir au moins les champs obligatoires similaires. Il sera utilisé pour la duplication.', ]; diff --git a/templates/handlers/duplicate.twig b/templates/handlers/duplicate.twig index 550499afe..f42d399a4 100644 --- a/templates/handlers/duplicate.twig +++ b/templates/handlers/duplicate.twig @@ -7,9 +7,9 @@
{{ _t('WIKI_URL_RECENT') }}.
- +
- + @@ -36,22 +36,29 @@
+ {% if form %} + + +
+ {% endif %}
{# hide the field while not connected #} {% endif %}
{% if pageTitle %}
- +
- +
- {% endif %} + {% endif %}
- +
- {{ baseUrl }} - + {{ baseUrl }} + {% if toExternalWiki %} @@ -69,16 +76,13 @@ {% endfor %} {% endif %} - {% if toExternalWiki %}{% endif %} + {% if toExternalWiki %}{% endif %} - - - + {% if toExternalWiki %}
{% endif %} -{% endif %} \ No newline at end of file diff --git a/tools/attach/lang/attach_ca.inc.php b/tools/attach/lang/attach_ca.inc.php index c431b6fe6..feeafbed7 100644 --- a/tools/attach/lang/attach_ca.inc.php +++ b/tools/attach/lang/attach_ca.inc.php @@ -98,8 +98,8 @@ 'FAILED' => 'Error', 'ATTACH_FILENAME' => 'Nom del fitxer', 'ATTACH_SIZE' => 'Cintura', - 'ATTACH_GET_CACHE_URLIMAGE_NO_FILE' => "Fitxer d'imatge inexistent", - 'INVALID_REQUEST_METHOD' => 'Versió del fitxer', + 'ATTACH_GET_CACHE_URLIMAGE_NO_FILE' => 'Fitxer imatge inexistent', + 'INVALID_REQUEST_METHOD' => 'Mètode de requète invàlid', 'ERROR_MOVING_TEMPORARY_FILE' => 'Error durant el d✱;ubicació del fitxer temporal', 'ERROR_NO_FILE_UPLOADED' => 'Cap fitxer no ha estat descarregat.', 'ATTACH_TRASH' => 'Corbeille', @@ -125,7 +125,7 @@ 'ERROR_MAX_FILE_SIZE' => 'El fitxer t markedeacute;l exposedeacute;charg markedeacute excitedcirc;de la mida de MAX_FILE_SIZE, que ha \'eacute;t yawned; spŭeacute;cifi primeacute;e en la forma HTML.', 'ERROR_PARTIAL_UPLOAD' => 'El fitxer té "eacute;t `eacute;; que parcialment cap aeacute;l neglecteacute;charg towardseacute.', 'ERROR_NOT_AUTHORIZED_EXTENSION' => 'El fitxer no té una extensió autoritzada, heus aquí les que la configuració autoritza: ', - 'ATTACH_ACTION_FULLIMAGELINK_TEXT' => 'Permet fer clic a la imatge per mostrar-la en gran', + 'ATTACH_ACTION_FULLIMAGELINK_TEXT' => 'Permetre clicar sobre la imatge per anunciar-lo en gran', 'ATTACH_FILE_MANAGEMENT' => 'Gestió dels fitxers', 'ATTACH_RESTORE' => 'Restauració', 'ATTACH_EMPTY_TRASH_NOTICE' => 'els fitxers esborrats a partir de la cistella ho seran definitivament.', diff --git a/tools/bazar/lang/bazar_ca.inc.php b/tools/bazar/lang/bazar_ca.inc.php index 36992881f..3170f4364 100644 --- a/tools/bazar/lang/bazar_ca.inc.php +++ b/tools/bazar/lang/bazar_ca.inc.php @@ -476,8 +476,8 @@ 'BAZ_PREVIEW_DETAILS' => 'aquesta part és no cliquable, les paramêtres es canvien en la columna d\'esquerra', 'BAZ_CORRESPONDANCE_ERROR' => 'acció bazarliste: parametre correspondència mal omplert: deu etre de la forma correspondència="identificant_1=identificador_2" o correspondència="identificant_1=identificador_2, identificant_3=identificador_4"', 'BAZ_WIDGET_INSTRUCTION2' => 'Codi acció wiki té copiar enganxar en una pàgina d\'aquest lloc', - 'BAZ_CORRESPONDANCE_ERROR2' => "acció bazarliste: el paràmetre correspondència està mal omplert. -Ha de ser de la forma correspondència=\"identificant_1=identificador_2\" o correspondència=\"identificant_1=identificador_2, identificant_3=identificador_4\"", + 'BAZ_CORRESPONDANCE_ERROR2' => 'acció bazarliste: el paràmetre correspondència està mal omplert. +Ha de ser de la forma correspondència="identificant_1=identificador_2" o correspondència="identificant_1=identificador_2, identificant_3=identificador_4"', 'BAZ_FILEFIELD_TOO_LARGE_FILE' => 'El fitxer és massa voluminós, màxim %{fileMaxSize} octets', 'BAZ_IMAGE_ALREADY_EXISTING' => 'La imatge {fileName} existia déja, no ha estada reemplaçada.', 'BAZ_DRAG_n_DROP_CHECKBOX_DELETE_ITEM' => 'Treure l\'element', diff --git a/tools/bazar/presentation/javascripts/jquery.photobox.js b/tools/bazar/presentation/javascripts/jquery.photobox.js index 4c0f9c7e0..dc53a4358 100644 --- a/tools/bazar/presentation/javascripts/jquery.photobox.js +++ b/tools/bazar/presentation/javascripts/jquery.photobox.js @@ -980,4 +980,4 @@ history, defaults } -}(jQuery, document, window)) \ No newline at end of file +}(jQuery, document, window)) diff --git a/tools/bazar/services/ListManager.php b/tools/bazar/services/ListManager.php index 091a29597..7317b5db0 100644 --- a/tools/bazar/services/ListManager.php +++ b/tools/bazar/services/ListManager.php @@ -44,6 +44,11 @@ public function __construct( $this->cachedLists = []; } + public function isList($id): bool + { + return boolval($this->tripleStore->exist($id, TripleStore::TYPE_URI, self::TRIPLES_LIST_ID, '', '')); + } + public function getOne($id): ?array { if (isset($this->cachedLists[$id])) { @@ -94,13 +99,12 @@ public function getAll(): array return $result; } - public function create($title, $nodes) + public function create($title, $nodes, $id = null) { if ($this->securityController->isWikiHibernated()) { throw new \Exception(_t('WIKI_IN_HIBERNATION')); } - - $id = genere_nom_wiki('List' . $title); + $id = $id ?? genere_nom_wiki('List' . $title); $this->pageManager->save($id, json_encode([ 'title' => $title, 'nodes' => $this->sanitizeHMTL($nodes), diff --git a/tools/contact/lang/contact_ca.inc.php b/tools/contact/lang/contact_ca.inc.php index 9e94fa427..1a62ebdeb 100644 --- a/tools/contact/lang/contact_ca.inc.php +++ b/tools/contact/lang/contact_ca.inc.php @@ -98,16 +98,16 @@ 'AB_abonnement_template_label' => 'plantilla', 'AB_abonnement_class_label' => 'classe', 'AB_abonnement_mailinglist_label' => 'Llista de discussió', - 'AB_deabonnement_action_label' => "Subscriure's a una llista de discussió", - 'AB_contact_action_label' => 'Formulari de contacte', - 'AB_contact_action_entete_default' => 'Enviat del lloc...', - 'AB_contact_action_template_label' => 'Plantilla personalitzada', - 'AB_contact_action_template_hint' => 'Ex.: complet-contact-form.tpl.html', - 'AB_contact_action_class_label' => 'cs', - 'AB_listsubscription_action_label' => 'llista', - 'AB_mailperiod_action_label' => "Subscriu-te per rebre el contingut d'una pàgina periòdicament per correu electrònic", - 'AB_mailperiod_action_hint' => 'Per a aquesta acció de treball cal comprovar certs paràmetres del servidor. Veure documents a https://yeswiki.net/?MailPeriod', - 'AB_mailinglist_action_label' => 'Correu electrònic massiu a un butlletí', - 'AB_mailinglist_action_description' => "Acció per donar-se d'alta o donar-se de baixa massivament de correus electrònics", - 'EDIT_CONFIG_HINT_CONTACT_USE_LONG_WIKI_URLS_IN_EMAILS' => "Afegir 'wiki=' als enllaços d'aquest wiki en correus electrònics", + 'AB_deabonnement_action_label' => "Donar-se de baixa d'una llista de discussió", + 'AB_contact_action_label' => 'Anunciar un formulari de contacte', + 'AB_contact_action_entete_default' => 'Enviat des del lloc...', + 'AB_contact_action_template_label' => 'Template personalitzat', + 'AB_contact_action_template_hint' => 'Ex.: complete-contacte-form.tpl.html', + 'AB_contact_action_class_label' => 'classifica css', + 'AB_listsubscription_action_label' => 'listsubscription', + 'AB_mailperiod_action_label' => "Abonar-se per rebre periòdicament el contingut d'una pàgina per email", + 'AB_mailperiod_action_hint' => 'Perquè aquesta acció funcioni heu de verificar certs paràmetres sobre el vostre servidor. Veure la documentació sobre https://yeswiki.net/?MailPeriod', + 'AB_mailinglist_action_label' => 'Inscriure massivament correus a un butlletí informatiu', + 'AB_mailinglist_action_description' => 'Acció permetent inscriure o désinscrire massivament dels correus a un butlletí informatiu', + 'EDIT_CONFIG_HINT_CONTACT_USE_LONG_WIKI_URLS_IN_EMAILS' => "Afegir 'wiki=' als enllaços cap a aquest wiki en els e-mails", ]; diff --git a/tools/contact/lang/contact_es.inc.php b/tools/contact/lang/contact_es.inc.php index 94d610852..4828d3fdb 100644 --- a/tools/contact/lang/contact_es.inc.php +++ b/tools/contact/lang/contact_es.inc.php @@ -97,17 +97,17 @@ 'CONTACT_SENDMAIL_INFO' => 'Enviamos los correos para el período', 'CONTACT_SENDMAIL_ERROR' => 'El período no se ha llenado ni tiene ningún valor estándar (mes, semana o día).', 'CONTACT_DAILY_REPORT' => 'informe diario del', - 'CONTACT_ENTRY_ADDED' => 'nuevos complementos de plug', - 'CONTACT_ENTRY_CHANGED' => 'archivo modificado', - 'CONTACT_IN_FORM' => 'en la forma', - 'CONTACT_DELETED_LIST' => 'lista eliminada', - 'CONTACT_USED_IP' => 'Usos IP', - 'CONTACT_YOUR_ENTRY' => 'Su tarjeta', - 'CONTACT_HELP_IN_NOTIFICATION' => 'ir al sitio para gestionar su registro', - 'CONTACT_NEW_USER_SUBJECT' => 'Sus nuevos identificadores en el sitio', - 'AB_abonnement_action_label' => 'Suscríbete a una lista de discusión', - 'AB_abonnement_template_label' => 'plantilla', + 'CONTACT_ENTRY_ADDED' => 'nueva ficha ajoutee', + 'CONTACT_ENTRY_CHANGED' => 'ficha modifiee', + 'CONTACT_IN_FORM' => 'en el formulario', + 'CONTACT_DELETED_LIST' => 'lista supprimee', + 'CONTACT_USED_IP' => 'IP utilisee', + 'CONTACT_YOUR_ENTRY' => 'Vuestra ficha', + 'CONTACT_HELP_IN_NOTIFICATION' => 'id sobre el website para gestionar vuestra inscripción', + 'CONTACT_NEW_USER_SUBJECT' => 'Vuestros nuevos identifiants sobre el website', + 'AB_abonnement_action_label' => 'Abonarse a una lista de discusión', + 'AB_abonnement_template_label' => 'template', 'AB_abonnement_class_label' => 'clase', - 'AB_contact_action_mail_label' => 'Dirección de correo electrónico', - 'AB_mailinglist_action_description' => 'Acción para registrar o cancelar correos electrónicos masivos a un boletín informativo', + 'AB_contact_action_mail_label' => 'E-mail del destinatario', + 'AB_mailinglist_action_description' => 'Acción que permite inscribir o désinscrire masivamente de los mails a un newsletter', ]; diff --git a/tools/templates/lang/templates_ca.inc.php b/tools/templates/lang/templates_ca.inc.php index 57423245a..9ff5cab9f 100644 --- a/tools/templates/lang/templates_ca.inc.php +++ b/tools/templates/lang/templates_ca.inc.php @@ -128,13 +128,13 @@ 'GERERTHEMES_PAGE' => 'Pàgina', 'AB_templates_tabs_bottom_nav_no' => 'No', 'AB_templates_tabs_counter_on_bottom_nav_no' => 'No', - 'AB_templates_nav_label' => "Pestanyes amb pàgines diferents", - 'AB_templates_section_textcolor_black' => 'Enfosquida', - 'AB_templates_tabs_counter_on_bottom_nav_label' => 'Numerar els Botons de navegació', - 'ACLS_SELECT_PAGES_FILTER_ON_PAGES' => 'les pàgines únicament', - 'TEMPLATE_FILE_NOT_FOUND' => 'Template no trobat', - 'TEMPLATE_REEDIT' => 'Editar de nou', - 'TEMPLATE_APPLY_ALL' => 'Aplicar per a tot el lloc', + 'AB_templates_nav_label' => 'Tabs amb diferents pàgines', + 'AB_templates_section_textcolor_black' => 'Frozen', + 'AB_templates_tabs_counter_on_bottom_nav_label' => 'Botons de navegació de número', + 'ACLS_SELECT_PAGES_FILTER_ON_PAGES' => 'només pàgines', + 'TEMPLATE_FILE_NOT_FOUND' => 'Plantilla no trobada', + 'TEMPLATE_REEDIT' => 'Edita de nou', + 'TEMPLATE_APPLY_ALL' => 'Sol·licita la teva plaça', 'TEMPLATE_PRESET' => 'Preset', 'TEMPLATE_DEFAULT_PRESET' => 'Preset per defecte', 'TEMPLATE_WIKINAME_IS_NOT_A_PAGE' => 'Això ChatMot no és una pàgina', @@ -177,12 +177,12 @@ 'TEMPLATE_CHOOSE_FONT' => 'Escollir una policia', 'TEMPLATE_ADD_CSS_PRESET_API_HINT' => 'Salvaguarda un fitxer preset personalitzat', 'TEMPLATE_DELETE_CSS_PRESET' => 'Vulgueu-vos suprimir el preset personalitzat', - 'TEMPLATE_DELETE_CSS_PRESET_API_HINT' => 'Suprimeix un fitxer preset personalitzat', - 'TEMPLATE_PRESET_FILENAME' => 'Nom del preset', - 'TEMPLATE_THEME_NOT_SAVE' => 'Tema no salvaguardat', - 'TEMPLATE_PRESETS' => 'Configuracions gràfiques', - 'TEMPLATE_PRESET_ERROR' => "Impossible d'aplicar això preset, hi ha un error!", - 'TEMPLATE_CREATE_PRESET' => 'Crear una nova configuració gràfica', + 'TEMPLATE_DELETE_CSS_PRESET_API_HINT' => 'Permet suprimir un fitxer preestablert personalitzat', + 'TEMPLATE_PRESET_FILENAME' => 'Nom del preestablert', + 'TEMPLATE_THEME_NOT_SAVE' => 'Tema sense garantia', + 'TEMPLATE_PRESETS' => 'Configuració gràfica', + 'TEMPLATE_PRESET_ERROR' => 'No es pot aplicar aquest preestablert, hi ha un error!', + 'TEMPLATE_CREATE_PRESET' => 'Crea una nova configuració gràfica', 'TEMPLATE_CUSTOMIZE_PRESET' => 'Configuració gràfica', 'AB_template_group_label' => 'Posada en forma', 'AB_template_action_label_label' => 'Etiquette', @@ -255,11 +255,11 @@ 'AB_templates_section_visible_label' => 'Visible per', 'AB_templates_section_visible_admins' => 'Admins només', 'AB_templates_section_visible_connected_user' => 'Usuari connectat', - 'AB_templates_section_visible_owner' => 'Propietari de la pàgina', - 'AB_templates_section_visible_no_container' => 'No posar de contenidor', - 'AB_templates_tabs_label' => 'Pestanyes amb parts de la pàgina', - 'AB_templates_tabs_titles_label' => "Títols de les pestanyes", - 'AB_templates_tabs_titles_hint' => 'Separar cada títol per una coma', + 'AB_templates_section_visible_owner' => 'Titular de la pàgina', + 'AB_templates_section_visible_no_container' => 'No posar un contenidor', + 'AB_templates_tabs_label' => 'Tabs amb parts de la pàgina', + 'AB_templates_tabs_titles_label' => 'Títols de pestanyes', + 'AB_templates_tabs_titles_hint' => 'Separa cada títol per una coma', 'AB_templates_tabs_titles_default' => 'Pestanya 1, Pestanya 2, Pestanya 3', 'AB_templates_tabs_btnsize_label' => 'Talla de botó', 'AB_templates_tabs_btnsize_default' => 'Normal',