Subversion Repositories Applications.projet

Rev

Rev 408 | Rev 419 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 408 Rev 411
Line 303... Line 303...
303
		$res .= "  <td></td>" ;
303
		$res .= "  <td></td>" ;
304
        foreach ($GLOBALS['mois'] as $valeur) $res .= '<th>'.$valeur.'</th>' ;
304
        foreach ($GLOBALS['mois'] as $valeur) $res .= '<th>'.$valeur.'</th>' ;
305
		$res .=" </tr>\n";
305
		$res .=" </tr>\n";
306
        $res .= $this->calendrierMessage();
306
        $res .= $this->calendrierMessage();
307
        $res .= "</table>\n";
307
        $res .= "</table>\n";
-
 
308
 
308
        return $res;
309
        return $res;
309
        /*
310
        /*
310
        $threadcount = array();
311
        $threadcount = array();
Line 311... Line 312...
311
 
312
 
Line 372... Line 373...
372
		$dernierRepertoire = floor($numArchive / 100);
373
		$dernierRepertoire = floor($numArchive / 100);
Line 373... Line 374...
373
		
374
		
374
		$threadcount = array();
375
		$threadcount = array();
Line 375... Line -...
375
		$tableau_annee = array();
-
 
376
		
376
		$tableau_annee = array();
377
		
377
		
Line 378... Line 378...
378
		for ($rep_courant = $dernierRepertoire; $rep_courant >= 0; $rep_courant--) {
378
		for ($rep_courant = $dernierRepertoire; $rep_courant >= 0; $rep_courant--) {
379
			$fichier_index = file ($this->listdir.'/archive/'.$rep_courant.'/index', FILE_IGNORE_NEW_LINES);
379
			$fichier_index = file ($this->listdir.'/archive/'.$rep_courant.'/index', FILE_IGNORE_NEW_LINES);
Line 424... Line 424...
424
	
424
	
425
	function calendrierMessage() {
425
	function calendrierMessage() {
426
		$html = '';
426
		$html = '';
427
		// On ajoute la derniere annee
427
		// On ajoute la derniere annee
428
		$html .= $this->calculeCalendrierPermanent(date ('Y'));
428
		$html .= $this->calculeCalendrierPermanent(date ('Y'));
429
		
429
 
430
		if ($this->isFichierCalendrierExiste()) {
430
		if (! $this->isFichierCalendrierExiste()) return $html . $this->ecrireFichierCalendrier();
431
			// S il existe mais qu il est trop vieux, il faut le recalculer
431
		// S'il existe mais qu il est trop vieux, il faut le recalculer et le réécrire
-
 
432
		if ($this->isDoitRecalculerCalendrier()) return $html . $this->ecrireFichierCalendrier();
-
 
433
		// précédemment, dans ce cas ci-dessus
432
		    if ($this->isDoitRecalculerCalendrier()) {
434
		// était effectuée un recalcul partiel, mais sans réécriture du fichier:
433
			$annees = $this->getAnneesARecalculer();
435
		/* $annees = $this->getAnneesARecalculer();
434
			$html .= $this->calculeCalendrierPermanent($annees);
436
		   $html .= $this->calculeCalendrierPermanent($annees); */
435
		    }
437
 
436
			$html .= file_get_contents('tmp/'.$this->listname.'.calendrier');
-
 
437
		} else {
-
 
438
			$html .= $this->ecrireFichierCalendrier();
-
 
439
		}	
-
 
440
		return $html;
438
		return $html . file_get_contents('tmp/'.$this->listname.'.calendrier');
Line 441... Line 439...
441
	}
439
	}
442
	
440
	
443
	function isFichierCalendrierExiste() {
441
	function isFichierCalendrierExiste() {
444
		if (file_exists('tmp/'.$this->listname.'.calendrier')) {
442
		if (file_exists('tmp/'.$this->listname.'.calendrier')) {
445
			return true;
443
			return true;
446
		}
444
		}
447
		return false;
445
		return false;
448
	}
-
 
449
	function isDoitRecalculerCalendrier() {
446
	}
450
 
-
 
451
		if (date ('Y', fileatime('tmp/'.$this->listname.'.calendrier')) != date('Y')) return true;
447
	function isDoitRecalculerCalendrier() {
Line 452... Line 448...
452
		return false;
448
	    return (date ('Y', filemtime('tmp/'.$this->listname.'.calendrier')) <= date('Y') - 1);
453
	}
449
	}
454
	
450
	
455
	function getAnneesARecalculer() {
451
	function getAnneesARecalculer() {
456
		// On suppose que l index de ezmlm est correct
452
		// On suppose que l index de ezmlm est correct
Line 457... Line 453...
457
		$anneeFichierCalendrier = date ('Y', fileatime('tmp/'.$this->listname.'.calendrier'));
453
		$anneeFichierCalendrier = date ('Y', filemtime('tmp/'.$this->listname.'.calendrier'));