From 798c2defb251ba1ebf097cd4e968b67e8a000757 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 30 Apr 2012 12:30:47 +0000 Subject: [PATCH] =?UTF-8?q?Reprise=20sur=20erreur=20=C3=A0=20partir=20de?= =?UTF-8?q?=20la=20ligne=20en=20erreur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/IndexController.php | 15 +++++++++++++++ application/views/scripts/index/index.phtml | 4 +++- public/scripts/enrichissement.js | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) 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();