function vtDeleteWorkflow($adb, $request)
{
    $util = new VTWorkflowUtils();
    $module = new VTWorkflowApplication("deleteworkflow");
    $mod = return_module_language($current_language, $module->name);
    if (!$util->checkAdminAccess()) {
        $errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
        $util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
        return;
    }
    $wm = new VTWorkflowManager($adb);
    $wm->delete($request['workflow_id']);
    if (isset($request["return_url"])) {
        $returnUrl = $request["return_url"];
    } else {
        $returnUrl = $module->listViewUrl($wf->id);
    }
    ?>
		<script type="text/javascript" charset="utf-8">
			window.location="<?php 
    echo $returnUrl;
    ?>
";
		</script>
		<a href="<?php 
    echo $returnUrl;
    ?>
">Return</a>
		<?php 
}
Exemple #2
0
 public function delete()
 {
     $db = PearDatabase::getInstance();
     $wm = new VTWorkflowManager($db);
     $wm->delete($this->getId());
 }