Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2018-12-18 06:19:18 +01:00
commit e252af2df4
26 changed files with 25561 additions and 20725 deletions

View File

@ -113,12 +113,17 @@
--------------------------------------------------------------------------------
Changes in version 5.1.10
--------------------------------------------------------------------------------
- add new hook on ViewDetails page
- running Controller::factory() will include class file only once
- use only Packagist for external dependencies
- set configured command timeout when creating pdf preview
- show numbers of reviews in main menu again
- do not send multiple emails after triggering a workflow transition, if a user
is involved in more than one of the following transitions
- fix javascript errors in out/out.TriggerWorkflow.php
- minor corrections in worklflow manager
- fix lots of javascript errors when removing, rewinding a workflow and
running, returning from a subworkflow
- show splash messages after triggering a workflow transition
--------------------------------------------------------------------------------

View File

@ -6089,10 +6089,11 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if (!$this->_workflowState)
$this->getWorkflowState();
$workflowstate = $this->_workflowState;
$transitions = $workflow->getNextTransitions($workflowstate);
foreach($transitions as $transition) {
if($this->triggerWorkflowTransitionIsAllowed($user, $transition)) {
$needwkflaction = true;
if($transitions = $workflow->getNextTransitions($workflowstate)) {
foreach($transitions as $transition) {
if($this->triggerWorkflowTransitionIsAllowed($user, $transition)) {
$needwkflaction = true;
}
}
}
}

View File

@ -12,7 +12,7 @@
<email>uwe@steinmann.cx</email>
<active>yes</active>
</lead>
<date>2018-11-13</date>
<date>2018-11-23</date>
<time>07:31:17</time>
<version>
<release>6.0.7</release>
@ -1636,6 +1636,22 @@ new optional parameter $listguest for SeedDMS_Core_Document::getReadAccessList()
remove deprecated methods SeedDMS_Core_Document::convert(), SeedDMS_Core_Document::wasConverted(), SeedDMS_Core_Document::viewOnline(), SeedDMS_Core_Document::getUrl()
</notes>
</release>
<release>
<date>2018-12-18</date>
<time>07:31:17</time>
<version>
<release>5.1.10</release>
<api>5.1.10</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
fix php warning if workflow state doesn' have next transition
</notes>
</release>
<release>
<date>2017-02-28</date>
<time>06:34:50</time>

View File

@ -49,7 +49,7 @@ class Controller {
if(!file_exists($filename))
$filename = '';
if($filename) {
require($filename);
require_once($filename);
$controller = new $classname($params);
/* Set some configuration parameters */
$controller->setParam('class', $class);

View File

@ -341,22 +341,11 @@ class Settings { /* {{{ */
exit;
}
}
$this->load($configFilePath);
if(!$this->load($configFilePath)) {
echo "Your configuration contains errors.";
exit;
}
// files with one of the following endings will be converted with the
// given commands for windows users
$this->_convertFileTypes = array(".doc" => "cscript \"" . $this->_rootDir."op/convert_word.js\" {SOURCE} {TARGET}",
".xls" => "cscript \"".$this->_rootDir."op/convert_excel.js\" {SOURCE} {TARGET}",
".ppt" => "cscript \"".$this->_rootDir."op/convert_pp.js\" {SOURCE} {TARGET}");
// uncomment the next line for linux users
// $this->_convertFileTypes = array(".doc" => "mswordview -o {TARGET} {SOURCE}");
if (!is_null($this->_smtpServer))
ini_set("SMTP", $this->_smtpServer);
if (!is_null($this->_smtpPort))
ini_set("smtp_port", $this->_smtpPort);
if (!is_null($this->_smtpSendFrom))
ini_set("sendmail_from", $this->_smtpSendFrom);
if (!is_null($this->_maxExecutionTime))
ini_set("max_execution_time", $this->_maxExecutionTime);
} /* }}} */

View File

@ -30,6 +30,9 @@ if(!defined("SEEDDMS_INSTALL") && file_exists(dirname($settings->_configFilePath
if(isset($settings->_extraPath))
ini_set('include_path', $settings->_extraPath. PATH_SEPARATOR .ini_get('include_path'));
/* composer is installed in pear directory */
require_once 'vendor/autoload.php';
if(isset($settings->_maxExecutionTime))
ini_set('max_execution_time', $settings->_maxExecutionTime);

View File

@ -46,9 +46,12 @@ if (!is_object($workflow)) {
}
if($workflow->remove()) {
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_workflow')));
} else {
$session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('error_rm_workflow')));
}
add_log_line("");
add_log_line("?workflowid=".$_POST["workflowid"]);
header("Location:../out/out.WorkflowMgr.php");
?>

View File

@ -32,23 +32,26 @@ if (!$user->isAdmin()) {
}
/* Check if the form data comes from a trusted request */
if(!checkFormKey('removeworkflowaction')) {
if(!checkFormKey('removeworkflowaction', 'GET')) {
UI::exitError(getMLText("workflow_editor"), getMLText("invalid_request_token"));
}
if (!isset($_POST["workflowactionid"]) || !is_numeric($_POST["workflowactionid"]) || intval($_POST["workflowactionid"])<1) {
if (!isset($_GET["workflowactionid"]) || !is_numeric($_GET["workflowactionid"]) || intval($_GET["workflowactionid"])<1) {
UI::exitError(getMLText("workflow_editor"), getMLText("invalid_version"));
}
$workflowaction = $dms->getWorkflowAction($_POST["workflowactionid"]);
$workflowaction = $dms->getWorkflowAction($_GET["workflowactionid"]);
if (!is_object($workflowaction)) {
UI::exitError(getMLText("workflow_editor"), getMLText("invalid_workflow_action"));
}
if($workflowaction->remove()) {
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_workflow_action')));
} else {
$session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('error_rm_workflow_action')));
}
add_log_line("?workflowactionid=".$_POST["workflowactionid"]);
add_log_line("?workflowactionid=".$_GET["workflowactionid"]);
header("Location:../out/out.WorkflowActionsMgr.php");
?>

View File

@ -32,23 +32,25 @@ if (!$user->isAdmin()) {
}
/* Check if the form data comes from a trusted request */
if(!checkFormKey('removeworkflowstate')) {
if(!checkFormKey('removeworkflowstate', 'GET')) {
UI::exitError(getMLText("workflow_editor"), getMLText("invalid_request_token"));
}
if (!isset($_POST["workflowstateid"]) || !is_numeric($_POST["workflowstateid"]) || intval($_POST["workflowstateid"])<1) {
if (!isset($_GET["workflowstateid"]) || !is_numeric($_GET["workflowstateid"]) || intval($_GET["workflowstateid"])<1) {
UI::exitError(getMLText("workflow_editor"), getMLText("invalid_version"));
}
$workflowstate = $dms->getWorkflowState($_POST["workflowstateid"]);
$workflowstate = $dms->getWorkflowState($_GET["workflowstateid"]);
if (!is_object($workflowstate)) {
UI::exitError(getMLText("workflow_editor"), getMLText("invalid_workflow_state"));
}
if($workflowstate->remove()) {
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_workflow_state')));
} else {
$session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('error_rm_workflow_state')));
}
add_log_line("?workflowstateid=".$_POST["workflowstateid"]);
add_log_line("?workflowstateid=".$_GET["workflowstateid"]);
header("Location:../out/out.WorkflowStatesMgr.php");
?>

View File

@ -55,7 +55,10 @@ if(!isset($_GET['action']) || $_GET['action'] == 'show') {
} else {
$index = $indexconf['Indexer']::open($settings->_luceneDir);
if(!$index) {
UI::exitError(getMLText("admin_tools"),getMLText("no_fulltextindex"));
$index = $indexconf['Indexer']::create($settings->_luceneDir);
if(!$index) {
UI::exitError(getMLText("admin_tools"),getMLText("no_fulltextindex"));
}
}
$indexconf['Indexer']::init($settings->_stopWordsFile);
}

View File

@ -34,20 +34,20 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$document = $dms->getDocument(intval($_POST["documentid"]));
$document = $dms->getDocument(intval($_GET["documentid"]));
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) {
if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
}
$version = $_POST["version"];
$version = $_GET["version"];
$version = $document->getContentByVersion($version);
if (!is_object($version)) {
@ -59,8 +59,8 @@ if (!is_object($workflow)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("document_has_no_workflow"));
}
if(isset($_POST["transition"]) && $_POST["transition"]) {
$transition = $dms->getWorkflowTransition($_POST["transition"]);
if(isset($_GET["transition"]) && $_GET["transition"]) {
$transition = $dms->getWorkflowTransition($_GET["transition"]);
if (!is_object($transition)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_workflow_transition"));
}

View File

@ -37,20 +37,20 @@ if (!$accessop->check_view_access($view, $_GET)) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$document = $dms->getDocument(intval($_POST["documentid"]));
$document = $dms->getDocument(intval($_GET["documentid"]));
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) {
if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
}
$version = $_POST["version"];
$version = $_GET["version"];
$version = $document->getContentByVersion($version);
if (!is_object($version)) {

View File

@ -34,20 +34,20 @@ $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user));
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$document = $dms->getDocument(intval($_POST["documentid"]));
$document = $dms->getDocument(intval($_GET["documentid"]));
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) {
if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
}
$version = $_POST["version"];
$version = $_GET["version"];
$version = $document->getContentByVersion($version);
if (!is_object($version)) {
@ -59,11 +59,11 @@ if (!is_object($workflow)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("document_has_no_workflow"));
}
if (!isset($_POST["subworkflow"]) || !is_numeric($_POST["subworkflow"]) || intval($_POST["subworkflow"])<1) {
if (!isset($_GET["subworkflow"]) || !is_numeric($_GET["subworkflow"]) || intval($_GET["subworkflow"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_workflow"));
}
$subworkflow = $dms->getWorkflow($_POST["subworkflow"]);
$subworkflow = $dms->getWorkflow($_GET["subworkflow"]);
if (!is_object($subworkflow)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_workflow"));
}

View File

@ -1,19 +0,0 @@
Copyright (c) 2016 The Cytoscape Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -117,6 +117,23 @@ $(document).ready( function() {
<?php
} /* }}} */
function actionmenu() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$selcategoryid = $this->params['selcategoryid'];
if($selcategoryid && $selcategoryid > 0) {
?>
<form style="display: inline-block;" method="post" action="../op/op.DefaultKeywords.php" >
<?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="hidden" name="categoryid" value="<?php echo $selcategoryid?>">
<input type="hidden" name="action" value="removecategory">
<button class="btn" type="submit"><i class="icon-remove"></i> <?php echo getMLText("rm_default_keyword_category")?></button>
</form>
<?php
}
} /* }}} */
function form() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -129,30 +146,27 @@ $(document).ready( function() {
if(!$category) {
?>
<form class="form-inline" action="../op/op.DefaultKeywords.php" method="post" id="form">
<form class="form-horizontal" action="../op/op.DefaultKeywords.php" method="post" id="form">
<?php echo createHiddenFieldWithKey('addcategory'); ?>
<input type="hidden" name="action" value="addcategory">
<?php printMLText("name");?>: <input type="text" class="name" name="name">
<input type="submit" class="btn" value="<?php printMLText("new_default_keyword_category"); ?>">
<?php
$this->formField(
getMLText("name"),
array(
'element'=>'input',
'type'=>'text',
'name'=>'name',
'value'=>''
)
);
$this->formSubmit("<i class=\"icon-save\"></i> ".getMLText('new_default_keyword_category'));
?>
</form>
<?php
} else {
$owner = $category->getOwner();
if ((!$user->isAdmin()) && ($owner->getID() != $user->getID())) return;
?>
<div class="control-group">
<label class="control-label"></label>
<div class="controls">
<form action="../op/op.DefaultKeywords.php" method="post">
<?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="Hidden" name="action" value="removecategory">
<input type="Hidden" name="categoryid" value="<?php echo $category->getID()?>">
<button type="submit" class="btn" title="<?php echo getMLText("delete")?>"><i class="icon-remove"></i> <?php printMLText("rm_default_keyword_category");?></button>
</form>
</div>
</div>
<div class="control-group">
<label class="control-label"><?php echo getMLText("name")?>:</label>
<div class="controls">
@ -229,14 +243,10 @@ $(document).ready( function() {
?>
<div class="row-fluid">
<div class="span4">
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="login"><?php printMLText("selection");?>:</label>
<div class="controls">
<select id="selector" class="input-xlarge">
<option value="-1"><?php echo getMLText("choose_category")?>
<option value="0"><?php echo getMLText("new_default_keyword_category")?>
<select class="chzn-select" id="selector" class="input-xlarge">
<option value="-1"><?php echo getMLText("choose_category")?>
<option value="0"><?php echo getMLText("new_default_keyword_category")?>
<?php
$selected=0;
@ -252,10 +262,8 @@ $(document).ready( function() {
}
?>
</select>
</div>
</div>
</form>
<?php $this->contentContainerEnd(); ?>
<div class="ajax" style="margin-bottom: 15px;" data-view="DefaultKeywords" data-action="actionmenu" <?php echo ($selcategoryid ? "data-query=\"categoryid=".$selcategoryid."\"" : "") ?>></div>
</div>
<div class="span8">

View File

@ -74,14 +74,13 @@ $(document).ready(function() {
<div class="tab-content">
<div class="tab-pane active" id="preview_markdown">
<?php
require_once('parsedown/Parsedown.php');
$Parsedown = new Parsedown();
echo $Parsedown->text(file_get_contents($dms->contentDir . $version->getPath()));
?>
</div>
<div class="tab-pane" id="preview_plain">
<?php
echo "<pre>".htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()))."</pre>";
echo "<pre>".htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()), ENT_SUBSTITUTE)."</pre>";
?>
</div>
</div>
@ -121,7 +120,7 @@ $this->contentHeading(getMLText("content"));
<input type="hidden" name="documentid" value="<?php echo $document->getId(); ?>" />
<textarea id="markdown" name="data" width="100%" rows="20">
<?php
echo htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()));
echo htmlspecialchars(file_get_contents($dms->contentDir . $version->getPath()), ENT_SUBSTITUTE);
?>
</textarea>
<button id="update" type="submit" class="btn btn-primary"><i class="icon-save"></i> <?php printMLText("save"); ?></button>

View File

@ -45,12 +45,13 @@ class SeedDMS_View_Help extends SeedDMS_Bootstrap_Style {
<div class="span4">
<legend>Table of contents</legend>
<?php
$d = dir("../languages/".$this->params['session']->getLanguage()."/help");
$dir = "../languages/".$this->params['session']->getLanguage()."/help";
$d = dir($dir);
echo "<ul>";
while (false !== ($entry = $d->read())) {
if($entry != '..' && $entry != '.') {
$path_parts = pathinfo($dir."/".$entry);
if($path_parts['extension'] == 'html' || $path_parts['extension'] == 'md') {
if(isset($path_parts['extension']) && ($path_parts['extension'] == 'html' || $path_parts['extension'] == 'md')) {
echo "<li><a href=\"../out/out.Help.php?context=".$path_parts['filename']."\">".getMLText('help_'.$path_parts['filename'], array(), $path_parts['filename'])."</a></li>";
}
}

View File

@ -584,7 +584,7 @@ $this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site'));
}
break;
default:
$this->showTextField("extensions[".$extname."][".$confkey."]", isset($settings->_extensions[$extname][$confkey]) ? $settings->_extensions[$extname][$confkey] : '', '', '');
$this->showTextField("extensions[".$extname."][".$confkey."]", isset($settings->_extensions[$extname][$confkey]) ? $settings->_extensions[$extname][$confkey] : '', isset($conf['type']) ? $conf['type'] : '', isset($conf['placeholder']) ? $conf['placeholder'] : '');
}
$html = ob_get_clean();
$this->showConfigPlain($conf['title'], isset($conf['help']) ? $conf['help'] : '', $html);

View File

@ -192,7 +192,6 @@ $(document).ready( function() {
$user = $this->params['user'];
$seluser = $this->params['seluser'];
$quota = $this->params['quota'];
$workflowmode = $this->params['workflowmode'];
$undeluserids = $this->params['undeluserids'];
$enableemail = $this->params['enableemail'];

View File

@ -509,6 +509,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<div class="row-fluid">
<div class="span4">
<?php
$txt = $this->callHook('startLeftColumn', $document);
if(is_string($txt))
echo $txt;
$this->documentInfos();
if($accessop->check_controller_access('ViewOnline', array('action'=>'run'))) {
$this->preview();
@ -1027,9 +1030,9 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$this->contentContainerStart();
if($user->isAdmin()) {
if(SeedDMS_Core_DMS::checkIfEqual($workflow->getInitState(), $latestContent->getWorkflowState())) {
print "<form action=\"../out/out.RemoveWorkflowFromDocument.php\" method=\"get\">".createHiddenFieldWithKey('removeworkflowfromdocument')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" /><button type=\"submit\" class=\"btn\"><i class=\"icon-remove\"></i> ".getMLText('rm_workflow')."</button></form>";
print "<form action=\"../out/out.RemoveWorkflowFromDocument.php\" method=\"get\"><input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" /><button type=\"submit\" class=\"btn\"><i class=\"icon-remove\"></i> ".getMLText('rm_workflow')."</button></form>";
} else {
print "<form action=\"../out/out.RewindWorkflow.php\" method=\"post\">".createHiddenFieldWithKey('rewindworkflow')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" /><button type=\"submit\" class=\"btn\"><i class=\"icon-refresh\"></i> ".getMLText('rewind_workflow')."</button></form>";
print "<form action=\"../out/out.RewindWorkflow.php\" method=\"get\"><input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" /><button type=\"submit\" class=\"btn\"><i class=\"icon-refresh\"></i> ".getMLText('rewind_workflow')."</button></form>";
}
}
@ -1148,7 +1151,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
}
}
if($subworkflows) {
echo "<form action=\"../out/out.RunSubWorkflow.php\" method=\"post\">".createHiddenFieldWithKey('runsubworkflow')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" />";
echo "<form action=\"../out/out.RunSubWorkflow.php\" method=\"get\"><input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" />";
echo "<select name=\"subworkflow\">";
foreach($subworkflows as $subworkflow) {
echo "<option value=\"".$subworkflow->getID()."\">".$subworkflow->getName()."</option>";
@ -1180,7 +1183,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
/* If the init state has not been left, return is always possible */
if($workflow->getInitState()->getID() == $latestContent->getWorkflowState()->getID()) {
echo "Initial state of sub workflow has not been left. Return to parent workflow is possible<br />";
echo "<form action=\"../out/out.ReturnFromSubWorkflow.php\" method=\"post\">".createHiddenFieldWithKey('returnfromsubworkflow')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" />";
echo "<form action=\"../out/out.ReturnFromSubWorkflow.php\" method=\"get\"><input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" />";
echo "<input type=\"submit\" class=\"btn\" value=\"".getMLText('return_from_subworkflow')."\" />";
echo "</form>";
} else {
@ -1195,7 +1198,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
foreach($transitions as $transition) {
if($latestContent->triggerWorkflowTransitionIsAllowed($user, $transition)) {
echo "Triggering transition is allowed<br />";
echo "<form action=\"../out/out.ReturnFromSubWorkflow.php\" method=\"post\">".createHiddenFieldWithKey('returnfromsubworkflow')."<input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" /><input type=\"hidden\" name=\"transition\" value=\"".$transition->getID()."\" />";
echo "<form action=\"../out/out.ReturnFromSubWorkflow.php\" method=\"get\"><input type=\"hidden\" name=\"documentid\" value=\"".$documentid."\" /><input type=\"hidden\" name=\"version\" value=\"".$latestContent->getVersion()."\" /><input type=\"hidden\" name=\"transition\" value=\"".$transition->getID()."\" />";
echo "<input type=\"submit\" class=\"btn\" value=\"".getMLText('return_from_subworkflow')."\" />";
echo "</form>";

View File

@ -100,18 +100,34 @@ $(document).ready( function() {
}
} /* }}} */
function actionmenu() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$selworkflowaction = $this->params['selworkflowaction'];
if($selworkflowaction && !$selworkflowaction->isUsed()) {
?>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<?php echo getMLText('action'); ?>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<?php
if(!$selworkflowaction->isUsed()) {
echo '<li><a href="../op/op.RemoveWorkflowAction.php?workflowactionid='.$selworkflowaction->getID().'&formtoken='.createFormKey('removeworkflowaction').'"><i class="icon-remove"></i> '.getMLText("rm_workflow_action").'</a><li>';
}
?>
</ul>
</div>
<?php
}
} /* }}} */
function showWorkflowActionForm($action) { /* {{{ */
if($action) {
if($action->isUsed()) {
$this->infoMsg(getMLText('workflow_action_in_use'));
} else {
?>
<form class="form-inline" action="../op/op.RemoveWorkflowAction.php" method="post">
<?php echo createHiddenFieldWithKey('removeworkflowaction'); ?>
<input type="hidden" name="workflowactionid" value="<?php print $action->getID();?>">
<button type="submit" class="btn"><i class="icon-remove"></i> <?php printMLText("rm_workflow_action");?></button>
</form>
<?php
}
}
?>
@ -169,8 +185,7 @@ $(document).ready( function() {
<div class="row-fluid">
<div class="span4">
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal">
<form class="form-horizontal">
<?php
$options = array();
$options[] = array('-1', getMLText("choose_workflow_action"));
@ -179,16 +194,17 @@ $(document).ready( function() {
$options[] = array($currWorkflowAction->getID(), htmlspecialchars($currWorkflowAction->getName()), $selworkflowaction && $currWorkflowAction->getID()==$selworkflowaction->getID());
}
$this->formField(
getMLText("selection"),
null, //getMLText("selection"),
array(
'element'=>'select',
'id'=>'selector',
'class'=>'chzn-select',
'options'=>$options
)
);
?>
</form>
<?php $this->contentContainerEnd(); ?>
</form>
<div class="ajax" style="margin-bottom: 15px;" data-view="WorkflowActionsMgr" data-action="actionmenu" <?php echo ($selworkflowaction ? "data-query=\"workflowactionid=".$selworkflowaction->getID()."\"" : "") ?>></div>
<div class="ajax" data-view="WorkflowActionsMgr" data-action="info" <?php echo ($selworkflowaction ? "data-query=\"workflowactionid=".$selworkflowaction->getID()."\"" : "") ?>></div>
</div>

View File

@ -73,13 +73,39 @@ $(document).ready(function() {
$dms = $this->params['dms'];
$user = $this->params['user'];
$selworkflow = $this->params['selworkflow'];
if($selworkflow) { ?>
if($selworkflow && $selworkflow->getTransitions()) { ?>
<div id="workflowgraph">
<iframe src="out.WorkflowGraph.php?workflow=<?php echo $selworkflow->getID(); ?>" width="100%" height="661" style="border: 1px solid #e3e3e3; border-radius: 4px; margin: -1px;"></iframe>
</div>
<?php }
} /* }}} */
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()) {
?>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<?php echo getMLText('action'); ?>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<?php
if(!$selworkflow->isUsed()) {
echo '<li><a href="../out/out.RemoveWorkflow.php?workflowid='.$selworkflow->getID().'"><i class="icon-remove"></i> '.getMLText("rm_workflow").'</a><li>';
}
?>
</ul>
</div>
<?php
}
} /* }}} */
function showWorkflowForm($workflow) { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -137,26 +163,16 @@ $(document).ready(function() {
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal" action="../op/op.WorkflowMgr.php" method="post" enctype="multipart/form-data">
<?php
if($workflow) {
echo createHiddenFieldWithKey('editworkflow');
if($workflow) {
echo createHiddenFieldWithKey('editworkflow');
?>
<input type="hidden" name="workflowid" value="<?php print $workflow->getID();?>">
<input type="hidden" name="action" value="editworkflow">
<?php
} else {
echo createHiddenFieldWithKey('addworkflow');
} else {
echo createHiddenFieldWithKey('addworkflow');
?>
<input type="hidden" name="action" value="addworkflow">
<?php
}
?>
<?php
if($workflow && !$workflow->isUsed()) {
?>
<div class="controls">
<a class="standardText btn" href="../out/out.RemoveWorkflow.php?workflowid=<?php print $workflow->getID();?>"><i class="icon-remove"></i> <?php printMLText("rm_workflow");?></a>
</div>
<?php
}
$this->formField(
@ -318,8 +334,7 @@ $(document).ready(function() {
<div class="row-fluid">
<div class="span5">
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal">
<form class="form-horizontal">
<?php
$options = array();
$options[] = array("-1", getMLText("choose_workflow"));
@ -328,17 +343,18 @@ $(document).ready(function() {
$options[] = array($currWorkflow->getID(), htmlspecialchars($currWorkflow->getName()),$selworkflow && $currWorkflow->getID()==$selworkflow->getID());
}
$this->formField(
getMLText("selection"),
null, //getMLText("selection"),
array(
'element'=>'select',
'id'=>'selector',
'class'=>'chzn-select',
'options'=>$options
)
);
?>
</form>
<?php $this->contentContainerEnd(); ?>
<div class="ajax" data-view="WorkflowMgr" data-action="info" <?php echo ($selworkflow ? "data-query=\"workflowid=".$selworkflow->getID()."\"" : "") ?>></div>
</form>
<div class="ajax" style="margin-bottom: 15px;" data-view="WorkflowMgr" data-action="actionmenu" <?php echo ($selworkflow ? "data-query=\"workflowid=".$selworkflow->getID()."\"" : "") ?>></div>
<div class="ajax" data-view="WorkflowMgr" data-action="info" <?php echo ($selworkflow ? "data-query=\"workflowid=".$selworkflow->getID()."\"" : "") ?>></div>
</div>
<div class="span7">

View File

@ -101,18 +101,34 @@ $(document).ready(function() {
}
} /* }}} */
function actionmenu() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$selworkflowstate = $this->params['selworkflowstate'];
if($selworkflowstate && !$selworkflowstate->isUsed()) {
?>
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<?php echo getMLText('action'); ?>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<?php
if(!$selworkflowstate->isUsed()) {
echo '<li><a href="../op/op.RemoveWorkflowState.php?workflowstateid='.$selworkflowstate->getID().'&formtoken='.createFormKey('removeworkflowstate').'"><i class="icon-remove"></i> '.getMLText("rm_workflow_state").'</a><li>';
}
?>
</ul>
</div>
<?php
}
} /* }}} */
function showWorkflowStateForm($state) { /* {{{ */
if($state) {
if($state->isUsed()) {
$this->infoMsg(getMLText('workflow_state_in_use'));
} else {
?>
<form class="form-inline" action="../op/op.RemoveWorkflowState.php" method="post">
<?php echo createHiddenFieldWithKey('removeworkflowstate'); ?>
<input type="hidden" name="workflowstateid" value="<?php print $state->getID();?>">
<button type="submit" class="btn"><i class="icon-remove"></i> <?php printMLText("rm_workflow_state");?></button>
</form>
<?php
}
}
?>
@ -182,8 +198,7 @@ $(document).ready(function() {
<div class="row-fluid">
<div class="span4">
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal">
<form class="form-horizontal">
<?php
$options = array();
$options[] = array("-1", getMLText("choose_workflow_state"));
@ -192,16 +207,17 @@ $(document).ready(function() {
$options[] = array($currWorkflowState->getID(), htmlspecialchars($currWorkflowState->getName()), $selworkflowstate && $currWorkflowState->getID()==$selworkflowstate->getID());
}
$this->formField(
getMLText("selection"),
null, //getMLText("selection"),
array(
'element'=>'select',
'id'=>'selector',
'class'=>'chzn-select',
'options'=>$options
)
);
?>
</form>
<?php $this->contentContainerEnd(); ?>
</form>
<div class="ajax" style="margin-bottom: 15px;" data-view="WorkflowStatesMgr" data-action="actionmenu" <?php echo ($selworkflowstate ? "data-query=\"workflowstateid=".$selworkflowstate->getID()."\"" : "") ?>></div>
<div class="ajax" data-view="WorkflowStatesMgr" data-action="info" <?php echo ($selworkflowstate ? "data-query=\"workflowstateid=".$selworkflowstate->getID()."\"" : "") ?>></div>
</div>