Permanently protected module

Module:PD-US-no-renewal

From Wikisource
Jump to navigation Jump to search

require('strict')

--[=[
Implements [[Template:PD-US-no-renewal]]
]=]

local p = {} --p stands for package

local getArgs = require('Module:Arguments').getArgs
local PD = require('Module:PD')

function p._PD_US_no_renewal(args)
	local deathyear = PD.getAuthorDeathYear({args[1], args.deathyear})
	local pubyear = PD.getPublicationYear({args[2], args.pubyear})
	local film = args.film
	local category = args.category
	local template = "PD-US-no-renewal"

	-- Should we use PD-US?
	if 1963 < PD.PD_US_cutoff or (pubyear and pubyear < PD.PD_US_cutoff) then
		return require('Module:PD-US')._PD_US({['deathyear'] = deathyear, ['category'] = category})
	end
	
	-- Is this work after the cutoff date?
	if pubyear and pubyear > 1963 then
		return PD.error_text(template .. " does not apply to works published after 1963.", template)
	end
	
	-- Text
	local text = PD.license_scope() .. " in the '''[[w:public domain|public domain]] in the United States''' because " .. PD.license_grammar({"it was", "they were"}) .. " ''[[United States Code/Title 17/Chapter 1/Section 101#publication|legally published]]'' within the United States (or the United Nations Headquarters in New York subject to Section 7 of the [[United States Headquarters Agreement]]) before 1964, and copyright was not renewed.\n\n"
	text = text .. table.concat({
		'* For Class A renewal records (\'\'\'books\'\'\' only) published between 1923 and 1963, check the [https://exhibits.stanford.edu/copyrightrenewals Stanford University Copyright Renewal Database].',
		'* For other renewal records of publications between 1922–1950, see the [http://onlinebooks.library.upenn.edu/cce/ University of Pennsylvania copyright records].',
		'* For all records since 1978, search the [https://cocatalog.loc.gov U.S. Copyright Office] records.'
	}, '\n')
	if pubyear then
		text = text .. "\n\nWorks published in " .. pubyear .. " could have had their copyright renewed in " .. pubyear + 27 .. " or " .. pubyear + 28 .. ", ''i.e.'' between January 1st of the 27th year after publication or registration and December 31st of the 28th year. As this work's copyright was not renewed, it entered the '''public domain''' on January 1st, " .. pubyear + 29 .. "."
	else
		text = text .. "\n\nWorks could have had their copyright renewed between January 1st of the 27th year after publication or registration and December 31st of the 28th year. As this work's copyright was not renewed, it entered the '''public domain''' on January 1st of the 29th year." 
	end
	text = text .. PD.shorter_term_text(deathyear, film)
	
	return PD.license({
		['image'] = PD.PD_image,
		['image_r'] = PD.US_flag_image,
		['text'] = text,
		['warning'] = "It is imperative that contributors ascertain that there is no evidence of a copyright renewal before using this license. Failure to do so will result in the deletion of the work as a [[WS:COPYVIO|copyright violation]].",
		['category'] = category or PD.category_with_deathyear_floor(template, deathyear),
	})
end

function p.PD_US_no_renewal(frame)
	return p._PD_US_no_renewal(getArgs(frame))
end

return p