Merge branch 'master' of bitbucket.org:colosa/processmaker

Conflicts:
	features/backend/activity/negative_tests_activity.feature
This commit is contained in:
Wendy Nestor
2014-03-05 09:52:59 -04:00
16 changed files with 499 additions and 79 deletions

View File

@@ -44,6 +44,7 @@ $projects = array(
'colosa/pmUI' 'colosa/pmUI'
); );
out("build-vendor.php", 'purple'); out("build-vendor.php", 'purple');
@@ -54,6 +55,7 @@ out(" mode", 'purple');
foreach ($projects as $project) { foreach ($projects as $project) {
echo PHP_EOL; echo PHP_EOL;
out("=> Building project: ", 'info', false); out("=> Building project: ", 'info', false);
$output = array();
echo $project.' '.PHP_EOL; echo $project.' '.PHP_EOL;
chdir($vendorDir.DS.$project); chdir($vendorDir.DS.$project);
if ($debug) { if ($debug) {

View File

@@ -3,7 +3,7 @@ Feature: Reorder Steps
Scenario: List all the Sub Processs (result 0 Sub Processs) Scenario: List all the Sub Processs (result 0 Sub Processs)
Given that I have a valid access_token Given that I have a valid access_token
And I request "project/9821342145305125d48cb88069229840/activity/8251872975307632a765f34007266075/step/285219904530763bb5c4367074373078" And I request "project/940481651530fa1f3803525098230380/activity/677485918530fa1f80ad463004640434/step/289467030530fa28077e6a2088432104"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
@@ -17,12 +17,12 @@ Feature: Reorder Steps
"step_position": "3" "step_position": "3"
} }
""" """
And I request "project/98002714453076320a06cb4009450121/activity/8251872975307632a765f34007266075/step/285219904530763bb5c4367074373078" And I request "project/98002714453076320a06cb4009450121/activity/677485918530fa1f80ad463004640434/step/289467030530fa28077e6a2088432104"
Then the response status code should be 200 Then the response status code should be 200
Scenario: List all the Sub Processs (result 0 Sub Processs) Scenario: List all the Sub Processs (result 0 Sub Processs)
Given that I have a valid access_token Given that I have a valid access_token
And I request "project/9821342145305125d48cb88069229840/activity/8251872975307632a765f34007266075/step/285219904530763bb5c4367074373078" And I request "project/940481651530fa1f3803525098230380/activity/677485918530fa1f80ad463004640434/step/289467030530fa28077e6a2088432104"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"
@@ -36,12 +36,12 @@ Feature: Reorder Steps
"step_position": "1" "step_position": "1"
} }
""" """
And I request "project/98002714453076320a06cb4009450121/activity/8251872975307632a765f34007266075/step/285219904530763bb5c4367074373078" And I request "project/98002714453076320a06cb4009450121/activity/677485918530fa1f80ad463004640434/step/289467030530fa28077e6a2088432104"
Then the response status code should be 200 Then the response status code should be 200
Scenario: List all the Sub Processs (result 0 Sub Processs) Scenario: List all the Sub Processs (result 0 Sub Processs)
Given that I have a valid access_token Given that I have a valid access_token
And I request "project/9821342145305125d48cb88069229840/activity/8251872975307632a765f34007266075/step/285219904530763bb5c4367074373078" And I request "project/940481651530fa1f3803525098230380/activity/677485918530fa1f80ad463004640434/step/289467030530fa28077e6a2088432104"
Then the response status code should be 200 Then the response status code should be 200
And the response charset is "UTF-8" And the response charset is "UTF-8"
And the type is "object" And the type is "object"

View File

