1
0
Fork 0

recoding to use as plugin with CL

Dieser Commit ist enthalten in:
o.pinke 2020-08-20 18:30:16 +02:00
Ursprung 244621b05f
Commit e8b0c80921
22 geänderte Dateien mit 2187 neuen und 2341 gelöschten Zeilen

1
.gitignore vendored Normale Datei
Datei anzeigen

@ -0,0 +1 @@
/.project

61
cl_plugin.xml Normale Datei
Datei anzeigen

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<plugin>
<general active="1">
<plugin_name>ConLite Workflow</plugin_name>
<plugin_foldername>cl-workflow</plugin_foldername>
<uuid>6BAFECC4-AF63-51CE-839D-A4E5FBBEB4A9</uuid>
<description>ConLite Workflow adds a simple worflow management to your ConLite CMS</description>
<author>ConLite Team</author>
<copyright>ConLite Team</copyright>
<mail>cl-workflow@conlite.org</mail>
<website>https://conlite.org</website>
<version>0.1.0</version>
<license>GNU Lesser General Public License</license>
</general>
<requirements php="5.6">
<conlite minversion="2.1.0" />
</requirements>
<conlite>
<areas>
<area menuless="0">workflow</area>
<area parent="workflow" menuless="0">workflow_common</area>
<area parent="workflow" menuless="0">workflow_steps</area>
<area parent="workflow" menuless="0">workflow_step_edit</area>
<area parent="con" menuless="0">con_workflow</area>
</areas>
<actions>
<action area="workflow_common">workflow_show</action>
<action area="workflow_common">workflow_create</action>
<action area="workflow_common">workflow_save</action>
<action area="workflow">workflow_delete</action>
<action area="workflow_steps">workflow_step_edit</action>
<action area="workflow_steps">workflow_step_up</action>
<action area="workflow_steps">workflow_step_down</action>
<action area="workflow_steps">workflow_save_step</action>
<action area="workflow_steps">workflow_create_step</action>
<action area="workflow_steps">workflow_step_delete</action>
<action area="workflow_steps">workflow_user_up</action>
<action area="workflow_steps">workflow_user_down</action>
<action area="workflow_steps">workflow_create_user</action>
<action area="workflow_steps">workflow_user_delete</action>
<action area="str">workflow_cat_assign</action>
<action area="con">workflow_do_action</action>
<action area="str">workflow_inherit_down</action>
<action area="con_workflow">workflow_task_user_select</action>
<action area="con_workflow">workflow_do_action</action>
</actions>
<frames>
<frame area="workflow" filetype="main" name="cl-workflow/includes/include.workflow_left_top.php" frameId="1" />
<frame area="workflow" filetype="main" name="cl-workflow/includes/include.workflow_list.php" frameId="2" />
<frame area="workflow_common" filetype="main" name="cl-workflow/includes/include.workflow_edit.php" frameId="4" />
<frame area="workflow" filetype="main" name="cl-workflow/includes/include.workflow_subnav.php" frameId="3" />
<frame area="workflow_steps" filetype="main" name="cl-workflow/includes/include.workflow_steps.php" frameId="4" />
<frame area="con_workflow" filetype="main" name="cl-workflow/includes/include.workflow_tasks.php" frameId="4" />
</frames>
<nav_sub>
<nav area="workflow" level="0" navm="extra">cl-workflow/xml/lang_de_DE.xml;navigation/extra/workflow/main</nav>
<nav area="workflow_common" level="1" navm="0">cl-workflow/xml/lang_de_DE.xml;navigation/extra/workflow/settings</nav>
<nav area="workflow_steps" level="1" navm="0">cl-workflow/xml/lang_de_DE.xml;navigation/extra/workflow/steps</nav>
</nav_sub>
</conlite>
</plugin>

Datei anzeigen

