Módulo:Infobox/Funções/Organização

Permanently protected module
Origem: Wikipédia, a enciclopédia livre.
Documentação do módulo[ver] [editar] [histórico] [purgar]


Descrição

Este módulo tem funções auxiliares para criar infocaixas.

Uso

Outra documentação:

local p = {}
local localdata = require 'Module:Infobox/Localdata'
local item = localdata.item
local wd = require 'Módulo:Infobox/Wikidata'

-- Dirigente (WIP)
function p.membros(id)
    local dirigeant = localdata['título dirigente'] or localdata['título dirigente1'] or wd.formatStatements{entity = id, property = 'P2388', defaultlink = '-'}
    local pres = wd.formatStatements{entity = id, property = 'P488', defaultlink = '-'}
    local dir = wd.formatStatements{entity = id, property = 'P169', defaultlink = '-'}
    local secgen = wd.formatStatements{entity = id, property = 'P3975', defaultlink = '-'}
    return {type = 'multi', rows = {
                {type = 'row', label = 'Membros', value = {'membro', 'membros', 'número_membros', 'número de membros'}, wikidata = {property = 'P2124', showdate = true, sorttype = 'chronological', showunit = 'long'}},
                {type = 'row', label = '[[Trabalho voluntário|Voluntários]]', value = {'voluntários', 'número_voluntários'}, wikidata = {property = 'P6125', showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = '[[Empregado]]s', value = {'efectivo', 'efectivos', 'empregados', 'pessoal', 'funcionários', 'num_empregados', 'efectivo total'}, wikidata = {property = 'P1128', showdate = true, sorttype = 'chronological', showunit = 'long'}},
                {type = 'row', label = 'Efectivo estatutário', value = 'efectivo estatutário'},
                {type = 'row', label = '[[Pesquisa]]dores', value = {'pesquisadores', 'pesquisadores estatutários'}},
                {type = 'row', label = 'Pesquisadores associados', value = 'pesquisadores associados'},
                {type = 'row', label = '[[Doutorando]]s', value = 'doutorandos', property = 'P185'},
                {type = 'row', label = 'Fundador', plurallabel = 'Fundadores', value = {'fundador', 'fundadora', 'fundadores'}, property = 'P112'},
                {type = 'row', label = function(id) if dirigeant and not dir then return dirigeant else return "[[Presidente]]" end end, plurallabel = "[[Presidente]]s", value = {'presidente', 'chefe'}, wikidata = {property = 'P488', showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = function() return localdata['título dirigente'] or localdata['título dirigente1'] or 'Dirigente' end, value = {'dirigente', 'dirigente1', 'fonction1'}},
                {type = 'row', label = function() return localdata['titre dirigeant2'] or localdata['intitulé dirigeant2'] or localdata['intitule_fonction2'] or 'Dirigeant' end, value = {'dirigeant2', 'fonction2'}},
                {type = 'row', label = function() return localdata['título dirigente3'] or 'Dirigente' end, value = {'dirigente3', 'fonction3'}},
                {type = 'row', label = function() return localdata['título dirigente3'] or 'Dirigente' end, value = {'dirigente4', 'fonction4'}},
                {type = 'row', label = function() return localdata['título dirigente3'] or 'Dirigente' end, value = {'dirigente5', 'fonction5'}},
                {type = 'row', label = 'Presidente de honra', plurallabel = 'Presidentes de honra', value = {'presidente de honra', 'presidente honorário'}, wikidata = {property = {'P2828', 'P3320'}, qualifier = 'P39', qualifiervalue = 'Q1300660', showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = '[[Vice-presidente]]', plurallabel = '[[Vice-presidente]]s', value = {'vice-presidente', 'vice president', 'vice-presidentes'}, wikidata = {property = {'P2828', 'P3320'}, qualifier = 'P39', qualifiervalue = 'Q42178', showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = 'Procurador', plurallabel = 'Procuradores', value = {'procurador', 'procuradora', 'procuradores', 'procuradoras'}, wikidata = {property = {'P1592'}, qualifier = 'P39', showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = function(id) if dirigeant then return dirigeant else return "Direção" end end, value = {'director', 'directora', 'direção', 'director_geral', 'diretor'}, wikidata = {property = {'P169', 'P1037'}, showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = function(id) if dirigeant and not pres and not dir then return dirigeant else return "[[Secretário geral]]" end end, plurallabel = '[[Secretário geral|Secretários gerais]]', value = {'secretário geral', 'secretária geral', 'secretários gerais'}, wikidata = {property = 'P3975', showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = '[[Secretário perpetual]]', plurallabel = '[[Secretário perpetual|Secretários perpetuais]]', value = {'secretário prepetual', 'secretária prepetual'}, wikidata = {property = {'P2828', 'P3320'}, qualifier = {'P39', 'P2868', 'P642'}, qualifiervalue = 'Q1282146', showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = '[[Secretário]]', plurallabel = '[[Secretário]]s', value = {'secretário', 'secretária'}, wikidata = {property = {'P2828', 'P3320'}, qualifier = 'P39', qualifiervalue = {'Q80687', 'Q836971'}, showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = 'Protetor', plurallabel = 'Protetores', value = 'protetor'},
                {type = 'row', label = 'Tesoureiro', plurallabel = 'Tesoureiro', value = {'tesoureiro', 'tesoureiros'}, wikidata = {property = 'P3320', qualifier = 'P39', qualifiervalue = 'Q388338', showdate = true, sorttype = 'chronological'}},
                {type = 'row', label = 'Pessoas chave', value = {'pessoal chave', 'pessoas chave', 'pessoas'}, wikidata = {property = {'P2828', 'P3320', 'P5052'}, conjtype = 'new line', showqualifiers = {'P39', 'P2868', 'P642'}, qualifconjtype = 'comma', excludequalifier = {'P39', 'P2868', 'P642'}, excludequalifiervalue = {'Q1300660', 'Q42178', 'Q1282146', 'Q80687', 'Q836971', 'Q388338'}}},
                {type = 'row', label = 'Proprietário', plurallabel = 'Proprietários', value = 'proprietário', wikidata = {property = {'P127', showdate = true, sorttype = 'chronological'}}},
            }
        }
end

-- Campos opcionais
function p.custom()
    return {type = 'multi', rows = {
                {type = 'row', label = function() return localdata['option-1'] or 'Option 1' end, value = 'valeur-1'},
                {type = 'row', label = function() return localdata['option-2'] or 'Option 2' end, value = 'valeur-2'},
                {type = 'row', label = function() return localdata['option-3'] or 'Option 3' end, value = 'valeur-3'},
                {type = 'row', label = function() return localdata['option-4'] or 'Option 4' end, value = 'valeur-4'},
                {type = 'row', label = function() return localdata['option-5'] or 'Option 5' end, value = 'valeur-5'},
                {type = 'row', label = function() return localdata['option-6'] or 'Option 6' end, value = 'valeur-6'},
            }
        }
end

-- Identificadores
function p.ids()
    return {type = 'table', title = 'Identificador',
                rows =     {
                {type = 'row', label = '[[:fr:Répertoire national des associations|RNA]]', value = 'rna', wikidata = {property = {'P3918', 'P6309'}, urlpattern = wd.formatStatements{entity = "P3918", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:fr:Système d\'identification du répertoire des entreprises|SIREN]]', value = 'siren', wikidata = {property = 'P1616', urlpattern = wd.formatStatements{entity = "P1616", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:fr:Système d\'identification du répertoire des établissements|SIRET]]', value = 'siret', wikidata = {property = 'P3215', urlpattern = wd.formatStatements{entity = "P3215", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:fr:TVA dans l\'Union européenne|TVA européenne]]', value = 'tva', wikidata = {property = 'P3608', urlpattern = wd.formatStatements{entity = "P3608", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[Internal Revenue Service|IRS]]', value = 'irs', wikidata = {property = 'P1297', urlpattern = wd.formatStatements{entity = "P1297", property = "P3303", numval = 1}}},
                {type = 'row', label = '[[Securities and Exchange Commission|CIK]]', value = 'cik', wikidata = {property = 'P5531', urlpattern = wd.formatStatements{entity = "P5531", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:fr:Banque-Carrefour des Entreprises|BCE]]', value = 'bce', wikidata = {property = 'P3376', urlpattern = wd.formatStatements{entity = "P3376", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:en:Central Business Register (Denmark)|CVR]]', value = 'cvr', wikidata = {property = 'P1059', urlpattern = wd.formatStatements{entity = "P1059", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:hu:Cégjegyzékszámok Magyarországon|Cégjegyzékszám]]', value = 'hun', wikidata = {property = 'P2619', urlpattern = wd.formatStatements{entity = "P2619", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:en:Companies House|Companies House]]', value = 'companies house', wikidata = {property = 'P2622', urlpattern = wd.formatStatements{entity = "P2622", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:en:Brønnøysund Register Centre|Registre de Brønnøysund]]', value = 'orgnr', wikidata = {property = 'P2333', urlpattern = wd.formatStatements{entity = "P2333", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:en:Russian Federal State Statistics Service|OKPO]]', value = 'okpo', wikidata = {property = 'P2391', urlpattern = wd.formatStatements{entity = "P2391", property = "P1630", numval = 1}}},
                {type = 'row', label = '[[:en:OpenCorporates|OpenCorporates]]', value = 'opencorporates', wikidata = {property = 'P1320', urlpattern = wd.formatStatements{entity = "P1320", property = "P1630", numval = 1}}},
                                {type = 'row', label = '[[:fr:data.gouv.fr|data.gouv.fr]]', value = 'datagouv', wikidata = {property = {'P3206'}, urlpattern = wd.formatStatements{entity = "P3206", property = "P1630", numval = 1}}},

{type = 'row', label = '[[UAI]]', value = 'uai', wikidata = {property = {'P3202'}, urlpattern = wd.formatStatements{entity = "P3202", property = "P1630", numval = 1}}},

{type = 'row', label = '[[:fr:Service-public.fr|Anuário do serviço público]]', value = 'servicepublic', wikidata = {property = {'P6671'}, urlpattern = wd.formatStatements{entity = "P6671", property = "P1630", numval = 1}}},

                }
            }
end

return p