WIP Pipework Workflow
This commit is contained in:
@@ -3,6 +3,72 @@
|
||||
class Workflowvalue extends mfBaseModel {
|
||||
private $item;
|
||||
|
||||
public function setValue($value, $items) {
|
||||
$this->item = $this->getProperty("item");
|
||||
|
||||
if($this->item->type == "delimiter" || $this->item->type == "empty") {
|
||||
return true;
|
||||
}
|
||||
|
||||
$value_type = "string";
|
||||
|
||||
switch($this->item->type) {
|
||||
case "string":
|
||||
$value_type = "string";
|
||||
break;
|
||||
case "enum":
|
||||
$value_type = "string";
|
||||
break;
|
||||
case "gps":
|
||||
$value_type = "string";
|
||||
break;
|
||||
case "color":
|
||||
$value_type = "string";
|
||||
break;
|
||||
case "date":
|
||||
$value_type = "string";
|
||||
break;
|
||||
case "int":
|
||||
$value_type = "int";
|
||||
break;
|
||||
case "bool":
|
||||
$value_type = "int";
|
||||
break;
|
||||
case "file":
|
||||
$value_type = "int";
|
||||
break;
|
||||
case "text":
|
||||
$value_type = "text";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if($this->item->type == "gps") {
|
||||
if(is_array($value) && count($value) == 2) {
|
||||
$lat = $value['lat'];
|
||||
$long = $value['long'];
|
||||
$value = "$lat;$long";
|
||||
} else {
|
||||
$value = "";
|
||||
}
|
||||
}
|
||||
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
|
||||
if($this->{"value_".$value_type} != $value) {
|
||||
$this->{"value_".$value_type} = $value;
|
||||
$this->changed = date('U');
|
||||
$this->changed_by = $me->id;
|
||||
}
|
||||
|
||||
if($this->new() == "new") {
|
||||
$this->changed = date('U');
|
||||
$this->changed_by = $me->id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user