@ -30,20 +30,6 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
$cfg["tab"]["workflow"] = $cfg['sql']['sqlprefix'] . "_piwf_workflow";
$cfg["tab"]["workflow_allocation"] = $cfg['sql']['sqlprefix'] . "_piwf_allocation";
$cfg["tab"]["workflow_art_allocation"] = $cfg['sql']['sqlprefix'] . "_piwf_art_allocation";
$cfg["tab"]["workflow_items"] = $cfg['sql']['sqlprefix'] . "_piwf_items";
$cfg["tab"]["workflow_user_sequences"] = $cfg['sql']['sqlprefix'] . "_piwf_user_sequences";
$cfg["tab"]["workflow_actions"] = $cfg['sql']['sqlprefix'] . "_piwf_actions";
plugin_include('workflow', 'classes/class.workflowactions.php');
plugin_include('workflow', 'classes/class.workflowallocation.php');
plugin_include('workflow', 'classes/class.workflowartallocation.php');
plugin_include('workflow', 'classes/class.workflowitems.php');
plugin_include('workflow', 'classes/class.workflowusersequence.php');
/** /**
* Class Workflows * Class Workflows
* Class for workflow management * Class for workflow management
@ -136,45 +122,4 @@ class Workflow extends Item {
parent::__construct($cfg["tab"]["workflow"], "idworkflow"); parent::__construct($cfg["tab"]["workflow"], "idworkflow");
} }
} }
/* Helper functions */
function getWorkflowForCat($idcat) {
global $lang, $cfg;
$idcatlang = getCatLang($idcat, $lang);
$workflows = new WorkflowAllocations;
$workflows->select("idcatlang = '$idcatlang'");
if ($obj = $workflows->next()) {
/* Sanity: Check if the workflow still exists */
$workflow = new Workflow;
$res = $workflow->loadByPrimaryKey($obj->get("idworkflow"));
if ($res == false) {
return 0;
} else {
return $obj->get("idworkflow");
}
}
}
function getCatLang($idcat, $idlang) {
global $lang, $cfg;
$db = new DB_ConLite;
/* Get the idcatlang */
$sql = "SELECT idcatlang FROM "
. $cfg["tab"]["cat_lang"] .
" WHERE idlang = '" . Contenido_Security::escapeDB($idlang, $db) . "' AND
idcat = '" . Contenido_Security::escapeDB($idcat, $db) . "'";
$db->query($sql);
if ($db->next_record()) {
return ($db->f("idcatlang"));
}
}
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -25,8 +26,7 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
@ -38,77 +38,69 @@ if(!defined('CON_FRAMEWORK')) {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowActions extends ItemCollection { class WorkflowActions extends ItemCollection {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg; parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction");
parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction");
$this->_setItemClass("WorkflowAction"); $this->_setItemClass("WorkflowAction");
} }
/** /**
* *
* @param type $idworkflowitem * @param type $idworkflowitem
* @param type $action * @param type $action
* @return boolean * @return boolean
*/ */
function get($idworkflowitem, $action) function get($idworkflowitem, $action) {
{ $this->select("idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "' AND action = '" . Contenido_Security::escapeDB($action, NULL) . "'");
$this->select("idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."' AND action = '".Contenido_Security::escapeDB($action, NULL)."'"); if ($this->next()) {
if ($this->next()) return true;
{ } else {
return true; return false;
} else { }
return false; }
}
} function getAvailableWorkflowActions() {
$availableWorkflowActions = array(
function getAvailableWorkflowActions () "publish" => i18n("Publish article", "workflow"),
{ "lock" => i18n("Lock article", "workflow"),
$availableWorkflowActions = array ( "last" => i18n("Move back to last editor", "workflow"),
"publish" => i18n("Publish article", "workflow"), "reject" => i18n("Reject article", "workflow"),
"lock" => i18n("Lock article", "workflow"), "articleedit" => i18n("Edit article content", "workflow"),
"last" => i18n("Move back to last editor", "workflow"), "propertyedit" => i18n("Edit article properties", "workflow"),
"reject" => i18n("Reject article", "workflow"), "templateedit" => i18n("Edit template", "workflow"),
"articleedit" => i18n("Edit article content", "workflow"), "revise" => i18n("Revise article", "workflow"));
"propertyedit" => i18n("Edit article properties", "workflow"),
"templateedit" => i18n("Edit template", "workflow"), return($availableWorkflowActions);
"revise" => i18n("Revise article", "workflow")); }
return($availableWorkflowActions); function set($idworkflowitem, $action) {
} $this->select("idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "' AND action = '" . Contenido_Security::escapeDB($action, NULL) . "'");
if (!$this->next()) {
$newitem = parent::createNewItem();
$newitem->setField("idworkflowitem", $idworkflowitem);
$newitem->setField("action", $action);
$newitem->store();
}
}
function remove($idworkflowitem, $action) {
$this->select("idworkflowitem = '$idworkflowitem' AND action = '$action'");
if ($item = $this->next()) {
$this->delete($item->getField("idworkflowaction"));
}
}
function select($where = "", $group_by = "", $order_by = "", $limit = "") {
global $client;
return parent::select($where, $group_by, $order_by, $limit);
}
function set ($idworkflowitem, $action)
{
$this->select("idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."' AND action = '".Contenido_Security::escapeDB($action, NULL)."'");
if (!$this->next())
{
$newitem = parent::createNewItem();
$newitem->setField("idworkflowitem",$idworkflowitem);
$newitem->setField("action",$action);
$newitem->store();
}
}
function remove ($idworkflowitem, $action)
{
$this->select("idworkflowitem = '$idworkflowitem' AND action = '$action'");
if ($item = $this->next())
{
$this->delete($item->getField("idworkflowaction"));
}
}
function select ($where = "", $group_by = "", $order_by = "", $limit = "")
{
global $client;
return parent::select($where, $group_by, $order_by, $limit);
}
} }
/** /**
@ -119,14 +111,16 @@ class WorkflowActions extends ItemCollection {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowAction extends Item { class WorkflowAction extends Item {
/** /**
* Constructor * Constructor
* @global type $cfg * @global type $cfg
*/ */
function __construct() { function __construct() {
global $cfg; global $cfg;
parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction"); parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction");
} }
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -25,12 +26,10 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
/** /**
* Class WorkflowAllocations * Class WorkflowAllocations
* Class for workflow allocation management * Class for workflow allocation management
@ -39,112 +38,100 @@ if(!defined('CON_FRAMEWORK')) {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowAllocations extends ItemCollection { class WorkflowAllocations extends ItemCollection {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg; parent::__construct($cfg["tab"]["workflow_allocation"], "idallocation");
parent::__construct($cfg["tab"]["workflow_allocation"], "idallocation");
$this->_setItemClass("WorkflowAllocation"); $this->_setItemClass("WorkflowAllocation");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
function WorkflowAllocations() function WorkflowAllocations() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
function delete ($idallocation) function delete($idallocation) {
{ global $cfg, $lang;
global $cfg, $lang;
$obj = new WorkflowAllocation; $obj = new WorkflowAllocation;
$obj->loadByPrimaryKey($idallocation); $obj->loadByPrimaryKey($idallocation);
$idcatlang = $obj->get("idcatlang");
$db = new DB_ConLite; $idcatlang = $obj->get("idcatlang");
$sql = "SELECT idcat FROM ".$cfg["tab"]["cat_lang"]." WHERE idcatlang = '".Contenido_Security::toInteger($idcatlang)."'";
$db->query($sql); $db = new DB_ConLite;
$db->next_record(); $sql = "SELECT idcat FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcatlang = '" . Contenido_Security::toInteger($idcatlang) . "'";
$idcat = $db->f("idcat"); $db->query($sql);
$db->next_record();
$sql = "SELECT idart FROM ".$cfg["tab"]["cat_art"]." WHERE idcat = '".Contenido_Security::toInteger($idcat)."'"; $idcat = $db->f("idcat");
$db->query($sql);
$sql = "SELECT idart FROM " . $cfg["tab"]["cat_art"] . " WHERE idcat = '" . Contenido_Security::toInteger($idcat) . "'";
while ($db->next_record()) $db->query($sql);
{
$idarts[] = $db->f("idart"); while ($db->next_record()) {
} $idarts[] = $db->f("idart");
}
$idartlangs = array();
$idartlangs = array();
if (is_array($idarts))
{ if (is_array($idarts)) {
foreach ($idarts as $idart) foreach ($idarts as $idart) {
{ $sql = "SELECT idartlang FROM " . $cfg["tab"]["art_lang"] . " WHERE idart = '" . Contenido_Security::toInteger($idart) . "' and idlang = '" . Contenido_Security::toInteger($lang) . "'";
$sql = "SELECT idartlang FROM ".$cfg["tab"]["art_lang"]." WHERE idart = '".Contenido_Security::toInteger($idart)."' and idlang = '".Contenido_Security::toInteger($lang)."'"; $db->query($sql);
$db->query($sql); if ($db->next_record()) {
if ($db->next_record()) $idartlangs[] = $db->f("idartlang");
{ }
$idartlangs[] = $db->f("idartlang"); }
} }
}
} $workflowArtAllocation = new WorkflowArtAllocation;
$workflowArtAllocations = new WorkflowArtAllocations;
$workflowArtAllocation = new WorkflowArtAllocation;
$workflowArtAllocations = new WorkflowArtAllocations; foreach ($idartlangs as $idartlang) {
$workflowArtAllocation->loadBy("idartlang", $idartlang);
foreach ($idartlangs as $idartlang) $workflowArtAllocations->delete($workflowArtAllocation->get("idartallocation"));
{ }
$workflowArtAllocation->loadBy("idartlang", $idartlang);
$workflowArtAllocations->delete($workflowArtAllocation->get("idartallocation")); parent::delete($idallocation);
} }
function create($idworkflow, $idcatlang) {
$this->select("idcatlang = '$idcatlang'");
if ($this->next() !== false) {
$this->lasterror = i18n("Category already has a workflow assigned", "workflow");
return false;
}
$workflows = new Workflows;
$workflows->select("idworkflow = '$idworkflow'");
if ($workflows->next() === false) {
$this->lasterror = i18n("Workflow doesn't exist", "workflow");
return false;
}
$newitem = parent::createNewItem();
if (!$newitem->setWorkflow($idworkflow)) {
$this->lasterror = $newitem->lasterror;
$workflows->delete($newitem->getField("idallocation"));
return false;
}
if (!$newitem->setCatLang($idcatlang)) {
$this->lasterror = $newitem->lasterror;
$workflows->delete($newitem->getField("idallocation"));
return false;
}
$newitem->store();
return ($newitem);
}
parent::delete($idallocation);
}
function create ($idworkflow, $idcatlang)
{
$this->select("idcatlang = '$idcatlang'");
if ($this->next() !== false)
{
$this->lasterror = i18n("Category already has a workflow assigned", "workflow");
return false;
}
$workflows = new Workflows;
$workflows->select("idworkflow = '$idworkflow'");
if ($workflows->next() === false)
{
$this->lasterror = i18n("Workflow doesn't exist", "workflow");
return false;
}
$newitem = parent::createNewItem();
if (!$newitem->setWorkflow($idworkflow))
{
$this->lasterror = $newitem->lasterror;
$workflows->delete($newitem->getField("idallocation"));
return false;
}
if (!$newitem->setCatLang($idcatlang))
{
$this->lasterror = $newitem->lasterror;
$workflows->delete($newitem->getField("idallocation"));
return false;
}
$newitem->store();
return ($newitem);
}
} }
/** /**
@ -155,88 +142,82 @@ class WorkflowAllocations extends ItemCollection {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowAllocation extends Item { class WorkflowAllocation extends Item {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg;
parent::__construct($cfg["tab"]["workflow_allocation"], "idallocation");
parent::__construct($cfg["tab"]["workflow_allocation"], "idallocation"); }
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
function WorkflowAllocation() function WorkflowAllocation() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
/** /**
* Overridden setField function. Users should only use setWorkflow. * Overridden setField function. Users should only use setWorkflow.
* @param string $field Void field since we override the usual setField function * @param string $field Void field since we override the usual setField function
* @param string $value Void field since we override the usual setField function * @param string $value Void field since we override the usual setField function
*/ */
function setField($field, $value, $bSafe = true) function setField($field, $value, $bSafe = true) {
{ die("Don't use setField for WorkflowAllocation items! Use setWorkflow instead!");
die("Don't use setField for WorkflowAllocation items! Use setWorkflow instead!"); }
}
/**
/**
* setWorkflow sets the workflow for the current item. * setWorkflow sets the workflow for the current item.
* @param int $idworkflow Workflow-ID to set the item to * @param int $idworkflow Workflow-ID to set the item to
*/ */
function setWorkflow ($idworkflow) function setWorkflow($idworkflow) {
{ $workflows = new Workflows;
$workflows = new Workflows;
$workflows->select("idworkflow = '$idworkflow'"); $workflows->select("idworkflow = '$idworkflow'");
if ($workflows->next() === false)
{
$this->lasterror = i18n("Workflow doesn't exist", "workflow");
return false;
}
parent::setField("idworkflow", $idworkflow);
parent::store();
return true;
}
/** if ($workflows->next() === false) {
$this->lasterror = i18n("Workflow doesn't exist", "workflow");
return false;
}
parent::setField("idworkflow", $idworkflow);
parent::store();
return true;
}
/**
* setCatLang sets the idcatlang for the current item. Should * setCatLang sets the idcatlang for the current item. Should
* only be called by the create function. * only be called by the create function.
* @param int $idcatlang idcatlang to set. * @param int $idcatlang idcatlang to set.
*/ */
function setCatLang ($idcatlang) function setCatLang($idcatlang) {
{ global $cfg;
global $cfg;
$allocations = new WorkflowAllocations;
$allocations = new WorkflowAllocations;
$allocations->select("idcatlang = '$idcatlang'");
$allocations->select("idcatlang = '$idcatlang'");
if ($allocations->next() !== false) {
if ($allocations->next() !== false) $this->lasterror = i18n("Category already has a workflow assigned", "workflow");
{ return false;
$this->lasterror = i18n("Category already has a workflow assigned", "workflow"); }
return false;
} $db = new DB_ConLite;
$sql = "SELECT idcatlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcatlang = '" . Contenido_Security::toInteger($idcatlang) . "'";
$db = new DB_ConLite; $db->query($sql);
$sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcatlang = '".Contenido_Security::toInteger($idcatlang)."'";
$db->query($sql); if (!$db->next_record()) {
$this->lasterror = i18n("Category doesn't exist, assignment failed", "workflow");
if (!$db->next_record()) return false;
{ }
$this->lasterror = i18n("Category doesn't exist, assignment failed", "workflow");
return false; parent::setField("idcatlang", $idcatlang);
} parent::store();
return true;
}
parent::setField("idcatlang", $idcatlang);
parent::store();
return true;
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -26,12 +27,10 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
/** /**
* Class WorkflowArtAllocations * Class WorkflowArtAllocations
* Class for workflow art allocation management * Class for workflow art allocation management
@ -40,53 +39,49 @@ if(!defined('CON_FRAMEWORK')) {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowArtAllocations extends ItemCollection { class WorkflowArtAllocations extends ItemCollection {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg; parent::__construct($cfg["tab"]["workflow_art_allocation"], "idartallocation");
parent::__construct($cfg["tab"]["workflow_art_allocation"], "idartallocation");
$this->_setItemClass("WorkflowArtAllocation"); $this->_setItemClass("WorkflowArtAllocation");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
function WorkflowArtAllocations() function WorkflowArtAllocations() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
function create ($idartlang) function create($idartlang) {
{ global $cfg;
global $cfg;
$sql = "SELECT idartlang FROM " . $cfg["tab"]["art_lang"] .
$sql = "SELECT idartlang FROM " .$cfg["tab"]["art_lang"]. " WHERE idartlang = '" . Contenido_Security::escapeDB($idartlang, $this->db) . "'";
" WHERE idartlang = '".Contenido_Security::escapeDB($idartlang, $this->db)."'";
$this->db->query($sql);
if (!$this->db->next_record()) {
$this->lasterror = i18n("Article doesn't exist", "workflow");
return false;
}
$this->select("idartlang = '$idartlang'");
if ($this->next() !== false) {
$this->lasterror = i18n("Article is already assigned to a usersequence step.", "workflow");
return false;
}
$newitem = parent::createNewItem();
$newitem->setField("idartlang", $idartlang);
$newitem->store();
return ($newitem);
}
$this->db->query($sql);
if (!$this->db->next_record())
{
$this->lasterror = i18n("Article doesn't exist", "workflow");
return false;
}
$this->select("idartlang = '$idartlang'");
if ($this->next() !== false)
{
$this->lasterror = i18n("Article is already assigned to a usersequence step.", "workflow");
return false;
}
$newitem = parent::createNewItem();
$newitem->setField("idartlang",$idartlang);
$newitem->store();
return ($newitem);
}
} }
/** /**
@ -97,265 +92,241 @@ class WorkflowArtAllocations extends ItemCollection {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowArtAllocation extends Item { class WorkflowArtAllocation extends Item {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg;
parent::__construct($cfg["tab"]["workflow_art_allocation"], "idartallocation");
parent::__construct($cfg["tab"]["workflow_art_allocation"], "idartallocation"); }
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
function WorkflowArtAllocation() function WorkflowArtAllocation() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
function getWorkflowItem () function getWorkflowItem() {
{ $userSequence = new WorkflowUserSequence;
$userSequence = new WorkflowUserSequence; $userSequence->loadByPrimaryKey($this->values["idusersequence"]);
$userSequence->loadByPrimaryKey($this->values["idusersequence"]);
return ($userSequence->getWorkflowItem());
return ($userSequence->getWorkflowItem()); }
}
/**
/**
* Returns the current item position * Returns the current item position
* @param string $field Void field since we override the usual setField function * @param string $field Void field since we override the usual setField function
* @param string $value Void field since we override the usual setField function * @param string $value Void field since we override the usual setField function
*/ */
function currentItemPosition() function currentItemPosition() {
{ $idworkflowitem = $this->get("idworkflowitem");
$idworkflowitem = $this->get("idworkflowitem");
$workflowItems = new WorkflowItems;
$workflowItems->select("idworkflowitem = '$idworkflowitem'");
if ($item = $workflowItems->next())
{
return ($item->get("position"));
}
}
/** $workflowItems = new WorkflowItems;
$workflowItems->select("idworkflowitem = '$idworkflowitem'");
if ($item = $workflowItems->next()) {
return ($item->get("position"));
}
}
/**
* Returns the current user position * Returns the current user position
* @param string $field Void field since we override the usual setField function * @param string $field Void field since we override the usual setField function
* @param string $value Void field since we override the usual setField function * @param string $value Void field since we override the usual setField function
*/ */
function currentUserPosition() function currentUserPosition() {
{ return ($this->get("position"));
return ($this->get("position")); }
}
/** /**
* Overriden store function to send mails * Overriden store function to send mails
* @param none * @param none
*/ */
function store() function store() {
{ global $cfg;
global $cfg;
$sMailhost = getSystemProperty('system', 'mail_host');
$sMailhost = getSystemProperty('system', 'mail_host');
if ($sMailhost == '') { if ($sMailhost == '') {
$sMailhost = 'localhost'; $sMailhost = 'localhost';
} }
//modified : 2008-06-25 - use php mailer class instead of mail() //modified : 2008-06-25 - use php mailer class instead of mail()
$oMail = new PHPMailer(); $oMail = new PHPMailer();
$oMail->Host = $sMailhost; $oMail->Host = $sMailhost;
$oMail->IsHTML(0); $oMail->IsHTML(0);
$oMail->WordWrap = 1000; $oMail->WordWrap = 1000;
$oMail->IsMail(); $oMail->IsMail();
if (array_key_exists("idusersequence",$this->modifiedValues))
{
$usersequence = new WorkflowUserSequence;
$usersequence->loadByPrimaryKey($this->values["idusersequence"]);
$email = $usersequence->get("emailnoti");
$escal = $usersequence->get("escalationnoti");
if ($email == 1 || $escal == 1)
{
/* Grab the required informations */
$curEditor = getGroupOrUserName($usersequence->get("iduser"));
$idartlang = $this->get("idartlang");
$timeunit = $usersequence->get("timeunit");
$timelimit = $usersequence->get("timelimit");
$db = new DB_ConLite;
$sql = "SELECT author, title, idart FROM ".$cfg["tab"]["art_lang"]." WHERE idartlang = '".Contenido_Security::escapeDB($idartlang, $db)."'";
$db->query($sql);
if ($db->next_record())
{
$idart = $db->f("idart");
$title = $db->f("title");
$author = $db->f("author");
}
/* Extract category */
$sql = "SELECT idcat FROM ".$cfg["tab"]["cat_art"]." WHERE idart = '".Contenido_Security::escapeDB($idart, $db)."'";
$db->query($sql);
if ($db->next_record())
{
$idcat = $db->f("idcat");
}
$sql = "SELECT name FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat = '".Contenido_Security::escapeDB($idcat, $db)."'";
$db->query($sql);
if ($db->next_record())
{
$catname = $db->f("name");
}
$starttime = $this->get("starttime");
$starttime = strtotime (substr_replace (substr (substr ($starttime,0,2).chunk_split (substr ($starttime,2,6),2,"-").chunk_split (substr ($starttime,8),2,":"),0,19)," ",10,1));
switch ($timeunit)
{
case "Seconds":
$maxtime = $starttime + $timelimit;
break;
case "Minutes":
$maxtime = $starttime + ($timelimit * 60);
break;
case "Hours":
$maxtime = $starttime + ($timelimit * 3600);
break;
case "Days":
$maxtime = $starttime + ($timelimit * 86400);
break;
case "Weeks":
$maxtime = $starttime + ($timelimit * 604800);
break;
case "Months":
$maxtime = $starttime + ($timelimit * 2678400);
break;
case "Years":
$maxtime = $starttime + ($timelimit * 31536000);
break;
default:
$maxtime = $starttime + $timelimit;
}
if ($email == 1)
{
$email = "Hello %s,\n\n".
"you are assigned as the next editor for the Article %s.\n\n".
"More informations:\n".
"Article: %s\n".
"Category: %s\n".
"Editor: %s\n".
"Author: %s\n".
"Editable from: %s\n".
"Editable to: %s\n";
$filledMail = sprintf( $email,
$curEditor,
$title,
$title,
$catname,
$curEditor,
$author,
date("Y-m-d H:i:s", $starttime),
date("Y-m-d H:i:s", $maxtime));
$user = new User;
if (isGroup($usersequence->get("iduser"))) if (array_key_exists("idusersequence", $this->modifiedValues)) {
{ $usersequence = new WorkflowUserSequence;
$sql = "select idgroupuser, user_id FROM ". $cfg["tab"]["groupmembers"] ." WHERE $usersequence->loadByPrimaryKey($this->values["idusersequence"]);
group_id = '".Contenido_Security::escapeDB($usersequence->get("iduser"), $db)."'";
$db->query($sql); $email = $usersequence->get("emailnoti");
$escal = $usersequence->get("escalationnoti");
while ($db->next_record())
{ if ($email == 1 || $escal == 1) {
$user->loadUserByUserID($db->f("user_id")); /* Grab the required informations */
//modified : 2008-06-25 - use php mailer class instead of mail() $curEditor = getGroupOrUserName($usersequence->get("iduser"));
$oMail->AddAddress($user->getField("email"), ""); $idartlang = $this->get("idartlang");
$oMail->Subject = stripslashes (i18n('Workflow notification')); $timeunit = $usersequence->get("timeunit");
$oMail->Body = $filledMail; $timelimit = $usersequence->get("timelimit");
$oMail->Send();
} $db = new DB_ConLite;
$sql = "SELECT author, title, idart FROM " . $cfg["tab"]["art_lang"] . " WHERE idartlang = '" . Contenido_Security::escapeDB($idartlang, $db) . "'";
} else {
$user->loadUserByUserID($usersequence->get("iduser")); $db->query($sql);
//modified : 2008-06-25 - use php mailer class instead of mail()
$oMail->AddAddress($user->getField("email"), ""); if ($db->next_record()) {
$oMail->Subject = stripslashes (i18n('Workflow notification')); $idart = $db->f("idart");
$oMail->Body = $filledMail; $title = $db->f("title");
$oMail->Send(); $author = $db->f("author");
} }
} else { /* Extract category */
$email = "Hello %s,\n\n". $sql = "SELECT idcat FROM " . $cfg["tab"]["cat_art"] . " WHERE idart = '" . Contenido_Security::escapeDB($idart, $db) . "'";
"you are assigned as the escalator for the Article %s.\n\n". $db->query($sql);
"More informations:\n".
"Article: %s\n". if ($db->next_record()) {
"Category: %s\n". $idcat = $db->f("idcat");
"Editor: %s\n". }
"Author: %s\n".
"Editable from: %s\n". $sql = "SELECT name FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat = '" . Contenido_Security::escapeDB($idcat, $db) . "'";
"Editable to: %s\n"; $db->query($sql);
$filledMail = sprintf( $email, if ($db->next_record()) {
$curEditor, $catname = $db->f("name");
$title, }
$title,
$catname, $starttime = $this->get("starttime");
$curEditor,
$author,
date("Y-m-d H:i:s", $starttime), $starttime = strtotime(substr_replace(substr(substr($starttime, 0, 2) . chunk_split(substr($starttime, 2, 6), 2, "-") . chunk_split(substr($starttime, 8), 2, ":"), 0, 19), " ", 10, 1));
date("Y-m-d H:i:s", $maxtime));
switch ($timeunit) {
$user = new User; case "Seconds":
$maxtime = $starttime + $timelimit;
if (isGroup($usersequence->get("iduser"))) break;
{ case "Minutes":
$maxtime = $starttime + ($timelimit * 60);
$sql = "select idgroupuser, user_id FROM ". $cfg["tab"]["groupmembers"] ." WHERE break;
group_id = '".Contenido_Security::escapeDB($usersequence->get("iduser"), $db)."'"; case "Hours":
$db->query($sql); $maxtime = $starttime + ($timelimit * 3600);
break;
while ($db->next_record()) case "Days":
{ $maxtime = $starttime + ($timelimit * 86400);
$user->loadUserByUserID($db->f("user_id")); break;
echo "mail to ".$user->getField("email")."<br>"; case "Weeks":
//modified : 2008-06-25 - use php mailer class instead of mail() $maxtime = $starttime + ($timelimit * 604800);
$oMail->AddAddress($user->getField("email"), ""); break;
$oMail->Subject = stripslashes (i18n('Workflow escalation')); case "Months":
$oMail->Body = $filledMail; $maxtime = $starttime + ($timelimit * 2678400);
$oMail->Send(); break;
} case "Years":
$maxtime = $starttime + ($timelimit * 31536000);
} else { break;
$user->loadUserByUserID($usersequence->get("iduser")); default:
echo "mail to ".$user->getField("email")."<br>"; $maxtime = $starttime + $timelimit;
//modified : 2008-06-25 - use php mailer class instead of mail() }
$oMail->AddAddress($user->getField("email"), "");
$oMail->Subject = stripslashes (i18n('Workflow escalation')); if ($email == 1) {
$oMail->Body = $filledMail; $email = "Hello %s,\n\n" .
$oMail->Send(); "you are assigned as the next editor for the Article %s.\n\n" .
} "More informations:\n" .
} "Article: %s\n" .
"Category: %s\n" .
"Editor: %s\n" .
"Author: %s\n" .
"Editable from: %s\n" .
"Editable to: %s\n";
$filledMail = sprintf($email,
$curEditor,
$title,
$title,
$catname,
$curEditor,
$author,
date("Y-m-d H:i:s", $starttime),
date("Y-m-d H:i:s", $maxtime));
$user = new User;
if (isGroup($usersequence->get("iduser"))) {
$sql = "select idgroupuser, user_id FROM " . $cfg["tab"]["groupmembers"] . " WHERE
group_id = '" . Contenido_Security::escapeDB($usersequence->get("iduser"), $db) . "'";
$db->query($sql);
while ($db->next_record()) {
$user->loadUserByUserID($db->f("user_id"));
//modified : 2008-06-25 - use php mailer class instead of mail()
$oMail->AddAddress($user->getField("email"), "");
$oMail->Subject = stripslashes(i18n('Workflow notification'));
$oMail->Body = $filledMail;
$oMail->Send();
}
} else {
$user->loadUserByUserID($usersequence->get("iduser"));
//modified : 2008-06-25 - use php mailer class instead of mail()
$oMail->AddAddress($user->getField("email"), "");
$oMail->Subject = stripslashes(i18n('Workflow notification'));
$oMail->Body = $filledMail;
$oMail->Send();
}
} else {
$email = "Hello %s,\n\n" .
"you are assigned as the escalator for the Article %s.\n\n" .
"More informations:\n" .
"Article: %s\n" .
"Category: %s\n" .
"Editor: %s\n" .
"Author: %s\n" .
"Editable from: %s\n" .
"Editable to: %s\n";
$filledMail = sprintf($email,
$curEditor,
$title,
$title,
$catname,
$curEditor,
$author,
date("Y-m-d H:i:s", $starttime),
date("Y-m-d H:i:s", $maxtime));
$user = new User;
if (isGroup($usersequence->get("iduser"))) {
$sql = "select idgroupuser, user_id FROM " . $cfg["tab"]["groupmembers"] . " WHERE
group_id = '" . Contenido_Security::escapeDB($usersequence->get("iduser"), $db) . "'";
$db->query($sql);
while ($db->next_record()) {
$user->loadUserByUserID($db->f("user_id"));
echo "mail to " . $user->getField("email") . "<br>";
//modified : 2008-06-25 - use php mailer class instead of mail()
$oMail->AddAddress($user->getField("email"), "");
$oMail->Subject = stripslashes(i18n('Workflow escalation'));
$oMail->Body = $filledMail;
$oMail->Send();
}
} else {
$user->loadUserByUserID($usersequence->get("iduser"));
echo "mail to " . $user->getField("email") . "<br>";
//modified : 2008-06-25 - use php mailer class instead of mail()
$oMail->AddAddress($user->getField("email"), "");
$oMail->Subject = stripslashes(i18n('Workflow escalation'));
$oMail->Body = $filledMail;
$oMail->Send();
}
}
}
}
return parent::store();
}
}
}
return parent::store();
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -25,12 +26,10 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
/** /**
* Class WorkflowTasks * Class WorkflowTasks
* Class for workflow task collections * Class for workflow task collections
@ -39,41 +38,37 @@ if(!defined('CON_FRAMEWORK')) {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowTasks extends ItemCollection { class WorkflowTasks extends ItemCollection {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg; parent::__construct($cfg["tab"]["tasks"], "idtask");
parent::__construct($cfg["tab"]["tasks"], "idtask");
$this->_setItemClass("WorkflowTask"); $this->_setItemClass("WorkflowTask");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
function WorkflowTasks() function WorkflowTasks() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
function create () function create() {
{ $newitem = parent::createNewItem();
$newitem = parent::createNewItem(); return ($newitem);
return ($newitem); }
}
function select($where = "", $group_by = "", $order_by = "", $limit = "") {
function select ($where = "", $group_by = "", $order_by = "", $limit = "") global $client;
{
global $client; if ($where != "") {
$where = $where . " AND idclient = '" . Contenido_Security::escapeDB($client, NULL) . "'";
if ($where != "") }
{ return parent::select($where, $group_by, $order_by, $limit);
$where = $where . " AND idclient = '".Contenido_Security::escapeDB($client, NULL)."'"; }
}
return parent::select($where, $group_by, $order_by, $limit);
}
} }
/** /**
@ -84,23 +79,22 @@ class WorkflowTasks extends ItemCollection {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowTask extends Item { class WorkflowTask extends Item {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg; parent::__construct($cfg["tab"]["tasks"], "idtask");
parent::__construct($cfg["tab"]["tasks"], "idtask"); }
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
function WorkflowTask() function WorkflowTask() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -25,12 +26,10 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
/** /**
* Class WorkflowUserSequences * Class WorkflowUserSequences
* Class for workflow user sequence management * Class for workflow user sequence management
@ -39,131 +38,122 @@ if(!defined('CON_FRAMEWORK')) {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowUserSequences extends ItemCollection { class WorkflowUserSequences extends ItemCollection {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg; parent::__construct($cfg["tab"]["workflow_user_sequences"], "idusersequence");
parent::__construct($cfg["tab"]["workflow_user_sequences"], "idusersequence");
$this->_setItemClass("WorkflowUserSequence"); $this->_setItemClass("WorkflowUserSequence");
} }
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
function WorkflowUserSequences() function WorkflowUserSequences() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
function delete ($id) function delete($id) {
{
global $cfg, $idworkflow; global $cfg, $idworkflow;
$item = new WorkflowUserSequence; $item = new WorkflowUserSequence;
$item->loadByPrimaryKey($id); $item->loadByPrimaryKey($id);
$pos = $item->get("position"); $pos = $item->get("position");
$idworkflowitem = $item->get("idworkflowitem"); $idworkflowitem = $item->get("idworkflowitem");
$this->select("position > $pos AND idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."'"); $this->select("position > $pos AND idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "'");
while ($obj = $this->next()) while ($obj = $this->next()) {
{ $pos = $obj->get("position") - 1;
$pos = $obj->get("position") -1; $obj->setPosition($pos);
$obj->setPosition($pos); $obj->store();
$obj->store(); }
}
parent::delete($id); parent::delete($id);
$this->updateArtAllocation($id); $this->updateArtAllocation($id);
} }
function updateArtAllocation ($idusersequence) { function updateArtAllocation($idusersequence) {
global $idworkflow, $cfg; global $idworkflow, $cfg;
$oDb = new DB_ConLite(); $oDb = new DB_ConLite();
$aIdArtLang = array(); $aIdArtLang = array();
$sSql = 'SELECT idartlang FROM '.$cfg["tab"]["workflow_art_allocation"].' WHERE idusersequence = '.Contenido_Security::escapeDB($idusersequence, $oDb).';'; $sSql = 'SELECT idartlang FROM ' . $cfg["tab"]["workflow_art_allocation"] . ' WHERE idusersequence = ' . Contenido_Security::escapeDB($idusersequence, $oDb) . ';';
$oDb->query($sSql); $oDb->query($sSql);
while ($oDb->next_record()) { while ($oDb->next_record()) {
array_push($aIdArtLang, $oDb->f('idartlang')); array_push($aIdArtLang, $oDb->f('idartlang'));
} }
$sSql = 'DELETE FROM '.$cfg["tab"]["workflow_art_allocation"].' WHERE idusersequence = '.Contenido_Security::escapeDB($idusersequence, $oDb).';'; $sSql = 'DELETE FROM ' . $cfg["tab"]["workflow_art_allocation"] . ' WHERE idusersequence = ' . Contenido_Security::escapeDB($idusersequence, $oDb) . ';';
$oDb->query($sSql); $oDb->query($sSql);
foreach ($aIdArtLang as $iIdArtLang) { foreach ($aIdArtLang as $iIdArtLang) {
setUserSequence($iIdArtLang, $idworkflow); setUserSequence($iIdArtLang, $idworkflow);
} }
} }
function create ($idworkflowitem)
{
global $auth, $client, $idworkflow;
$newitem = parent::createNewItem();
$workflowitems = new WorkflowItems;
if (!$workflowitems->exists($idworkflowitem))
{
$this->delete($newitem->getField("idusersequence"));
$this->lasterror = i18n("Workflow item doesn't exist. Can't create entry.", "workflow");
return false;
}
$this->select("idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."'","","position DESC","1");
$item = $this->next();
if ($item === false)
{
$lastPos = 1;
} else {
$lastPos = $item->getField("position") + 1;
}
$newitem->setWorkflowItem($idworkflowitem);
$newitem->setPosition($lastPos);
$newitem->store();
return ($newitem);
}
function swap ($idworkflowitem, $pos1, $pos2)
{
$this->select("idworkflowitem = '$idworkflowitem' AND position = '".Contenido_Security::escapeDB($pos1, NULL)."'");
if (($item = $this->next()) === false)
{
$this->lasterror = i18n("Swapping items failed: Item doesn't exist", "workflow");
return false;
}
$pos1ID = $item->getField("idusersequence");
$this->select("idworkflowitem = '$idworkflowitem' AND position = '".Contenido_Security::escapeDB($pos2, NULL)."'"); function create($idworkflowitem) {
if (($item = $this->next()) === false) global $auth, $client, $idworkflow;
{ $newitem = parent::createNewItem();
$this->lasterror(i18n("Swapping items failed: Item doesn't exist", "workflow"));
return false; $workflowitems = new WorkflowItems;
} if (!$workflowitems->exists($idworkflowitem)) {
$this->delete($newitem->getField("idusersequence"));
$pos2ID = $item->getField("idusersequence"); $this->lasterror = i18n("Workflow item doesn't exist. Can't create entry.", "workflow");
return false;
$item = new WorkflowUserSequence(); }
$item->loadByPrimaryKey($pos1ID);
$item->setPosition($pos2); $this->select("idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "'", "", "position DESC", "1");
$item->store();
$item->loadByPrimaryKey($pos2ID); $item = $this->next();
$item->setPosition($pos1);
$item->store(); if ($item === false) {
$lastPos = 1;
} else {
$lastPos = $item->getField("position") + 1;
}
$newitem->setWorkflowItem($idworkflowitem);
$newitem->setPosition($lastPos);
$newitem->store();
return ($newitem);
}
function swap($idworkflowitem, $pos1, $pos2) {
$this->select("idworkflowitem = '$idworkflowitem' AND position = '" . Contenido_Security::escapeDB($pos1, NULL) . "'");
if (($item = $this->next()) === false) {
$this->lasterror = i18n("Swapping items failed: Item doesn't exist", "workflow");
return false;
}
$pos1ID = $item->getField("idusersequence");
$this->select("idworkflowitem = '$idworkflowitem' AND position = '" . Contenido_Security::escapeDB($pos2, NULL) . "'");
if (($item = $this->next()) === false) {
$this->lasterror(i18n("Swapping items failed: Item doesn't exist", "workflow"));
return false;
}
$pos2ID = $item->getField("idusersequence");
$item = new WorkflowUserSequence();
$item->loadByPrimaryKey($pos1ID);
$item->setPosition($pos2);
$item->store();
$item->loadByPrimaryKey($pos2ID);
$item->setPosition($pos1);
$item->store();
$this->updateArtAllocation($pos2ID); $this->updateArtAllocation($pos2ID);
$this->updateArtAllocation($pos1ID); $this->updateArtAllocation($pos1ID);
return (true); return (true);
} }
} }
/** /**
@ -174,105 +164,95 @@ class WorkflowUserSequences extends ItemCollection {
* @copyright four for business 2003 * @copyright four for business 2003
*/ */
class WorkflowUserSequence extends Item { class WorkflowUserSequence extends Item {
/** /**
* Constructor Function * Constructor Function
* @param string $table The table to use as information source * @param string $table The table to use as information source
*/ */
function __construct() function __construct() {
{ global $cfg;
global $cfg; parent::__construct($cfg["tab"]["workflow_user_sequences"], "idusersequence");
parent::__construct($cfg["tab"]["workflow_user_sequences"], "idusersequence"); }
}
/** @deprecated [2011-03-15] Old constructor function for downwards compatibility */ /** @deprecated [2011-03-15] Old constructor function for downwards compatibility */
function WorkflowUserSequence() function WorkflowUserSequence() {
{
cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()"); cWarning(__FILE__, __LINE__, "Deprecated method call, use __construct()");
$this->__construct(); $this->__construct();
} }
/** /**
* Override setField Function to prevent that somebody modifies * Override setField Function to prevent that somebody modifies
* idsequence. * idsequence.
* @param string $field Field to set * @param string $field Field to set
* @param string $valie Value to set * @param string $valie Value to set
*/ */
function setField($field, $value, $bSafe = true) function setField($field, $value, $bSafe = true) {
{ global $cfg;
global $cfg;
switch ($field)
{
case "idworkflowitem":
die("Please use create to modify idsequence. Direct modifications are not allowed");
case "idusersequence":
die("Please use create to modify idsequence. Direct modifications are not allowed");
case "position":
die("Please use create and swap to set the position. Direct modifications are not allowed");
case "iduser":
if ($value != 0)
{
$db = new DB_ConLite;
$sql = "SELECT user_id FROM " . $cfg["tab"]["phplib_auth_user_md5"] .
" WHERE user_id = '".Contenido_Security::escapeDB($value, $db)."'";
$db->query($sql);
if (!$db->next_record())
{
$sql = "SELECT group_id FROM " . $cfg["tab"]["groups"] .
" WHERE group_id = '".Contenido_Security::escapeDB($value, $db)."'";
$db->query($sql);
if (!$db->next_record())
{
$this->lasterror = i18n("Can't set user_id: User or group doesn't exist", "workflow");
return false;
}
}
$idusersquence = parent::getField('idusersequence');
}
} switch ($field) {
case "idworkflowitem":
parent::setField($field, $value, $bSafe); die("Please use create to modify idsequence. Direct modifications are not allowed");
case "idusersequence":
die("Please use create to modify idsequence. Direct modifications are not allowed");
case "position":
die("Please use create and swap to set the position. Direct modifications are not allowed");
case "iduser":
if ($value != 0) {
$db = new DB_ConLite;
$sql = "SELECT user_id FROM " . $cfg["tab"]["phplib_auth_user_md5"] .
" WHERE user_id = '" . Contenido_Security::escapeDB($value, $db) . "'";
$db->query($sql);
if (!$db->next_record()) {
$sql = "SELECT group_id FROM " . $cfg["tab"]["groups"] .
" WHERE group_id = '" . Contenido_Security::escapeDB($value, $db) . "'";
$db->query($sql);
if (!$db->next_record()) {
$this->lasterror = i18n("Can't set user_id: User or group doesn't exist", "workflow");
return false;
}
}
$idusersquence = parent::getField('idusersequence');
}
}
parent::setField($field, $value, $bSafe);
if ($idusersquence) { if ($idusersquence) {
WorkflowUserSequences::updateArtAllocation(0); WorkflowUserSequences::updateArtAllocation(0);
} }
} }
/** /**
* Returns the associated workflowItem for this user sequence * Returns the associated workflowItem for this user sequence
* @param none * @param none
*/ */
function getWorkflowItem () function getWorkflowItem() {
{ if (!$this->virgin) {
if (!$this->virgin) $workflowItem = new WorkflowItem;
{ $workflowItem->loadByPrimaryKey($this->values["idworkflowitem"]);
$workflowItem = new WorkflowItem; return ($workflowItem);
$workflowItem->loadByPrimaryKey($this->values["idworkflowitem"]); } else {
return ($workflowItem); return false;
} else { }
return false; }
}
}
/**
* Interface to set idworkflowitem. Should only be called by "create".
* @param string $value The value to set
*/
function setWorkflowItem($value)
{
parent::setField("idworkflowitem", $value);
}
/** /**
* Interface to set idworkflowitem. Should only be called by "create". * Interface to set idworkflowitem. Should only be called by "create".
* @param string $value The value to set * @param string $value The value to set
*/ */
function setPosition($value) function setWorkflowItem($value) {
{ parent::setField("idworkflowitem", $value);
parent::setField("position", $value); }
}
/**
* Interface to set idworkflowitem. Should only be called by "create".
* @param string $value The value to set
*/
function setPosition($value) {
parent::setField("position", $value);
}
} }
?> ?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -26,7 +27,6 @@
* }} * }}
* *
*/ */
define('CON_FRAMEWORK', true); define('CON_FRAMEWORK', true);
@ -35,8 +35,6 @@ include_once ('../../../includes/startup.php');
cInclude("includes", "cfg_language_de.inc.php"); cInclude("includes", "cfg_language_de.inc.php");
cInclude("includes", "functions.con.php"); cInclude("includes", "functions.con.php");
plugin_include('workflow', 'classes/class.workflow.php');
plugin_include('workflow', 'includes/functions.workflow.php'); plugin_include('workflow', 'includes/functions.workflow.php');
$workflowartallocations = new WorkflowArtAllocations; $workflowartallocations = new WorkflowArtAllocations;
@ -44,71 +42,62 @@ $workflowusersequences = new WorkflowUserSequences;
$workflowartallocations->select(); $workflowartallocations->select();
while ($obj = $workflowartallocations->next()) while ($obj = $workflowartallocations->next()) {
{ $starttime = $obj->get("starttime");
$starttime = $obj->get("starttime"); $idartlang = $obj->get("idartlang");
$idartlang = $obj->get("idartlang"); $lastidusersequence = $obj->get("lastusersequence");
$lastidusersequence = $obj->get("lastusersequence");
$usersequence = getCurrentUserSequence($idartlang,0);
if ($usersequence != $lastidusersequence)
{
$workflowusersequences->select("idusersequence = '$usersequence'");
if ($wfobj = $workflowusersequences->next())
{
$wfitem = $wfobj->get("idworkflowitem");
$pos = $wfobj->get("position");
$timeunit = $wfobj->get("timeunit");
$timelimit = $wfobj->get("timelimit");
}
$starttime = strtotime (substr_replace (substr (substr ($starttime,0,2).chunk_split (substr ($starttime,2,6),2,"-").chunk_split (substr ($starttime,8),2,":"),0,19)," ",10,1));
switch ($timeunit)
{
case "Seconds":
$maxtime = $starttime + $timelimit;
break;
case "Minutes":
$maxtime = $starttime + ($timelimit * 60);
break;
case "Hours":
$maxtime = $starttime + ($timelimit * 3600);
break;
case "Days":
$maxtime = $starttime + ($timelimit * 86400);
break;
case "Weeks":
$maxtime = $starttime + ($timelimit * 604800);
break;
case "Months":
$maxtime = $starttime + ($timelimit * 2678400);
break;
case "Years":
$maxtime = $starttime + ($timelimit * 31536000);
break;
default:
$maxtime = $starttime + $timelimit;
}
if ($maxtime < time())
{
$pos = $pos + 1;
$workflowusersequences->select("idworkflowitem = '$wfitem' AND position = '".Contenido_Security::escapeDB($pos, NULL)."'");
if ($wfobj = $workflowusersequences->next())
{
$obj->set("idusersequence", $wfobj->get("idusersequence"));
$obj->store();
}
}
}
}
$usersequence = getCurrentUserSequence($idartlang, 0);
if ($usersequence != $lastidusersequence) {
$workflowusersequences->select("idusersequence = '$usersequence'");
if ($wfobj = $workflowusersequences->next()) {
$wfitem = $wfobj->get("idworkflowitem");
$pos = $wfobj->get("position");
$timeunit = $wfobj->get("timeunit");
$timelimit = $wfobj->get("timelimit");
}
$starttime = strtotime(substr_replace(substr(substr($starttime, 0, 2) . chunk_split(substr($starttime, 2, 6), 2, "-") . chunk_split(substr($starttime, 8), 2, ":"), 0, 19), " ", 10, 1));
switch ($timeunit) {
case "Seconds":
$maxtime = $starttime + $timelimit;
break;
case "Minutes":
$maxtime = $starttime + ($timelimit * 60);
break;
case "Hours":
$maxtime = $starttime + ($timelimit * 3600);
break;
case "Days":
$maxtime = $starttime + ($timelimit * 86400);
break;
case "Weeks":
$maxtime = $starttime + ($timelimit * 604800);
break;
case "Months":
$maxtime = $starttime + ($timelimit * 2678400);
break;
case "Years":
$maxtime = $starttime + ($timelimit * 31536000);
break;
default:
$maxtime = $starttime + $timelimit;
}
if ($maxtime < time()) {
$pos = $pos + 1;
$workflowusersequences->select("idworkflowitem = '$wfitem' AND position = '" . Contenido_Security::escapeDB($pos, NULL) . "'");
if ($wfobj = $workflowusersequences->next()) {
$obj->set("idusersequence", $wfobj->get("idusersequence"));
$obj->store();
}
}
}
}
?> ?>

Datei anzeigen

@ -0,0 +1,19 @@
<?php
$sAutoloadClassPath = strstr(dirname(dirname(__FILE__)), "conlite/plugins")."/classes/";
return array(
'Workflow' => $sAutoloadClassPath.'class.workflow.php',
'Workflows' => $sAutoloadClassPath.'class.workflow.php',
'WorkflowAction' => $sAutoloadClassPath.'class.workflowactions.php',
'WorkflowActions' => $sAutoloadClassPath.'class.workflowactions.php',
'WorkflowAllocation' => $sAutoloadClassPath.'class.workflowallocation.php',
'WorkflowAllocations' => $sAutoloadClassPath.'class.workflowallocation.php',
'WorkflowArtAllocation' => $sAutoloadClassPath.'class.workflowartallocation.php',
'WorkflowArtAllocations' => $sAutoloadClassPath.'class.workflowartallocation.php',
'WorkflowItem' => $sAutoloadClassPath.'class.workflowitems.php',
'WorkflowItems' => $sAutoloadClassPath.'class.workflowitems.php',
'WorkflowTask' => $sAutoloadClassPath.'class.workflowtasks.php',
'WorkflowTasks' => $sAutoloadClassPath.'class.workflowtasks.php',
'WorkflowUserSequence' => $sAutoloadClassPath.'class.workflowusersequence.php',
'WorkflowUserSequences' => $sAutoloadClassPath.'class.workflowusersequence.php'
);
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -22,36 +23,35 @@
* *
* $Id: config.plugin.php 128 2019-07-03 11:58:28Z oldperl $ * $Id: config.plugin.php 128 2019-07-03 11:58:28Z oldperl $
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
plugin_include('cl-workflow', 'includes/functions.workflow.php');
plugin_include('workflow', 'classes/class.workflow.php'); $sPluginName = 'cl-workflow';
plugin_include('workflow', 'includes/functions.workflow.php');
global $lngAct, $modidartlang; global $lngAct, $modidartlang;
$lngAct["workflow"]["workflow_delete"] = i18n("Delete workflow", "workflow"); $lngAct["workflow"]["workflow_delete"] = i18n("Delete workflow", $sPluginName);
$lngAct["con_workflow"]["workflow_task_user_select"] = i18n("Select workflow task", "workflow"); $lngAct["con_workflow"]["workflow_task_user_select"] = i18n("Select workflow task", $sPluginName);
$lngAct["workflow_common"]["workflow_show"] = i18n("Show workflow", "workflow"); $lngAct["workflow_common"]["workflow_show"] = i18n("Show workflow", $sPluginName);
$lngAct["workflow_common"]["workflow_create"] = i18n("Create workflow", "workflow"); $lngAct["workflow_common"]["workflow_create"] = i18n("Create workflow", $sPluginName);
$lngAct["workflow_common"]["workflow_save"] = i18n("Edit workflow", "workflow"); $lngAct["workflow_common"]["workflow_save"] = i18n("Edit workflow", $sPluginName);
$lngAct["con"]["workflow_do_action"] = i18n("Process workflow step", "workflow"); $lngAct["con"]["workflow_do_action"] = i18n("Process workflow step", $sPluginName);
$lngAct["str"]["workflow_inherit_down"] = i18n("Inherit workflow down", "workflow"); $lngAct["str"]["workflow_inherit_down"] = i18n("Inherit workflow down", $sPluginName);
$lngAct["str"]["workflow_inherit_down"] = i18n("Inherit workflow down", "workflow"); $lngAct["str"]["workflow_inherit_down"] = i18n("Inherit workflow down", $sPluginName);
$lngAct["workflow_steps"]["workflow_step_edit"] = i18n("Edit workflow step", "workflow"); $lngAct["workflow_steps"]["workflow_step_edit"] = i18n("Edit workflow step", $sPluginName);
$lngAct["workflow_steps"]["workflow_step_up"] = i18n("Move workflowstep up", "workflow"); $lngAct["workflow_steps"]["workflow_step_up"] = i18n("Move workflowstep up", $sPluginName);
$lngAct["workflow_steps"]["workflow_step_down"] = i18n("Move workflowstep down", "workflow"); $lngAct["workflow_steps"]["workflow_step_down"] = i18n("Move workflowstep down", $sPluginName);
$lngAct["workflow_steps"]["workflow_save_step"] = i18n("Save Workflowstep", "workflow"); $lngAct["workflow_steps"]["workflow_save_step"] = i18n("Save Workflowstep", $sPluginName);
$lngAct["workflow_steps"]["workflow_create_step"] = i18n("Create workflowstep", "workflow"); $lngAct["workflow_steps"]["workflow_create_step"] = i18n("Create workflowstep", $sPluginName);
$lngAct["workflow_steps"]["workflow_step_delete"] = i18n("Delete workflowstep", "workflow"); $lngAct["workflow_steps"]["workflow_step_delete"] = i18n("Delete workflowstep", $sPluginName);
$lngAct["workflow_steps"]["workflow_user_up"] = i18n("Move workflowstepuser up", "workflow"); $lngAct["workflow_steps"]["workflow_user_up"] = i18n("Move workflowstepuser up", $sPluginName);
$lngAct["workflow_steps"]["workflow_user_down"] = i18n("Move workflowstepuser down", "workflow"); $lngAct["workflow_steps"]["workflow_user_down"] = i18n("Move workflowstepuser down", $sPluginName);
$lngAct["workflow_steps"]["workflow_create_user"] = i18n("Create Workflowstepuser", "workflow"); $lngAct["workflow_steps"]["workflow_create_user"] = i18n("Create Workflowstepuser", $sPluginName);
$lngAct["workflow_steps"]["workflow_user_delete"] = i18n("Delete Workflowstepuser", "workflow"); $lngAct["workflow_steps"]["workflow_user_delete"] = i18n("Delete Workflowstepuser", $sPluginName);
$lngAct["str"]["workflow_cat_assign"] = i18n("Associate workflow with category", "workflow"); $lngAct["str"]["workflow_cat_assign"] = i18n("Associate workflow with category", $sPluginName);
$_cecRegistry->addChainFunction("Contenido.ArticleCategoryList.ListItems", "piworkflowCreateTasksFolder"); $_cecRegistry->addChainFunction("Contenido.ArticleCategoryList.ListItems", "piworkflowCreateTasksFolder");
$_cecRegistry->addChainFunction("Contenido.ArticleList.Columns", "piworkflowProcessArticleColumns"); $_cecRegistry->addChainFunction("Contenido.ArticleList.Columns", "piworkflowProcessArticleColumns");
@ -62,392 +62,10 @@ $_cecRegistry->addChainFunction("Contenido.CategoryList.Columns", "piworkflowCat
$_cecRegistry->addChainFunction("Contenido.CategoryList.RenderColumn", "piworkflowCategoryRenderColumn"); $_cecRegistry->addChainFunction("Contenido.CategoryList.RenderColumn", "piworkflowCategoryRenderColumn");
$_cecRegistry->addChainFunction("Contenido.Frontend.AllowEdit", "piworkflowAllowArticleEdit"); $_cecRegistry->addChainFunction("Contenido.Frontend.AllowEdit", "piworkflowAllowArticleEdit");
function prepareWorkflowItems ()
{
global $action, $lang, $modidcat, $workflowSelectBox, $workflowworkflows, $client, $tpl, $cfg; $cfg["tab"]["workflow"] = $cfg['sql']['sqlprefix'] . "_piwf_workflow";
$cfg["tab"]["workflow_allocation"] = $cfg['sql']['sqlprefix'] . "_piwf_allocation";
$workflowworkflows = new Workflows; $cfg["tab"]["workflow_art_allocation"] = $cfg['sql']['sqlprefix'] . "_piwf_art_allocation";
$cfg["tab"]["workflow_items"] = $cfg['sql']['sqlprefix'] . "_piwf_items";
if ($action === 'workflow_inherit_down') $cfg["tab"]["workflow_user_sequences"] = $cfg['sql']['sqlprefix'] . "_piwf_user_sequences";
{ $cfg["tab"]["workflow_actions"] = $cfg['sql']['sqlprefix'] . "_piwf_actions";
$tmp = strDeeperCategoriesArray($modidcat);
$asworkflow = getWorkflowForCat($modidcat);
$wfa = new WorkflowAllocations;
foreach ($tmp as $tmp_cat)
{
$idcatlang = getCatLang ($tmp_cat, $lang);
if ($asworkflow == 0)
{
$wfa->select("idcatlang = '$idcatlang'");
if ($item = $wfa->next())
{
$wfa->delete($item->get("idallocation"));
# delete user sequences for listing in tasklist for each included article
$oArticles = new ArticleCollection(array('idcat' => $idcatlang, 'start' => true, 'offline' => true));
while ($oArticle = $oArticles->nextArticle()) {
setUserSequence($oArticle->getField('idartlang'), -1);
}
}
} else {
$wfa->select("idcatlang = '$idcatlang'");
if ($item = $wfa->next())
{
$item->setWorkflow($asworkflow);
$item->store();
} else {
$wfa->create($asworkflow, $idcatlang);
# generate user sequences for listing in tasklist for each included article
$oArticles = new ArticleCollection(array('idcat' => $tmp_cat, 'start' => true, 'offline' => true));
while ($oArticle = $oArticles->nextArticle()) {
setUserSequence($oArticle->getField('idartlang'), $asworkflow);
}
}
}
}
}
if ($action == "workflow_cat_assign")
{
$seltpl = "wfselect".$modidcat;
$wfa = new WorkflowAllocations;
$idcatlang = getCatLang($modidcat, $lang);
#associate workflow with category
if ($GLOBALS[$seltpl] != 0)
{
$wfa->select("idcatlang = '$idcatlang'");
if ($item = $wfa->next())
{
$item->setWorkflow($GLOBALS[$seltpl]);
$item->store();
} else {
$wfa->create($GLOBALS[$seltpl], $idcatlang);
}
# generate user sequences for listing in tasklist for each included article
$oArticles = new ArticleCollection(array('idcat' => $modidcat, 'start' => true, 'offline' => true));
while ($oArticle = $oArticles->nextArticle()) {
setUserSequence($oArticle->getField('idartlang'), $GLOBALS[$seltpl]);
}
#unlink workflow with category
} else {
$wfa->select("idcatlang = '$idcatlang'");
if ($item = $wfa->next())
{
$alloc = $item->get("idallocation");
}
$wfa->delete($alloc);
# delete user sequences for listing in tasklist for each included article
$oArticles = new ArticleCollection(array('idcat' => $modidcat, 'start' => true, 'offline' => true));
while ($oArticle = $oArticles->nextArticle()) {
setUserSequence($oArticle->getField('idartlang'), -1);
}
}
}
$workflowSelectBox = new cHTMLSelectElement("foo");
$workflowSelectBox->setClass("text_medium");
$workflowworkflows->select("idclient = '$client' AND idlang = '".Contenido_Security::escapeDB($lang, null)."'");
$workflowOption = new cHTMLOptionElement("--- ".i18n("None", "workflow")." ---", 0);
$workflowSelectBox->addOptionElement(0,$workflowOption);
while ($workflow = $workflowworkflows->next())
{
$workflowOption = new cHTMLOptionElement($workflow->get("name"), $workflow->get("idworkflow"));
$workflowSelectBox->addOptionElement($workflow->get("idworkflow"),$workflowOption);
}
$workflowSelectBox->updateAttributes(array("id" => "wfselect{IDCAT}"));
$workflowSelectBox->updateAttributes(array("name" => "wfselect{IDCAT}"));
$tpl->set('s', 'PLUGIN_WORKFLOW', $workflowSelectBox->render().'<a href="javascript:setWorkflow({IDCAT}, \\\'wfselect{IDCAT}\\\')"><img src="'.$cfg["path"]["images"].'submit.gif" class="spaced"></a>');
$tpl->set('s', 'PLUGIN_WORKFLOW_TRANSLATION', i18n("Inherit workflow down", "workflow"));
}
function piworkflowCategoryRenderColumn ($idcat, $type)
{
switch ($type)
{
case "workflow":
$value = workflowInherit($idcat).'<script type="text/javascript" id="wf'.$idcat.'">printWorkflowSelect('.$idcat.', '.(int)getWorkflowForCat($idcat).');</script>';
break;
}
return ($value);
}
function piworkflowCategoryColumns ($array)
{
prepareWorkflowItems();
$myarray = array("workflow" => i18n("Workflow", "workflow"));
return ($myarray);
}
function piworkflowProcessActions ($array)
{
global $idcat;
$defaultidworkflow = getWorkflowForCat($idcat);
if ($defaultidworkflow != 0)
{
$narray = array("todo",
"wfartconf",
"wftplconf",
"wfonline",
"wflocked",
"duplicate",
"delete",
"usetime");
} else {
$narray = $array;
}
return ($narray);
}
function piworkflowRenderAction ($idcat, $idart, $idartlang, $type)
{
global $area, $frame, $idtpl, $cfg, $alttitle, $tmp_articletitle;
global $tmp_artconf, $onlinelink, $lockedlink, $tplconf_link;
$defaultidworkflow = getWorkflowForCat($idcat);
$idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow);
$associatedUserSequence = new WorkflowUserSequence;
$associatedUserSequence->loadByPrimaryKey($idusersequence);
$currentEditor = $associatedUserSequence->get("iduser");
$workflowItem = $associatedUserSequence->getWorkflowItem();
if (isCurrentEditor($associatedUserSequence->get("iduser")))
{
/* Query rights for this user */
$wfRights = $workflowItem->getStepRights();
$mayEdit = true;
} else {
$wfRights = "";
$mayEdit = false;
}
switch ($type)
{
case "wfartconf":
if ($wfRights["propertyedit"] == true)
{
return $tmp_artconf;
}
break;
case "wfonline":
if ($wfRights["publish"] == true)
{
return $onlinelink;
}
break;
case "wflocked":
if ($wfRights["lock"] == true)
{
return $lockedlink;
}
break;
case "wftplconf":
if ($wfRights["templateedit"] == true)
{
return $tplconf_link;
}
default:
break;
}
return "";
}
function piworkflowProcessArticleColumns ($array)
{
global $idcat, $action, $modidartlang;
if ($action == "workflow_do_action")
{
$selectedAction = "wfselect".$modidartlang;
doWorkflowAction($modidartlang, $GLOBALS[$selectedAction]);
}
$defaultidworkflow = getWorkflowForCat($idcat);
if ($defaultidworkflow != 0)
{
$narray = array();
$bInserted = false;
foreach ($array as $sKey => $sValue) {
$narray[$sKey] = $sValue;
if ($sKey == 'title' && !$bInserted) {
$narray["wftitle"] = $array["title"];
$narray["wfstep"] = i18n("Workflow Step", "workflow");
$narray["wfaction"] = i18n("Workflow Action", "workflow");
$narray["wfeditor"] = i18n("Workflow Editor", "workflow");
$narray["wflaststatus"] = i18n("Last status", "workflow");
$bInserted = true;
}
}
unset ($narray['title']);
unset ($narray['changeddate']);
unset ($narray['publisheddate']);
unset ($narray['sortorder']);
} else {
$narray = $array;
}
return ($narray);
}
function piworkflowAllowArticleEdit ($idlang, $idcat, $idart, $user)
{
$defaultidworkflow = getWorkflowForCat($idcat);
if ($defaultidworkflow == 0)
{
return true;
}
$idartlang = getArtLang($idart, $idlang);
$idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow);
$associatedUserSequence = new WorkflowUserSequence;
$associatedUserSequence->loadByPrimaryKey($idusersequence);
$currentEditor = $associatedUserSequence->get("iduser");
$workflowItem = $associatedUserSequence->getWorkflowItem();
if (isCurrentEditor($associatedUserSequence->get("iduser")))
{
$wfRights = $workflowItem->getStepRights();
$mayEdit = true;
} else {
$wfRights = "";
$mayEdit = false;
}
if ($wfRights["articleedit"] == true)
{
return true;
} else {
return false;
}
}
function piworkflowRenderColumn ($idcat, $idart, $idartlang, $column)
{
global $area, $frame, $idtpl, $cfg, $alttitle, $tmp_articletitle;
$defaultidworkflow = getWorkflowForCat($idcat);
$idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow);
$associatedUserSequence = new WorkflowUserSequence;
$associatedUserSequence->loadByPrimaryKey($idusersequence);
$currentEditor = $associatedUserSequence->get("iduser");
$workflowItem = $associatedUserSequence->getWorkflowItem();
if (isCurrentEditor($associatedUserSequence->get("iduser")))
{
$wfRights = $workflowItem->getStepRights();
$mayEdit = true;
} else {
$wfRights = "";
$mayEdit = false;
}
switch ($column)
{
case "wftitle":
if ($wfRights["articleedit"] == true)
{
$mtitle = $tmp_articletitle;
} else {
$mtitle = strip_tags($tmp_articletitle);
}
return ($mtitle);
case "wfstep":
if ($workflowItem === false)
{
return "nobody";
}
return ($workflowItem->get("position").".) ".$workflowItem->get("name"));
case "wfeditor":
$sEditor = getGroupOrUserName($currentEditor);
if (!$sEditor) {
$sEditor = "nobody";
}
return $sEditor;
case "wfaction":
$defaultidworkflow = getWorkflowForCat($idcat);
$idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow);
$sActionSelect = getActionSelect($idartlang, $idusersequence);
if (!$sActionSelect) {
$mayEdit = false;
}
$form = new UI_Form("wfaction".$idartlang, "main.php", "get");
$form->setVar("area",$area);
$form->setVar("action","workflow_do_action");
$form->setVar("frame", $frame);
$form->setVar("idcat", $idcat);
$form->setVar("modidartlang", $idartlang);
$form->setVar("idtpl", $idtpl);
$form->add("select", '<table cellspacing="0" border="0"><tr><td>'.$sActionSelect.'</td><td>');
$form->add("button", '<input type="image" src="'.$cfg["path"]["htmlpath"].$cfg["path"]["images"]."submit.gif".'"></tr></table>');
if ($mayEdit == true)
{
return ($form->render(true));
} else {
return '--- ' . i18n("None") . ' ---';
}
case "wflaststatus":
$sStatus = getLastWorkflowStatus($idartlang);
if (!$sStatus) {
$sStatus = '--- ' . i18n("None") . ' ---';
}
return $sStatus;
}
}
function piworkflowCreateTasksFolder ()
{
global $sess, $cfg;
$item = array();
/* Create workflow tasks folder */
$tmp_mstr = '<a href="javascript://" onclick="javascript:conMultiLink(\'%s\', \'%s\', \'%s\', \'%s\')">%s</a>';
$mstr = sprintf($tmp_mstr, 'right_bottom',
$sess->url("main.php?area=con_workflow&frame=4"),
'right_top',
$sess->url("main.php?area=con_workflow&frame=3"),
'Workflow / Todo');
$item["image"] = '<img src="'.$cfg["path"]["contenido_fullhtml"].$cfg["path"]["plugins"].'workflow/images/workflow_erstellen.gif">';
$item["title"] = $mstr;
return ($item);
}
?>

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -31,7 +31,7 @@ if(!defined('CON_FRAMEWORK')) {
} }
plugin_include('workflow', 'classes/class.workflow.php'); plugin_include('cl-workflow', 'classes/class.workflow.php');
$form = new UI_Table_Form("workflow_edit"); $form = new UI_Table_Form("workflow_edit");
$userclass = new User; $userclass = new User;
@ -83,10 +83,10 @@ $form->setVar("frame", $frame);
if ($workflow->virgin) if ($workflow->virgin)
{ {
$name = i18n("New Workflow", "workflow"); $name = i18n("New Workflow", "cl-workflow");
$header = i18n("Create new workflow", "workflow"); $header = i18n("Create new workflow", "cl-workflow");
} else { } else {
$header = i18n("Edit workflow", "workflow"); $header = i18n("Edit workflow", "cl-workflow");
$description = $workflow->get("description"); $description = $workflow->get("description");
$name = $workflow->get("name"); $name = $workflow->get("name");
$created = $workflow->get("created"); $created = $workflow->get("created");
@ -94,10 +94,10 @@ if ($workflow->virgin)
} }
$form->addHeader($header); $form->addHeader($header);
$form->add(i18n("Workflow name", "workflow"),formGenerateField("text","wfname",$name,40,255)); $form->add(i18n("Workflow name", "cl-workflow"),formGenerateField("text","wfname",$name,40,255));
$form->add(i18n("Description", "workflow"),formGenerateField("textbox","wfdescription",$description,50,10)); $form->add(i18n("Description", "cl-workflow"),formGenerateField("textbox","wfdescription",$description,50,10));
$form->add(i18n("Author", "workflow"),$author); $form->add(i18n("Author", "cl-workflow"),$author);
$form->add(i18n("Created", "workflow"),$created); $form->add(i18n("Created", "cl-workflow"),$created);
$page = new UI_Page; $page = new UI_Page;
$page->setContent($form->render(true)); $page->setContent($form->render(true));

Datei anzeigen

@ -34,7 +34,7 @@ if(!defined('CON_FRAMEWORK')) {
$create = new Link; $create = new Link;
$create->setMultiLink("workflow","","workflow_common","workflow_create"); $create->setMultiLink("workflow","","workflow_common","workflow_create");
//$create->setCLink("workflow_common",4,"workflow_create"); //$create->setCLink("workflow_common",4,"workflow_create");
$create->setContent(i18n("Create workflow", "workflow")); $create->setContent(i18n("Create workflow", "cl-workflow"));
$create->setCustom("idworkflow","-1"); $create->setCustom("idworkflow","-1");
$aAttributes = array(); $aAttributes = array();

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -25,30 +26,26 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
$iIdMarked = (int) $_GET['idworkflow']; $iIdMarked = (int) $_GET['idworkflow'];
plugin_include('workflow', 'classes/class.workflow.php');
$workflows = new Workflows; $workflows = new Workflows;
$sScript = ''; $sScript = '';
if ($action == "workflow_delete") if ($action == "workflow_delete") {
{ $workflows->delete($idworkflow);
$workflows->delete($idworkflow);
$sScript = '<script type="text/javascript"> $sScript = '<script type="text/javascript">
var right_top = top.content.frames["right"].frames["right_top"]; var right_top = top.content.frames["right"].frames["right_top"];
var right_bottom = top.content.frames["right"].frames["right_bottom"]; var right_bottom = top.content.frames["right"].frames["right_bottom"];
if (right_top) { if (right_top) {
right_top.location.href = "'.$sess->url('main.php?area=workflow&frame=3').'"; right_top.location.href = "' . $sess->url('main.php?area=workflow&frame=3') . '";
} }
if (right_bottom) { if (right_bottom) {
right_bottom.location.href = "'.$sess->url('main.php?area=workflow&frame=4').'"; right_bottom.location.href = "' . $sess->url('main.php?area=workflow&frame=4') . '";
} }
</script>'; </script>';
} }
@ -56,31 +53,29 @@ if ($action == "workflow_delete")
$ui = new UI_Menu; $ui = new UI_Menu;
$workflows->select("idclient = '$client' AND idlang = '$lang'"); $workflows->select("idclient = '$client' AND idlang = '$lang'");
while ($workflow = $workflows->next()) while ($workflow = $workflows->next()) {
{ $wfid = $workflow->getField("idworkflow");
$wfid = $workflow->getField("idworkflow"); $wfname = $workflow->getField("name");
$wfname = $workflow->getField("name"); $wfdescription = $workflow->getField("description");
$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", "workflow"); /* Create the link to show/edit the workflow */
$delDescr = sprintf(i18n("Do you really want to delete the following workflow:<br><br>%s<br>", "workflow"),$wfname); $link = new Link;
$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>'; $link->setMultiLink("workflow", "", "workflow_common", "workflow_show");
$link->setAlt($wfdescription);
$ui->setTitle($wfid, $wfname); $link->setCustom("idworkflow", $wfid);
$ui->setLink($wfid, $link);
$delTitle = i18n("Delete workflow", "cl-workflow");
$ui->setActions($wfid, 'delete', $delete); $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>';
if ($wfid == $iIdMarked) {
$ui->setExtra ($wfid, 'id="marked" '); $ui->setTitle($wfid, $wfname);
} $ui->setLink($wfid, $link);
$ui->setActions($wfid, 'delete', $delete);
if ($wfid == $iIdMarked) {
$ui->setExtra($wfid, 'id="marked" ');
}
} }
$content = $ui->render(false); $content = $ui->render(false);
@ -91,7 +86,7 @@ $delScript = '
function foo(){return true;} function foo(){return true;}
/* Session-ID */ /* Session-ID */
var sid = "'.$sess->id.'"; var sid = "' . $sess->id . '";
/* Create messageBox /* Create messageBox
instance */ instance */
@ -110,20 +105,18 @@ $delScript = '
} }
</script>'; </script>';
$sInitRowMark = "<script type=\"text/javascript\"> $sInitRowMark = "<script type=\"text/javascript\">
if (document.getElementById('marked')) { if (document.getElementById('marked')) {
row.markedRow = document.getElementById('marked'); row.markedRow = document.getElementById('marked');
} }
</script>"; </script>";
$msgboxInclude = ' <script type="text/javascript" src="scripts/messageBox.js.php?contenido='.$sess->id.'"></script>'; $msgboxInclude = ' <script type="text/javascript" src="scripts/messageBox.js.php?contenido=' . $sess->id . '"></script>';
$page = new UI_Page; $page = new UI_Page;
$page->addScript('include', $msgboxInclude); $page->addScript('include', $msgboxInclude);
$page->addScript('del',$delScript); $page->addScript('del', $delScript);
$page->addScript('refresh', $sScript); $page->addScript('refresh', $sScript);
$page->setMargin(0); $page->setMargin(0);
$page->setContent($content.$sInitRowMark); $page->setContent($content . $sInitRowMark);
$page->render(); $page->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -27,379 +28,370 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
plugin_include('workflow', 'classes/class.workflow.php');
plugin_include('workflow', 'includes/functions.workflow.php');
cInclude("includes", "functions.encoding.php"); cInclude("includes", "functions.encoding.php");
$iIdMarked = (int) $_GET['idworkflowitem']; $iIdMarked = (int) $_GET['idworkflowitem'];
$availableWorkflowActions= WorkflowActions :: getAvailableWorkflowActions(); $availableWorkflowActions = WorkflowActions :: getAvailableWorkflowActions();
$sCurrentEncoding = getEncodingByLanguage ($db, $lang, $cfg); $sCurrentEncoding = getEncodingByLanguage($db, $lang, $cfg);
if (clHtmlEntities($adduser, ENT_COMPAT, $sCurrentEncoding) == i18n("Add User", "workflow")) { if (clHtmlEntities($adduser, ENT_COMPAT, $sCurrentEncoding) == i18n("Add User", "cl-workflow")) {
$action= "workflow_create_user"; $action = "workflow_create_user";
} }
/* Function: Move step up */ /* Function: Move step up */
if ($action == "workflow_step_up") { if ($action == "workflow_step_up") {
$workflowitems= new WorkflowItems; $workflowitems = new WorkflowItems;
$workflowitems->swap($idworkflow, $position, $position -1); $workflowitems->swap($idworkflow, $position, $position - 1);
} }
/* Function: Move step down */ /* Function: Move step down */
if ($action == "workflow_step_down") { if ($action == "workflow_step_down") {
$workflowitems= new WorkflowItems; $workflowitems = new WorkflowItems;
$workflowitems->swap($idworkflow, $position, $position +1); $workflowitems->swap($idworkflow, $position, $position + 1);
} }
/* Function: Move user up */ /* Function: Move user up */
if ($action == "workflow_user_up") { if ($action == "workflow_user_up") {
$workflowitems= new WorkflowUserSequences; $workflowitems = new WorkflowUserSequences;
$workflowitems->swap($idworkflowitem, $position, $position -1); $workflowitems->swap($idworkflowitem, $position, $position - 1);
} }
/* Function: Move step down */ /* Function: Move step down */
if ($action == "workflow_user_down") { if ($action == "workflow_user_down") {
$workflowitems= new WorkflowUserSequences; $workflowitems = new WorkflowUserSequences;
$workflowitems->swap($idworkflowitem, $position, $position +1); $workflowitems->swap($idworkflowitem, $position, $position + 1);
} }
/* Function: Create new step */ /* Function: Create new step */
if ($action == "workflow_create_step") { if ($action == "workflow_create_step") {
$workflowitems= new WorkflowItems; $workflowitems = new WorkflowItems;
$item= $workflowitems->create($idworkflow); $item = $workflowitems->create($idworkflow);
$item->set("name", i18n("New Workflow Step", "workflow")); $item->set("name", i18n("New Workflow Step", "cl-workflow"));
$item->store(); $item->store();
$idworkflowitem= $item->get("idworkflowitem"); $idworkflowitem = $item->get("idworkflowitem");
} }
/* Function: Delete step */ /* Function: Delete step */
if ($action == "workflow_step_delete") { if ($action == "workflow_step_delete") {
$workflowitems= new WorkflowItems; $workflowitems = new WorkflowItems;
$workflowitems->delete($idworkflowitem); $workflowitems->delete($idworkflowitem);
} }
/* Function: Add user */ /* Function: Add user */
if ($action == "workflow_create_user") { if ($action == "workflow_create_user") {
$workflowusers= new WorkflowUserSequences; $workflowusers = new WorkflowUserSequences;
$new= $workflowusers->create($idworkflowitem); $new = $workflowusers->create($idworkflowitem);
} }
/* Function: Remove user */ /* Function: Remove user */
if ($action == "workflow_user_delete") { if ($action == "workflow_user_delete") {
$workflowusers= new WorkflowUserSequences; $workflowusers = new WorkflowUserSequences;
$workflowusers->delete($idusersequence); $workflowusers->delete($idusersequence);
} }
/* Function: Save step */ /* Function: Save step */
if ($action == "workflow_save_step" || $action == "workflow_create_user") { if ($action == "workflow_save_step" || $action == "workflow_create_user") {
$workflowactions= new WorkflowActions; $workflowactions = new WorkflowActions;
foreach ($availableWorkflowActions as $key => $value) { foreach ($availableWorkflowActions as $key => $value) {
if ($wfactions[$key] == 1) { if ($wfactions[$key] == 1) {
$workflowactions->set($idworkflowitem, $key); $workflowactions->set($idworkflowitem, $key);
} else { } else {
$workflowactions->remove($idworkflowitem, $key); $workflowactions->remove($idworkflowitem, $key);
} }
} }
$workflowitem= new WorkflowItem; $workflowitem = new WorkflowItem;
$workflowitem->loadByPrimaryKey($idworkflowitem); $workflowitem->loadByPrimaryKey($idworkflowitem);
$workflowitem->setField('idtask', $wftaskselect); $workflowitem->setField('idtask', $wftaskselect);
$workflowitem->setField('name', $wfstepname); $workflowitem->setField('name', $wfstepname);
$workflowitem->setField('description', $wfstepdescription); $workflowitem->setField('description', $wfstepdescription);
$workflowitem->store(); $workflowitem->store();
$usersequences= new WorkflowUserSequences; $usersequences = new WorkflowUserSequences;
$usersequences->select("idworkflowitem = '$idworkflowitem'"); $usersequences->select("idworkflowitem = '$idworkflowitem'");
while ($usersequence= $usersequences->next()) { while ($usersequence = $usersequences->next()) {
$wftime= "time" . $usersequence->get("idusersequence"); $wftime = "time" . $usersequence->get("idusersequence");
$wfuser= "user" . $usersequence->get("idusersequence"); $wfuser = "user" . $usersequence->get("idusersequence");
$wftimelimit= "wftimelimit" . $usersequence->get("idusersequence"); $wftimelimit = "wftimelimit" . $usersequence->get("idusersequence");
$usersequence->set("timeunit", $$wftime); $usersequence->set("timeunit", $$wftime);
$usersequence->set("iduser", $$wfuser); $usersequence->set("iduser", $$wfuser);
$usersequence->set("timelimit", $$wftimelimit); $usersequence->set("timelimit", $$wftimelimit);
$usersequence->set("emailnoti", $wfemailnoti[$usersequence->get("idusersequence")]); $usersequence->set("emailnoti", $wfemailnoti[$usersequence->get("idusersequence")]);
$usersequence->set("escalationnoti", $wfescalnoti[$usersequence->get("idusersequence")]); $usersequence->set("escalationnoti", $wfescalnoti[$usersequence->get("idusersequence")]);
$usersequence->store(); $usersequence->store();
}
}
} }
function getTimeUnitSelector($listid, $default) { function getTimeUnitSelector($listid, $default) {
global $idclient, $cfg, $auth; global $idclient, $cfg, $auth;
$timeunits = array (); $timeunits = array();
$timeunits['Seconds'] = i18n("Seconds", "workflow"); $timeunits['Seconds'] = i18n("Seconds", "cl-workflow");
$timeunits['Minutes'] = i18n("Minutes", "workflow"); $timeunits['Minutes'] = i18n("Minutes", "cl-workflow");
$timeunits['Hours'] = i18n("Hours", "workflow"); $timeunits['Hours'] = i18n("Hours", "cl-workflow");
$timeunits['Days'] = i18n("Days", "workflow"); $timeunits['Days'] = i18n("Days", "cl-workflow");
$timeunits['Weeks'] = i18n("Weeks", "workflow"); $timeunits['Weeks'] = i18n("Weeks", "cl-workflow");
$timeunits['Months'] = i18n("Months", "workflow"); $timeunits['Months'] = i18n("Months", "cl-workflow");
$timeunits['Years'] = i18n("Years", "workflow"); $timeunits['Years'] = i18n("Years", "cl-workflow");
$tpl2= new Template; $tpl2 = new Template;
$tpl2->set('s', 'NAME', 'time' . $listid); $tpl2->set('s', 'NAME', 'time' . $listid);
$tpl2->set('s', 'CLASS', 'text_small'); $tpl2->set('s', 'CLASS', 'text_small');
$tpl2->set('s', 'OPTIONS', 'size=1'); $tpl2->set('s', 'OPTIONS', 'size=1');
foreach ($timeunits as $key => $value) { foreach ($timeunits as $key => $value) {
$tpl2->set('d', 'VALUE', $key); $tpl2->set('d', 'VALUE', $key);
$tpl2->set('d', 'CAPTION', $value); $tpl2->set('d', 'CAPTION', $value);
if ($default == $key) { if ($default == $key) {
$tpl2->set('d', 'SELECTED', 'SELECTED'); $tpl2->set('d', 'SELECTED', 'SELECTED');
} else { } else {
$tpl2->set('d', 'SELECTED', ''); $tpl2->set('d', 'SELECTED', '');
} }
$tpl2->next(); $tpl2->next();
} }
return $tpl2->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true);
return $tpl2->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true);
} }
function getWorkflowList() { function getWorkflowList() {
global $idworkflow, $cfg; global $idworkflow, $cfg;
$ui= new UI_Menu; $ui = new UI_Menu;
$workflowitems= new WorkflowItems; $workflowitems = new WorkflowItems;
$workflowitems->select("idworkflow = '$idworkflow'", "", "position ASC"); $workflowitems->select("idworkflow = '$idworkflow'", "", "position ASC");
while ($workflowitem= $workflowitems->next()) { while ($workflowitem = $workflowitems->next()) {
$pos= $workflowitem->get("position"); $pos = $workflowitem->get("position");
$name= $workflowitem->get("name"); $name = $workflowitem->get("name");
$id= $workflowitem->get("idworkflowitem"); $id = $workflowitem->get("idworkflowitem");
$edititem= new Link; $edititem = new Link;
$edititem->setCLink("workflow_steps", 4, "workflow_step_edit"); $edititem->setCLink("workflow_steps", 4, "workflow_step_edit");
$edititem->setCustom("idworkflowitem", $id); $edititem->setCustom("idworkflowitem", $id);
$edititem->setCustom("idworkflow", $idworkflow); $edititem->setCustom("idworkflow", $idworkflow);
$moveup= new Link; $moveup = new Link;
$moveup->setCLink("workflow_steps", 4, "workflow_step_up"); $moveup->setCLink("workflow_steps", 4, "workflow_step_up");
$moveup->setCustom("idworkflowitem", $id); $moveup->setCustom("idworkflowitem", $id);
$moveup->setCustom("idworkflow", $idworkflow); $moveup->setCustom("idworkflow", $idworkflow);
$moveup->setCustom("position", $pos); $moveup->setCustom("position", $pos);
$moveup->setAlt(i18n("Move step up", "workflow")); $moveup->setAlt(i18n("Move step up", "cl-workflow"));
$moveup->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/no_verschieben.gif" . '">'); $moveup->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/no_verschieben.gif" . '">');
$movedown= new Link; $movedown = new Link;
$movedown->setCLink("workflow_steps", 4, "workflow_step_down"); $movedown->setCLink("workflow_steps", 4, "workflow_step_down");
$movedown->setCustom("idworkflowitem", $id); $movedown->setCustom("idworkflowitem", $id);
$movedown->setCustom("idworkflow", $idworkflow); $movedown->setCustom("idworkflow", $idworkflow);
$movedown->setCustom("position", $pos); $movedown->setCustom("position", $pos);
$movedown->setAlt(i18n("Move step down", "workflow")); $movedown->setAlt(i18n("Move step down", "cl-workflow"));
$movedown->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/nu_verschieben.gif" . '">'); $movedown->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/nu_verschieben.gif" . '">');
$deletestep= new Link;
$deletestep->setCLink("workflow_steps", 4, "workflow_step_delete");
$deletestep->setCustom("idworkflowitem", $id);
$deletestep->setCustom("idworkflow", $idworkflow);
$deletestep->setCustom("position", $pos);
$deletestep->setAlt(i18n("Delete step", "workflow"));
$deletestep->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_delete.gif" . '">');
$ui->setTitle($id, "$pos. $name");
$ui->setLink($id, $edititem);
if ($pos > 1) {
$ui->setActions($id, "moveup", $moveup->render());
} else {
$ui->setActions($id, "moveup", '<img style="padding-left: 2px" src="images/spacer.gif" width="15" height="1">');
}
if ($pos < $workflowitems->count()) {
$ui->setActions($id, "movedown", $movedown->render());
} else {
$ui->setActions($id, "movedown", '<img style="padding-left: 2px" src="images/spacer.gif" width="15" height="1">');
}
$ui->setActions($id, "delete", $deletestep->render());
if ($_GET['idworkflowitem'] == $id) {
$ui->setExtra ($id, 'id="marked" ');
}
}
$content= $ui->render(false);
return ($content); $deletestep = new Link;
$deletestep->setCLink("workflow_steps", 4, "workflow_step_delete");
$deletestep->setCustom("idworkflowitem", $id);
$deletestep->setCustom("idworkflow", $idworkflow);
$deletestep->setCustom("position", $pos);
$deletestep->setAlt(i18n("Delete step", "cl-workflow"));
$deletestep->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_delete.gif" . '">');
$ui->setTitle($id, "$pos. $name");
$ui->setLink($id, $edititem);
if ($pos > 1) {
$ui->setActions($id, "moveup", $moveup->render());
} else {
$ui->setActions($id, "moveup", '<img style="padding-left: 2px" src="images/spacer.gif" width="15" height="1">');
}
if ($pos < $workflowitems->count()) {
$ui->setActions($id, "movedown", $movedown->render());
} else {
$ui->setActions($id, "movedown", '<img style="padding-left: 2px" src="images/spacer.gif" width="15" height="1">');
}
$ui->setActions($id, "delete", $deletestep->render());
if ($_GET['idworkflowitem'] == $id) {
$ui->setExtra($id, 'id="marked" ');
}
}
$content = $ui->render(false);
return ($content);
} }
function createNewWorkflow() { function createNewWorkflow() {
global $idworkflow, $cfg; global $idworkflow, $cfg;
$content= ""; $content = "";
$ui= new UI_Menu; $ui = new UI_Menu;
$rowmark = false; $rowmark = false;
$createstep= new Link; $createstep = new Link;
$createstep->setCLink("workflow_steps", 4, "workflow_create_step"); $createstep->setCLink("workflow_steps", 4, "workflow_create_step");
$createstep->setCustom("idworkflow", $idworkflow); $createstep->setCustom("idworkflow", $idworkflow);
#$ui->setLink("spacer", NULL); #$ui->setLink("spacer", NULL);
$ui->setTitle("create", i18n("Create new step", "workflow")); $ui->setTitle("create", i18n("Create new step", "cl-workflow"));
$ui->setImage("create", $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_new.gif"); $ui->setImage("create", $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_new.gif");
$ui->setLink("create", $createstep); $ui->setLink("create", $createstep);
$ui->setRowmark ($rowmark); $ui->setRowmark($rowmark);
$ui->setBgColor("create", $cfg['color']['table_header']); $ui->setBgColor("create", $cfg['color']['table_header']);
$content= $ui->render(false);
return $content;
$content = $ui->render(false);
return $content;
} }
function editWorkflowStep($idworkflowitem) { function editWorkflowStep($idworkflowitem) {
global $area, $idworkflow, $idworkflowitem, $frame, $availableWorkflowActions; global $area, $idworkflow, $idworkflowitem, $frame, $availableWorkflowActions;
global $notification; global $notification;
$workflowitem= new WorkflowItem; $workflowitem = new WorkflowItem;
if ($workflowitem->loadByPrimaryKey($idworkflowitem) == false) { if ($workflowitem->loadByPrimaryKey($idworkflowitem) == false) {
return "&nbsp;"; return "&nbsp;";
} }
$workflowactions= new WorkflowActions; $workflowactions = new WorkflowActions;
$stepname= $workflowitem->get("name"); $stepname = $workflowitem->get("name");
$stepdescription= $workflowitem->get("description"); $stepdescription = $workflowitem->get("description");
$id= $workflowitem->get("idworkflowitem"); $id = $workflowitem->get("idworkflowitem");
$task= $workflowitem->get("idtask"); $task = $workflowitem->get("idtask");
$form= new UI_Table_Form("workflow_edit"); $form = new UI_Table_Form("workflow_edit");
$form->setVar("area", $area); $form->setVar("area", $area);
$form->setVar("action", "workflow_save_step"); $form->setVar("action", "workflow_save_step");
$form->setVar("idworkflow", $idworkflow); $form->setVar("idworkflow", $idworkflow);
$form->setVar("idworkflowitem", $idworkflowitem); $form->setVar("idworkflowitem", $idworkflowitem);
$form->setVar("frame", $frame); $form->setVar("frame", $frame);
$form->addHeader(i18n("Edit workflow step", "workflow")); $form->addHeader(i18n("Edit workflow step", "cl-workflow"));
$form->add(i18n("Step name", "workflow"), formGenerateField("text", "wfstepname", $stepname, 40, 255)); $form->add(i18n("Step name", "cl-workflow"), formGenerateField("text", "wfstepname", $stepname, 40, 255));
$form->add(i18n("Step description", "workflow"), formGenerateField("textbox", "wfstepdescription", $stepdescription, 60, 10)); $form->add(i18n("Step description", "cl-workflow"), formGenerateField("textbox", "wfstepdescription", $stepdescription, 60, 10));
foreach ($availableWorkflowActions as $key => $value) { foreach ($availableWorkflowActions as $key => $value) {
$actions .= formGenerateCheckbox("wfactions[" . $key . "]", "1", $workflowactions->get($id, $key)) . '<label for="wfactions[' . $key . ']1">' . $value . '</label>' . "<br>"; $actions .= formGenerateCheckbox("wfactions[" . $key . "]", "1", $workflowactions->get($id, $key)) . '<label for="wfactions[' . $key . ']1">' . $value . '</label>' . "<br>";
} }
$form->add(i18n("Actions", "workflow"), $actions); $form->add(i18n("Actions", "cl-workflow"), $actions);
$form->add(i18n("Assigned users", "workflow"), getWorkflowUsers($idworkflowitem)); $form->add(i18n("Assigned users", "cl-workflow"), getWorkflowUsers($idworkflowitem));
return $form->render(true); return $form->render(true);
} }
function getWorkflowUsers($idworkflowitem) { function getWorkflowUsers($idworkflowitem) {
global $idworkflow, $cfg; global $idworkflow, $cfg;
$ui= new UI_Menu; $ui = new UI_Menu;
$workflowusers= new WorkflowUserSequences; $workflowusers = new WorkflowUserSequences;
$workflowusers->select("idworkflowitem = '$idworkflowitem'", "", "position ASC"); $workflowusers->select("idworkflowitem = '$idworkflowitem'", "", "position ASC");
while ($workflowitem= $workflowusers->next()) { while ($workflowitem = $workflowusers->next()) {
$pos= $workflowitem->get("position"); $pos = $workflowitem->get("position");
$iduser= $workflowitem->get("iduser"); $iduser = $workflowitem->get("iduser");
$timelimit= $workflowitem->get("timelimit"); $timelimit = $workflowitem->get("timelimit");
$timeunit= $workflowitem->get("timeunit"); $timeunit = $workflowitem->get("timeunit");
$email= $workflowitem->get("emailnoti"); $email = $workflowitem->get("emailnoti");
$escalation= $workflowitem->get("escalationnoti"); $escalation = $workflowitem->get("escalationnoti");
$timeunit= $workflowitem->get("timeunit"); $timeunit = $workflowitem->get("timeunit");
$id= $workflowitem->get("idusersequence"); $id = $workflowitem->get("idusersequence");
$moveup= new Link; $moveup = new Link;
$moveup->setCLink("workflow_steps", 4, "workflow_user_up"); $moveup->setCLink("workflow_steps", 4, "workflow_user_up");
$moveup->setCustom("idworkflowitem", $idworkflowitem); $moveup->setCustom("idworkflowitem", $idworkflowitem);
$moveup->setCustom("idworkflow", $idworkflow); $moveup->setCustom("idworkflow", $idworkflow);
$moveup->setCustom("position", $pos); $moveup->setCustom("position", $pos);
$moveup->setAlt(i18n("Move user up", "workflow")); $moveup->setAlt(i18n("Move user up", "cl-workflow"));
#$moveup->setContent('<img border="0" style="padding-left: 2px" src="images/pfeil_hoch.gif">'); #$moveup->setContent('<img border="0" style="padding-left: 2px" src="images/pfeil_hoch.gif">');
$moveup->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/no_verschieben.gif" . '">'); $moveup->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/no_verschieben.gif" . '">');
$movedown= new Link; $movedown = new Link;
$movedown->setCLink("workflow_steps", 4, "workflow_user_down"); $movedown->setCLink("workflow_steps", 4, "workflow_user_down");
$movedown->setCustom("idworkflowitem", $idworkflowitem); $movedown->setCustom("idworkflowitem", $idworkflowitem);
$movedown->setCustom("idworkflow", $idworkflow); $movedown->setCustom("idworkflow", $idworkflow);
$movedown->setCustom("position", $pos); $movedown->setCustom("position", $pos);
$movedown->setAlt(i18n("Move user down", "workflow")); $movedown->setAlt(i18n("Move user down", "cl-workflow"));
$movedown->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/nu_verschieben.gif" . '">'); $movedown->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/nu_verschieben.gif" . '">');
$deletestep= new Link; $deletestep = new Link;
$deletestep->setCLink("workflow_steps", 4, "workflow_user_delete"); $deletestep->setCLink("workflow_steps", 4, "workflow_user_delete");
$deletestep->setCustom("idworkflowitem", $idworkflowitem); $deletestep->setCustom("idworkflowitem", $idworkflowitem);
$deletestep->setCustom("idworkflow", $idworkflow); $deletestep->setCustom("idworkflow", $idworkflow);
$deletestep->setCustom("position", $pos); $deletestep->setCustom("position", $pos);
$deletestep->setCustom("idusersequence", $id); $deletestep->setCustom("idusersequence", $id);
$deletestep->setAlt(i18n("Delete user", "workflow")); $deletestep->setAlt(i18n("Delete user", "cl-workflow"));
$deletestep->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_delete.gif" . '">'); $deletestep->setContent('<img style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_step_delete.gif" . '">');
$title= "$pos. " . getUsers($id, $iduser); $title = "$pos. " . getUsers($id, $iduser);
$title .= formGenerateField("text", "wftimelimit" . $id, $timelimit, 3, 6); $title .= formGenerateField("text", "wftimelimit" . $id, $timelimit, 3, 6);
$title .= getTimeUnitSelector($id, $timeunit); $title .= getTimeUnitSelector($id, $timeunit);
$altmail= i18n("Notify this user via E-Mail", "workflow"); $altmail = i18n("Notify this user via E-Mail", "cl-workflow");
$altnoti= i18n("Escalate to this user via E-Mail", "workflow"); $altnoti = i18n("Escalate to this user via E-Mail", "cl-workflow");
$title .= formGenerateCheckbox("wfemailnoti[" . $id . "]", "1", $email) . '<label for="wfemailnoti[' . $id . ']1"><img alt="' . $altmail . '" title="' . $altmail . '" style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_email_noti.gif" . '"></label>'; $title .= formGenerateCheckbox("wfemailnoti[" . $id . "]", "1", $email) . '<label for="wfemailnoti[' . $id . ']1"><img alt="' . $altmail . '" title="' . $altmail . '" style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_email_noti.gif" . '"></label>';
$title .= formGenerateCheckbox("wfescalnoti[" . $id . "]", "1", $escalation) . '<label for="wfescalnoti[' . $id . ']1"><img alt="' . $altnoti . '" title="' . $altnoti . '" style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_escal_noti.gif" . '"></label>'; $title .= formGenerateCheckbox("wfescalnoti[" . $id . "]", "1", $escalation) . '<label for="wfescalnoti[' . $id . ']1"><img alt="' . $altnoti . '" title="' . $altnoti . '" style="padding-left: 2px" border="0" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_escal_noti.gif" . '"></label>';
$ui->setTitle($id, $title); $ui->setTitle($id, $title);
$ui->setLink($id, NULL); $ui->setLink($id, NULL);
if ($pos > 1) { if ($pos > 1) {
$ui->setActions($id, "moveup", $moveup->render()); $ui->setActions($id, "moveup", $moveup->render());
} else { } else {
$ui->setActions($id, "moveup", '<img style="padding-left: 2px" src="images/spacer.gif" width="15" height="1">'); $ui->setActions($id, "moveup", '<img style="padding-left: 2px" src="images/spacer.gif" width="15" height="1">');
} }
if ($pos < $workflowusers->count()) { if ($pos < $workflowusers->count()) {
$ui->setActions($id, "movedown", $movedown->render()); $ui->setActions($id, "movedown", $movedown->render());
} else { } else {
$ui->setActions($id, "movedown", '<img style="padding-left: 2px" src="images/spacer.gif" width="15" height="1">'); $ui->setActions($id, "movedown", '<img style="padding-left: 2px" src="images/spacer.gif" width="15" height="1">');
} }
$ui->setActions($id, "delete", $deletestep->render()); $ui->setActions($id, "delete", $deletestep->render());
$ui->setImage($id, $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_user.gif"); $ui->setImage($id, $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["plugins"] . "workflow/images/workflow_user.gif");
}
} $createstep = new Link;
$createstep->setCLink("workflow_steps", 4, "workflow_create_user");
$createstep->setCustom("idworkflow", $idworkflow);
$createstep->setCustom("idworkflowitem", $idworkflowitem);
$createstep= new Link; $ui->setLink("spacer", NULL);
$createstep->setCLink("workflow_steps", 4, "workflow_create_user");
$createstep->setCustom("idworkflow", $idworkflow);
$createstep->setCustom("idworkflowitem", $idworkflowitem);
$ui->setLink("spacer", NULL); $ui->setTitle("create", '<input class="text_medium" type="submit" name="adduser" value="' . i18n("Add User", "cl-workflow") . '">');
$ui->setLink("create", NULL);
$content = $ui->render(false);
$ui->setTitle("create", '<input class="text_medium" type="submit" name="adduser" value="' . i18n("Add User", "workflow") . '">'); return ($content);
$ui->setLink("create", NULL);
$content= $ui->render(false);
return ($content);
} }
$tpl= new Template; $tpl = new Template;
$tpl->set('s', 'NEW', createNewWorkflow()); $tpl->set('s', 'NEW', createNewWorkflow());
$tpl->set('s', 'STEPS', getWorkflowList()); $tpl->set('s', 'STEPS', getWorkflowList());
$tpl->set('s', 'EDITSTEP', editWorkflowStep($idworkflowitem)); $tpl->set('s', 'EDITSTEP', editWorkflowStep($idworkflowitem));
$tpl->set('s', 'BORDERCOLOR', $cfg["color"]["table_border"]); $tpl->set('s', 'BORDERCOLOR', $cfg["color"]["table_border"]);
$frame= $tpl->generate($cfg["path"]["contenido"] . $cfg["path"]["plugins"] . "workflow/templates/template.workflow_steps.html", true); $frame = $tpl->generate($cfg["path"]["contenido"] . $cfg["path"]["plugins"] . "workflow/templates/template.workflow_steps.html", true);
$page= new UI_Page; $page = new UI_Page;
$page->setContent($frame); $page->setContent($frame);
$page->render(); $page->render();
?>

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -26,88 +27,81 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) { if (!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
$nav = new Contenido_Navigation; $nav = new Contenido_Navigation;
$parentarea = getParentAreaID($area); $parentarea = getParentAreaID($area);
$sql = "SELECT $sql = "SELECT
idarea idarea
FROM FROM
".$cfg["tab"]["area"]." AS a " . $cfg["tab"]["area"] . " AS a
WHERE WHERE
a.name = '".Contenido_Security::escapeDB($parentarea, $db)."' OR a.name = '" . Contenido_Security::escapeDB($parentarea, $db) . "' OR
a.parent_id = '".Contenido_Security::escapeDB($parentarea, $db)."' a.parent_id = '" . Contenido_Security::escapeDB($parentarea, $db) . "'
ORDER BY ORDER BY
idarea"; idarea";
$db->query($sql); $db->query($sql);
$in_str = ""; $in_str = "";
while ( $db->next_record() ) { while ($db->next_record()) {
$in_str .= $db->f('idarea') . ','; $in_str .= $db->f('idarea') . ',';
} }
$len = strlen($in_str)-1; $len = strlen($in_str) - 1;
$in_str = substr($in_str, 0, $len); $in_str = substr($in_str, 0, $len);
$in_str = '('.$in_str.')'; $in_str = '(' . $in_str . ')';
$sql = "SELECT $sql = "SELECT
b.location AS location, b.location AS location,
a.name AS name a.name AS name
FROM FROM
".$cfg["tab"]["area"]." AS a, " . $cfg["tab"]["area"] . " AS a,
".$cfg["tab"]["nav_sub"]." AS b " . $cfg["tab"]["nav_sub"] . " AS b
WHERE WHERE
b.idarea IN ".Contenido_Security::escapeDB($in_str, $db)." AND b.idarea IN " . Contenido_Security::escapeDB($in_str, $db) . " AND
b.idarea = a.idarea AND b.idarea = a.idarea AND
b.level = 1 b.level = 1
ORDER BY ORDER BY
b.idnavs"; b.idnavs";
$db->query($sql); $db->query($sql);
while ( $db->next_record() ) { while ($db->next_record()) {
# Extract caption from # Extract caption from
# the xml language file # the xml language file
$caption = $nav->getName($db->f("location")); $caption = $nav->getName($db->f("location"));
$tmp_area = $db->f("name"); $tmp_area = $db->f("name");
# Set template data
$tpl->set("d", "ID", 'c_'.$tpl->dyn_cnt);
$tpl->set("d", "CLASS", '');
$tpl->set("d", "OPTIONS", '');
$tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="'.$sess->url("main.php?area=$tmp_area&frame=4&idworkflow=$idworkflow").'">'.$caption.'</a>');
if ($area == $tmp_area)
{
$tpl->set('s', 'DEFAULT', markSubMenuItem($tpl->dyn_cnt,true));
}
$tpl->next();
# Set template data
$tpl->set("d", "ID", 'c_' . $tpl->dyn_cnt);
$tpl->set("d", "CLASS", '');
$tpl->set("d", "OPTIONS", '');
$tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="' . $sess->url("main.php?area=$tmp_area&frame=4&idworkflow=$idworkflow") . '">' . $caption . '</a>');
if ($area == $tmp_area) {
$tpl->set('s', 'DEFAULT', markSubMenuItem($tpl->dyn_cnt, true));
} }
$tpl->next();
}
$tpl->set('s', 'COLSPAN', ($tpl->dyn_cnt * 2) + 2); $tpl->set('s', 'COLSPAN', ($tpl->dyn_cnt * 2) + 2);
$tpl->set('s', 'IDCAT', $idcat); $tpl->set('s', 'IDCAT', $idcat);
$tpl->set('s', 'SESSID', $sess->id); $tpl->set('s', 'SESSID', $sess->id);
$tpl->set('s', 'CLIENT', $client); $tpl->set('s', 'CLIENT', $client);
$tpl->set('s', 'LANG', $lang); $tpl->set('s', 'LANG', $lang);
# Generate the third
# navigation layer
if ($idworkflow <= 0)
{
$tpl->generate($cfg["path"]["templates"].$cfg["templates"]["subnav_blank"]);
} else {
$tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav"]);
}
?> # Generate the third
# navigation layer
if ($idworkflow <= 0) {
$tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav_blank"]);
} else {
$tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav"]);
}

Datei anzeigen

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -25,13 +26,10 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) { die('Illegal call');
die('Illegal call');
} }
plugin_include('workflow', 'classes/class.workflow.php');
plugin_include('workflow', 'includes/functions.workflow.php'); plugin_include('workflow', 'includes/functions.workflow.php');
global $sess; global $sess;
@ -44,83 +42,68 @@ $db2 = new DB_ConLite;
ob_start(); ob_start();
if ($usershow == "") if ($usershow == "") {
{ $usershow = $auth->auth["uid"];
$usershow = $auth->auth["uid"];
} }
if (!$perm->have_perm_area_action($area, "workflow_task_user_select")) if (!$perm->have_perm_area_action($area, "workflow_task_user_select")) {
{ $usershow = $auth->auth["uid"];
$usershow = $auth->auth["uid"];
} }
if ($action == "workflow_do_action") if ($action == "workflow_do_action") {
{ $selectedAction = "wfselect" . $modidartlang;
$selectedAction = "wfselect".$modidartlang;
doWorkflowAction($modidartlang, $GLOBALS[$selectedAction]); doWorkflowAction($modidartlang, $GLOBALS[$selectedAction]);
} }
$wfa->select(); $wfa->select();
while ($wfaitem = $wfa->next()) while ($wfaitem = $wfa->next()) {
{ $wfaid = $wfaitem->get("idartallocation");
$wfaid = $wfaitem->get("idartallocation"); $usersequence[$wfaid] = $wfaitem->get("idusersequence");
$usersequence[$wfaid] = $wfaitem->get("idusersequence"); $lastusersequence[$wfaid] = $wfaitem->get("lastusersequence");
$lastusersequence[$wfaid] = $wfaitem->get("lastusersequence"); $article[$wfaid] = $wfaitem->get("idartlang");
$article[$wfaid] = $wfaitem->get("idartlang");
}
if (is_array($usersequence))
{
foreach ($usersequence as $key => $value)
{
$wfu->select("idusersequence = '$value'");
if ($obj = $wfu->next())
{
$userids[$key] = $obj->get("iduser");
}
}
} }
if (is_array($userids))
{ if (is_array($usersequence)) {
foreach ($userids as $key=>$value) foreach ($usersequence as $key => $value) {
{ $wfu->select("idusersequence = '$value'");
$isCurrent[$key] = false; if ($obj = $wfu->next()) {
$userids[$key] = $obj->get("iduser");
if ($usershow == $value)
{
$isCurrent[$key] = true;
}
if ($users->loadUserByUserID($value) == false)
{
/* Yes, it's a group. Let's try to load the group members! */
$sql = "SELECT user_id FROM "
.$cfg["tab"]["groupmembers"]."
WHERE group_id = '".$value."'";
$db2->query(Contenido_Security::escapeDB($sql, $db2));
while ($db2->next_record())
{
if ($db2->f("user_id") == $usershow)
{
$isCurrent[$key] = true;
}
} }
} else {
if ($value == $usershow)
{
$isCurrent[$key] = true;
}
}
if ($lastusersequence[$key] == $usersequence[$key])
{
$isCurrent[$key] = false;
} }
} }
if (is_array($userids)) {
foreach ($userids as $key => $value) {
$isCurrent[$key] = false;
if ($usershow == $value) {
$isCurrent[$key] = true;
}
if ($users->loadUserByUserID($value) == false) {
/* Yes, it's a group. Let's try to load the group members! */
$sql = "SELECT user_id FROM "
. $cfg["tab"]["groupmembers"] . "
WHERE group_id = '" . $value . "'";
$db2->query(Contenido_Security::escapeDB($sql, $db2));
while ($db2->next_record()) {
if ($db2->f("user_id") == $usershow) {
$isCurrent[$key] = true;
}
}
} else {
if ($value == $usershow) {
$isCurrent[$key] = true;
}
}
if ($lastusersequence[$key] == $usersequence[$key]) {
$isCurrent[$key] = false;
}
}
} }
$tpl->reset(); $tpl->reset();
@ -130,136 +113,131 @@ $tpl->set('s', 'SESSNAME', $sess->name);
$iIDCat = 0; $iIDCat = 0;
$iIDTpl = 0; $iIDTpl = 0;
if ($perm->have_perm_area_action($area, "workflow_task_user_select")) if ($perm->have_perm_area_action($area, "workflow_task_user_select")) {
{
$form = new UI_Form("showusers", $sess->url("main.php?area=$area&frame=$frame")); $form = new UI_Form("showusers", $sess->url("main.php?area=$area&frame=$frame"));
$form->setVar("area",$area); $form->setVar("area", $area);
$form->setEvent("submit", "setUsershow();"); $form->setEvent("submit", "setUsershow();");
$form->setVar("frame", $frame); $form->setVar("frame", $frame);
$form->setVar("action", "workflow_task_user_select"); $form->setVar("action", "workflow_task_user_select");
$form->add("select",i18n("Show users").": ".getUsers("show",$usershow)); $form->add("select", i18n("Show users", 'cl-workflow') . ": " . getUsers("show", $usershow));
$form->add("button", '<input style="vertical-align:middle;" type="image" src="'.$cfg["path"]["htmlpath"].$cfg["path"]["images"]."submit.gif".'">'); $form->add("button", '<input style="vertical-align:middle;" type="image" src="' . $cfg["path"]["htmlpath"] . $cfg["path"]["images"] . "submit.gif" . '">');
$tpl->set('s', 'USERSELECT', $form->render(true)); $tpl->set('s', 'USERSELECT', $form->render(true));
} else { } else {
$tpl->set('s', 'USERSELECT', ''); $tpl->set('s', 'USERSELECT', '');
} }
$pageTitle = i18n('Search results').' - '.i18n('Workflow tasks', 'workflow'); $pageTitle = i18n('Search results', 'cl-workflow') . ' - ' . i18n('Workflow tasks', 'cl-workflow');
$tpl->set('s', 'PAGE_TITLE', $pageTitle); $tpl->set('s', 'PAGE_TITLE', $pageTitle);
$tpl->set('s', 'TH_START', i18n("Article")); $tpl->set('s', 'TH_START', i18n("Article", 'cl-workflow'));
$tpl->set('s', 'TH_TEMPLATE', i18n("Template")); $tpl->set('s', 'TH_TEMPLATE', i18n("Template", 'cl-workflow'));
$tpl->set('s', 'TH_ACTIONS', i18n("Actions")); $tpl->set('s', 'TH_ACTIONS', i18n("Actions", 'cl-workflow'));
$tpl->set('s', 'TH_TITLE', i18n("Title")); $tpl->set('s', 'TH_TITLE', i18n("Title", 'cl-workflow'));
$tpl->set('s', 'TH_CHANGED', i18n("Changed")); $tpl->set('s', 'TH_CHANGED', i18n("Changed", 'cl-workflow'));
$tpl->set('s', 'TH_PUBLISHED', i18n("Published")); $tpl->set('s', 'TH_PUBLISHED', i18n("Published", 'cl-workflow'));
$tpl->set('s', 'TH_WORKFLOW_STEP', i18n("Workflow Step", 'workflow')); $tpl->set('s', 'TH_WORKFLOW_STEP', i18n("Workflow Step", 'cl-workflow'));
$tpl->set('s', 'TH_WORKFLOW_ACTION', i18n("Workflow Action", 'workflow')); $tpl->set('s', 'TH_WORKFLOW_ACTION', i18n("Workflow Action", 'cl-workflow'));
$tpl->set('s', 'TH_WORKFLOW_EDITOR', i18n("Workflow Editor")); $tpl->set('s', 'TH_WORKFLOW_EDITOR', i18n("Workflow Editor", 'cl-workflow'));
$tpl->set('s', 'TH_LAST_STATUS', i18n("Last status", 'workflow')); $tpl->set('s', 'TH_LAST_STATUS', i18n("Last status", 'cl-workflow'));
$currentUserSequence = new WorkflowUserSequence; $currentUserSequence = new WorkflowUserSequence;
if (is_array($isCurrent))
{
foreach ($isCurrent as $key => $value) if (is_array($isCurrent)) {
{
if ($value == true)
{
$idartlang = Contenido_Security::toInteger($article[$key]);
$lang = Contenido_Security::toInteger($lang);
$client = Contenido_Security::toInteger($client);
$sql = "SELECT B.idcat AS idcat, A.title AS title, A.created AS created, A.lastmodified AS changed, foreach ($isCurrent as $key => $value) {
if ($value == true) {
$idartlang = Contenido_Security::toInteger($article[$key]);
$lang = Contenido_Security::toInteger($lang);
$client = Contenido_Security::toInteger($client);
$sql = "SELECT B.idcat AS idcat, A.title AS title, A.created AS created, A.lastmodified AS changed,
A.idart as idart, E.name as tpl_name, A.idartlang as idartlang, F.idcatlang as idcatlang, A.idart as idart, E.name as tpl_name, A.idartlang as idartlang, F.idcatlang as idcatlang,
B.idcatart as idcatart, A.idlang as art_lang, F.startidartlang as startidartlang B.idcatart as idcatart, A.idlang as art_lang, F.startidartlang as startidartlang
FROM (".$cfg["tab"]["art_lang"]." AS A, FROM (" . $cfg["tab"]["art_lang"] . " AS A,
".$cfg["tab"]["cat_art"]." AS B, " . $cfg["tab"]["cat_art"] . " AS B,
".$cfg["tab"]["art"]." AS C) " . $cfg["tab"]["art"] . " AS C)
LEFT JOIN ".$cfg['tab']['tpl_conf']." as D ON A.idtplcfg = D.idtplcfg LEFT JOIN " . $cfg['tab']['tpl_conf'] . " as D ON A.idtplcfg = D.idtplcfg
LEFT JOIN ".$cfg['tab']['tpl']." as E ON D.idtpl = E.`idtpl` LEFT JOIN " . $cfg['tab']['tpl'] . " as E ON D.idtpl = E.`idtpl`
LEFT JOIN ".$cfg['tab']['cat_lang']." as F ON B.idcat = F.`idcat` LEFT JOIN " . $cfg['tab']['cat_lang'] . " as F ON B.idcat = F.`idcat`
WHERE A.idartlang = '$idartlang' AND WHERE A.idartlang = '$idartlang' AND
A.idart = B.idart AND A.idart = B.idart AND
A.idart = C.idart AND A.idart = C.idart AND
A.idlang = '$lang' AND A.idlang = '$lang' AND
C.idclient = '$client';"; C.idclient = '$client';";
$db->query($sql);
if ($db->next_record()) $db->query($sql);
{
global $area;
//$area = "con";
$idcat = $db->f("idcat");
$idart = $db->f("idart");
# create javascript multilink if ($db->next_record()) {
$tmp_mstr = '<a href="javascript://" onclick="javascript:conMultiLink(\'%s\', \'%s\', \'%s\', \'%s\')" title="idart: '.$db->f('idart').' idcatart: '.$db->f('idcatart').'" alt="idart: '.$db->f('idart').' idcatart: '.$db->f('idcatart').'">%s</a>'; global $area;
//$area = "con";
$idcat = $db->f("idcat");
$idart = $db->f("idart");
$mstr = sprintf($tmp_mstr, 'right_top', # create javascript multilink
$sess->url("main.php?area=con&frame=3&idcat=$idcat&idtpl=$idtpl"), $tmp_mstr = '<a href="javascript://" onclick="javascript:conMultiLink(\'%s\', \'%s\', \'%s\', \'%s\')" title="idart: ' . $db->f('idart') . ' idcatart: ' . $db->f('idcatart') . '" alt="idart: ' . $db->f('idart') . ' idcatart: ' . $db->f('idcatart') . '">%s</a>';
'right_bottom',
$sess->url("main.php?area=con_editart&action=con_edit&frame=4&idcat=$idcat&idtpl=$idtpl&idart=$idart"),
$db->f("title"));
$laststatus = getLastWorkflowStatus($idartlang); $mstr = sprintf($tmp_mstr, 'right_top',
$username = getGroupOrUserName($userids[$key]); $sess->url("main.php?area=con&frame=3&idcat=$idcat&idtpl=$idtpl"),
$actionSelect = piworkflowRenderColumn($idcat, $idart, $db->f('idartlang'), 'wfaction'); 'right_bottom',
$sess->url("main.php?area=con_editart&action=con_edit&frame=4&idcat=$idcat&idtpl=$idtpl&idart=$idart"),
$currentUserSequence->loadByPrimaryKey($usersequence[$key]); $db->f("title"));
$workflowItem = $currentUserSequence->getWorkflowItem();
$step = $workflowItem->get("name"); $laststatus = getLastWorkflowStatus($idartlang);
$description = $workflowItem->get("description"); $username = getGroupOrUserName($userids[$key]);
$actionSelect = piworkflowRenderColumn($idcat, $idart, $db->f('idartlang'), 'wfaction');
$sRowId = $db->f('idart').'-'.$db->f('idartlang').'-'.$db->f('idcat').'-'.$db->f('idcatlang').'-'.$db->f('idcatart').'-'.$db->f('art_lang');
$currentUserSequence->loadByPrimaryKey($usersequence[$key]);
if( $db->f('startidartlang') == $db->f('idartlang') ) { $workflowItem = $currentUserSequence->getWorkflowItem();
$makeStartarticle = "<img src=\"images/isstart1.gif\" border=\"0\" title=\"{$sFlagTitle}\" alt=\"{$sFlagTitle}\">"; $step = $workflowItem->get("name");
} else { $description = $workflowItem->get("description");
$makeStartarticle = "<img src=\"images/isstart0.gif\" border=\"0\" title=\"{$sFlagTitle}\" alt=\"{$sFlagTitle}\">";
$sRowId = $db->f('idart') . '-' . $db->f('idartlang') . '-' . $db->f('idcat') . '-' . $db->f('idcatlang') . '-' . $db->f('idcatart') . '-' . $db->f('art_lang');
if ($db->f('startidartlang') == $db->f('idartlang')) {
$makeStartarticle = "<img src=\"images/isstart1.gif\" border=\"0\" title=\"{$sFlagTitle}\" alt=\"{$sFlagTitle}\">";
} else {
$makeStartarticle = "<img src=\"images/isstart0.gif\" border=\"0\" title=\"{$sFlagTitle}\" alt=\"{$sFlagTitle}\">";
}
$todoListeSubject = i18n("Reminder", 'cl-workflow');
$sReminder = i18n("Set reminder / add to todo list", 'cl-workflow');
$sReminderHtml = "<a id=\"m1\" onclick=\"javascript:window.open('main.php?subject=$todoListeSubject&amp;area=todo&amp;frame=1&amp;itemtype=idart&amp;itemid=$idart&amp;contenido=$sSession', 'todo', 'scrollbars=yes, height=300, width=550');\" alt=\"$sReminder\" title=\"$sReminder\" href=\"#\"><img id=\"m2\" style=\"padding-left: 2px; padding-right: 2px;\" alt=\"$sReminder\" src=\"images/but_setreminder.gif\" border=\"0\"></a>";
$templatename = $db->f('tpl_name');
if (!empty($templatename)) {
$templatename = clHtmlEntities($templatename);
} else {
$templatename = '--- ' . i18n("None", 'cl-workflow') . ' ---';
}
if ($i == 0) {
$iIDCat = $db->f("idcat");
$iIDTpl = $idtpl;
$tpl->set('s', 'FIRST_ROWID', $sRowId);
}
$tpl->set('d', 'START', $makeStartarticle);
$tpl->set('d', 'TITLE', $mstr);
$tpl->set('d', 'LAST_STATUS', $laststatus);
$tpl->set('d', 'WORKFLOW_EDITOR', $username);
$tpl->set('d', 'WORKFLOW_STEP', $step);
$tpl->set('d', 'WORKFLOW_ACTION', $actionSelect);
$tpl->set('d', 'TEMPLATE', $templatename);
$tpl->set('d', 'BGCOLOR', $cfg['color']['table_dark_offline']);
$tpl->set('d', 'ROWID', $sRowId);
$tpl->set('d', 'ACTIONS', $sReminderHtml);
$tpl->next();
$i++;
} }
}
$todoListeSubject = i18n("Reminder"); }
$sReminder = i18n("Set reminder / add to todo list");
$sReminderHtml = "<a id=\"m1\" onclick=\"javascript:window.open('main.php?subject=$todoListeSubject&amp;area=todo&amp;frame=1&amp;itemtype=idart&amp;itemid=$idart&amp;contenido=$sSession', 'todo', 'scrollbars=yes, height=300, width=550');\" alt=\"$sReminder\" title=\"$sReminder\" href=\"#\"><img id=\"m2\" style=\"padding-left: 2px; padding-right: 2px;\" alt=\"$sReminder\" src=\"images/but_setreminder.gif\" border=\"0\"></a>";
$templatename = $db->f('tpl_name');
if (!empty($templatename)) {
$templatename = clHtmlEntities($templatename);
} else {
$templatename = '--- ' . i18n("None") . ' ---';
}
if ($i == 0) {
$iIDCat = $db->f("idcat");
$iIDTpl = $idtpl;
$tpl->set('s', 'FIRST_ROWID', $sRowId);
}
$tpl->set('d', 'START', $makeStartarticle);
$tpl->set('d', 'TITLE', $mstr);
$tpl->set('d', 'LAST_STATUS', $laststatus);
$tpl->set('d', 'WORKFLOW_EDITOR', $username);
$tpl->set('d', 'WORKFLOW_STEP', $step);
$tpl->set('d', 'WORKFLOW_ACTION', $actionSelect);
$tpl->set('d', 'TEMPLATE', $templatename);
$tpl->set('d', 'BGCOLOR', $cfg['color']['table_dark_offline']);
$tpl->set('d', 'ROWID', $sRowId);
$tpl->set('d', 'ACTIONS', $sReminderHtml);
$tpl->next();
$i++;
}
}
}
} }
if ($i > 0) { if ($i > 0) {
$tpl->set('s', 'NO_ARTICLES_ROW'); $tpl->set('s', 'NO_ARTICLES_ROW');
} else { } else {
$sRow = '<tr><td colspan="8" class="bordercell">' . i18n("No article found.") . '</td></tr>'; $sRow = '<tr><td colspan="8" class="bordercell">' . i18n("No article found.", 'cl-workflow') . '</td></tr>';
$tpl->set('s', 'NO_ARTICLES_ROW', $sRow); $tpl->set('s', 'NO_ARTICLES_ROW', $sRow);
} }
@ -270,5 +248,3 @@ $frame = ob_get_contents();
ob_end_clean(); ob_end_clean();
$tpl->generate($cfg["path"]['contenido'] . $cfg["path"]["plugins"] . "workflow/templates/template.workflow_tasks.html"); $tpl->generate($cfg["path"]['contenido'] . $cfg["path"]["plugins"] . "workflow/templates/template.workflow_tasks.html");
?>

11
plugin_install.sql Normale Datei
Datei anzeigen

@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS !PREFIX!wf_actions (
idworkflowaction int(10) NOT NULL auto_increment,
idworkflowitem int(10) NOT NULL default 0,
action varchar(255) NOT NULL,
PRIMARY KEY (idworkflowaction)
);
CREATE TABLE IF NOT EXISTS !PREFIX!wf_allocation (idallocation int(10) NOT NULL auto_increment, idworkflow int(10) NOT NULL default 0, idcatlang int(10) NOT NULL default 0, PRIMARY KEY (idallocation));
CREATE TABLE IF NOT EXISTS !PREFIX!wf_art_allocation (idartallocation int(10) NOT NULL auto_increment, idartlang int(10) NOT NULL default 0, idusersequence int(10) NOT NULL default 0, starttime datetime NOT NULL, laststatus varchar(32) default NULL, lastusersequence int(10) NOT NULL default 0, PRIMARY KEY (idartallocation));
CREATE TABLE IF NOT EXISTS !PREFIX!wf_items (idworkflowitem int(10) NOT NULL auto_increment, idworkflow int(10) NOT NULL default 0, position int(10) NOT NULL default 0, name varchar(255) NOT NULL default 0, description text NOT NULL, idtask int(10) NOT NULL default 0, PRIMARY KEY (idworkflowitem));
CREATE TABLE IF NOT EXISTS !PREFIX!wf_user_sequences (idusersequence int(10) NOT NULL auto_increment, idworkflowitem int(10) NOT NULL default 0, iduser varchar(32) NOT NULL, position int(10) NOT NULL default 0, timelimit int(10) NOT NULL default 0, timeunit varchar(32) NOT NULL, emailnoti int(10) NOT NULL default 0, escalationnoti int(10) NOT NULL default 0, PRIMARY KEY (idusersequence));
CREATE TABLE IF NOT EXISTS !PREFIX!wf_workflow (idworkflow int(10) NOT NULL auto_increment, idclient int(10) NOT NULL default 0, idlang int(10) NOT NULL default 0, idauthor varchar(32) NOT NULL, name varchar(255) NOT NULL, description text NOT NULL, created datetime NOT NULL, PRIMARY KEY (idworkflow));

