diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..293e9227e Binary files /dev/null and b/.DS_Store differ diff --git "a/Icon\r" "b/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/Icon\r" "b/cypress/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/fixtures/Icon\r" "b/cypress/fixtures/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/integration/Icon\r" "b/cypress/integration/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/integration/repository/Icon\r" "b/cypress/integration/repository/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/integration/repository/collection/Icon\r" "b/cypress/integration/repository/collection/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/integration/repository/collection/field/Icon\r" "b/cypress/integration/repository/collection/field/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/integration/tests-collection/Icon\r" "b/cypress/integration/tests-collection/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/integration/tests-collection/field/Icon\r" "b/cypress/integration/tests-collection/field/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/plugins/Icon\r" "b/cypress/plugins/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/cypress/support/Icon\r" "b/cypress/support/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/docs/Icon\r" "b/docs/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 000000000..f676fd4ad Binary files /dev/null and b/src/.DS_Store differ diff --git "a/src/Icon\r" "b/src/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/Icon\r" "b/src/admin/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/admin/admin.vue b/src/admin/admin.vue index 48221a54f..0df27e967 100644 --- a/src/admin/admin.vue +++ b/src/admin/admin.vue @@ -55,6 +55,11 @@ height: 100%; margin-bottom: 0px; margin-top: 0px; + + + @media screen and (max-width: 769px) { + height: auto; + } } .is-main-content { @@ -65,9 +70,7 @@ height: 100%; @media screen and (max-width: 769px) { - & { - overflow-y: visible; - } + overflow-y: visible; } .columns { margin-left: 0px; @@ -83,9 +86,10 @@ height: calc(100% - 53px); @media screen and (max-width: 769px) { - & { - overflow-y: visible; - } + + overflow-y: visible; + margin: 0 auto; + } .columns { diff --git "a/src/admin/components/Icon\r" "b/src/admin/components/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/components/edition/Icon\r" "b/src/admin/components/edition/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/admin/components/edition/item-edition-form.vue b/src/admin/components/edition/item-edition-form.vue index e3437f3e7..8615ce6ae 100644 --- a/src/admin/components/edition/item-edition-form.vue +++ b/src/admin/components/edition/item-edition-form.vue @@ -468,6 +468,11 @@ export default { this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type }) .then((item) => { this.item.document_as_html = item.document_as_html; + + let oldThumbnail = this.item.thumbnail; + if (item.document_type == 'attachment' && oldThumbnail != item.thumbnail ) + this.item.thumbnail = item.thumbnail; + }) .catch(error => this.$console.error(error)); } diff --git "a/src/admin/components/lists/Icon\r" "b/src/admin/components/lists/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/components/navigation/Icon\r" "b/src/admin/components/navigation/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/admin/components/navigation/primary-menu.vue b/src/admin/components/navigation/primary-menu.vue index ccb87e7f3..4b25cfb9a 100644 --- a/src/admin/components/navigation/primary-menu.vue +++ b/src/admin/components/navigation/primary-menu.vue @@ -11,7 +11,7 @@
  • + :class="activeRoute == 'CollectionsPage' || $route.params.collectionId != undefined ? 'is-active':''"> {{ $i18n.getFrom('collections', 'name') }} @@ -132,11 +132,10 @@ export default { @media screen and (max-width: 769px) { width: 100% !important; max-width: 100% !important; - - .menu-header { - height: 60px; + padding-top: $header-height; + .menu{ + padding-top: 0px; } - ul { flex-flow: wrap; display: flex; @@ -147,6 +146,9 @@ export default { padding: 0.8em !important; text-align: center; } + .menu-text { + display: none; + } } } } diff --git a/src/admin/components/navigation/tainacan-header.vue b/src/admin/components/navigation/tainacan-header.vue index ac9e2136f..2f6b0abc1 100644 --- a/src/admin/components/navigation/tainacan-header.vue +++ b/src/admin/components/navigation/tainacan-header.vue @@ -146,20 +146,21 @@ export default { } @media screen and (max-width: 769px) { + padding: 0px; + display: flex; .level-left { + display: inline-block; margin-left: 0px !important; .level-item { - margin-left: 30px; + margin-left: 0px; } } .level-right { - display: none; + margin-top: 0; + display: inline-block; } - top: 206px; - &.menu-compressed { - top: 237px !important; - } + top: 0px; margin-bottom: 0px !important; } diff --git a/src/admin/components/navigation/tainacan-subheader.vue b/src/admin/components/navigation/tainacan-subheader.vue index fbd7784ac..5d88a9bf6 100644 --- a/src/admin/components/navigation/tainacan-subheader.vue +++ b/src/admin/components/navigation/tainacan-subheader.vue @@ -103,7 +103,7 @@ export default { id: Number }, watch: { - '$route.path' (to) { + '$route' (to, from) { this.activeRoute = to.name; @@ -282,11 +282,16 @@ export default { @media screen and (max-width: 769px) { width: 100% !important; max-width: 100% !important; + height: 143px; + max-height: 143px; + ul { + margin-top: 12px; flex-flow: wrap; display: flex; - align-items: stretch; - justify-content: space-evenly; + align-items: baseline; + justify-content: space-between; + a { padding: 0.5em 0.7em !important; text-align: center; @@ -295,9 +300,7 @@ export default { padding-left: 0.3em !important; } } - } - - @media screen and (max-width: 769px) { + .level-left { margin-left: 0px !important; .level-item { diff --git "a/src/admin/components/other/Icon\r" "b/src/admin/components/other/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/components/other/event/Icon\r" "b/src/admin/components/other/event/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/components/other/event/diff-exhibition/Icon\r" "b/src/admin/components/other/event/diff-exhibition/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/components/other/event/unique-exhibition/Icon\r" "b/src/admin/components/other/event/unique-exhibition/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/components/search/Icon\r" "b/src/admin/components/search/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/admin/components/search/search-control.vue b/src/admin/components/search/search-control.vue index 6926c523a..bcdaf5788 100644 --- a/src/admin/components/search/search-control.vue +++ b/src/admin/components/search/search-control.vue @@ -117,6 +117,9 @@ .header-item { display: inline-block; } + .header-item .field { + align-items: center; + } #item-creation-options-dropdown { margin-right: 80px; } diff --git "a/src/admin/images/Icon\r" "b/src/admin/images/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/js/Icon\r" "b/src/admin/js/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/pages/Icon\r" "b/src/admin/pages/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/pages/lists/Icon\r" "b/src/admin/pages/lists/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/admin/pages/lists/items-page.vue b/src/admin/pages/lists/items-page.vue index efe514e8c..6dcb914f4 100644 --- a/src/admin/pages/lists/items-page.vue +++ b/src/admin/pages/lists/items-page.vue @@ -333,8 +333,7 @@ @media screen and (max-width: 769px) { height: 60px; - margin-top: -0.5em; - padding-top: 0.90em; + margin-top: 0; .header-item { padding-right: 0.5em; @@ -385,12 +384,10 @@ } @media screen and (max-width: 769px) { - .filters-menu { - display: none; - } + .table-container { margin-right: 0; - padding: .85em 0em; + padding: 16px; } } diff --git "a/src/admin/pages/singles/Icon\r" "b/src/admin/pages/singles/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/admin/scss/Icon\r" "b/src/admin/scss/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/admin/scss/_variables.scss b/src/admin/scss/_variables.scss index 4cb735f3c..5fd0b99db 100644 --- a/src/admin/scss/_variables.scss +++ b/src/admin/scss/_variables.scss @@ -68,7 +68,7 @@ $page-small-side-padding: 22px; $page-small-top-padding: 22px; $page-mobile-side-padding: 1em; -$page-mobile-top-padding: 0.5em; +$page-mobile-top-padding: 1em; // Links $link: $secondary; diff --git a/src/admin/scss/tainacan-admin.scss b/src/admin/scss/tainacan-admin.scss index 72f7dcc7d..ec4455719 100644 --- a/src/admin/scss/tainacan-admin.scss +++ b/src/admin/scss/tainacan-admin.scss @@ -52,6 +52,10 @@ html { .primary-page { margin-top: $header-height; height: $page-height !important; + + @media screen and (max-width: 769px) { + margin-top: 0; + } } .page-container { padding: $page-top-padding $page-side-padding; diff --git a/src/admin/tainacan-admin-i18n.php b/src/admin/tainacan-admin-i18n.php index c97b593ed..0a41024aa 100644 --- a/src/admin/tainacan-admin-i18n.php +++ b/src/admin/tainacan-admin-i18n.php @@ -6,12 +6,12 @@ return [ 'collections' => __( 'Collections', 'tainacan' ), 'items' => __( 'Items', 'tainacan' ), 'fields' => __( 'Fields', 'tainacan' ), - 'filters' => __( 'Filters', 'tainacan' ), + 'filters' => __( 'Metadata', 'tainacan' ), 'categories' => __( 'Categories', 'tainacan' ), 'events' => __( 'Events', 'tainacan' ), 'collection' => __( 'Collection', 'tainacan' ), 'item' => __( 'Item', 'tainacan' ), - 'field' => __( 'Field', 'tainacan' ), + 'field' => __( 'Metadata', 'tainacan' ), 'filter' => __( 'Filter', 'tainacan' ), 'category' => __( 'Category', 'tainacan' ), 'event' => __( 'Event', 'tainacan' ), @@ -178,7 +178,7 @@ return [ 'instruction_select_a_filter_type' => __( 'Select a filter type:', 'tainacan' ), 'instruction_select_a_parent_term' => __( 'Select a parent term:', 'tainacan' ), 'instruction_cover_page' => __( 'Type to search a Page to choose.', 'tainacan'), - 'instruction_moderators' => __( 'Type to search a User to add.', 'tainacan'), + 'instruction_moderators' => __( 'Type to search a User to add.', 'tainacan'), 'instruction_select_a_parent_collection' => __( 'Select a parent colection.', 'tainacan' ), 'instruction_select_collection_thumbnail' => __( 'Select a thumbnail image for collection', 'tainacan' ), 'instruction_select_item_thumbnail' => __( 'Select a thumbnail image for item', 'tainacan' ), @@ -258,4 +258,4 @@ return [ 'tainacan-filter-category-checkbox' => __( 'Category Check Box', 'tainacan' ), 'tainacan-filter-category-selectbox' => __( 'Category Select Box', 'tainacan' ) ] -?> \ No newline at end of file +?> diff --git "a/src/api/Icon\r" "b/src/api/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/api/endpoints/Icon\r" "b/src/api/endpoints/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/assets/Icon\r" "b/src/assets/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/assets/css/Icon\r" "b/src/assets/css/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/assets/css/fonts/Icon\r" "b/src/assets/css/fonts/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/Icon\r" "b/src/classes/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/entities/Icon\r" "b/src/classes/entities/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/Icon\r" "b/src/classes/field-types/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/category/Icon\r" "b/src/classes/field-types/category/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/compound/Icon\r" "b/src/classes/field-types/compound/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/core-description/Icon\r" "b/src/classes/field-types/core-description/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/core-title/Icon\r" "b/src/classes/field-types/core-title/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/date/Icon\r" "b/src/classes/field-types/date/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/field-type/Icon\r" "b/src/classes/field-types/field-type/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/numeric/Icon\r" "b/src/classes/field-types/numeric/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/relationship/Icon\r" "b/src/classes/field-types/relationship/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/selectbox/Icon\r" "b/src/classes/field-types/selectbox/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/text/Icon\r" "b/src/classes/field-types/text/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/field-types/textarea/Icon\r" "b/src/classes/field-types/textarea/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/filter-types/Icon\r" "b/src/classes/filter-types/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/filter-types/autocomplete/Icon\r" "b/src/classes/filter-types/autocomplete/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/filter-types/category/Icon\r" "b/src/classes/filter-types/category/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/filter-types/checkbox/Icon\r" "b/src/classes/filter-types/checkbox/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/filter-types/custom-interval/Icon\r" "b/src/classes/filter-types/custom-interval/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/filter-types/filter-type/Icon\r" "b/src/classes/filter-types/filter-type/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/filter-types/selectbox/Icon\r" "b/src/classes/filter-types/selectbox/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/filter-types/taginput/Icon\r" "b/src/classes/filter-types/taginput/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/repositories/Icon\r" "b/src/classes/repositories/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/classes/traits/Icon\r" "b/src/classes/traits/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/dev-interface/Icon\r" "b/src/dev-interface/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/exposers/Icon\r" "b/src/exposers/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/exposers/mappers/Icon\r" "b/src/exposers/mappers/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/exposers/types/Icon\r" "b/src/exposers/types/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/helpers/Icon\r" "b/src/helpers/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/importer/Icon\r" "b/src/importer/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/importer/class-tainacan-importer.php b/src/importer/class-tainacan-importer.php index f7a847a29..ee8eb1266 100644 --- a/src/importer/class-tainacan-importer.php +++ b/src/importer/class-tainacan-importer.php @@ -354,6 +354,15 @@ abstract class Importer { $this->steps =$steps; } + public function is_finished() + { + if($this->current_step >= count($this->steps)) + { + return true; + } + + return false; + } /** * Removes method accepeted by the importer * diff --git a/src/importer/class-tainacan-old-tainacan.php b/src/importer/class-tainacan-old-tainacan.php index 67e479876..37ddfeeb7 100644 --- a/src/importer/class-tainacan-old-tainacan.php +++ b/src/importer/class-tainacan-old-tainacan.php @@ -44,10 +44,11 @@ class Old_Tainacan extends Importer $steps = [ 'Creating all categories' => 'create_categories', 'Create empty collections' => 'create_collections', + 'Creating relationships metadata' => 'create_relationships_meta', 'Create repository metadata' => 'create_repo_meta', 'Create collections metadata' => 'create_collection_metas', 'Create collections items' => 'create_collection_items', - 'Setting relationships' => 'set_relationships' + "Finishing" => 'clear' ], $tainacan_api_address, $wordpress_api_address; @@ -63,48 +64,38 @@ class Old_Tainacan extends Importer $Tainacan_Taxonomies = \Tainacan\Repositories\Taxonomies::get_instance(); $categories_array = $this->remove_same_name($categories_array); - $start = $this->get_start(); - $total_items = count($categories_array); - if($start >= $total_items) - { - return false; - } + list($start, $end) = $this->get_begin_end($categories_array); + if($start === false) return false; - $end = $this->get_start() + $this->get_items_per_step(); - if($end > $total_items) - { - $end = $total_items; - } $created_categories = []; while($start < $end) { - for($i = $start; $i < $end; $i++) + $category = $categories_array[$start]; + + $taxonomy = new \Tainacan\Entities\Taxonomy(); + + $taxonomy->set_name($category->name); + $taxonomy->set_description($category->description); + $taxonomy->set_allow_insert(true); + + $Tainacan_Taxonomies->insert($taxonomy); + + $inserted_taxonomy = $Tainacan_Taxonomies->fetch($taxonomy->get_id()); + + /*Insert old tainacan id*/ + $created_categories[] = $category->term_id.",".$inserted_taxonomy->get_id().",".$category->name; + + if(isset($category->children) && $inserted_taxonomy) { - $category = $categories_array[$i]; - - $taxonomy = new \Tainacan\Entities\Taxonomy(); - - $taxonomy->set_name($category->name); - $taxonomy->set_description($category->description); - $taxonomy->set_allow_insert(true); - - $Tainacan_Taxonomies->insert($taxonomy); - - $inserted_taxonomy = $Tainacan_Taxonomies->fetch($taxonomy->get_id()); - - /*Insert old tainacan id*/ - $created_categories[] = $category->term_id.",".$inserted_taxonomy->get_id(); - - if(isset($category->children) && $inserted_taxonomy) - { - $this->add_all_terms($inserted_taxonomy, $category->children); - } + $this->add_all_terms($inserted_taxonomy, $category->children); } + $start++; } + + $this->save_in_file("categories", $created_categories); } - $this->save_in_file("categories", $created_categories); return $start; } @@ -114,10 +105,16 @@ class Old_Tainacan extends Importer $collections = wp_remote_get($collections_link); $collections_array = $this->verify_process_result($collections); + $created_collections = []; if($collections_array) { - foreach ($collections_array as $collection) + list($start, $end) = $this->get_begin_end($collections_array); + if($start === false) return false; + + while($start < $end) { + $collection = $collections_array[$start]; + $new_collection = new \Tainacan\Entities\Collection(); $new_collection->set_name($collection->post_title); $new_collection->set_status('publish'); @@ -125,10 +122,35 @@ class Old_Tainacan extends Importer $new_collection = \Tainacan\Repositories\Collections::get_instance()->insert($new_collection); /*Add old id*/ - add_post_meta($new_collection->get_id(), "old_tainacan_collection_id", $collection->ID); + $created_collections[] = $collection->ID.",".$new_collection->get_id().",".$collection->post_title; + + $start++; + } + $this->save_in_file("collections", $created_collections); + } + + return $start; + } + + public function create_relationships_meta() + { + $relationships = []; + $created_collection = $this->read_from_file("collections"); + $created_categories = $this->read_from_file("categories"); + foreach ($created_categories as $category_id => $category) + { + $category_name = $category['name']; + foreach ($created_collection as $collection_id => $collection) + { + $collection_name = $collection['name']; + if(strcmp($category_name, $collection_name) === 0) + { + $relationships[] = $category_id.",".$collection['new_id'].",".$category['name']; + } } } + $this->save_in_file('relationships', $relationships); return false; } @@ -141,6 +163,9 @@ class Old_Tainacan extends Importer if($repo_meta_array) { $Fields_Repository = \Tainacan\Repositories\Fields::get_instance(); + $created_categories = $this->read_from_file("categories"); + $relationships = $this->read_from_file("relationships"); + foreach ($repo_meta_array as $meta) { $avoid = [ @@ -154,7 +179,6 @@ class Old_Tainacan extends Importer $special = [ 'socialdb_property_fixed_type', 'stars', - 'item', 'compound' ]; @@ -166,11 +190,18 @@ class Old_Tainacan extends Importer $newField->set_name($meta->name); $newField->set_field_type('Tainacan\Field_Types\\'.$type); - if(strcmp($type, "Category") == 0) + if(strcmp($type, "Category") === 0) { $taxonomy_id = $meta->metadata->taxonomy; - $new_category_id = $this->created_categories[$taxonomy_id]; + + $new_category_id = $created_categories[$taxonomy_id]['new_id']; $newField->set_field_type_options(['taxonomy_id' => $new_category_id]); + }else if(strcmp($type, "Relationship") === 0) + { + $taxonomy_id = $meta->metadata->object_category_id; + $new_collection_id = $relationships[$taxonomy_id]['new_id']; + + $newField->set_field_type_options(['collection_id' => $new_collection_id]); } $newField->set_collection_id('default'); @@ -199,9 +230,33 @@ class Old_Tainacan extends Importer return false; } + public function clear() + { + unlink($this->get_id()."_categories.txt"); + unlink($this->get_id()."_collections.txt"); + unlink($this->get_id()."_relationships.txt"); + return false; + } + /*Aux functions*/ + private function read_from_file($name) + { + $file_name = $this->get_id()."_".$name.".txt"; + $fp = fopen($file_name, "r"); + $content = explode("|", fread($fp, filesize($file_name))); + $result = []; + foreach ($content as $ids) + { + $old_new_name = explode(",", $ids); + $result[$old_new_name[0]] = ['new_id' => $old_new_name[1], 'name' => $old_new_name[2]]; + } + + return $result; + } + private function save_in_file($name, $ids) { + /*Old ID, new ID*/ $file_name = $this->get_id()."_".$name.".txt"; $content = implode("|", $ids); if(file_exists($file_name)) @@ -216,6 +271,25 @@ class Old_Tainacan extends Importer fclose($fp); } + private function get_begin_end($items) + { + $start = $this->get_start(); + $total_items = count($items); + + if($start >= $total_items) + { + return [false, false]; + } + + $end = $this->get_start() + $this->get_items_per_step(); + if($end > $total_items) + { + $end = $total_items; + } + + return [$start, $end]; + } + private function add_all_terms($taxonomy_father, $children, $term_father = null) { $Tainacan_Terms = \Tainacan\Repositories\Terms::get_instance(); diff --git "a/src/js/Icon\r" "b/src/js/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/axios/Icon\r" "b/src/js/axios/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/store/Icon\r" "b/src/js/store/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/store/modules/Icon\r" "b/src/js/store/modules/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/store/modules/category/Icon\r" "b/src/js/store/modules/category/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/store/modules/collection/Icon\r" "b/src/js/store/modules/collection/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/js/store/modules/collection/actions.js b/src/js/store/modules/collection/actions.js index 66afa737c..bc354f3e7 100644 --- a/src/js/store/modules/collection/actions.js +++ b/src/js/store/modules/collection/actions.js @@ -75,7 +75,7 @@ export const fetchCollection = ({ commit }, id) => { } export const fetchCollectionName = ({ commit }, id) => { - commit('cleanCollectionName'); + //commit('cleanCollectionName'); return new Promise((resolve, reject) =>{ axios.tainacan.get('/collections/' + id + '?fetch_only=name') .then(res => { diff --git "a/src/js/store/modules/event/Icon\r" "b/src/js/store/modules/event/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/store/modules/events/Icon\r" "b/src/js/store/modules/events/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/store/modules/fields/Icon\r" "b/src/js/store/modules/fields/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/store/modules/filter/Icon\r" "b/src/js/store/modules/filter/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/js/store/modules/item/Icon\r" "b/src/js/store/modules/item/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/js/store/modules/item/actions.js b/src/js/store/modules/item/actions.js index a4c26df7b..5d138c6f1 100644 --- a/src/js/store/modules/item/actions.js +++ b/src/js/store/modules/item/actions.js @@ -118,7 +118,9 @@ export const updateItemDocument = ({ commit }, { item_id, document, document_typ document: document, document_type: document_type }).then( res => { - commit('setItem', res.data); + let item = res.data; + + commit('setItem', item); resolve( res.data ); }).catch( error => { reject({ error_message: error['response']['data'].error_message, errors: error['response']['data'].errors }); diff --git "a/src/js/store/modules/search/Icon\r" "b/src/js/store/modules/search/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/languages/Icon\r" "b/src/languages/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/src/languages/tainacan-pt_BR.mo b/src/languages/tainacan-pt_BR.mo index a59f444ee..c3f5b01c1 100644 Binary files a/src/languages/tainacan-pt_BR.mo and b/src/languages/tainacan-pt_BR.mo differ diff --git a/src/languages/tainacan-pt_BR.po b/src/languages/tainacan-pt_BR.po index 664a7db7e..c9597c7f0 100644 --- a/src/languages/tainacan-pt_BR.po +++ b/src/languages/tainacan-pt_BR.po @@ -20,12 +20,12 @@ msgstr "" "esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;" "_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n" "X-Poedit-Basepath: ..\n" -"X-Generator: Poedit 2.0.4\n" +"X-Generator: Poedit 2.0.6\n" "X-Poedit-SearchPath-0: .\n" #: admin/class-tainacan-admin.php:22 admin/class-tainacan-admin.php:23 msgid "Tainacan" -msgstr "" +msgstr "Tainacan" #: admin/tainacan-admin-i18n.php:5 msgid "Repository" @@ -47,7 +47,7 @@ msgstr "Itens" #: classes/repositories/class-tainacan-fields.php:190 #: classes/repositories/class-tainacan-fields.php:201 msgid "Fields" -msgstr "Campos" +msgstr "Metadados" #: admin/tainacan-admin-i18n.php:9 #: classes/repositories/class-tainacan-filters.php:83 @@ -83,7 +83,7 @@ msgstr "Item" #: dev-interface/class-tainacan-dev-interface.php:244 #: dev-interface/class-tainacan-dev-interface.php:314 msgid "Field" -msgstr "Campo" +msgstr "Metadado" #: admin/tainacan-admin-i18n.php:15 #: classes/repositories/class-tainacan-filters.php:84 @@ -140,7 +140,7 @@ msgstr "Busca Avançada" #: admin/tainacan-admin-i18n.php:32 msgid "Publish" -msgstr "Publicado" +msgstr "Publicar" #: admin/tainacan-admin-i18n.php:33 msgid "Draft" @@ -164,7 +164,7 @@ msgstr "Visível para todos" #: admin/tainacan-admin-i18n.php:38 msgid "Visible only for editors" -msgstr "Visível apenas para editores" +msgstr "Visível apenas para Editores" #: admin/tainacan-admin-i18n.php:41 msgid "Collections Page" @@ -176,7 +176,7 @@ msgstr "Página de Itens" #: admin/tainacan-admin-i18n.php:43 msgid "Fields Page" -msgstr "Página de Campos" +msgstr "Página de Metadados" #: admin/tainacan-admin-i18n.php:44 msgid "Filters Page" @@ -186,9 +186,10 @@ msgstr "Página de Filtros" msgid "Categories Page" msgstr "Página de Categorias" +# ESTÁ REPETIDO #: admin/tainacan-admin-i18n.php:46 msgid "Terms Page" -msgstr "Página de Campos" +msgstr "Página de Categorias" #: admin/tainacan-admin-i18n.php:47 msgid "Events Page" @@ -204,11 +205,11 @@ msgstr "Página do Item" #: admin/tainacan-admin-i18n.php:50 msgid "Field Page" -msgstr "Página do Campo" +msgstr "Página do Metadado" #: admin/tainacan-admin-i18n.php:53 msgid "Filter Page" -msgstr "Págia do Filtro" +msgstr "Página do Filtro" #: admin/tainacan-admin-i18n.php:54 msgid "Category Page" @@ -236,7 +237,7 @@ msgstr "Página de Criação do Item" #: admin/tainacan-admin-i18n.php:60 msgid "Filter Creation Page" -msgstr "Página de Criação do Item" +msgstr "Página de Criação do Filtro" #: admin/tainacan-admin-i18n.php:61 msgid "Collection Edition Page" @@ -256,7 +257,7 @@ msgstr "Página de Edição do Filtro" #: admin/tainacan-admin-i18n.php:65 msgid "Collection Fields Edition Page" -msgstr "Página de Edição dos Campos da Coleção" +msgstr "Página de Edição dos Metadados da Coleção" #: admin/tainacan-admin-i18n.php:68 msgid "Menu" @@ -314,7 +315,7 @@ msgstr "Status" #: classes/repositories/class-tainacan-logs.php:56 #: classes/repositories/class-tainacan-taxonomies.php:42 msgid "Slug" -msgstr "" +msgstr "slug" #: admin/tainacan-admin-i18n.php:77 msgid "Image" @@ -354,15 +355,15 @@ msgstr "Items por Página:" #: admin/tainacan-admin-i18n.php:86 msgid "Active Fields" -msgstr "Campos Ativos" +msgstr "Metadados ativos" #: admin/tainacan-admin-i18n.php:87 msgid "Available Fields" -msgstr "Campos Disponíveis" +msgstr "Metadados disponíveis" #: admin/tainacan-admin-i18n.php:88 msgid "Available Field Types" -msgstr "Tipos de Campos Disponíveis" +msgstr "Tipos de Metadados disponíveis" #: admin/tainacan-admin-i18n.php:89 msgid "Active Filters" @@ -378,7 +379,7 @@ msgstr "Filtros Disponíveis" #: admin/tainacan-admin-i18n.php:92 msgid "Available Filter Types" -msgstr "Tipo de Filtros Disponíveis" +msgstr "Tipos de Filtro disponíveis" #: admin/tainacan-admin-i18n.php:93 msgid "per Page" @@ -386,8 +387,9 @@ msgstr "por Página" #: admin/tainacan-admin-i18n.php:94 msgid "Fields on table" -msgstr "Campos na tabela" +msgstr "Metadados na tabela" +# DESCOBRIR O CONTEXTO DESSA “REQUISIÇAO” #: admin/tainacan-admin-i18n.php:95 #: classes/repositories/class-tainacan-fields.php:88 msgid "Required" @@ -412,15 +414,15 @@ msgstr "Sim" #: admin/tainacan-admin-i18n.php:100 msgid "No" -msgstr "No" +msgstr "Não" #: admin/tainacan-admin-i18n.php:101 msgid "Collection Related" -msgstr "Coleção Relacionada" +msgstr "Coleção relacionada" #: admin/tainacan-admin-i18n.php:102 msgid "Fields for search" -msgstr "Campos para busca" +msgstr "Metadados para busca" #: admin/tainacan-admin-i18n.php:103 msgid "Allow repeated items" @@ -468,7 +470,7 @@ msgstr "Itens da Coleção" #: admin/tainacan-admin-i18n.php:114 msgid "Collection Fields" -msgstr "Campos da Coleção" +msgstr "Metadados da Coleção" #: admin/tainacan-admin-i18n.php:115 msgid "Collection Filters" @@ -484,23 +486,23 @@ msgstr "Adicionar Novo Termo" #: admin/tainacan-admin-i18n.php:120 msgid "Drag and drop Fields here to Collection." -msgstr "Arraste e solte Campos aqui para a Coleção." +msgstr "Arraste e solte Metadados aqui para a Coleção." #: admin/tainacan-admin-i18n.php:121 msgid "Drag and drop Fields to create Filters on Collection." -msgstr "Arraste e solte Campos para criar Filtros na Coleção." +msgstr "Arraste e solte Metadados para criar Filtros na Coleção." #: admin/tainacan-admin-i18n.php:122 msgid "Drag and drop Fields here to Repository." -msgstr "Araste e solte Campos aqui para o Repositório." +msgstr "Araste e solte Metadados aqui para adicionar ao Repositório." #: admin/tainacan-admin-i18n.php:123 msgid "Drag and drop Fields to create Filters on Repository." -msgstr "Arraste e solte Campos para criar Filtros no Repositósio." +msgstr "Arraste e solte Metadados para criar Filtros no Repositório." #: admin/tainacan-admin-i18n.php:124 msgid "Delete selected collections" -msgstr "Deletar coleções selecionadas" +msgstr "Deletar Coleções selecionadas" #: admin/tainacan-admin-i18n.php:125 msgid "Delete selected items" @@ -564,15 +566,15 @@ msgstr "O campo Coleção é requerido" #: admin/tainacan-admin-i18n.php:142 msgid "No fields found in this collection" -msgstr "Nenhum campo encontrado nesta coleção" +msgstr "Nenhum metadado encontrado nesta coleção" #: admin/tainacan-admin-i18n.php:143 msgid "Showing items " -msgstr "Exibindo itens" +msgstr "Exibindo itens " #: admin/tainacan-admin-i18n.php:144 msgid "Showing collections " -msgstr "Exibindo coleções" +msgstr "Exibindo coleções " #: admin/tainacan-admin-i18n.php:145 msgid "Showing categories" @@ -580,23 +582,23 @@ msgstr "Exibindo Categorias" #: admin/tainacan-admin-i18n.php:146 msgid " to " -msgstr "a" +msgstr " a" #: admin/tainacan-admin-i18n.php:147 msgid " of " -msgstr "de" +msgstr " de" #: admin/tainacan-admin-i18n.php:148 msgid "Created by: " -msgstr "Criado por:" +msgstr "Criado por" #: admin/tainacan-admin-i18n.php:149 msgid "Date: " -msgstr "Data:" +msgstr "Data" #: admin/tainacan-admin-i18n.php:150 msgid "Not saved " -msgstr "Não salvo" +msgstr "Não salvo " #: admin/tainacan-admin-i18n.php:153 msgid "Text" @@ -665,12 +667,12 @@ msgstr "Ordenar ascendente ou descendente." #: api/class-tainacan-rest-controller.php:388 #: api/class-tainacan-rest-controller.php:410 msgid "Custom field key." -msgstr "Chave de campo customizada." +msgstr "Chave de Metadado customizado." #: api/class-tainacan-rest-controller.php:392 #: api/class-tainacan-rest-controller.php:396 msgid "Custom field value" -msgstr "Valor de campo customizado." +msgstr "Valor de metadado customizado" #: api/class-tainacan-rest-controller.php:400 msgid "" @@ -685,7 +687,7 @@ msgstr "" #: api/class-tainacan-rest-controller.php:404 msgid "Limit result set to items that have specific custom fields" msgstr "" -"Limitar conjunto de resultados para itens que possuem campos específicos" +"Limitar conjunto de resultados para itens que possuem metadado específicos" #: api/class-tainacan-rest-controller.php:414 msgid "" @@ -1184,7 +1186,7 @@ msgstr "" #: classes/repositories/class-tainacan-fields.php:41 msgid "Name of the field" -msgstr "Nome do campo" +msgstr "Nome do Metadado" #: classes/repositories/class-tainacan-fields.php:42 msgid "The name should be a text value and not empty" @@ -1192,11 +1194,13 @@ msgstr "O nome deve ser um texto não vazio" #: classes/repositories/class-tainacan-fields.php:49 msgid "A unique and santized string representation of the field" -msgstr "Um texto único e sanitizado representando o campo" +msgstr "Um texto único e sanitizado representando o metadado" +# COMO ASSIM? #: classes/repositories/class-tainacan-fields.php:56 msgid "Field order. Field used if collections are manually ordered" -msgstr "Ordem do campo. Campo utilizado se coleções são ordenadas manualmente." +msgstr "" +"Ordem do Metadado. Metadado utilizado se coleções são ordenadas manualmente." #: classes/repositories/class-tainacan-fields.php:57 msgid "The menu order should be a numeric value" @@ -1210,11 +1214,11 @@ msgstr "Pai" #: classes/repositories/class-tainacan-fields.php:64 msgid "Parent field" -msgstr "Campo pai" +msgstr "Metadado pai" #: classes/repositories/class-tainacan-fields.php:73 msgid "The field description" -msgstr "Descrição do campo" +msgstr "Descrição do Metadado" #: classes/repositories/class-tainacan-fields.php:80 #: classes/repositories/class-tainacan-filters.php:48 @@ -1223,19 +1227,19 @@ msgstr "Tipo" #: classes/repositories/class-tainacan-fields.php:82 msgid "The field type" -msgstr "O tipo de campo" +msgstr "O tipo de Metadado" #: classes/repositories/class-tainacan-fields.php:83 msgid "Field type is empty" -msgstr "Tipo de campo está vazio" +msgstr "Tipo de metadado está vazio" #: classes/repositories/class-tainacan-fields.php:90 msgid "The field is required" -msgstr "O campo é requerido" +msgstr "O metadado é requerido" #: classes/repositories/class-tainacan-fields.php:91 msgid "Field required field is invalid" -msgstr "Campo requerido é invalido" +msgstr "Metadado requerido é invalido" #: classes/repositories/class-tainacan-fields.php:97 msgid "Collection key" @@ -1243,7 +1247,7 @@ msgstr "Chave da coleção" #: classes/repositories/class-tainacan-fields.php:99 msgid "Field value should not be repeated" -msgstr "Valores do campo não devem ser repetidos" +msgstr "Valores do metadado não devem ser repetidos" #: classes/repositories/class-tainacan-fields.php:100 msgid "Collection key is invalid" @@ -1255,11 +1259,11 @@ msgstr "Multiplo" #: classes/repositories/class-tainacan-fields.php:108 msgid "Allow multiple fields for the field" -msgstr "Permitir campos múltiplos no campo" +msgstr "Permitir metadados múltiplos no Metadado" #: classes/repositories/class-tainacan-fields.php:109 msgid "Multiple fields is invalid" -msgstr "Campos múltiplos é invalido" +msgstr "Metadado múltiplos é invalido" #: classes/repositories/class-tainacan-fields.php:116 msgid "Cardinality" @@ -1353,7 +1357,7 @@ msgstr "Buscar Campo" #: classes/repositories/class-tainacan-fields.php:198 msgid "No Field found " -msgstr "Nenhum Campo encontrado" +msgstr "Nenhum Metadado encontrado " #: classes/repositories/class-tainacan-fields.php:199 msgid "No Field found in trash" @@ -1361,7 +1365,7 @@ msgstr "Nenhum campo encontrado na lixeira" #: classes/repositories/class-tainacan-fields.php:200 msgid "Parent Field:" -msgstr "Campo Pai" +msgstr "Metadado Pai: " #: classes/repositories/class-tainacan-filters.php:19 msgid "Name of the filter" @@ -1377,7 +1381,7 @@ msgstr "Ordem do Filtro. Campo utilizado se filtros são ordenados manualmente" #: classes/repositories/class-tainacan-filters.php:34 msgid "The filter description" -msgstr "A descrição do filtro." +msgstr "A descrição do filtro" #: classes/repositories/class-tainacan-filters.php:40 msgid "Filter type options" @@ -1425,7 +1429,7 @@ msgstr "Buscar Filtros" #: classes/repositories/class-tainacan-filters.php:91 msgid "No Filters found " -msgstr "Nenhum Filtro encontrado" +msgstr "Nenhum Filtro encontrado " #: classes/repositories/class-tainacan-filters.php:92 msgid "No Filters found in trash" @@ -1601,7 +1605,7 @@ msgstr "Buscar Atividades" #: classes/repositories/class-tainacan-logs.php:114 msgid "No Logs found " -msgstr "Nenhuma atividade encontrada" +msgstr "Nenhuma atividade encontrada " #: classes/repositories/class-tainacan-logs.php:115 msgid "No Logs found in trash" @@ -1687,7 +1691,7 @@ msgstr "Buscar Categorias" #: classes/repositories/class-tainacan-taxonomies.php:80 msgid "No Taxonomies found " -msgstr "Nenhuma Categoria encontrada" +msgstr "Nenhuma Categoria encontrada " #: classes/repositories/class-tainacan-taxonomies.php:81 msgid "No Taxonomies found in trash" diff --git "a/src/pdf-viewer/Icon\r" "b/src/pdf-viewer/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/scss/Icon\r" "b/src/scss/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/src/theme-helper/Icon\r" "b/src/theme-helper/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/tests/Icon\r" "b/tests/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/tests/attachment/Icon\r" "b/tests/attachment/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/tests/bin/Icon\r" "b/tests/bin/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git "a/tests/factories/Icon\r" "b/tests/factories/Icon\r" new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test-importer.php b/tests/test-importer.php index 006de5325..d62af0f20 100644 --- a/tests/test-importer.php +++ b/tests/test-importer.php @@ -48,15 +48,10 @@ class ImporterTests extends TAINACAN_UnitTestCase { $url = 'http://localhost/'; $_SESSION['tainacan_importer'][$id]->set_url($url); - // One run for each step - //Create categories - $_SESSION['tainacan_importer'][$id]->run(); - - //Create empty collections - $_SESSION['tainacan_importer'][$id]->run(); - - //Create repository metadata - $_SESSION['tainacan_importer'][$id]->run(); + while (!$_SESSION['tainacan_importer'][$id]->is_finished()) + { + $_SESSION['tainacan_importer'][$id]->run(); + } $this->assertTrue(true); }