Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1291 → Rev 1292

/trunk/includes/oidplus_base.js
218,6 → 218,7
console.error(_L("Error: %1",errorThrown));
},
success:function(data) {
// TODO: Use oidplus_ajax_success(), since this checks the existance of "error" in data, and checks if status>=0
if ("error" in data) {
alertError(_L("Failed to load content: %1",data.error));
console.error(data.error);
/trunk/plugins/viathinksoft/adminPages/400_oidinfo_export/OIDplusPageAdminOIDInfoExport.js
75,6 → 75,7
error: oidplus_ajax_error,
success:function(data) {
// TODO XXX: (Future feature) If the user decides that existing OIDs shall be overwritten, then we may not print "Ignored OIDs because they are already existing"
// TODO: Use oidplus_ajax_success(), since this checks the existance of "error" in data, and checks if status>=0
if (typeof data === "object" && "error" in data) {
if (typeof data === "object" && "count_imported_oids" in data) {
// TODO: Device if alertSuccess, alertWarning oder alertError is shown
/trunk/plugins/viathinksoft/adminPages/900_software_update/OIDplusPageAdminSoftwareUpdate.js
63,6 → 63,7
}
},
success: function(data) {
// TODO: Use oidplus_ajax_success(), since this checks the existance of "error" in data, and checks if status>=0
//hide_waiting_anim();
if (typeof data === "object" && "error" in data) {
$("#update_header").text(_L("Update failed"));
/trunk/plugins/viathinksoft/adminPages/910_automated_ajax_calls/examples/example_js.html
31,12 → 31,8
success:function(data) {
if ("error" in data) {
alert("Error: " + data.error);
} else if (data.status == 0/*OK*/) {
} else if (data.status >= 0/*OK*/) {
alert("Insert OK");
} else if (data.status == 1/*RaNotExisting*/) {
alert("Insert OK");
} else if (data.status == 2/*RaNotExistingNoInvitation*/) {
alert("Insert OK");
} else {
alert("Error: " + data);
}
/trunk/plugins/viathinksoft/adminPages/910_automated_ajax_calls/examples/example_php.phps
37,12 → 37,8
 
if (isset($json['error'])) {
die($json['error']."\n");
} else if ($json['status'] == 0/*OK*/) {
} else if ($json['status'] >= 0) {
die("Insert OK\n");
} else if ($json['status'] == 1/*RaNotExisting*/) {
die("Insert OK\n");
} else if ($json['status'] == 2/*RaNotExistingNoInvitation*/) {
die("Insert OK\n");
} else {
die("Error ".print_r($json,true)."\n");
}
/trunk/plugins/viathinksoft/adminPages/910_automated_ajax_calls/examples/example_python.py
25,11 → 25,7
 
if json['error'] != None:
print(json['error']);
elif json['status'] == 0: # OK
elif json['status'] >= 0: # OK
print("Insert OK");
elif json['status'] == 1: # RaNotExisting
print("Insert OK");
elif json['status'] == 2: # RaNotExistingNoInvitation
print("Insert OK");
else:
print("Error "+json);
/trunk/plugins/viathinksoft/publicPages/000_objects/OIDplusPagePublicObjects.class.php
379,7 → 379,7
* @throws OIDplusConfigInitializationException
* @throws OIDplusException
*/
public function action_Update(array $params): array {
private function action_Update(array $params): array {
_CheckParamExists($params, 'id');
$id = $params['id'];
$obj = OIDplusObject::parse($id);
546,7 → 546,7
* @throws OIDplusConfigInitializationException
* @throws OIDplusException
*/
public function action_Insert(array $params): array {
private function action_Insert(array $params): array {
// Check if you have write rights on the parent (to create a new object)
_CheckParamExists($params, 'parent');
$objParent = OIDplusObject::parse($params['parent']);
711,6 → 711,23
}
 
/**
* Generate UUID (will be used by a few plugins)
* @param array $params Nothing
* @return array status=0 success, status<0 error. If success, then also uuid, intval
* @throws OIDplusConfigInitializationException
* @throws OIDplusException
*/
private function action_UuidGen(array $params): array {
$uuid = gen_uuid(OIDplus::config()->getValue('uuid_prefer_timebased', '1') == '1');
if (!$uuid) return array("status" => -1);
return array(
"status" => 0,
"uuid" => $uuid,
"intval" => substr(uuid_to_oid($uuid),strlen('2.25.'))
);
}
 
/**
* @param string $actionID
* @param array $params
* @return array
725,14 → 742,7
} else if ($actionID == 'Insert') {
return $this->action_Insert($params);
} else if ($actionID == 'generate_uuid') {
// Generate UUID (will be used by a few plugins)
$uuid = gen_uuid(OIDplus::config()->getValue('uuid_prefer_timebased', '1') == '1');
if (!$uuid) return array("status" => 1);
return array(
"status" => 0,
"uuid" => $uuid,
"intval" => substr(uuid_to_oid($uuid),strlen('2.25.'))
);
return $this->action_UuidGen($params);
} else {
return parent::action($actionID, $params);
}
/trunk/plugins/viathinksoft/raPages/910_automated_ajax_calls/examples/example_js.html
31,12 → 31,8
success:function(data) {
if ("error" in data) {
alert("Error: " + data.error);
} else if (data.status == 0/*OK*/) {
} else if (data.status >= 0/*OK*/) {
alert("Insert OK");
} else if (data.status == 1/*RaNotExisting*/) {
alert("Insert OK");
} else if (data.status == 2/*RaNotExistingNoInvitation*/) {
alert("Insert OK");
} else {
alert("Error: " + data);
}
/trunk/plugins/viathinksoft/raPages/910_automated_ajax_calls/examples/example_php.phps
37,12 → 37,8
 
if (isset($json['error'])) {
die($json['error']."\n");
} else if ($json['status'] == 0/*OK*/) {
} else if ($json['status'] >= 0) {
die("Insert OK\n");
} else if ($json['status'] == 1/*RaNotExisting*/) {
die("Insert OK\n");
} else if ($json['status'] == 2/*RaNotExistingNoInvitation*/) {
die("Insert OK\n");
} else {
die("Error ".print_r($json,true)."\n");
}
/trunk/plugins/viathinksoft/raPages/910_automated_ajax_calls/examples/example_python.py
25,11 → 25,7
 
if json['error'] != None:
print(json['error']);
elif json['status'] == 0: # OK
elif json['status'] >= 0: # OK
print("Insert OK");
elif json['status'] == 1: # RaNotExisting
print("Insert OK");
elif json['status'] == 2: # RaNotExistingNoInvitation
print("Insert OK");
else:
print("Error "+json);