6
plugin_uninstall.sql Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
DROP TABLE !PREFIX!wf_actions;
DROP TABLE !PREFIX!wf_allocation;
DROP TABLE !PREFIX!wf_art_allocation;
DROP TABLE !PREFIX!wf_items;
DROP TABLE !PREFIX!wf_user_sequences;
DROP TABLE !PREFIX!wf_workflow;

Datei anzeigen

@ -1,13 +1,13 @@
<div class="grey"> <div class="grey">
{NEW} {NEW}
</div> </div>
<div class="left_list"> <div class="left_list">
{STEPS} {STEPS}
</div> </div>
<div class="right_list"> <div class="right_list">
{EDITSTEP} {EDITSTEP}
</div> </div>
<div class="right_list"> <div class="right_list">
i18n('Warning: Changes will reset active Workflows') i18n('Warning: Changes will reset active Workflows', 'cl-workflow')
</div> </div>

Datei anzeigen

@ -1,34 +1,34 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML>
"http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title>{TITLE}</title> <meta charset="utf-8">
<meta http-equiv="expires" content="0"> <title>{TITLE}</title>
<meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache">
<link rel="stylesheet" type="text/css" href="styles/contenido.css" /> <meta http-equiv="pragma" content="no-cache">
<script type="text/javascript" src="scripts/rowMark.js"></script> <link rel="stylesheet" type="text/css" href="styles/contenido.css" />
<script type="text/javascript" src="scripts/general.js"></script> <script type="text/javascript" src="scripts/rowMark.js"></script>
<script type="text/javascript" src="scripts/messageBox.js.php?{SESSNAME}={SESSID}"></script> <script type="text/javascript" src="scripts/general.js"></script>
<script type="text/javascript" src="scripts/articleObject.js.php?{SESSNAME}={SESSID}"></script> <script type="text/javascript" src="scripts/messageBox.js.php?{SESSNAME}={SESSID}"></script>
<script type="text/javascript"> <script type="text/javascript" src="scripts/articleObject.js.php?{SESSNAME}={SESSID}"></script>
<!-- <script type="text/javascript">
<!--
/* Contenido Session-ID */ /* Contenido Session-ID */
var sid = "{SESSID}"; var sid = "{SESSID}";
/* New messageBox instance */ /* New messageBox instance */
box = new messageBox("", "", "", 0, 0); box = new messageBox("", "", "", 0, 0);
/* Function for deleting articles */ /* Function for deleting articles */
function deleteArticle(idart, idcat) { function deleteArticle(idart, idcat) {
var url = "main.php?area=con&action=con_deleteart&frame=4&idcat="+idcat+"&idart="+idart+"&{SESSNAME}="+sid; var url = "main.php?area=con&action=con_deleteart&frame=4&idcat=" + idcat + "&idart=" + idart + "&{SESSNAME}=" + sid;
window.location.href = url; window.location.href = url;
}
function setUsershow() {
document.forms['showusers'].setAttribute('action', document.forms['showusers'].getAttribute('action')+'&usershow='+document.showusers.usershow.value);
} }
//-->
function setUsershow() {
document.forms['showusers'].setAttribute('action', document.forms['showusers'].getAttribute('action') + '&usershow=' + document.showusers.usershow.value);
}
//-->
</script> </script>
</head> </head>
@ -39,7 +39,7 @@
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
<table width="100%" border="0" cellspacing="0" cellpadding="2" class="bordered" style="display:{DISPLAY}"> <table width="100%" border="0" cellspacing="0" cellpadding="2" class="bordered" style="display:{DISPLAY}">
<tr> <tr>
@ -52,7 +52,7 @@
<td width="1%" class="headerbordercell" nowrap="nowrap">{TH_TEMPLATE}</td> <td width="1%" class="headerbordercell" nowrap="nowrap">{TH_TEMPLATE}</td>
<td width="1%" class="headerbordercell" nowrap="nowrap">{TH_ACTIONS}</td> <td width="1%" class="headerbordercell" nowrap="nowrap">{TH_ACTIONS}</td>
</tr> </tr>
<!-- BEGIN:BLOCK --> <!-- BEGIN:BLOCK -->
<tr id="{ROWID}" class="text_medium" style="{BGCOLOR}" onmouseover="artRow.over(this)" onmouseout="artRow.out(this)" onclick="artRow.click(this)"> <tr id="{ROWID}" class="text_medium" style="{BGCOLOR}" onmouseover="artRow.over(this)" onmouseout="artRow.out(this)" onclick="artRow.click(this)">
<td nowrap="nowrap" class="bordercell">{START}</td> <td nowrap="nowrap" class="bordercell">{START}</td>
@ -65,91 +65,93 @@
<td nowrap="nowrap" class="bordercell">{ACTIONS}</td> <td nowrap="nowrap" class="bordercell">{ACTIONS}</td>
</tr> </tr>
<!-- END:BLOCK --> <!-- END:BLOCK -->
{NO_ARTICLES_ROW} {NO_ARTICLES_ROW}
</table> </table>
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
rcount = 0; rcount = 0;
/* Update frame right top for sub navigation */
{SUBNAVI}
/* Create a reference to the Article Object in frame 'right_top' */ /* Update frame right top for sub navigation */
artObj = parent.parent.frames["left"].frames["left_top"].artObj; {
SUBNAVI
/* Reset article object
properties. e.g. Some article was edited and we are now back in the
overview mask. There is now no marked article, the articleObject data
should be reset. */
if ( artObj ) {
artObj.reset();
artObj.enable();
artObj.setHrefOverview(document.location.href);
}
/* Timeout to call the function afer 250ms */
window.setTimeout("createReference()", 250);
/* Javascript-Error work-around... try to create the reference after
250ms again... and hope it works.. */
function createReference() {
if( !artObj ) {
artObj=parent.parent.frames["left"].frames["left_top"].artObj;
if( artObj ) {
artObj.reset();
artObj.enable();
artObj.setHrefOverview(document.location.href);
}
}
if( !artObj ) {
return false;
}
}
/* Extract data from the article grid and send
them to the articleObject Instance. The data is stored in the
attribute 'id' of the row object. */
function conArtOverviewExtractData( obj ) {
if( !artObj ) {
var rval=createReference();
if (rval== false) {
return false;
}
}
var datastring=obj.id;
var data=datastring.split( "-" );
if ( data.length== 6 ) {
/* Send data to articleObject instance:
0: idart
1: idartlang
2: idcat
3: idcatlang
5: idcatart */
artObj.setProperties(data[0], data[1], data[2], data[3], data[4], data[5]);
}
return true;
}
/* Mark the first submenu item i.e. 'Overview' */
if( parent.parent.frames['right'].frames['right_top'].document.getElementById('c_0') ) {
menuItem=parent.parent.frames['right'].frames['right_top'].document.getElementById('c_0');
parent.parent.frames['right'].frames['right_top'].sub.click(menuItem);
}
function initTheOne() {
var theOne = document.getElementById("{FIRST_ROWID}");
artRow.reset();
artRow.over( theOne );
artRow.click( theOne )
} }
/* Create a reference to the Article Object in frame 'right_top' */
artObj = parent.parent.frames["left"].frames["left_top"].artObj;
/* Reset article object
properties. e.g. Some article was edited and we are now back in the
overview mask. There is now no marked article, the articleObject data
should be reset. */
if (artObj) {
artObj.reset();
artObj.enable();
artObj.setHrefOverview(document.location.href);
}
/* Timeout to call the function afer 250ms */
window.setTimeout("createReference()", 250);
/* Javascript-Error work-around... try to create the reference after
250ms again... and hope it works.. */
function createReference() {
if (!artObj) {
artObj = parent.parent.frames["left"].frames["left_top"].artObj;
if (artObj) {
artObj.reset();
artObj.enable();
artObj.setHrefOverview(document.location.href);
}
}
if (!artObj) {
return false;
}
}
/* Extract data from the article grid and send
them to the articleObject Instance. The data is stored in the
attribute 'id' of the row object. */
function conArtOverviewExtractData(obj) {
if (!artObj) {
var rval = createReference();
if (rval == false) {
return false;
}
}
var datastring = obj.id;
var data = datastring.split("-");
if (data.length == 6) {
/* Send data to articleObject instance:
0: idart
1: idartlang
2: idcat
3: idcatlang
5: idcatart */
artObj.setProperties(data[0], data[1], data[2], data[3], data[4], data[5]);
}
return true;
}
/* Mark the first submenu item i.e. 'Overview' */
if (parent.parent.frames['right'].frames['right_top'].document.getElementById('c_0')) {
menuItem = parent.parent.frames['right'].frames['right_top'].document.getElementById('c_0');
parent.parent.frames['right'].frames['right_top'].sub.click(menuItem);
}
function initTheOne() {
var theOne = document.getElementById("{FIRST_ROWID}");
artRow.reset();
artRow.over(theOne);
artRow.click(theOne)
}
initTheOne(); initTheOne();
//--> //-->
</script> </script>