diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index b197f9fd8..2efc9d313 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -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) { diff --git a/modules/backend/behaviors/relationcontroller/assets/js/october.relation.js b/modules/backend/behaviors/relationcontroller/assets/js/october.relation.js index 5e13a2810..85c052814 100644 --- a/modules/backend/behaviors/relationcontroller/assets/js/october.relation.js +++ b/modules/backend/behaviors/relationcontroller/assets/js/october.relation.js @@ -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 = $('') 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 } }) }