Chronos chronos left.png
Rusmed logo color.png
Chronos chronos right.png

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Module:Fo/data

De Commission Historique

La documentation pour ce module peut être créée à Module:Fo/data/doc

local fields = '_pageName,ZoteroKey,TitleItem,Author,Editor,Date,Date__precision,Place,ItemType,Publisher,PublicationTitle,Volume,PublicationYear,Pages,Url,FilingDate,AccessDate,Type,Number,IssuingAuthority,Archive,Medium,Interviewer,AccessDate'
local fieldds = mw.text.split(fields,',')
local args = {groupBy = 'ZoteroKey', orderBy = 'ZoteroKey', limit = 4000}
local bib = mw.ext.cargo.query('Zotero', fields, args)
local bbib={}
for _,r in ipairs(bib) do
	bbib[r['ZoteroKey']] = {}
	for _,f in ipairs(fieldds) do
		bbib[r['ZoteroKey']][f] = r[f] or ''
	end
	if r['Date__precision'] == '3' then
		bbib[r['ZoteroKey']]['Date'] = mw.text.truncate(r['Date'],4,'')
	end
	if not r['ZoteroKey']['PublicationYear'] then
		bbib[r['ZoteroKey']]['PublicationYear'] = bbib[r['ZoteroKey']]['Date']
	end
end
return bbib