$current_version = getIntFromRequest('current_version', 0);
$version = getIntFromRequest('edit_version', 0);
$new_version = getIntFromRequest('new_version', 0);
+$newobjectsassociation = getStringFromRequest('newobjectsassociation');
if (!$docid) {
$warning_msg = _('No document found to update');
$vcomment = $dv->getComment();
$version = $current_version_radio;
$current_version = 1;
+} elseif ($newobjectsassociation) {
+ if (!$d->addAssociations($newobjectsassociation)) {
+ $error_msg = $d->getErrorMessage();
+ } else {
+ $feedback = sprintf(_('Document [D%s] updated successfully.'), $d->getID());
+ }
+ session_redirect($urlparam);
} else {
$warning_msg = _('No action to perform');
session_redirect($urlparam);
function showAddAssociations($url = false) {
global $HTML;
- $content = '';
- echo _('Add new associate object')._(':');
+ $content = html_ao('span', array()). _('Add new associate object')._(':');
if ($url !== false) {
$content .= $HTML->openForm(array('action' => $url, 'method' => 'post'));
}
$content .= html_e('input', array('type' => 'submit', 'value' => _('Add')));
$content .= $HTML->closeForm();
}
+ $content .= html_ac(html_ap() -1);
return $content;
}
}
}, this));
jQuery.getJSON(this.listfileparams.docManURL + '/?group_id=' + docid_groupid + '&action=getassociations&docid='+ this.docparams.id, jQuery.proxy(function(data){
- if (typeof data.html != 'undefined') {
+ if (typeof data.html != 'undefined') {
jQuery('#tabbereditfile-association > .feedback').remove();
jQuery('#tabbereditfile-association > .error').remove();
jQuery('#tabbereditfile-association > .warning_msg').remove();
+ jQuery('#tabbereditfile-association > table').remove();
+ jQuery('#tabbereditfile-association > span').remove();
jQuery('#tabbereditfile-association').prepend(data.html);
}
}, this));