public function edit($param) { $entry_list_id = $param->get("entry_list_id"); $cF = $this->getCustomFields($entry_list_id); $cFields = $cF->map(array(new _hx_lambda(array(&$cF, &$entry_list_id, &$param), "model_QC_0"), 'execute')); haxe_Log::trace($cFields, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 38, "className" => "model.QC", "methodName" => "edit"))); $fieldNames = new haxe_ds_StringMap(); $typeMap = new haxe_ds_StringMap(); $optionsMap = new haxe_ds_StringMap(); $_g1 = 0; $_g = $cFields->length; while ($_g1 < $_g) { $f = $_g1++; $fieldNames->set($cFields[$f], _hx_array_get($cF, $f)->get("field_name")); if (_hx_array_get($cF, $f)->get("field_options") !== null) { $optionsMap->set($cFields[$f], _hx_array_get($cF, $f)->get("field_options")); } $typeMap->set($cFields[$f], _hx_array_get($cF, $f)->get("field_type")); unset($f); } $param->set("fields", $cFields); $sb = new StringBuf(); $phValues = new _hx_array(array()); haxe_Log::trace($param, _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 57, "className" => "model.QC", "methodName" => "edit"))); $this->data = _hx_anonymous(array("fieldNames" => php_Lib::associativeArrayOfHash($fieldNames), "rows" => $this->doSelectCustom($param, $sb, $phValues), "typeMap" => php_Lib::associativeArrayOfHash($typeMap), "optionsMap" => php_Lib::associativeArrayOfHash($optionsMap), "recordings" => $this->getRecordings(Std::parseInt($param->get("lead_id"))))); return $this->json_encode(); }
public function getGlobals($param) { $fieldNames = new haxe_ds_StringMap(); $typeMap = new haxe_ds_StringMap(); $optionsMap = new haxe_ds_StringMap(); $eF = $this->getEditorFields(null); $keys = $eF->keys(); $tableNames = new _hx_array(array()); $tableFields = new haxe_ds_StringMap(); haxe_Log::trace($param, _hx_anonymous(array("fileName" => "App.hx", "lineNumber" => 32, "className" => "model.App", "methodName" => "getGlobals"))); while ($keys->hasNext()) { $k = $keys->next(); $tableNames->push($k); $aFields = $eF->get($k); $cFields = $aFields->map(array(new _hx_lambda(array(&$aFields, &$eF, &$fieldNames, &$k, &$keys, &$optionsMap, &$param, &$tableFields, &$tableNames, &$typeMap), "model_App_0"), 'execute')); $tableFields->set($k, $cFields); $_g1 = 0; $_g = $cFields->length; while ($_g1 < $_g) { $f = $_g1++; $fieldNames->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_name")); if (_hx_array_get($aFields, $f)->get("field_options") !== null) { $optionsMap->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_options")); } $typeMap->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_type")); unset($f); } unset($_g1, $_g); unset($k, $cFields, $aFields); } $me = new model_Users($param); $me->get_info(null); $data = _hx_anonymous(array("fieldNames" => php_Lib::associativeArrayOfHash($fieldNames), "userMap" => $me->globals, "optionsMap" => $optionsMap, "typeMap" => $typeMap, "limit" => _hx_array_get(S::$conf->get("sql"), "LIMIT"))); return $data; }
public function edit($param) { $fieldNames = new haxe_ds_StringMap(); $typeMap = new haxe_ds_StringMap(); $optionsMap = new haxe_ds_StringMap(); $eF = $this->getEditorFields(null); $keys = $eF->keys(); $tableNames = new _hx_array(array()); $tableFields = new haxe_ds_StringMap(); while ($keys->hasNext()) { $k = $keys->next(); haxe_Log::trace($k, _hx_anonymous(array("fileName" => "Clients.hx", "lineNumber" => 55, "className" => "model.Clients", "methodName" => "edit"))); $tableNames->push($k); $aFields = $eF->get($k); $cFields = $aFields->map(array(new _hx_lambda(array(&$aFields, &$eF, &$fieldNames, &$k, &$keys, &$optionsMap, &$param, &$tableFields, &$tableNames, &$typeMap), "model_Clients_0"), 'execute')); $tableFields->set($k, $cFields); $_g1 = 0; $_g = $cFields->length; while ($_g1 < $_g) { $f = $_g1++; $fieldNames->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_name")); if (_hx_array_get($aFields, $f)->get("field_options") !== null) { $optionsMap->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_options")); } $typeMap->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_type")); unset($f); } unset($_g1, $_g); unset($k, $cFields, $aFields); } $editTables = new haxe_ds_StringMap(); $ti = 0; $_g2 = 0; while ($_g2 < $tableNames->length) { $table = $tableNames[$_g2]; ++$_g2; $p = new haxe_ds_StringMap(); $sb = new StringBuf(); $phValues = new _hx_array(array()); $p->set("primary_id", $param->get("primary_id")); if ($table === "clients") { $p->set("table", "vicidial_list"); $p->set("jointable", "fly_crm." . _hx_string_or_null($table)); $p->set("joincond", "ON vicidial_list.lead_id=fly_crm.clients.lead_id"); $p->set("fields", Std::string(_hx_string_call($param->get("fields"), "split", array(","))->map(array(new _hx_lambda(array(&$_g2, &$eF, &$editTables, &$fieldNames, &$keys, &$optionsMap, &$p, &$param, &$phValues, &$sb, &$table, &$tableFields, &$tableNames, &$ti, &$typeMap), "model_Clients_1"), 'execute'))->join(",")) . "," . _hx_string_or_null($tableFields->get($table)->map(array(new _hx_lambda(array(&$_g2, &$eF, &$editTables, &$fieldNames, &$keys, &$optionsMap, &$p, &$param, &$phValues, &$sb, &$table, &$tableFields, &$tableNames, &$ti, &$typeMap), "model_Clients_2"), 'execute'))->join(","))); $p->set("where", "vicidial_list.lead_id|" . Std::string($param->get("lead_id"))); $editTables->set($table, php_Lib::hashOfAssociativeArray($this->doJoin($p, $sb, $phValues))); } else { $p->set("table", "fly_crm." . _hx_string_or_null($table)); $p->set("fields", $tableFields->get($table)->join(",")); $p->set("where", "client_id|" . Std::string($param->get("client_id"))); $editTables->set($table, php_Lib::hashOfAssociativeArray($this->doSelect($p, $sb, $phValues))); } haxe_Log::trace($p, _hx_anonymous(array("fileName" => "Clients.hx", "lineNumber" => 105, "className" => "model.Clients", "methodName" => "edit"))); unset($table, $sb, $phValues, $p); } $this->data = _hx_anonymous(array("fieldNames" => php_Lib::associativeArrayOfHash($fieldNames), "editData" => php_Lib::associativeArrayOfHash($editTables), "typeMap" => php_Lib::associativeArrayOfHash($typeMap), "optionsMap" => php_Lib::associativeArrayOfHash($optionsMap), "recordings" => $this->getRecordings(Std::parseInt($param->get("lead_id"))))); return $this->json_encode(); }
static function convertBeforeEncode($val) { $arr = null; if (is_object($val)) { $_g = get_class($val); switch ($_g) { case "_hx_anonymous": case "stdClass": $arr = php_Lib::associativeArrayOfObject($val); break; case "_hx_array": $arr = php_Lib::toPhpArray($val); break; case "Date": return Std::string($val); break; case "HList": $arr = php_Lib::toPhpArray(Lambda::harray($val)); break; case "_hx_enum": $e = $val; return $e->index; break; case "StringMap": case "IntMap": $arr = php_Lib::associativeArrayOfHash($val); break; default: $arr = php_Lib::associativeArrayOfObject($val); break; } } else { if (is_array($val)) { $arr = $val; } else { if (is_float($val) && !is_finite($val)) { $val = null; } return $val; } } return array_map(isset(haxe_Json::$convertBeforeEncode) ? haxe_Json::$convertBeforeEncode : array("haxe_Json", "convertBeforeEncode"), $arr); }
public function edit($param) { $entry_list_id = $param->get("entry_list_id"); $cF = $this->getCustomFields($entry_list_id); $cFields = $cF->map(array(new _hx_lambda(array(&$cF, &$entry_list_id, &$param), "model_QC_0"), 'execute')); haxe_Log::trace($cFields->join(","), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 38, "className" => "model.QC", "methodName" => "edit"))); $fieldDefault = new haxe_ds_StringMap(); $fieldNames = new haxe_ds_StringMap(); $fieldRequired = new haxe_ds_StringMap(); $typeMap = new haxe_ds_StringMap(); $optionsMap = new haxe_ds_StringMap(); $eF = $this->getEditorFields(null)->get("vicidial_list"); $_g = 0; while ($_g < $eF->length) { $f = $eF[$_g]; ++$_g; $fieldNames->set($f->get("field_label"), $f->get("field_name")); if ($f->get("field_options") !== null) { $optionsMap->set($f->get("field_label"), $f->get("field_options")); } $typeMap->set($f->get("field_label"), $f->get("field_type")); unset($f); } $_g1 = 0; $_g2 = $cFields->length; while ($_g1 < $_g2) { $f1 = $_g1++; $fieldNames->set($cFields[$f1], _hx_array_get($cF, $f1)->get("field_name")); if (_hx_array_get($cF, $f1)->get("field_options") !== null) { $optionsMap->set($cFields[$f1], _hx_array_get($cF, $f1)->get("field_options")); } $def = _hx_array_get($cF, $f1)->get("field_default"); if ($def === null) { } else { switch ($def) { case "NULL": case "": break; default: $fieldDefault->set($cFields[$f1], _hx_array_get($cF, $f1)->get("field_default")); break; } } if (_hx_array_get($cF, $f1)->get("field_required") === "Y") { $fieldRequired->set($cFields[$f1], true); } $typeMap->set($cFields[$f1], _hx_array_get($cF, $f1)->get("field_type")); unset($f1, $def); } $cFields->push("entry_date"); $param->set("fields", $cFields); $sb = new StringBuf(); $phValues = new _hx_array(array()); $this->data = _hx_anonymous(array("fieldDefault" => php_Lib::associativeArrayOfHash($fieldDefault), "fieldNames" => php_Lib::associativeArrayOfHash($fieldNames), "fieldRequired" => php_Lib::associativeArrayOfHash($fieldRequired), "rows" => $this->doSelectCustom($param, $sb, $phValues), "typeMap" => php_Lib::associativeArrayOfHash($typeMap), "optionsMap" => php_Lib::associativeArrayOfHash($optionsMap), "recordings" => $this->getRecordings(Std::parseInt($param->get("lead_id"))))); $userMap = new haxe_ds_StringMap(); $sb = new StringBuf(); $phValues = new _hx_array(array()); $p = new haxe_ds_StringMap(); $p->set("table", "vicidial_users"); $p->set("fields", "user,full_name"); $p->set("where", "user_group|AGENTS_A"); haxe_Log::trace(_hx_string_rec($this->num_rows, "") . ":" . Std::string($param->get("owner")), _hx_anonymous(array("fileName" => "QC.hx", "lineNumber" => 108, "className" => "model.QC", "methodName" => "edit"))); $this->data->userMap = _hx_deref(new model_Users(null))->get_info(null); return $this->json_encode(); }
public function edit($param) { $fieldNames = new haxe_ds_StringMap(); $typeMap = null; $typeMap = model_Clients_5($this, $fieldNames, $param, $typeMap); $optionsMap = new haxe_ds_StringMap(); $eF = $this->getEditorFields(null); $keys = $eF->keys(); $tableNames = new _hx_array(array()); $tableFields = new haxe_ds_StringMap(); haxe_Log::trace($param, _hx_anonymous(array("fileName" => "Clients.hx", "lineNumber" => 139, "className" => "model.Clients", "methodName" => "edit"))); while ($keys->hasNext()) { $k = $keys->next(); $tableNames->push($k); $aFields = $eF->get($k); $cFields = $aFields->map(array(new _hx_lambda(array(&$aFields, &$eF, &$fieldNames, &$k, &$keys, &$optionsMap, &$param, &$tableFields, &$tableNames, &$typeMap), "model_Clients_6"), 'execute')); $tableFields->set($k, $cFields); $_g2 = 0; $_g1 = $cFields->length; while ($_g2 < $_g1) { $f = $_g2++; $fieldNames->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_name")); if (_hx_array_get($aFields, $f)->get("field_options") !== null) { $optionsMap->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_options")); } $typeMap->set($cFields[$f], _hx_array_get($aFields, $f)->get("field_type")); unset($f); } unset($_g2, $_g1); unset($k, $cFields, $aFields); } haxe_Log::trace($tableNames, _hx_anonymous(array("fileName" => "Clients.hx", "lineNumber" => 158, "className" => "model.Clients", "methodName" => "edit"))); $editTables = new haxe_ds_StringMap(); $ti = 0; $tableNames->remove("vicidial_list"); $tableNames->push("buchungs_anforderungen"); $_g11 = 0; while ($_g11 < $tableNames->length) { $table = $tableNames[$_g11]; ++$_g11; $p = new haxe_ds_StringMap(); $sb = new StringBuf(); $phValues = new _hx_array(array()); $p->set("primary_id", $param->get("primary_id")); switch ($table) { case "clients": $p->set("table", "vicidial_list"); $p->set("jointable", "fly_crm." . _hx_string_or_null($table)); $p->set("joincond", $param->get("joincond")); $p->set("fields", Std::string(_hx_string_call($param->get("fields"), "split", array(","))->map(array(new _hx_lambda(array(&$_g11, &$eF, &$editTables, &$fieldNames, &$keys, &$optionsMap, &$p, &$param, &$phValues, &$sb, &$table, &$tableFields, &$tableNames, &$ti, &$typeMap), "model_Clients_7"), 'execute'))->join(",")) . "," . _hx_string_or_null($tableFields->get($table)->map(array(new _hx_lambda(array(&$_g11, &$eF, &$editTables, &$fieldNames, &$keys, &$optionsMap, &$p, &$param, &$phValues, &$sb, &$table, &$tableFields, &$tableNames, &$ti, &$typeMap), "model_Clients_8"), 'execute'))->join(","))); $p->set("where", "vicidial_list.lead_id|" . Std::string($param->get("lead_id"))); $editTables->set($table, php_Lib::hashOfAssociativeArray($this->doJoin($p, $sb, $phValues))); break; case "buchungs_anforderungen": $p->set("table", "fly_crm." . _hx_string_or_null($table)); $p->set("fields", model_Clients::$pay_history_fields->map(array(new _hx_lambda(array(&$_g11, &$eF, &$editTables, &$fieldNames, &$keys, &$optionsMap, &$p, &$param, &$phValues, &$sb, &$table, &$tableFields, &$tableNames, &$ti, &$typeMap), "model_Clients_9"), 'execute'))->join(",")); $p->set("where", "`Mandat-ID`|" . Std::string($param->get("client_id")) . "K1"); $editTables->set("pay_history", php_Lib::hashOfAssociativeArray($this->doSelect($p, $sb, $phValues))); break; default: $p->set("table", model_Clients_10($this, $_g11, $eF, $editTables, $fieldNames, $keys, $optionsMap, $p, $param, $phValues, $sb, $table, $tableFields, $tableNames, $ti, $typeMap)); $p->set("fields", $tableFields->get($table)->join(",")); if ($table === "vicidial_list") { $p->set("where", "vendor_lead_code|" . Std::string($param->get("client_id"))); } else { $p->set("where", "client_id|" . Std::string($param->get("client_id"))); } $editTables->set($table, php_Lib::hashOfAssociativeArray($this->doSelect($p, $sb, $phValues))); if ($table === "pay_source") { haxe_Log::trace($tableFields->get($table), _hx_anonymous(array("fileName" => "Clients.hx", "lineNumber" => 198, "className" => "model.Clients", "methodName" => "edit"))); } break; } unset($table, $sb, $phValues, $p); } $recordings = $this->getRecordings(Std::parseInt($param->get("lead_id"))); $editTables->set("konto_auszug", php_Lib::hashOfAssociativeArray(_hx_deref(new model_ClientHistory(null))->findClient(model_Clients_11($this, $eF, $editTables, $fieldNames, $keys, $optionsMap, $param, $recordings, $tableFields, $tableNames, $ti, $typeMap), true))); $this->data = _hx_anonymous(array("fieldNames" => php_Lib::associativeArrayOfHash($fieldNames), "editData" => php_Lib::associativeArrayOfHash($editTables), "typeMap" => php_Lib::associativeArrayOfHash($typeMap), "optionsMap" => php_Lib::associativeArrayOfHash($optionsMap), "recordings" => $recordings)); $userMap = new haxe_ds_StringMap(); $sb1 = new StringBuf(); $phValues1 = new _hx_array(array()); $p1 = new haxe_ds_StringMap(); $p1->set("table", "vicidial_users"); $p1->set("fields", "user,full_name"); $p1->set("where", "user_group|AGENTS_A"); $owner = Std::parseInt(model_Clients_12($this, $eF, $editTables, $fieldNames, $keys, $optionsMap, $p1, $param, $phValues1, $recordings, $sb1, $tableFields, $tableNames, $ti, $typeMap, $userMap)); haxe_Log::trace($owner, _hx_anonymous(array("fileName" => "Clients.hx", "lineNumber" => 218, "className" => "model.Clients", "methodName" => "edit"))); $this->data->userMap = _hx_deref(new model_Users(null))->get_info(null); return $this->json_encode(); }