Módulo:Infobox/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 implementa a predefinição {{Info/Organização2}}

Uso

Outra documentação:

local generic = require "Módulo:Infobox/Funções"
local localdata = require "Módulo:Infobox/Localdata"
local organizacao = require "Módulo:Infobox/Funções/Organização"
local wd = require "Módulo:Infobox/Wikidata"

local chartes = {
    -- {titulo carta, elemento wikidata, cor titulo, cor texto, pictograma}
    {'agência federal dos Estados Unidos', 'Q20857065', '#3c3b6e', '#FFFFFF', 'mapa'},
    {'dicastério', 'Q1225300', '#FFE8BF', '#000000', 'castelo'},
    {'instituto de investigação', 'Q31855', '#8089b7', '#FFFFFF', 'comunicacao'},
    {'agência especializada das Nações Unidas', 'Q15925165', '#4B92DB', '#FFFFFF', 'mapa'},
    {'instituição europeana', 'Q748720', '#003399', '#FFFFFF', 'mapa'},
    {'sociedade nacional da Cruz-Vermelha', 'Q1968122', '#CC0000', '#FFFFFF', 'humano'},
    {'sociedade douta', 'Q955824', '#FFDEAD', '#000000', 'comunicacao'},
    {'agência', 'Q681615', '#D20012', '#FFFFFF', 'mapa'},
    {'partido político', 'Q7278', '#E1E1E1', '#000', 'padrao'},
    {'sindicato', 'Q681615', '#D20012', '#FFF', 'association'},
}

local function setformat()
    local instanceof = wd.getIds(localdata.item, {property = 'P31'})

    if not instanceof then
        return  {'Q', '', '#323996', '#FFF', 'padrao'}
    end
    instanceof = wd.addVals(instanceof, {property = 'P279'}, 2)
    for i, j in pairs(instanceof) do
        for k, l in pairs(chartes) do
            if l[2] == j then
                return l
            end
        end
    end
    return {'Q', '', '#323996', '#FFF', 'padrao'}
end

local function setcharte()
    if localdata['charte'] then
        charte = localdata['charte']
        for i, j in pairs(chartes) do
            if j[1] == charte then
                return j
            end
        end
    end
    return setformat()
end

local infoboxformat = setcharte()

local defaultquery = {property = {'P101', 'P366', 'P361', 'P279'}}

