forked from extern/egroupware
UI to support links on unsaved entries
This commit is contained in:
parent
129eb91b3d
commit
8912d029a4
@ -157,7 +157,7 @@ class etemplate_widget_link extends etemplate_widget
|
||||
$result = egw_link::link($app, $id, $links);
|
||||
|
||||
$response = egw_json_response::get();
|
||||
$response->data($result !== false);
|
||||
$response->data(is_array($id) ? $id : $result !== false);
|
||||
}
|
||||
|
||||
public function ajax_link_list($value) {
|
||||
|
@ -315,16 +315,42 @@ var et2_link_to = et2_inputWidget.extend(
|
||||
}
|
||||
this.file_upload.progress.empty();
|
||||
|
||||
// Server says it's OK, but didn't store - we'll send this again on submit
|
||||
if(typeof success == "object" && success["Array:"])
|
||||
{
|
||||
this.options.value = success["Array:"];
|
||||
var i = 0;
|
||||
var fake_data = {
|
||||
// Icon should be in registry
|
||||
icon: egw.link_get_registry('addressbook','icon'),
|
||||
app: this.options.value.app[i].app,
|
||||
id: this.options.value.app[i].id
|
||||
};
|
||||
}
|
||||
|
||||
// Look for a link-list with the same ID, refresh it
|
||||
var self = this;
|
||||
var list_widget = null;
|
||||
this.getRoot().iterateOver(
|
||||
function(widget) {
|
||||
if(widget.id == self.id) {
|
||||
widget._get_links();
|
||||
list_widget = widget;
|
||||
if(success === true)
|
||||
{
|
||||
widget._get_links();
|
||||
}
|
||||
}
|
||||
},
|
||||
this, et2_link_list
|
||||
);
|
||||
|
||||
if(list_widget && fake_data)
|
||||
{
|
||||
egw.link_title(fake_data.app, fake_data.id, function(title) {
|
||||
fake_data.title = title;
|
||||
list_widget._add_link(fake_data);
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user