getAll(); if(!empty($params['connectionId'])) { $sql = 'UPDATE vtiger_wf_provider SET title = ? WHERE id = ?'; $adb->pquery($sql, array($params['title'], $params['connectionId'])); } else { $sql = 'INSERT INTO vtiger_wf_provider SET type = ?, title = ?'; $adb->pquery($sql, array($params['type'], $params['title']), true); $params['connectionId'] = \Workflow\VtUtils::LastDBInsertID();; } $connection = \Workflow\ConnectionProvider::getConnection($params['connectionId']); $connection->saveConfiguration($params['settings']); /*try { $return = $connection->test(); } catch (\Exception $exp) { echo json_encode(array('result' => 'error', 'message' => $exp->getMessage())); exit(); }*/ echo json_encode(array('result' => 'ok')); } }