protected function doSubscribe() { $batch = new Am_BatchProcessor(array($this, '_handleAll'), 10); $page = $this->grid->getRequest()->getInt('group_context'); if ($batch->run($page)) { echo ___('DONE') . "."; } else { echo $page * $this->batchCount . ' ' . ___('records processed.'); echo $this->getAutoClickScript(5, 'input#group-action-continue'); echo $this->renderContinueForm(___('Continue'), $page); } }
public function indexAction() { if (@$_GET['reset']) { $this->getSession()->unsetAll(); } $upgradeProcess = new Am_BatchProcessor(array($this, 'doUpgrade')); $status = null; if ($upgradeProcess->run($status)) { $this->view->title = ___('Upgrade Finished'); $this->view->content .= '<h2>' . ___('Upgrade Finished') . '</h2>' . "<input type='button' value='" . ___('Back') . "' onclick='window.location=window.rootUrl+\"/admin\"'/>"; } else { $this->view->title = ___('Upgrade'); $this->view->content .= "<br /><input type='button' onclick='window.location=\"admin-upgrade\"' value='" . ___('Continue') . "' />"; } if (!$this->noDisplay) { $this->view->display('admin/layout.phtml'); } }
function doDeleteAction() { $batch = new Am_BatchProcessor(array($this, 'deleteUser')); $context = null; if (!$batch->run($context)) { $this->sendDelRedirect(); } $this->delImportHistory($this->session->params['import-id']); $this->session->unsetAll(); $this->_redirect('admin-import'); }
public function onRebuild(Am_Event_Rebuild $event) { $batch = new Am_BatchProcessor(array($this, 'batchProcess'), 5); $context = $event->getDoneString(); $this->_rebuildName = $this->getId(); $this->_sessionId = Zend_Session::getId(); if ($batch->run($context)) { $event->setDone(); $this->getDi()->storeRebuild->deleteByNameAndSession($this->_rebuildName, $this->_sessionId); } else { $event->setDoneString($context); } }
function onRebuild(Am_Event_Rebuild $event) { $batch = new Am_BatchProcessor(array($this, 'doWork'), 15); $context = $event->getDoneString(); $batch->run($context) ? $event->setDone() : $event->setDoneString($context); }
public function run(&$context) { $ret = parent::run($context); if ($ret) { $this->session->unsetAll(); } return $ret; }
function sendAction() { if ($this->getParam('back')) { return $this->_redirect('admin-email'); } check_demo(); if (!$this->saved) { $this->createSendSession(); return $this->sendRedirect(); } $batch = new Am_BatchProcessor(array($this, 'batchSend'), 10); $breaked = !$batch->run($this->saved); $breaked ? $this->sendRedirect() : $this->sendComplete(); }
function onRebuild(Am_Event_Rebuild $event) { $batch = new Am_BatchProcessor(array($this, 'batchProcess'), 5); $context = $event->getDoneString(); $this->_batchStoreId = 'rebuild-' . $this->getId() . '-' . Zend_Session::getId(); if ($batch->run($context)) { $event->setDone(); } else { $event->setDoneString($context); } }
public function handleAll() { $batch = new Am_BatchProcessor(array($this, '_handleAll'), 10); $context = $this->grid->getRequest()->getParam('group_context', '0-0'); if ($batch->run($context)) { echo $this->renderDone(); } else { list(, $processed) = explode('-', $context); echo $processed . " " . ___('records processed.'); echo $this->getAutoClickScript(3, 'input#group-action-continue'); echo $this->renderContinueForm(___('Continue'), $context); } }
function onRebuild(Am_Event_Rebuild $event) { $this->getDi()->db->query("DELETE FROM ?_newsletter_user_subscription \n WHERE list_id not in (SELECT list_id from ?_newsletter_list)"); $batch = new Am_BatchProcessor(array($this, 'batchProcess'), 5); $context = $event->getDoneString(); $this->_batchStoreId = 'rebuild-' . $this->getId() . '-' . Zend_Session::getId(); if ($batch->run($context)) { $event->setDone(); } else { $event->setDoneString($context); } }
public function handleAll() { $batch = new Am_BatchProcessor(array($this, '_handleAll'), 10); $page = $this->grid->getRequest()->getInt('group_page'); if ($this->isDelete) { $page = 0; } if ($batch->run($page)) { echo $this->renderDone(); } else { echo $page * $this->batchCount . " records processed."; echo $this->renderConfirmationForm(___("Continue"), $page); } }