Module:Infobox/Fonctions/Organisation
Wikimedia module / De Wikipedia, l'encyclopédie encyclopedia
-- Ce module étant utilisé par plus de 10 000 pages, avant de le modifier, testez le avec sa version bac à sable et à l'aide de la page de test (Modèle:Infobox Organisation2/Test).
local p = {} local localdata = require 'Module:Infobox/Localdata' local item = localdata.item local wd = require 'Module:Wikidata' local linguistic = require 'Module:Linguistique'
-- Recherche le titre le plus approprié en fonction de la forme juridique de l'organisation (P1454) -- item : élement wikidata sous la forme Qxxxx -- plural : booléen pour indiquer le pluriel local function ownerLabel(item, plural)
local formeJuridique = wd.stringTable{entity = item, property = 'P1454', displayformat = 'raw', excludespecial = true}
if wd.isSubclass('Q134161', formeJuridique[1]) then -- société par actions
if plural then return "Actionnaires" else return "Actionnaire" end else if plural then return "Propriétaires" else return "Propriétaire" end end
end
function p.membres(id) local dir = wd.formatStatements{entity = item, property = 'P1037', defaultlink = '-', numval = 1, displayformat = 'raw'} local pres = wd.formatStatements{entity = item, property = 'P488', defaultlink = '-', numval = 1, displayformat = 'raw'} local direx = wd.formatStatements{entity = item, property = 'P169', defaultlink = '-', numval = 1, displayformat = 'raw'} local secgen = wd.formatStatements{entity = item, property = 'P3975', defaultlink = '-', numval = 1, displayformat = 'raw'}
dir = dir or pres or direx or secgen local genredirigeant = wd.getgender(dir) or "m"
local titredirigeant = localdata['titre dirigeant'] or localdata['titre dirigeant1'] titredirigeant = titredirigeant or wd.formatStatements{ entity = item, property = 'P2388', defaultlink = '-', labelformat = function(titleid) return wd.genderedlabel(titleid, genredirigeant) end, labelformat2 = linguistic.removecomplement } return {type = 'multi', rows = { {type = 'row', label = 'Membres', value = {'membre', 'membres', 'nombre_membres', 'nombre de membres'}, wikidata = {property = 'P2124', showdate = true, sorttype = 'inverted', showunit = 'long'} }, {type = 'row', label = 'Volontaires', value = {'volontaires', 'bénévoles', 'nombre_volontaires', 'nombre_benevoles'}, wikidata = {property = 'P6125', showdate = true, sorttype = 'inverted'} }, {type = 'row', label = 'Effectif', value = {'effectif', 'effectifs', 'employés', 'personnel', 'personnels', 'nombre_employes', 'effectif total'}, wikidata = {property = 'P1128', showdate = true, sorttype = 'inverted', targetunit = 'employé', showunit = 'long'} }, {type = 'row', label = 'Effectif statutaire', value = 'effectif statutaire'}, {type = 'row', label = 'Chercheurs', value = {'chercheurs', 'chercheurs statutaires'}}, {type = 'row', label = 'Chercheurs associés', value = 'chercheurs associés'}, {type = 'row', label = 'Doctorants', value = 'doctorants'}, {type = 'row', label = 'Fondateur', plurallabel = 'Fondateurs', value = {'fondateur', 'fondatrice', 'fondateurs', 'fondatrices'}, wikidata = {property = {'P112', 'P170'}} }, {type = 'row', label = function(id) if titredirigeant and not direx then return titredirigeant else return "Président" end end, plurallabel = "Présidents", value = {'président', 'president', 'presidente'}, wikidata = {property = 'P488', showdate = true, sorttype = 'inverted', precision = 'year'} },
{type = 'row',
label = function() return localdata['titre recteur'] or 'Recteur' end,
value = 'recteur',
wikidata = { property = 'P1075', showdate = true, precision = 'year' }
},
{type = 'row', label = function() return localdata['titre dirigeant'] or localdata['titre dirigeant1'] or localdata['intitulé dirigeant1'] or localdata['intitule_fonction1'] or 'Dirigeant' end, value = {'dirigeant', 'dirigeant1', '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['titre dirigeant3'] or localdata['intitulé dirigeant3'] or localdata['intitule_fonction3'] or 'Dirigeant' end, value = {'dirigeant3', 'fonction3'} }, {type = 'row', label = function() return localdata['titre dirigeant4'] or localdata['intitulé dirigeant4'] or localdata['intitule_fonction4'] or 'Dirigeant' end, value = {'dirigeant4', 'fonction4'} }, {type = 'row', label = function() return localdata['titre dirigeant5'] or localdata['intitulé dirigeant5'] or localdata['intitule_fonction5'] or 'Dirigeant' end, value = {'dirigeant5', 'fonction5'} }, {type = 'row', label = 'Président d\'honneur', plurallabel = 'Présidents d\'honneur', value = {'président d\'honneur', 'président honoraire'}, wikidata = {property = {'P2828', 'P3320'}, qualifier = 'P39', qualifiervalue = 'Q1300660', showdate = true, sorttype = 'inverted', precision = 'year'}}, {type = 'row', label = 'Vice-président', plurallabel = 'Vice-présidents', value = {'vice-président', 'vice-president', 'vice-présidente', 'vice-presidente', 'vice-présidents', 'vice-presidents'}, wikidata = {property = {'P2828', 'P3320'}, qualifier = 'P39', qualifiervalue = 'Q42178', showdate = true, sorttype = 'inverted', precision = 'year'}}, {type = 'row', label = 'Procureur', plurallabel = 'Procureurs', value = {'procureur', 'procureure', 'procureuse', 'procureures', 'procureuses', 'procureurs'}, wikidata = {property = {'P1592'}, qualifier = 'P39', showdate = true, sorttype = 'inverted', precision = 'year'}}, {type = 'row', label = function(id) if titredirigeant then return titredirigeant else return "Direction" end end, value = {'directeur', 'directrice', 'direction', 'directeur_general'}, wikidata = {property = {'P169', 'P1037'}, showdate = true, sorttype = 'inverted', precision = 'year'}, blockers = {'dirigeant', 'dirigeant1', 'fonction1'}}, {type = 'row', label = function(id) if titredirigeant and not pres and not direx then return titredirigeant else return "Secrétaire général" end end, plurallabel = 'Secrétaires généraux', value = {'secrétaire général', 'secretaire_general', 'secretaire_generale'}, wikidata = {property = 'P3975', showdate = true, sorttype = 'inverted', precision = 'year'}, blockers = {'dirigeant', 'dirigeant1', 'fonction1'} }, {type = 'row', label = 'Secrétaire perpétuel', plurallabel = 'Secrétaire perpétuels', value = {'secrétaire perpétuel', 'secretaire perpetuel'}, wikidata = { property = {'P2828', 'P3320'}, qualifier = {'P39', 'P2868', 'P642'}, qualifiervalue = 'Q1282146', showdate = true, sorttype = 'inverted', precision = 'year' } }, {type = 'row', label = 'Secrétaire', plurallabel = 'Secrétaires', value = {'secrétaire', 'secretaire'}, wikidata = { property = {'P2828', 'P3320'}, qualifier = 'P39', qualifiervalue = {'Q80687', 'Q836971'}, showdate = true, sorttype = 'inverted', precision = 'year' } }, {type = 'row', label = 'Protecteur', plurallabel = 'Protecteurs', value = 'protecteur'}, {type = 'row', label = 'Trésorier', plurallabel = 'Trésoriers', value = {'trésorier', 'tresorier', 'trésorière', 'tresoriere'}, wikidata = {property = 'P3320', qualifier = 'P39', qualifiervalue = 'Q388338', showdate = true, sorttype = 'inverted', precision = 'year'} }, {type = 'row', label = 'Personnes clés', value = {'personne clé', 'pers', 'personnage_clef'}, wikidata = { property = {'P3342', 'P2828', 'P3320', 'P5052'}, conjtype = 'new line', showqualifiers = {'P39', 'P2868', 'P642'}, qualifconjtype = 'comma', excludequalifier = {'P39', 'P2868', 'P642'}, excludequalifiervalue = {'Q1300660', 'Q42178', 'Q1282146', 'Q80687', 'Q836971', 'Q388338'}, atdate = 'today' } }, {type = 'row', label = ownerLabel(item, false), plurallabel = ownerLabel(item, true), value = 'propriétaire', wikidata = {property = 'P127', atdate = "today", showdate = true, sorttype = 'inverted', precision = 'year', showqualifiers = "P1107", qualiftargetunit = 'percent'}}, {type = 'row', label = 'Soutenu par', value = {'soutenu par', 'soutien', 'soutiens'}, wikidata = {property = 'P8001', showdate = true, sorttype = 'inverted'} }, } } end
-- Champs optionnels 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
-- Identifiants function p.ids() return {type = 'table', title = 'Identifiants', rows = { {type = 'row', label = 'RNA', value = 'rna', wikidata = {property = {'P3918', 'P6309'}, urlpattern = wd.formatStatements{entity = "P3918", property = "P1630", numval = 1}}}, {type = 'row', label = 'SIREN', value = 'siren', wikidata = {property = 'P1616', urlpattern = wd.formatStatements{entity = "P1616", property = "P1630", numval = 1}}}, {type = 'row', label = 'SIRET', value = 'siret', wikidata = {property = 'P3215', urlpattern = wd.formatStatements{entity = "P3215", property = "P1630", numval = 1}}}, {type = 'row', label = 'TVA européenne', value = 'tva', wikidata = {property = 'P3608', urlpattern = wd.formatStatements{entity = "P3608", property = "P1630", numval = 1}}}, {type = 'row', label = 'IRS', value = 'irs', wikidata = {property = 'P1297', urlpattern = wd.formatStatements{entity = "P1297", property = "P3303", numval = 1}}}, {type = 'row', label = 'CIK', value = 'cik', wikidata = {property = 'P5531', urlpattern = wd.formatStatements{entity = "P5531", property = "P1630", numval = 1}}}, {type = 'row', label = 'BCE', value = 'bce', wikidata = {property = 'P3376', urlpattern = wd.formatStatements{entity = "P3376", property = "P1630", numval = 1}}}, {type = 'row', label = 'CVR', value = 'cvr', wikidata = {property = 'P1059', urlpattern = wd.formatStatements{entity = "P1059", property = "P1630", numval = 1}}}, {type = 'row', label = 'Cégjegyzékszám', value = 'hun', wikidata = {property = 'P2619', urlpattern = wd.formatStatements{entity = "P2619", property = "P1630", numval = 1}}}, {type = 'row', label = 'Companies House', value = 'companies house', wikidata = {property = 'P2622', urlpattern = wd.formatStatements{entity = "P2622", property = "P1630", numval = 1}}}, {type = 'row', label = 'Registre de Brønnøysund', value = 'orgnr', wikidata = {property = 'P2333', urlpattern = wd.formatStatements{entity = "P2333", property = "P1630", numval = 1}}}, {type = 'row', label = 'OKPO', value = 'okpo', wikidata = {property = 'P2391', urlpattern = wd.formatStatements{entity = "P2391", property = "P1630", numval = 1}}}, {type = 'row', label = 'OpenCorporates', value = 'opencorporates', wikidata = {property = 'P1320', urlpattern = wd.formatStatements{entity = "P1320", property = "P1630", numval = 1}}},
{type = 'row', label = '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 = 'Annuaire du service public', value = 'servicepublic', wikidata = {property = {'P6671'}, urlpattern = wd.formatStatements{entity = "P6671", property = "P1630", numval = 1}}},
} } end
return p