From ebcd9a9265c67cb396a0323c6916dd070f18ff79 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 9 Jun 2015 13:01:11 +0200 Subject: [PATCH 01/14] Allow to import local files Also provide an option to remove local files after import. --- CsvImportPlugin.php | 6 ++++ controllers/IndexController.php | 2 ++ forms/Main.php | 3 ++ models/CsvImport/Import.php | 55 +++++++++++++++++++++++++-------- plugin.ini | 2 +- 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/CsvImportPlugin.php b/CsvImportPlugin.php index 790f8d7..0be665c 100644 --- a/CsvImportPlugin.php +++ b/CsvImportPlugin.php @@ -118,6 +118,7 @@ public function hookInstall() `skipped_item_count` int(10) unsigned NOT NULL, `is_public` tinyint(1) default '0', `is_featured` tinyint(1) default '0', + `remove_local_files` tinyint(1) default '0', `serialized_column_maps` text collate utf8_unicode_ci NOT NULL, `added` timestamp NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`) @@ -179,6 +180,11 @@ public function hookUpgrade($args) "; $db->query($sql); } + + if(version_compare($oldVersion, '2.0.3', '<=')) { + $sql = "ALTER TABLE `{$db->prefix}csv_import_imports` ADD `remove_local_files` TINYINT( 1 ) DEFAULT 0 AFTER is_featured"; + $db->query($sql); + } } /** diff --git a/controllers/IndexController.php b/controllers/IndexController.php index 4b0bd05..9748f4a 100644 --- a/controllers/IndexController.php +++ b/controllers/IndexController.php @@ -67,6 +67,7 @@ public function indexAction() $this->session->itemTypeId = $form->getValue('item_type_id'); $this->session->itemsArePublic = $form->getValue('items_are_public'); $this->session->itemsAreFeatured = $form->getValue('items_are_featured'); + $this->session->removeLocalFiles = $form->getValue('remove_local_files'); $this->session->collectionId = $form->getValue('collection_id'); $this->session->automapColumnNamesToElements = $form->getValue('automap_columns_names_to_elements'); @@ -349,6 +350,7 @@ protected function _sessionIsValid() { $requiredKeys = array('itemsArePublic', 'itemsAreFeatured', + 'removeLocalFiles', 'collectionId', 'itemTypeId', 'ownerId'); diff --git a/forms/Main.php b/forms/Main.php index c07ee01..b8da452 100644 --- a/forms/Main.php +++ b/forms/Main.php @@ -63,6 +63,9 @@ public function init() $this->addElement('checkbox', 'items_are_featured', array( 'label' => __('Feature All Items?'), )); + $this->addElement('checkbox', 'remove_local_files', array( + 'label' => __('Remove local files after successful import?'), + )); $this->_addColumnDelimiterElement(); $this->_addTagDelimiterElement(); diff --git a/models/CsvImport/Import.php b/models/CsvImport/Import.php index 2b6797f..a5a0892 100644 --- a/models/CsvImport/Import.php +++ b/models/CsvImport/Import.php @@ -36,6 +36,7 @@ class CsvImport_Import extends Omeka_Record_AbstractRecord public $delimiter; // the column delimiter public $is_public; public $is_featured; + public $remove_local_files; public $skipped_row_count = 0; public $skipped_item_count = 0; public $status; @@ -85,6 +86,17 @@ public function setItemsAreFeatured($flag) $this->is_featured = $booleanFilter->filter($flag); } + /** + * Sets whether the local files should be removed or not + * + * @param mixed $flag A boolean representation + */ + public function setRemoveLocalFiles($flag) + { + $booleanFilter = new Omeka_Filter_Boolean; + $this->remove_local_files = $booleanFilter->filter($flag); + } + /** * Sets the collection id of the collection to which the imported items belong * @@ -715,25 +727,42 @@ protected function _addItemFromRow($row) $fileUrls = $result[CsvImport_ColumnMap::TYPE_FILE]; foreach ($fileUrls as $url) { - try { - $file = insert_files_for_item($item, 'Url', $url, - array('ignore_invalid_files' => false)); - } catch (Omeka_File_Ingest_InvalidException $e) { - $msg = "Invalid file URL '$url': " - . $e->getMessage(); - $this->_log($msg, Zend_Log::ERR); - $item->delete(); - release_object($item); - return false; - } catch (Omeka_File_Ingest_Exception $e) { - $msg = "Could not import file '$url': " - . $e->getMessage(); + $successfulTransferStrategy = null; + foreach (array('Url', 'Filesystem') as $transferStrategy) { + try { + $file = insert_files_for_item($item, $transferStrategy, $url, + array('ignore_invalid_files' => false)); + } catch (Omeka_File_Ingest_InvalidException $e) { + $msg = "Invalid file URL '$url': " + . $e->getMessage(); + continue; + } catch (Omeka_File_Ingest_Exception $e) { + $msg = "Could not import file '$url': " + . $e->getMessage(); + continue; + } + $successfulTransferStrategy = $transferStrategy; + break; + } + if (!isset($file)) { $this->_log($msg, Zend_Log::ERR); $item->delete(); release_object($item); return false; } release_object($file); + + if ($successfulTransferStrategy === 'Filesystem') { + $localFiles []= $url; + } + } + + if ($this->remove_local_files) { + foreach ($localFiles as $localFile) { + if(!unlink($localFile)) { + $this->_log("Failed to remove file $localFile", Zend_Log::ERR); + } + } } // Makes it easy to unimport the item later. diff --git a/plugin.ini b/plugin.ini index 031fd49..cfbf00c 100644 --- a/plugin.ini +++ b/plugin.ini @@ -3,7 +3,7 @@ name="CSV Import" author="Roy Rosenzweig Center for History and New Media" description="Imports items, tags, and files from CSV files." link="http://omeka.org/codex/Plugins/CSV_Import_2.0" -version="2.0.3" +version="2.0.4" support_link="http://omeka.org/forums/forum/plugins" license="GPL" omeka_minimum_version="2.0" From c7c7cd27d214c2aa9ac712c24a7ae0be40f8a6e8 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 10 Jun 2015 13:53:49 +0200 Subject: [PATCH 02/14] Add basic checks to avoid importing the same item twice The user can choose which elements to use for item comparison --- CsvImportPlugin.php | 10 ++++++ controllers/IndexController.php | 5 +++ forms/Main.php | 39 ++++++++++++++++++++++ models/CsvImport/Import.php | 47 +++++++++++++++++++++++++++ plugin.ini | 2 +- views/admin/javascripts/csv-import.js | 2 +- 6 files changed, 103 insertions(+), 2 deletions(-) diff --git a/CsvImportPlugin.php b/CsvImportPlugin.php index 0be665c..20614d5 100644 --- a/CsvImportPlugin.php +++ b/CsvImportPlugin.php @@ -120,6 +120,7 @@ public function hookInstall() `is_featured` tinyint(1) default '0', `remove_local_files` tinyint(1) default '0', `serialized_column_maps` text collate utf8_unicode_ci NOT NULL, + `serialized_identifier_element_ids` TEXT, `added` timestamp NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); @@ -185,6 +186,15 @@ public function hookUpgrade($args) $sql = "ALTER TABLE `{$db->prefix}csv_import_imports` ADD `remove_local_files` TINYINT( 1 ) DEFAULT 0 AFTER is_featured"; $db->query($sql); } + + if(version_compare($oldVersion, '2.0.4', '<=')) { + $sql = " + ALTER TABLE `{$db->prefix}csv_import_imports` + ADD `serialized_identifier_element_ids` TEXT + AFTER serialized_column_maps + "; + $db->query($sql); + } } /** diff --git a/controllers/IndexController.php b/controllers/IndexController.php index 9748f4a..ae8e50d 100644 --- a/controllers/IndexController.php +++ b/controllers/IndexController.php @@ -68,6 +68,10 @@ public function indexAction() $this->session->itemsArePublic = $form->getValue('items_are_public'); $this->session->itemsAreFeatured = $form->getValue('items_are_featured'); $this->session->removeLocalFiles = $form->getValue('remove_local_files'); + $this->session->identifierElementIds = $form->getValue('identifier_element_ids'); + if (!isset($this->session->identifierElementIds)) { + $this->session->identifierElementIds = array(); + } $this->session->collectionId = $form->getValue('collection_id'); $this->session->automapColumnNamesToElements = $form->getValue('automap_columns_names_to_elements'); @@ -351,6 +355,7 @@ protected function _sessionIsValid() $requiredKeys = array('itemsArePublic', 'itemsAreFeatured', 'removeLocalFiles', + 'identifierElementIds', 'collectionId', 'itemTypeId', 'ownerId'); diff --git a/forms/Main.php b/forms/Main.php index b8da452..55828e6 100644 --- a/forms/Main.php +++ b/forms/Main.php @@ -67,6 +67,7 @@ public function init() 'label' => __('Remove local files after successful import?'), )); + $this->_addIdentifierElementIdsElement(); $this->_addColumnDelimiterElement(); $this->_addTagDelimiterElement(); $this->_addFileDelimiterElement(); @@ -89,6 +90,44 @@ public function init() $this->addElement($submit); } + protected function _getElementsOptions() + { + $db = get_db(); + $sql = " + SELECT + es.name AS element_set_name, + e.id AS element_id, + e.name AS element_name, + it.name AS item_type_name + FROM {$db->ElementSet} es + JOIN {$db->Element} e ON es.id = e.element_set_id + LEFT JOIN {$db->ItemTypesElements} ite ON e.id = ite.element_id + LEFT JOIN {$db->ItemType} it ON ite.item_type_id = it.id + WHERE es.record_type IS NULL + OR (es.record_type = 'Item' AND it.name IS NOT NULL) + ORDER BY es.name, it.name, e.name + "; + $elements = $db->fetchAll($sql); + $result = array(); + foreach ($elements as $element) { + $group = $element['item_type_name'] + ? __('Item Type') . ': ' . __($element['item_type_name']) + : __($element['element_set_name']); + $result[$group][$element['element_id']] = $element['element_name']; + } + return $result; + } + + protected function _addIdentifierElementIdsElement() + { + $this->addElement('multiselect', 'identifier_element_ids', array( + 'label' => __('Choose Identifier Elements'), + 'description' => __('Those elements will be compared to detect if an item already exists in database. If an item already exists, it will be skipped.'), + 'size' => '6', + 'multioptions' => $this->_getElementsOptions(), + )); + } + /** * Return the human readable word for a delimiter * diff --git a/models/CsvImport/Import.php b/models/CsvImport/Import.php index a5a0892..0431731 100644 --- a/models/CsvImport/Import.php +++ b/models/CsvImport/Import.php @@ -37,6 +37,7 @@ class CsvImport_Import extends Omeka_Record_AbstractRecord public $is_public; public $is_featured; public $remove_local_files; + public $serialized_identifier_element_ids; public $skipped_row_count = 0; public $skipped_item_count = 0; public $status; @@ -45,6 +46,7 @@ class CsvImport_Import extends Omeka_Record_AbstractRecord private $_csvFile; private $_isOmekaExport; private $_importedCount = 0; + private $_identifier_element_ids; /** * Batch importing is not enabled by default. @@ -86,6 +88,11 @@ public function setItemsAreFeatured($flag) $this->is_featured = $booleanFilter->filter($flag); } + public function setIdentifierElementIds($element_ids) + { + $this->_identifier_element_ids = $element_ids; + } + /** * Sets whether the local files should be removed or not * @@ -228,6 +235,7 @@ public function setBatchSize($size) protected function beforeSave($args) { $this->serialized_column_maps = serialize($this->getColumnMaps()); + $this->serialized_identifier_element_ids = serialize($this->getIdentifierElementIds()); } /** @@ -561,6 +569,15 @@ public function getColumnMaps() return $this->_columnMaps; } + public function getIdentifierElementIds() + { + if ($this->_identifier_element_ids === null) { + $this->_identifier_element_ids + = unserialize($this->serialized_identifier_element_ids); + } + return $this->_identifier_element_ids; + } + /** * Returns the number of items currently imported. If a user undoes an import, * this number decreases to the number of items left to remove. @@ -682,6 +699,24 @@ protected function _undoImportLoop() } } + protected function _findItemsByElementTexts($elementTexts) + { + if (!$elementTexts) { + return array(); + } + + $db = $this->getDb(); + $select = $db->select()->from(array('i' => 'items'), array('item_id' => 'id')); + foreach ($elementTexts as $elementText) { + $element_id = $elementText['element_id']; + $select->joinLeft(array("et_$element_id" => 'element_texts'), + "i.id = et_{$element_id}.record_id AND et_{$element_id}.record_type = 'Item' AND et_{$element_id}.element_id = {$element_id}"); + $select->where("et_{$element_id}.text = ?", $elementText['text']); + } + $items = $db->fetchCol($select); + return $items; + } + /** * Adds a new item based on a row string in the CSV file and returns it. * @@ -715,6 +750,18 @@ protected function _addItemFromRow($row) } $elementTexts = $result[CsvImport_ColumnMap::TYPE_ELEMENT]; + + $identifier_element_ids = $this->getIdentifierElementIds(); + $identifierElementTexts = array_filter($elementTexts, function ($e) use ($identifier_element_ids) { + return in_array($e['element_id'], $identifier_element_ids); + }); + $existing_items = $this->_findItemsByElementTexts($identifierElementTexts); + if ($existing_items) { + $this->_log("Found similar items: " . implode(", ", $existing_items), Zend_Log::WARN); + $this->_log("Identifier Element Texts:\n" . var_export($identifierElementTexts, true), Zend_Log::WARN); + return false; + } + try { $item = insert_item($itemMetadata, $elementTexts); } catch (Omeka_Validator_Exception $e) { diff --git a/plugin.ini b/plugin.ini index cfbf00c..c315ea6 100644 --- a/plugin.ini +++ b/plugin.ini @@ -3,7 +3,7 @@ name="CSV Import" author="Roy Rosenzweig Center for History and New Media" description="Imports items, tags, and files from CSV files." link="http://omeka.org/codex/Plugins/CSV_Import_2.0" -version="2.0.4" +version="2.0.5" support_link="http://omeka.org/forums/forum/plugins" license="GPL" omeka_minimum_version="2.0" diff --git a/views/admin/javascripts/csv-import.js b/views/admin/javascripts/csv-import.js index 7965af1..9766f06 100644 --- a/views/admin/javascripts/csv-import.js +++ b/views/admin/javascripts/csv-import.js @@ -40,7 +40,7 @@ Omeka.CsvImport = {}; Omeka.CsvImport.updateImportOptions = function () { // we need to test whether the checkbox is checked // because fields will all be displayed if the form fails validation - var fields = $('div.field').has('#automap_columns_names_to_elements, #item_type_id, #collection_id, #items_are_public, #items_are_featured, #column_delimiter, #element_delimiter, #tag_delimiter, #file_delimiter'); + var fields = $('div.field').has('#automap_columns_names_to_elements, #item_type_id, #collection_id, #items_are_public, #items_are_featured, #identifier_elements, #column_delimiter, #element_delimiter, #tag_delimiter, #file_delimiter'); if ($('#omeka_csv_export').is(':checked')) { fields.slideUp(); } else { From bb55535b7ee44df47b942a9ec3ffe1f1e76ef714 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 12 Jun 2015 10:33:29 +0200 Subject: [PATCH 03/14] Add ElementTypes support --- models/CsvImport/ColumnMap/Element.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/models/CsvImport/ColumnMap/Element.php b/models/CsvImport/ColumnMap/Element.php index 6a2a468..58c39b8 100644 --- a/models/CsvImport/ColumnMap/Element.php +++ b/models/CsvImport/ColumnMap/Element.php @@ -52,11 +52,20 @@ public function map($row, $result) $texts = explode($this->_elementDelimiter, $text); } foreach($texts as $text) { - $result[] = array( - 'element_id' => $this->_elementId, - 'html' => $this->_isHtml ? 1 : 0, - 'text' => $text, - ); + if (is_callable('element_types_format')) { + $formattedText = element_types_format($this->_elementId, $text); + if (!$formattedText) { + _log("Cannot format '$text' for element {$this->_elementId}", Zned_Log::WARN); + } + $text = $formattedText; + } + if ($text) { + $result[] = array( + 'element_id' => $this->_elementId, + 'html' => $this->_isHtml ? 1 : 0, + 'text' => $text, + ); + } } return $result; } @@ -116,4 +125,4 @@ static public function getDefaultElementDelimiter() } return $delimiter; } -} \ No newline at end of file +} From 606f59eb83647b1a8c7fa09c0f3fdfc9d28742a6 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 19 Jun 2015 16:36:27 +0200 Subject: [PATCH 04/14] Fix typo "Zned_Log" --- models/CsvImport/ColumnMap/Element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/CsvImport/ColumnMap/Element.php b/models/CsvImport/ColumnMap/Element.php index 58c39b8..2f4a07a 100644 --- a/models/CsvImport/ColumnMap/Element.php +++ b/models/CsvImport/ColumnMap/Element.php @@ -55,7 +55,7 @@ public function map($row, $result) if (is_callable('element_types_format')) { $formattedText = element_types_format($this->_elementId, $text); if (!$formattedText) { - _log("Cannot format '$text' for element {$this->_elementId}", Zned_Log::WARN); + _log("Cannot format '$text' for element {$this->_elementId}", Zend_Log::WARN); } $text = $formattedText; } From e5f315d51b1d6fae58ea25c81241a3e7f50b8b6f Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 19 Jun 2015 17:20:19 +0200 Subject: [PATCH 05/14] Use $db->TableName instead of 'table_name' --- models/CsvImport/Import.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/CsvImport/Import.php b/models/CsvImport/Import.php index 0431731..7e53e07 100644 --- a/models/CsvImport/Import.php +++ b/models/CsvImport/Import.php @@ -706,10 +706,10 @@ protected function _findItemsByElementTexts($elementTexts) } $db = $this->getDb(); - $select = $db->select()->from(array('i' => 'items'), array('item_id' => 'id')); + $select = $db->select()->from(array('i' => $db->Item), array('item_id' => 'id')); foreach ($elementTexts as $elementText) { $element_id = $elementText['element_id']; - $select->joinLeft(array("et_$element_id" => 'element_texts'), + $select->joinLeft(array("et_$element_id" => $db->ElementText), "i.id = et_{$element_id}.record_id AND et_{$element_id}.record_type = 'Item' AND et_{$element_id}.element_id = {$element_id}"); $select->where("et_{$element_id}.text = ?", $elementText['text']); } From 39d09fcca09a69231a755906d95fdd3ac4ff05fe Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 9 Sep 2015 11:45:03 +0200 Subject: [PATCH 06/14] Add french translation --- languages/fr.mo | Bin 0 -> 10194 bytes languages/fr.po | 364 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 364 insertions(+) create mode 100644 languages/fr.mo create mode 100644 languages/fr.po diff --git a/langu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owH>RoSfo!1JNxe9%Mxzzu!>bnV+Os^kMjSiH;vI=Pd7kl-lMGYsa`rVIWUSO= zMMp7nfMM8Mgj^5ZkuO5(Q2Z9IC}Ns4h`?=aaoh-<%!i|dut(rvgJL9-xrzm*M${39 zA5o=OjR--Emf9+~w1U~1k=M^v^TKq<%S|?F!pP+?x-8U)i%-NSy zz!UM<(Rl>Bi`+!mcmvkFCqk_<<9xtZquS;6a-v}#d)VbfKiI8w-`;H3;AD<5BaCc?~i0Od+h@{ebpZChvtAqN!18(!Rdb* zhG^Z#^aO*>X8h`^;-i=?1Kzu&?f_@|0~`9{(2F5m(2gdm|tK^!{XP+@7N#cDBd^{Qyb`uU7NAyY{Y-gs0-u_n=_tB zsWQznwMrOQCq3)I7CQJ=DX3MDAI3WJF>O)IIcz1{MZTiqP?rn7caC~XU%Z* zq?V)aAX2(Db~+T&$or@{U+TvlVz|GUIrCpn47X`#s9b?hFewf$m_zisLDJ2XXZ8kR0 z;TJA$?-^Ggf#D0;F`Te;&FT5=h%JBRx0dsP+XCmnkd4E||21RCZF%hif9|zC+2{0G zbul%HMGKk86!h2z0QkvT@4`HFr9emJm$vdU@47LnAy*e5WVb; z3%wiIc!wH>nYZGUE(`I+A@yd!lL&Okrd>tOpG#b)*0qYbJ@$l67YQ}$RPK5;;8WEC tIvK5B4~wck<_|%o0ka`J)gzQ|%s5N-U9%JCL-zXMz?m`3TXvd9{|kG, 2015 +# Isabelle Gilles , 2015 +# Stéphane Loret Sdj , 2015 +# symac , 2014 +msgid "" +msgstr "" +"Project-Id-Version: Omeka\n" +"Report-Msgid-Bugs-To: https://github.com/omeka/plugin-CsvImport/issues\n" +"POT-Creation-Date: 2013-03-06 00:06+0900\n" +"PO-Revision-Date: 2015-04-14 19:40+0000\n" +"Last-Translator: Isabelle Gilles \n" +"Language-Team: French (http://www.transifex.com/omeka/omeka/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +msgid "Import Items" +msgstr "Importer les contenus" + +#: views/admin/index/browse.php:6 views/admin/index/browse.php:19 +msgid "Status" +msgstr "Statut" + +msgid "Queued" +msgstr "En attente" + +msgid "In Progress" +msgstr "En cours" + +msgid "Completed" +msgstr "Terminé" + +msgid "Queued Undo" +msgstr "Annulations en attente" + +msgid "Undo In Progress" +msgstr "Annulations en cours" + +msgid "Completed Undo" +msgstr "Annulations terminées" + +msgid "Import Error" +msgstr "Erreur d'importation" + +msgid "Undo Import Error" +msgstr "Erreur d'annulation" + +msgid "Other Error" +msgstr "Autres erreurs" + +msgid "Stopped" +msgstr "Arrêté" + +msgid "Paused" +msgstr "En pause" + +#: CsvImportPlugin.php:231 views/admin/index/browse.php:2 +#: views/admin/index/index.php:2 views/admin/index/map-columns.php:2 +msgid "CSV Import" +msgstr "CSV Import" + +#: controllers/IndexController.php:36 +msgid "Invalid form input. Please see errors below and try again." +msgstr "Formulaire non valide. Prenez connaissance des erreurs et essayez à nouveau." + +#: controllers/IndexController.php:41 +msgid "Error uploading file. Please try again." +msgstr "Chargement du fichier impossible. Merci d'essayer à nouveau." + +#: controllers/IndexController.php:51 +msgid "Your file is incorrectly formatted." +msgstr "Votre fichier n'est pas formaté correctement." + +#: controllers/IndexController.php:95 +msgid "Import settings expired. Please try again." +msgstr "Les paramètres d'importation ont expiré. Merci de réessayer." + +#: controllers/IndexController.php:116 +msgid "Invalid form input. Please try again." +msgstr "Formulaire non valide. Merci d'essayer à nouveau." + +#: controllers/IndexController.php:122 +msgid "Please map at least one column to an element, file, or tag." +msgstr "Veuillez créer l'équivalence pour une colonne au moins vers un élément, fichier ou mot-clé." + +#: controllers/IndexController.php:136 controllers/IndexController.php:254 +msgid "Import started. Reload this page for status updates." +msgstr "Import démarré. Recharger cette page pour une mise à jour du statut." + +#: controllers/IndexController.php:138 controllers/IndexController.php:256 +msgid "Import could not be started. Please check error logs for more details." +msgstr "L'import n'a pas démarré. Consultez les logs d'import pour plus de détails." + +#: controllers/IndexController.php:174 +#, php-format +msgid "" +"Invalid column names. Column names must either be one of the following %s, " +"or have the following format: {ElementSetName}:{ElementName}" +msgstr "Nom de colonne non valide. Les noms de colonne doivent être parmi : %s, ou avoir le format suivant : {ElementSetName}:{ElementName}" + +#: controllers/IndexController.php:190 +#, php-format +msgid "Element \"%s\" is not found in element set \"%s\"" +msgstr "L'élément \"%s\" n'appartient pas au jeu d'éléments \"%s\"" + +#: controllers/IndexController.php:282 +msgid "Undo import started. Reload this page for status updates." +msgstr "Annulation d'import démarrée. Recharger cette page pour une mise à jour du statut." + +#: controllers/IndexController.php:284 +msgid "" +"Undo import could not be started. Please check error logs for more details." +msgstr "L'annulation d'import n'a pas démarré. Consultez les logs d'import pour plus de détails." + +#: controllers/IndexController.php:303 +msgid "Cleared import from the history." +msgstr "Historique effacé" + +#: controllers/IndexController.php:305 +msgid "Cannot clear import history." +msgstr "Impossible d'effacer l'historique." + +#: forms/Main.php:36 forms/Main.php:50 +msgid "Select Item Type" +msgstr "Choisir le type de contenu" + +#: forms/Main.php:39 +msgid "Use an export from Omeka CSV Report" +msgstr "Utiliser un export de CSV Report." + +#: forms/Main.php:40 +msgid "Selecting this will override the options below." +msgstr "Sélectionner ceci remplacera les options ci-dessous." + +#: forms/Main.php:44 +msgid "Automap Column Names to Elements" +msgstr "Aligner automatiquement les noms de colonnes avec les éléments." + +#: forms/Main.php:45 +msgid "" +"Automatically maps columns to elements based on their column names. The " +"column name must be in the form:
{ElementSetName}:{ElementName}" +msgstr "Aligner automatiquement les noms de colonnes avec les éléments en fonction des titres de colonnes. Les noms de colonne doivent être de la forme :
{ElementSetName}:{ElementName}" + +#: forms/Main.php:54 forms/Main.php:57 +msgid "Select Collection" +msgstr "Choisir la collection" + +#: forms/Main.php:61 +msgid "Make All Items Public?" +msgstr "Rendre tous les contenus publics ?" + +#: forms/Main.php:64 +msgid "Feature All Items?" +msgstr "Mettre en avant tous les contenus ?" + +#: forms/Main.php:77 +msgid "Next" +msgstr "Suivant" + +#: forms/Main.php:100 +msgid "comma" +msgstr "virgule" + +#: forms/Main.php:103 +msgid "semi-colon" +msgstr "point-virgule" + +#: forms/Main.php:106 +msgid "empty" +msgstr "vide" + +#: forms/Main.php:120 +msgid "Choose Column Delimiter" +msgstr "Choisir le délimiteur de colonne" + +#: forms/Main.php:121 +#, php-format +msgid "" +"A single character that will be used to separate columns in the file (%s by " +"default). Note that spaces, tabs, and other whitespace are not accepted." +msgstr "Un caractère unique sera utilisé comme séparateur de colonnes dans le fichier (%s par défaut). Veuillez noter que les espaces, tabulations et caractères vides ne sont pas acceptés." + +#: forms/Main.php:132 forms/Main.php:140 forms/Main.php:142 +msgid "Column delimiter cannot be whitespace and must be one character long." +msgstr "Le délimiteur de colonnes ne peut être vide et doit contenir un caractère." + +#: forms/Main.php:157 +msgid "Choose File Delimiter" +msgstr "Choisir le délimiteur de fichier." + +#: forms/Main.php:158 +#, php-format +msgid "" +"A single character that will be used to separate file paths or URLs within a" +" cell (%s by default). If the delimiter is empty, then the whole text will " +"be used as the file path or URL. Note that spaces, tabs, and other " +"whitespace are not accepted." +msgstr "Un caractère unique sera utilisé pour séparer les chemins vers les fichiers ou leurs URLs à l'intérieur d'une cellule (%s par défaut). Si le délimiteur est vide, la cellule entière sera utilisée comme chemin de fichier ou URL. Veuillez noter que les espaces, tabulations et caractères vides ne sont pas acceptés." + +#: forms/Main.php:170 forms/Main.php:179 forms/Main.php:181 +msgid "" +"File delimiter cannot be whitespace, and must be empty or one character " +"long." +msgstr "Le délimiteur de fichier ne peut être vide et doit contenir un caractère." + +#: forms/Main.php:196 +msgid "Choose Tag Delimiter" +msgstr "Choisir un délimiteur pour les mots clé" + +#: forms/Main.php:197 +#, php-format +msgid "" +"A single character that will be used to separate tags within a cell (%s by " +"default). Note that spaces, tabs, and other whitespace are not accepted." +msgstr "Un caractère unique sera utilisé pour séparer les mots clé à l'intérieur d'une cellule (%s par défaut). Veuillez noter que les espaces, tabulations et caractères vides ne sont pas acceptés." + +#: forms/Main.php:208 forms/Main.php:216 forms/Main.php:218 +msgid "Tag delimiter cannot be whitespace and must be one character long." +msgstr "Le délimiteur de mot clé ne peut être vide et doit contenir un caractère." + +#: forms/Main.php:233 +msgid "Choose Element Delimiter" +msgstr "Choisir un délimiteur pour les contenus." + +#: forms/Main.php:234 +#, php-format +msgid "" +"A single character that will be used to separate metadata elements within a " +"cell (%s by default). If the delimiter is empty, then the whole text will be" +" used as the element text. Note that spaces, tabs, and other whitespace are " +"not accepted." +msgstr "Un caractère unique sera utilisé pour séparer les métadonnées à l'intérieur d'une cellule (%s par défaut). Si le délimiteur est vide, la cellule entière sera utilisée comme texte pour l'enregistrement. Veuillez noter que les espaces, tabulations et caractères vides ne sont pas acceptés." + +#: forms/Main.php:246 forms/Main.php:255 forms/Main.php:257 +msgid "" +"Element delimiter cannot be whitespace, and must be empty or one character " +"long." +msgstr "Le délimiteur de contenus ne peut être vide et doit contenir un caractère." + +#: forms/Main.php:291 +msgid "Upload CSV File" +msgstr "Charger un fichier CSV" + +#: forms/Main.php:295 +#, php-format +msgid "Maximum file size is %s." +msgstr "La taille maximale du fichier est de %s." + +#: forms/Main.php:309 +#, php-format +msgid "" +"The file you have uploaded exceeds the maximum post size allowed by the " +"server. Please upload a file smaller than %s." +msgstr "Le fichier téléchargé dépasse la limite imposée par le serveur. Veuillez charger un fichier de moins de %s." + +#: forms/Mapping.php:56 +msgid "Import CSV File" +msgstr "Importer un fichier CSV" + +#: models/CsvImport/File.php:99 +msgid "Please ensure that all column names are unique." +msgstr "Veuillez vous assurer que chaque nom de colonne est unique. " + +#: models/CsvImport/File.php:103 +msgid "" +"Please ensure that the CSV file is formatted correctly and contains the " +"expected number of columns for each row." +msgstr "Veuillez vous assurer que le fichier CSV est correctement formé et qu'il contient le nombre de colonnes attendues pour chaque contenu." + +#: views/admin/index/browse.php:14 +msgid "Import Date" +msgstr "Date de l'import" + +#: views/admin/index/browse.php:15 +msgid "CSV File" +msgstr "Fichier CSV" + +#: views/admin/index/browse.php:16 +msgid "Imported Items" +msgstr "Contenus importés" + +#: views/admin/index/browse.php:17 +msgid "Skipped Items" +msgstr "Contenus ignorés" + +#: views/admin/index/browse.php:18 +msgid "Skipped Rows" +msgstr "Lignes ignorées" + +#: views/admin/index/browse.php:20 +msgid "Action" +msgstr "Action" + +#: views/admin/index/browse.php:49 +msgid "Undo Import" +msgstr "Annuler l'import" + +#: views/admin/index/browse.php:61 +msgid "Clear History" +msgstr "Effacer l'historique" + +#: views/admin/index/browse.php:71 +msgid "You have no imports yet." +msgstr "Vous n'avez encore aucun import." + +#: views/admin/index/check-omeka-csv.php:2 +msgid "CSV Import Errors" +msgstr "Erreur d'importation CSV" + +#: views/admin/index/check-omeka-csv.php:7 +msgid "" +"The following problems were found with your CSV file and Omeka installation." +msgstr "Les problèmes suivants ont été détectés dans votre fichier CSV et votre instance d'Omeka." + +#: views/admin/index/check-omeka-csv.php:10 +msgid "" +"Usually, these are the result of the elements in your Omeka.net site not having \n" +" corresponding elements in this installation of Omeka. Either the Dublin Core Extended plugin is not \n" +" installed, or you created custom item type elements in Omeka.net, but have not yet created them here." +msgstr "D'habitude, l'erreur est causée par des contenus sur votre site hébergé sur Omeka.net qui n'ont pas d'équivalent sur cette instance d'Omeka. Soit l'extension Dublin Core Extended n'est pas installée, soit vous avez défini des types de contenus personnalisés sur votre site Omeka.net qui n'existent pas encore sur cette instance." + +#: views/admin/index/check-omeka-csv.php:14 +msgid "Please correct the errors, then try your import again." +msgstr "Veuillez retenter l'import après avoir corrigé les erreurs." + +#: views/admin/index/index.php:7 +msgid "Step 1: Select File and Item Settings" +msgstr "Étape 1 : Choix du fichier et Paramètres des enregistrements" + +#: views/admin/index/map-columns-form.php:9 +msgid "Column" +msgstr "Colonne" + +#: views/admin/index/map-columns-form.php:10 +msgid "Example from CSV File" +msgstr "Exemple depuis un fichier CSV" + +#: views/admin/index/map-columns-form.php:11 +msgid "Map To Element" +msgstr "Relier à l'élément" + +#: views/admin/index/map-columns-form.php:12 +msgid "Use HTML?" +msgstr "Utiliser HTML ?" + +#: views/admin/index/map-columns-form.php:13 +msgid "Tags?" +msgstr "Mots clé ?" + +#: views/admin/index/map-columns-form.php:14 +msgid "Files?" +msgstr "Fichiers ?" + +#: views/admin/index/map-columns.php:6 +msgid "Step 2: Map Columns To Elements, Tags, or Files" +msgstr "Étape 2 : Relier les colonnes aux éléments, mots clé ou fichiers" From a4e0e486fc442b4ef4622ac6babd91e47340e6e6 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 15 Sep 2015 11:50:44 +0200 Subject: [PATCH 07/14] Show import logs in admin interface --- CsvImportPlugin.php | 27 +++++++++++ controllers/IndexController.php | 10 +++++ models/CsvImport/Import.php | 8 ++++ models/CsvImport/Log.php | 10 +++++ models/Table/CsvImport/Log.php | 12 +++++ plugin.ini | 2 +- views/admin/index/browse.php | 6 +++ views/admin/index/logs.php | 79 +++++++++++++++++++++++++++++++++ 8 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 models/CsvImport/Log.php create mode 100644 models/Table/CsvImport/Log.php create mode 100644 views/admin/index/logs.php diff --git a/CsvImportPlugin.php b/CsvImportPlugin.php index 20614d5..a92b3ce 100644 --- a/CsvImportPlugin.php +++ b/CsvImportPlugin.php @@ -135,6 +135,18 @@ public function hookInstall() UNIQUE (`item_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); + $db->query(" + CREATE TABLE IF NOT EXISTS `{$db->CsvImport_Log}` ( + `id` int(10) unsigned NOT NULL auto_increment, + `import_id` int(10) unsigned NOT NULL, + `priority` tinyint unsigned NOT NULL, + `created` timestamp DEFAULT CURRENT_TIMESTAMP, + `message` text NOT NULL, + PRIMARY KEY (`id`), + KEY (`import_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + "); + $this->_installOptions(); } @@ -195,6 +207,21 @@ public function hookUpgrade($args) "; $db->query($sql); } + + if (version_compare($oldVersion, '2.0.5', '<=')) { + $sql = " + CREATE TABLE IF NOT EXISTS `{$db->CsvImport_Log}` ( + `id` int(10) unsigned NOT NULL auto_increment, + `import_id` int(10) unsigned NOT NULL, + `priority` tinyint unsigned NOT NULL, + `created` timestamp DEFAULT CURRENT_TIMESTAMP, + `message` text NOT NULL, + PRIMARY KEY (`id`), + KEY (`import_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + "; + $db->query($sql); + } } /** diff --git a/controllers/IndexController.php b/controllers/IndexController.php index ae8e50d..7fa43ea 100644 --- a/controllers/IndexController.php +++ b/controllers/IndexController.php @@ -292,6 +292,16 @@ public function undoImportAction() $this->_helper->redirector->goto('browse'); } + public function logsAction() + { + $db = $this->_helper->db; + $csvImport = $db->findById(); + $logs = $db->getTable('CsvImport_Log')->findByImportId($csvImport->id); + + $this->view->csvImport = $csvImport; + $this->view->logs = $logs; + } + /** * Clear the import history. */ diff --git a/models/CsvImport/Import.php b/models/CsvImport/Import.php index 7e53e07..3b31e49 100644 --- a/models/CsvImport/Import.php +++ b/models/CsvImport/Import.php @@ -846,5 +846,13 @@ protected function _log($msg, $priority = Zend_Log::DEBUG) $prefix = "[CsvImport][#{$this->id}]"; $msg = str_replace('%memory%', memory_get_usage(), $msg); _log("$prefix $msg", $priority); + + $csvImportLog = new CsvImport_Log(); + $csvImportLog->setArray(array( + 'import_id' => $this->id, + 'priority' => $priority, + 'message' => $msg, + )); + $csvImportLog->save(); } } diff --git a/models/CsvImport/Log.php b/models/CsvImport/Log.php new file mode 100644 index 0000000..2af2780 --- /dev/null +++ b/models/CsvImport/Log.php @@ -0,0 +1,10 @@ +getSelect() + ->where('import_id = ?', $importId) + ->order(array('created ASC')); + return $this->fetchObjects($select); + } +} diff --git a/plugin.ini b/plugin.ini index c315ea6..33879ee 100644 --- a/plugin.ini +++ b/plugin.ini @@ -3,7 +3,7 @@ name="CSV Import" author="Roy Rosenzweig Center for History and New Media" description="Imports items, tags, and files from CSV files." link="http://omeka.org/codex/Plugins/CSV_Import_2.0" -version="2.0.5" +version="2.0.6" support_link="http://omeka.org/forums/forum/plugins" license="GPL" omeka_minimum_version="2.0" diff --git a/views/admin/index/browse.php b/views/admin/index/browse.php index b0698d3..e6b4dd1 100644 --- a/views/admin/index/browse.php +++ b/views/admin/index/browse.php @@ -44,9 +44,15 @@ $undoImportUrl = $this->url(array('action' => 'undo-import', 'id' => $csvImport->id), 'default'); + $logsUrl = $this->url(array( + 'action' => 'logs', + 'id' => $csvImport->id + ), 'default'); ?> +
+ isUndone() || $csvImport->isUndoImportError() || diff --git a/views/admin/index/logs.php b/views/admin/index/logs.php new file mode 100644 index 0000000..68ca118 --- /dev/null +++ b/views/admin/index/logs.php @@ -0,0 +1,79 @@ + __('CSV Import'))); ?> + + + +
+

id); ?>

