Merged in release/3.3 (pull request #6629)

HOR-4880: Update release/3.3.1 with release/3.3
This commit is contained in:
Paula Quispe
2018-09-18 12:20:19 +00:00
committed by Julio Cesar Laura Avendaño
13 changed files with 229 additions and 66 deletions

View File

@@ -37,7 +37,7 @@ class ChangeLog
*
* @var array
*/
protected static $applications = ['Unknow', 'Web', 'Actions by Email', 'Mobile'];
protected static $applications = ['Unknow', 'Web Application', 'Action by Email', 'Mobile Application'];
/**
* Identifier for unknow object.

View File

@@ -0,0 +1,96 @@
<?php
namespace ProcessMaker\Core;
class AppEvent
{
/**
* Identify XML Form type elements
*/
const XMLFORM_RENDER = 0;
/**
* Represents the AppEvent object.
*
* @var object
*/
private static $appEvent = null;
/**
* List of closure elements.
*
* @var array
*/
private $callbacks = [];
/**
* Represents the html string.
*
* @var string
*/
private $html = null;
/**
* Get an AppEvent object.
*
* @return object
*/
public static function getAppEvent()
{
if (self::$appEvent === null) {
self::$appEvent = new AppEvent();
}
return self::$appEvent;
}
/**
* Process all closure elements.
*
* @param int $type
* @param object $object
* @return $this
*/
public function dispatch($type, $object)
{
foreach ($this->callbacks as $callback) {
$callback($type, $object, $this);
}
return $this;
}
/**
* Add a closure function.
*
* @param function $callback
* @return $this
*/
public function addEvent($callback)
{
if (is_callable($callback)) {
$this->callbacks[] = $callback;
}
return $this;
}
/**
* Get html value.
*
* @return string
*/
public function getHtml()
{
return $this->html;
}
/**
* Set html value.
*
* @param string $html
* @return $this
*/
public function setHtml($html)
{
$this->html = $html;
return $this;
}
}

View File

@@ -1274,7 +1274,7 @@ class Light extends Api
$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;
$imageLocation = imagecreatefromjpeg($url);
$tmpfname = tempnam("php://temp", "pmm");
$tmpfname = tempnam(sys_get_temp_dir(), "pmm");
imagejpeg($imageLocation, $tmpfname);
$_FILES["form"]["type"] = "image/jpeg";