Ajout option de réinitialisation d'un enrichissement pour recommencer à zéro

This commit is contained in:
Michael RICOIS 2012-04-18 13:14:58 +00:00
parent 72d3750960
commit d972d9d545
2 changed files with 30 additions and 3 deletions

View File

@ -70,7 +70,25 @@ class IndexController extends Zend_Controller_Action
} else {
echo 'Impossible de charger le fichier.';
}
}
public function restartAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$id = $request->getParam('id');
if (!empty($id)){
$commandesM = new Application_Model_Commandes();
$data = array(
'nbLigneT' => 0,
'error' => '',
'dateStart' => '0000-00-00 00:00:00',
'fichierOut' => '',
);
$commandesM->update($data, "id=$id");
}
}
}
}

View File

@ -42,7 +42,14 @@
<?php if (count($this->fileEnCours)) {?>
<table>
<thead>
<tr><th>Fichier</th><th>Date</th><th>Lignes traités</th><th>Lignes total</th></tr>
<tr>
<th>Fichier</th>
<th>Date Ajout</th>
<th>Lignes Traités</th>
<th>Lignes Total</th>
<th>Message d'erreur</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach($this->fileEnCours as $file) {?>
@ -51,6 +58,8 @@
<td><?=$file->dateAdded?></td>
<td class="ligne"><?=$file->nbLigneT?></td>
<td><?=$file->nbLigne?></td>
<td><?=$file->error?></td>
<td><a class="restart" href="<?=$this->url(array('action'=>'restart', 'id'=>$file->id))?>">Remise à zéro et redémarrage</a></td>
</tr>
<?php }?>
</tbody>