Commit 88b8e521 authored by andy gu's avatar andy gu
Browse files

phase out rootendpoint

parent ae03eff2
......@@ -22,7 +22,6 @@ include "Export.php";
function _civicrm_api3_exporter_Bulk_spec(&$spec) {
$spec['key']['api.required'] = 1;
$spec['endpoint']['api.required'] = 1;
$spec['endpoint_root']['api.required'] = 1;
$spec['allow_restart']['api.required'] = 0;
$spec['group']['api.required'] = 0;
$spec['updatejob']['api.required'] = 0;
......@@ -105,8 +104,8 @@ function civicrm_api3_exporter_Bulk($params) {
// Use a sha1 of the key with the endpoint to generate our identifier.
// change the hash to the URL if Civi, key if actionnetwork
$hash = "CIVI_ID_actionnetwork_" . sha1($params["key"]);
if (strpos($params["endpoint_root"], "actionnetwork.org") === FALSE) {
$hash = "CIVI_ID_" . sha1($params["endpoint_root"]);
if (strpos($params["updateendpoint"], "actionnetwork.org") === FALSE) {
$hash = "CIVI_ID_" . sha1($params["updateendpoint"]);
}
$second_key = $params["endpoint"] . $hash;
......
......@@ -231,9 +231,6 @@ function civicrm_api3_o_s_d_i_job_Add($params) {
if ($params["signupendpoint"] != "") {
$exportonceparams[] = "endpoint=" . $params["signupendpoint"];
}
if ($params["rootendpoint"] != "") {
$exportonceparams[] = "endpoint_root=" . $params["rootendpoint"];
}
$exportonceparams[] = "allow_restart=0";
if ($params["groupid"] != "") {
$exportonceparams[] = "group=" . $params["groupid"];
......@@ -269,9 +266,6 @@ function civicrm_api3_o_s_d_i_job_Add($params) {
if ($params["signupendpoint"] != "") {
$exportmanyparams[] = "endpoint=" . $params["signupendpoint"];
}
if ($params["rootendpoint"] != "") {
$exportmanyparams[] = "endpoint_root=" . $params["rootendpoint"];
}
$exportmanyparams[] = "allow_restart=1";
if ($params["groupid"] != "") {
$exportmanyparams[] = "group=" . $params["groupid"];
......
......@@ -379,13 +379,6 @@
);
var endpoint = data["civiendpoint"];
var endpointroot = data["civiendpoint"];
if (endpoint.indexOf("actionnetwork.org") !== -1) {
endpointroot = endpointroot.substring(0, endpointroot.indexOf("/people"));
} else {
endpointroot = endpointroot.substring(0, endpointroot.indexOf("/civicrm"))
+ "/civicrm";
}
if (data["resource"] == 1) {
e.preventDefault();
......@@ -395,7 +388,6 @@
CRM.api3('Exporter', 'bulk', {
"zone": data["zone"],
"allow_restart": 1,
"endpoint_root": endpointroot,
"group": data["group"],
"required": data["required"],
"key": data["apikey"],
......
......@@ -17,10 +17,6 @@
<option value="0" disabled="disabled">Imported Resource</option>
<option value="1" selected="selected">Contacts</option>
</select>
<br>
<label for="rootendpoint">Sync Endpoint (root)</label>
<input type="text" name="rootendpoint" id="rootendpoint" class="text ui-widget-content ui-corner-all" value="localhost/civicrm">
<br>
<label for="signupendpoint">Sync Endpoint (Person Signup Helper)</label>
<input type="text" name="signupendpoint" id="signupendpoint" class="text ui-widget-content ui-corner-all" value="localhost/civicrm/osdi/webhook">
<br>
......@@ -173,7 +169,6 @@
function addJob() {
jobname = CRM.$("#name");
resource = CRM.$("select#resource option:checked");
rootendpoint = CRM.$("#rootendpoint");
signupendpoint = CRM.$("#signupendpoint");
peopleendpoint = CRM.$("#peopleendpoint");
groupid = CRM.$("#groupid");
......@@ -187,7 +182,7 @@
CRM.api3('OSDIJob', 'Add', {
"name": jobname.val(),
"resource": resource.val(),
"rootendpoint": rootendpoint.val(),
"rootendpoint": peopleendpoint.val(),
"signupendpoint": signupendpoint.val(),
"peopleendpoint": peopleendpoint.val(),
"groupid": groupid.val(),
......@@ -207,7 +202,7 @@
}
if (!edit) {
// redirect to mapping
window.location.href = "/civicrm/osdi/mapping?change=1&endpoint=" + rootendpoint.val();
window.location.href = "/civicrm/osdi/mapping?change=1&endpoint=" + peopleendpoint.val();
}
});
......@@ -222,7 +217,7 @@
CRM.$('[id^="edit_"]').click(function() {
jobname = CRM.$("#name");
resource = CRM.$("select#resource option:checked");
rootendpoint = CRM.$("#rootendpoint");
rootendpoint = CRM.$("#peopleendpoint");
signupendpoint = CRM.$("#signupendpoint");
peopleendpoint = CRM.$("#peopleendpoint");
groupid = CRM.$("#groupid");
......@@ -273,7 +268,6 @@
if ("zone" in parameterarray) CRM.$("#timezone")[0].selectedIndex
= parseInt(parameterarray["zone"], 10) + 13;
if ("required" in parameterarray) reqfields.val(parameterarray["required"]);
rootendpoint.val(parameterarray["endpoint"]);
key.val(parameterarray["key"]);
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment