diff --git a/layouts/v7/modules/Vtiger/resources/Detail.js b/layouts/v7/modules/Vtiger/resources/Detail.js index 86842fa212b404273c3b5761b77884c489b45c97..fc0f6890f9560660154668e1fa9737fd42e2db05 100644 --- a/layouts/v7/modules/Vtiger/resources/Detail.js +++ b/layouts/v7/modules/Vtiger/resources/Detail.js @@ -1136,7 +1136,7 @@ Vtiger.Class("Vtiger_Detail_Js",{ fieldName = multiPicklistFieldName[0]; } - var customHandlingFields = ['owner','ownergroup','picklist','multipicklist','reference','currencyList','text']; + var customHandlingFields = ['owner','ownergroup','picklist','multipicklist','reference','currencyList','text', 'documentsFolder']; if(jQuery.inArray(fieldType, customHandlingFields) !== -1){ value = rawValue; } diff --git a/layouts/v7/modules/Vtiger/resources/Field.js b/layouts/v7/modules/Vtiger/resources/Field.js index 78dacb077adbe4871a8fb0315d50ee0c50a74c7e..a8891ac7b8d05304be0ba5c260ed02de813e9f09 100644 --- a/layouts/v7/modules/Vtiger/resources/Field.js +++ b/layouts/v7/modules/Vtiger/resources/Field.js @@ -289,6 +289,48 @@ Vtiger_Field_Js('Vtiger_Picklist_Field_Js',{},{ } }); +Vtiger_Field_Js('Vtiger_Documentsfolder_Field_Js',{},{ + + /** + * Function to get the pick list values + * @return <object> key value pair of options + */ + getPickListValues : function() { + return this.get('documentFolders'); + }, + + /** + * Function to get the ui + * @return - select element and chosen element + */ + getUi : function() { + //added class inlinewidth + var html = '<select class="select2 inputElement inlinewidth" name="'+ this.getName() +'" id="field_'+this.getModuleName()+'_'+this.getName()+'">'; + var pickListValues = this.getPickListValues(); + var selectedOption = app.htmlDecode(this.getValue()); + + if(typeof pickListValues[' '] == 'undefined' || pickListValues[' '].length <= 0 || pickListValues[' '] != 'Select an Option') { + html += '<option value="">'+app.vtranslate('JS_SELECT_OPTION')+'</option>'; + } + + var data = this.getData(); + + var fieldName = this.getName(); + for(var option in pickListValues) { + html += '<option value="'+option+'" '; + if(option == selectedOption) { + html += ' selected '; + } + html += '>'+pickListValues[option]+'</option>'; + } + html +='</select>'; + + var selectContainer = jQuery(html); + this.addValidationToElement(selectContainer); + return selectContainer; + } +}); + Vtiger_Field_Js('Vtiger_Currencylist_Field_Js',{},{ /** diff --git a/modules/Vtiger/models/Field.php b/modules/Vtiger/models/Field.php index 27324065da7e76b1863589afe9acbff96a766e0e..df0987285df9cc5e23579da26505dc883fecebcf 100644 --- a/modules/Vtiger/models/Field.php +++ b/modules/Vtiger/models/Field.php @@ -583,6 +583,13 @@ class Vtiger_Field_Model extends Vtiger_Field { $this->fieldInfo['picklistColors'] = $picklistColors; } } + + if($fieldDataType == "documentsFolder"){ + $documentFolders = $this->getDocumentFolders(); + if(!empty($documentFolders)) { + $this->fieldInfo['documentFolders'] = $documentFolders; + } + } if($fieldDataType === 'currencyList'){ $currencyList = $this->getCurrencyList();