$issuePublishEvent->dumpToHtml(); echo "Executing pending events:<br>"; $events = IssuePublish::GetPendingActions(); foreach ($events as $event) { $event->doAction(); $event->dumpToHtml(); } // Check if issues are published echo "Is the issue published?<br>"; $issue->fetch(); $issue->dumpToHtml(); // Are the articles published? echo "Are the articles published?<br>"; $article1->fetch(); $article1->dumpToHtml(); $article2->fetch(); $article2->dumpToHtml(); echo "Number of remaining events (should be zero): ".count(IssuePublish::GetPendingActions())."<br>"; echo "Deleting objects.<br>"; $issue->delete(); $article1->delete(); $article2->delete(); $issuePublishEvent->delete(); echo "done.<br>"; ?>
/** * method Delete() * Delete a record */ function Delete($param) { try { // security check TTransaction::open('changeman'); if (Member::newFromLogin(TSession::getValue('login'))->role_mnemonic !== 'ADMINISTRATOR') { throw new Exception(_t('Permission denied')); } TTransaction::close(); // get the parameter $key $key = $param['key']; // open a transaction with database 'changeman' TTransaction::open('changeman'); // instantiates object Issue $object = new Issue($key); // deletes the object from the database $object->delete(); // close the transaction TTransaction::close(); // reload the listing $this->onReload(); // shows the success message new TMessage('info', TAdiantiCoreTranslator::translate('Record deleted')); } catch (Exception $e) { // shows the exception error message new TMessage('error', '<b>Error</b> ' . $e->getMessage()); // undo all pending operations TTransaction::rollback(); } }
camp_html_display_error(getGS('You do not have the right to delete issues.')); exit; } $f_publication_id = Input::Get('f_publication_id', 'int'); $f_issue_number = Input::Get('f_issue_number', 'int'); $f_language_id = Input::Get('f_language_id', 'int'); if (!Input::IsValid()) { camp_html_display_error(getGS('Invalid Input: $1', Input::GetErrorString())); exit; } $publicationObj = new Publication($f_publication_id); $issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number); $numArticlesDeleted = $issueObj->delete(true, true); $tmpArray = array("Pub" => $publicationObj, "Issue"=> $issueObj); camp_html_content_top(getGS("Deleted issue"), $tmpArray); ?> <P> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box"> <TR> <TD> <B> <?php putGS("Deleted issue"); ?> </B> <HR NOSHADE SIZE="1" COLOR="BLACK"> </TD> </TR> <TR> <TD>
function killIssue() { // We delete the issue, cause there is no chance anybody can get to it without the expert view if (!Config::get()->RESOURCES_ENABLE_EXPERT_SCHEDULE_VIEW) { if ($issue_ids = $this->getIssueIDs()) { foreach ($issue_ids as $issue_id) { // delete this issue unset($this->issues[$issue_id]); $issue = new Issue(array('issue_id' => $issue_id)); $issue->delete(); } } } }
public function delete($issue_id) { $this->load->model('Issue'); $issue = new Issue(); $issue->load($issue_id); if (!$issue->issue_id) { show_404(); } $issue->delete(); $this->load->view('bootstrap/main', ['main' => 'magazines/magazine_deleted', 'issue_id' => $issue_id]); }
public function delete($issue_id) { $this->load->helper('url'); $this->load->library('session'); $this->load->model('My_User'); $this->load->library('table'); $this->load->model(array('Issue', 'Publication')); $this->load->view('bootstrap/header'); $this->load->helper('html'); $this->load->model(array('Issue')); $issue = new Issue(); $issue->load($issue_id); if (!$issue->issue_id) { show_404(); } $issue->delete(); $this->load->view('issue_deleted', array('issue_id' => $issue_id)); $this->load->view('bootstrap/footer'); }