2013-01-24 10:35:33 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of WorkspaceMgr view
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2013-01-24 10:35:33 +00:00
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include parent class
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
//require_once("class.Bootstrap.php");
|
2013-01-24 10:35:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which outputs the html page for WorkspaceMgr view
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2013-01-24 10:35:33 +00:00
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
class SeedDMS_View_WorkflowMgr extends SeedDMS_Theme_Style {
|
2013-01-24 10:35:33 +00:00
|
|
|
|
2016-03-18 14:33:18 +00:00
|
|
|
function js() { /* {{{ */
|
|
|
|
header('Content-Type: application/javascript; charset=UTF-8');
|
2021-05-28 12:18:26 +00:00
|
|
|
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
|
2013-01-24 10:35:33 +00:00
|
|
|
?>
|
2021-05-28 12:18:26 +00:00
|
|
|
function runValidation() {
|
|
|
|
$("#form1").validate({
|
|
|
|
rules: {
|
|
|
|
name: {
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
initstate: {
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
messages: {
|
|
|
|
name: "<?php printMLText("js_no_name");?>",
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2013-01-24 10:35:33 +00:00
|
|
|
|
|
|
|
function checkForm(num)
|
|
|
|
{
|
2013-05-23 14:07:00 +00:00
|
|
|
msg = new Array();
|
2013-01-24 10:35:33 +00:00
|
|
|
eval("var formObj = document.form" + num + ";");
|
|
|
|
|
2013-05-23 14:07:00 +00:00
|
|
|
if (formObj.name.value == "") msg.push("<?php printMLText("js_no_name");?>");
|
2013-01-24 10:35:33 +00:00
|
|
|
if (msg != "")
|
|
|
|
{
|
2013-05-23 14:07:00 +00:00
|
|
|
noty({
|
|
|
|
text: msg.join('<br />'),
|
|
|
|
type: 'error',
|
|
|
|
dismissQueue: true,
|
|
|
|
layout: 'topRight',
|
|
|
|
theme: 'defaultTheme',
|
|
|
|
_timeout: 1500,
|
|
|
|
});
|
2013-01-24 10:35:33 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-03-18 14:33:18 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
$('body').on('submit', '#form1', function(ev){
|
|
|
|
if(checkForm()) return;
|
2016-03-22 13:47:13 +00:00
|
|
|
ev.preventDefault();
|
2016-03-18 14:33:18 +00:00
|
|
|
});
|
|
|
|
$( "#selector" ).change(function() {
|
|
|
|
$('div.ajax').trigger('update', {workflowid: $(this).val()});
|
|
|
|
});
|
|
|
|
});
|
2013-01-24 10:35:33 +00:00
|
|
|
<?php
|
2016-03-18 14:33:18 +00:00
|
|
|
} /* }}} */
|
2013-01-24 10:35:33 +00:00
|
|
|
|
2016-03-18 14:33:18 +00:00
|
|
|
function info() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$selworkflow = $this->params['selworkflow'];
|
2018-12-03 06:40:58 +00:00
|
|
|
if($selworkflow && $selworkflow->getTransitions()) { ?>
|
2016-03-18 14:33:18 +00:00
|
|
|
<div id="workflowgraph">
|
2021-04-18 05:08:00 +00:00
|
|
|
<iframe src="out.WorkflowGraph.php?workflow=<?php echo $selworkflow->getID(); ?>" width="100%" height="670" style="border: 1px solid #e3e3e3; border-radius: 4px; margin: -1px;"></iframe>
|
2013-01-24 10:35:33 +00:00
|
|
|
</div>
|
2016-03-18 14:33:18 +00:00
|
|
|
<?php }
|
|
|
|
} /* }}} */
|
2013-01-24 10:35:33 +00:00
|
|
|
|
2018-12-03 06:40:58 +00:00
|
|
|
function actionmenu() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$selworkflow = $this->params['selworkflow'];
|
|
|
|
$workflows = $this->params['allworkflows'];
|
|
|
|
$workflowstates = $this->params['allworkflowstates'];
|
|
|
|
|
|
|
|
if($selworkflow && !$selworkflow->isUsed()) {
|
2021-04-18 05:08:00 +00:00
|
|
|
$button = array(
|
|
|
|
'label'=>getMLText('action'),
|
|
|
|
'menuitems'=>array(
|
|
|
|
)
|
|
|
|
);
|
2018-12-03 06:40:58 +00:00
|
|
|
if(!$selworkflow->isUsed()) {
|
2021-04-18 05:08:00 +00:00
|
|
|
$button['menuitems'][] = array('label'=>'<i class="fa fa-remove"></i> '.getMLText("rm_workflow"), 'link'=>'../out/out.RemoveWorkflow.php?workflowid='.$selworkflow->getID());
|
2018-12-03 06:40:58 +00:00
|
|
|
}
|
2021-04-18 05:08:00 +00:00
|
|
|
self::showButtonwithMenu($button);
|
2018-12-03 06:40:58 +00:00
|
|
|
}
|
|
|
|
} /* }}} */
|
|
|
|
|
2016-03-18 14:33:18 +00:00
|
|
|
function showWorkflowForm($workflow) { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$workflows = $this->params['allworkflows'];
|
|
|
|
$workflowstates = $this->params['allworkflowstates'];
|
2013-01-24 10:35:33 +00:00
|
|
|
|
2016-03-18 14:33:18 +00:00
|
|
|
if($workflow) {
|
2016-11-18 08:05:21 +00:00
|
|
|
$path = $workflow->checkForCycles();
|
|
|
|
if($path) {
|
|
|
|
$names = array();
|
|
|
|
foreach($path as $state) {
|
2020-03-26 06:54:27 +00:00
|
|
|
$names[] = htmlspecialchars($state->getName());
|
2016-11-18 08:05:21 +00:00
|
|
|
}
|
2020-08-27 05:52:52 +00:00
|
|
|
$this->errorMsg(getMLText('workflow_has_cycle').": ".implode(' <i class="fa fa-arrow-right"></i> ', $names));
|
2016-11-18 08:05:21 +00:00
|
|
|
}
|
|
|
|
|
2016-03-18 14:33:18 +00:00
|
|
|
$transitions = $workflow->getTransitions();
|
|
|
|
$initstate = $workflow->getInitState();
|
2013-02-07 17:03:05 +00:00
|
|
|
$hasinitstate = true;
|
2016-09-02 06:36:12 +00:00
|
|
|
$hasreleased = true;
|
|
|
|
$hasrejected = true;
|
2013-02-06 14:00:57 +00:00
|
|
|
$missesug = false;
|
2013-02-05 09:23:17 +00:00
|
|
|
if($transitions) {
|
2013-02-07 17:03:05 +00:00
|
|
|
$hasinitstate = false;
|
2016-09-02 06:36:12 +00:00
|
|
|
$hasreleased = false;
|
|
|
|
$hasrejected = false;
|
2013-02-05 09:23:17 +00:00
|
|
|
foreach($transitions as $transition) {
|
|
|
|
$transusers = $transition->getUsers();
|
|
|
|
$transgroups = $transition->getGroups();
|
|
|
|
if(!$transusers && !$transgroups) {
|
2013-02-06 14:00:57 +00:00
|
|
|
$missesug = true;
|
2013-02-05 09:23:17 +00:00
|
|
|
}
|
2016-09-02 06:36:12 +00:00
|
|
|
if($transition->getNextState()->getDocumentStatus() == S_RELEASED)
|
|
|
|
$hasreleased = true;
|
|
|
|
if($transition->getNextState()->getDocumentStatus() == S_REJECTED)
|
|
|
|
$hasrejected = true;
|
2013-02-06 14:00:57 +00:00
|
|
|
if($transition->getState()->getID() == $initstate->getID())
|
|
|
|
$hasinitstate = true;
|
2013-02-05 09:23:17 +00:00
|
|
|
}
|
|
|
|
}
|
2013-02-06 14:00:57 +00:00
|
|
|
if($missesug)
|
2016-09-02 06:36:12 +00:00
|
|
|
$this->errorMsg(getMLText('workflow_transition_without_user_group'));
|
2013-02-06 14:00:57 +00:00
|
|
|
if(!$hasinitstate)
|
2016-09-02 06:36:12 +00:00
|
|
|
$this->errorMsg(getMLText('workflow_no_initial_state'));
|
|
|
|
if(!$hasreleased)
|
|
|
|
$this->errorMsg(getMLText('workflow_no_doc_released_state'));
|
|
|
|
if(!$hasrejected)
|
|
|
|
$this->errorMsg(getMLText('workflow_no_doc_rejected_state'));
|
2016-03-18 14:33:18 +00:00
|
|
|
|
2016-09-02 06:36:12 +00:00
|
|
|
if($workflow->isUsed()) {
|
|
|
|
$this->infoMsg(getMLText('workflow_in_use'));
|
|
|
|
}
|
2016-03-18 14:33:18 +00:00
|
|
|
}
|
2013-01-24 10:35:33 +00:00
|
|
|
?>
|
2021-05-28 12:18:26 +00:00
|
|
|
<form class="form-horizontal" action="../op/op.WorkflowMgr.php" method="post" enctype="multipart/form-data" id="form1" name="form1">
|
2016-03-18 14:33:18 +00:00
|
|
|
<?php
|
2018-12-03 06:40:58 +00:00
|
|
|
if($workflow) {
|
|
|
|
echo createHiddenFieldWithKey('editworkflow');
|
2016-03-18 14:33:18 +00:00
|
|
|
?>
|
2017-01-04 06:03:05 +00:00
|
|
|
<input type="hidden" name="workflowid" value="<?php print $workflow->getID();?>">
|
|
|
|
<input type="hidden" name="action" value="editworkflow">
|
2016-03-18 14:33:18 +00:00
|
|
|
<?php
|
2018-12-03 06:40:58 +00:00
|
|
|
} else {
|
|
|
|
echo createHiddenFieldWithKey('addworkflow');
|
2016-03-18 14:33:18 +00:00
|
|
|
?>
|
|
|
|
<input type="hidden" name="action" value="addworkflow">
|
2016-09-02 06:36:12 +00:00
|
|
|
<?php
|
|
|
|
}
|
2021-05-28 12:18:26 +00:00
|
|
|
$this->contentContainerStart();
|
2018-04-26 06:50:44 +00:00
|
|
|
$this->formField(
|
|
|
|
getMLText("workflow_name"),
|
2018-06-07 05:46:19 +00:00
|
|
|
array(
|
|
|
|
'element'=>'input',
|
|
|
|
'type'=>'text',
|
|
|
|
'id'=>'name',
|
|
|
|
'name'=>'name',
|
|
|
|
'value'=>($workflow ? htmlspecialchars($workflow->getName()) : '')
|
|
|
|
)
|
2018-04-26 06:50:44 +00:00
|
|
|
);
|
2018-06-07 05:46:19 +00:00
|
|
|
$options = array();
|
2018-04-26 06:50:44 +00:00
|
|
|
foreach($workflowstates as $workflowstate) {
|
2018-06-07 05:46:19 +00:00
|
|
|
$options[] = array($workflowstate->getID(), htmlspecialchars($workflowstate->getName()), $workflow && $workflow->getInitState()->getID() == $workflowstate->getID());
|
2018-04-26 06:50:44 +00:00
|
|
|
}
|
|
|
|
$this->formField(
|
|
|
|
getMLText("workflow_initstate"),
|
2018-06-07 05:46:19 +00:00
|
|
|
array(
|
|
|
|
'element'=>'select',
|
|
|
|
'name'=>'initstate',
|
|
|
|
'options'=>$options
|
|
|
|
)
|
2018-04-26 06:50:44 +00:00
|
|
|
);
|
2021-05-28 12:18:26 +00:00
|
|
|
$this->contentContainerEnd();
|
2020-08-27 05:52:52 +00:00
|
|
|
$this->formSubmit('<i class="fa fa-save"></i> '.getMLText("save"));
|
2016-09-02 06:36:12 +00:00
|
|
|
?>
|
2013-01-24 10:35:33 +00:00
|
|
|
</form>
|
|
|
|
<?php
|
2016-03-18 14:33:18 +00:00
|
|
|
if($workflow) {
|
2013-01-24 16:53:35 +00:00
|
|
|
$actions = $dms->getAllWorkflowActions();
|
|
|
|
if($actions) {
|
2016-03-18 14:33:18 +00:00
|
|
|
$transitions = $workflow->getTransitions();
|
|
|
|
echo "<table class=\"table table-condensed\"><thead>";
|
|
|
|
echo "<tr><th>".getMLText('state_and_next_state')."</th><th>".getMLText('action')."</th><th>".getMLText('users_and_groups')."</th><th></th></tr></thead><tbody>";
|
2013-01-24 10:35:33 +00:00
|
|
|
if($transitions) {
|
|
|
|
foreach($transitions as $transition) {
|
|
|
|
$state = $transition->getState();
|
|
|
|
$nextstate = $transition->getNextState();
|
|
|
|
$action = $transition->getAction();
|
2013-02-05 09:23:17 +00:00
|
|
|
$transusers = $transition->getUsers();
|
|
|
|
$transgroups = $transition->getGroups();
|
|
|
|
echo "<tr";
|
|
|
|
if(!$transusers && !$transgroups) {
|
|
|
|
echo " class=\"error\"";
|
|
|
|
}
|
2020-08-27 05:52:52 +00:00
|
|
|
echo "><td>".'<i class="fa fa-circle'.($workflow->getInitState()->getId() == $state->getId() ? ' initstate' : ' in-workflow').'"></i> '.htmlspecialchars($state->getName())."<br />";
|
2013-01-24 16:53:35 +00:00
|
|
|
$docstatus = $nextstate->getDocumentStatus();
|
2020-08-27 05:52:52 +00:00
|
|
|
echo '<i class="fa fa-circle'.($docstatus == S_RELEASED ? ' released' : ($docstatus == S_REJECTED ? ' rejected' : ' in-workflow')).'"></i> '.htmlspecialchars($nextstate->getName());
|
2013-01-24 16:53:35 +00:00
|
|
|
if($docstatus == S_RELEASED || $docstatus == S_REJECTED) {
|
2020-08-27 05:52:52 +00:00
|
|
|
echo "<br /><i class=\"fa fa-arrow-right\"></i> ".getOverallStatusText($docstatus);
|
2013-01-24 16:53:35 +00:00
|
|
|
}
|
|
|
|
echo "</td>";
|
2020-08-27 05:52:52 +00:00
|
|
|
echo "<td><i class=\"fa fa-sign-blank workflow-action\"></i> ".htmlspecialchars($action->getName())."</td>";
|
2013-01-24 10:35:33 +00:00
|
|
|
echo "<td>";
|
|
|
|
foreach($transusers as $transuser) {
|
|
|
|
$u = $transuser->getUser();
|
2020-08-27 05:52:52 +00:00
|
|
|
echo '<i class="fa fa-user"></i> '.htmlspecialchars($u->getLogin()." - ".$u->getFullName());
|
2013-01-24 10:35:33 +00:00
|
|
|
echo "<br />";
|
|
|
|
}
|
|
|
|
foreach($transgroups as $transgroup) {
|
|
|
|
$g = $transgroup->getGroup();
|
2020-08-27 05:52:52 +00:00
|
|
|
echo '<i class="fa fa-group"></i> '.getMLText('at_least_n_users_of_group',
|
2013-09-20 18:56:46 +00:00
|
|
|
array("number_of_users" => $transgroup->getNumOfUsers(),
|
2020-03-26 06:54:27 +00:00
|
|
|
"group" => htmlspecialchars($g->getName())));
|
2013-01-24 10:35:33 +00:00
|
|
|
echo "<br />";
|
|
|
|
}
|
|
|
|
echo "</td>";
|
|
|
|
echo "<td>";
|
|
|
|
?>
|
|
|
|
<form class="form-inline" action="../op/op.RemoveTransitionFromWorkflow.php" method="post">
|
|
|
|
<?php echo createHiddenFieldWithKey('removetransitionfromworkflow'); ?>
|
2016-03-18 14:33:18 +00:00
|
|
|
<input type="hidden" name="workflow" value="<?php print $workflow->getID();?>">
|
2013-01-24 10:35:33 +00:00
|
|
|
<input type="hidden" name="transition" value="<?php print $transition->getID(); ?>">
|
2021-04-18 05:08:00 +00:00
|
|
|
<button type="submit" class="btn btn-mini btn-danger btn-sm"><i class="fa fa-remove"></i> <?php printMLText("delete");?></button>
|
2013-01-24 10:35:33 +00:00
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>\n";
|
|
|
|
}
|
2013-01-24 16:53:35 +00:00
|
|
|
}
|
2016-03-18 14:33:18 +00:00
|
|
|
echo "</tbody></table>";
|
2013-01-24 10:35:33 +00:00
|
|
|
?>
|
2021-05-28 12:18:26 +00:00
|
|
|
<form class="form-inline" action="../op/op.AddTransitionToWorkflow.php" method="post" id="form2" name="form2">
|
2013-01-24 10:35:33 +00:00
|
|
|
<?php
|
2016-03-18 14:33:18 +00:00
|
|
|
echo "<table class=\"table table-condensed\"><thead></thead><tbody>";
|
2013-01-24 10:35:33 +00:00
|
|
|
echo "<tr>";
|
|
|
|
echo "<td>";
|
2021-04-18 05:08:00 +00:00
|
|
|
echo "<select name=\"state\" class=\"form-control\">";
|
2013-01-24 10:35:33 +00:00
|
|
|
$states = $dms->getAllWorkflowStates();
|
|
|
|
foreach($states as $state) {
|
2020-03-26 06:54:27 +00:00
|
|
|
echo "<option value=\"".$state->getID()."\">".htmlspecialchars($state->getName())."</option>";
|
2013-01-24 10:35:33 +00:00
|
|
|
}
|
2013-02-05 09:23:17 +00:00
|
|
|
echo "</select><br />";
|
2021-04-18 05:08:00 +00:00
|
|
|
echo "<select name=\"nextstate\" class=\"form-control\">";
|
2013-02-05 09:23:17 +00:00
|
|
|
$states = $dms->getAllWorkflowStates();
|
|
|
|
foreach($states as $state) {
|
2020-03-26 06:54:27 +00:00
|
|
|
echo "<option value=\"".$state->getID()."\">".htmlspecialchars($state->getName())."</option>";
|
2013-02-05 09:23:17 +00:00
|
|
|
}
|
2013-01-24 10:35:33 +00:00
|
|
|
echo "</select>";
|
|
|
|
echo "</td>";
|
|
|
|
echo "<td>";
|
2021-04-18 05:08:00 +00:00
|
|
|
echo "<select name=\"action\" class=\"form-control\">";
|
2013-01-24 10:35:33 +00:00
|
|
|
foreach($actions as $action) {
|
2020-03-26 06:54:27 +00:00
|
|
|
echo "<option value=\"".$action->getID()."\">".htmlspecialchars($action->getName())."</option>";
|
2013-01-24 10:35:33 +00:00
|
|
|
}
|
|
|
|
echo "</select>";
|
|
|
|
echo "</td>";
|
|
|
|
echo "<td>";
|
2013-09-09 05:16:18 +00:00
|
|
|
echo "<select class=\"chzn-select\" name=\"users[]\" multiple=\"multiple\" data-placeholder=\"".getMLText('select_users')."\" data-no_results_text=\"".getMLText('unknown_user')."\">";
|
2013-01-24 10:35:33 +00:00
|
|
|
$allusers = $dms->getAllUsers();
|
|
|
|
foreach($allusers as $usr) {
|
|
|
|
print "<option value=\"".$usr->getID()."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>";
|
|
|
|
}
|
|
|
|
echo "</select>";
|
|
|
|
echo "<br />";
|
2013-09-09 05:16:18 +00:00
|
|
|
echo "<select class=\"chzn-select\" name=\"groups[]\" multiple=\"multiple\" data-placeholder=\"".getMLText('select_groups')."\" data-no_results_text=\"".getMLText('unknown_group')."\">";
|
2013-01-24 10:35:33 +00:00
|
|
|
$allgroups = $dms->getAllGroups();
|
|
|
|
foreach($allgroups as $grp) {
|
|
|
|
print "<option value=\"".$grp->getID()."\">". htmlspecialchars($grp->getName())."</option>";
|
|
|
|
}
|
|
|
|
echo "</select>";
|
|
|
|
echo "</td>";
|
|
|
|
echo "<td>";
|
|
|
|
?>
|
|
|
|
<?php echo createHiddenFieldWithKey('addtransitiontoworkflow'); ?>
|
2016-03-18 14:33:18 +00:00
|
|
|
<input type="hidden" name="workflow" value="<?php print $workflow->getID();?>">
|
2021-05-28 12:18:26 +00:00
|
|
|
<input type="submit" class="btn btn-primary" value="<?php printMLText("add");?>">
|
2013-01-24 10:35:33 +00:00
|
|
|
<?php
|
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>\n";
|
2016-03-18 14:33:18 +00:00
|
|
|
echo "</tbody></table>";
|
2013-01-24 10:35:33 +00:00
|
|
|
?>
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
}
|
2016-03-18 14:33:18 +00:00
|
|
|
}
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
function form() { /* {{{ */
|
|
|
|
$selworkflow = $this->params['selworkflow'];
|
|
|
|
|
|
|
|
$this->showWorkflowForm($selworkflow);
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$selworkflow = $this->params['selworkflow'];
|
|
|
|
$workflows = $this->params['allworkflows'];
|
|
|
|
$workflowstates = $this->params['allworkflowstates'];
|
|
|
|
|
2021-05-28 12:18:26 +00:00
|
|
|
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
|
|
|
|
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
|
|
|
|
|
2016-03-18 14:33:18 +00:00
|
|
|
$this->htmlStartPage(getMLText("admin_tools"));
|
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
|
|
|
$this->contentHeading(getMLText("workflow_management"));
|
2020-10-08 05:57:23 +00:00
|
|
|
$this->rowStart();
|
|
|
|
$this->columnStart(5);
|
2013-01-24 10:35:33 +00:00
|
|
|
?>
|
2018-12-03 06:40:58 +00:00
|
|
|
<form class="form-horizontal">
|
2016-03-18 14:33:18 +00:00
|
|
|
<?php
|
2018-06-07 05:46:19 +00:00
|
|
|
$options = array();
|
|
|
|
$options[] = array("-1", getMLText("choose_workflow"));
|
|
|
|
$options[] = array("0", getMLText("add_workflow"));
|
2016-03-18 14:33:18 +00:00
|
|
|
foreach ($workflows as $currWorkflow) {
|
2018-06-07 05:46:19 +00:00
|
|
|
$options[] = array($currWorkflow->getID(), htmlspecialchars($currWorkflow->getName()),$selworkflow && $currWorkflow->getID()==$selworkflow->getID());
|
2016-03-18 14:33:18 +00:00
|
|
|
}
|
2018-04-26 06:50:44 +00:00
|
|
|
$this->formField(
|
2018-12-03 06:40:58 +00:00
|
|
|
null, //getMLText("selection"),
|
2018-06-07 05:46:19 +00:00
|
|
|
array(
|
|
|
|
'element'=>'select',
|
|
|
|
'id'=>'selector',
|
2018-12-03 06:40:58 +00:00
|
|
|
'class'=>'chzn-select',
|
2018-06-07 05:46:19 +00:00
|
|
|
'options'=>$options
|
|
|
|
)
|
2018-04-26 06:50:44 +00:00
|
|
|
);
|
2016-03-18 14:33:18 +00:00
|
|
|
?>
|
2018-12-03 06:40:58 +00:00
|
|
|
</form>
|
|
|
|
<div class="ajax" style="margin-bottom: 15px;" data-view="WorkflowMgr" data-action="actionmenu" <?php echo ($selworkflow ? "data-query=\"workflowid=".$selworkflow->getID()."\"" : "") ?>></div>
|
2020-10-08 05:57:23 +00:00
|
|
|
<div class="ajax" data-view="WorkflowMgr" data-action="info" <?php echo ($selworkflow ? "data-query=\"workflowid=".$selworkflow->getID()."\"" : "") ?>></div>
|
|
|
|
<?php
|
|
|
|
$this->columnEnd();
|
|
|
|
$this->columnStart(7);
|
|
|
|
?>
|
2021-05-28 12:18:26 +00:00
|
|
|
<div class="ajax" data-view="WorkflowMgr" data-action="form" data-afterload="()=>{runValidation();}" <?php echo ($selworkflow ? "data-query=\"workflowid=".$selworkflow->getID()."\"" : "") ?>></div>
|
2013-01-24 10:35:33 +00:00
|
|
|
<?php
|
2020-10-08 05:57:23 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->rowEnd();
|
2016-03-15 07:30:53 +00:00
|
|
|
$this->contentEnd();
|
2013-01-24 10:35:33 +00:00
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|