Merge remote-tracking branch 'origin/feature/HOR-3274' into feature/HOR-3559

This commit is contained in:
davidcallizaya
2017-08-10 21:38:58 -04:00
44 changed files with 60980 additions and 710 deletions

View File

@@ -1,5 +1,7 @@
<?php
use \ProcessMaker\BusinessModel\WebEntryEvent;
/**
* class.case.php
* @package workflow.engine.classes
@@ -184,18 +186,33 @@ class Cases
}
/*
* get user starting tasks, but per type (dropdown, radio and category type)
* Get user starting tasks, but per type (dropdown, radio and category type)
*
* @param string $sUIDUser
* @return $rows
*/
public function getStartCasesPerType($sUIDUser = '', $typeView = null)
{
$rows[] = array('uid' => 'char', 'value' => 'char');
$tasks = array();
$arrayTaskTypeToExclude = array("WEBENTRYEVENT", "END-MESSAGE-EVENT", "START-MESSAGE-EVENT", "INTERMEDIATE-THROW-MESSAGE-EVENT", "INTERMEDIATE-CATCH-MESSAGE-EVENT", "SCRIPT-TASK", "START-TIMER-EVENT", "INTERMEDIATE-CATCH-TIMER-EVENT");
$arrayTaskTypeToExclude = array(
"WEBENTRYEVENT",
"END-MESSAGE-EVENT",
"START-MESSAGE-EVENT",
"INTERMEDIATE-THROW-MESSAGE-EVENT",
"INTERMEDIATE-CATCH-MESSAGE-EVENT",
"SCRIPT-TASK",
"START-TIMER-EVENT",
"INTERMEDIATE-CATCH-TIMER-EVENT"
);
$webEntryEvent = new WebEntryEvent();
$arrayWebEntryEvent = array();
//Set the parameter $considerShowInCase=true, to consider the WE_SHOW_IN_CASE
//configuration to filter the Start events with WebEntry.
$allWebEntryEvents = $webEntryEvent->getAllWebEntryEvents(true);
foreach ($allWebEntryEvents as $webEntryEvents) {
$arrayWebEntryEvent[] = $webEntryEvents["ACT_UID"];
}
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(TaskPeer::TAS_UID);
@@ -205,6 +222,7 @@ class Cases
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(ProcessPeer::PRO_SUBPROCESS, '0');
$c->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN);
$c->add(TaskPeer::TAS_UID, $arrayWebEntryEvent, Criteria::NOT_IN);
$c->add(TaskPeer::TAS_START, 'TRUE');
$c->add(TaskUserPeer::USR_UID, $sUIDUser);
$c->add(TaskUserPeer::TU_TYPE, 1);
@@ -217,11 +235,9 @@ class Cases
$rs->next();
$row = $rs->getRow();
}
//check groups
$group = new Groups();
$aGroups = $group->getActiveGroupsForAnUser($sUIDUser);
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(TaskPeer::TAS_UID);
@@ -231,6 +247,7 @@ class Cases
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$c->add(ProcessPeer::PRO_SUBPROCESS, '0');
$c->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN);
$c->add(TaskPeer::TAS_UID, $arrayWebEntryEvent, Criteria::NOT_IN);
$c->add(TaskPeer::TAS_START, 'TRUE');
$c->add(TaskUserPeer::USR_UID, $aGroups, Criteria::IN);
$c->add(TaskUserPeer::TU_TYPE, 1);
@@ -243,7 +260,6 @@ class Cases
$rs->next();
$row = $rs->getRow();
}
$c = new Criteria();
$c->addSelectColumn(TaskPeer::TAS_UID);
$c->addSelectColumn(TaskPeer::TAS_TITLE);
@@ -261,20 +277,17 @@ class Cases
$aConditions[] = array('PCS.PRO_CATEGORY', 'PCSCAT.CATEGORY_UID');
$c->addJoinMC($aConditions, Criteria::LEFT_JOIN);
}
$c->addJoin (TaskPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
$c->add(TaskPeer::TAS_UID, $tasks, Criteria::IN);
$c->add(ProcessPeer::PRO_SUBPROCESS, '0');
$c->addAscendingOrderByColumn(ProcessPeer::PRO_TITLE);
$c->addAscendingOrderByColumn(TaskPeer::TAS_TITLE);
$rs = TaskPeer::doSelectRS($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$countTaskLabel = 1;
while ($row = $rs->getRow()) {
if($row['TAS_TITLE'] != ''){
if ($row['TAS_TITLE'] != '') {
$taskTitleLabel = $row['TAS_TITLE'];
} else {
$taskTitleLabel = G::LoadTranslation('ID_UNTITLED_TASK').' '.$countTaskLabel;
@@ -284,7 +297,7 @@ class Cases
$taskTitle = TaskPeer::retrieveByPK($row['TAS_UID']);
$row['TAS_TITLE'] = $taskTitle->getTasTitle();
$row['CATEGORY_NAME'] = ($row['CATEGORY_NAME'] == '') ?
G::LoadTranslation('ID_PROCESS_NOCATEGORY') : $row['CATEGORY_NAME'];
G::LoadTranslation('ID_PROCESS_NOCATEGORY') : $row['CATEGORY_NAME'];
$rows[] = array(
'uid' => $row['TAS_UID'],
'value' => $row['PRO_TITLE'] . ' (' . $taskTitleLabel . ')',
@@ -302,12 +315,10 @@ class Cases
$rs->next();
$row = $rs->getRow();
}
$rowsToReturn = $rows;
if ($typeView === 'category') {
$rowsToReturn = $this->orderStartCasesByCategoryAndName($rows);
}
return $rowsToReturn;
}

View File

@@ -850,6 +850,29 @@ class Processes
return true;
}
/**
* change and Renew all Task GUID owned by WebEntries
*
* @param string $oData
* @return boolean
*/
public function renewAllWebEntryEventGuid(&$oData)
{
$map = array();
foreach ($oData->webEntryEvent as $key => $val) {
if (isset($val["EVN_UID_OLD"])) {
$uidNew = \ProcessMaker\BusinessModel\WebEntryEvent::getTaskUidFromEvnUid($val["EVN_UID"]);
$uidOld = \ProcessMaker\BusinessModel\WebEntryEvent::getTaskUidFromEvnUid($val["EVN_UID_OLD"]);
foreach($oData->tasks as $index => $task) {
if ($task["TAS_UID"]===$uidOld) {
$oData->tasks[$index]["TAS_UID"]=$uidNew;
$oData->tasks[$index]["TAS_UID_OLD"]=$uidOld;
}
}
}
}
}
/**
* change and Renew all Task GUID, because the process needs to have a new set of tasks
*
@@ -2584,6 +2607,7 @@ class Processes
$oData->uid["PROCESS"] = array($oData->process["PRO_PARENT"] => $oData->process["PRO_UID"]);
}
$this->renewAllWebEntryEventGuid($oData);
$this->renewAllTaskGuid($oData);
$this->renewAllDynaformGuid($oData);
$this->renewAllInputGuid($oData);

View File

@@ -1270,7 +1270,7 @@ class wsBase
return $result;
} catch (Exception $e) {
$result = wsCreateUserResponse( 100, $e->getMessage(), null );
$result = new wsCreateUserResponse( 100, $e->getMessage(), null );
return $result;
}

View File

@@ -77,9 +77,9 @@ class WebEntryEventMapBuilder
$tMap->addColumn('ACT_UID', 'ActUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('WEE_STATUS', 'WeeStatus', 'string', CreoleTypes::VARCHAR, true, 10);

View File

@@ -71,7 +71,7 @@ class WebEntryMapBuilder
$tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('DYN_UID', 'DynUid', 'string', CreoleTypes::VARCHAR, false, 32);
$tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, false, 32);
@@ -89,6 +89,36 @@ class WebEntryMapBuilder
$tMap->addColumn('WE_UPDATE_DATE', 'WeUpdateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
$tMap->addColumn('WE_TYPE', 'WeType', 'string', CreoleTypes::VARCHAR, true, 8);
$tMap->addColumn('WE_CUSTOM_TITLE', 'WeCustomTitle', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('WE_AUTHENTICATION', 'WeAuthentication', 'string', CreoleTypes::VARCHAR, true, 14);
$tMap->addColumn('WE_HIDE_INFORMATION_BAR', 'WeHideInformationBar', 'string', CreoleTypes::CHAR, false, 1);
$tMap->addColumn('WE_CALLBACK', 'WeCallback', 'string', CreoleTypes::VARCHAR, true, 13);
$tMap->addColumn('WE_CALLBACK_URL', 'WeCallbackUrl', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('WE_LINK_GENERATION', 'WeLinkGeneration', 'string', CreoleTypes::VARCHAR, true, 8);
$tMap->addColumn('WE_LINK_SKIN', 'WeLinkSkin', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('WE_LINK_LANGUAGE', 'WeLinkLanguage', 'string', CreoleTypes::VARCHAR, false, 255);
$tMap->addColumn('WE_LINK_DOMAIN', 'WeLinkDomain', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('WE_SHOW_IN_NEW_CASE', 'WeShowInNewCase', 'string', CreoleTypes::CHAR, false, 1);
$tMap->addValidator('WE_TYPE', 'validValues', 'propel.validator.ValidValuesValidator', 'SINGLE|MULTIPLE', 'Please enter a valid value for WE_TYPE');
$tMap->addValidator('WE_AUTHENTICATION', 'validValues', 'propel.validator.ValidValuesValidator', 'ANONYMOUS|LOGIN_REQUIRED', 'Please enter a valid value for WE_AUTHENTICATION');
$tMap->addValidator('WE_CALLBACK', 'validValues', 'propel.validator.ValidValuesValidator', 'PROCESSMAKER|CUSTOM|CUSTOM_CLEAR', 'Please enter a valid value for WE_CALLBACK');
$tMap->addValidator('WE_LINK_GENERATION', 'validValues', 'propel.validator.ValidValuesValidator', 'DEFAULT|ADVANCED', 'Please enter a valid value for WE_LINK_GENERATION');
} // doBuild()
} // WebEntryMapBuilder

View File

@@ -55,7 +55,7 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
* The value for the usr_uid field.
* @var string
*/
protected $usr_uid = '';
protected $usr_uid;
/**
* The value for the we_method field.
@@ -99,6 +99,72 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
*/
protected $we_update_date;
/**
* The value for the we_type field.
* @var string
*/
protected $we_type = 'SINGLE';
/**
* The value for the we_custom_title field.
* @var string
*/
protected $we_custom_title;
/**
* The value for the we_authentication field.
* @var string
*/
protected $we_authentication = 'ANONYMOUS';
/**
* The value for the we_hide_information_bar field.
* @var string
*/
protected $we_hide_information_bar = '1';
/**
* The value for the we_callback field.
* @var string
*/
protected $we_callback = 'PROCESSMAKER';
/**
* The value for the we_callback_url field.
* @var string
*/
protected $we_callback_url;
/**
* The value for the we_link_generation field.
* @var string
*/
protected $we_link_generation = 'DEFAULT';
/**
* The value for the we_link_skin field.
* @var string
*/
protected $we_link_skin;
/**
* The value for the we_link_language field.
* @var string
*/
protected $we_link_language;
/**
* The value for the we_link_domain field.
* @var string
*/
protected $we_link_domain;
/**
* The value for the we_show_in_new_case field.
* @var string
*/
protected $we_show_in_new_case = '1';
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -287,6 +353,127 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
}
}
/**
* Get the [we_type] column value.
*
* @return string
*/
public function getWeType()
{
return $this->we_type;
}
/**
* Get the [we_custom_title] column value.
*
* @return string
*/
public function getWeCustomTitle()
{
return $this->we_custom_title;
}
/**
* Get the [we_authentication] column value.
*
* @return string
*/
public function getWeAuthentication()
{
return $this->we_authentication;
}
/**
* Get the [we_hide_information_bar] column value.
*
* @return string
*/
public function getWeHideInformationBar()
{
return $this->we_hide_information_bar;
}
/**
* Get the [we_callback] column value.
*
* @return string
*/
public function getWeCallback()
{
return $this->we_callback;
}
/**
* Get the [we_callback_url] column value.
*
* @return string
*/
public function getWeCallbackUrl()
{
return $this->we_callback_url;
}
/**
* Get the [we_link_generation] column value.
*
* @return string
*/
public function getWeLinkGeneration()
{
return $this->we_link_generation;
}
/**
* Get the [we_link_skin] column value.
*
* @return string
*/
public function getWeLinkSkin()
{
return $this->we_link_skin;
}
/**
* Get the [we_link_language] column value.
*
* @return string
*/
public function getWeLinkLanguage()
{
return $this->we_link_language;
}
/**
* Get the [we_link_domain] column value.
*
* @return string
*/
public function getWeLinkDomain()
{
return $this->we_link_domain;
}
/**
* Get the [we_show_in_new_case] column value.
*
* @return string
*/
public function getWeShowInNewCase()
{
return $this->we_show_in_new_case;
}
/**
* Set the value of [we_uid] column.
*
@@ -390,7 +577,7 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->usr_uid !== $v || $v === '') {
if ($this->usr_uid !== $v) {
$this->usr_uid = $v;
$this->modifiedColumns[] = WebEntryPeer::USR_UID;
}
@@ -565,6 +752,248 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
} // setWeUpdateDate()
/**
* Set the value of [we_type] column.
*
* @param string $v new value
* @return void
*/
public function setWeType($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_type !== $v || $v === 'SINGLE') {
$this->we_type = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_TYPE;
}
} // setWeType()
/**
* Set the value of [we_custom_title] column.
*
* @param string $v new value
* @return void
*/
public function setWeCustomTitle($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_custom_title !== $v) {
$this->we_custom_title = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_CUSTOM_TITLE;
}
} // setWeCustomTitle()
/**
* Set the value of [we_authentication] column.
*
* @param string $v new value
* @return void
*/
public function setWeAuthentication($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_authentication !== $v || $v === 'ANONYMOUS') {
$this->we_authentication = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_AUTHENTICATION;
}
} // setWeAuthentication()
/**
* Set the value of [we_hide_information_bar] column.
*
* @param string $v new value
* @return void
*/
public function setWeHideInformationBar($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_hide_information_bar !== $v || $v === '1') {
$this->we_hide_information_bar = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_HIDE_INFORMATION_BAR;
}
} // setWeHideInformationBar()
/**
* Set the value of [we_callback] column.
*
* @param string $v new value
* @return void
*/
public function setWeCallback($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_callback !== $v || $v === 'PROCESSMAKER') {
$this->we_callback = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_CALLBACK;
}
} // setWeCallback()
/**
* Set the value of [we_callback_url] column.
*
* @param string $v new value
* @return void
*/
public function setWeCallbackUrl($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_callback_url !== $v) {
$this->we_callback_url = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_CALLBACK_URL;
}
} // setWeCallbackUrl()
/**
* Set the value of [we_link_generation] column.
*
* @param string $v new value
* @return void
*/
public function setWeLinkGeneration($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_link_generation !== $v || $v === 'DEFAULT') {
$this->we_link_generation = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_LINK_GENERATION;
}
} // setWeLinkGeneration()
/**
* Set the value of [we_link_skin] column.
*
* @param string $v new value
* @return void
*/
public function setWeLinkSkin($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_link_skin !== $v) {
$this->we_link_skin = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_LINK_SKIN;
}
} // setWeLinkSkin()
/**
* Set the value of [we_link_language] column.
*
* @param string $v new value
* @return void
*/
public function setWeLinkLanguage($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_link_language !== $v) {
$this->we_link_language = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_LINK_LANGUAGE;
}
} // setWeLinkLanguage()
/**
* Set the value of [we_link_domain] column.
*
* @param string $v new value
* @return void
*/
public function setWeLinkDomain($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_link_domain !== $v) {
$this->we_link_domain = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_LINK_DOMAIN;
}
} // setWeLinkDomain()
/**
* Set the value of [we_show_in_new_case] column.
*
* @param string $v new value
* @return void
*/
public function setWeShowInNewCase($v)
{
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->we_show_in_new_case !== $v || $v === '1') {
$this->we_show_in_new_case = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_SHOW_IN_NEW_CASE;
}
} // setWeShowInNewCase()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
@@ -606,12 +1035,34 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
$this->we_update_date = $rs->getTimestamp($startcol + 11, null);
$this->we_type = $rs->getString($startcol + 12);
$this->we_custom_title = $rs->getString($startcol + 13);
$this->we_authentication = $rs->getString($startcol + 14);
$this->we_hide_information_bar = $rs->getString($startcol + 15);
$this->we_callback = $rs->getString($startcol + 16);
$this->we_callback_url = $rs->getString($startcol + 17);
$this->we_link_generation = $rs->getString($startcol + 18);
$this->we_link_skin = $rs->getString($startcol + 19);
$this->we_link_language = $rs->getString($startcol + 20);
$this->we_link_domain = $rs->getString($startcol + 21);
$this->we_show_in_new_case = $rs->getString($startcol + 22);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 12; // 12 = WebEntryPeer::NUM_COLUMNS - WebEntryPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 23; // 23 = WebEntryPeer::NUM_COLUMNS - WebEntryPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating WebEntry object", $e);
@@ -851,6 +1302,39 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
case 11:
return $this->getWeUpdateDate();
break;
case 12:
return $this->getWeType();
break;
case 13:
return $this->getWeCustomTitle();
break;
case 14:
return $this->getWeAuthentication();
break;
case 15:
return $this->getWeHideInformationBar();
break;
case 16:
return $this->getWeCallback();
break;
case 17:
return $this->getWeCallbackUrl();
break;
case 18:
return $this->getWeLinkGeneration();
break;
case 19:
return $this->getWeLinkSkin();
break;
case 20:
return $this->getWeLinkLanguage();
break;
case 21:
return $this->getWeLinkDomain();
break;
case 22:
return $this->getWeShowInNewCase();
break;
default:
return null;
break;
@@ -883,6 +1367,17 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
$keys[9] => $this->getWeUpdateUsrUid(),
$keys[10] => $this->getWeCreateDate(),
$keys[11] => $this->getWeUpdateDate(),
$keys[12] => $this->getWeType(),
$keys[13] => $this->getWeCustomTitle(),
$keys[14] => $this->getWeAuthentication(),
$keys[15] => $this->getWeHideInformationBar(),
$keys[16] => $this->getWeCallback(),
$keys[17] => $this->getWeCallbackUrl(),
$keys[18] => $this->getWeLinkGeneration(),
$keys[19] => $this->getWeLinkSkin(),
$keys[20] => $this->getWeLinkLanguage(),
$keys[21] => $this->getWeLinkDomain(),
$keys[22] => $this->getWeShowInNewCase(),
);
return $result;
}
@@ -950,6 +1445,39 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
case 11:
$this->setWeUpdateDate($value);
break;
case 12:
$this->setWeType($value);
break;
case 13:
$this->setWeCustomTitle($value);
break;
case 14:
$this->setWeAuthentication($value);
break;
case 15:
$this->setWeHideInformationBar($value);
break;
case 16:
$this->setWeCallback($value);
break;
case 17:
$this->setWeCallbackUrl($value);
break;
case 18:
$this->setWeLinkGeneration($value);
break;
case 19:
$this->setWeLinkSkin($value);
break;
case 20:
$this->setWeLinkLanguage($value);
break;
case 21:
$this->setWeLinkDomain($value);
break;
case 22:
$this->setWeShowInNewCase($value);
break;
} // switch()
}
@@ -1021,6 +1549,50 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
$this->setWeUpdateDate($arr[$keys[11]]);
}
if (array_key_exists($keys[12], $arr)) {
$this->setWeType($arr[$keys[12]]);
}
if (array_key_exists($keys[13], $arr)) {
$this->setWeCustomTitle($arr[$keys[13]]);
}
if (array_key_exists($keys[14], $arr)) {
$this->setWeAuthentication($arr[$keys[14]]);
}
if (array_key_exists($keys[15], $arr)) {
$this->setWeHideInformationBar($arr[$keys[15]]);
}
if (array_key_exists($keys[16], $arr)) {
$this->setWeCallback($arr[$keys[16]]);
}
if (array_key_exists($keys[17], $arr)) {
$this->setWeCallbackUrl($arr[$keys[17]]);
}
if (array_key_exists($keys[18], $arr)) {
$this->setWeLinkGeneration($arr[$keys[18]]);
}
if (array_key_exists($keys[19], $arr)) {
$this->setWeLinkSkin($arr[$keys[19]]);
}
if (array_key_exists($keys[20], $arr)) {
$this->setWeLinkLanguage($arr[$keys[20]]);
}
if (array_key_exists($keys[21], $arr)) {
$this->setWeLinkDomain($arr[$keys[21]]);
}
if (array_key_exists($keys[22], $arr)) {
$this->setWeShowInNewCase($arr[$keys[22]]);
}
}
/**
@@ -1080,6 +1652,50 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
$criteria->add(WebEntryPeer::WE_UPDATE_DATE, $this->we_update_date);
}
if ($this->isColumnModified(WebEntryPeer::WE_TYPE)) {
$criteria->add(WebEntryPeer::WE_TYPE, $this->we_type);
}
if ($this->isColumnModified(WebEntryPeer::WE_CUSTOM_TITLE)) {
$criteria->add(WebEntryPeer::WE_CUSTOM_TITLE, $this->we_custom_title);
}
if ($this->isColumnModified(WebEntryPeer::WE_AUTHENTICATION)) {
$criteria->add(WebEntryPeer::WE_AUTHENTICATION, $this->we_authentication);
}
if ($this->isColumnModified(WebEntryPeer::WE_HIDE_INFORMATION_BAR)) {
$criteria->add(WebEntryPeer::WE_HIDE_INFORMATION_BAR, $this->we_hide_information_bar);
}
if ($this->isColumnModified(WebEntryPeer::WE_CALLBACK)) {
$criteria->add(WebEntryPeer::WE_CALLBACK, $this->we_callback);
}
if ($this->isColumnModified(WebEntryPeer::WE_CALLBACK_URL)) {
$criteria->add(WebEntryPeer::WE_CALLBACK_URL, $this->we_callback_url);
}
if ($this->isColumnModified(WebEntryPeer::WE_LINK_GENERATION)) {
$criteria->add(WebEntryPeer::WE_LINK_GENERATION, $this->we_link_generation);
}
if ($this->isColumnModified(WebEntryPeer::WE_LINK_SKIN)) {
$criteria->add(WebEntryPeer::WE_LINK_SKIN, $this->we_link_skin);
}
if ($this->isColumnModified(WebEntryPeer::WE_LINK_LANGUAGE)) {
$criteria->add(WebEntryPeer::WE_LINK_LANGUAGE, $this->we_link_language);
}
if ($this->isColumnModified(WebEntryPeer::WE_LINK_DOMAIN)) {
$criteria->add(WebEntryPeer::WE_LINK_DOMAIN, $this->we_link_domain);
}
if ($this->isColumnModified(WebEntryPeer::WE_SHOW_IN_NEW_CASE)) {
$criteria->add(WebEntryPeer::WE_SHOW_IN_NEW_CASE, $this->we_show_in_new_case);
}
return $criteria;
}
@@ -1156,6 +1772,28 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
$copyObj->setWeUpdateDate($this->we_update_date);
$copyObj->setWeType($this->we_type);
$copyObj->setWeCustomTitle($this->we_custom_title);
$copyObj->setWeAuthentication($this->we_authentication);
$copyObj->setWeHideInformationBar($this->we_hide_information_bar);
$copyObj->setWeCallback($this->we_callback);
$copyObj->setWeCallbackUrl($this->we_callback_url);
$copyObj->setWeLinkGeneration($this->we_link_generation);
$copyObj->setWeLinkSkin($this->we_link_skin);
$copyObj->setWeLinkLanguage($this->we_link_language);
$copyObj->setWeLinkDomain($this->we_link_domain);
$copyObj->setWeShowInNewCase($this->we_show_in_new_case);
$copyObj->setNew(true);

View File

@@ -25,7 +25,7 @@ abstract class BaseWebEntryPeer
const CLASS_DEFAULT = 'classes.model.WebEntry';
/** The total number of columns. */
const NUM_COLUMNS = 12;
const NUM_COLUMNS = 23;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -67,6 +67,39 @@ abstract class BaseWebEntryPeer
/** the column name for the WE_UPDATE_DATE field */
const WE_UPDATE_DATE = 'WEB_ENTRY.WE_UPDATE_DATE';
/** the column name for the WE_TYPE field */
const WE_TYPE = 'WEB_ENTRY.WE_TYPE';
/** the column name for the WE_CUSTOM_TITLE field */
const WE_CUSTOM_TITLE = 'WEB_ENTRY.WE_CUSTOM_TITLE';
/** the column name for the WE_AUTHENTICATION field */
const WE_AUTHENTICATION = 'WEB_ENTRY.WE_AUTHENTICATION';
/** the column name for the WE_HIDE_INFORMATION_BAR field */
const WE_HIDE_INFORMATION_BAR = 'WEB_ENTRY.WE_HIDE_INFORMATION_BAR';
/** the column name for the WE_CALLBACK field */
const WE_CALLBACK = 'WEB_ENTRY.WE_CALLBACK';
/** the column name for the WE_CALLBACK_URL field */
const WE_CALLBACK_URL = 'WEB_ENTRY.WE_CALLBACK_URL';
/** the column name for the WE_LINK_GENERATION field */
const WE_LINK_GENERATION = 'WEB_ENTRY.WE_LINK_GENERATION';
/** the column name for the WE_LINK_SKIN field */
const WE_LINK_SKIN = 'WEB_ENTRY.WE_LINK_SKIN';
/** the column name for the WE_LINK_LANGUAGE field */
const WE_LINK_LANGUAGE = 'WEB_ENTRY.WE_LINK_LANGUAGE';
/** the column name for the WE_LINK_DOMAIN field */
const WE_LINK_DOMAIN = 'WEB_ENTRY.WE_LINK_DOMAIN';
/** the column name for the WE_SHOW_IN_NEW_CASE field */
const WE_SHOW_IN_NEW_CASE = 'WEB_ENTRY.WE_SHOW_IN_NEW_CASE';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
@@ -78,10 +111,10 @@ abstract class BaseWebEntryPeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('WeUid', 'ProUid', 'TasUid', 'DynUid', 'UsrUid', 'WeMethod', 'WeInputDocumentAccess', 'WeData', 'WeCreateUsrUid', 'WeUpdateUsrUid', 'WeCreateDate', 'WeUpdateDate', ),
BasePeer::TYPE_COLNAME => array (WebEntryPeer::WE_UID, WebEntryPeer::PRO_UID, WebEntryPeer::TAS_UID, WebEntryPeer::DYN_UID, WebEntryPeer::USR_UID, WebEntryPeer::WE_METHOD, WebEntryPeer::WE_INPUT_DOCUMENT_ACCESS, WebEntryPeer::WE_DATA, WebEntryPeer::WE_CREATE_USR_UID, WebEntryPeer::WE_UPDATE_USR_UID, WebEntryPeer::WE_CREATE_DATE, WebEntryPeer::WE_UPDATE_DATE, ),
BasePeer::TYPE_FIELDNAME => array ('WE_UID', 'PRO_UID', 'TAS_UID', 'DYN_UID', 'USR_UID', 'WE_METHOD', 'WE_INPUT_DOCUMENT_ACCESS', 'WE_DATA', 'WE_CREATE_USR_UID', 'WE_UPDATE_USR_UID', 'WE_CREATE_DATE', 'WE_UPDATE_DATE', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
BasePeer::TYPE_PHPNAME => array ('WeUid', 'ProUid', 'TasUid', 'DynUid', 'UsrUid', 'WeMethod', 'WeInputDocumentAccess', 'WeData', 'WeCreateUsrUid', 'WeUpdateUsrUid', 'WeCreateDate', 'WeUpdateDate', 'WeType', 'WeCustomTitle', 'WeAuthentication', 'WeHideInformationBar', 'WeCallback', 'WeCallbackUrl', 'WeLinkGeneration', 'WeLinkSkin', 'WeLinkLanguage', 'WeLinkDomain', 'WeShowInNewCase', ),
BasePeer::TYPE_COLNAME => array (WebEntryPeer::WE_UID, WebEntryPeer::PRO_UID, WebEntryPeer::TAS_UID, WebEntryPeer::DYN_UID, WebEntryPeer::USR_UID, WebEntryPeer::WE_METHOD, WebEntryPeer::WE_INPUT_DOCUMENT_ACCESS, WebEntryPeer::WE_DATA, WebEntryPeer::WE_CREATE_USR_UID, WebEntryPeer::WE_UPDATE_USR_UID, WebEntryPeer::WE_CREATE_DATE, WebEntryPeer::WE_UPDATE_DATE, WebEntryPeer::WE_TYPE, WebEntryPeer::WE_CUSTOM_TITLE, WebEntryPeer::WE_AUTHENTICATION, WebEntryPeer::WE_HIDE_INFORMATION_BAR, WebEntryPeer::WE_CALLBACK, WebEntryPeer::WE_CALLBACK_URL, WebEntryPeer::WE_LINK_GENERATION, WebEntryPeer::WE_LINK_SKIN, WebEntryPeer::WE_LINK_LANGUAGE, WebEntryPeer::WE_LINK_DOMAIN, WebEntryPeer::WE_SHOW_IN_NEW_CASE, ),
BasePeer::TYPE_FIELDNAME => array ('WE_UID', 'PRO_UID', 'TAS_UID', 'DYN_UID', 'USR_UID', 'WE_METHOD', 'WE_INPUT_DOCUMENT_ACCESS', 'WE_DATA', 'WE_CREATE_USR_UID', 'WE_UPDATE_USR_UID', 'WE_CREATE_DATE', 'WE_UPDATE_DATE', 'WE_TYPE', 'WE_CUSTOM_TITLE', 'WE_AUTHENTICATION', 'WE_HIDE_INFORMATION_BAR', 'WE_CALLBACK', 'WE_CALLBACK_URL', 'WE_LINK_GENERATION', 'WE_LINK_SKIN', 'WE_LINK_LANGUAGE', 'WE_LINK_DOMAIN', 'WE_SHOW_IN_NEW_CASE', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, )
);
/**
@@ -91,10 +124,10 @@ abstract class BaseWebEntryPeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('WeUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'DynUid' => 3, 'UsrUid' => 4, 'WeMethod' => 5, 'WeInputDocumentAccess' => 6, 'WeData' => 7, 'WeCreateUsrUid' => 8, 'WeUpdateUsrUid' => 9, 'WeCreateDate' => 10, 'WeUpdateDate' => 11, ),
BasePeer::TYPE_COLNAME => array (WebEntryPeer::WE_UID => 0, WebEntryPeer::PRO_UID => 1, WebEntryPeer::TAS_UID => 2, WebEntryPeer::DYN_UID => 3, WebEntryPeer::USR_UID => 4, WebEntryPeer::WE_METHOD => 5, WebEntryPeer::WE_INPUT_DOCUMENT_ACCESS => 6, WebEntryPeer::WE_DATA => 7, WebEntryPeer::WE_CREATE_USR_UID => 8, WebEntryPeer::WE_UPDATE_USR_UID => 9, WebEntryPeer::WE_CREATE_DATE => 10, WebEntryPeer::WE_UPDATE_DATE => 11, ),
BasePeer::TYPE_FIELDNAME => array ('WE_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'DYN_UID' => 3, 'USR_UID' => 4, 'WE_METHOD' => 5, 'WE_INPUT_DOCUMENT_ACCESS' => 6, 'WE_DATA' => 7, 'WE_CREATE_USR_UID' => 8, 'WE_UPDATE_USR_UID' => 9, 'WE_CREATE_DATE' => 10, 'WE_UPDATE_DATE' => 11, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
BasePeer::TYPE_PHPNAME => array ('WeUid' => 0, 'ProUid' => 1, 'TasUid' => 2, 'DynUid' => 3, 'UsrUid' => 4, 'WeMethod' => 5, 'WeInputDocumentAccess' => 6, 'WeData' => 7, 'WeCreateUsrUid' => 8, 'WeUpdateUsrUid' => 9, 'WeCreateDate' => 10, 'WeUpdateDate' => 11, 'WeType' => 12, 'WeCustomTitle' => 13, 'WeAuthentication' => 14, 'WeHideInformationBar' => 15, 'WeCallback' => 16, 'WeCallbackUrl' => 17, 'WeLinkGeneration' => 18, 'WeLinkSkin' => 19, 'WeLinkLanguage' => 20, 'WeLinkDomain' => 21, 'WeShowInNewCase' => 22, ),
BasePeer::TYPE_COLNAME => array (WebEntryPeer::WE_UID => 0, WebEntryPeer::PRO_UID => 1, WebEntryPeer::TAS_UID => 2, WebEntryPeer::DYN_UID => 3, WebEntryPeer::USR_UID => 4, WebEntryPeer::WE_METHOD => 5, WebEntryPeer::WE_INPUT_DOCUMENT_ACCESS => 6, WebEntryPeer::WE_DATA => 7, WebEntryPeer::WE_CREATE_USR_UID => 8, WebEntryPeer::WE_UPDATE_USR_UID => 9, WebEntryPeer::WE_CREATE_DATE => 10, WebEntryPeer::WE_UPDATE_DATE => 11, WebEntryPeer::WE_TYPE => 12, WebEntryPeer::WE_CUSTOM_TITLE => 13, WebEntryPeer::WE_AUTHENTICATION => 14, WebEntryPeer::WE_HIDE_INFORMATION_BAR => 15, WebEntryPeer::WE_CALLBACK => 16, WebEntryPeer::WE_CALLBACK_URL => 17, WebEntryPeer::WE_LINK_GENERATION => 18, WebEntryPeer::WE_LINK_SKIN => 19, WebEntryPeer::WE_LINK_LANGUAGE => 20, WebEntryPeer::WE_LINK_DOMAIN => 21, WebEntryPeer::WE_SHOW_IN_NEW_CASE => 22, ),
BasePeer::TYPE_FIELDNAME => array ('WE_UID' => 0, 'PRO_UID' => 1, 'TAS_UID' => 2, 'DYN_UID' => 3, 'USR_UID' => 4, 'WE_METHOD' => 5, 'WE_INPUT_DOCUMENT_ACCESS' => 6, 'WE_DATA' => 7, 'WE_CREATE_USR_UID' => 8, 'WE_UPDATE_USR_UID' => 9, 'WE_CREATE_DATE' => 10, 'WE_UPDATE_DATE' => 11, 'WE_TYPE' => 12, 'WE_CUSTOM_TITLE' => 13, 'WE_AUTHENTICATION' => 14, 'WE_HIDE_INFORMATION_BAR' => 15, 'WE_CALLBACK' => 16, 'WE_CALLBACK_URL' => 17, 'WE_LINK_GENERATION' => 18, 'WE_LINK_SKIN' => 19, 'WE_LINK_LANGUAGE' => 20, 'WE_LINK_DOMAIN' => 21, 'WE_SHOW_IN_NEW_CASE' => 22, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, )
);
/**
@@ -219,6 +252,28 @@ abstract class BaseWebEntryPeer
$criteria->addSelectColumn(WebEntryPeer::WE_UPDATE_DATE);
$criteria->addSelectColumn(WebEntryPeer::WE_TYPE);
$criteria->addSelectColumn(WebEntryPeer::WE_CUSTOM_TITLE);
$criteria->addSelectColumn(WebEntryPeer::WE_AUTHENTICATION);
$criteria->addSelectColumn(WebEntryPeer::WE_HIDE_INFORMATION_BAR);
$criteria->addSelectColumn(WebEntryPeer::WE_CALLBACK);
$criteria->addSelectColumn(WebEntryPeer::WE_CALLBACK_URL);
$criteria->addSelectColumn(WebEntryPeer::WE_LINK_GENERATION);
$criteria->addSelectColumn(WebEntryPeer::WE_LINK_SKIN);
$criteria->addSelectColumn(WebEntryPeer::WE_LINK_LANGUAGE);
$criteria->addSelectColumn(WebEntryPeer::WE_LINK_DOMAIN);
$criteria->addSelectColumn(WebEntryPeer::WE_SHOW_IN_NEW_CASE);
}
const COUNT = 'COUNT(WEB_ENTRY.WE_UID)';
@@ -549,6 +604,18 @@ abstract class BaseWebEntryPeer
}
} else {
if ($obj->isNew() || $obj->isColumnModified(WebEntryPeer::WE_TYPE))
$columns[WebEntryPeer::WE_TYPE] = $obj->getWeType();
if ($obj->isNew() || $obj->isColumnModified(WebEntryPeer::WE_AUTHENTICATION))
$columns[WebEntryPeer::WE_AUTHENTICATION] = $obj->getWeAuthentication();
if ($obj->isNew() || $obj->isColumnModified(WebEntryPeer::WE_CALLBACK))
$columns[WebEntryPeer::WE_CALLBACK] = $obj->getWeCallback();
if ($obj->isNew() || $obj->isColumnModified(WebEntryPeer::WE_LINK_GENERATION))
$columns[WebEntryPeer::WE_LINK_GENERATION] = $obj->getWeLinkGeneration();
}
return BasePeer::doValidate(WebEntryPeer::DATABASE_NAME, WebEntryPeer::TABLE_NAME, $columns);

View File

@@ -3332,32 +3332,56 @@
<column name="PRF_UPDATE_DATE" type="TIMESTAMP" required="false" />
</table>
<table name="WEB_ENTRY">
<vendor type="mysql">
<parameter name="Name" value="WEB_ENTRY" />
<parameter name="Engine" value="InnoDB" />
<parameter name="Version" value="10" />
<parameter name="Row_format" value="Dynamic" />
<parameter name="Data_free" value="0" />
<parameter name="Auto_increment" value="" />
<parameter name="Check_time" value="" />
<parameter name="Collation" value="utf8_general_ci" />
<parameter name="Checksum" value="" />
<parameter name="Create_options" value="" />
</vendor>
<column name="WE_UID" type="VARCHAR" size="32" required="true" primaryKey="true" />
<column name="PRO_UID" type="VARCHAR" size="32" required="true" />
<column name="TAS_UID" type="VARCHAR" size="32" required="true" />
<column name="DYN_UID" type="VARCHAR" size="32" required="true" />
<column name="USR_UID" type="VARCHAR" size="32" default="" />
<column name="WE_METHOD" type="VARCHAR" size="4" default="HTML" />
<column name="WE_INPUT_DOCUMENT_ACCESS" type="INTEGER" default="0" />
<column name="WE_DATA" type="LONGVARCHAR" />
<column name="WE_CREATE_USR_UID" type="VARCHAR" size="32" default="" required="true" />
<column name="WE_UPDATE_USR_UID" type="VARCHAR" size="32" default="" />
<column name="WE_CREATE_DATE" type="TIMESTAMP" required="true" />
<column name="WE_UPDATE_DATE" type="TIMESTAMP" />
</table>
<table name="WEB_ENTRY">
<vendor type="mysql">
<parameter name="Name" value="WEB_ENTRY" />
<parameter name="Engine" value="InnoDB" />
<parameter name="Version" value="10" />
<parameter name="Row_format" value="Dynamic" />
<parameter name="Data_free" value="0" />
<parameter name="Auto_increment" value="" />
<parameter name="Check_time" value="" />
<parameter name="Collation" value="utf8_general_ci" />
<parameter name="Checksum" value="" />
<parameter name="Create_options" value="" />
</vendor>
<column name="WE_UID" type="VARCHAR" size="32" required="true" primaryKey="true" />
<column name="PRO_UID" type="VARCHAR" size="32" required="true" />
<column name="TAS_UID" type="VARCHAR" size="32" required="true" />
<column name="DYN_UID" type="VARCHAR" size="32" required="false" />
<column name="USR_UID" type="VARCHAR" size="32" required="false" />
<column name="WE_METHOD" type="VARCHAR" size="4" default="HTML" />
<column name="WE_INPUT_DOCUMENT_ACCESS" type="INTEGER" default="0" />
<column name="WE_DATA" type="LONGVARCHAR" />
<column name="WE_CREATE_USR_UID" type="VARCHAR" size="32" default="" required="true" />
<column name="WE_UPDATE_USR_UID" type="VARCHAR" size="32" default="" />
<column name="WE_CREATE_DATE" type="TIMESTAMP" required="true" />
<column name="WE_UPDATE_DATE" type="TIMESTAMP" />
<!-- PROD-181: Web Entry 2.0 -->
<column name="WE_TYPE" type="VARCHAR" size="8" required="true" default="SINGLE"/>
<column name="WE_CUSTOM_TITLE" type="LONGVARCHAR" />
<column name="WE_AUTHENTICATION" type="VARCHAR" size="14" required="true" default="ANONYMOUS"/>
<column name="WE_HIDE_INFORMATION_BAR" type="CHAR" size="1" default="1"/>
<column name="WE_CALLBACK" type="VARCHAR" size="13" required="true" default="PROCESSMAKER"/>
<column name="WE_CALLBACK_URL" type="LONGVARCHAR" />
<column name="WE_LINK_GENERATION" type="VARCHAR" size="8" required="true" default="DEFAULT" />
<column name="WE_LINK_SKIN" type="VARCHAR" size="255" />
<column name="WE_LINK_LANGUAGE" type="VARCHAR" size="255" />
<column name="WE_LINK_DOMAIN" type="LONGVARCHAR" />
<column name="WE_SHOW_IN_NEW_CASE" type="CHAR" size="1" default="1"/>
<validator column="WE_TYPE">
<rule name="validValues" value="SINGLE|MULTIPLE" message="Please enter a valid value for WE_TYPE" />
</validator>
<validator column="WE_AUTHENTICATION">
<rule name="validValues" value="ANONYMOUS|LOGIN_REQUIRED" message="Please enter a valid value for WE_AUTHENTICATION" />
</validator>
<validator column="WE_CALLBACK">
<rule name="validValues" value="PROCESSMAKER|CUSTOM|CUSTOM_CLEAR" message="Please enter a valid value for WE_CALLBACK" />
</validator>
<validator column="WE_LINK_GENERATION">
<rule name="validValues" value="DEFAULT|ADVANCED" message="Please enter a valid value for WE_LINK_GENERATION" />
</validator>
</table>
<!--
OAUTH TABLES DEFINITION
@@ -4795,8 +4819,8 @@
<column name="PRJ_UID" type="VARCHAR" size="32" required="true" />
<column name="EVN_UID" type="VARCHAR" size="32" required="true" />
<column name="ACT_UID" type="VARCHAR" size="32" required="true" />
<column name="DYN_UID" type="VARCHAR" size="32" required="true" />
<column name="USR_UID" type="VARCHAR" size="32" required="true" />
<column name="DYN_UID" type="VARCHAR" size="32" required="false" />
<column name="USR_UID" type="VARCHAR" size="32" required="false" />
<column name="WEE_STATUS" type="VARCHAR" size="10" required="true" default="ENABLED" />
<column name="WEE_WE_UID" type="VARCHAR" size="32" required="true" default="" />
<column name="WEE_WE_TAS_UID" type="VARCHAR" size="32" required="true" default="" />

View File

@@ -15476,6 +15476,17 @@ msgstr "Add users"
msgid "Remove selected"
msgstr "Remove selected"
# TRANSLATION
# LABEL/ID_SELECT_DYNAFORM_USE_IN_CASE
#: LABEL/ID_SELECT_DYNAFORM_USE_IN_CASE
msgid "The \"dyn_uid\" parameter is required to configure a Web Entry of type \"Single Dynaform\""
msgstr "The \"dyn_uid\" parameter is required to configure a Web Entry of type \"Single Dynaform\""
# LABEL/ID_ENTER_VALID_URL
#: LABEL/ID_ENTER_VALID_URL
msgid "Enter a valid URL to redirect the browser after the web entry is completed"
msgstr "Enter a valid URL to redirect the browser after the web entry is completed"
# TRANSLATION
# LABEL/ID_EVENT_ADD_DYNAVAR
#: LABEL/ID_EVENT_ADD_DYNAVAR
@@ -17879,14 +17890,14 @@ msgstr "Sending a test mail to: {0}"
# TRANSLATION
# LABEL/ID_EVENT_NOT_IS_START_EVENT
#: LABEL/ID_EVENT_NOT_IS_START_EVENT
msgid "The event with {0}: {1} not is \"Start Event\"."
msgstr "The event with {0}: {1} not is \"Start Event\"."
msgid "The event with {0}: {1} is not a \"Start Event\"."
msgstr "The event with {0}: {1} is not a \"Start Event\"."
# TRANSLATION
# LABEL/ID_WEB_ENTRY_EVENT_DOES_NOT_IS_REGISTERED
#: LABEL/ID_WEB_ENTRY_EVENT_DOES_NOT_IS_REGISTERED
msgid "The event with {0}: {1} does not is registered."
msgstr "The event with {0}: {1} does not is registered."
msgid "The event with {0}: {1} is not registered."
msgstr "The event with {0}: {1} is not registered."
# TRANSLATION
# LABEL/ID_WEB_ENTRY_EVENT_TITLE_ALREADY_EXISTS
@@ -27828,6 +27839,18 @@ msgstr "View Response"
msgid "Error Message"
msgstr "Error Message"
# TRANSLATION
# LABEL/ID_CASE_CREATED
#: LABEL/ID_CASE_CREATED
msgid "Case created"
msgstr "Case created"
# TRANSLATION
# LABEL/ID_CASE_ROUTED_TO
#: LABEL/ID_CASE_ROUTED_TO
msgid "Case routed to"
msgstr "Case routed to"
# additionalTables/additionalTablesData.xml?ADD_TAB_NAME
# additionalTables/additionalTablesData.xml
#: text - ADD_TAB_NAME

View File

@@ -4074,7 +4074,9 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_SMTP_ERROR_MET_TURN_SMTP_NOT_IMPLEMENTED','en','The method TURN of the SMTP is not implemented','2014-10-21') ,
( 'LABEL','ID_EVENT_ADD_CURRENT','en','Add current task user','2014-02-12') ,
( 'LABEL','ID_EVENT_ADD_USERS','en','Add users','2014-02-12') ,
( 'LABEL','ID_EVENT_REMOVE_SELECTED','en','Remove selected','2014-02-12') ;
( 'LABEL','ID_SELECT_DYNAFORM_USE_IN_CASE','en','The "dyn_uid" parameter is required to configure a Web Entry of type "Single Dynaform"','2017-07-05') ,
( 'LABEL','ID_EVENT_REMOVE_SELECTED','en','Remove selected','2014-02-12') ,
( 'LABEL','ID_ENTER_VALID_URL','en','Enter a valid URL to redirect the browser after the web entry is completed','2017-07-04') ;
INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ) VALUES
( 'LABEL','ID_EVENT_ADD_DYNAVAR','en','Add dynavar','2014-02-12') ,
@@ -4487,8 +4489,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_EMAIL_SERVER_TEST_CONNECTION_SENDING_EMAIL','en','Sending a test mail to: {0}','2014-12-24') ;
INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ) VALUES
( 'LABEL','ID_EVENT_NOT_IS_START_EVENT','en','The event with {0}: {1} not is "Start Event".','2015-01-13') ,
( 'LABEL','ID_WEB_ENTRY_EVENT_DOES_NOT_IS_REGISTERED','en','The event with {0}: {1} does not is registered.','2015-01-16') ,
( 'LABEL','ID_EVENT_NOT_IS_START_EVENT','en','The event with {0}: {1} is not a "Start Event".','2015-01-13') ,
( 'LABEL','ID_WEB_ENTRY_EVENT_DOES_NOT_IS_REGISTERED','en','The event with {0}: {1} is not registered.','2015-01-16') ,
( 'LABEL','ID_WEB_ENTRY_EVENT_TITLE_ALREADY_EXISTS','en','The WebEntry-Event title with {0}: "{1}" already exists.','2015-01-16') ,
( 'LABEL','ID_CASE_STOPPED_TRIGGER','en','The case has not stopped due to its trigger.','2015-01-29') ,
( 'LABEL','ID_TRANSLATION_NOT_WRITEABLE','en','The translation file is not writable. <br/>Please give write permission to file:','2015-01-31') ,
@@ -6178,7 +6180,9 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_CASE_NUMBER_CAPITALIZED','en','Case Number','2017-02-22') ,
( 'LABEL','ID_ANSWERED','en','Answered','2017-02-22') ,
( 'LABEL','ID_VIEW_RESPONSE','en','View Response','2017-02-22') ,
( 'LABEL','ID_ERROR_MESSAGE','en','Error Message','2017-02-22') ;
( 'LABEL','ID_ERROR_MESSAGE','en','Error Message','2017-02-22') ,
( 'LABEL','ID_CASE_CREATED','en','Case created','2017-06-02') ,
( 'LABEL','ID_CASE_ROUTED_TO','en','Case routed to','2017-06-02');
INSERT INTO ISO_LOCATION (IC_UID,IL_UID,IL_NAME,IL_NORMAL_NAME,IS_UID) VALUES
('AD','','',' ','') ,

View File

@@ -1659,8 +1659,8 @@ CREATE TABLE `WEB_ENTRY`
`WE_UID` VARCHAR(32) NOT NULL,
`PRO_UID` VARCHAR(32) NOT NULL,
`TAS_UID` VARCHAR(32) NOT NULL,
`DYN_UID` VARCHAR(32) NOT NULL,
`USR_UID` VARCHAR(32) default '',
`DYN_UID` VARCHAR(32),
`USR_UID` VARCHAR(32),
`WE_METHOD` VARCHAR(4) default 'HTML',
`WE_INPUT_DOCUMENT_ACCESS` INTEGER default 0,
`WE_DATA` MEDIUMTEXT,
@@ -1668,6 +1668,17 @@ CREATE TABLE `WEB_ENTRY`
`WE_UPDATE_USR_UID` VARCHAR(32) default '',
`WE_CREATE_DATE` DATETIME NOT NULL,
`WE_UPDATE_DATE` DATETIME,
`WE_TYPE` VARCHAR(8) default 'SINGLE' NOT NULL,
`WE_CUSTOM_TITLE` MEDIUMTEXT,
`WE_AUTHENTICATION` VARCHAR(14) default 'ANONYMOUS' NOT NULL,
`WE_HIDE_INFORMATION_BAR` CHAR(1) default '1',
`WE_CALLBACK` VARCHAR(13) default 'PROCESSMAKER' NOT NULL,
`WE_CALLBACK_URL` MEDIUMTEXT,
`WE_LINK_GENERATION` VARCHAR(8) default 'DEFAULT' NOT NULL,
`WE_LINK_SKIN` VARCHAR(255),
`WE_LINK_LANGUAGE` VARCHAR(255),
`WE_LINK_DOMAIN` MEDIUMTEXT,
`WE_SHOW_IN_NEW_CASE` CHAR(1) default '1',
PRIMARY KEY (`WE_UID`)
)ENGINE=InnoDB DEFAULT CHARSET='utf8';
#-----------------------------------------------------------------------------
@@ -2731,8 +2742,8 @@ CREATE TABLE `WEB_ENTRY_EVENT`
`PRJ_UID` VARCHAR(32) NOT NULL,
`EVN_UID` VARCHAR(32) NOT NULL,
`ACT_UID` VARCHAR(32) NOT NULL,
`DYN_UID` VARCHAR(32) NOT NULL,
`USR_UID` VARCHAR(32) NOT NULL,
`DYN_UID` VARCHAR(32),
`USR_UID` VARCHAR(32),
`WEE_STATUS` VARCHAR(10) default 'ENABLED' NOT NULL,
`WEE_WE_UID` VARCHAR(32) default '' NOT NULL,
`WEE_WE_TAS_UID` VARCHAR(32) default '' NOT NULL,

View File

@@ -157,6 +157,7 @@ $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$oCase = new Cases();
$oStep = new Step();
$bmWebEntry = new \ProcessMaker\BusinessModel\WebEntry;
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
@@ -291,6 +292,9 @@ try {
if (isset( $oProcessFieds['PRO_SHOW_MESSAGE'] )) {
$noShowTitle = $oProcessFieds['PRO_SHOW_MESSAGE'];
}
if ($bmWebEntry->isTaskAWebEntry($_SESSION['TASK'])) {
$noShowTitle = 1;
}
switch ($_GET['TYPE']) {
case 'DYNAFORM':
@@ -1097,6 +1101,27 @@ try {
$aFields["TASK"][$sKey]["NEXT_TASK"]["TAS_TITLE"] = G::LoadTranslation("ID_ROUTE_TO_TASK_INTERMEDIATE_CATCH_MESSAGE_EVENT");
}
//SKIP ASSIGN SCREEN
if (!empty($aFields['TASK'][1])) {
$currentTask = $aFields['TASK'][1];
$isWebEntry = $bmWebEntry->isTaskAWebEntry($currentTask['TAS_UID']);
if ($isWebEntry) {
$tplFile = 'webentry/cases_ScreenDerivation';
$caseId = $currentTask['APP_UID'];
$delIndex = $currentTask['DEL_INDEX'];
$derivationResponse = PMFDerivateCase($caseId, $delIndex, true);
if ($derivationResponse) {
$webEntryUrl = $bmWebEntry->getCallbackUrlByTask($currentTask['TAS_UID']);
$delegationData = $Fields['APP_DATA'];
$delegationData['_DELEGATION_DATA'] = $aFields['TASK'];
$delegationData['_DELEGATION_MESSAGE'] = $bmWebEntry->getDelegationMessage($delegationData);
$webEntryUrlEvaluated = \G::replaceDataField($webEntryUrl, $delegationData);
}
$aFields['derivationResponse'] = $derivationResponse;
$aFields['webEntryUrlEvaluated'] = $webEntryUrlEvaluated;
}
}
$G_PUBLISH->AddContent( 'smarty', $tplFile, '', '', $aFields );
/*
if (isset( $aFields['TASK'][1]['NEXT_TASK']['USER_ASSIGNED'])){

View File

@@ -0,0 +1,44 @@
<?php
/**
* This service is to start PM with the anonymous user.
*/
/* @var $RBAC RBAC */
global $RBAC;
G::LoadClass('pmFunctions');
try {
if (empty($_REQUEST['we_uid'])) {
throw new \Exception('Missing required field "we_uid"');
}
$weUid = $_REQUEST['we_uid'];
$webEntry = \WebEntryPeer::retrieveByPK($weUid);
if (empty($webEntry)) {
throw new \Exception('Undefined WebEntry');
}
$userUid = $webEntry->getUsrUid();
$userInfo = PMFInformationUser($userUid);
if (empty($userInfo)) {
throw new \Exception('WebEntry User not found');
}
$_SESSION['USER_LOGGED'] = $userUid;
$_SESSION['USR_USERNAME'] = $userInfo['username'];
$result = [
'user_logged' => $userUid,
'userName' => $userInfo['username'],
'firstName' => $userInfo['firstname'],
'lastName' => $userInfo['lastname'],
'mail' => $userInfo['mail'],
'image' => '../users/users_ViewPhoto?t='.microtime(true),
];
} catch (\Exception $e) {
$result = [
'error' => $e->getMessage(),
];
http_response_code(500);
}
echo G::json_encode($result);

