Merge remote branch 'upstream/master'

This commit is contained in:
Ronald Quenta
2015-03-03 10:52:18 -04:00
40 changed files with 5407 additions and 5365 deletions

View File

@@ -13,7 +13,7 @@ class EmailServer
"MESS_PASSWORD" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "emailServerPassword"),
"MESS_FROM_MAIL" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "emailServerFromMail"),
"MESS_FROM_NAME" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "emailServerFromName"),
"SMTPSECURE" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("No", "tls", "ssl"), "fieldNameAux" => "emailServerSecureConnection"),
"SMTPSECURE" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("No", "tls", "ssl", "none"), "fieldNameAux" => "emailServerSecureConnection"),
"MESS_TRY_SEND_INMEDIATLY" => array("type" => "int", "required" => false, "empty" => false, "defaultValues" => array(0, 1), "fieldNameAux" => "emailServerSendTestMail"),
"MAIL_TO" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "emailServerMailTo"),
"MESS_DEFAULT" => array("type" => "int", "required" => false, "empty" => false, "defaultValues" => array(0, 1), "fieldNameAux" => "emailServerDefault")

View File

@@ -1,6 +1,5 @@
<?php
namespace ProcessMaker\BusinessModel;
use \G;
/**
@@ -18,7 +17,7 @@ class Lists {
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*/
*/
public function getList($listName = 'inbox', $dataList = array(), $total = false)
{
Validator::isArray($dataList, '$dataList');
@@ -31,7 +30,6 @@ class Lists {
$userUid = $dataList["userId"];
$filters["paged"] = isset( $dataList["paged"] ) ? $dataList["paged"] : true;
$filters['count'] = isset( $dataList['count'] ) ? $dataList['count'] : true;
$filters["category"] = isset( $dataList["category"] ) ? $dataList["category"] : "";
$filters["process"] = isset( $dataList["process"] ) ? $dataList["process"] : "";
$filters["search"] = isset( $dataList["search"] ) ? $dataList["search"] : "";
@@ -87,7 +85,7 @@ class Lists {
$filters["start"] = (int)$filters["start"];
$filters["start"] = abs($filters["start"]);
if ($filters["start"] != 0) {
$filters["start"]--;
$filters["start"]+1;
}
$filters["limit"] = (int)$filters["limit"];
@@ -162,11 +160,10 @@ class Lists {
//$value = array_change_key_case($value, CASE_LOWER);
}
}
$response = array();
if ($filters["paged"]) {
$filtersData = array();
$filtersData['start'] = $filters["start"]+1;
$filtersData['start'] = $filters["start"];
$filtersData['limit'] = $filters["limit"];
$filtersData['sort'] = G::toLower($filters["sort"]);
$filtersData['dir'] = G::toLower($filters["dir"]);
@@ -177,11 +174,10 @@ class Lists {
$filtersData['date_to'] = $filters["dateTo"];
$response['filters'] = $filtersData;
$response['data'] = $result;
$response['totalCount'] = $list->countTotal($userUid, $filters);
$response['totalCount'] = $list->countTotal($userUid, $filtersData);
} else {
$response = $result;
}
return $response;
}
}

View File

@@ -213,23 +213,23 @@ class Process
if ($arrayFieldDefinition[$fieldName]["empty"] && $fieldValue . "" == "") {
//
} else {
$eregDate = "[1-9]\d{3}\-(?:0[1-9]|1[012])\-(?:[0][1-9]|[12][0-9]|3[01])";
$eregHour = "(?:[0-1]\d|2[0-3])\:(?:[0-5]\d)(?:\:[0-5]\d)?";
$eregDatetime = $eregDate . "\s" . $eregHour;
$regexpDate = "[1-9]\d{3}\-(?:0[1-9]|1[012])\-(?:[0][1-9]|[12][0-9]|3[01])";
$regexpHour = "(?:[0-1]\d|2[0-3])\:(?:[0-5]\d)(?:\:[0-5]\d)?";
$regexpDatetime = $regexpDate . "\s" . $regexpHour;
switch ($arrayFieldDefinition[$fieldName]["type"]) {
case "date":
if (!preg_match("/^" . $eregDate . "$/", $fieldValue)) {
if (!preg_match("/^" . $regexpDate . "$/", $fieldValue)) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE", array($fieldNameAux)));
}
break;
case "hour":
if (!preg_match("/^" . $eregHour . "$/", $fieldValue)) {
if (!preg_match("/^" . $regexpHour . "$/", $fieldValue)) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE", array($fieldNameAux)));
}
break;
case "datetime":
if (!preg_match("/^" . $eregDatetime . "$/", $fieldValue)) {
if (!preg_match("/^" . $regexpDatetime . "$/", $fieldValue)) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE", array($fieldNameAux)));
}
break;
@@ -239,9 +239,12 @@ class Process
case 2:
switch ($arrayFieldDefinition[$fieldName]["type"]) {
case "array":
$regexpArray1 = "\s*array\s*\(";
$regexpArray2 = "\)\s*";
//type
if (!is_array($fieldValue)) {
if ($fieldValue != "" && !preg_match("/^\s*array\s*\(.*\)\s*$/", $fieldValue)) {
if ($fieldValue != "" && !preg_match("/^" . $regexpArray1 . ".*" . $regexpArray2 . "$/", $fieldValue)) {
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_THIS_MUST_BE_ARRAY", array($fieldNameAux)));
}
}
@@ -255,7 +258,13 @@ class Process
}
if (is_string($fieldValue) && trim($fieldValue) . "" != "") {
eval("\$arrayAux = $fieldValue;");
//eval("\$arrayAux = $fieldValue;");
if (preg_match("/^" . $regexpArray1 . "(.*)" . $regexpArray2 . "$/", $fieldValue, $arrayMatch)) {
if (trim($arrayMatch[1], " ,") != "") {
$arrayAux = array(0);
}
}
}
if (count($arrayAux) == 0) {

View File

@@ -24,8 +24,8 @@ class Lists extends Api
* @param string $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -45,8 +45,8 @@ class Lists extends Api
$limit = 0,
$sort = 'APP_UPDATE_DATE',
$dir = 'DESC',
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -63,8 +63,8 @@ class Lists extends Api
$dataList['sort'] = $sort;
$dataList['dir'] = $dir;
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -83,8 +83,8 @@ class Lists extends Api
/**
* Get count list Inbox
*
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -98,8 +98,8 @@ class Lists extends Api
* @url GET /total
*/
public function doGetCountInbox(
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -108,8 +108,8 @@ class Lists extends Api
try {
$dataList['userId'] = $this->getUserId();
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -132,8 +132,8 @@ class Lists extends Api
* @param string $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -153,8 +153,8 @@ class Lists extends Api
$limit = 0,
$sort = 'APP_UPDATE_DATE',
$dir = 'DESC',
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -170,8 +170,8 @@ class Lists extends Api
$dataList['sort'] = $sort;
$dataList['dir'] = $dir;
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -188,8 +188,8 @@ class Lists extends Api
/**
* Get count list Participated Last
*
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -203,8 +203,8 @@ class Lists extends Api
* @url GET /participated-last/total
*/
public function doGetCountParticipatedLast(
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -213,8 +213,8 @@ class Lists extends Api
try {
$dataList['userId'] = $this->getUserId();
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -237,8 +237,8 @@ class Lists extends Api
* @param string $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -257,8 +257,8 @@ class Lists extends Api
$limit = 0,
$sort = 'APP_UPDATE_DATE',
$dir = 'DESC',
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -274,8 +274,8 @@ class Lists extends Api
$dataList['sort'] = $sort;
$dataList['dir'] = $dir;
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -292,8 +292,8 @@ class Lists extends Api
/**
* Get count list Participated History
*
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -306,8 +306,8 @@ class Lists extends Api
* @url GET /participated-history/total
*/
public function doGetCountParticipatedHistory(
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -316,8 +316,8 @@ class Lists extends Api
try {
$dataList['userId'] = $this->getUserId();
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -343,8 +343,8 @@ class Lists extends Api
* @param string $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -363,8 +363,8 @@ class Lists extends Api
$limit = 0,
$sort = 'APP_PAUSED_DATE',
$dir = 'DESC',
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -380,8 +380,8 @@ class Lists extends Api
$dataList['sort'] = $sort;
$dataList['dir'] = $dir;
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -398,8 +398,8 @@ class Lists extends Api
/**
* Get count list Paused
*
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -412,8 +412,8 @@ class Lists extends Api
* @url GET /paused/total
*/
public function doGetCountPaused(
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -422,8 +422,8 @@ class Lists extends Api
try {
$dataList['userId'] = $this->getUserId();
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -448,8 +448,8 @@ class Lists extends Api
* @param string $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -468,8 +468,8 @@ class Lists extends Api
$limit = 0,
$sort = 'APP_CANCELED_DATE',
$dir = 'DESC',
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -485,8 +485,8 @@ class Lists extends Api
$dataList['sort'] = $sort;
$dataList['dir'] = $dir;
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -503,8 +503,8 @@ class Lists extends Api
/**
* Get count list Canceled
*
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -517,8 +517,8 @@ class Lists extends Api
* @url GET /canceled/total
*/
public function doGetCountCanceled(
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -527,8 +527,8 @@ class Lists extends Api
try {
$dataList['userId'] = $this->getUserId();
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -552,8 +552,8 @@ class Lists extends Api
* @param string $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -572,8 +572,8 @@ class Lists extends Api
$limit = 0,
$sort = 'APP_UPDATE_DATE',
$dir = 'DESC',
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -589,8 +589,8 @@ class Lists extends Api
$dataList['sort'] = $sort;
$dataList['dir'] = $dir;
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -607,8 +607,8 @@ class Lists extends Api
/**
* Get count list Participated History
*
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -621,8 +621,8 @@ class Lists extends Api
* @url GET /completed/total
*/
public function doGetCountCompleted(
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -631,8 +631,8 @@ class Lists extends Api
try {
$dataList['userId'] = $this->getUserId();
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -656,8 +656,8 @@ class Lists extends Api
* @param string $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -676,8 +676,8 @@ class Lists extends Api
$limit = 0,
$sort = 'APP_UPDATE_DATE',
$dir = 'DESC',
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -693,8 +693,8 @@ class Lists extends Api
$dataList['sort'] = $sort;
$dataList['dir'] = $dir;
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -711,8 +711,8 @@ class Lists extends Api
/**
* Get count list Participated History
*
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -725,8 +725,8 @@ class Lists extends Api
* @url GET /my-inbox/total
*/
public function doGetCountListMyInbox(
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -735,8 +735,8 @@ class Lists extends Api
try {
$dataList['userId'] = $this->getUserId();
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -759,8 +759,8 @@ class Lists extends Api
* @param string $limit {@from path}
* @param string $sort {@from path}
* @param string $dir {@from path}
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -779,8 +779,8 @@ class Lists extends Api
$limit = 0,
$sort = 'APP_UPDATE_DATE',
$dir = 'DESC',
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -797,8 +797,8 @@ class Lists extends Api
$dataList['sort'] = $sort;
$dataList['dir'] = $dir;
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;
@@ -815,8 +815,8 @@ class Lists extends Api
/**
* Get count list Unassigned
*
* @param string $cat_uid {@from path}
* @param string $pro_uid {@from path}
* @param string $category {@from path}
* @param string $process {@from path}
* @param string $search {@from path}
* @param string $filter {@from path}
* @param string $date_from {@from path}
@@ -829,8 +829,8 @@ class Lists extends Api
* @url GET /unassigned/total
*/
public function doGetCountUnassigned(
$cat_uid = '',
$pro_uid = '',
$category = '',
$process = '',
$search = '',
$filter = '',
$date_from = '',
@@ -839,8 +839,8 @@ class Lists extends Api
try {
$dataList['userId'] = $this->getUserId();
$dataList['category'] = $cat_uid;
$dataList['process'] = $pro_uid;
$dataList['category'] = $category;
$dataList['process'] = $process;
$dataList['search'] = $search;
$dataList['filter'] = $filter;
$dataList['dateFrom'] = $date_from;