1
0
Fork 0
cl-workflow/includes/include.workflow_list.php

122 Zeilen
3,7 KiB
PHP

2019-11-04 15:22:11 +00:00
<?php
2020-08-20 16:30:16 +00:00
2019-11-04 15:22:11 +00:00
/**
* Project:
* Contenido Content Management System
*
* Description:
* Workflow list
*
* Requirements:
* @con_php_req 5.0
*
*
* @package Contenido Backend classes
* @version 1.5
* @author Timo Hummel
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* {@internal
* created 2006-01-13
*
* $Id: include.workflow_list.php 128 2019-07-03 11:58:28Z oldperl $
* }}
*
*/
2020-08-20 16:30:16 +00:00
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
2019-11-04 15:22:11 +00:00
}
$iIdMarked = (int) $_GET['idworkflow'];
$workflows = new Workflows;
$sScript = '';
2020-08-20 16:30:16 +00:00
if ($action == "workflow_delete") {
$workflows->delete($idworkflow);
2019-11-04 15:22:11 +00:00
$sScript = '<script type="text/javascript">
var right_top = top.content.frames["right"].frames["right_top"];
var right_bottom = top.content.frames["right"].frames["right_bottom"];
if (right_top) {
2020-08-20 16:30:16 +00:00
right_top.location.href = "' . $sess->url('main.php?area=workflow&frame=3') . '";
2019-11-04 15:22:11 +00:00
}
if (right_bottom) {
2020-08-20 16:30:16 +00:00
right_bottom.location.href = "' . $sess->url('main.php?area=workflow&frame=4') . '";
2019-11-04 15:22:11 +00:00
}
</script>';
}
$ui = new UI_Menu;
$workflows->select("idclient = '$client' AND idlang = '$lang'");
2020-08-20 16:30:16 +00:00
while ($workflow = $workflows->next()) {
$wfid = $workflow->getField("idworkflow");
$wfname = $workflow->getField("name");
$wfdescription = $workflow->getField("description");
/* Create the link to show/edit the workflow */
$link = new Link;
$link->setMultiLink("workflow", "", "workflow_common", "workflow_show");
$link->setAlt($wfdescription);
$link->setCustom("idworkflow", $wfid);
$delTitle = i18n("Delete workflow", "cl-workflow");
$delDescr = sprintf(i18n("Do you really want to delete the following workflow:<br><br>%s<br>", "cl-workflow"), $wfname);
$delete = '<a title="' . $delTitle . '" href="javascript://" onclick="box.confirm(\'' . $delTitle . '\', \'' . $delDescr . '\', \'deleteWorkflow(\\\'' . $wfid . '\\\')\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $delTitle . '" alt="' . $delTitle . '"></a>';
$ui->setTitle($wfid, $wfname);
$ui->setLink($wfid, $link);
$ui->setActions($wfid, 'delete', $delete);
if ($wfid == $iIdMarked) {
$ui->setExtra($wfid, 'id="marked" ');
}
2019-11-04 15:22:11 +00:00
}
$content = $ui->render(false);
$delScript = '
<script type="text/javascript">
function foo(){return true;}
/* Session-ID */
2020-08-20 16:30:16 +00:00
var sid = "' . $sess->id . '";
2019-11-04 15:22:11 +00:00
/* Create messageBox
instance */
box = new messageBox("", "", "", 0, 0);
/* Function for deleting
modules */
function deleteWorkflow(idworkflow) {
url = "main.php?area=workflow";
url += "&action=workflow_delete";
url += "&frame=2";
url += "&idworkflow=" + idworkflow;
url += "&contenido=" + sid;
parent.left_bottom.location.href = url;
}
</script>';
2020-08-20 16:30:16 +00:00
2019-11-04 15:22:11 +00:00
$sInitRowMark = "<script type=\"text/javascript\">
if (document.getElementById('marked')) {
row.markedRow = document.getElementById('marked');
}
</script>";
2020-08-20 16:30:16 +00:00
$msgboxInclude = ' <script type="text/javascript" src="scripts/messageBox.js.php?contenido=' . $sess->id . '"></script>';
2019-11-04 15:22:11 +00:00
$page = new UI_Page;
$page->addScript('include', $msgboxInclude);
2020-08-20 16:30:16 +00:00
$page->addScript('del', $delScript);
2019-11-04 15:22:11 +00:00
$page->addScript('refresh', $sScript);
$page->setMargin(0);
2020-08-20 16:30:16 +00:00
$page->setContent($content . $sInitRowMark);
$page->render();