Added edit indication to workflow
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
class Workflowvalue extends mfBaseModel {
|
||||
private $item;
|
||||
private $changer;
|
||||
|
||||
public function setValue($value, $items) {
|
||||
$this->item = $this->getProperty("item");
|
||||
@@ -43,18 +44,33 @@ class Workflowvalue extends mfBaseModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($this->item->type == "gps") {
|
||||
if(is_array($value) && count($value) == 2) {
|
||||
$lat = $value['lat'];
|
||||
$long = $value['long'];
|
||||
$value = "$lat;$long";
|
||||
if($lat == null && $long == null) {
|
||||
$value = null;
|
||||
}
|
||||
} else {
|
||||
$value = "";
|
||||
$value = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($this->item->type == "bool" && $this->{"value_".$value_type} = null && $value == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if($value == null && $this->{"value_".$value_type} == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
|
||||
|
||||
|
||||
if($this->{"value_".$value_type} != $value) {
|
||||
$this->{"value_".$value_type} = $value;
|
||||
@@ -77,6 +93,15 @@ class Workflowvalue extends mfBaseModel {
|
||||
return $this->item;
|
||||
}
|
||||
|
||||
if($name == "changer") {
|
||||
if($this->changed && $this->changed_by) {
|
||||
$this->changer = new User($this->changed_by);
|
||||
return $this->changer;
|
||||
} else {
|
||||
return new Address();
|
||||
}
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
Reference in New Issue
Block a user