View File

@@ -0,0 +1,35 @@
<?php
/**
* This service verify if the provided APP_UID and DEL_INDEX could be used
* for the web entry.
*/
/* @var $RBAC RBAC */
global $RBAC;
G::LoadClass('pmFunctions');
try {
if (empty($_REQUEST['app_uid'])) {
throw new \Exception('Missing required field "app_uid"');
}
if (empty($_REQUEST['del_index'])) {
throw new \Exception('Missing required field "del_index"');
}
if (empty($_SESSION['USER_LOGGED'])) {
throw new \Exception('You are not logged');
}
$appUid = $_REQUEST['app_uid'];
$delIndex = $_REQUEST['del_index'];
$delegation = \AppDelegationPeer::retrieveByPK($appUid, $delIndex);
$check = $delegation->getDelThreadStatus() === 'OPEN' &&
$delegation->getUsrUid() === $_SESSION['USER_LOGGED'];
$result = ["check" => $check];
} catch (\Exception $e) {
$result = [
'error' => $e->getMessage(),
];
http_response_code(500);
}
echo G::json_encode($result);

View File

@@ -0,0 +1,18 @@
<?php
/**
* This page displays a message when completed or if there is an error
* during the execution.
*/
$G_PUBLISH = new Publisher();
$show = "login/showMessage";
$message = [];
if (isset($_GET["message"])) {
$show = "login/showInfo";
$message['MESSAGE'] = nl2br($_GET["message"]);
} elseif (isset($_GET["error"])) {
$show = "login/showMessage";
$message['MESSAGE'] = $_GET["error"];
}
$G_PUBLISH->AddContent("xmlform", "xmlform", $show, "", $message);
G::RenderPage("publish", "blank");

