diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index 3d4f36b7..fd2110db 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -90,5 +90,20 @@ class IndexController extends Zend_Controller_Action } } + public function repriseAction() + { + $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( + 'error' => '', + ); + $commandesM->update($data, "id=$id"); + } + exec("php ".APPLICATION_PATH."/../batch/enrichissement.php --reprise --id ".$id." &"); + } } \ No newline at end of file diff --git a/application/views/scripts/index/index.phtml b/application/views/scripts/index/index.phtml index e276ccef..9bcc134c 100644 --- a/application/views/scripts/index/index.phtml +++ b/application/views/scripts/index/index.phtml @@ -61,7 +61,9 @@ error?> Remise à zéro et redémarrage - + error) ) {?> + | Reprise manuelle sur erreur + diff --git a/public/scripts/enrichissement.js b/public/scripts/enrichissement.js index 22b4fb33..28b38d52 100644 --- a/public/scripts/enrichissement.js +++ b/public/scripts/enrichissement.js @@ -31,6 +31,12 @@ $(document).ready(function(){ } }); + $('a.reprise').click(function(e){ + e.preventDefault(); + var href = $(this).attr('href'); + window.location = href; + }); + //Focus entrant sur le document, on relance le script $(document).focusin(function(){ updateInfo();