Improved the Admin Fields Relations area to allow more custom coding without the need of selecting Join Field/s. Improved the dynamic get string fixing implementation to avoid conflict when the same field name is used in multiple joined tables requiering string fixing. Fixed gh-322 to insure ID is always readonly even if override detected. Added new feature to control access and view/hide control per/field.

This commit is contained in:
2018-07-21 09:10:37 +02:00
parent 0a7b91829f
commit 6dd654c745
18 changed files with 469 additions and 329 deletions

View File

@ -270,14 +270,16 @@
name="permission"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_DESCRIPTION"
class="fieldMid"
multiple="false"
class="fieldMedium"
multiple="true"
required="false">
<!-- Option Set. -->
<option value="0">
COM_COMPONENTBUILDER_ADMIN_FIELDS_NONE</option>
<option value=" 1">
<option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_EDITING</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_FIELDS_ACCESS</option>
<option value="3">
COM_COMPONENTBUILDER_ADMIN_FIELDS_VIEW</option>
</field>
</form>
</field>

View File

@ -20,14 +20,14 @@ function getCodeGlueOptions(field) {
var subID = target[0]+'__'+target[1];
// get listfield value
var listfield = jQuery('#'+subID+'__listfield').val();
// get joinfields values
var joinfields = jQuery('#'+subID+'__joinfields').val();
// get type value
var type = jQuery('#'+subID+'__join_type').val();
// get area value
var area = jQuery('#'+subID+'__area').val();
// check that values are set
if (_isSet(listfield) && _isSet(joinfields) && _isSet(type) && _isSet(area)) {
if (_isSet(listfield) && _isSet(type) && _isSet(area)) {
// get joinfields values
var joinfields = jQuery('#'+subID+'__joinfields').val();
// get codeGlueOptions
getCodeGlueOptions_server(listfield, joinfields, type, area).done(function(result) {
if(result){
@ -43,7 +43,11 @@ function getCodeGlueOptions(field) {
function getCodeGlueOptions_server(listfield, joinfields, type, area){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getCodeGlueOptions&format=json";
if(token.length > 0 && listfield > 0 && joinfields.length >= 1 && type > 0 && area > 0) {
// make sure the joinfields are set
if (!_isSet(joinfields)) {
joinfields = 'none';
}
if(token.length > 0 && listfield > 0 && type > 0 && area > 0) {
var request = 'token='+token+'&listfield='+listfield+'&type='+type+'&area='+area+'&joinfields='+joinfields;
}
return jQuery.ajax({