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

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -26,7 +27,6 @@
* }}
*
*/
define('CON_FRAMEWORK', true);
@ -35,8 +35,6 @@ include_once ('../../../includes/startup.php');
cInclude("includes", "cfg_language_de.inc.php");
cInclude("includes", "functions.con.php");
plugin_include('workflow', 'classes/class.workflow.php');
plugin_include('workflow', 'includes/functions.workflow.php');
$workflowartallocations = new WorkflowArtAllocations;
@ -44,71 +42,62 @@ $workflowusersequences = new WorkflowUserSequences;
$workflowartallocations->select();
while ($obj = $workflowartallocations->next())
{
$starttime = $obj->get("starttime");
$idartlang = $obj->get("idartlang");
$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();
}
}
}
}
while ($obj = $workflowartallocations->next()) {
$starttime = $obj->get("starttime");
$idartlang = $obj->get("idartlang");
$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();
}
}
}
}
?>