Merged in feature/HOR-3340 (pull request #5720)

HOR-3340

Approved-by: Paula Quispe <paula.quispe@processmaker.com>
Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
David Callizaya
2017-06-05 21:30:27 +00:00
committed by Paula Quispe
8 changed files with 210 additions and 131 deletions

View File

@@ -121,7 +121,7 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
* The value for the we_hide_information_bar field.
* @var string
*/
protected $we_hide_information_bar = '0';
protected $we_hide_information_bar = '1';
/**
* The value for the we_callback field.
@@ -816,7 +816,7 @@ abstract class BaseWebEntry extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->we_hide_information_bar !== $v || $v === '0') {
if ($this->we_hide_information_bar !== $v || $v === '1') {
$this->we_hide_information_bar = $v;
$this->modifiedColumns[] = WebEntryPeer::WE_HIDE_INFORMATION_BAR;
}

View File

@@ -3346,7 +3346,7 @@
<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="0"/>
<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" />

View File

@@ -17836,14 +17836,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

View File

@@ -4480,8 +4480,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') ,

View File

@@ -1664,7 +1664,7 @@ CREATE TABLE `WEB_ENTRY`
`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 '0',
`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,

View File

@@ -23,6 +23,8 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
<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);
@@ -91,7 +93,7 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
<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>
<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>
@@ -162,10 +164,13 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
return this.$element.errorMessage.textContent;
}
};
function logout(reload) {
function logout(reload, callback) {
$.ajax({
url: '../login/login',
success: function () {
if (typeof callback==='function') {
callback();
}
if (reload) {
resetLocalData();
location.reload();
@@ -238,7 +243,9 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
iframe.style.opacity = 1;
onLoadIframe = function () {};
}
iframe.src = url;
//This code is to prevent error at back history
//in Firefox
setTimeout(function(){iframe.src = url;}, 0);
window.fullfill = function () {
resolve.apply(this, arguments);
};
@@ -352,6 +359,9 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
data.TAS_UID = tasUid;
localStorage.weData = JSON.stringify(data);
resolve(data);
},
error: function () {
reject();
}
});
} else {
@@ -370,7 +380,7 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
function (event, resolve, reject) {
var contentDocument = getContentDocument(event.target);
var stepTitle = contentDocument.getElementsByTagName("title");
if (!stepTitle || stepTitle[0].textContent === 'Runtime Exception.') {
if (!stepTitle || !stepTitle.length || stepTitle[0].textContent === 'Runtime Exception.') {
if (contentDocument.location.search.match(/&POSITION=10000&/)) {
//Catch error if webentry was deleted.
reject();
@@ -398,14 +408,25 @@ $webEntryModel = \WebEntryPeer::retrieveByPK($weUid);
log("closeWebEntry");
resetLocalData();
if (closeSession) {
logout(false);
//This code is to prevent error at back history
//in Firefox
$("#iframe").hide();
$("#iframe").attr("src", "../login/login");
logout(false, function() {
resolve(callbackUrl);
});
} else {
//This code is to prevent error at back history
//in Firefox
open("../webentry/logged", function() {
resolve(callbackUrl);
});
}
resolve(callbackUrl);
});
};
var redirectCallback = function (callbackUrl) {
return new Promise(function (resolve, reject) {
log("redirect");
log("redirect: "+callbackUrl);
location.href = callbackUrl;
resolve();
});

View File

@@ -596,9 +596,7 @@ class WebEntry
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
unset($arrayData["WE_UID"]);
if (isset($arrayData['WE_LINK_GENERATION']) && $arrayData['WE_LINK_GENERATION']==='DEFAULT') {
unset($arrayData["WE_DATA"]);
}
unset($arrayData["WE_DATA"]);
//Verify data
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);

View File

@@ -4,16 +4,19 @@ namespace ProcessMaker\BusinessModel;
class WebEntryEvent
{
private $arrayFieldDefinition = array(
"WEE_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "webEntryEventUid"),
"WEE_UID" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "webEntryEventUid"),
"EVN_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "eventUid"),
"ACT_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "activityUid"),
"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"),
"EVN_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "eventUid"),
"ACT_UID" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "activityUid"),
"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"),
"WEE_TITLE" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "webEntryEventTitle"),
"WEE_DESCRIPTION" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "webEntryEventDescription"),
"WEE_STATUS" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("ENABLED", "DISABLED"), "fieldNameAux" => "webEntryEventStatus")
"WEE_TITLE" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "webEntryEventTitle"),
"WEE_DESCRIPTION" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "webEntryEventDescription"),
"WEE_STATUS" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("ENABLED", "DISABLED"), "fieldNameAux" => "webEntryEventStatus"),
"WE_LINK_SKIN" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "webEntryEventSkin"),
"WE_LINK_LANGUAGE" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "webEntryEventLanguage"),
"WE_LINK_DOMAIN" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "webEntryEventDomain"),
);
private $formatFieldNameInUppercase = true;
@@ -269,6 +272,27 @@ class WebEntryEvent
== 'SINGLE') {
$this->arrayFieldDefinition['DYN_UID']['required'] = true;
}
if (isset($arrayData['WE_LINK_GENERATION']) && $arrayData['WE_LINK_GENERATION']
== 'ADVANCED') {
$this->arrayFieldDefinition['WE_LINK_SKIN']['required'] = true;
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['required'] = true;
$this->arrayFieldDefinition['WE_LINK_DOMAIN']['required'] = true;
$this->arrayFieldDefinition['WE_LINK_SKIN']['empty'] = false;
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['empty'] = false;
$this->arrayFieldDefinition['WE_LINK_DOMAIN']['empty'] = false;
}
$modelSkins = new \ProcessMaker\BusinessModel\Skins();
$skins = [];
foreach ($modelSkins->getSkins() as $mSkin) {
$skins[] = $mSkin['SKIN_FOLDER_ID'];
}
$this->arrayFieldDefinition['WE_LINK_SKIN']['defaultValues'] = $skins;
$modelLanguages = new \ProcessMaker\BusinessModel\Language();
$languages = [];
foreach ($modelLanguages->getLanguageList() as $mLang) {
$languages[] = $mLang['LANG_ID'];
}
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['defaultValues'] = $languages;
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, $flagInsert);
@@ -650,101 +674,101 @@ class WebEntryEvent
try {
//WebEntry
if ($arrayWebEntryEventData["WEE_WE_UID"] != "") {
$task = new \Tasks();
if ($arrayWebEntryEventData["WEE_WE_UID"] != "") {
$task = new \Tasks();
//Task - Step
if (isset($arrayData["DYN_UID"]) && $arrayData["DYN_UID"] != $arrayWebEntryEventData["DYN_UID"]) {
//Delete
$step = new \Step();
//Task - Step for WE_TYPE=SINGLE
if (isset($arrayData["DYN_UID"]) && $arrayData["DYN_UID"] != $arrayWebEntryEventData["DYN_UID"] && $arrayData["WE_TYPE"]==='SINGLE') {
//Delete
$step = new \Step();
$criteria = new \Criteria("workflow");
$criteria = new \Criteria("workflow");
$criteria->add(\StepPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$criteria->add(\StepPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$rsCriteria = \StepPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rsCriteria = \StepPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $step->remove($row["STEP_UID"]);
}
//Add
$step = new \Step();
$stepUid = $step->create(array("PRO_UID" => $arrayWebEntryEventData["PRJ_UID"], "TAS_UID" => $arrayWebEntryEventData["WEE_WE_TAS_UID"]));
$result = $step->update(array("STEP_UID" => $stepUid, "STEP_TYPE_OBJ" => "DYNAFORM", "STEP_UID_OBJ" => $arrayData["DYN_UID"], "STEP_POSITION" => 1, "STEP_MODE" => "EDIT"));
}
//Task - User
if (isset($arrayData["USR_UID"]) && $arrayData["USR_UID"] != $arrayWebEntryEventData["USR_UID"]) {
//Unassign
$taskUser = new \TaskUser();
$criteria = new \Criteria("workflow");
$criteria->add(\TaskUserPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$rsCriteria = \TaskUserPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $taskUser->remove($row["TAS_UID"], $row["USR_UID"], $row["TU_TYPE"], $row["TU_RELATION"]);
}
//Assign
$result = $task->assignUser($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["USR_UID"], 1);
}
//Route
if (array_key_exists('ACT_UID', $arrayData)) {
if ($arrayData['ACT_UID'] != $arrayWebEntryEventData['ACT_UID']) {
//Delete
$result = $task->deleteAllRoutesOfTask(
$arrayWebEntryEventData['PRJ_UID'], $arrayWebEntryEventData['WEE_WE_TAS_UID'], true
);
}
//Add
$workflow = \ProcessMaker\Project\Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
$result = $workflow->addRoute($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["ACT_UID"], "SEQUENTIAL");
}
//WebEntry
$arrayDataAux = array();
$webEntryMap = [
'DYN_UID' => 'DYN_UID',
'USR_UID' => 'USR_UID',
'WE_TYPE' => 'WE_TYPE',
'WE_TITLE' => 'WEE_TITLE',
'WE_DESCRIPTION' => 'WEE_DESCRIPTION',
'WE_CUSTOM_TITLE' => 'WE_CUSTOM_TITLE',
'WE_AUTHENTICATION' => 'WE_AUTHENTICATION',
'WE_HIDE_INFORMATION_BAR' => 'WE_HIDE_INFORMATION_BAR',
'WE_CALLBACK' => 'WE_CALLBACK',
'WE_CALLBACK_URL' => 'WE_CALLBACK_URL',
'WE_LINK_GENERATION' => 'WE_LINK_GENERATION',
'WE_LINK_SKIN' => 'WE_LINK_SKIN',
'WE_LINK_LANGUAGE' => 'WE_LINK_LANGUAGE',
'WE_LINK_DOMAIN' => 'WE_LINK_DOMAIN',
'WE_DATA' => 'WEE_URL',
];
foreach ($webEntryMap as $k => $v) {
if (array_key_exists($v, $arrayData)) {
$arrayDataAux[$k] = $arrayData[$v];
}
}
if (count($arrayDataAux) > 0) {
$arrayDataAux = $this->webEntry->update($arrayWebEntryEventData["WEE_WE_UID"], $userUidUpdater, $arrayDataAux);
}
$result = $step->remove($row["STEP_UID"]);
}
//Add
$step = new \Step();
$stepUid = $step->create(array("PRO_UID" => $arrayWebEntryEventData["PRJ_UID"], "TAS_UID" => $arrayWebEntryEventData["WEE_WE_TAS_UID"]));
$result = $step->update(array("STEP_UID" => $stepUid, "STEP_TYPE_OBJ" => "DYNAFORM", "STEP_UID_OBJ" => $arrayData["DYN_UID"], "STEP_POSITION" => 1, "STEP_MODE" => "EDIT"));
}
//Task - User
if (!empty($arrayData["USR_UID"]) && $arrayData["USR_UID"] != $arrayWebEntryEventData["USR_UID"]) {
//Unassign
$taskUser = new \TaskUser();
$criteria = new \Criteria("workflow");
$criteria->add(\TaskUserPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$rsCriteria = \TaskUserPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $taskUser->remove($row["TAS_UID"], $row["USR_UID"], $row["TU_TYPE"], $row["TU_RELATION"]);
}
//Assign
$result = $task->assignUser($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["USR_UID"], 1);
}
//Route
if (array_key_exists('ACT_UID', $arrayData)) {
if ($arrayData['ACT_UID'] != $arrayWebEntryEventData['ACT_UID']) {
//Delete
$result = $task->deleteAllRoutesOfTask(
$arrayWebEntryEventData['PRJ_UID'], $arrayWebEntryEventData['WEE_WE_TAS_UID'], true
);
}
//Add
$workflow = \ProcessMaker\Project\Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
$result = $workflow->addRoute($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["ACT_UID"], "SEQUENTIAL");
}
//WebEntry
$arrayDataAux = array();
$webEntryMap = [
'DYN_UID' => 'DYN_UID',
'USR_UID' => 'USR_UID',
'WE_TYPE' => 'WE_TYPE',
'WE_TITLE' => 'WEE_TITLE',
'WE_DESCRIPTION' => 'WEE_DESCRIPTION',
'WE_CUSTOM_TITLE' => 'WE_CUSTOM_TITLE',
'WE_AUTHENTICATION' => 'WE_AUTHENTICATION',
'WE_HIDE_INFORMATION_BAR' => 'WE_HIDE_INFORMATION_BAR',
'WE_CALLBACK' => 'WE_CALLBACK',
'WE_CALLBACK_URL' => 'WE_CALLBACK_URL',
'WE_LINK_GENERATION' => 'WE_LINK_GENERATION',
'WE_LINK_SKIN' => 'WE_LINK_SKIN',
'WE_LINK_LANGUAGE' => 'WE_LINK_LANGUAGE',
'WE_LINK_DOMAIN' => 'WE_LINK_DOMAIN',
'WE_DATA' => 'WEE_URL',
];
foreach ($webEntryMap as $k => $v) {
if (array_key_exists($v, $arrayData)) {
$arrayDataAux[$k] = $arrayData[$v];
}
}
if (count($arrayDataAux) > 0) {
$arrayDataAux = $this->webEntry->update($arrayWebEntryEventData["WEE_WE_UID"], $userUidUpdater, $arrayDataAux);
}
}
//WebEntry-Event
$webEntryEvent = \WebEntryEventPeer::retrieveByPK($webEntryEventUid);
@@ -880,14 +904,13 @@ class WebEntryEvent
public function getWebEntryEventDataFromRecord(array $record)
{
try {
if (
(!isset($record['WE_LINK_GENERATION']) || $record['WE_LINK_GENERATION']==='DEFAULT')
&& $record["WEE_WE_UID"] . "" != ""
) {
$http = (\G::is_https())? "https://" : "http://";
$url = $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $record["PRJ_UID"];
$record["WEE_WE_URL"] = $url . "/" . $record["WEE_WE_URL"];
if ($record["WEE_WE_UID"]."" != "") {
$record["WEE_WE_URL"] = $this->getGeneratedLink(
$record["WEE_UID"], $record["PRJ_UID"],
$record["WE_LINK_GENERATION"], $record["WE_LINK_DOMAIN"],
$record["WE_LINK_LANGUAGE"], $record["WE_LINK_SKIN"],
$record["WEE_WE_URL"]
);
}
return array(
@@ -1099,16 +1122,53 @@ class WebEntryEvent
)
);
}
if ($webEntry->getWeLinkGeneration() === 'ADVANCED') {
$domain = $webEntry->getWeLinkDomain();
$url = $domain . "/sys".SYS_SYS."/".
$webEntry->getWeLinkLanguage()."/".
$webEntry->getWeLinkSkin()."/".$prj_uid;
return $url."/".$webEntry->getWeUid().'.php';
return $this->getGeneratedLink(
$webEntry->getWeUid(),
$prj_uid,
$webEntry->getWeLinkGeneration(),
$webEntry->getWeLinkDomain(),
$webEntry->getWeLinkLanguage(),
$webEntry->getWeLinkSkin(),
$webEntry->getWeData()
);
}
/**
* Get the WebEntry URL.
*
* @param string $weUid
* @param string $weLinkGeneration
* @param string $weLinkDomain
* @param string $weLinkLanguage
* @param string $weLinkSkin
* @param string $weData
* @return string
*/
private function getGeneratedLink(
$weUid,
$prj_uid,
$weLinkGeneration,
$weLinkDomain,
$weLinkLanguage,
$weLinkSkin,
$weData
) {
$http = (\G::is_https()) ? "https://" : "http://";
$port = $_SERVER['SERVER_PORT'] == '80' ? '' : ':'.$_SERVER['SERVER_PORT'];
if ($weLinkGeneration === 'ADVANCED') {
$domain = $weLinkDomain;
$hasProtocol = strpos($domain, 'http://') === 0 ||
strpos($domain, 'https://') === 0;
$hasPort = preg_match('/\:\d+$/', $domain);
$url = ($hasProtocol ? '' : $http).
$domain.($hasPort ? '' : $port).
"/sys".SYS_SYS."/".
$weLinkLanguage."/".
$weLinkSkin."/".$prj_uid;
return $url."/".$weData;
} else {
$http = (\G::is_https()) ? "https://" : "http://";
$url = $http.$_SERVER["HTTP_HOST"]."/sys".SYS_SYS."/".SYS_LANG."/".SYS_SKIN."/".$prj_uid;
return $url."/".$webEntry->getWeData();
return $url."/".$weData;
}
}
}