@@ -165,6 +165,10 @@ class PmSessionHandler //implements SessionHandlerInterface
*/ */
public function write($id, $data) public function write($id, $data)
{ {
if (empty($this->db)) {
return null;
}
$time = time(); $time = time();
if(! isset($this->wstmt)) { if(! isset($this->wstmt)) {

View File

@@ -129,20 +129,17 @@ class Controller
print G::json_encode( $result ); print G::json_encode( $result );
} }
} catch (Exception $e) { } catch (Exception $e) {
$result = new StdClass();
if ($this->responseType != 'json') { if ($this->responseType != 'json') {
$result->exception->class = get_class( $e ); Bootstrap::renderTemplate('controller.exception.tpl', array(
$result->exception->code = $e->getCode(); 'title' => 'Controller Exception',
'message' => nl2br($e->getMessage()),
$template = new TemplatePower( PATH_TEMPLATE . 'controller.exception.tpl' ); 'controller' => (function_exists( 'get_called_class' ) ? get_called_class() : 'Controller'),
$template->prepare(); 'exceptionClass' => get_class($e),
$template->assign( 'controller', (function_exists( 'get_called_class' ) ? get_called_class() : 'Controller') ); 'file' => $e->getFile(),
$template->assign( 'message', $e->getMessage() ); 'line' => $e->getLine(),
$template->assign( 'file', $e->getFile() ); 'trace' => $e->getTrace()
$template->assign( 'line', $e->getLine() ); ));
$template->assign( 'trace', $e->getTraceAsString() );
echo $template->getOutputContent();
} else { } else {
$result->success = false; $result->success = false;
$result->msg = $e->getMessage(); $result->msg = $e->getMessage();

View File

@@ -1,55 +1,100 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Server Error :: </title> <meta name="robots" content="noindex,nofollow" />
<title>Whoops, looks like something went wrong.</title>
<style>
{literal}
/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
html { background: #eee; padding: 10px }
body { font: 11px Verdana, Arial, sans-serif; color: #333 }
img { border: 0; }
.clear { clear:both; height:0; font-size:0; line-height:0; }
.clear_fix:after { display:block; height:0; clear:both; visibility:hidden; }
.clear_fix { display:inline-block; }
* html .clear_fix { height:1%; }
.clear_fix { display:block; }
#content { width:970px; margin:0 auto; }
.exceptionreset, .exceptionreset .block { margin: auto }
.exceptionreset abbr { border-bottom: 1px dotted #000; cursor: help; }
.exceptionreset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px }
.exceptionreset strong { font-weight:bold; }
.exceptionreset a { color:#6c6159; }
.exceptionreset a img { border:none; }
.exceptionreset a:hover { text-decoration:underline; }
.exceptionreset em { font-style:italic; }
.exceptionreset h1, .exceptionreset h2 { font: 20px Georgia, "Times New Roman", Times, serif }
.exceptionreset h2 span { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; }
.exceptionreset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; }
.exceptionreset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px;
-webkit-border-bottom-right-radius: 16px;
-webkit-border-bottom-left-radius: 16px;
-moz-border-radius-bottomright: 16px;
-moz-border-radius-bottomleft: 16px;
border-bottom-right-radius: 16px;
border-bottom-left-radius: 16px;
border-bottom:1px solid #ccc;
border-right:1px solid #ccc;
border-left:1px solid #ccc;
}
.exceptionreset .block_exception { background-color:#ddd; color: #333; padding:20px;
-webkit-border-top-left-radius: 16px;
-webkit-border-top-right-radius: 16px;
-moz-border-radius-topleft: 16px;
-moz-border-radius-topright: 16px;
border-top-left-radius: 16px;
border-top-right-radius: 16px;
border-top:1px solid #ccc;
border-right:1px solid #ccc;
border-left:1px solid #ccc;
}
.exceptionreset li a { background:none; color:#868686; text-decoration:none; }
.exceptionreset li a:hover { background:none; color:#313131; text-decoration:underline; }
.exceptionreset ol { padding: 10px 0; }
.exceptionreset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: 1px solid #ccc;
}
{/literal}
</style>
</head> </head>
<style>
.box {
-moz-border-radius:6px; /* Rounded edges in Firefox */
color :#000;
border-style:solid;
border-width:1px;
border-color:#000;
font :normal 8pt Tahoma,sans-serif,MiscFixed;
text-decoration:none;
padding:0 20px;
vertical-align:middle;
font-weight: bold;
background-color:#DBDBDB;
}
</style>
<body> <body>
<div class='box'> <div id="content" class="exceptionreset">
<h1>{$controller} {$title}</h1>
<br /> <div class="block_exception clear_fix">
<br /> <h2>
<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0" class="mainCopy"> <abbr title="RuntimeException">{$exceptionClass}</abbr>: {$message}
<tr> </h2>
<td width="15%" align="left" scope="col"> </div>
<span class="mxbOnlineTextBlue">CONTROLLER EXCEPTION</span><br /> <div class="block">
<hr/> Controller: {$controller}<br />
{message}<br /><br /> File: {$file}<br />
Controller: {controller}<br /> Line: {$line}
File: {file}<br />
Line: {line}
<br />
<br />
<table>
<tr><td><small><pre>{trace}</pre></small></td></tr>
</table>
</td>
</tr>
</table>
<ol class="traces list_exception">
{foreach from=$trace item=line}
{if $line.class}
<li>At <b>{$line.class}{$line.type}</b><i>{$line.function}()</i><br/>in {$line.file} line {$line.line}</li>
{else}
<li>At {$line.function}() in {$line.file} line {$line.line}</li>
{/if}
{/foreach}
</ol>
</div>
</div> </div>
</body> </body>
</html> </html>

25
update
View File

@@ -2,19 +2,19 @@
echo "<h1>Michelangelo Update</h1><h2>Changelog Processmaker</h2><code>" > temp.txt echo "<h1>Michelangelo Update</h1><h2>Changelog Processmaker</h2><code>" > temp.txt
git pull git pull
git log -n 20 --relative-date --graph --format=short >> temp.txt git log -n 30 --relative-date --graph --format=medium --no-merges >> temp.txt
cd vendor/colosa/pmUI cd vendor/colosa/pmUI
echo "</code><br><h2>Changelog pmUI</h2><br><code>" >> ../../../temp.txt echo "</code><br><h2>Changelog pmUI</h2><br><code>" >> ../../../temp.txt
git pull git pull
git log -n 20 --relative-date --graph --format=short >> ../../../temp.txt git log -n 30 --relative-date --graph --format=medium --no-merges >> ../../../temp.txt
cd ../MichelangeloFE cd ../MichelangeloFE
echo "</code><br><h2>Changelog MichelangeloFE</h2><br><code>" >> ../../../temp.txt echo "</code><br><h2>Changelog MichelangeloFE</h2><br><code>" >> ../../../temp.txt
git pull git pull
git log -n 20 --relative-date --graph --format=short >> ../../../temp.txt git log -n 30 --relative-date --graph --format=medium --no-merges >> ../../../temp.txt
cd ../../../ cd ../../../
@@ -23,4 +23,23 @@ php build-vendor.php >> temp.txt
sed ':a;N;$!ba;s/\n/<br>/g' temp.txt > workflow/public_html/build-log.html sed ':a;N;$!ba;s/\n/<br>/g' temp.txt > workflow/public_html/build-log.html
cp workflow/public_html/build-log.html temp.txt
sed -re 's#\[0;35;35m#<span style="color:saddlebrown;">#g' temp.txt > workflow/public_html/build-log.html
cp workflow/public_html/build-log.html temp.txt
sed -re 's#\[1;33;34m#<span style="color:darkblue;">#g' temp.txt > workflow/public_html/build-log.html
cp workflow/public_html/build-log.html temp.txt
sed -re 's#\[0;35;32m#<span style="color:green;">#g' temp.txt > workflow/public_html/build-log.html
cp workflow/public_html/build-log.html temp.txt
sed -re 's#\[31m\[32m#</span style="color:brown;">#g' temp.txt > workflow/public_html/build-log.html
cp workflow/public_html/build-log.html temp.txt
sed -re 's#\[0m#</span>#g' temp.txt > workflow/public_html/build-log.html
cp workflow/public_html/build-log.html temp.txt
sed -re 's#Author:(.*)\n#<span>xxxx(1)</span>#g' temp.txt > workflow/public_html/build-log.html
echo "update executed succesfully, check the log in http://<server>/build-log.html " echo "update executed succesfully, check the log in http://<server>/build-log.html "

View File

@@ -39,10 +39,10 @@ class Designer extends Controller
if (System::isDebugMode()) { if (System::isDebugMode()) {
if (! file_exists(PATH_HTML . "lib-dev/pmUI/build.cache")) { if (! file_exists(PATH_HTML . "lib-dev/pmUI/build.cache")) {
throw new Exception("Error: Development JS Files were are not generated!, please execute: \$rake pmBuildDebug in pmUI project"); throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in pmUI project");
} }
if (! file_exists(PATH_HTML . "lib-dev/mafe/build.cache")) { if (! file_exists(PATH_HTML . "lib-dev/mafe/build.cache")) {
throw new Exception("Error: Development JS Files were are not generated!, please execute: \$rake pmBuildDebug in MichelangeloFE project"); throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in MichelangeloFE project");
} }
$mafeFiles = file(PATH_HTML . "lib-dev/mafe/build.cache", FILE_IGNORE_NEW_LINES); $mafeFiles = file(PATH_HTML . "lib-dev/mafe/build.cache", FILE_IGNORE_NEW_LINES);

View File

@@ -1,3 +1,4 @@
<?php http_response_code(404); die; ?>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8" /> <META http-equiv="Content-Type" content="text/html; charset=utf-8" />

View File

@@ -0,0 +1,256 @@
<?php
namespace BusinessModel;
class Calendar
{
private $arrayFieldDefinition = array(
"CAL_UID" => array("fieldName" => "CALENDAR_UID", "type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "calendarUid"),
"CAL_NAME" => array("fieldName" => "CALENDAR_NAME", "type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "calendarName"),
"CAL_DESCRIPTION" => array("fieldName" => "CALENDAR_DESCRIPTION", "type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "calendarDescription"),
"CAL_CREATE_DATE" => array("fieldName" => "CALENDAR_CREATE_DATE", "type" => "datetime", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "calendarCreateDate"),
"CAL_UPDATE_DATE" => array("fieldName" => "CALENDAR_UPDATE_DATE", "type" => "datetime", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "calendarUpdateDate"),
"CAL_WORK_DAYS" => array("fieldName" => "CALENDAR_WORK_DAYS", "type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "calendarWorkDays"),
"CAL_STATUS" => array("fieldName" => "CALENDAR_STATUS", "type" => "string", "required" => true, "empty" => false, "defaultValues" => array("ACTIVE", "INACTIVE"), "fieldNameAux" => "calendarStatus")
);
private $formatFieldNameInUppercase = true;
private $arrayFieldNameForException = array(
"filter" => "FILTER",
"start" => "START",
"limit" => "LIMIT"
);
/**
* Constructor of the class
*
* return void
*/
public function __construct()
{
try {
foreach ($this->arrayFieldDefinition as $key => $value) {
$this->arrayFieldNameForException[$value["fieldNameAux"]] = $key;
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Set the format of the fields name (uppercase, lowercase)
*
* @param bool $flag Value that set the format
*
* return void
*/
public function setFormatFieldNameInUppercase($flag)
{
try {
$this->formatFieldNameInUppercase = $flag;
$this->setArrayFieldNameForException($this->arrayFieldNameForException);
} catch (\Exception $e) {
throw $e;
}
}
/**
* Set exception messages for fields
*
* @param array $arrayData Data with the fields
*
* return void
*/
public function setArrayFieldNameForException($arrayData)
{
try {
foreach ($arrayData as $key => $value) {
$this->arrayFieldNameForException[$key] = $this->getFieldNameByFormatFieldName($value);
}
} catch (\Exception $e) {
throw $e;
}
}
/**
* Get the name of the field according to the format
*
* @param string $fieldName Field name
*
* return string Return the field name according the format
*/
public function getFieldNameByFormatFieldName($fieldName)
{
try {
return ($this->formatFieldNameInUppercase)? strtoupper($fieldName) : strtolower($fieldName);
} catch (\Exception $e) {
throw $e;
}
}
/**
* Get criteria for Calendar
*
* return object
*/
public function getCalendarCriteria()
{
try {
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\CalendarDefinitionPeer::CALENDAR_UID);
$criteria->addSelectColumn(\CalendarDefinitionPeer::CALENDAR_NAME);
$criteria->addSelectColumn(\CalendarDefinitionPeer::CALENDAR_DESCRIPTION);
$criteria->addSelectColumn(\CalendarDefinitionPeer::CALENDAR_CREATE_DATE);
$criteria->addSelectColumn(\CalendarDefinitionPeer::CALENDAR_UPDATE_DATE);
$criteria->addSelectColumn(\CalendarDefinitionPeer::CALENDAR_WORK_DAYS);
$criteria->addSelectColumn(\CalendarDefinitionPeer::CALENDAR_STATUS);
$criteria->add(\CalendarDefinitionPeer::CALENDAR_STATUS, "DELETED", \Criteria::NOT_EQUAL);
return $criteria;
} catch (\Exception $e) {
throw $e;
}
}
/**
* Get data of a Calendar from a record
*
* @param array $record Record
*
* return array Return an array with data Calendar
*/
public function getCalendarDataFromRecord($record)
{
try {
return array(
$this->getFieldNameByFormatFieldName("CAL_UID") => $record["CALENDAR_UID"],
$this->getFieldNameByFormatFieldName("CAL_NAME") => $record["CALENDAR_NAME"],
$this->getFieldNameByFormatFieldName("CAL_DESCRIPTION") => $record["CALENDAR_DESCRIPTION"] . "",
$this->getFieldNameByFormatFieldName("CAL_CREATE_DATE") => $record["CALENDAR_CREATE_DATE"] . "",
$this->getFieldNameByFormatFieldName("CAL_UPDATE_DATE") => $record["CALENDAR_UPDATE_DATE"] . "",
$this->getFieldNameByFormatFieldName("CAL_WORK_DAYS") => $record["CALENDAR_WORK_DAYS"] . "",
$this->getFieldNameByFormatFieldName("CAL_STATUS") => $record["CALENDAR_STATUS"],
$this->getFieldNameByFormatFieldName("CAL_TOTAL_USERS") => (int)($record["CALENDAR_TOTAL_USERS"]),
$this->getFieldNameByFormatFieldName("CAL_TOTAL_PROCESSES") => (int)($record["CALENDAR_TOTAL_PROCESSES"]),
$this->getFieldNameByFormatFieldName("CAL_TOTAL_TASKS") => (int)($record["CALENDAR_TOTAL_TASKS"])
);
} catch (\Exception $e) {
throw $e;
}
}
/**
* Get all Calendars
*
* @param array $arrayFilterData Data of the filters
* @param string $sortField Field name to sort
* @param string $sortDir Direction of sorting (ASC, DESC)
* @param int $start Start
* @param int $limit Limit
*
* return array Return an array with all Calendars
*/
public function getCalendars($arrayFilterData = null, $sortField = null, $sortDir = null, $start = null, $limit = null)
{
try {
$arrayCalendar = array();
//Verify data
$process = new \BusinessModel\Process();
$process->throwExceptionIfDataNotMetPagerVarDefinition(array("start" => $start, "limit" => $limit), $this->arrayFieldNameForException);
//Get data
if (!is_null($limit) && $limit . "" == "0") {
return $arrayCalendar;
}
//Set variables
$calendar = new \calendar();
$arrayTotalUsersByCalendar = $calendar->getAllCounterByCalendar("USER");
$arrayTotalProcessesByCalendar = $calendar->getAllCounterByCalendar("PROCESS");
$arrayTotalTasksByCalendar = $calendar->getAllCounterByCalendar("TASK");
//SQL
$criteria = $this->getCalendarCriteria();
if (!is_null($arrayFilterData) && is_array($arrayFilterData) && isset($arrayFilterData["filter"]) && trim($arrayFilterData["filter"]) != "") {
$criteria->add(\CalendarDefinitionPeer::CALENDAR_NAME, "%" . $arrayFilterData["filter"] . "%", \Criteria::LIKE);
}
//Number records total
$criteriaCount = clone $criteria;
$criteriaCount->clearSelectColumns();
$criteriaCount->addSelectColumn("COUNT(" . \CalendarDefinitionPeer::CALENDAR_UID . ") AS NUM_REC");
$rsCriteriaCount = \CalendarDefinitionPeer::doSelectRS($criteriaCount);
$rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteriaCount->next();
$row = $rsCriteriaCount->getRow();
$numRecTotal = $row["NUM_REC"];
//SQL
if (!is_null($sortField) && trim($sortField) != "") {
$sortField = strtoupper($sortField);
$sortField = (isset($this->arrayFieldDefinition[$sortField]["fieldName"]))? $this->arrayFieldDefinition[$sortField]["fieldName"] : $sortField;
switch ($sortField) {
case "CALENDAR_UID":
case "CALENDAR_NAME":
case "CALENDAR_DESCRIPTION":
case "CALENDAR_CREATE_DATE":
case "CALENDAR_UPDATE_DATE":
case "CALENDAR_WORK_DAYS":
case "CALENDAR_STATUS":
$sortField = \CalendarDefinitionPeer::TABLE_NAME . "." . $sortField;
break;
default:
$sortField = \CalendarDefinitionPeer::CALENDAR_NAME;
break;
}
} else {
$sortField = \CalendarDefinitionPeer::CALENDAR_NAME;
}
if (!is_null($sortDir) && trim($sortDir) != "" && strtoupper($sortDir) == "DESC") {
$criteria->addDescendingOrderByColumn($sortField);
} else {
$criteria->addAscendingOrderByColumn($sortField);
}
if (!is_null($start)) {
$criteria->setOffset((int)($start));
}
if (!is_null($limit)) {
$criteria->setLimit((int)($limit));
}
$rsCriteria = \CalendarDefinitionPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$row["CALENDAR_TOTAL_USERS"] = (isset($arrayTotalUsersByCalendar[$row["CALENDAR_UID"]]))? $arrayTotalUsersByCalendar[$row["CALENDAR_UID"]] : 0;
$row["CALENDAR_TOTAL_PROCESSES"] = (isset($arrayTotalProcessesByCalendar[$row["CALENDAR_UID"]]))? $arrayTotalProcessesByCalendar[$row["CALENDAR_UID"]] : 0;
$row["CALENDAR_TOTAL_TASKS"] = (isset($arrayTotalTasksByCalendar[$row["CALENDAR_UID"]]))? $arrayTotalTasksByCalendar[$row["CALENDAR_UID"]] : 0;
$arrayCalendar[] = $this->getCalendarDataFromRecord($row);
}
//Return
return $arrayCalendar;
} catch (\Exception $e) {
throw $e;
}
}
}

View File

@@ -170,9 +170,8 @@ class Step
*/ */
public function throwExceptionIfHaveInvalidValueInTypeObj($stepTypeObj) public function throwExceptionIfHaveInvalidValueInTypeObj($stepTypeObj)
{ {
if (!in_array($stepTypeObj, array("DYNAFORM", "INPUT_DOCUMENT", "OUTPUT_DOCUMENT"))) { if (!in_array($stepTypeObj, array("DYNAFORM", "INPUT_DOCUMENT", "OUTPUT_DOCUMENT", "EXTERNAL"))) {
$field = $this->arrayParamException["stepTypeObj"]; $field = $this->arrayParamException["stepTypeObj"];
throw (new \Exception(str_replace(array("{0}"), array($field), "Invalid value specified for \"{0}\""))); throw (new \Exception(str_replace(array("{0}"), array($field), "Invalid value specified for \"{0}\"")));
} }
} }

View File

@@ -0,0 +1,33 @@
<?php
namespace Services\Api\ProcessMaker;
use \ProcessMaker\Services\Api;
use \Luracast\Restler\RestException;
/**
* Group Api Controller
*
* @protected
*/
class Calendar extends Api
{
private $formatFieldNameInUppercase = false;
/**
* @url GET
*/
public function index($filter = null, $start = null, $limit = null)
{
try {
$calendar = new \BusinessModel\Calendar();
$calendar->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase);
$response = $calendar->getCalendars(array("filter" => $filter), null, null, $start, $limit);
return $response;
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}

View File

@@ -39,7 +39,7 @@ class Step extends Api
* @param string $act_uid {@min 32}{@max 32} * @param string $act_uid {@min 32}{@max 32}
* @param string $prj_uid {@min 32}{@max 32} * @param string $prj_uid {@min 32}{@max 32}
* @param array $request_data * @param array $request_data
* @param string $step_type_obj {@from body}{@choice DYNAFORM,INPUT_DOCUMENT,OUTPUT_DOCUMENT}{@required true} * @param string $step_type_obj {@from body}{@choice DYNAFORM,INPUT_DOCUMENT,OUTPUT_DOCUMENT,EXTERNAL}{@required true}
* @param string $step_uid_obj {@from body}{@min 32}{@max 32}{@required true} * @param string $step_uid_obj {@from body}{@min 32}{@max 32}{@required true}
* @param string $step_condition {@from body} * @param string $step_condition {@from body}
* @param int $step_position {@from body}{@min 1} * @param int $step_position {@from body}{@min 1}
@@ -79,7 +79,7 @@ class Step extends Api
* @param string $act_uid {@min 32}{@max 32} * @param string $act_uid {@min 32}{@max 32}
* @param string $prj_uid {@min 32}{@max 32} * @param string $prj_uid {@min 32}{@max 32}
* @param array $request_data * @param array $request_data
* @param string $step_type_obj {@from body}{@choice DYNAFORM,INPUT_DOCUMENT,OUTPUT_DOCUMENT} * @param string $step_type_obj {@from body}{@choice DYNAFORM,INPUT_DOCUMENT,OUTPUT_DOCUMENT,EXTERNAL}
* @param string $step_uid_obj {@from body}{@min 32}{@max 32} * @param string $step_uid_obj {@from body}{@min 32}{@max 32}
* @param string $step_condition {@from body} * @param string $step_condition {@from body}
* @param int $step_position {@from body}{@min 1} * @param int $step_position {@from body}{@min 1}

View File

@@ -53,3 +53,9 @@ debug = 1
[alias: users] [alias: users]
user = "Services\Api\ProcessMaker\User" user = "Services\Api\ProcessMaker\User"
[alias: calendar]
calendar = "Services\Api\ProcessMaker\Calendar"
[alias: calendars]
calendar = "Services\Api\ProcessMaker\Calendar"

View File

@@ -21,7 +21,7 @@ class BpmnWorkflowTest extends \PHPUnit_Framework_TestCase
public static function tearDownAfterClass() public static function tearDownAfterClass()
{ {
return false; //return false;
//cleaning DB //cleaning DB
foreach (self::$uids as $prjUid) { foreach (self::$uids as $prjUid) {
$bwap = Project\Adapter\BpmnWorkflow::load($prjUid); $bwap = Project\Adapter\BpmnWorkflow::load($prjUid);

View File

@@ -1,4 +1,4 @@
<head>
{if $isDebugMode} {if $isDebugMode}
<!-- files that are built into pmui.css--> <!-- files that are built into pmui.css-->
{foreach from=$pmuiCssCacheFile item=file} {foreach from=$pmuiCssCacheFile item=file}
@@ -98,5 +98,63 @@
{/if} {/if}
</head>
<body>
<section class="navBar">
<h2>Michelangelo</h2>
<nav>
<ul>
<li><a href="#" class="mafe-button-save">Save</a></li>
<li><a href="#" class="mafe-button-export-process">Export process</a></li>
<li><a href="#" class="mafe-button-undo">Undo</a>
<a href="#" class="mafe-button-redo">Redo</a></li>
<li><input type="button" value="Zoom" class="mafe-button-zoom"> </li>
<li><a href="#" title="Full screen"class="mafe-button-fullscreen"></a></li>
</ul>
</nav>
</section>
<section class="content">
<div class="bpmn_shapes">
<div class="head"><a href="#" class="bpmn_shapes-collapse"><img src="img/ico_hiden2.png"></a></div>
</div>
<div class="content_controls">
<div class="head"><a href="#" class="content_controls-collapse"><img src="img/ico_hiden3.png"></a></div>
<ul>
<li>
<a href="" class="mafe-menu-dynaform">Dynaforms</a>
<a href="#" class="btn_create"><span>Create</span></a>
</li>
<li>
<a href="#" class="mafe-menu-inputdocuments">Input documents</a>
<a href="#" class="btn_create"><span>Create</span></a>
</li>
<li>
<a href="#" class="mafe-menu-outputdocuments">Output documents</a>
<a href="#" class="btn_create"><span>Create</span></a>
</li>
<li>
<a href="#" class="mafe-menu-triggers">Triggers</a>
<a href="#" class="btn_create"><span>Create</span></a>
</li>
<li>
<a href="#" class="mafe-menu-reporttables">Report tables</a>
<a href="#" class="btn_create"><span>Create</span></a>
</li>
<li>
<a href="#" class="mafe-menu-databaseconnections">Database connections</a>
<a href="#" class="btn_create"><span>Create</span></a>
</li>
<li>
<a href="#" class="mefe-menu-casescheduler">Case scheduler</a>
<a href="#" class="btn_create"><span>Create</span></a>
</li>
</ul>
</div>
</section>
</body>