diff --git a/workflow/engine/classes/PmDynaform.php b/workflow/engine/classes/PmDynaform.php index 309bd9384..f614521d3 100644 --- a/workflow/engine/classes/PmDynaform.php +++ b/workflow/engine/classes/PmDynaform.php @@ -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" . "\n" . "\n" . "\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() . " @@ -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" . "\n" . "\n" . "
\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" . "\n" . "\n" . "
\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 . ""; @@ -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" . "\n" . "\n" . "
\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; + } } diff --git a/workflow/engine/js/cases/core/pmDynaform.js b/workflow/engine/js/cases/core/pmDynaform.js index 8997a633b..56cc81ef2 100644 --- a/workflow/engine/js/cases/core/pmDynaform.js +++ b/workflow/engine/js/cases/core/pmDynaform.js @@ -91,6 +91,7 @@ $(window).load(function () { }, token: credentials, submitRest: false, + googleMaps: googleMaps, onLoad: function () { var dynaformname = document.createElement("input"), appuid, diff --git a/workflow/engine/methods/authSources/authSources_Ajax.php b/workflow/engine/methods/authSources/authSources_Ajax.php index 2c44d7fb8..cef5514d9 100644 --- a/workflow/engine/methods/authSources/authSources_Ajax.php +++ b/workflow/engine/methods/authSources/authSources_Ajax.php @@ -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); } } diff --git a/workflow/engine/src/ProcessMaker/Core/System.php b/workflow/engine/src/ProcessMaker/Core/System.php index 890264c0c..1a5f7aea3 100644 --- a/workflow/engine/src/ProcessMaker/Core/System.php +++ b/workflow/engine/src/ProcessMaker/Core/System.php @@ -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' => '' ); /** diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Light.php b/workflow/engine/src/ProcessMaker/Services/Api/Light.php index d1988cfca..11f126b25 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Light.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Light.php @@ -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);