Merged in bugfix/HOR-4921 (pull request #6661)

Bugfix/HOR-4921

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2018-10-16 19:44:56 +00:00
committed by Julio Cesar Laura Avendaño
5 changed files with 45 additions and 4 deletions

View File

@@ -1023,6 +1023,7 @@ class PmDynaform
var isRTL = \"" . $this->isRTL . "\";
var pathRTLCss = \"" . $this->pathRTLCss . "\";
var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "0") . ";
" . $this->getTheStringVariableForGoogleMaps() . "\n
$(window).load(function ()
{
var data = jsondata;
@@ -1037,7 +1038,8 @@ class PmDynaform
workspace: workspace
},
token: credentials,
submitRest: false
submitRest: false,
googleMaps: googleMaps
});
$(document).find(\"form\").submit(function (e) {
e.preventDefault();
@@ -1085,6 +1087,7 @@ class PmDynaform
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "0") . ";\n" .
"var leaveCaseWarning = " . $this->getLeaveCaseWarning() . ";\n" .
$this->getTheStringVariableForGoogleMaps() . "\n" .
"$(window).load(function () {\n" .
" var data = jsondata;\n" .
" window.dynaform = new PMDynaform.core.Project({\n" .
@@ -1097,7 +1100,8 @@ class PmDynaform
" workspace: workspace\n" .
" },\n" .
" token: credentials,\n" .
" submitRest: false\n" .
" submitRest: false,\n" .
" googleMaps: googleMaps\n" .
" });\n" .
" $(document).find('form').find('button').on('click', function (e) {\n" .
" e.preventDefault();\n" .
@@ -1167,6 +1171,7 @@ class PmDynaform
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "0") . ";\n" .
"var leaveCaseWarning = " . $this->getLeaveCaseWarning() . ";\n" .
$this->getTheStringVariableForGoogleMaps() . "\n" .
"</script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/cases_Step.js'></script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
@@ -1224,6 +1229,7 @@ class PmDynaform
var pathRTLCss = \"" . $this->pathRTLCss . "\";
var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "0") . ";
var leaveCaseWarning = " . $this->getLeaveCaseWarning() . ";
" . $this->getTheStringVariableForGoogleMaps() . "
</script>
<script type=\"text/javascript\" src=\"/jscore/cases/core/pmDynaform.js\"></script>
@@ -1268,6 +1274,7 @@ class PmDynaform
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "0") . ";\n" .
"var leaveCaseWarning = " . $this->getLeaveCaseWarning() . ";\n" .
$this->getTheStringVariableForGoogleMaps() . "\n" .
"</script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
"<div style='width:100%;padding: 0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
@@ -1310,6 +1317,7 @@ class PmDynaform
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? G::decrypt($this->fields["DEL_INDEX"], URL_KEY) : "0") . ";\n" .
"var leaveCaseWarning = " . $this->getLeaveCaseWarning() . ";\n" .
$this->getTheStringVariableForGoogleMaps() . "\n" .
"</script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
"<div style='width:100%;padding: 0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
@@ -1337,6 +1345,7 @@ class PmDynaform
"var jsonData = " . $this->json_encode($json) . ";\n" .
"var httpServerHostname = \"" . System::getHttpServerHostnameRequestsFrontEnd() . "\";\n" .
"var leaveCaseWarning = " . $this->getLeaveCaseWarning() . ";\n" .
$this->getTheStringVariableForGoogleMaps() . "\n" .
$js .
"</script>";
@@ -1373,6 +1382,7 @@ class PmDynaform
"var pathRTLCss = '" . $this->pathRTLCss . "';\n" .
"var delIndex = " . (isset($this->fields["DEL_INDEX"]) ? $this->fields["DEL_INDEX"] : "0") . ";\n" .
"var leaveCaseWarning = " . $this->getLeaveCaseWarning() . ";\n" .
$this->getTheStringVariableForGoogleMaps() . "\n" .
"</script>\n" .
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
"<div style='width:100%;padding: 0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
@@ -2188,4 +2198,19 @@ class PmDynaform
return $result;
}
/**
* Get the string variable for google maps
*
* @return string
*/
private function getTheStringVariableForGoogleMaps()
{
$config = Bootstrap::getSystemConfiguration();
$googleMaps = new stdClass();
$googleMaps->key = $config['google_map_api_key'];
$googleMaps->signature = $config['google_map_signature'];
$result = 'var googleMaps = ' . G::json_encode($googleMaps) . ';';
return $result;
}
}

View File

@@ -91,6 +91,7 @@ $(window).load(function () {
},
token: credentials,
submitRest: false,
googleMaps: googleMaps,
onLoad: function () {
var dynaformname = document.createElement("input"),
appuid,

View File

@@ -166,7 +166,8 @@ try {
if (is_file( PATH_RBAC . 'plugins' . PATH_SEP . $sObject )) {
$sType = trim(str_replace(array("class.", ".php"), "", $sObject));
if ($sType != "ldapAdvanced") {
// Filter Authentication Sources added by plugins, because these will be configured from another place
if ($sType != "ldapAdvanced" && $sType != "Gauth") {
$arr[] = array("sType" => $sType, "sLabel" => $sType);
}
}

View File

@@ -64,7 +64,9 @@ class System
'logs_max_files' => 60,
'logs_location' => '',
'logging_level' => 'INFO',
'smtp_timeout' => 20
'smtp_timeout' => 20,
'google_map_api_key' => '',
'google_map_signature' => ''
);
/**

View File

@@ -3,6 +3,7 @@
namespace ProcessMaker\Services\Api;
use AppDelegation;
use Bootstrap;
use Cases as ClassesCases;
use Criteria;
use Exception;
@@ -1292,6 +1293,17 @@ class Light extends Api
$oMobile = new BusinessModelLight();
$url = "http://maps.googleapis.com/maps/api/staticmap?center=" . $latitude . ',' . $longitude . "&format=jpg&size=600x600&zoom=15&markers=color:blue%7Clabel:S%7C" . $latitude . ',' . $longitude;
$config = Bootstrap::getSystemConfiguration();
$googleMapApiKey = $config['google_map_api_key'];
$googleMapSignature = $config['google_map_signature'];
if(!empty($googleMapApiKey)){
$url .= "&key=" . $googleMapApiKey;
}
if(!empty($googleMapSignature)){
$url .= "&signature=" . $googleMapSignature;
}
$imageLocation = imagecreatefromjpeg($url);
$tmpfname = tempnam(sys_get_temp_dir(), "pmm");
imagejpeg($imageLocation, $tmpfname);