+ + + + + + + + + + + + + + + + + + + + + +
TimePriorityMessage
+ created, Zend_Date::DATE_SHORT)); ?> + created, Zend_Date::TIME_MEDIUM)); ?> + + priority) { + case Zend_Log::EMERG: + $priority = 'EMERGENCY'; + break; + + case Zend_Log::ALERT: + $priority = 'ALERT'; + break; + + case Zend_Log::CRIT: + $priority = 'CRITICAL'; + break; + + case Zend_Log::ERR: + $priority = 'ERROR'; + break; + + case Zend_Log::WARN: + $priority = 'WARNING'; + break; + + case Zend_Log::NOTICE: + $priority = 'NOTICE'; + break; + + case Zend_Log::INFO: + $priority = 'INFO'; + break; + + case Zend_Log::DEBUG: + $priority = 'DEBUG'; + break; + + default: + $priority = ''; + } + echo $priority; + ?> + message); ?>
+ +

+ +
+ + From 77773d7af155296566b83fe80cc6828d13869da4 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 15 Sep 2015 12:12:38 +0200 Subject: [PATCH 08/14] Update translations --- languages/fr.mo | Bin 10194 -> 10687 bytes languages/fr.po | 307 +++++++++++++++++++++++++---------------- languages/template.pot | 196 +++++++++++++++----------- 3 files changed, 303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`lvS6-nk{*A13F{?uky`!x z_UtjD^?Va?j7H4zm@pH{4q3n6bh?*%YQ`}ZAYvHSF}{;bWQQ`}E_}6cPSQ7CHQ^sL U*6WGJt#Oh)49rTT4^_AR4UUCLdH?_b delta 1821 zcmX}sS!@ka9LMp0+uIf`r7L=?*IrAlRg@}Px0cd|Sev#Q+Q!x(wg<^gRALFSTzw!O zBqFf}nNU3Fi>+y>hXlx-Ke19{SlY8cK=FFWr=lsuqrgg=u^3eNaU$apv zsDA4CXtOP9$8w-Ni!(ceZTJJL0`!U>=g2|a~uZX zCDb@Am|+&O*E9yw@deW`Ho+_vGqEpD!T`=e4OD{*upSx9u46yEi@Eq1wV1Cs8cPzr z=WfMh&JW;HY{odow+}Ru==hA>W51D~#WA`}!5{{3EH+>so<S{ z=)SGUTU5JUQ77Y(-6QhCaJ^rN=F26tl}mf>5}M01EEP0K@WwID9R z)i@I`B6GBNs4eQo;rLTVvA`5B0!69BUl-P};Tmv%!~;k=*kOFh4Pku1`9|Vc%y~AM zGafe($0zik9OSKR^im)2@VLDO~D$}ich1ScL#GY)J{Vy z`i9ERKd1*K5SBtr#o4$V58(-1j~P5o6W@ngc@yfv=a8t|Eu4n!s9cF+*;-f%DhWs6 z9KHYJXq3>g88z@t)XeXp_AYLOm;K3D&3O~*L7hk**;iDg;z{XB^y5n0hnm<6R5E@< z=5F7yJc33kC6Xsw(bL!;q03G6;pN(p^`4{_GrbL zv=;KOMAJ|Nv<;eo-Z)KoE_D#&yMrjXG|OTt6LX7JsZcJa2B@V}CCzlIBJ{6ldsLL! zDzVhDZp-^ps;Nj#rSjsqi>yGEP`;=8shmtZml_l4(>txAXz1-wW~-1}Zczd$axwQL97kG3y1e9@&)K9%&pZrL*k?5=I7D+tu@bb=XOvEg_A YfU_%WmCxxITH$kUkGdQk-aBUDUo&T_-~a#s diff --git a/languages/fr.po b/languages/fr.po index 859b213..c926557 100644 --- a/languages/fr.po +++ b/languages/fr.po @@ -1,7 +1,7 @@ # Translation for the Csv Import plugin for Omeka. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the Omeka package. -# +# # Translators: # fiuzzy , 2015 # Isabelle Gilles , 2015 @@ -15,10 +15,10 @@ msgstr "" "PO-Revision-Date: 2015-04-14 19:40+0000\n" "Last-Translator: Isabelle Gilles \n" "Language-Team: French (http://www.transifex.com/omeka/omeka/language/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "Import Items" @@ -61,14 +61,28 @@ msgstr "Arrêté" msgid "Paused" msgstr "En pause" -#: CsvImportPlugin.php:231 views/admin/index/browse.php:2 -#: views/admin/index/index.php:2 views/admin/index/map-columns.php:2 +#: models/CsvImport/File.php:99 +msgid "Please ensure that all column names are unique." +msgstr "Veuillez vous assurer que chaque nom de colonne est unique. " + +#: models/CsvImport/File.php:103 +msgid "" +"Please ensure that the CSV file is formatted correctly and contains the " +"expected number of columns for each row." +msgstr "" +"Veuillez vous assurer que le fichier CSV est correctement formé et qu'il " +"contient le nombre de colonnes attendues pour chaque contenu." + +#: CsvImportPlugin.php:274 views/admin/index/index.php:2 +#: views/admin/index/map-columns.php:2 views/admin/index/logs.php:1 +#: views/admin/index/browse.php:2 msgid "CSV Import" msgstr "CSV Import" #: controllers/IndexController.php:36 msgid "Invalid form input. Please see errors below and try again." -msgstr "Formulaire non valide. Prenez connaissance des erreurs et essayez à nouveau." +msgstr "" +"Formulaire non valide. Prenez connaissance des erreurs et essayez à nouveau." #: controllers/IndexController.php:41 msgid "Error uploading file. Please try again." @@ -78,55 +92,68 @@ msgstr "Chargement du fichier impossible. Merci d'essayer à nouveau." msgid "Your file is incorrectly formatted." msgstr "Votre fichier n'est pas formaté correctement." -#: controllers/IndexController.php:95 +#: controllers/IndexController.php:100 msgid "Import settings expired. Please try again." msgstr "Les paramètres d'importation ont expiré. Merci de réessayer." -#: controllers/IndexController.php:116 +#: controllers/IndexController.php:121 msgid "Invalid form input. Please try again." msgstr "Formulaire non valide. Merci d'essayer à nouveau." -#: controllers/IndexController.php:122 +#: controllers/IndexController.php:127 msgid "Please map at least one column to an element, file, or tag." -msgstr "Veuillez créer l'équivalence pour une colonne au moins vers un élément, fichier ou mot-clé." +msgstr "" +"Veuillez créer l'équivalence pour une colonne au moins vers un élément, " +"fichier ou mot-clé." -#: controllers/IndexController.php:136 controllers/IndexController.php:254 +#: controllers/IndexController.php:141 controllers/IndexController.php:259 msgid "Import started. Reload this page for status updates." msgstr "Import démarré. Recharger cette page pour une mise à jour du statut." -#: controllers/IndexController.php:138 controllers/IndexController.php:256 +#: controllers/IndexController.php:143 controllers/IndexController.php:261 msgid "Import could not be started. Please check error logs for more details." -msgstr "L'import n'a pas démarré. Consultez les logs d'import pour plus de détails." +msgstr "" +"L'import n'a pas démarré. Consultez les logs d'import pour plus de détails." -#: controllers/IndexController.php:174 +#: controllers/IndexController.php:179 #, php-format msgid "" "Invalid column names. Column names must either be one of the following %s, " "or have the following format: {ElementSetName}:{ElementName}" -msgstr "Nom de colonne non valide. Les noms de colonne doivent être parmi : %s, ou avoir le format suivant : {ElementSetName}:{ElementName}" +msgstr "" +"Nom de colonne non valide. Les noms de colonne doivent être parmi : %s, ou " +"avoir le format suivant : {ElementSetName}:{ElementName}" -#: controllers/IndexController.php:190 +#: controllers/IndexController.php:195 #, php-format msgid "Element \"%s\" is not found in element set \"%s\"" msgstr "L'élément \"%s\" n'appartient pas au jeu d'éléments \"%s\"" -#: controllers/IndexController.php:282 +#: controllers/IndexController.php:287 msgid "Undo import started. Reload this page for status updates." -msgstr "Annulation d'import démarrée. Recharger cette page pour une mise à jour du statut." +msgstr "" +"Annulation d'import démarrée. Recharger cette page pour une mise à jour du " +"statut." -#: controllers/IndexController.php:284 +#: controllers/IndexController.php:289 msgid "" "Undo import could not be started. Please check error logs for more details." -msgstr "L'annulation d'import n'a pas démarré. Consultez les logs d'import pour plus de détails." +msgstr "" +"L'annulation d'import n'a pas démarré. Consultez les logs d'import pour plus " +"de détails." -#: controllers/IndexController.php:303 +#: controllers/IndexController.php:318 msgid "Cleared import from the history." msgstr "Historique effacé" -#: controllers/IndexController.php:305 +#: controllers/IndexController.php:320 msgid "Cannot clear import history." msgstr "Impossible d'effacer l'historique." +#: forms/Mapping.php:56 +msgid "Import CSV File" +msgstr "Importer un fichier CSV" + #: forms/Main.php:36 forms/Main.php:50 msgid "Select Item Type" msgstr "Choisir le type de contenu" @@ -147,7 +174,10 @@ msgstr "Aligner automatiquement les noms de colonnes avec les éléments." msgid "" "Automatically maps columns to elements based on their column names. The " "column name must be in the form:
{ElementSetName}:{ElementName}" -msgstr "Aligner automatiquement les noms de colonnes avec les éléments en fonction des titres de colonnes. Les noms de colonne doivent être de la forme :
{ElementSetName}:{ElementName}" +msgstr "" +"Aligner automatiquement les noms de colonnes avec les éléments en fonction " +"des titres de colonnes. Les noms de colonne doivent être de la forme :
" +"{ElementSetName}:{ElementName}" #: forms/Main.php:54 forms/Main.php:57 msgid "Select Collection" @@ -161,155 +191,141 @@ msgstr "Rendre tous les contenus publics ?" msgid "Feature All Items?" msgstr "Mettre en avant tous les contenus ?" -#: forms/Main.php:77 +#: forms/Main.php:67 +msgid "Remove local files after successful import?" +msgstr "" + +#: forms/Main.php:81 msgid "Next" msgstr "Suivant" -#: forms/Main.php:100 +#: forms/Main.php:124 +msgid "Choose Identifier Elements" +msgstr "Sélectionnez les éléments identifiants" + +#: forms/Main.php:125 +msgid "" +"Those elements will be compared to detect if an item already exists in " +"database. If an item already exists, it will be skipped." +msgstr "" +"Ces éléments seront comparés pour détecter is un contenu existe déjà " +"dans la base de données. Si un contenu existe déjà, il sera sauté." + +#: forms/Main.php:142 msgid "comma" msgstr "virgule" -#: forms/Main.php:103 +#: forms/Main.php:145 msgid "semi-colon" msgstr "point-virgule" -#: forms/Main.php:106 +#: forms/Main.php:148 msgid "empty" msgstr "vide" -#: forms/Main.php:120 +#: forms/Main.php:162 msgid "Choose Column Delimiter" msgstr "Choisir le délimiteur de colonne" -#: forms/Main.php:121 +#: forms/Main.php:163 #, php-format msgid "" "A single character that will be used to separate columns in the file (%s by " "default). Note that spaces, tabs, and other whitespace are not accepted." -msgstr "Un caractère unique sera utilisé comme séparateur de colonnes dans le fichier (%s par défaut). Veuillez noter que les espaces, tabulations et caractères vides ne sont pas acceptés." +msgstr "" +"Un caractère unique sera utilisé comme séparateur de colonnes dans le " +"fichier (%s par défaut). Veuillez noter que les espaces, tabulations et " +"caractères vides ne sont pas acceptés." -#: forms/Main.php:132 forms/Main.php:140 forms/Main.php:142 +#: forms/Main.php:174 forms/Main.php:182 forms/Main.php:184 msgid "Column delimiter cannot be whitespace and must be one character long." -msgstr "Le délimiteur de colonnes ne peut être vide et doit contenir un caractère." +msgstr "" +"Le délimiteur de colonnes ne peut être vide et doit contenir un caractère." -#: forms/Main.php:157 +#: forms/Main.php:199 msgid "Choose File Delimiter" msgstr "Choisir le délimiteur de fichier." -#: forms/Main.php:158 +#: forms/Main.php:200 #, php-format msgid "" -"A single character that will be used to separate file paths or URLs within a" -" cell (%s by default). If the delimiter is empty, then the whole text will " -"be used as the file path or URL. Note that spaces, tabs, and other " -"whitespace are not accepted." -msgstr "Un caractère unique sera utilisé pour séparer les chemins vers les fichiers ou leurs URLs à l'intérieur d'une cellule (%s par défaut). Si le délimiteur est vide, la cellule entière sera utilisée comme chemin de fichier ou URL. Veuillez noter que les espaces, tabulations et caractères vides ne sont pas acceptés." +"A single character that will be used to separate file paths or URLs within a " +"cell (%s by default). If the delimiter is empty, then the whole text will be " +"used as the file path or URL. Note that spaces, tabs, and other whitespace " +"are not accepted." +msgstr "" +"Un caractère unique sera utilisé pour séparer les chemins vers les fichiers " +"ou leurs URLs à l'intérieur d'une cellule (%s par défaut). Si le délimiteur " +"est vide, la cellule entière sera utilisée comme chemin de fichier ou URL. " +"Veuillez noter que les espaces, tabulations et caractères vides ne sont pas " +"acceptés." -#: forms/Main.php:170 forms/Main.php:179 forms/Main.php:181 +#: forms/Main.php:212 forms/Main.php:221 forms/Main.php:223 msgid "" -"File delimiter cannot be whitespace, and must be empty or one character " -"long." -msgstr "Le délimiteur de fichier ne peut être vide et doit contenir un caractère." +"File delimiter cannot be whitespace, and must be empty or one character long." +msgstr "" +"Le délimiteur de fichier ne peut être vide et doit contenir un caractère." -#: forms/Main.php:196 +#: forms/Main.php:238 msgid "Choose Tag Delimiter" msgstr "Choisir un délimiteur pour les mots clé" -#: forms/Main.php:197 +#: forms/Main.php:239 #, php-format msgid "" "A single character that will be used to separate tags within a cell (%s by " "default). Note that spaces, tabs, and other whitespace are not accepted." -msgstr "Un caractère unique sera utilisé pour séparer les mots clé à l'intérieur d'une cellule (%s par défaut). Veuillez noter que les espaces, tabulations et caractères vides ne sont pas acceptés." +msgstr "" +"Un caractère unique sera utilisé pour séparer les mots clé à l'intérieur " +"d'une cellule (%s par défaut). Veuillez noter que les espaces, tabulations " +"et caractères vides ne sont pas acceptés." -#: forms/Main.php:208 forms/Main.php:216 forms/Main.php:218 +#: forms/Main.php:250 forms/Main.php:258 forms/Main.php:260 msgid "Tag delimiter cannot be whitespace and must be one character long." -msgstr "Le délimiteur de mot clé ne peut être vide et doit contenir un caractère." +msgstr "" +"Le délimiteur de mot clé ne peut être vide et doit contenir un caractère." -#: forms/Main.php:233 +#: forms/Main.php:275 msgid "Choose Element Delimiter" msgstr "Choisir un délimiteur pour les contenus." -#: forms/Main.php:234 +#: forms/Main.php:276 #, php-format msgid "" "A single character that will be used to separate metadata elements within a " -"cell (%s by default). If the delimiter is empty, then the whole text will be" -" used as the element text. Note that spaces, tabs, and other whitespace are " +"cell (%s by default). If the delimiter is empty, then the whole text will be " +"used as the element text. Note that spaces, tabs, and other whitespace are " "not accepted." -msgstr "Un caractère unique sera utilisé pour séparer les métadonnées à l'intérieur d'une cellule (%s par défaut). Si le délimiteur est vide, la cellule entière sera utilisée comme texte pour l'enregistrement. Veuillez noter que les espaces, tabulations et caractères vides ne sont pas acceptés." +msgstr "" +"Un caractère unique sera utilisé pour séparer les métadonnées à l'intérieur " +"d'une cellule (%s par défaut). Si le délimiteur est vide, la cellule entière " +"sera utilisée comme texte pour l'enregistrement. Veuillez noter que les " +"espaces, tabulations et caractères vides ne sont pas acceptés." -#: forms/Main.php:246 forms/Main.php:255 forms/Main.php:257 +#: forms/Main.php:288 forms/Main.php:297 forms/Main.php:299 msgid "" "Element delimiter cannot be whitespace, and must be empty or one character " "long." -msgstr "Le délimiteur de contenus ne peut être vide et doit contenir un caractère." +msgstr "" +"Le délimiteur de contenus ne peut être vide et doit contenir un caractère." -#: forms/Main.php:291 +#: forms/Main.php:333 msgid "Upload CSV File" msgstr "Charger un fichier CSV" -#: forms/Main.php:295 +#: forms/Main.php:337 #, php-format msgid "Maximum file size is %s." msgstr "La taille maximale du fichier est de %s." -#: forms/Main.php:309 +#: forms/Main.php:351 #, php-format msgid "" "The file you have uploaded exceeds the maximum post size allowed by the " "server. Please upload a file smaller than %s." -msgstr "Le fichier téléchargé dépasse la limite imposée par le serveur. Veuillez charger un fichier de moins de %s." - -#: forms/Mapping.php:56 -msgid "Import CSV File" -msgstr "Importer un fichier CSV" - -#: models/CsvImport/File.php:99 -msgid "Please ensure that all column names are unique." -msgstr "Veuillez vous assurer que chaque nom de colonne est unique. " - -#: models/CsvImport/File.php:103 -msgid "" -"Please ensure that the CSV file is formatted correctly and contains the " -"expected number of columns for each row." -msgstr "Veuillez vous assurer que le fichier CSV est correctement formé et qu'il contient le nombre de colonnes attendues pour chaque contenu." - -#: views/admin/index/browse.php:14 -msgid "Import Date" -msgstr "Date de l'import" - -#: views/admin/index/browse.php:15 -msgid "CSV File" -msgstr "Fichier CSV" - -#: views/admin/index/browse.php:16 -msgid "Imported Items" -msgstr "Contenus importés" - -#: views/admin/index/browse.php:17 -msgid "Skipped Items" -msgstr "Contenus ignorés" - -#: views/admin/index/browse.php:18 -msgid "Skipped Rows" -msgstr "Lignes ignorées" - -#: views/admin/index/browse.php:20 -msgid "Action" -msgstr "Action" - -#: views/admin/index/browse.php:49 -msgid "Undo Import" -msgstr "Annuler l'import" - -#: views/admin/index/browse.php:61 -msgid "Clear History" -msgstr "Effacer l'historique" - -#: views/admin/index/browse.php:71 -msgid "You have no imports yet." -msgstr "Vous n'avez encore aucun import." +msgstr "" +"Le fichier téléchargé dépasse la limite imposée par le serveur. Veuillez " +"charger un fichier de moins de %s." #: views/admin/index/check-omeka-csv.php:2 msgid "CSV Import Errors" @@ -318,14 +334,24 @@ msgstr "Erreur d'importation CSV" #: views/admin/index/check-omeka-csv.php:7 msgid "" "The following problems were found with your CSV file and Omeka installation." -msgstr "Les problèmes suivants ont été détectés dans votre fichier CSV et votre instance d'Omeka." +msgstr "" +"Les problèmes suivants ont été détectés dans votre fichier CSV et votre " +"instance d'Omeka." #: views/admin/index/check-omeka-csv.php:10 msgid "" -"Usually, these are the result of the elements in your Omeka.net site not having \n" -" corresponding elements in this installation of Omeka. Either the Dublin Core Extended plugin is not \n" -" installed, or you created custom item type elements in Omeka.net, but have not yet created them here." -msgstr "D'habitude, l'erreur est causée par des contenus sur votre site hébergé sur Omeka.net qui n'ont pas d'équivalent sur cette instance d'Omeka. Soit l'extension Dublin Core Extended n'est pas installée, soit vous avez défini des types de contenus personnalisés sur votre site Omeka.net qui n'existent pas encore sur cette instance." +"Usually, these are the result of the elements in your Omeka.net site not " +"having \n" +" corresponding elements in this installation of Omeka. Either the Dublin " +"Core Extended plugin is not \n" +" installed, or you created custom item type elements in Omeka.net, but " +"have not yet created them here." +msgstr "" +"D'habitude, l'erreur est causée par des contenus sur votre site hébergé sur " +"Omeka.net qui n'ont pas d'équivalent sur cette instance d'Omeka. Soit " +"l'extension Dublin Core Extended n'est pas installée, soit vous avez défini " +"des types de contenus personnalisés sur votre site Omeka.net qui n'existent " +"pas encore sur cette instance." #: views/admin/index/check-omeka-csv.php:14 msgid "Please correct the errors, then try your import again." @@ -335,6 +361,19 @@ msgstr "Veuillez retenter l'import après avoir corrigé les erreurs." msgid "Step 1: Select File and Item Settings" msgstr "Étape 1 : Choix du fichier et Paramètres des enregistrements" +#: views/admin/index/map-columns.php:6 +msgid "Step 2: Map Columns To Elements, Tags, or Files" +msgstr "Étape 2 : Relier les colonnes aux éléments, mots clé ou fichiers" + +#: views/admin/index/logs.php:6 +#, php-format +msgid "Logs for import #%s" +msgstr "" + +#: views/admin/index/logs.php:73 +msgid "You have no logs yet." +msgstr "Vous n'avez encore aucun log." + #: views/admin/index/map-columns-form.php:9 msgid "Column" msgstr "Colonne" @@ -359,6 +398,42 @@ msgstr "Mots clé ?" msgid "Files?" msgstr "Fichiers ?" -#: views/admin/index/map-columns.php:6 -msgid "Step 2: Map Columns To Elements, Tags, or Files" -msgstr "Étape 2 : Relier les colonnes aux éléments, mots clé ou fichiers" +#: views/admin/index/browse.php:14 +msgid "Import Date" +msgstr "Date de l'import" + +#: views/admin/index/browse.php:15 +msgid "CSV File" +msgstr "Fichier CSV" + +#: views/admin/index/browse.php:16 +msgid "Imported Items" +msgstr "Contenus importés" + +#: views/admin/index/browse.php:17 +msgid "Skipped Items" +msgstr "Contenus ignorés" + +#: views/admin/index/browse.php:18 +msgid "Skipped Rows" +msgstr "Lignes ignorées" + +#: views/admin/index/browse.php:20 +msgid "Action" +msgstr "Action" + +#: views/admin/index/browse.php:53 +msgid "Undo Import" +msgstr "Annuler l'import" + +#: views/admin/index/browse.php:55 +msgid "Logs" +msgstr "Logs" + +#: views/admin/index/browse.php:67 +msgid "Clear History" +msgstr "Effacer l'historique" + +#: views/admin/index/browse.php:77 +msgid "You have no imports yet." +msgstr "Vous n'avez encore aucun import." diff --git a/languages/template.pot b/languages/template.pot index e707b9a..3fc2b4b 100644 --- a/languages/template.pot +++ b/languages/template.pot @@ -56,8 +56,19 @@ msgstr "" msgid "Paused" msgstr "" -#: CsvImportPlugin.php:231 views/admin/index/browse.php:2 -#: views/admin/index/index.php:2 views/admin/index/map-columns.php:2 +#: models/CsvImport/File.php:99 +msgid "Please ensure that all column names are unique." +msgstr "" + +#: models/CsvImport/File.php:103 +msgid "" +"Please ensure that the CSV file is formatted correctly and contains the " +"expected number of columns for each row." +msgstr "" + +#: CsvImportPlugin.php:274 views/admin/index/index.php:2 +#: views/admin/index/map-columns.php:2 views/admin/index/logs.php:1 +#: views/admin/index/browse.php:2 msgid "CSV Import" msgstr "" @@ -73,55 +84,59 @@ msgstr "" msgid "Your file is incorrectly formatted." msgstr "" -#: controllers/IndexController.php:95 +#: controllers/IndexController.php:100 msgid "Import settings expired. Please try again." msgstr "" -#: controllers/IndexController.php:116 +#: controllers/IndexController.php:121 msgid "Invalid form input. Please try again." msgstr "" -#: controllers/IndexController.php:122 +#: controllers/IndexController.php:127 msgid "Please map at least one column to an element, file, or tag." msgstr "" -#: controllers/IndexController.php:136 controllers/IndexController.php:254 +#: controllers/IndexController.php:141 controllers/IndexController.php:259 msgid "Import started. Reload this page for status updates." msgstr "" -#: controllers/IndexController.php:138 controllers/IndexController.php:256 +#: controllers/IndexController.php:143 controllers/IndexController.php:261 msgid "Import could not be started. Please check error logs for more details." msgstr "" -#: controllers/IndexController.php:174 +#: controllers/IndexController.php:179 #, php-format msgid "" "Invalid column names. Column names must either be one of the following %s, " "or have the following format: {ElementSetName}:{ElementName}" msgstr "" -#: controllers/IndexController.php:190 +#: controllers/IndexController.php:195 #, php-format msgid "Element \"%s\" is not found in element set \"%s\"" msgstr "" -#: controllers/IndexController.php:282 +#: controllers/IndexController.php:287 msgid "Undo import started. Reload this page for status updates." msgstr "" -#: controllers/IndexController.php:284 +#: controllers/IndexController.php:289 msgid "" "Undo import could not be started. Please check error logs for more details." msgstr "" -#: controllers/IndexController.php:303 +#: controllers/IndexController.php:318 msgid "Cleared import from the history." msgstr "" -#: controllers/IndexController.php:305 +#: controllers/IndexController.php:320 msgid "Cannot clear import history." msgstr "" +#: forms/Mapping.php:56 +msgid "Import CSV File" +msgstr "" + #: forms/Main.php:36 forms/Main.php:50 msgid "Select Item Type" msgstr "" @@ -156,42 +171,56 @@ msgstr "" msgid "Feature All Items?" msgstr "" -#: forms/Main.php:77 +#: forms/Main.php:67 +msgid "Remove local files after successful import?" +msgstr "" + +#: forms/Main.php:81 msgid "Next" msgstr "" -#: forms/Main.php:100 +#: forms/Main.php:124 +msgid "Choose Identifier Elements" +msgstr "" + +#: forms/Main.php:125 +msgid "" +"Those elements will be compared to detect if an item already exists in " +"database. If an item already exists, it will be skipped." +msgstr "" + +#: forms/Main.php:142 msgid "comma" msgstr "" -#: forms/Main.php:103 +#: forms/Main.php:145 msgid "semi-colon" msgstr "" -#: forms/Main.php:106 +#: forms/Main.php:148 msgid "empty" msgstr "" -#: forms/Main.php:120 +#: forms/Main.php:162 msgid "Choose Column Delimiter" msgstr "" -#: forms/Main.php:121 +#: forms/Main.php:163 #, php-format msgid "" "A single character that will be used to separate columns in the file (%s by " "default). Note that spaces, tabs, and other whitespace are not accepted." msgstr "" -#: forms/Main.php:132 forms/Main.php:140 forms/Main.php:142 +#: forms/Main.php:174 forms/Main.php:182 forms/Main.php:184 msgid "Column delimiter cannot be whitespace and must be one character long." msgstr "" -#: forms/Main.php:157 +#: forms/Main.php:199 msgid "Choose File Delimiter" msgstr "" -#: forms/Main.php:158 +#: forms/Main.php:200 #, php-format msgid "" "A single character that will be used to separate file paths or URLs within a " @@ -200,31 +229,31 @@ msgid "" "are not accepted." msgstr "" -#: forms/Main.php:170 forms/Main.php:179 forms/Main.php:181 +#: forms/Main.php:212 forms/Main.php:221 forms/Main.php:223 msgid "" "File delimiter cannot be whitespace, and must be empty or one character long." msgstr "" -#: forms/Main.php:196 +#: forms/Main.php:238 msgid "Choose Tag Delimiter" msgstr "" -#: forms/Main.php:197 +#: forms/Main.php:239 #, php-format msgid "" "A single character that will be used to separate tags within a cell (%s by " "default). Note that spaces, tabs, and other whitespace are not accepted." msgstr "" -#: forms/Main.php:208 forms/Main.php:216 forms/Main.php:218 +#: forms/Main.php:250 forms/Main.php:258 forms/Main.php:260 msgid "Tag delimiter cannot be whitespace and must be one character long." msgstr "" -#: forms/Main.php:233 +#: forms/Main.php:275 msgid "Choose Element Delimiter" msgstr "" -#: forms/Main.php:234 +#: forms/Main.php:276 #, php-format msgid "" "A single character that will be used to separate metadata elements within a " @@ -233,78 +262,28 @@ msgid "" "not accepted." msgstr "" -#: forms/Main.php:246 forms/Main.php:255 forms/Main.php:257 +#: forms/Main.php:288 forms/Main.php:297 forms/Main.php:299 msgid "" "Element delimiter cannot be whitespace, and must be empty or one character " "long." msgstr "" -#: forms/Main.php:291 +#: forms/Main.php:333 msgid "Upload CSV File" msgstr "" -#: forms/Main.php:295 +#: forms/Main.php:337 #, php-format msgid "Maximum file size is %s." msgstr "" -#: forms/Main.php:309 +#: forms/Main.php:351 #, php-format msgid "" "The file you have uploaded exceeds the maximum post size allowed by the " "server. Please upload a file smaller than %s." msgstr "" -#: forms/Mapping.php:56 -msgid "Import CSV File" -msgstr "" - -#: models/CsvImport/File.php:99 -msgid "Please ensure that all column names are unique." -msgstr "" - -#: models/CsvImport/File.php:103 -msgid "" -"Please ensure that the CSV file is formatted correctly and contains the " -"expected number of columns for each row." -msgstr "" - -#: views/admin/index/browse.php:14 -msgid "Import Date" -msgstr "" - -#: views/admin/index/browse.php:15 -msgid "CSV File" -msgstr "" - -#: views/admin/index/browse.php:16 -msgid "Imported Items" -msgstr "" - -#: views/admin/index/browse.php:17 -msgid "Skipped Items" -msgstr "" - -#: views/admin/index/browse.php:18 -msgid "Skipped Rows" -msgstr "" - -#: views/admin/index/browse.php:20 -msgid "Action" -msgstr "" - -#: views/admin/index/browse.php:49 -msgid "Undo Import" -msgstr "" - -#: views/admin/index/browse.php:61 -msgid "Clear History" -msgstr "" - -#: views/admin/index/browse.php:71 -msgid "You have no imports yet." -msgstr "" - #: views/admin/index/check-omeka-csv.php:2 msgid "CSV Import Errors" msgstr "" @@ -332,6 +311,19 @@ msgstr "" msgid "Step 1: Select File and Item Settings" msgstr "" +#: views/admin/index/map-columns.php:6 +msgid "Step 2: Map Columns To Elements, Tags, or Files" +msgstr "" + +#: views/admin/index/logs.php:6 +#, php-format +msgid "Logs for import #%s" +msgstr "" + +#: views/admin/index/logs.php:73 +msgid "You have no logs yet." +msgstr "" + #: views/admin/index/map-columns-form.php:9 msgid "Column" msgstr "" @@ -356,6 +348,42 @@ msgstr "" msgid "Files?" msgstr "" -#: views/admin/index/map-columns.php:6 -msgid "Step 2: Map Columns To Elements, Tags, or Files" +#: views/admin/index/browse.php:14 +msgid "Import Date" +msgstr "" + +#: views/admin/index/browse.php:15 +msgid "CSV File" +msgstr "" + +#: views/admin/index/browse.php:16 +msgid "Imported Items" +msgstr "" + +#: views/admin/index/browse.php:17 +msgid "Skipped Items" +msgstr "" + +#: views/admin/index/browse.php:18 +msgid "Skipped Rows" +msgstr "" + +#: views/admin/index/browse.php:20 +msgid "Action" +msgstr "" + +#: views/admin/index/browse.php:53 +msgid "Undo Import" +msgstr "" + +#: views/admin/index/browse.php:55 +msgid "Logs" +msgstr "" + +#: views/admin/index/browse.php:67 +msgid "Clear History" +msgstr "" + +#: views/admin/index/browse.php:77 +msgid "You have no imports yet." msgstr "" From 554b0308b9f54db3b0d948d5c639a9d3deefe06f Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 15 Sep 2015 12:20:40 +0200 Subject: [PATCH 09/14] Update translations --- languages/fr.mo | Bin 10687 -> 10918 bytes languages/fr.po | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/languages/fr.mo b/languages/fr.mo index 267e6166ab39b4d2b8a2d3af9b7151974718ec2e..e435f384bb139deb35e00c138e331c5fb6979d93 100644 GIT binary patch delta 2095 zcmYk-TWl0n9LMp0ORsC8rP88cW!h4Ty>e?y)ov-5fC$F}$b*FApmbNkAil4~lnrGL60{1|u;VF)?1gznQ6elK*_pna-T+f41*L zUK+_wRTn*Llx@Uy#7Bi@Iowmsg|e&E>;OKDzu~Mhv!AiJ+-yHy!4ljXG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))9K&*w5|qcV;t5ZZQ2Ut9$Oc26P9ot!VG+YqtQ#R>NuB!o-4;jtifDt!~WQl z#-lM0yJI27(!b5)L@Tf?a>E8xLyf3`g)kfU<1l=PE78-%Y&_PZ?rTOpcLBB3H<6z` z=Ah@^AY-;f{?x=$F{lTJaiS4sqi$S)Y_n~_0^Eg4hiAAJ+i)6Iv5uO+5md*41h?Z% zRL6NZ6)SKY9ze!!Pf%O-Hi5^}IQc?Fn#U}G4cAJHWuvrLl^pc{Qq%x8N8Eu*sy+CC z=Z@kPuItIDLawuDBokNlGP^_lAreXxU6N#$kIV5gHYYKBjl7PORD)|!0|;U&?!y#p z#lhGXsrU7DuQMW6qms1&m0Tgz3O3<%Y(~8eKT&({?dRr3pCBi?VGd5j6UaUG8Z~oI zvb)s%Q3I?;CTZ(YOS~J^aTBr#)`~OmAx^?Tz^oJ(p$2veHIP=^h{4;OXaMC*b0qFX zW$9hi3fxCE{0#@8pGwVa1d`Y`4%J{8Y63HH0&d4fyoZahn%QUq7f>s318FyC&p2Uw z>@$u*f4ZAQd8ipyqV{ev=3yNc;Yn1-pHLI{j@rsXGI=Fd;6l8CJ282H+g=NjZgvY3 zmA+3onNP(>tijTO?g$T}vh_SNdAp4j9JiFU*k zLZyUAR{yNJ^A)Q`a>e;jRADAjNbm|fMIWX=MTw*&V`ZJUWDsiavj~#P#u6&IF3xc> z#}s0?bLGBOQ#JJ=R45^eBYy~T#`)xqh}7}DaFQ?-;~yD5?fdErpNnhogy+V`#)lhH M{ZZj->F>S20nd=79smFU diff --git a/languages/fr.po b/languages/fr.po index c926557..20b5711 100644 --- a/languages/fr.po +++ b/languages/fr.po @@ -193,7 +193,7 @@ msgstr "Mettre en avant tous les contenus ?" #: forms/Main.php:67 msgid "Remove local files after successful import?" -msgstr "" +msgstr "Supprimer les fichiers locaux après un import réussi?" #: forms/Main.php:81 msgid "Next" @@ -368,7 +368,7 @@ msgstr "Étape 2 : Relier les colonnes aux éléments, mots clé ou fichiers" #: views/admin/index/logs.php:6 #, php-format msgid "Logs for import #%s" -msgstr "" +msgstr "Logs pour l'import #%s" #: views/admin/index/logs.php:73 msgid "You have no logs yet." From ba69df3f4324f1b7037b6174d819761ff5126075 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 16 Sep 2015 15:31:30 +0200 Subject: [PATCH 10/14] Log number of skipped items --- models/CsvImport/Import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/CsvImport/Import.php b/models/CsvImport/Import.php index 3b31e49..dc3ebe8 100644 --- a/models/CsvImport/Import.php +++ b/models/CsvImport/Import.php @@ -372,7 +372,7 @@ public function complete() $this->status = self::COMPLETED; $this->save(); $this->_log("Completed importing $this->_importedCount items (skipped " - . "$this->skipped_row_count rows)."); + . "$this->skipped_item_count items, $this->skipped_row_count rows)."); return true; } From e69b17814d7ec0c07e42c7a1b7aa269ae21be738 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 16 Sep 2015 17:14:40 +0200 Subject: [PATCH 11/14] Translate log messages (french) --- CsvImportPlugin.php | 8 ++ languages/fr.mo | Bin 10918 -> 14390 bytes languages/fr.po | 144 +++++++++++++++++++++++++++++++++++- languages/template.base.pot | 101 +++++++++++++++++++++++++ languages/template.pot | 120 +++++++++++++++++++++++++++++- models/CsvImport/Import.php | 53 ++++++------- models/CsvImport/Log.php | 1 + plugin.ini | 2 +- views/admin/index/logs.php | 17 ++++- 9 files changed, 410 insertions(+), 36 deletions(-) diff --git a/CsvImportPlugin.php b/CsvImportPlugin.php index a92b3ce..be881d5 100644 --- a/CsvImportPlugin.php +++ b/CsvImportPlugin.php @@ -222,6 +222,14 @@ public function hookUpgrade($args) "; $db->query($sql); } + + if (version_compare($oldVersion, '2.0.6', '<=')) { + $sql = " + ALTER TABLE `{$db->CsvImport_Log}` + ADD COLUMN `params` text DEFAULT NULL + "; + $db->query($sql); + } } /** diff --git a/languages/fr.mo b/languages/fr.mo index e435f384bb139deb35e00c138e331c5fb6979d93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q~h_y|H!MWy7@dYQ=fiY6ct6*XLUpBS7$OO4nC%GuV zWUj5xQQ?2SLDOn->I+a!Y$Vr{8%RY&`=1xI{i;>7nbd!%B2pFm|DXi?z0);)9opZS zVB7tuUk2g{BsN;5) zzUBQ{TH{1FXLe?G4p=~}|Nem?_wMqfJ6%5HKE7}uZ_AEBcRJGH9ayy9@y=FEguNH5 zb~tW#{5!WdG2&fJoOaxAlb5|8Q=^W%yROnbQ`hS5t$)nDwPDstatus = self::COMPLETED; $this->save(); - $this->_log("Completed importing $this->_importedCount items (skipped " - . "$this->skipped_item_count items, $this->skipped_row_count rows)."); + $this->_log('Completed importing %1$s items (skipped %2$s items, %3$s rows).', + array($this->_importedCount, $this->skipped_item_count, $this->skipped_row_count)); return true; } @@ -442,14 +442,16 @@ public function stop() // The import or undo import loop was prematurely stopped $logMsg = "Stopped import or undo import due to error"; + $logParams = array(); if ($error = error_get_last()) { - $logMsg .= ": " . $error['message']; + $logMsg .= ": %s"; + $logParams[] = $error['message']; } else { $logMsg .= '.'; } $this->status = self::STOPPED; $this->save(); - $this->_log($logMsg, Zend_Log::ERR); + $this->_log($logMsg, $logParams, Zend_Log::ERR); return true; // stopped with an error } @@ -609,7 +611,8 @@ protected function _importLoop($startAt = null) $rows->seek($startAt); } $rows->skipInvalidRows(true); - $this->_log("Running item import loop. Memory usage: %memory%"); + $this->_log("Running item import loop. Memory usage: %s", + array(memory_get_usage())); while ($rows->valid()) { $row = $rows->current(); $index = $rows->key(); @@ -618,12 +621,11 @@ protected function _importLoop($startAt = null) release_object($item); } else { $this->skipped_item_count++; - $this->_log("Skipped item on row #{$index}.", Zend_Log::WARN); + $this->_log("Skipped item on row #%s", array($index), Zend_Log::WARN); } $this->file_position = $this->getCsvFile()->getIterator()->tell(); if ($this->_batchSize && ($index % $this->_batchSize == 0)) { - $this->_log("Completed importing batch of $this->_batchSize " - . "items. Memory usage: %memory%"); + $this->_log('Completed importing batch of %1$s items. Memory usage %2$s', array($this->_batchSize, memory_get_usage())); return $this->queue(); } $rows->next(); @@ -637,7 +639,7 @@ protected function _importLoop($startAt = null) } catch (Exception $e) { $this->status = self::IMPORT_ERROR; $this->save(); - $this->_log($e, Zend_Log::ERR); + $this->_log($e, array(), Zend_Log::ERR); throw $e; } } @@ -677,8 +679,7 @@ protected function _undoImportLoop() if ($batchSize > 0 && $deletedItemCount == $batchSize) { $inClause = 'IN (' . join(', ', $deletedItemIds) . ')'; $db->delete($db->CsvImport_ImportedItem, "`item_id` $inClause"); - $this->_log("Completed undoing the import of a batch of $batchSize " - . "items. Memory usage: %memory%"); + $this->_log('Completed undoing the import of a batch of %1$s items. Memory usage: %2$s', array($batchSize, memory_get_usage())); return $this->queueUndo(); } } @@ -694,7 +695,7 @@ protected function _undoImportLoop() } catch (Exception $e) { $this->status = self::UNDO_IMPORT_ERROR; $this->save(); - $this->_log($e, Zend_Log::ERR); + $this->_log($e, array(), Zend_Log::ERR); throw $e; } } @@ -757,42 +758,44 @@ protected function _addItemFromRow($row) }); $existing_items = $this->_findItemsByElementTexts($identifierElementTexts); if ($existing_items) { - $this->_log("Found similar items: " . implode(", ", $existing_items), Zend_Log::WARN); - $this->_log("Identifier Element Texts:\n" . var_export($identifierElementTexts, true), Zend_Log::WARN); + $this->_log("Found similar items: %s", array(implode(", ", $existing_items)), Zend_Log::WARN); + $this->_log("Identifier Element Texts:\n%s", array(var_export($identifierElementTexts, true)), Zend_Log::WARN); return false; } try { $item = insert_item($itemMetadata, $elementTexts); } catch (Omeka_Validator_Exception $e) { - $this->_log($e, Zend_Log::ERR); + $this->_log($e, array(), Zend_Log::ERR); return false; } catch (Omeka_Record_Builder_Exception $e) { - $this->_log($e, Zend_Log::ERR); + $this->_log($e, array(), Zend_Log::ERR); return false; } $fileUrls = $result[CsvImport_ColumnMap::TYPE_FILE]; foreach ($fileUrls as $url) { $successfulTransferStrategy = null; + $logMsg = null; + $logParams = array(); foreach (array('Url', 'Filesystem') as $transferStrategy) { try { $file = insert_files_for_item($item, $transferStrategy, $url, array('ignore_invalid_files' => false)); } catch (Omeka_File_Ingest_InvalidException $e) { - $msg = "Invalid file URL '$url': " - . $e->getMessage(); + $logMsg = 'Invalid file URL "%1$s": %2$s'; + $logParams = array($url, $e->getMessage()); continue; } catch (Omeka_File_Ingest_Exception $e) { - $msg = "Could not import file '$url': " - . $e->getMessage(); + $logMsg = 'Could not import file "%1$s": %2$s'; + $logParams = array($url, $e->getMessage()); continue; } $successfulTransferStrategy = $transferStrategy; break; } if (!isset($file)) { - $this->_log($msg, Zend_Log::ERR); + $this->_log($logMsg, $logParams, Zend_Log::ERR); $item->delete(); release_object($item); return false; @@ -807,7 +810,7 @@ protected function _addItemFromRow($row) if ($this->remove_local_files) { foreach ($localFiles as $localFile) { if(!unlink($localFile)) { - $this->_log("Failed to remove file $localFile", Zend_Log::ERR); + $this->_log("Failed to remove file %s", array($localFile), Zend_Log::ERR); } } } @@ -836,15 +839,14 @@ protected function _recordImportedItemId($itemId) /** * Log an import message * Every message will log the import ID. - * Messages that have %memory% will include memory usage information. * * @param string $msg The message to log + * @param array $params Params to pass the translation function __() * @param int $priority The priority of the message */ - protected function _log($msg, $priority = Zend_Log::DEBUG) + protected function _log($msg, $params = array(), $priority = Zend_Log::DEBUG) { $prefix = "[CsvImport][#{$this->id}]"; - $msg = str_replace('%memory%', memory_get_usage(), $msg); _log("$prefix $msg", $priority); $csvImportLog = new CsvImport_Log(); @@ -852,6 +854,7 @@ protected function _log($msg, $priority = Zend_Log::DEBUG) 'import_id' => $this->id, 'priority' => $priority, 'message' => $msg, + 'params' => serialize($params), )); $csvImportLog->save(); } diff --git a/models/CsvImport/Log.php b/models/CsvImport/Log.php index 2af2780..34972f7 100644 --- a/models/CsvImport/Log.php +++ b/models/CsvImport/Log.php @@ -7,4 +7,5 @@ class CsvImport_Log extends Omeka_Record_AbstractRecord public $priority; public $created; public $message; + public $params; } diff --git a/plugin.ini b/plugin.ini index 33879ee..f0efa8a 100644 --- a/plugin.ini +++ b/plugin.ini @@ -3,7 +3,7 @@ name="CSV Import" author="Roy Rosenzweig Center for History and New Media" description="Imports items, tags, and files from CSV files." link="http://omeka.org/codex/Plugins/CSV_Import_2.0" -version="2.0.6" +version="2.0.7" support_link="http://omeka.org/forums/forum/plugins" license="GPL" omeka_minimum_version="2.0" diff --git a/views/admin/index/logs.php b/views/admin/index/logs.php index 68ca118..e807206 100644 --- a/views/admin/index/logs.php +++ b/views/admin/index/logs.php @@ -11,9 +11,9 @@ - - - + + + @@ -64,7 +64,16 @@ echo $priority; ?> - + From 0f0d4da9c3aa32b431f90077a4e22b6dcafb93f9 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 17 Sep 2015 15:41:29 +0200 Subject: [PATCH 12/14] Fix a string translation (french) --- languages/fr.mo | Bin 14390 -> 14400 bytes languages/fr.po | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/fr.mo b/languages/fr.mo index 4828136e2009b6188657eced9e4a9f31c057f5ae..f0a60e46ff6c9e4618517c0675b68ed174db90ad 100644 GIT binary patch delta 765 zcmYk(K}gea6u|K(OwEP5TFsEu|J){9ZnMocb6Q~*7G=XAhA3gguz}nDYzy%qf5IRH z5$sk6FCIkb5G?W*nuo%BAR%^7J4IdA!S7=pI(^>z{U86|d++zr+%n(q+pLEoVhf1e z!xT>98g`;w5($9^6F7#WxP;g6JGSA4?rMD;J>=tfALr4IyXeDj*n$;wpff0zoFniC zMb2YCKENd2z*QW<13ZgebaM*(@g?3wFMh#MJi;g@!VHC3bYTH?pheVs-k~2qhb@tM zfSoqX+{QlgAE^ItiHKap zE{i}X9Y*bJ0bB76#_$84!Jp{Bf9S?W#?=@GaJ2kZ!brC^~T%_32VLfiw6BzoKrSJucFWG1P`{W3onM z8V&MI*1?84WsiVu%U{$d@LjFGT?iY=qvg5!*X}!|bRnC`?QA3rU&LE9p5}9o@kqoXX@W?nn~22dxfm=q5{aaO zg)}ir#K302CKwpZz9;SUIp^M+`#-<)kA*M8=P#+opopZpM20YgQ+SAW{KG~puNUdW zAck-Qd+-q}(cBRK-i;3WQ5?n<%)%Jf;ysq(59VX0TMQ|tu((A^(2FBDfPHv?L43kO zv@%TwdT|r|Sc5kh!gp-JCJ&)-0ZVZSHIRXN&M`Xi+GB{ADBgIWexMnDP!AGsJZUC& z(*|)1H*pqonn;1ms7cpR58OcA%wfVS^wB?~{y(>wFlaR>G-&{JvItsm8{6>|3-A^5 z@fWKxg_!!h7OT*Q={SMCID`Fogc{@>yYMsdzOFUCF=LS;n->=t#u(0EbDPL6?qC|) znMMb2Vi5*VuP%g>IFI9ai@Jg04v{=;KpnUXN0UUR(MEs9I@pk19w^whe4$=Jg+G3G k4$P%@MkA)Z>is)cd9uy9?{`^Eww1ZH)w`4EnCsj859Byg7XSbN diff --git a/languages/fr.po b/languages/fr.po index 2be457c..cf6e7d6 100644 --- a/languages/fr.po +++ b/languages/fr.po @@ -70,7 +70,7 @@ msgstr "Impossible de terminer un import déjà terminé." #, php-format msgid "Completed importing %1$s items (skipped %2$s items, %3$s rows)." msgstr "" -"Import de %1$s contenus terminé (%2$s contenus et %3$s lignes sautés)." +"Import terminé: %1$s contenus importés (ignorés: %2$s contenus et %3$s lignes)." msgid "Cannot complete an undo import that is already undone." msgstr "Impossible de terminer l'annulation d'un import déjà annulé." From 724b39426a8fe475f0299ac66be8defc7e7d6340 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Sep 2015 00:00:00 +0200 Subject: [PATCH 13/14] Fixed table definition. --- CsvImportPlugin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CsvImportPlugin.php b/CsvImportPlugin.php index be881d5..60fe0c4 100644 --- a/CsvImportPlugin.php +++ b/CsvImportPlugin.php @@ -142,6 +142,7 @@ public function hookInstall() `priority` tinyint unsigned NOT NULL, `created` timestamp DEFAULT CURRENT_TIMESTAMP, `message` text NOT NULL, + `params` text DEFAULT NULL, PRIMARY KEY (`id`), KEY (`import_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -185,8 +186,8 @@ public function hookUpgrade($args) set_option(CsvImport_ColumnMap_Element::ELEMENT_DELIMITER_OPTION_NAME, CsvImport_ColumnMap_Element::DEFAULT_ELEMENT_DELIMITER); set_option(CsvImport_ColumnMap_Tag::TAG_DELIMITER_OPTION_NAME, CsvImport_ColumnMap_Tag::DEFAULT_TAG_DELIMITER); set_option(CsvImport_ColumnMap_File::FILE_DELIMITER_OPTION_NAME, CsvImport_ColumnMap_File::DEFAULT_FILE_DELIMITER); - } - + } + if(version_compare($oldVersion, '2.0.1', '<=')) { $sql = "ALTER TABLE `{$db->prefix}csv_import_imports` CHANGE `item_type_id` `item_type_id` INT( 10 ) UNSIGNED NULL , CHANGE `collection_id` `collection_id` INT( 10 ) UNSIGNED NULL From f863b5998a11d073a653dd8fe069970665f4b0e3 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 21 Sep 2015 00:00:00 +0200 Subject: [PATCH 14/14] Added a link to logs for all imports. --- views/admin/index/browse.php | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/views/admin/index/browse.php b/views/admin/index/browse.php index e6b4dd1..cf026dc 100644 --- a/views/admin/index/browse.php +++ b/views/admin/index/browse.php @@ -11,7 +11,7 @@ - - - + + getImportedItemCount(); ?> @@ -43,16 +56,10 @@ url(array('action' => 'undo-import', 'id' => $csvImport->id), - 'default'); - $logsUrl = $this->url(array( - 'action' => 'logs', - 'id' => $csvImport->id - ), 'default'); + 'default'); ?> isUndone() || $csvImport->isUndoImportError() ||
TimePriorityMessage
message); ?> + message); + $params = unserialize($log->params); + if (is_array($params)) { + $param_arr = array_merge($param_arr, $params); + } + echo html_escape(call_user_func_array('__', $param_arr)); + ?> +
added, Zend_Date::DATETIME_SHORT)); ?>
+ added, Zend_Date::DATETIME_SHORT)); + $logs = get_db()->getTable('CsvImport_Log')->findByImportId($csvImport->id); + if (empty($logs)): + echo $importDate; + else: + $logsUrl = $this->url(array( + 'action' => 'logs', + 'id' => $csvImport->id + ), 'default'); + ?> + + + original_filename); ?> - -
- +