Aller au contenu

Module:Infobox/Fonctions/Organisation/Bac à sable

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 13 avril 2022 à 16:37 et modifiée en dernier par Dom (discuter | contributions) (Recherche le titre le plus approprié en fonction de la forme juridique de l'organisation). Elle peut contenir des erreurs, des inexactitudes ou des contenus vandalisés non présents dans la version actuelle.

 Documentation[voir] [modifier] [historique] [purger]

Cette page définit un module d'infobox.


-- 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'

-- Recherche le titre le plus approprié en fonction de la forme juridique de l'organisation (P1454)
function p.labelOwner(id)
    local formeJuridique = wd.stringTable{entity = id, property = 'P1454', displayformat = 'raw', excludespecial = true}
	if wd.isSubclass('Q134161', formeJuridique[1]) then -- société par actions
       return "Actionnaires"
    else
       return "Propriétaire"
    end
end

-- Dirigeant (WIP)
function p.membres(id)
	local dirigeant = localdata['titre dirigeant'] or localdata['titre dirigeant1'] 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 = 'Membres', value = {'membre', 'membres', 'nombre_membres', 'nombre de membres'}, wikidata = {property = 'P2124', showdate = true, sorttype = 'inverted', showunit = 'long'}},
				{type = 'row', label = '[[Bénévolat|Volontaires]]', value = {'volontaires', 'bénévoles', 'nombre_volontaires', 'nombre_benevoles'}, wikidata = {property = 'P6125', showdate = true, sorttype = 'inverted'}},
				{type = 'row', label = '[[Employé|Effectif]]', value = {'effectif', 'effectifs', 'employés', 'personnel', 'personnels', 'nombre_employes', 'effectif total'}, wikidata = {property = 'P1128', showdate = true, sorttype = 'inverted', showunit = 'long'}},
				{type = 'row', label = 'Effectif statutaire', value = 'effectif statutaire'},
				{type = 'row', label = '[[Chercheur]]s', value = {'chercheurs', 'chercheurs statutaires'}},
				{type = 'row', label = 'Chercheurs associés', value = 'chercheurs associés'},
				{type = 'row', label = '[[Doctorant]]s', value = 'doctorants', property = 'P185'},
				{type = 'row', label = 'Fondateur', plurallabel = 'Fondateurs', value = {'fondateur', 'fondatrice', 'fondateurs', 'fondatrices'}, wikidata = {property = {'P112', 'P170'}}},
				{type = 'row', label = function(id) if dirigeant and not dir then return dirigeant else return "[[Président]]" end end, plurallabel = "[[Président]]s", value = {'président', 'president', 'presidente'}, wikidata = {property = 'P488', showdate = true, sorttype = 'inverted', precision = 'year', numval = 1}},
            	{type = 'row', label = function() return localdata['titre recteur'] or '[[Recteur d\'université|Recteur]]' end, value = 'recteur', wikidata = { property = 'P1075', showdate = true, precision = 'year', numval = 1 },},		
				{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', numval = 1}},
				{type = 'row', label = '[[Vice-président]]', plurallabel = '[[Vice-président]]s', 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', numval = 1}},
				{type = 'row', label = 'Procureur', plurallabel = 'Procureurs', value = {'procureur', 'procureure', 'procureuse', 'procureures', 'procureuses', 'procureurs'}, wikidata = {property = {'P1592'}, qualifier = 'P39', showdate = true, sorttype = 'inverted', precision = 'year', numval = 1}},
				{type = 'row', label = function(id) if dirigeant then return dirigeant else return "Direction" end end, value = {'directeur', 'directrice', 'direction', 'directeur_general'}, wikidata = {property = {'P169', 'P1037'}, showdate = true, sorttype = 'inverted', precision = 'year', numval = 1}},
				{type = 'row', label = function(id) if dirigeant and not pres and not dir then return dirigeant else return "[[Secrétaire général]]" end end, plurallabel = '[[Secrétaire général|Secrétaires généraux]]', value = {'secrétaire général', 'secretaire_general', 'secretaire_generale'}, wikidata = {property = 'P3975', showdate = true, sorttype = 'inverted', precision = 'year', numval = 1}},
				{type = 'row', label = '[[Secrétaire perpétuel]]', plurallabel = '[[Secrétaire perpétuel|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', numval = 1}},
				{type = 'row', label = '[[Secrétariat|Secrétaire]]', plurallabel = '[[Secrétariat|Secrétaires]]', value = {'secrétaire', 'secretaire'}, wikidata = {property = {'P2828', 'P3320'}, qualifier = 'P39', qualifiervalue = {'Q80687', 'Q836971'}, showdate = true, sorttype = 'inverted', precision = 'year', numval = 1}},
				{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', numval = 1}},
				{type = 'row', label = 'Personnes clés', value = {'personne clé', 'personnes clé', 'pers', 'personnage_clef'}, 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 = labelOwner(id), plurallabel = labelOwner(id), value = 'propriétaire', wikidata = {property = 'P127', atdate = "today", showdate = true, sorttype = 'inverted', precision = 'year', showqualifiers = "P1107"}},
				{type = 'row', label = 'Soutenu par', value = {'soutenu par', 'soutien', 'soutiens'}, property = 'P8001'},
			}
		}
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 = '[[Répertoire national des associations|RNA]]', value = 'rna', wikidata = {property = {'P3918', 'P6309'}, urlpattern = wd.formatStatements{entity = "P3918", property = "P1630", numval = 1}}},
				{type = 'row', label = '[[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 = '[[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 = '[[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 = '[[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 = '[[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 = '[[Service-public.fr|Annuaire du service public]]', value = 'servicepublic', wikidata = {property = {'P6671'}, urlpattern = wd.formatStatements{entity = "P6671", property = "P1630", numval = 1}}},

				}
			}
end

return p