View File

@@ -0,0 +1,501 @@
<?php
/**
* This page is the WebEntry Access Point.
*/
if (empty($weUid)) {
http_response_code(403);
return;
}
$conf = new Configurations();
$configuration = $conf->getConfiguration(
"ENVIRONMENT_SETTINGS",
"",
"",
"",
"",
$outResult
);
$userInformationFormat = isset($outResult['format']) ? $outResult['format'] :
'@lastName, @firstName (@userName)';
$webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
?>
<html>
<head>
<link rel="stylesheet" href="/lib/pmdynaform/libs/bootstrap-3.1.1/css/bootstrap.min.css">
<title><?php echo htmlentities($webEntryModel->getWeCustomTitle()); ?></title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<?php
$oHeadPublisher = & headPublisher::getSingleton();
echo $oHeadPublisher->getExtJsStylesheets(SYS_SKIN);
?>
<style>
html, body, iframe {
border:none;
width: 100%;
top:0px;
height:100%;
margin: 0px;
padding: 0px;
}
iframe {
position: absolute;
border:none;
width: 100%;
top:60px;
bottom:0px;
margin: 0px;
padding: 0px;
}
.header {
height: 60px;
}
.without-header .header {
display:none;
}
.without-header #iframe {
top:0px;
}
#avatar {
background-color: buttonface;
width: 48px;
height: 48px;
border-radius: 50%;
border: 1px solid black;
margin-left: 8px;
margin-top: 4px;
display: inline-block;
position: absolute;
}
#userInformation {
display: inline-block;
margin-top: 20px;
position: absolute;
margin-left: 64px;
}
#logout {
margin-top: 20px;
position: absolute;
margin-left: 64px;
right: 8px;
}
#messageBox{
position: absolute;
left: 50%;
margin-left: -260px;
top: 96px;
}
</style>
</head>
<body class="without-header">
<div class="header">
<img id="avatar">
<span class="logout"><a href="javascript:void(1)" id="userInformation"></a></span>
<span class="logout"><a href="javascript:logout(1)" id="logout"><?php echo G::LoadTranslation('ID_LOGOUT'); ?></a></span>
</div>
<iframe id="iframe"></iframe>
<form id="messageBox" class="formDefault formWE" method="post" style="display: none;">
<div class="borderForm" style="width:520px; padding-left:0; padding-right:0; border-width:1px;">
<div class="boxTop"><div class="a">&nbsp;</div><div class="b">&nbsp;</div><div class="c">&nbsp;</div></div>
<div class="content" style="height:100%;">
<table width="99%">
<tbody><tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tbody><tr>
<td class="FormTitle" colspan="2" align=""><span id="form[TITLE]" name="form[TITLE]" pmfieldtype="title"><?php echo G::LoadTranslation('ID_ERROR'); ?></span></td>
</tr>
<tr>
<td class="FormLabel" width="0"><label for="form[MESSAGE]"></label></td>
<td class="FormFieldContent" width="520"><span id="errorMessage"></span></td>
</tr>
<tr id="messageBoxReset" style="display:none;">
<td class="FormLabel" width="0"></td>
<td class="FormFieldContent" width="520" style="text-align: right;"><button type="button" onclick="resetLocalData(true)"><?php echo G::LoadTranslation('ID_RESET'); ?></button></td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</div>
<div class="boxBottom"><div class="a">&nbsp;</div><div class="b">&nbsp;</div><div class="c">&nbsp;</div></div>
</div>
</form>
<script src="/lib/js/jquery-1.10.2.min.js"></script>
<script>
var weData = {};
var resetLocalData = function (reload) {
localStorage.removeItem('weData');
weData={};
if (reload) {
location.reload();
}
};
var app = {
$element:{
avatar: $("#avatar").get(0),
userInformation: $("#userInformation").get(0),
errorMessage: $("#errorMessage").get(0)
},
setAvatar:function(src){
this.$element.avatar.src=src;
},
getAvatar:function(){
return this.$avatar.src;
},
setUserInformation:function(textContent){
this.$element.userInformation.textContent=textContent;
},
getUserInformation:function(){
return this.$element.userInformation.textContent;
},
loadUserInformation:function(userInformation) {
var format = <?php echo G::json_encode($userInformationFormat); ?>;
this.setAvatar(userInformation.image);
for(var key in userInformation) {
format = format.replace("@"+key, userInformation[key]);
};
this.setUserInformation(format);
},
setErrorMessage:function(textContent){
this.$element.errorMessage.textContent=textContent;
},
getErrorMessage:function(){
return this.$element.errorMessage.textContent;
}
};
function logout(reload, callback) {
$.ajax({
url: '../login/login',
success: function () {
if (typeof callback==='function') {
callback();
}
if (reload) {
resetLocalData();
location.reload();
}
}
});
}
</script>
<script>
!function () {
var DEBUG_ENABLED = false;
var processUid = <?php echo G::json_encode($webEntryModel->getProUid()); ?>;
var tasUid = <?php echo G::json_encode($webEntryModel->getTasUid()); ?>;
var weUid = <?php echo G::json_encode($webEntryModel->getWeUid()); ?>;
var forceLogin = <?php echo G::json_encode($webEntryModel->getWeAuthentication()==='LOGIN_REQUIRED'); ?>;
var isLogged = <?php echo G::json_encode(!empty($_SESSION['USER_LOGGED'])); ?>;
var closeSession = <?php echo G::json_encode($webEntryModel->getWeCallback()==='CUSTOM_CLEAR'); ?>;
var hideInformationBar = <?php echo G::json_encode(!!$webEntryModel->getWeHideInformationBar()); ?>;
if (!forceLogin) {
$("#logout").hide();
}
var onLoadIframe = function () {};
var error = function(msg, showResetButton) {
app.setErrorMessage(msg);
if (showResetButton) {
$('#messageBoxReset').show();
} else {
$('#messageBoxReset').hide();
}
$('#messageBox').show();
};
var log = function() {
if (DEBUG_ENABLED) {
console.log.apply(console, arguments);
}
};
if (localStorage.weData) {
try {
weData = JSON.parse(localStorage.weData);
if (weData.TAS_UID!==tasUid || !weData.APPLICATION || !weData.INDEX) {
//TAS_UID is different, reset.
resetLocalData();
}
} catch (e) {
//corrupt weData, reset.
resetLocalData();
}
}
$("#iframe").load(function (event) {
onLoadIframe(event);
});
var getContentDocument = function (iframe) {
return (iframe.contentDocument) ?
iframe.contentDocument :
iframe.contentWindow.document;
};
var open = function (url, callback) {
return new Promise(function (resolve, reject) {
var iframe = document.getElementById("iframe");
if (typeof callback === 'function') {
iframe.style.opacity = 0;
onLoadIframe = (function () {
return function (event) {
if (callback(event, resolve, reject)) {
iframe.style.opacity = 1;
}
};
})();
} else {
iframe.style.opacity = 1;
onLoadIframe = function () {};
}
//This code is to prevent error at back history
//in Firefox
setTimeout(function(){iframe.src = url;}, 0);
window.fullfill = function () {
resolve.apply(this, arguments);
};
window.reject = function () {
reject(this, arguments);
};
});
};
var verifyLogin = function () {
if (forceLogin) {
return login();
} else {
return anonymousLogin();
}
};
var login = function () {
return new Promise(function (logged, failure) {
if (!isLogged) {
log("login");
open('../login/login?inIFrame=1&u=' + encodeURIComponent(location.pathname + '/../../webentry/logged'))
.then(function (userInformation) {
logged(userInformation);
})
.catch(function () {
failure();
});
} else {
log("logged");
open('../webentry/logged')
.then(function (userInformation) {
logged(userInformation);
})
.catch(function () {
failure();
});
}
});
};
var anonymousLogin = function () {
return new Promise(function (resolve, failure) {
log("anonymousLogin");
$.ajax({
url: '../services/webentry/anonymousLogin',
method: 'get',
dataType: 'json',
data: {
we_uid: weUid
},
success: function (userInformation) {
resolve(userInformation);
},
error: function (data) {
failure(data);
}
});
});
};
var loadUserInformation = function (userInformation) {
return new Promise(function (resolve, reject) {
log("userInformation:", userInformation);
app.loadUserInformation(userInformation);
resolve();
});
};
var checkWebEntryCase = function (userInformation) {
return new Promise(function (resolve, reject) {
if (localStorage.weData) {
log("checkWebEntryCase");
$.ajax({
url: '../services/webentry/checkCase',
method: 'post',
dataType: 'json',
data: {
app_uid: weData.APPLICATION,
del_index: weData.INDEX
},
success: function (data) {
log("check:", data);
if (!data.check) {
resetLocalData();
}
resolve();
},
error: function () {
resetLocalData();
resolve();
}
});
} else {
resolve();
}
});
};
var initCase = function () {
return new Promise(function (resolve, reject) {
if (!hideInformationBar) {
$("body").removeClass("without-header");
}
if (!localStorage.weData) {
log("initCase");
$.ajax({
url: '../cases/casesStartPage_Ajax',
method: 'post',
dataType: 'json',
data: {
action: 'startCase',
processId: processUid,
taskId: tasUid
},
success: function (data) {
data.TAS_UID = tasUid;
localStorage.weData = JSON.stringify(data);
resolve(data);
},
error: function () {
reject();
}
});
} else {
log("openCase");
resolve(weData);
}
});
};
var casesStep = function (data) {
return new Promise(function (resolve, reject) {
log("casesStep");
open(
'../cases/cases_Open?APP_UID=' + encodeURIComponent(data.APPLICATION) +
'&DEL_INDEX=' + encodeURIComponent(data.INDEX) +
'&action=draft',
function (event, resolve, reject) {
var contentDocument = getContentDocument(event.target);
var stepTitle = contentDocument.getElementsByTagName("title");
if (!stepTitle || !stepTitle.length || stepTitle[0].textContent === 'Runtime Exception.') {
if (contentDocument.location.search.match(/&POSITION=10000&/)) {
//Catch error if webentry was deleted.
reject();
return false;
}
}
return true;
}
).then(function (callbackUrl) {
resolve(callbackUrl);
})
.catch(function () {
reject();
});
});
};
var routeWebEntry = function (callbackUrl) {
return new Promise(function (resolve, reject) {
log("routeWebEntry", callbackUrl);
resolve(callbackUrl);
});
};
var closeWebEntry = function (callbackUrl) {
return new Promise(function (resolve, reject) {
log("closeWebEntry");
resetLocalData();
if (closeSession) {
//This code is to prevent error at back history
//in Firefox
$("#iframe").hide();
$("#iframe").attr("src", "../login/login?inIFrame=1");
logout(false, function() {
resolve(callbackUrl);
});
} else {
//This code is to prevent error at back history
//in Firefox
open("../webentry/logged", function() {
resolve(callbackUrl);
});
}
});
};
var redirectCallback = function (callbackUrl) {
return new Promise(function (resolve, reject) {
log("redirect: "+callbackUrl);
location.href = callbackUrl;
resolve();
});
};
//Errors
var errorLogin = function () {
return new Promise(function (resolve, reject) {
log("errorLogin");
var msg = <?php echo G::json_encode(G::LoadTranslation('ID_EXCEPTION_LOG_INTERFAZ')); ?>;
msg = msg.replace("{0}", "LOGIN");
error(msg);
resetLocalData();
});
};
var errorLoadUserInfo = function () {
return new Promise(function (resolve, reject) {
log("errorLoadUserInfo");
var msg = <?php echo G::json_encode(G::LoadTranslation('ID_EXCEPTION_LOG_INTERFAZ')); ?>;
msg = msg.replace("{0}", "USR001");
error(msg);
resetLocalData();
});
};
var errorCheckWebEntry = function () {
return new Promise(function (resolve, reject) {
log("errorCheckWebEntry");
var msg = <?php echo G::json_encode(G::LoadTranslation('ID_EXCEPTION_LOG_INTERFAZ')); ?>;
msg = msg.replace("{0}", "WEE001");
error(msg);
resetLocalData();
});
};
var errorInitCase = function () {
return new Promise(function (resolve, reject) {
log("error Init case");
var msg = <?php echo G::json_encode(G::LoadTranslation('ID_EXCEPTION_LOG_INTERFAZ')); ?>;
msg = msg.replace("{0}", "INIT001");
error(msg);
resetLocalData();
});
};
var errorStep = function () {
return new Promise(function (resolve, reject) {
log("Step Error");
var msg = <?php echo G::json_encode(G::LoadTranslation('ID_EXCEPTION_LOG_INTERFAZ')); ?>;
msg = msg.replace("{0}", "STEP001");
error(msg);
resetLocalData();
});
};
var errorRouting = function () {
return new Promise(function (resolve, reject) {
log("errorRouting");
var msg = <?php echo G::json_encode(G::LoadTranslation('ID_EXCEPTION_LOG_INTERFAZ')); ?>;
msg = msg.replace("{0}", "ROU001");
error(msg);
resetLocalData();
});
};
//Execute WebEntry Flow
verifyLogin().catch(errorLogin)
.then(loadUserInformation).catch(errorLoadUserInfo)
.then(checkWebEntryCase).catch(errorCheckWebEntry)
.then(initCase).catch(errorInitCase)
.then(casesStep).catch(errorStep)
.then(routeWebEntry).catch(errorRouting)
.then(closeWebEntry)
.then(redirectCallback);
}();
</script>
</body>
</html>

