Modulo:Cronologia valutazioni: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
+Modulo:Data
Riga 5:
local cfg = mw.loadData("Modulo:Cronologia valutazioni/Configurazione")
 
local tempoDate = require('moduloModulo:tempoData').Date
local errors = {}
local we_got_error = false
 
local tempo = require('modulo:tempo')
 
-------------------------------------------------------------------------------
Line 160 ⟶ 159:
-- leggo i dati della riga
local date = self.args['data' .. Id]
date = date and tempo.dataDaStringaDate:newDMY(date)
local collegamento = self.args['collegamento' .. Id]
local codice = self.args['codice' .. Id]
Line 238 ⟶ 237:
if action == "PDC" and (result == "MANTENUTA" or result == "CANCELLATA") then
-- per le primissime procedure si applicava il veto
if date and date < tempo.data{year = Date:new('2004, month = /10}/01') then
if result == 'CANCELLATA' then
msg = msg..' in seguito a decisione consensuale.'
Line 251 ⟶ 250:
link_label = "votazione"
if date then
local cambio_quorum1 = tempo.data{year = Date:new('2005, month = /12, day = /30}')
local cambio_quorum2 = tempo.data{year = Date:new('2015, month = 4, day = /04/27}')
if result == "MANTENUTA" and yes >= no*2 and yes+no >= 5 and (yes >= 7 or date < cambio_quorum1) and (yes+no >= 10 or date >= cambio_quorum2 or date < cambio_quorum1) then
errors_msg[#errors_msg+1] = "Risultato della PDC discorde con i voti dati: la voce avrebbe dovuto essere cancellata."
Line 266 ⟶ 265:
-- messaggio che avvisa di non proporre nuovamente la voce per la cancellazione nel caso ne sia stata deciso recentemente il mantenimento
if result == "MANTENUTA" and date then
local scadenza = tempo.periodo{month=3}date:addDays(90)
if dateDate:tempoPassatonew() < scadenza then
self:__CreaAvviso(tostring(date+scadenza:getDateString())
end
end
end
if action == 'PDC' and date and date < tempo.data{year = Date:new('2005, month = 4, day = /04/19}') and not collegamento then
collegamento = 'no'
end
-- per le vecchie valutazioni per la vetrina si distinguono le votazioni dalle valutazioni in base alla data
if (action == "OLDSRQ" or action == "OLDRRQ") and date then
if date <= tempo.data{year = Date:new('2009, month = 2}/02/01') then
link_label = "votazione"
end
Line 288 ⟶ 287:
local etichetta
if date then
etichetta = tostring(date:getDateString()
else
self.manca_data = true
Line 295 ⟶ 294:
row['date'] = '[' .. tostring(mw.uri.fullUrl( name, {oldid=codice} )) .. " " .. etichetta .. "]"
elseif codice == 'no' and date then
row['date'] = '<abbr title="Nella cronologia della voce non è reperibile la versione relativa a questa procedura">' .. tostring(date:getDateString() .. '</abbr>'
elseif date then
self.manca_codice = true
row['date'] = tostring(date:getDateString()
else
self.manca_data = true
Line 316 ⟶ 315:
if row_action['use_date_for_position'] then
if date and action == "LSC" then
if date >= tempo.data{year=Date:new('2012}/01/01') then
local month, year = string.gsubmatch(date:mese()self.args['data' .. Id], "^(%l",a+) string.upper(%d+)")
month = month and mw.language.getContentLanguage():ucfirst(month) or nil
collegamento = mw.message.newRawMessage( row_action.default_position,
{name, month, date.year} ):plain()
else
local link_crono
if date >= tempo.data{year = Date:new('2010, month = 3, day = 4}/03/04') then
link_crono = 'Lo_sapevi_che/Valutazione'
else