return {
    maincolor = infoboxformat[3],
    secondcolor = infoboxformat[3],
    thirdcolor = infoboxformat[4],
     parts =
        {
            generic.title(infoboxformat[5]),
            generic.logo('!Artigos sem imagens'),
            generic.brazao(),
            generic.flag(),
            generic.locationmap(),
            generic.mainimage('!Artigos sem imagens'),
            {type = 'table',
                rows =     {
                {type = 'row', value = {'devise', 'slogan', 'association_slogan'}, wikidata = {property = 'P1451', showlang = true, isinlang = {'pt', 'es', 'fr', 'en', 'la'}, conjtype = '<br />'}, style = { ['text-align'] = 'center', ['font-size'] = '0.9em', ['font-weight'] = 'normal', ['font-style'] = 'italic' }},
                }
            },         
            {type = 'table', title = localdata['história'] or wd.formatStatements{entity = id, property = 'P2184', withlink = 'ptwiki'} or 'História',
                rows =     {
                {type = 'row', label = 'Fundação', value = {'criação', 'fundação', 'data_de_fundação'}, wikidata = {property = {'P571', 'P740'}, showqualifiers = {'P518', 'P1810', 'P4649'}, conjtype = '<br />'}},
                {type = 'row', label = 'Extinção', value = 'extinção', property = 'P576'},
                {type = 'row', label = 'Origem', value = {'origem'}},
                {type = 'row', label = 'Predecessor', value = {'substituto', 'a substituir', 'predecessor'}, wikidata = {property = {'P1365', 'P155', 'P1398'}, removedupes = true}},
                {type = 'row', label = 'Sucessor', value = {'substituido por', 'sucedido'}, wikidata = {property = {'P1366', 'P156', 'P167'}, removedupes = true}},
                {type = 'row', label = 'Divisão de', value = {'divisão de'}},
                {type = 'row', label = 'Fusão de', value = {'fusão de'}},
                {type = 'row', label = 'Cisão em', value = {'cisão em'}},
                {type = 'row', label = 'Fusão em', value = {'fusão em'}},
                }
            },
            {type = 'table', title='Quadro profissional',
                rows =     {
                {type = "row", label = "Sigla", plurallabel = "Siglas", value = {"sobrenome", "sigla", "acrónimo"}, wikidata = {property = {"P1449", "P1813"}, showlang = true, isinlang = {"pt", "en"}}},
                {type = "row", label = "Código", plurallabel = "Códigos", value = "código"},
                {type = "row", label = "Área de operação", value = {"cobertura", "região", "zone operacional", "zone de influência"}, wikidata = {property = "P2541", speciallabels = {Q13780930 = "[[Ficheiro:Flag of the United Nations.svg|20px|Mundo|class=noviewer thumbborder]] [[Mundo (universo)|Mundo inteiro]]", Q46 = "[[Ficheiro:Flag of Europe.svg|20px|Europa|class=noviewer thumbborder]] [[Europa]]"}}},
                {type = "row", label = "Tipo", value = {"tipo", "tipo_associação"}, wikidata = {property = "P31", ucfirst = "-", removedupes = true, showqualifiers = {"P642", "P459", "P1013", "P5102"}, conjtype = "<br />", defaultlink = "-", defaultlinkquery = defaultquery }},
                {type = "row", label = "Estado legal", value = "estado", wikidata = {property = "P1454", showqualifiers = "P4649", defaultlink = "-", defaultlinkquery = defaultquery, rank = "valid", showdate = true, sorttype = "chronological", conjtype = "<br />", ucfirst = "-"}},
                {type = "row", label = "Estrutura", value = "estrutura"},
                {type = "row", label = "[[Objeto social]]", plurallabel = "[[Objeto social|Objetos sociais]]", value = {"objeto social", "objetos sociais"}, wikidata = {property = "P6346", ucfirst = "-"}},
                {type = "row", label = "Domínio de atividade", plurallabel = "Domínios de atividade", value = {"disciplina", "disciplinas", "domínio", "domínios", "sector"}, wikidata = {property = {"P101", "P452", "P2650"}, defaultlink = "-", defaultlinkquery = defaultquery}},
                {type = "row", label = "[[Movimento cultural|Movimento]]", value = {"movimento"}, wikidata = {property = "P135"}},
                {type = "row", label = "[[:fr:Financement]]", value = "financement", wikidata = {property = "P2770", speciallabels = {Q193219 = "subvenções", Q1124860 = "dentro"}, conjtype = "e"}},
                {type = "row", label = "Propósito", plurallabel = "Propósitos", value = {"propósito", "objectivo", "objetivo"}, property = {"P3712", ucfirst = "-"}},
                {type = "row", label = "Profissão", plurallabel = "Profissões", value = {"profissão", "profissao"}},
                {type = "row", label = "Campus", value = "campus"},
                {type = "row", label = "Sede social", value = {"sede", "sede social", "endereço", "localização", "cidade"}, wikidata = {property = "P159", defaultlink = "-", defaultlinkquery = {property = {"P669", "P131", "P466"}}, showqualifiers = {"P670", "P969", "P669", "P281", "P131", "P17"}, qualifconjtype = "<br />", labelformat = function(id) local label = wd.getLabel(id) if mw.ustring.match(label, "%de") then return mw.ustring.gsub(label, "(%d)(e%l?)", "%1<sup>%2</sup>", 1) else return label end end}},
                generic.country(),
                generic.coordenadas(),
                {type = "row", label = "Língua", plurallabel = "Línguas", value = {"língua", "línguas", "língua oficial", "línguas oficiais"}, wikidata = {property = "P37", showqualifiers = "P4626", ucfirst = "-"}},
                {type = "row", label = "Língua de trabalho", plurallabel = "Línguas de trabalho", value = {"língua de trabalho", "línguas de trabalho"}, wikidata = {property = "P2936", showqualifiers = "P4626", ucfirst = "-"}},
                }
            },
            {type = "table", title="Organização",
                rows =     {
                organizacao.membros(id),
                organizacao.custom(),
                -- Entidades ligadas
                {type = "row", label = "Organização mãe", plurallabel = "Organizações mães", value = {"organização mãe", "sociedade mãe", "organismo"}, wikidata = {property = "P749", showdate = true, sorttype = "chronological", showqualifiers = {"P1001"}, conjtype = "<br />", ucfirst = "-"}},
                {type = "row", label = "Setor de atividade", plurallabel = "Setores de atividades", value = "repartição", property = "P199", ucfirst = "-"},
                {type = "row", label = "Parceriam com", plurallabel = "Parcerias com", value = "parceria com", property = "P2652", ucfirst = "-"},
                {type = "row", label = "Depende de", value = "depende de"},
                {type = "row", label = "Afiliação", value = {"affiliação", "afiliação_europeia", "afiliação_internacional"}, wikidata = {property = {"P1416", "P463"}, showdate = true, defaultlinkquery = {property = {"P749", "P127", "P112"}}, qualifdefaultlinkquery = defaultquery, showqualifiers = {"P2868", "P1416", "P3831"}}},
                {type = "row", label = "Patrocinador", plurallabel = "Patrocinadores", hidden = true, value = "patrocinador", wikidata = {property = "P859", defaultlinkquery = {property = {"P749", "P127", "P112"}}}},
                -- Orientação política
                {type = "row", label = "Orientação política", value = {"ideologia", "orientação política", "política", "pol"}, wikidata = {property = "P1142", ucfirst = "-"}},
                {type = "row", label = "Posicionamento político", value = {"posicionamento", "posicionamento político"}, wikidata = {property = "P1387", ucfirst = "-"}},
                {type = "row", label = "Coalizão política", plurallabels = "colalizões políticas", value = {"coalition", "coalition politique"}, wikidata = {property = "P5832", ucfirst = "-"}},
                {type = "row", label = "Grupo parlamentar", value = {"grupo parlamentar", "parlamento"}, wikidata = {property = "P4100", ucfirst = "-"}},
                -- Situação financeira
                {type = "row", label = "Orçamento", value = "orçamento", wikidata = {property = "P2769", showdate = true, sorttype = "chronological", showunit = "true"}},
                {type = "row", label = "Receita líquida", value = "receita líquida", wikidata = {property = "P2139", showdate = true, sorttype = "chronological", showunit = "true"}},
                {type = "row", label = "Lucro líquido", value = "lucro líquido", wikidata = {property = "P2295", showdate = true, sorttype = "chronological", showunit = "true"}},
                {type = "row", label = "Despesas", value = {"despensas", "despesas anuais", "despesas totais"}, wikidata = {property = "P2402", showdate = true, sorttype = "chronological", showunit = "true"}},
                {type = "row", label = "Capitalização na bolsa", value = "capitalização", wikidata = {property = "P2226", showdate = true, sorttype = "chronological", showunit = "true"}},
                {type = "row", label = "Cotação", plurallabel = "Cotações", value = "cotação", wikidata = {property = "P414", showqualifiers = "P249", conjtype = "<br />"}},
                {type = "row", label = "Notação", value = "notação"},
                -- Divers
                {type = "row", label = "Representativo", value = {"representativivo", "sindicato"}},
                {type = "row", label = "Distinção", plurallabel = "Distinções", value = "distinção", wikidata = {property = "P166", showdate = true, sorttype = "chronological", conjtype = "<br />", defaultlink = "-", ucfirst = "-", defaultlinkquery = {property = "P1027"}}},
                {type = "row", label = "Produto", plurallabel = "Produtos", value = "produto", property = "P1056"},
                {type = "row", label = "Publicação", plurallabel = "Publicações", value = {"orgão de imprensa", "publicação", "publicações"}, wikidata = {property = "P2813", showdate = true, sorttype = "chronological", conjtype = "<br />", ucfirst = "-", defaultlink = "-", defaultlinkquery = {property = "P123", "P1433"}, labelformat = function(id) local label = wd.getLabel(id) if label then return "<i>" .. label .. "</i>" end end}},
                generic.website(),
                                {type = "mixed", label = "Portal de dados", value = "portal de dados", wikidata = {property = "P1325", displayformat = "weblink"}},
                {type = "mixed", label = "Status", value = "status", wikidata = {property = "P6378", displayformat = "weblink", text = "Em linha"}},
                }
            },
            organizacao.ids(),
            generic.geoloc({default_zoom=4}),
        }
    }