View File

@@ -0,0 +1,23 @@
<html>
<head>
<script>
<?php
/**
* This page is redirected from the login page.
*/
G::LoadClass('pmFunctions');
$userUid = $_SESSION['USER_LOGGED'];
$userInfo = PMFInformationUser($userUid);
$result = [
'user_logged' => $userUid,
'userName' => $userInfo['username'],
'firstName' => $userInfo['firstname'],
'lastName' => $userInfo['lastname'],
'mail' => $userInfo['mail'],
'image' => '../users/users_ViewPhoto?t='.microtime(true),
];
?>
parent.fullfill(<?= G::json_encode($result) ?>);
</script>
</head>
</html>

View File

@@ -0,0 +1,43 @@
<?php
namespace ProcessMaker\BusinessModel;
use Translation;
/**
* Translation class
*
*/
class Language
{
/**
* Web Entry 2.0 Rest - Get languages
*
* @category HOR-3209,PROD-181
* @return array
*/
public function getLanguageList()
{
$Translations = new Translation();
$translationsTable = $Translations->getTranslationEnvironments();
$availableLangArray = [];
foreach ($translationsTable as $locale) {
$row = [];
$row['LANG_ID'] = $locale['LOCALE'];
if ($locale['COUNTRY'] != '.') {
$row['LANG_NAME'] = $locale['LANGUAGE'].' ('.
(ucwords(strtolower($locale['COUNTRY']))).')';
} else {
$row['LANG_NAME'] = $locale['LANGUAGE'];
}
$availableLangArray [] = $row;
}
return $availableLangArray;
}
}

