From 78b6214862501ab5aec9f5cd75dcc23abac3a374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Roma=C5=84czuk?= Date: Thu, 18 May 2017 14:59:43 +0200 Subject: [PATCH] add PDW exclusiveness elibri extension --- lib/elibri_onix_generator.rb | 9 +++++---- lib/elibri_onix_generator/version.rb | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/elibri_onix_generator.rb b/lib/elibri_onix_generator.rb index 0cde686..fdad19c 100644 --- a/lib/elibri_onix_generator.rb +++ b/lib/elibri_onix_generator.rb @@ -230,7 +230,7 @@ def render_products! export_sale_restrictions!(product) if product.respond_to?(:sale_restricted?) && product.sale_restricted? #PR.21 end remove_tag_if_empty!(:PublishingDetail) - + #P.23 - related products if product.respond_to?(:facsimiles) && product.facsimiles.present? export_related_products!(product) @@ -377,18 +377,18 @@ def export_epub_details!(product) tag(:ProductFormDetail, onix_code) end end - + if product.respond_to?(:digital?) && product.digital? if product.epub_technical_protection comment_dictionary "Zabezpieczenie", :EpubTechnicalProtection, :indent => 10, :kind => :onix_epub_details tag(:EpubTechnicalProtection, product.epub_technical_protection_onix_code) end - + if product.epub_fragment_info? tag(:EpubUsageConstraint) do comment "Rodzaj ograniczenia - w tym przypadku zawsze dotyczy dostępności fragmentu książki", :indent => 12, :kind => :onix_epub_details tag(:EpubUsageType, Elibri::ONIX::Dict::Release_3_0::EpubUsageType::PREVIEW) - + comment_dictionary "Jaka jest decyzja wydawcy?", :EpubUsageStatus, :indent => 12, :kind => :onix_epub_details tag(:EpubUsageStatus, product.epub_publication_preview_usage_status_onix_code) if product.epub_publication_preview_usage_status_onix_code == Elibri::ONIX::Dict::Release_3_0::EpubUsageStatus::LIMITED @@ -1078,6 +1078,7 @@ def export_elibri_extensions!(product) comment 'Vat w procentach' tag("elibri:Vat", product.vat) if product.vat.present? tag("elibri:PKWiU", product.pkwiu) if product.pkwiu.present? + tag("elibri:PDWExclusiveness", product.pdw_exclusiveness) if product.pdw_exclusiveness.present? tag("elibri:preview_exists", product.preview_exists?.to_s) if product.digital? if product.epub_sale_not_restricted? || product.epub_sale_restricted_to.nil? diff --git a/lib/elibri_onix_generator/version.rb b/lib/elibri_onix_generator/version.rb index c1af785..9b6bbe0 100644 --- a/lib/elibri_onix_generator/version.rb +++ b/lib/elibri_onix_generator/version.rb @@ -1,3 +1,3 @@ module ElibriOnixGenerator - VERSION = "0.1.13" + VERSION = "0.3.0" end