Propagate the readOnly option to the viewClickList AJAX action

This commit is contained in:
Jérémy Gaulin 2016-08-08 08:35:57 +02:00
parent c4007dd570
commit 7f22ba62dc
2 changed files with 6 additions and 4 deletions

View File

@ -599,10 +599,11 @@ class RelationController extends ControllerBehavior
$config->recordUrl = $this->getConfig('view[recordUrl]', null);
$defaultOnClick = sprintf(
"$.oc.relationBehavior.clickViewListRecord(':%s', '%s', '%s')",
"$.oc.relationBehavior.clickViewListRecord(':%s', '%s', '%s', %s)",
$this->relationModel->getKeyName(),
$this->field,
$this->relationGetSessionKey()
$this->relationGetSessionKey(),
$this->readOnly ? 1 : 0
);
if ($config->recordUrl) {

View File

@ -9,7 +9,7 @@
$(el).closest('.control-list').listWidget('toggleChecked', [el])
}
this.clickViewListRecord = function(recordId, relationField, sessionKey) {
this.clickViewListRecord = function(recordId, relationField, sessionKey, readOnly) {
var newPopup = $('<a />')
newPopup.popup({
@ -18,7 +18,8 @@
extraData: {
'manage_id': recordId,
'_relation_field': relationField,
'_session_key': sessionKey
'_session_key': sessionKey,
'_relation_read_only': readOnly ? 1 : 0
}
})
}