View File

@@ -0,0 +1,181 @@
<?php
namespace ProcessMaker\BusinessModel;
use System;
use Exception;
use G;
/**
* Skins business model
*/
class Skins
{
/**
* Get a list of skins.
*
* @category HOR-3208,PROD-181
* @return array
*/
public function getSkins()
{
$list = System::getSkingList();
return $list['skins'];
}
/**
* Create a new skin.
*
* @param string $skinName
* @param string $skinFolder
* @param string $skinDescription
* @param string $skinAuthor
* @param string $skinWorkspace
* @param string $skinBase
* @return array
* @throws Exception
*/
public function createSkin(
$skinName,
$skinFolder,
$skinDescription = '',
$skinAuthor = 'ProcessMaker Team',
$skinWorkspace = 'global',
$skinBase = 'neoclassic'
) {
try {
if (!(isset($skinName))) {
throw (new Exception(G::LoadTranslation('ID_SKIN_NAME_REQUIRED')));
}
if (!(isset($skinFolder))) {
throw (new Exception(G::LoadTranslation('ID_SKIN_FOLDER_REQUIRED')));
}
if (is_dir(PATH_CUSTOM_SKINS.$skinFolder)) {
throw (new Exception(G::LoadTranslation('ID_SKIN_ALREADY_EXISTS')));
}
if (strtolower($skinFolder) == 'classic') {
throw (new Exception(G::LoadTranslation('ID_SKIN_ALREADY_EXISTS')));
}
//All validations OK then create skin
switch ($skinBase) {
//Validate skin base
case 'uxmodern':
$this->copySkinFolder(G::ExpandPath("skinEngine").'uxmodern'.PATH_SEP,
PATH_CUSTOM_SKINS.$skinFolder,
array("config.xml"
));
$pathBase = G::ExpandPath("skinEngine").'base'.PATH_SEP;
break;
case 'classic':
//Special Copy of this dir + xmlreplace
$this->copySkinFolder(G::ExpandPath("skinEngine").'base'.PATH_SEP,
PATH_CUSTOM_SKINS.$skinFolder,
array("config.xml", "baseCss"
));
$pathBase = G::ExpandPath("skinEngine").'base'.PATH_SEP;
break;
case 'neoclassic':
//Special Copy of this dir + xmlreplace
$this->copySkinFolder(G::ExpandPath("skinEngine").'neoclassic'.PATH_SEP,
PATH_CUSTOM_SKINS.$skinFolder,
array("config.xml", "baseCss"
));
$pathBase = G::ExpandPath("skinEngine").'neoclassic'.PATH_SEP;
break;
default:
//Commmon copy/paste of a folder + xmlrepalce
$this->copySkinFolder(PATH_CUSTOM_SKINS.$skinBase,
PATH_CUSTOM_SKINS.$skinFolder,
array("config.xml"
));
$pathBase = PATH_CUSTOM_SKINS.$skinBase.PATH_SEP;
break;
}
//@todo Improve this pre_replace lines
$configFileOriginal = $pathBase."config.xml";
$configFileFinal = PATH_CUSTOM_SKINS.$skinFolder.PATH_SEP.'config.xml';
$xmlConfiguration = file_get_contents($configFileOriginal);
$workspace = ($skinWorkspace == 'global') ? '' : SYS_SYS;
$xmlConfigurationObj = G::xmlParser($xmlConfiguration);
$skinInformationArray = $xmlConfigurationObj->result["skinConfiguration"]["__CONTENT__"]["information"]["__CONTENT__"];
$xmlConfiguration = preg_replace('/(<id>)(.+?)(<\/id>)/i',
'<id>'.G::generateUniqueID().'</id><!-- $2 -->',
$xmlConfiguration);
if (isset($skinInformationArray["workspace"]["__VALUE__"])) {
$workspace = ($workspace != "" && !empty($skinInformationArray["workspace"]["__VALUE__"]))
? $skinInformationArray["workspace"]["__VALUE__"]."|".$workspace
: $workspace;
$xmlConfiguration = preg_replace("/(<workspace>)(.*)(<\/workspace>)/i",
"<workspace>".$workspace."</workspace><!-- $2 -->",
$xmlConfiguration);
$xmlConfiguration = preg_replace("/(<name>)(.*)(<\/name>)/i",
"<name>".$skinName."</name><!-- $2 -->",
$xmlConfiguration);
} else {
$xmlConfiguration = preg_replace("/(<name>)(.*)(<\/name>)/i",
"<name>".$skinName."</name><!-- $2 -->\n<workspace>".$workspace."</workspace>",
$xmlConfiguration);
}
$xmlConfiguration = preg_replace("/(<description>)(.+?)(<\/description>)/i",
"<description>".$skinDescription."</description><!-- $2 -->",
$xmlConfiguration);
$xmlConfiguration = preg_replace("/(<author>)(.+?)(<\/author>)/i",
"<author>".$skinAuthor."</author><!-- $2 -->",
$xmlConfiguration);
$xmlConfiguration = preg_replace("/(<createDate>)(.+?)(<\/createDate>)/i",
"<createDate>".date("Y-m-d H:i:s")."</createDate><!-- $2 -->",
$xmlConfiguration);
$xmlConfiguration = preg_replace("/(<modifiedDate>)(.+?)(<\/modifiedDate>)/i",
"<modifiedDate>".date("Y-m-d H:i:s")."</modifiedDate><!-- $2 -->",
$xmlConfiguration);
file_put_contents($configFileFinal, $xmlConfiguration);
$response['success'] = true;
$response['message'] = G::LoadTranslation('ID_SKIN_SUCCESS_CREATE');
G::auditLog("CreateSkin", "Skin Name: ".$skinName);
return $response;
} catch (Exception $e) {
$response['success'] = false;
$response['message'] = $e->getMessage();
$response['error'] = $e->getMessage();
return $response;
}
}
private function copySkinFolder($path, $dest, $exclude = array())
{
$defaultExcluded = array(".", "..");
$excludedItems = array_merge($defaultExcluded, $exclude);
if (is_dir($path)) {
mkdir($dest);
$objects = scandir($path);
if (sizeof($objects) > 0) {
foreach ($objects as $file) {
if (in_array($file, $excludedItems)) {
continue;
}
if (is_dir($path.PATH_SEP.$file)) {
$this->copySkinFolder($path.PATH_SEP.$file,
$dest.PATH_SEP.$file, $exclude);
} else {
copy($path.PATH_SEP.$file, $dest.PATH_SEP.$file);
}
}
}
return true;
} elseif (is_file($path)) {
return copy($path, $dest);
} else {
return false;
}
}
}

View File

@@ -7,8 +7,8 @@ class WebEntry
"WE_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "webEntryUid"),
"TAS_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "taskUid"),
"DYN_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "dynaFormUid"),
"USR_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "userUid"),
"DYN_UID" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "dynaFormUid"),
"USR_UID" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "userUid"),
"WE_TITLE" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "webEntryTitle"),
"WE_DESCRIPTION" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "webEntryDescription"),
"WE_METHOD" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array("WS", "HTML"), "fieldNameAux" => "webEntryMethod"),
@@ -16,7 +16,7 @@ class WebEntry
);
private $arrayUserFieldDefinition = array(
"USR_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "userUid")
"USR_UID" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "userUid")
);
private $formatFieldNameInUppercase = true;
@@ -269,13 +269,13 @@ class WebEntry
$task->throwExceptionIfNotExistsTask($processUid, $arrayData["TAS_UID"], $this->arrayFieldNameForException["taskUid"]);
}
if (isset($arrayData["DYN_UID"])) {
if (!empty($arrayData["DYN_UID"])) {
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
$dynaForm->throwExceptionIfNotExistsDynaForm($arrayData["DYN_UID"], $processUid, $this->arrayFieldNameForException["dynaFormUid"]);
}
if ($arrayDataMain["WE_METHOD"] == "WS" && isset($arrayData["USR_UID"])) {
if ($arrayDataMain["WE_METHOD"] == "WS" && !empty($arrayData["USR_UID"])) {
$process->throwExceptionIfNotExistsUser($arrayData["USR_UID"], $this->arrayFieldNameForException["userUid"]);
}
@@ -293,7 +293,7 @@ class WebEntry
}
}
if ($arrayDataMain["WE_METHOD"] == "WS" && isset($arrayData["TAS_UID"])) {
if ($arrayDataMain["WE_METHOD"] == "WS" && isset($arrayData["TAS_UID"]) && (!isset($arrayData["WE_AUTHENTICATION"]) || $arrayData["WE_AUTHENTICATION"]!='LOGIN_REQUIRED')) {
$task = new \Tasks();
if ($task->assignUsertoTask($arrayData["TAS_UID"]) == 0) {
@@ -301,7 +301,7 @@ class WebEntry
}
}
if (isset($arrayData["DYN_UID"])) {
if (isset($arrayData["DYN_UID"]) && (!isset($arrayData["WE_TYPE"]) || $arrayData["WE_TYPE"]==='SINGLE')) {
$dynaForm = new \Dynaform();
$arrayDynaFormData = $dynaForm->Load($arrayData["DYN_UID"]);
@@ -313,7 +313,7 @@ class WebEntry
}
}
if ($arrayDataMain["WE_METHOD"] == "WS" && isset($arrayData["USR_UID"])) {
if ($arrayDataMain["WE_METHOD"] == "WS" && !empty($arrayData["USR_UID"])) {
$user = new \Users();
$arrayUserData = $user->load($arrayData["USR_UID"]);
@@ -321,9 +321,6 @@ class WebEntry
//Verify if User is assigned to Task
$projectUser = new \ProcessMaker\BusinessModel\ProjectUser();
if (!$projectUser->userIsAssignedToTask($arrayData["USR_UID"], $arrayDataMain["TAS_UID"])) {
throw new \Exception(\G::LoadTranslation("ID_USER_DOES_NOT_HAVE_ACTIVITY_ASSIGNED", array($arrayUserData["USR_USERNAME"], $arrayTaskData["TAS_TITLE"])));
}
}
} catch (\Exception $e) {
throw $e;
@@ -337,7 +334,7 @@ class WebEntry
*
* return void
*/
public function setWeData($webEntryUid)
protected function setWeData($webEntryUid, $arrayData)
{
try {
//Verify data
@@ -386,7 +383,9 @@ class WebEntry
$dynaForm = new \Dynaform();
$arrayDynaFormData = $dynaForm->Load($arrayWebEntryData["DYN_UID"]);
if (!empty($arrayWebEntryData["DYN_UID"])) {
$arrayDynaFormData = $dynaForm->Load($arrayWebEntryData["DYN_UID"]);
}
//Creating sys.info;
$sitePublicPath = "";
@@ -400,6 +399,12 @@ class WebEntry
$fileContent = "<?php\n\n";
$fileContent .= "global \$_DBArray;\n";
$fileContent .= '$webEntry = new ' . WebEntry::class . ";\n";
$fileContent .= "\$processUid = \"" . $processUid . "\";\n";
$fileContent .= "\$weUid = \"" . $arrayWebEntryData['WE_UID'] . "\";\n";
$fileContent .= 'if (!$webEntry->isWebEntryOne($weUid)) {'."\n";
$fileContent .= " return require(PATH_METHODS . 'webentry/access.php');\n";
$fileContent .= "}\n";
$fileContent .= "if (!isset(\$_DBArray)) {\n";
$fileContent .= " \$_DBArray = array();\n";
$fileContent .= "}\n";
@@ -407,7 +412,8 @@ class WebEntry
$fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n";
$fileContent .= "\$G_PUBLISH = new Publisher();\n";
$fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n";
$fileContent .= "G::LoadClass(\"pmDynaform\");\n";
$fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $dynaFormUid . "\"));\n";
$fileContent .= "if (\$a->isResponsive()) {\n";
$fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");\n";
$fileContent .= "} else {\n";
@@ -444,7 +450,7 @@ class WebEntry
$template->assign("USR_VAR", "\$USR_UID = -1;");
}
$template->assign("dynaform", $arrayDynaFormData["DYN_TITLE"]);
$template->assign("dynaform", empty($arrayDynaFormData) ? '' : $arrayDynaFormData["DYN_TITLE"]);
$template->assign("timestamp", date("l jS \of F Y h:i:s A"));
$template->assign("ws", $this->sysSys);
$template->assign("version", \PmSystem::getVersion());
@@ -551,15 +557,17 @@ class WebEntry
}
//Update
//Update where
$criteriaWhere = new \Criteria("workflow");
$criteriaWhere->add(\WebEntryPeer::WE_UID, $webEntryUid);
if (!isset($arrayData['WE_LINK_GENERATION']) || $arrayData['WE_LINK_GENERATION']==='DEFAULT') {
//Update where
$criteriaWhere = new \Criteria("workflow");
$criteriaWhere->add(\WebEntryPeer::WE_UID, $webEntryUid);
//Update set
$criteriaSet = new \Criteria("workflow");
$criteriaSet->add(\WebEntryPeer::WE_DATA, $webEntryData);
//Update set
$criteriaSet = new \Criteria("workflow");
$criteriaSet->add(\WebEntryPeer::WE_DATA, $webEntryData);
\BasePeer::doUpdate($criteriaWhere, $criteriaSet, \Propel::getConnection("workflow"));
\BasePeer::doUpdate($criteriaWhere, $criteriaSet, \Propel::getConnection("workflow"));
}
} catch (\Exception $e) {
throw $e;
}
@@ -629,7 +637,7 @@ class WebEntry
}
//Set WE_DATA
$this->setWeData($webEntryUid);
$this->setWeData($webEntryUid, $arrayData);
//Return
return $this->getWebEntry($webEntryUid);
@@ -710,7 +718,7 @@ class WebEntry
}
//Set WE_DATA
$this->setWeData($webEntryUid);
$this->setWeData($webEntryUid, $arrayData);
//Return
if (!$this->formatFieldNameInUppercase) {
@@ -839,7 +847,7 @@ class WebEntry
public function getWebEntryDataFromRecord(array $record)
{
try {
if ($record["WE_METHOD"] == "WS") {
if ((!isset($record['WE_LINK_GENERATION']) || $record['WE_LINK_GENERATION']==='DEFAULT') && $record["WE_METHOD"] == "WS") {
$http = (\G::is_https())? "https://" : "http://";
$url = $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $record["PRO_UID"];
@@ -1061,5 +1069,55 @@ class WebEntry
file_put_contents($pathFileName, $code);
}
/**
* Verify if web entry is a single dynaform without login required.
*
* @param type $processUid
* @param type $weUid
* @return boolean
*/
public function isWebEntryOne($weUid)
{
$webEntry = \WebEntryPeer::retrieveByPK($weUid);
return $webEntry->getWeType()==='SINGLE' && $webEntry->getWeAuthentication()==='ANONYMOUS';
}
/**
* Verify if a Task is and Web Entry auxiliar task.
*
* @param type $tasUid
* @return boolean
*/
public function isTaskAWebEntry($tasUid)
{
return substr($tasUid, 0, 4) === 'wee-';
}
public function getCallbackUrlByTask($tasUid)
{
$criteria = new \Criteria;
$criteria->add(\WebEntryPeer::TAS_UID, $tasUid);
$webEntry = \WebEntryPeer::doSelectOne($criteria);
if ($webEntry->getWeCallback()==='CUSTOM' || $webEntry->getWeCallback()==='CUSTOM_CLEAR') {
return $webEntry->getWeCallbackUrl();
} else {
return '../services/webentry/completed?message=@%_DELEGATION_MESSAGE';
}
}
public function getDelegationMessage($data)
{
$appNumber = $data['APP_NUMBER'];
$appUid = $data['APPLICATION'];
$message = "\n".\G::LoadTranslation('ID_CASE_CREATED').
"\n".\G::LoadTranslation('ID_CASE_NUMBER').": $appNumber".
"\n".\G::LoadTranslation('ID_CASESLIST_APP_UID').": $appUid";
foreach($data['_DELEGATION_DATA'] as $task) {
$message.="\n".\G::LoadTranslation('ID_CASE_ROUTED_TO').": ".
$task['NEXT_TASK']['TAS_TITLE'].
"(".htmlentities($task['NEXT_TASK']['USER_ASSIGNED']['USR_USERNAME']).")";
}
return $message;
}
}

View File

@@ -11,6 +11,9 @@ use \Luracast\Restler\RestException;
*/
class WebEntryEvent extends Api
{
/**
* @var \ProcessMaker\BusinessModel\WebEntryEvent $webEntryEvent
*/
private $webEntryEvent;
/**
@@ -32,6 +35,8 @@ class WebEntryEvent extends Api
/**
* @url GET /:prj_uid/web-entry-events
* @access protected
* @class AccessControl {@permission PM_FACTORY}
*
* @param string $prj_uid {@min 32}{@max 32}
*/
@@ -48,6 +53,7 @@ class WebEntryEvent extends Api
/**
* @url GET /:prj_uid/web-entry-event/:wee_uid
* @class AccessControl {@permission PM_FACTORY}
*
* @param string $prj_uid {@min 32}{@max 32}
* @param string $wee_uid {@min 32}{@max 32}
@@ -65,6 +71,7 @@ class WebEntryEvent extends Api
/**
* @url GET /:prj_uid/web-entry-event/event/:evn_uid
* @class AccessControl {@permission PM_FACTORY}
*
* @param string $prj_uid {@min 32}{@max 32}
* @param string $evn_uid {@min 32}{@max 32}
@@ -82,6 +89,7 @@ class WebEntryEvent extends Api
/**
* @url POST /:prj_uid/web-entry-event
* @class AccessControl {@permission PM_FACTORY}
*
* @param string $prj_uid {@min 32}{@max 32}
* @param array $request_data
@@ -103,6 +111,7 @@ class WebEntryEvent extends Api
/**
* @url PUT /:prj_uid/web-entry-event/:wee_uid
* @class AccessControl {@permission PM_FACTORY}
*
* @param string $prj_uid {@min 32}{@max 32}
* @param string $wee_uid {@min 32}{@max 32}
@@ -112,6 +121,7 @@ class WebEntryEvent extends Api
{
try {
$arrayData = $this->webEntryEvent->update($wee_uid, $this->getUserId(), $request_data);
return $this->webEntryEvent->getWebEntryEvent($wee_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
@@ -119,6 +129,7 @@ class WebEntryEvent extends Api
/**
* @url DELETE /:prj_uid/web-entry-event/:wee_uid
* @class AccessControl {@permission PM_FACTORY}
*
* @param string $prj_uid {@min 32}{@max 32}
* @param string $wee_uid {@min 32}{@max 32}
@@ -127,6 +138,24 @@ class WebEntryEvent extends Api
{
try {
$this->webEntryEvent->delete($wee_uid);
return ['success' => true];
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Get the web entry URL.
*
* @url GET /:prj_uid/web-entry-event/:wee_uid/generate-link
* @access protected
* @class AccessControl {@permission PM_FACTORY}
*/
public function generateLink($prj_uid, $wee_uid)
{
try {
$link = $this->webEntryEvent->generateLink($prj_uid, $wee_uid);
return ["link" => $link];
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}

View File

@@ -7,7 +7,6 @@ use \Luracast\Restler\RestException;
/**
* Pmtable Api Controller
*
* @protected
*/
class System extends Api
{
@@ -18,6 +17,7 @@ class System extends Api
* @copyright Colosa - Bolivia
*
* @url GET /db-engines
* @protected
*/
public function doGetDataBaseEngines()
{
@@ -39,6 +39,7 @@ class System extends Api
* @copyright Colosa - Bolivia
*
* @url GET /counters-lists
* @protected
*/
public function doGetCountersLists()
{
@@ -52,6 +53,25 @@ class System extends Api
}
}
/**
* Get a list of the installed languages.
*
* @category HOR-3209,PROD-181
* @return array
* @url GET /languages
* @public
*/
public function doGetLanguages()
{
try {
$language = new \ProcessMaker\BusinessModel\Language;
$list = $language->getLanguageList();
return ["data" => $list];
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* @return array
*
@@ -59,6 +79,7 @@ class System extends Api
* @copyright Colosa - Bolivia
*
* @url GET /enabled-features
* @protected
*/
public function doGetEnabledFeatures()
{
@@ -81,4 +102,25 @@ class System extends Api
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
/**
* Get the list of installed skins.
*
* @url GET /skins
* @return array
* @access protected
* @class AccessControl {@permission PM_FACTORY}
* @protected
*/
public function doGetSkins()
{
try {
$model = new \ProcessMaker\BusinessModel\Skins();
$response = $model->getSkins();
return ["data" => $response];
} catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
}
}
}

View File

@@ -0,0 +1,6 @@
<script>
if({$derivationResponse|@json_encode})
parent.fullfill({$webEntryUrlEvaluated|@json_encode});
else
parent.reject();
</script>

View File

@@ -27,7 +27,7 @@ SELECT LANG_ID, LANG_NAME FROM langOptions
<JS type="javascript"><![CDATA[
//validate iframe login
if(inIframe()) {
if(inIframe() && (window.location.search.indexOf("inIFrame=1")===-1)) {
if (PM.Sessions.getCookie('PM-TabPrimary') !== '101010010'
&& (window.location.pathname.indexOf("login/login") !== -1
|| window.location.pathname.indexOf("sysLogin") !== -1)) {

View File

@@ -30,7 +30,7 @@ SELECT LANG_ID, LANG_NAME FROM langOptions
<JS type="javascript"><![CDATA[
//validate iframe login
if(inIframe()) {
if(inIframe() && (window.location.search.indexOf("inIFrame=1")===-1)) {
if (PM.Sessions.getCookie('PM-TabPrimary') !== '101010010'
&& (window.location.pathname.indexOf("login/login") !== -1
|| window.location.pathname.indexOf("sysLogin") !== -1)) {