diff --git a/layouts/v7/modules/Calendar/Export.tpl b/layouts/v7/modules/Calendar/Export.tpl
deleted file mode 100644
index 9e7945aa73e66859220dd3a48bfb52cd18e94ebd..0000000000000000000000000000000000000000
--- a/layouts/v7/modules/Calendar/Export.tpl
+++ /dev/null
@@ -1,60 +0,0 @@
-{*<!--
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
-* ("License"); You may not use this file except in compliance with the License
-* The Original Code is: vtiger CRM Open Source
-* The Initial Developer of the Original Code is vtiger.
-* Portions created by vtiger are Copyright (C) vtiger.
-* All Rights Reserved.
-*
-********************************************************************************/
--->*}
-
-<div class="fc-overlay-modal modal-content">
-    <form id="exportForm" class="form-horizontal" method="post" action="index.php">
-        <input type="hidden" name="module" value="{$SOURCE_MODULE}" />
-        <input type="hidden" name="source_module" value="{$SOURCE_MODULE}" />
-        <input type="hidden" name="action" value="ExportData" />
-        <input type="hidden" name="viewname" value="{$VIEWID}" />
-        <input type="hidden" name="selected_ids" value={ZEND_JSON::encode($SELECTED_IDS)}>
-        <input type="hidden" name="excluded_ids" value={ZEND_JSON::encode($EXCLUDED_IDS)}>
-        <input type="hidden" id="page" name="page" value="{$PAGE}" />
-        <input type="hidden" value="export" name="view">
-
-        <div class="overlayHeader">
-            {include file="ModalHeader.tpl"|vtemplate_path:$MODULE TITLE={vtranslate('LBL_EXPORT_RECORDS', $MODULE)}}
-        </div>
-        <div class="modal-body" style="margin-bottom:250px">
-            <div class="well exportContents">
-                <div>
-                    <label style ="font-weight:normal">&nbsp;&nbsp;{vtranslate('LBL_EXPORT_FILE_NAME',$MODULE)}</label>
-                    <input type='text' name='filename' id='filename' size='25' value='vtiger.calendar'/>
-                </div>
-                <hr>
-                <div>
-                    <input type="radio" name="mode" value="ExportSelectedRecords" id ="group1" {if !empty($SELECTED_IDS)} checked="checked" {else} disabled="disabled"{/if} />
-                    <label style ="font-weight:normal" for="group1">&nbsp;&nbsp;{vtranslate('LBL_EXPORT_SELECTED_RECORDS',$MODULE)}</label>
-                    {if empty($SELECTED_IDS)}&nbsp; <span style ="color:red">{vtranslate('LBL_NO_RECORD_SELECTED',$MODULE)}</span>{/if}
-                </div>
-                <br>
-                <div>
-                    <input type="radio" name="mode" value="ExportCurrentPage" id ="group2"/>
-                    <label style ="font-weight:normal" for="group2">&nbsp;&nbsp;{vtranslate('LBL_EXPORT_DATA_IN_CURRENT_PAGE',$MODULE)}</label>
-                </div>
-                <br>
-                <div>
-                    <input type="radio" name="mode" value="ExportAllData" id ="group3" {if empty($SELECTED_IDS)} checked="checked" {/if}/>
-                    <label style ="font-weight:normal" for="group3">&nbsp;&nbsp;{vtranslate('LBL_EXPORT_ALL_DATA',$MODULE)}</label>
-                </div>
-            </div>
-        </div>
-        <div class='modal-overlay-footer clearfix'>
-            <div class="row clearfix">
-                    <div class='textAlignCenter col-lg-12 col-md-12 col-sm-12 '><button type="submit" class="btn btn-success btn-lg">{vtranslate($MODULE, $MODULE)}&nbsp;{vtranslate($SOURCE_MODULE, $MODULE)}</button>
-                    &nbsp;&nbsp;<a class='cancelLink' data-dismiss="modal" href="#">{vtranslate('LBL_CANCEL', $MODULE)}</a>
-                </div>
-            </div>
-        </div>
-    </form>
-</div>
-
diff --git a/layouts/v7/modules/Documents/ModuleHeader.tpl b/layouts/v7/modules/Documents/ModuleHeader.tpl
index 3a7a772ced785ad8311d2e6e1c3e04e4612c4b2c..233212f49bc4010d76ba6690d0db0222eceacb23 100644
--- a/layouts/v7/modules/Documents/ModuleHeader.tpl
+++ b/layouts/v7/modules/Documents/ModuleHeader.tpl
@@ -8,132 +8,129 @@
 * All Rights Reserved.
 ************************************************************************************/
 -->*}
-    
+
 {strip}
-    <div class="col-sm-12 col-xs-12 module-action-bar clearfix coloredBorderTop">
-        <div class="module-action-content clearfix">
-            <div class="col-lg-7 col-md-7 module-breadcrumb module-breadcrumb-{$smarty.request.view}">
-                    {assign var=MODULE_MODEL value=Vtiger_Module_Model::getInstance($MODULE)}
-                    {if $MODULE_MODEL->getDefaultViewName() neq 'List'}
-                        {assign var=DEFAULT_FILTER_URL value=$MODULE_MODEL->getDefaultUrl()}
-                    {else}
-                        {assign var=DEFAULT_FILTER_ID value=$MODULE_MODEL->getDefaultCustomFilter()}
-                        {if $DEFAULT_FILTER_ID}
-                            {assign var=CVURL value="&viewname="|cat:$DEFAULT_FILTER_ID}
-                            {assign var=DEFAULT_FILTER_URL value=$MODULE_MODEL->getListViewUrl()|cat:$CVURL}
-                        {else}
-                            {assign var=DEFAULT_FILTER_URL value=$MODULE_MODEL->getListViewUrlWithAllFilter()}
-                        {/if}
-                    {/if}
-                    <a title="{vtranslate($MODULE, $MODULE)}" href='{$DEFAULT_FILTER_URL}&app={$SELECTED_MENU_CATEGORY}'><h4 class="module-title pull-left textOverflowEllipsis text-uppercase"> {vtranslate($MODULE, $MODULE)} </h4>&nbsp;&nbsp;</a>
-                    {if $smarty.session.lvs.$MODULE.viewname}
-                        {assign var=VIEWID value=$smarty.session.lvs.$MODULE.viewname}
-                    {/if}
-                    {if $VIEWID}
-                    {foreach item=FILTER_TYPES from=$CUSTOM_VIEWS}
-                        {foreach item=FILTERS from=$FILTER_TYPES}
-                            {if $FILTERS->get('cvid') eq $VIEWID}
-                                {assign var=CVNAME value=$FILTERS->get('viewname')}
-                                {break}
-                            {/if}
-                        {/foreach}
-                    {/foreach}
-                    <p  class="current-filter-name filter-name pull-left cursorPointer" title="{$CVNAME}"><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a  href='{$MODULE_MODEL->getListViewUrl()}&viewname={$VIEWID}'>&nbsp;&nbsp;{$CVNAME}&nbsp;&nbsp;</a> </p>
-                        {/if}
-                        {assign var=SINGLE_MODULE_NAME value='SINGLE_'|cat:$MODULE}
-                        {if $RECORD and $smarty.request.view eq 'Edit'}
-                    <p class="current-filter-name filter-name pull-left "><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a title="{$RECORD->get('label')}">&nbsp;&nbsp;{vtranslate('LBL_EDITING', $MODULE)} : {$RECORD->get('label')} &nbsp;&nbsp;</a></p>
-                {else if $smarty.request.view eq 'Edit'}
-                    <p class="current-filter-name filter-name pull-left "><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a>&nbsp;&nbsp;{vtranslate('LBL_ADDING_NEW', $MODULE)}&nbsp;&nbsp;</a></p>
-                {/if}
-                {if $smarty.request.view eq 'Detail'}
-                    <p class="current-filter-name filter-name pull-left"><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a title="{$RECORD->get('label')}">&nbsp;&nbsp;{$RECORD->get('label')} &nbsp;&nbsp;</a></p>
-                {/if}
-            </div>
-            <div class="col-lg-5 col-md-5 pull-right ">
-                <div id="appnav" class="navbar-right">
-                    <ul class="nav navbar-nav">
-                        {foreach item=BASIC_ACTION from=$MODULE_BASIC_ACTIONS}
-                            {if $BASIC_ACTION->getLabel() eq 'LBL_ADD_RECORD'}
-                                <li>
-                                    <div>
-                                        <button type="button" class="btn btn-default module-buttons dropdown-toggle" data-toggle="dropdown">
-                                            <span class="fa fa-plus" title="{vtranslate('LBL_NEW_DOCUMENT', $MODULE)}"></span>&nbsp;{vtranslate('LBL_NEW_DOCUMENT', $MODULE)}&nbsp; <span class="caret"></span>
-                                        </button>
-                                        <ul class="dropdown-menu">
-                                            <li class="dropdown-header"><i class="fa fa-upload"></i> {vtranslate('LBL_FILE_UPLOAD', $MODULE)}</li>
-                                            <li id="VtigerAction">
-                                                <a href="javascript:Documents_Index_Js.uploadTo('Vtiger')">
-                                                    <img style="  margin-top: -3px;margin-right: 4%;" title="Vtiger" alt="Vtiger" src="layouts/v7/skins//images/Vtiger.png">
-                                                    {vtranslate('LBL_TO_SERVICE', $MODULE_NAME, {vtranslate('LBL_VTIGER', $MODULE_NAME)})}
-                                                </a>
-                                            </li>
-                                            <li role="separator" class="divider"></li>
-                                            <li class="dropdown-header"><i class="fa fa-link"></i> {vtranslate('LBL_LINK_EXTERNAL_DOCUMENT', $MODULE)}</li>
-                                            <li id="shareDocument"><a href="javascript:Documents_Index_Js.createDocument('E')">&nbsp;<i class="fa fa-external-link"></i>&nbsp; {vtranslate('LBL_FROM_SERVICE', $MODULE_NAME, {vtranslate('LBL_FILE_URL', $MODULE_NAME)})}</a></li>
-                                            <li role="separator" class="divider"></li>
-                                            <li id="createDocument"><a href="javascript:Documents_Index_Js.createDocument('W')"><i class="fa fa-file-text"></i> {vtranslate('LBL_CREATE_NEW', $MODULE_NAME, {vtranslate('SINGLE_Documents', $MODULE_NAME)})}</a></li>
-                                        </ul>
-                                    </div>
-                                </li>
-                            {/if}
+	<div class="col-sm-12 col-xs-12 module-action-bar clearfix coloredBorderTop">
+		<div class="module-action-content clearfix">
+			<div class="col-lg-7 col-md-7 module-breadcrumb module-breadcrumb-{$smarty.request.view}">
+				{assign var=MODULE_MODEL value=Vtiger_Module_Model::getInstance($MODULE)}
+				{if $MODULE_MODEL->getDefaultViewName() neq 'List'}
+					{assign var=DEFAULT_FILTER_URL value=$MODULE_MODEL->getDefaultUrl()}
+				{else}
+					{assign var=DEFAULT_FILTER_ID value=$MODULE_MODEL->getDefaultCustomFilter()}
+					{if $DEFAULT_FILTER_ID}
+						{assign var=CVURL value="&viewname="|cat:$DEFAULT_FILTER_ID}
+						{assign var=DEFAULT_FILTER_URL value=$MODULE_MODEL->getListViewUrl()|cat:$CVURL}
+					{else}
+						{assign var=DEFAULT_FILTER_URL value=$MODULE_MODEL->getListViewUrlWithAllFilter()}
+					{/if}
+				{/if}
+				<a title="{vtranslate($MODULE, $MODULE)}" href='{$DEFAULT_FILTER_URL}&app={$SELECTED_MENU_CATEGORY}'><h4 class="module-title pull-left textOverflowEllipsis text-uppercase"> {vtranslate($MODULE, $MODULE)} </h4>&nbsp;&nbsp;</a>
+				{if $smarty.session.lvs.$MODULE.viewname}
+					{assign var=VIEWID value=$smarty.session.lvs.$MODULE.viewname}
+				{/if}
+				{if $VIEWID}
+					{foreach item=FILTER_TYPES from=$CUSTOM_VIEWS}
+						{foreach item=FILTERS from=$FILTER_TYPES}
+							{if $FILTERS->get('cvid') eq $VIEWID}
+								{assign var=CVNAME value=$FILTERS->get('viewname')}
+								{break}
+							{/if}
+						{/foreach}
+					{/foreach}
+					<p  class="current-filter-name filter-name pull-left cursorPointer" title="{$CVNAME}"><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a  href='{$MODULE_MODEL->getListViewUrl()}&viewname={$VIEWID}'>&nbsp;&nbsp;{$CVNAME}&nbsp;&nbsp;</a> </p>
+				{/if}
+				{assign var=SINGLE_MODULE_NAME value='SINGLE_'|cat:$MODULE}
+				{if $RECORD and $smarty.request.view eq 'Edit'}
+					<p class="current-filter-name filter-name pull-left "><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a title="{$RECORD->get('label')}">&nbsp;&nbsp;{vtranslate('LBL_EDITING', $MODULE)} : {$RECORD->get('label')} &nbsp;&nbsp;</a></p>
+				{else if $smarty.request.view eq 'Edit'}
+					<p class="current-filter-name filter-name pull-left "><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a>&nbsp;&nbsp;{vtranslate('LBL_ADDING_NEW', $MODULE)}&nbsp;&nbsp;</a></p>
+				{/if}
+				{if $smarty.request.view eq 'Detail'}
+					<p class="current-filter-name filter-name pull-left"><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a title="{$RECORD->get('label')}">&nbsp;&nbsp;{$RECORD->get('label')} &nbsp;&nbsp;</a></p>
+				{/if}
+			</div>
+			<div class="col-lg-5 col-md-5 pull-right ">
+				<div id="appnav" class="navbar-right">
+					<ul class="nav navbar-nav">
+						{foreach item=BASIC_ACTION from=$MODULE_BASIC_ACTIONS}
+							{if $BASIC_ACTION->getLabel() eq 'LBL_ADD_RECORD'}
+								<li>
+									<div>
+										<button type="button" class="btn btn-default module-buttons dropdown-toggle" data-toggle="dropdown">
+											<span class="fa fa-plus" title="{vtranslate('LBL_NEW_DOCUMENT', $MODULE)}"></span>&nbsp;{vtranslate('LBL_NEW_DOCUMENT', $MODULE)}&nbsp; <span class="caret"></span>
+										</button>
+										<ul class="dropdown-menu">
+											<li class="dropdown-header"><i class="fa fa-upload"></i> {vtranslate('LBL_FILE_UPLOAD', $MODULE)}</li>
+											<li id="VtigerAction">
+												<a href="javascript:Documents_Index_Js.uploadTo('Vtiger')">
+													<img style="  margin-top: -3px;margin-right: 4%;" title="Vtiger" alt="Vtiger" src="layouts/v7/skins//images/Vtiger.png">
+													{vtranslate('LBL_TO_SERVICE', $MODULE_NAME, {vtranslate('LBL_VTIGER', $MODULE_NAME)})}
+												</a>
+											</li>
+											<li role="separator" class="divider"></li>
+											<li class="dropdown-header"><i class="fa fa-link"></i> {vtranslate('LBL_LINK_EXTERNAL_DOCUMENT', $MODULE)}</li>
+											<li id="shareDocument"><a href="javascript:Documents_Index_Js.createDocument('E')">&nbsp;<i class="fa fa-external-link"></i>&nbsp; {vtranslate('LBL_FROM_SERVICE', $MODULE_NAME, {vtranslate('LBL_FILE_URL', $MODULE_NAME)})}</a></li>
+											<li role="separator" class="divider"></li>
+											<li id="createDocument"><a href="javascript:Documents_Index_Js.createDocument('W')"><i class="fa fa-file-text"></i> {vtranslate('LBL_CREATE_NEW', $MODULE_NAME, {vtranslate('SINGLE_Documents', $MODULE_NAME)})}</a></li>
+										</ul>
+									</div>
+								</li>
+							{/if}
+						{/foreach}
 
-                        {/foreach}
-                        
-                        {if $MODULE_SETTING_ACTIONS|@count gt 0}
-                            <li>
-                                <div class="settingsIcon">
-                                    <button type="button" class="btn btn-default module-buttons dropdown-toggle" data-toggle="dropdown">
-                                        <span class="fa fa-wrench" aria-hidden="true" title="{vtranslate('LBL_SETTINGS', $MODULE)}"></span>&nbsp;{vtranslate('LBL_CUSTOMIZE', 'Reports')}&nbsp; <span class="caret"></span>
-                                    </button>
-                                    <ul class="detailViewSetting dropdown-menu">
-                                        {foreach item=SETTING from=$MODULE_SETTING_ACTIONS}
-                                            {if {vtranslate($SETTING->getLabel())} eq "%s Numbering"}
-                                                 <li id="{$MODULE_NAME}_listview_advancedAction_{$SETTING->getLabel()}"><a href={$SETTING->getUrl()}>{vtranslate($SETTING->getLabel(), $MODULE_NAME ,vtranslate($MODULE_NAME))}</a></li>
-                                            {elseif $SETTING->getLabel() eq 'LBL_REVOKE_ACCESS_TO_DRIVE' || $SETTING->getLabel() eq 'LBL_REVOKE_ACCESS_TO_DROPBOX'}
-                                                <li id="{$MODULE_NAME}_listview_customsettingaction_{$SETTING->getLabel()}" class="{if $SETTING->get('linkvisibility') eq false}hide{/if}"><a href="javascript:Documents_Index_Js.revokeAccess('{$SETTING->getLabel()}','{{$SETTING->getUrl()}}')">{vtranslate($SETTING->getLabel(), $MODULE_NAME)}</a></li>
-                                            {else}
-                                                <li id="{$MODULE_NAME}_listview_advancedAction_{$SETTING->getLabel()}"><a href={$SETTING->getUrl()}>{vtranslate($SETTING->getLabel(), $MODULE_NAME, vtranslate("SINGLE_$MODULE_NAME", $MODULE_NAME))}</a></li>
-                                            {/if}
-                                        {/foreach}
-                                    </ul>
-                                </div>
-                            </li>
-                        {/if}
-                    </ul>
-                </div>
-            </div>
-        </div>
-        {if $FIELDS_INFO neq null}
-            <script type="text/javascript">
-                var uimeta = (function() {
-                    var fieldInfo  = {$FIELDS_INFO};
-                    return {
-                        field: {
-                            get: function(name, property) {
-                                if(name && property === undefined) {
-                                    return fieldInfo[name];
-                                }
-                                if(name && property) {
-                                    return fieldInfo[name][property]
-                                }
-                            },
-                            isMandatory : function(name){
-                                if(fieldInfo[name]) {
-                                    return fieldInfo[name].mandatory;
-                                }
-                                return false;
-                            },
-                            getType : function(name){
-                                if(fieldInfo[name]) {
-                                    return fieldInfo[name].type
-                                }
-                                return false;
-                            }
-                        },
-                    };
-                })();
-            </script>
-        {/if}
-    </div>     
+						{if $MODULE_SETTING_ACTIONS|@count gt 0}
+							<li>
+								<div class="settingsIcon">
+									<button type="button" class="btn btn-default module-buttons dropdown-toggle" data-toggle="dropdown">
+										<span class="fa fa-wrench" aria-hidden="true" title="{vtranslate('LBL_SETTINGS', $MODULE)}"></span>&nbsp;{vtranslate('LBL_CUSTOMIZE', 'Reports')}&nbsp; <span class="caret"></span>
+									</button>
+									<ul class="detailViewSetting dropdown-menu">
+										{foreach item=SETTING from=$MODULE_SETTING_ACTIONS}
+											{if {vtranslate($SETTING->getLabel())} eq "%s Numbering"}
+												<li id="{$MODULE_NAME}_listview_advancedAction_{$SETTING->getLabel()}"><a href={$SETTING->getUrl()}>{vtranslate($SETTING->getLabel(), $MODULE_NAME ,vtranslate($MODULE_NAME))}</a></li>
+											{else}
+												<li id="{$MODULE_NAME}_listview_advancedAction_{$SETTING->getLabel()}"><a href={$SETTING->getUrl()}>{vtranslate($SETTING->getLabel(), $MODULE_NAME, vtranslate("SINGLE_$MODULE_NAME", $MODULE_NAME))}</a></li>
+											{/if}
+										{/foreach}
+									</ul>
+								</div>
+							</li>
+						{/if}
+					</ul>
+				</div>
+			</div>
+		</div>
+		{if $FIELDS_INFO neq null}
+			<script type="text/javascript">
+				var uimeta = (function() {
+					var fieldInfo  = {$FIELDS_INFO};
+					return {
+						field: {
+							get: function(name, property) {
+								if(name && property === undefined) {
+									return fieldInfo[name];
+								}
+								if(name && property) {
+									return fieldInfo[name][property]
+								}
+							},
+							isMandatory : function(name){
+								if(fieldInfo[name]) {
+									return fieldInfo[name].mandatory;
+								}
+								return false;
+							},
+							getType : function(name){
+								if(fieldInfo[name]) {
+									return fieldInfo[name].type
+								}
+								return false;
+							}
+						}
+					};
+				})();
+			</script>
+		{/if}
+	</div>
 {/strip}
diff --git a/layouts/v7/modules/Documents/UploadDocument.tpl b/layouts/v7/modules/Documents/UploadDocument.tpl
index a08a84999e4c81357647a1333049ff247b86ff3a..a7c20094d05be730cd06fb0351c5a5f8521d1c44 100644
--- a/layouts/v7/modules/Documents/UploadDocument.tpl
+++ b/layouts/v7/modules/Documents/UploadDocument.tpl
@@ -8,55 +8,53 @@
  ************************************************************************************}
 
 {strip}
-<div class="modal-dialog modelContainer">
-	{assign var=HEADER_TITLE value={vtranslate('LBL_UPLOAD_TO_VTIGER', $MODULE)}}
-	<div class="modal-content" style="width:675px;">
-		{include file="ModalHeader.tpl"|vtemplate_path:$MODULE TITLE=$HEADER_TITLE}
-		<div class="modal-body">
-			<div class="uploadview-content container-fluid">
-				<div class="uploadcontrols row">
-					<div id="upload" data-filelocationtype="I">
-						<br/>
-						<form class="form-horizontal recordEditView" name="upload" method="post" action="index.php">
-							{if !empty($PICKIST_DEPENDENCY_DATASOURCE)}
-								<input type="hidden" name="picklistDependency" value='{Vtiger_Util_Helper::toSafeHTML($PICKIST_DEPENDENCY_DATASOURCE)}' />
-							{/if}
-							<input type="hidden" name="module" value="{$MODULE}" />
-							<input type="hidden" name="action" value="SaveAjax" />
-							<input type="hidden" name="document_source" value="Vtiger" />
-							{if $RELATION_OPERATOR eq 'true'}
-								<input type="hidden" name="relationOperation" value="{$RELATION_OPERATOR}" />
-								<input type="hidden" name="sourceModule" value="{$PARENT_MODULE}" />
-								<input type="hidden" name="sourceRecord" value="{$PARENT_ID}" />
-								{if $RELATION_FIELD_NAME}
-									<input type="hidden" name="{$RELATION_FIELD_NAME}" value="{$PARENT_ID}" /> 
+	<div class="modal-dialog modelContainer">
+		{assign var=HEADER_TITLE value={vtranslate('LBL_UPLOAD_TO_VTIGER', $MODULE)}}
+		<div class="modal-content" style="width:675px;">
+			<form class="form-horizontal recordEditView" name="upload" method="post" action="index.php">
+				{include file="ModalHeader.tpl"|vtemplate_path:$MODULE TITLE=$HEADER_TITLE}
+				<div class="modal-body">
+					<div class="uploadview-content container-fluid">
+						<div class="uploadcontrols row">
+							<div id="upload" data-filelocationtype="I">
+								{if !empty($PICKIST_DEPENDENCY_DATASOURCE)}
+									<input type="hidden" name="picklistDependency" value='{Vtiger_Util_Helper::toSafeHTML($PICKIST_DEPENDENCY_DATASOURCE)}' />
+								{/if}
+								<input type="hidden" name="module" value="{$MODULE}" />
+								<input type="hidden" name="action" value="SaveAjax" />
+								<input type="hidden" name="document_source" value="Vtiger" />
+								{if $RELATION_OPERATOR eq 'true'}
+									<input type="hidden" name="relationOperation" value="{$RELATION_OPERATOR}" />
+									<input type="hidden" name="sourceModule" value="{$PARENT_MODULE}" />
+									<input type="hidden" name="sourceRecord" value="{$PARENT_ID}" />
+									{if $RELATION_FIELD_NAME}
+										<input type="hidden" name="{$RELATION_FIELD_NAME}" value="{$PARENT_ID}" /> 
+									{/if}
 								{/if}
-							{/if}
 
-							<input type="hidden" name="max_upload_limit" value="{$MAX_UPLOAD_LIMIT_BYTES}" />
-							<input type="hidden" name="max_upload_limit_mb" value="{$MAX_UPLOAD_LIMIT_MB}" />
+								<input type="hidden" name="max_upload_limit" value="{$MAX_UPLOAD_LIMIT_BYTES}" />
+								<input type="hidden" name="max_upload_limit_mb" value="{$MAX_UPLOAD_LIMIT_MB}" />
 
-							<div id="dragandrophandler" class="dragdrop-dotted">
-								<div style="font-size:175%;">
-									<span class="fa fa-upload"></span>&nbsp;&nbsp;
-									{vtranslate('LBL_DRAG_&_DROP_FILE_HERE', $MODULE)}
-								</div>
-								<div style="margin-top: 1%;text-transform: uppercase;margin-bottom: 2%;">
-									{vtranslate('LBL_OR', $MODULE)}
-								</div>
-								<div>
-									<div class="fileUploadBtn btn btn-primary">
-										<span><i class="fa fa-laptop"></i> {vtranslate('LBL_SELECT_FILE_FROM_COMPUTER', $MODULE)}</span>
-										{assign var=FIELD_MODEL value=$FIELD_MODELS['filename']}
-										<input type="file" name="{$FIELD_MODEL->getFieldName()}" value="{$FIELD_VALUE}" data-rule-required="true" />
+								<div id="dragandrophandler" class="dragdrop-dotted">
+									<div style="font-size:175%;">
+										<span class="fa fa-upload"></span>&nbsp;&nbsp;
+										{vtranslate('LBL_DRAG_&_DROP_FILE_HERE', $MODULE)}
+									</div>
+									<div style="margin-top: 1%;text-transform: uppercase;margin-bottom: 2%;">
+										{vtranslate('LBL_OR', $MODULE)}
+									</div>
+									<div>
+										<div class="fileUploadBtn btn btn-primary">
+											<span><i class="fa fa-laptop"></i> {vtranslate('LBL_SELECT_FILE_FROM_COMPUTER', $MODULE)}</span>
+											{assign var=FIELD_MODEL value=$FIELD_MODELS['filename']}
+											<input type="file" name="{$FIELD_MODEL->getFieldName()}" value="{$FIELD_VALUE}" data-rule-required="true" />
+										</div>
+										&nbsp;&nbsp;&nbsp;<i class="fa fa-info-circle cursorPointer" data-toggle="tooltip" title="{vtranslate('LBL_MAX_UPLOAD_SIZE', $MODULE)} {$MAX_UPLOAD_LIMIT_MB}{vtranslate('MB', $MODULE)}"></i>
 									</div>
-									&nbsp;&nbsp;&nbsp;<i class="fa fa-info-circle cursorPointer" data-toggle="tooltip" title="{vtranslate('LBL_MAX_UPLOAD_SIZE', $MODULE)} {$MAX_UPLOAD_LIMIT_MB}{vtranslate('MB', $MODULE)}"></i>
+									<div class="fileDetails"></div>
 								</div>
-								<div class="fileDetails"></div>
-							</div>
 
-							<table class="massEditTable table no-border">
-								<tr>
+								<table class="massEditTable table no-border">
 									<tr>
 										{assign var="FIELD_MODEL" value=$FIELD_MODELS['notes_title']}
 										<td class="fieldLabel col-lg-2">
@@ -71,21 +69,8 @@
 											{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
 										</td>
 									</tr>
-									{assign var="FIELD_MODEL" value=$FIELD_MODELS['assigned_user_id']}
-									<td class="fieldLabel col-lg-2">
-										<label class="muted pull-right">
-											{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;
-											{if $FIELD_MODEL->isMandatory() eq true}
-												<span class="redColor">*</span>
-											{/if}
-										</label>
-									</td>
-									<td class="fieldValue col-lg-4">
-										{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
-									</td>
-
-									{assign var="FIELD_MODEL" value=$FIELD_MODELS['folderid']}
-									{if $FIELD_MODELS['folderid']}
+									<tr>
+										{assign var="FIELD_MODEL" value=$FIELD_MODELS['assigned_user_id']}
 										<td class="fieldLabel col-lg-2">
 											<label class="muted pull-right">
 												{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;
@@ -97,97 +82,111 @@
 										<td class="fieldValue col-lg-4">
 											{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
 										</td>
-									{/if}
-								</tr>
-								<tr>
-									{assign var="FIELD_MODEL" value=$FIELD_MODELS['notecontent']}
-									{if $FIELD_MODELS['notecontent']}
-										<td class="fieldLabel col-lg-2" colspan="1">
-											<label class="muted pull-right">
-												{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;
-												{if $FIELD_MODEL->isMandatory() eq true}
-													<span class="redColor">*</span>
+
+										{assign var="FIELD_MODEL" value=$FIELD_MODELS['folderid']}
+										{if $FIELD_MODELS['folderid']}
+											<td class="fieldLabel col-lg-2">
+												<label class="muted pull-right">
+													{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;
+													{if $FIELD_MODEL->isMandatory() eq true}
+														<span class="redColor">*</span>
+													{/if}
+												</label>
+											</td>
+											<td class="fieldValue col-lg-4">
+												{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
+											</td>
+										{/if}
+									</tr>
+									<tr>
+										{assign var="FIELD_MODEL" value=$FIELD_MODELS['notecontent']}
+										{if $FIELD_MODELS['notecontent']}
+											<td class="fieldLabel col-lg-2" colspan="1">
+												<label class="muted pull-right">
+													{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;
+													{if $FIELD_MODEL->isMandatory() eq true}
+														<span class="redColor">*</span>
+													{/if}
+												</label>
+											</td>
+											<td class="fieldValue col-lg-4" colspan="3">
+												{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
+											</td>
+										{/if}
+									</tr>
+									<tr>
+										{assign var=HARDCODED_FIELDS value=','|explode:"filename,assigned_user_id,folderid,notecontent,notes_title"}
+										{assign var=COUNTER value=0}
+										{foreach key=FIELD_NAME item=FIELD_MODEL from=$FIELD_MODELS} 
+											{if $FIELD_MODEL->isMandatory() && !in_array($FIELD_NAME,$HARDCODED_FIELDS) && $FIELD_MODEL->isQuickCreateEnabled()}
+												{assign var="isReferenceField" value=$FIELD_MODEL->getFieldDataType()}
+												{assign var="referenceList" value=$FIELD_MODEL->getReferenceList()}
+												{assign var="referenceListCount" value=count($referenceList)}
+												{if $FIELD_MODEL->get('uitype') eq "19"}
+													{if $COUNTER eq '1'}
+														<td></td><td></td></tr><tr>
+														{assign var=COUNTER value=0}
+													{/if}
 												{/if}
-											</label>
-										</td>
-										<td class="fieldValue col-lg-4" colspan="3">
-											{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
-										</td>
-									{/if}
-								</tr>
-								<tr>
-									{assign var=HARDCODED_FIELDS value=','|explode:"filename,assigned_user_id,folderid,notecontent,notes_title"}
-									{assign var=COUNTER value=0}
-									{foreach key=FIELD_NAME item=FIELD_MODEL from=$FIELD_MODELS}
-										{if $FIELD_MODEL->isMandatory() && !in_array($FIELD_NAME,$HARDCODED_FIELDS) && $FIELD_MODEL->isQuickCreateEnabled()}
-											{assign var="isReferenceField" value=$FIELD_MODEL->getFieldDataType()}
-											{assign var="referenceList" value=$FIELD_MODEL->getReferenceList()}
-											{assign var="referenceListCount" value=count($referenceList)}
-											{if $FIELD_MODEL->get('uitype') eq "19"}
-												{if $COUNTER eq '1'}
-													<td></td><td></td></tr><tr>
-													{assign var=COUNTER value=0}
+												{if $COUNTER eq 2}
+												</tr><tr>
+													{assign var=COUNTER value=1}
+												{else}
+													{assign var=COUNTER value=$COUNTER+1}
 												{/if}
-											{/if}
-											{if $COUNTER eq 2}
-											</tr><tr>
-												{assign var=COUNTER value=1}
-											{else}
-												{assign var=COUNTER value=$COUNTER+1}
-											{/if}
-											<td class='fieldLabel col-lg-2'>
-												{if $isReferenceField neq "reference"}<label class="muted pull-right">{/if}
-													{if $isReferenceField eq "reference"}
-														{if $referenceListCount > 1}
-															{assign var="DISPLAYID" value=$FIELD_MODEL->get('fieldvalue')}
-															{assign var="REFERENCED_MODULE_STRUCT" value=$FIELD_MODEL->getUITypeModel()->getReferenceModule($DISPLAYID)}
-															{if !empty($REFERENCED_MODULE_STRUCT)}
-																{assign var="REFERENCED_MODULE_NAME" value=$REFERENCED_MODULE_STRUCT->get('name')}
+												<td class='fieldLabel col-lg-2'>
+													{if $isReferenceField neq "reference"}<label class="muted pull-right">{/if}
+														{if $isReferenceField eq "reference"}
+															{if $referenceListCount > 1}
+																{assign var="DISPLAYID" value=$FIELD_MODEL->get('fieldvalue')}
+																{assign var="REFERENCED_MODULE_STRUCT" value=$FIELD_MODEL->getUITypeModel()->getReferenceModule($DISPLAYID)}
+																{if !empty($REFERENCED_MODULE_STRUCT)}
+																	{assign var="REFERENCED_MODULE_NAME" value=$REFERENCED_MODULE_STRUCT->get('name')}
+																{/if}
+																<span class="pull-right">
+																	<select style="width:150px;" class="select2 referenceModulesList {if $FIELD_MODEL->isMandatory() eq true}reference-mandatory{/if}">
+																		{foreach key=index item=value from=$referenceList}
+																			<option value="{$value}" {if $value eq $REFERENCED_MODULE_NAME} selected {/if} >{vtranslate($value, $value)}</option>
+																		{/foreach}
+																	</select>
+																</span>
+															{else}
+																<label class="muted pull-right">{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;{if $FIELD_MODEL->isMandatory() eq true} <span class="redColor">*</span> {/if}</label>
 															{/if}
-															<span class="pull-right">
-																<select style="width:150px;" class="select2 referenceModulesList {if $FIELD_MODEL->isMandatory() eq true}reference-mandatory{/if}">
-																	{foreach key=index item=value from=$referenceList}
-																		<option value="{$value}" {if $value eq $REFERENCED_MODULE_NAME} selected {/if} >{vtranslate($value, $value)}</option>
-																	{/foreach}
-																</select>
-															</span>
-														{else}
-															<label class="muted pull-right">{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;{if $FIELD_MODEL->isMandatory() eq true} <span class="redColor">*</span> {/if}</label>
-														{/if}
-													{else if $FIELD_MODEL->get('uitype') eq '83'}
-														{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE) COUNTER=$COUNTER MODULE=$MODULE}
-														{if $TAXCLASS_DETAILS}
-															{assign 'taxCount' count($TAXCLASS_DETAILS)%2}
-															{if $taxCount eq 0}
-																{if $COUNTER eq 2}
-																	{assign var=COUNTER value=1}
-																{else}
-																	{assign var=COUNTER value=2}
+														{else if $FIELD_MODEL->get('uitype') eq '83'}
+															{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE) COUNTER=$COUNTER MODULE=$MODULE}
+															{if $TAXCLASS_DETAILS}
+																{assign 'taxCount' count($TAXCLASS_DETAILS)%2}
+																{if $taxCount eq 0}
+																	{if $COUNTER eq 2}
+																		{assign var=COUNTER value=1}
+																	{else}
+																		{assign var=COUNTER value=2}
+																	{/if}
 																{/if}
 															{/if}
+														{else}
+															{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;{if $FIELD_MODEL->isMandatory() eq true} <span class="redColor">*</span> {/if}
 														{/if}
-													{else}
-														{vtranslate($FIELD_MODEL->get('label'), $MODULE)}&nbsp;{if $FIELD_MODEL->isMandatory() eq true} <span class="redColor">*</span> {/if}
-													{/if}
-													{if $isReferenceField neq "reference"}</label>{/if}
-											</td>
-											{if $FIELD_MODEL->get('uitype') neq '83'}
-												<td class="fieldValue col-lg-4" {if $FIELD_MODEL->get('uitype') eq '19'} colspan="3" {assign var=COUNTER value=$COUNTER+1} {/if}>
-													{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
+														{if $isReferenceField neq "reference"}</label>{/if}
 												</td>
+												{if $FIELD_MODEL->get('uitype') neq '83'}
+													<td class="fieldValue col-lg-4" {if $FIELD_MODEL->get('uitype') eq '19'} colspan="3" {assign var=COUNTER value=$COUNTER+1} {/if}>
+														{include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getTemplateName(),$MODULE)}
+													</td>
+												{/if}
 											{/if}
-										{/if}
-									{/foreach}
-								</tr>
-							</table>
-							{assign var=BUTTON_NAME value={vtranslate('LBL_UPLOAD', $MODULE)}}
-							{assign var=BUTTON_ID value="js-upload-document"}
-							{include file="ModalFooter.tpl"|vtemplate_path:$MODULE}
-						</form>
+										{/foreach}
+									</tr>
+								</table>
+							</div>
+						</div>
 					</div>
 				</div>
-			</div>
+				{assign var=BUTTON_NAME value={vtranslate('LBL_UPLOAD', $MODULE)}}
+				{assign var=BUTTON_ID value="js-upload-document"}
+				{include file="ModalFooter.tpl"|vtemplate_path:$MODULE}
+			</form>
 		</div>
 	</div>
-</div>
 {/strip}
diff --git a/layouts/v7/modules/Documents/resources/Documents.js b/layouts/v7/modules/Documents/resources/Documents.js
index 5d1795d776f37c81f784fd9209a06f5ba1e2fb2d..8dce6caceb9a46c4a8f9e57d26160b65e60fdb59 100644
--- a/layouts/v7/modules/Documents/resources/Documents.js
+++ b/layouts/v7/modules/Documents/resources/Documents.js
@@ -10,25 +10,13 @@
 Vtiger.Class('Documents_Index_Js', {
 
 	fileObj : false,
-
 	referenceCreateMode : false,
 	referenceFieldName : '',
 
-	hierarchyMap : {
-		'GoogleDrive' : {},
-		'Dropbox' : {}
-	},
-
 	getInstance : function() {
 		return new Documents_Index_Js();
 	},
 
-	authorize : function(serviceName,parentId,relatedModule,mode,referenceFieldName) {
-		var instance = Documents_Index_Js.getInstance();
-		instance.detectReferenceCreateMode(referenceFieldName);
-		instance.authorize(serviceName,parentId,relatedModule,mode,referenceFieldName);
-	},
-
 	uploadTo : function(service,parentId,relatedModule,referenceFieldName) {
 		var instance = Documents_Index_Js.getInstance();
 		instance.detectReferenceCreateMode(referenceFieldName);
@@ -41,17 +29,6 @@ Vtiger.Class('Documents_Index_Js', {
 		instance.createDocument(type,parentId,relatedModule);
 	},
 
-	revokeAccess : function(label,revokeUrl) {
-		var instance = Documents_Index_Js.getInstance();
-		instance.revokeAccess(label,revokeUrl);
-	},
-
-	selectFrom : function(service,parentId,relatedModule, referenceFieldName) {
-		var instance = Documents_Index_Js.getInstance();
-		instance.detectReferenceCreateMode(referenceFieldName);
-		instance.selectFrom(service,parentId,relatedModule);
-	}
-
 }, {
 
 	detectReferenceCreateMode : function(referenceFieldName) {
@@ -64,34 +41,6 @@ Vtiger.Class('Documents_Index_Js', {
 		}
 	},
 
-	revokeAccess : function(label,revokeUrl) {
-		app.helper.showConfirmationBox({
-			message:app.vtranslate('JS_ARE_YOU_SURE_TO_REVOKE_ACCESS')
-		}).then(function() {
-			app.helper.showProgress();
-			app.request.post({'url' : revokeUrl}).then(function(e,resp) {
-				app.helper.hideProgress();
-				if(!e) {
-					if(resp.accessRevoked) {
-						jQuery('#Documents_listview_customsettingaction_'+label).addClass('hide');
-						if(jQuery('.settingsIcon').find('ul.dropdown-menu').find('li').not('.hide').length <= 0) {
-							jQuery('.settingsIcon').parent('li').addClass('hide');
-						}
-						var service = 'GoogleDrive'
-						if(label !== 'LBL_REVOKE_ACCESS_TO_DRIVE') {
-							service = 'Dropbox';
-						}
-						jQuery('#'+service+'UploadAction > a').attr('href','javascript:Documents_Index_Js.authorize(\''+service+'\', undefined, undefined, "upload")');
-						jQuery('#'+service+'SelectAction > a').attr('href','javascript:Documents_Index_Js.authorize(\''+service+'\', undefined, undefined, "select")');
-						app.helper.showSuccessNotification({
-							'message' : app.vtranslate('JS_ACCESS_REVOKED')
-						});
-					}
-				}
-			});
-		});
-	},
-
 	getFile : function() {
 		return Documents_Index_Js.fileObj;
 	},
@@ -124,8 +73,7 @@ Vtiger.Class('Documents_Index_Js', {
 		var parentId = jQuery('#recordId').val();
 		var parentModule = app.getModuleName();
 		var relatedModuleName = jQuery('.relatedModuleName').val();
-		var selectedRelatedTabElement = jQuery('div.related-tabs')
-				.find('li').filter('.active');
+		var selectedRelatedTabElement = jQuery('div.related-tabs').find('li').filter('.active');
 		var relatedList = Vtiger_RelatedList_Js.getInstance(parentId, parentModule, selectedRelatedTabElement, relatedModuleName);
 		relatedList.loadRelatedList();
 	},
@@ -329,100 +277,23 @@ Vtiger.Class('Documents_Index_Js', {
 		vtUtils.enableTooltips();
 	},
 
-	tabChangeHandler : function(container) {
-		jQuery('.tab-item', container).on('click', function() {
-			var currentTab = jQuery(this);
-			//activate tab
-			currentTab.closest('.nav-tabs').find('.tab-item').removeClass('active');
-			currentTab.addClass('active');
-
-			//activate tab-pane
-			container.find('.tab-content > .tab-pane').removeClass('active in');
-			var activatedPane = container.find('.tab-content > '+currentTab.data('tabcontentSelector'));
-			activatedPane.addClass('active in');
-
-			//intimate activated tab-pane
-			activatedPane.trigger('Documents.Upload.Tab.Active');
-		});
-	},
-
-	addToHierarchyMap : function(childDir,parentDir,service) {
-		Documents_Index_Js.hierarchyMap[service][childDir] = parentDir;
-	},
-
-	getParentDirFromHierarchyMap : function(childDir,service) {
-		if(childDir == '/') return false;
-		return Documents_Index_Js.hierarchyMap[service][childDir];
-	},
-
 	updateDirectoryMeta : function(folderId,tab,backwardNavigation) {
 		backwardNavigation = (typeof backwardNavigation == "undefined") ? false : true;
 		var currentDirElement = jQuery('input[name="currentDir"]',tab);
 		var parentDirElement = jQuery('input[name="parentDir"]',tab);
-		var service = jQuery('input[name="serviceProvider"]',tab).val();
 		var currentDir = currentDirElement.val();
 		var parentDir = parentDirElement.val();
 		if(!backwardNavigation) {
-			this.addToHierarchyMap(folderId,currentDir,service);
 			parentDirElement.val(currentDir);
 			currentDirElement.val(folderId);
 			jQuery('.browseBack',tab).removeAttr('disabled');
 			jQuery('.gotoRoot',tab).removeAttr('disabled');
 		} else {
 			currentDirElement.val(folderId);
-			parentDir = this.getParentDirFromHierarchyMap(folderId,service)
-			if(!parentDir) {
-				jQuery('.browseBack',tab).attr('disabled','disabled');
-				jQuery('.gotoRoot',tab).attr('disabled','disabled');
-			}
 			parentDirElement.val(parentDir);
 		}
 	},
 
-	registerInlineAuthEvent : function(container) {
-		var self = this;
-		var authorizeButton = jQuery('.inlineAuth',container);
-		if(authorizeButton.length) {
-			authorizeButton.on('click', function() {
-				var currentTarget = jQuery(this);
-				currentTarget.attr('disabled','disabled');
-				self._getAuthUrl(currentTarget.data('service'),true).then(function(authUrl) {
-					window.resumeAuth = function(status) {
-						if(status) {
-							app.helper.hideModal();
-							var serviceProvider = container.find('input[name="serviceProvider"]').val(),
-							parentId, relatedModule;
-							if(container.find('.relationDetails').length) {
-								var relationDetailsContainer = container.find('.relationDetails');
-								parentId = relationDetailsContainer.find('input[name="sourceRecord"]').val();
-								relatedModule = relationDetailsContainer.find('input[name="sourceModule"]').val();
-							}
-							Documents_Index_Js.selectFrom(serviceProvider,parentId,relatedModule);
-						}
-					};
-					window.open(authUrl,'','height=600,width=600,channelmode=1');
-				}, function(e) {
-					console.log("error : ",e);
-				});
-			});
-		}
-	},
-
-	registerExternalStorageTabEvents : function(tab) {
-		this.registerSearchFilesEvent(tab);
-		this.registerGotoRootFolderEvent(tab);
-		this.registerBackBrowseButton(tab);
-		this.registerFileSelectionHandler(tab);
-		this.registerBrowseFolder(tab);
-		this.registerInlineAuthEvent(tab);
-	},
-
-	registerPostTabLoadEvents : function(tab) {
-		if(tab.data('service') === 'GoogleDrive' || tab.data('service') === 'Dropbox') {
-			this.registerExternalStorageTabEvents(tab);
-		}
-	},
-
 	loadTab : function(tab) {
 		var self = this;
 		var url = tab.data('url');
@@ -432,7 +303,6 @@ Vtiger.Class('Documents_Index_Js', {
 			if(!e) {
 				tab.html(resp);
 				vtUtils.applyFieldElementsView(tab);
-				self.registerPostTabLoadEvents(tab);
 			} else {
 				console.log("error while loading tab : ",e);
 			}
@@ -487,47 +357,6 @@ Vtiger.Class('Documents_Index_Js', {
 		});
 	},
 
-	_uploadToExternalStorage : function(container) {
-		var self = this;
-		if(!self.getFile()) {
-			app.helper.showErrorNotification({
-				'message' : app.vtranslate('JS_PLEASE_SELECT_A_FILE')
-			});
-			return;
-		}
-		var uploadForm = container.find('form[name="uploadToService"]');
-		self._upload(uploadForm).then(function(resp) {
-			if(resp.uploadFail) {
-				app.helper.showErrorNotification({
-					'message' : app.vtranslate(resp.msg)
-				});
-			} else {
-				app.helper.showSuccessNotification({
-					'message' : app.vtranslate('JS_UPLOAD_SUCCESSFUL')
-				});
-			}
-			app.helper.hideModal();
-			self.reloadList();
-
-			if(Documents_Index_Js.referenceCreateMode === true && Documents_Index_Js.referenceFieldName !== '') {
-				self.postQuickCreateSave(resp);
-			}
-		}, function(e) {
-			app.helper.showErrorNotification({'message' : app.vtranslate('JS_UPLOAD_FAILED')});
-		});
-	},
-
-	registerUploadToExternalStorageEvents : function(container) {
-		var self = this;
-		container.find('form').vtValidate({
-			'submitHandler' : function() {
-				self._uploadToExternalStorage(container);
-				return false;
-			}
-		});
-		this.registerFileHandlingEvents(container);
-	},
-
 	applyScrollToModal : function(modalContainer) {
 		app.helper.showVerticalScroll(modalContainer.find('.modal-body').css('max-height', '415px'), 
 		{'autoHideScrollbar': true});
@@ -535,195 +364,7 @@ Vtiger.Class('Documents_Index_Js', {
 
 	uploadTo : function(service,parentId,relatedModule) {
 		this.setFile(false);
-		this.showUploadToVtigerModal(service,parentId,relatedModule);
-	},
-
-	createExternalDocument : function(container) {
-		var self = this;
-		var selection = jQuery('.selectList', container).find('.selectedFile');
-		if(!selection.length) {
-			app.helper.showAlertNotification({
-				'message' : app.vtranslate('JS_PLEASE_SELECT_A_FILE')
-			});
-			return;
-		}
-
-		var service = jQuery('input[name="serviceProvider"]', container).val();
-
-		var assignedUserId = jQuery('select[name="assigned_user_id"] option:selected', container).val();
-		var documentSource = service;
-		if(service === 'GoogleDrive') {
-			documentSource = 'Google Drive';
-		}
-
-		var params = {
-			module : 'Documents',
-			action : 'SaveAjax',
-			service : service,
-			notes_title : selection.data('title'),
-			filename : selection.data('link'),
-			filelocationtype : 'E',
-			assigned_user_id : assignedUserId,
-			document_source : documentSource,
-			externalFileId : selection.data('fileid'),
-			folderid : jQuery('input[name="vtigerFolderId"]',container).val()
-		};
-
-		if(service === 'Dropbox'){
-			params.createDirectLink = "yes";
-		}
-
-		var relationDetailsContainer = container.find('.relationDetails');
-		if(relationDetailsContainer.length) {
-			var relationOperationElement = relationDetailsContainer.find('input[name="relationOperation"]');
-			var relationOperator = relationOperationElement.val();
-			var sourceModule = relationDetailsContainer.find('input[name="sourceModule"]').val();
-			var sourceRecord = relationDetailsContainer.find('input[name="sourceRecord"]').val();
-			var relationFieldName = relationDetailsContainer.find('input[name="relationFieldName"]').val();
-			params.relationOperation = relationOperator;
-			params.sourceModule = sourceModule;
-			params.sourceRecord = sourceRecord;
-			if(relationFieldName){
-				params[relationFieldName] = sourceRecord;
-			}
-		}
-
-		app.helper.showProgress();
-		app.request.post({'data':params}).then(function(e,res) {
-			app.helper.hideProgress();
-			if(!e) {
-				app.helper.showSuccessNotification({
-					'message' : app.vtranslate('JS_DOCUMENT_CREATED')
-				});
-				app.helper.hideModal();
-				self.reloadList();
-
-				//reference create handling
-				if (Documents_Index_Js.referenceCreateMode === true && Documents_Index_Js.referenceFieldName !== '') {
-					self.postQuickCreateSave(res);
-				}
-			} else {
-				app.event.trigger('post.save.failed', e);
-			}
-		});
-	},
-
-	registerLinkExternalDocumentEvent : function(container) {
-		var self = this;
-		jQuery('#js-select-document',container).on('click',function() {
-			self.createExternalDocument(container.find('form'));
-		});
-	},
-
-	updateFilesList : function(files, container) {
-		var tableContainer = container.find('.selectList').find('tbody'),
-			listItem = '';
-		tableContainer.empty();
-		if(typeof files === 'undefined' || !files.length) {
-			listItem = '<div style="padding:20px">'+
-							'<span class="span">'+
-								'<i class="fa fa-info-circle"></i>'+
-									app.vtranslate('JS_NO_RESULTS_FOUND')+
-							'</span>'+
-						'</div>';
-			tableContainer.append(listItem);
-			return;
-		} else {
-			for(var i=0;i<files.length;i++) {
-				if(files[i].is_dir) {
-					listItem = "<tr class='listViewEntries folder' data-fileid='"+files[i].id+"' data-title='"+files[i].title+"' data-link='"+files[i].alternateLink+"'>"+
-									"<td class='listViewEntryValue medium fileTitleData' nowrap=''>"+
-										"<i class='fa fa-folder'></i>&nbsp;<a>"+files[i].title+"</a>"+
-									"</td>";
-					if(files[i].owner_name) {
-						listItem += "<td class='listViewEntryValue medium fileOwnerData' nowrap=''>"+
-										"<a>" + files[i].owner_name + "</a>"+
-									"</td>";
-					}
-					if(files[i].fileSize && !files[i].is_dir) {
-						var fileSize = files[i].fileSize;
-						if(container.find('input[name="serviceProvider"]').val() === 'GoogleDrive') {
-							fileSize = vtUtils.convertFileSizeInToDisplayFormat(fileSize);
-						}
-						listItem += "<td class='listViewEntryValue medium fileSizeData' nowrap=''>"+
-										"<a>" + fileSize + "</a>"+
-									"</td>";
-					}
-					listItem += "</tr>";
-				} else {
-					listItem = "<tr class='listViewEntries file' data-fileid='"+files[i].id+"' data-title='"+files[i].title+"' data-link='"+files[i].alternateLink+"'>"+
-								"<td class='listViewEntryValue medium fileTitleData' nowrap=''>"+
-									"<i class='fa fa-file'></i>&nbsp;<a>"+files[i].title+"</a>"+
-								"</td>";
-					if(files[i].owner_name) {
-						listItem += "<td class='listViewEntryValue medium fileOwnerData' nowrap=''>"+
-										"<a>" + files[i].owner_name + "</a>"+
-									"</td>";
-					}
-					if(files[i].fileSize) {
-						var fileSize = files[i].fileSize;
-						if(container.find('input[name="serviceProvider"]').val() === 'GoogleDrive') {
-							fileSize = vtUtils.convertFileSizeInToDisplayFormat(fileSize);
-						}
-						listItem += "<td class='listViewEntryValue medium fileSizeData' nowrap=''>"+
-									"<a>" + fileSize + "</a>"+
-								"</td>";
-					}
-					listItem += "</tr>";
-				}
-				tableContainer.append(listItem);
-			}
-		}
-		this.registerFileSelectionHandler(container);
-		this.registerBrowseFolder(container);
-	},
-
-	showEmptyDirectoryMessage : function(tab) {
-		var container = jQuery('.selectList',tab).find('tbody');
-		container.empty();
-		var content = '<div style="padding:20px">\n\
-						<span class="span">\n\
-							<i class="fa fa-info-circle"></i>\n\
-							'+app.vtranslate('JS_DIRECTORY_IS_EMPTY')+
-						'</span>\n\
-					</div>';
-		container.append(content);
-	},
-
-	openFolder : function(folderId,container,backwardNavigation) {
-		var self = this;
-		var service = jQuery('input[name="serviceProvider"]',container).val();
-
-		var params = {
-			 'module' : 'Documents',
-			 'action' : 'ServiceProvidersAjax',
-			 'mode' : 'getFilesForDirectory',
-			 'service' : service,
-			 'folderId' : folderId
-		 };
-		 app.helper.showProgress(app.vtranslate('JS_PLEASE_WAIT'));
-		 app.request.post({'data':params}).then(function(e,res) {
-			 app.helper.hideProgress();
-			 if(!e) {
-				 if(res.is_directory_empty) {
-					 self.showEmptyDirectoryMessage(container);
-				 } else {
-					 self.updateFilesList(res.filesList,container);
-				 }
-				 self.updateDirectoryMeta(folderId,container,backwardNavigation);
-				 self.registerBackBrowseButton(container);
-			 }
-		 });
-	},
-
-	registerBrowseFolder : function(container) {
-		var self = this;
-		jQuery('.folder', container).on('click', function() {
-			jQuery('.folder',container).off('click');
-			jQuery('.browseBack',container).off('click');
-			var folderId = jQuery(this).data('fileid');
-			self.openFolder(folderId,container);
-		});
+		this.showUploadToVtigerModal(parentId,relatedModule);
 	},
 
 	registerFileSelectionHandler : function(container) {
@@ -736,178 +377,6 @@ Vtiger.Class('Documents_Index_Js', {
 		});
 	},
 
-	registerBackBrowseButton : function(container) {
-		var thisInstance = this;
-		var currentDirElement = jQuery('input[name="currentDir"]',container);
-		jQuery('.browseBack',container).on('click',function() {
-			var service = jQuery('input[name="serviceProvider"]',container).val();
-			var parentDir = thisInstance.getParentDirFromHierarchyMap(currentDirElement.val(),service);
-			if(parentDir) {
-				jQuery('.browseBack',container).off('click');
-				jQuery('.folder',container).off('click');
-				thisInstance.openFolder(parentDir,container,true);
-			}
-		});
-	},
-
-	registerGotoRootFolderEvent : function(container) {
-		var self = this;
-		jQuery('.gotoRoot', container).on('click', function() {
-			jQuery(this).attr('disabled','disabled');
-			jQuery('.browseBack',container).attr('disabled','disabled');
-			var rootMetaElement = jQuery('input[name="rootDirContents"]',container);
-			var filesList = rootMetaElement.val();
-			var rootDirId = rootMetaElement.attr('data-rootDirId');
-			filesList = JSON.parse(filesList);
-			self.updateFilesList(filesList,container);
-			jQuery('input[name="currentDir"]',container).val(rootDirId);
-			jQuery('input[name="parentDir"]',container).val('');
-		});
-	},
-
-	registerSearchFilesEvent : function(container) {
-		var self = this;
-		jQuery('input[name="searchFiles"]', container).on('change', function() {
-			var searchKey = jQuery(this).val();
-			searchKey = jQuery.trim(searchKey);
-			if(searchKey.length === 0) {
-				jQuery(this).val('');
-				return;
-			}
-
-			var params = {
-				'module' : 'Documents',
-				'action' : 'ServiceProvidersAjax',
-				'mode' : 'search',
-				'searchKey' : searchKey,
-				'service' : jQuery('input[name="serviceProvider"]',container).val()
-			};
-			app.helper.showProgress(app.vtranslate('JS_PLEASE_WAIT'));
-			app.request.post({'data':params}).then(function(e,res) {
-				app.helper.hideProgress();
-				if(!e) {
-					self.updateFilesList(res,container);
-					jQuery('.browseBack',container).attr('disabled','disabled');
-					jQuery('.gotoRoot',container).removeAttr('disabled');
-				}
-			});
-		});
-	},
-
-	registerSelectFromExternalStorageEvents : function(modalContainer) {
-		modalContainer.find('form').vtValidate({
-			'submitHandler' : function() {
-				return false;
-			}
-		});
-
-		this.registerSearchFilesEvent(modalContainer);
-		this.registerGotoRootFolderEvent(modalContainer);
-		this.registerBackBrowseButton(modalContainer);
-		this.registerFileSelectionHandler(modalContainer);
-		this.registerBrowseFolder(modalContainer);
-		this.registerInlineAuthEvent(modalContainer);
-		this.registerLinkExternalDocumentEvent(modalContainer);
-
-		app.helper.showVerticalScroll(modalContainer.find('.selectList'), 
-		{'autoHideScrollbar' : true, 'setHeight' : 270});
-	},
-
-	showSelectFromExternalStorageModal : function(service,parentId,relatedModule) {
-		var self = this;
-		var url = 'index.php?module=Documents&view=ExternalStorage&operation=SelectFrom'+service;
-		if(typeof parentId !== 'undefined' && typeof relatedModule !== 'undefined') {
-			url += '&relationOperation=true&sourceModule='+relatedModule+'&sourceRecord='+parentId;
-		}
-		var relationField = jQuery('div.related-tabs').find('li').filter('.active').data('relatedfield');
-		if (relationField && parentId) {
-			url += '&'+relationField+"="+parentId;
-		}
-		app.helper.showProgress();
-		app.request.get({'url':url}).then(function(e,resp) {
-			app.helper.hideProgress();
-			if(!e) {
-				app.helper.showModal(resp, {
-					'cb' : function(modalContainer) {
-						self.registerSelectFromExternalStorageEvents(modalContainer);
-					}
-				});
-			}
-		});
-	},
-
-	selectFrom : function(service,parentId,relatedModule) {
-		this.showSelectFromExternalStorageModal(service,parentId,relatedModule);
-	},
-
-	_getAuthUrl : function(serviceName,inline) {
-		var aDeferred = jQuery.Deferred();
-		if(typeof inline === 'undefined') {
-			inline = false;
-		}
-		var params = {
-			'module' : 'Documents',
-			'action' : 'ServiceProvidersAjax',
-			'mode' : 'getOauthUrl',
-			'service' : serviceName,
-			'inline' : inline
-		};
-		app.helper.showProgress();
-		app.request.post({'data':params}).then(function(e,resp) {
-			app.helper.hideProgress();
-			if(!e) {
-				if(resp.hasOwnProperty('authUrl')) {
-					aDeferred.resolve(resp.authUrl);
-				} else if(resp.hasOwnProperty('postAuthorization')) {
-					aDeferred.reject({postAuthorization:resp.postAuthorization});
-				}
-			} else {
-				aDeferred.reject(e);
-			}
-		});
-		return aDeferred.promise();
-	},
-
-	authorize : function(serviceName,parentId,relatedModule,mode,referenceFieldName) {
-		if(typeof mode === 'undefined') {
-			mode = 'upload';
-		}
-		this._getAuthUrl(serviceName,true).then(function(authUrl) {
-			window.resumeAuth = function(status) {
-				if(status) {
-					var actionHref = 'javascript:Documents_Index_Js.uploadTo(\''+serviceName+'\'';
-					if(typeof parentId !== 'undefined' && typeof relatedModule !== 'undefined') {
-						actionHref += ','+parentId+',\''+relatedModule+'\'';
-					}
-					actionHref += ')';
-					jQuery('#'+serviceName+'Action').find('a').attr('href',actionHref);
-					if(mode === 'select') {
-						Documents_Index_Js.selectFrom(serviceName,parentId,relatedModule,referenceFieldName);
-					} else {
-						Documents_Index_Js.uploadTo(serviceName,parentId,relatedModule,referenceFieldName);
-					}
-					var revokeSelector = 'Documents_listview_customsettingaction_LBL_REVOKE_ACCESS_TO_DRIVE';
-					if(serviceName === 'Dropbox') {
-						revokeSelector = 'Documents_listview_customsettingaction_LBL_REVOKE_ACCESS_TO_DROPBOX';
-					}
-					jQuery('#'+revokeSelector).removeClass('hide');
-					jQuery('.settingsIcon').parent('li').removeClass('hide');
-				}
-			};
-			window.open(authUrl,'','height=600,width=600,channelmode=1');
-		}, function(e) {
-			if(e.hasOwnProperty('postAuthorization')) {
-				if(e.postAuthorization) {
-					if(mode === 'select') {
-						Documents_Index_Js.selectFrom(serviceName,parentId,relatedModule,referenceFieldName);
-					} else {
-						Documents_Index_Js.uploadTo(serviceName,parentId,relatedModule,referenceFieldName);
-					}
-				}
-			}
-		});
-	},
-
 	_createDocument : function(form) {
 		var self = this;
 		var noteContentElement = form.find('#Documents_editView_fieldName_notecontent_popup');
@@ -966,7 +435,7 @@ Vtiger.Class('Documents_Index_Js', {
 		this.registerCreateDocumentEvent(container);
 	},
 
-	showCreateDocumentModal : function(type,parentId,relatedModule) {
+	createDocument : function(type,parentId,relatedModule) {
 		var self = this;
 		var url = 'index.php?module=Documents&view=QuickCreateAjax&operation=CreateDocument&type='+type;
 		if(typeof parentId !== 'undefined' && typeof relatedModule !== 'undefined') {
@@ -991,10 +460,6 @@ Vtiger.Class('Documents_Index_Js', {
 		});
 	},
 
-	createDocument : function(type,parentId,relatedModule) {
-		this.showCreateDocumentModal(type,parentId,relatedModule);
-	},
-
 	registerQuickCreateEvents : function(container) {
 		var vtigerInstance = Vtiger_Index_Js.getInstance();
 		vtigerInstance.registerReferenceCreate(container);
diff --git a/layouts/v7/modules/Settings/Vtiger/TaxIndex.tpl b/layouts/v7/modules/Settings/Vtiger/TaxIndex.tpl
index 7bfd0228f1ecf7d7482f439a90ae96c1cc53daf3..1d20cc3f04fcd235298459ee408bcdaae909f55a 100644
--- a/layouts/v7/modules/Settings/Vtiger/TaxIndex.tpl
+++ b/layouts/v7/modules/Settings/Vtiger/TaxIndex.tpl
@@ -9,40 +9,28 @@
 {* modules/Settings/Vtiger/views/TaxIndex.php *}
 
 {strip}
-    <div class="col-lg-12 col-md-12 col-sm-12" id="TaxCalculationsContainer">
-        <div class="editViewHeader">
-            <h4>{vtranslate('LBL_TAX_CALCULATIONS', $QUALIFIED_MODULE)}</h4>
-        </div>
-        <hr>
-        <br>
-        <div class="contents tabbable clearfix">
-            <ul class="nav nav-tabs layoutTabs massEditTabs">
-                <li class="tab-item taxesTab active"><a data-toggle="tab" href="#taxes"><strong>{vtranslate('LBL_TAXES', $QUALIFIED_MODULE)}</strong></a></li>
-                <li class="tab-item chargesTab"><a data-toggle="tab" href="#charges"><strong>{vtranslate('LBL_CHARGES_AND ITS_TAXES', $QUALIFIED_MODULE)}</strong></a></li>
-                <li class="tab-item taxRegionsTab"><a data-toggle="tab" href="#taxRegions"><strong>{vtranslate('LBL_TAX_REGIONS', $QUALIFIED_MODULE)}</strong></a></li>
-            </ul>
-            <div class="tab-content layoutContent padding20 overflowVisible">
-                <div class="tab-pane active" id="taxes">
-                    <div class="col-lg-3 col-md-3 col-sm-3"></div>
-                        <div class="col-lg-6">
-						<div class="defaultTaxMode">
-							<input type="hidden" id="selectedTaxMode" value="{$SELECTED_TAX_MODE}">
-							<div class="pull-left">{vtranslate('LBL_DEFAULT_TAX_MODE', $QUALIFIED_MODULE)} : </div>
-							<label class="span radio-group">&nbsp;&nbsp;
-								<input class="input-medium" type="radio" name="default_tax_mode" {if $SELECTED_TAX_MODE eq 'group'}checked{/if} value='group' style="display: inline-block;">&nbsp;&nbsp;
-								<span class="mode radio-label">{vtranslate('LBL_GROUP', $QUALIFIED_MODULE)}</span>
-							</label>
-							<label class="span radio-group">&nbsp;&nbsp;
-								<input class="input-medium" type="radio" name="default_tax_mode" {if $SELECTED_TAX_MODE eq 'individual'}checked{/if} value='individual' style="display: inline-block;">&nbsp;&nbsp;
-								<span class="mode radio-label">{vtranslate('LBL_INDIVIDUAL', $QUALIFIED_MODULE)}</span>
-							</label>
-						</div>
-						<br>
+	<div class="col-lg-12 col-md-12 col-sm-12" id="TaxCalculationsContainer">
+		<div class="editViewHeader">
+			<h4>{vtranslate('LBL_TAX_CALCULATIONS', $QUALIFIED_MODULE)}</h4>
+		</div>
+		<hr>
+		<br>
+		<div class="contents tabbable clearfix">
+			<ul class="nav nav-tabs layoutTabs massEditTabs">
+				<li class="tab-item taxesTab active"><a data-toggle="tab" href="#taxes"><strong>{vtranslate('LBL_TAXES', $QUALIFIED_MODULE)}</strong></a></li>
+				<li class="tab-item chargesTab"><a data-toggle="tab" href="#charges"><strong>{vtranslate('LBL_CHARGES_AND ITS_TAXES', $QUALIFIED_MODULE)}</strong></a></li>
+				<li class="tab-item taxRegionsTab"><a data-toggle="tab" href="#taxRegions"><strong>{vtranslate('LBL_TAX_REGIONS', $QUALIFIED_MODULE)}</strong></a></li>
+			</ul>
+			<div class="tab-content layoutContent padding20 overflowVisible">
+				<div class="tab-pane active" id="taxes">
+					<div class="col-lg-3 col-md-3 col-sm-3"></div>
+					<div class="col-lg-6">
 						{assign var=CREATE_TAX_URL value=$TAX_RECORD_MODEL->getCreateTaxUrl()}
 						{assign var=WIDTHTYPE value=$CURRENT_USER_MODEL->get('rowheight')}
 						<div class="marginBottom10px">
 							<button type="button" class="btn btn-default addTax addButton btn-default module-buttons" data-url="{$CREATE_TAX_URL}" data-type="0">
-								<i class="fa fa-plus"></i>&nbsp;&nbsp;{vtranslate('LBL_ADD_NEW_TAX', $QUALIFIED_MODULE)}</button>
+								<i class="fa fa-plus"></i>&nbsp;&nbsp;{vtranslate('LBL_ADD_NEW_TAX', $QUALIFIED_MODULE)}
+							</button>
 						</div>
 						<table class="table table-bordered inventoryTaxTable">
 							<tr>
@@ -68,10 +56,10 @@
 							{/foreach}
 						</table>
 					</div>
-                </div>
-                <div class="tab-pane" id="charges"></div>
-                <div class="tab-pane" id="taxRegions"></div>
-            </div>
-        </div>
-    </div>
+				</div>
+				<div class="tab-pane" id="charges"></div>
+				<div class="tab-pane" id="taxRegions"></div>
+			</div>
+		</div>
+	</div>
 {/strip}
\ No newline at end of file
diff --git a/layouts/v7/modules/Vtiger/Export.tpl b/layouts/v7/modules/Vtiger/Export.tpl
index 98b5cd282bed79e5a01824dc751687ba0b30afb8..2fffe80e6300cbab0cf9c2d9a963da0595732111 100644
--- a/layouts/v7/modules/Vtiger/Export.tpl
+++ b/layouts/v7/modules/Vtiger/Export.tpl
@@ -57,19 +57,19 @@
 							<br><div><b>{vtranslate('LBL_EXPORT_DATA',$MODULE)}</b></div><br>
 							<div style="margin-left: 50px;">
 								<div>
-									<input type="radio" name="mode" value="ExportSelectedRecords" id="group1" {if !empty($SELECTED_IDS)} checked="checked" {else} disabled="disabled"{/if} />
+									<input type="radio" name="mode" value="ExportSelectedRecords" id="group1" {if !empty($SELECTED_IDS)} checked="checked" {else} disabled="disabled"{/if} style="margin:2px 0 -4px" />
 									<label style="font-weight:normal" for="group1">&nbsp;&nbsp;{vtranslate('LBL_EXPORT_SELECTED_RECORDS',$MODULE)}</label>
 									{if empty($SELECTED_IDS)}&nbsp; <span style="color:red">{vtranslate('LBL_NO_RECORD_SELECTED',$MODULE)}</span>{/if}
 									<input type="hidden" class="isSelectedRecords" value="{if $SELECTED_IDS}1{else}0{/if}" >
 								</div>
 								<br>
 								<div>
-									<input type="radio" name="mode" value="ExportCurrentPage" id="group2"/>
+									<input type="radio" name="mode" value="ExportCurrentPage" id="group2" style="margin:2px 0 -4px" />
 									<label style="font-weight:normal" for="group2">&nbsp;&nbsp;{vtranslate('LBL_EXPORT_DATA_IN_CURRENT_PAGE',$MODULE)}</label>
 								</div>
 								<br>
 								<div>
-									<input type="radio" name="mode" value="ExportAllData" id="group3" {if empty($SELECTED_IDS)} checked="checked" {/if}/>
+									<input type="radio" name="mode" value="ExportAllData" id="group3" {if empty($SELECTED_IDS)} checked="checked" {/if} style="margin:2px 0 -4px" />
 									<label style="font-weight:normal" for="group3">&nbsp;&nbsp;{vtranslate('LBL_EXPORT_ALL_DATA',$MODULE)}</label>
 								</div>
 								{if $MULTI_CURRENCY}
diff --git a/layouts/v7/modules/Vtiger/resources/List.js b/layouts/v7/modules/Vtiger/resources/List.js
index 219451874f5a80052be771b9e6bdb125d877ba92..d170c6fc573ca15ca2b8960d68b5376bd9925eba 100644
--- a/layouts/v7/modules/Vtiger/resources/List.js
+++ b/layouts/v7/modules/Vtiger/resources/List.js
@@ -1071,6 +1071,7 @@ Vtiger.Class("Vtiger_List_Js", {
 					}, 500));
 				}
 			}
+			e.preventDefault();
 			e.stopPropagation();
 		});
 
diff --git a/layouts/v7/modules/Vtiger/uitypes/StringDetailView.tpl b/layouts/v7/modules/Vtiger/uitypes/StringDetailView.tpl
index 0d109d5813c816f5efabda9cc05dc42d14c5c316..6ece8c7be5b01a602de767c258a1bf861f90b40f 100644
--- a/layouts/v7/modules/Vtiger/uitypes/StringDetailView.tpl
+++ b/layouts/v7/modules/Vtiger/uitypes/StringDetailView.tpl
@@ -39,6 +39,8 @@
     {else}
         <span class="currencyValue">{$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'))}</span>&nbsp;{$CURRENCY_SYMBOL}
     {/if}
+{else if  $FIELD_MODEL->get('name') eq 'signature'}
+	{decode_html($FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'), $RECORD->getId(), $RECORD))}
 {else}
     {$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'), $RECORD->getId(), $RECORD)}
 {/if}
diff --git a/modules/Calendar/actions/ExportData.php b/modules/Calendar/actions/ExportData.php
index 56a8a8a0b180f886a682376ba8eda350fd03a64c..8933e4819381e772c5f07fec243022b163436530 100644
--- a/modules/Calendar/actions/ExportData.php
+++ b/modules/Calendar/actions/ExportData.php
@@ -186,6 +186,11 @@ class Calendar_ExportData_Action extends Vtiger_ExportData_Action {
 
 		$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
 		$moduleFields = $moduleModel->getFields();
+
+		$eventsModuleModel = Vtiger_Module_Model::getInstance('Events');
+		$eventModuleFieldList = $eventsModuleModel->getFields();
+		$moduleFields = array_merge($moduleFields, $eventModuleFieldList);
+
 		foreach ($moduleFields as $fieldName => $fieldModel) {
 			if (in_array($fieldName, $skippedFields)) {
 				unset($moduleFields[$fieldName]);
diff --git a/modules/Calendar/views/Export.php b/modules/Calendar/views/Export.php
index 5f32eaebe1da246228c3671438930cf46ca8c392..5c5a247fd5d42a5c1fe28eae194324b5b5bb5ff3 100644
--- a/modules/Calendar/views/Export.php
+++ b/modules/Calendar/views/Export.php
@@ -9,20 +9,4 @@
  *************************************************************************************/
 
 class Calendar_Export_View extends Vtiger_Export_View {
-
-	public function preprocess(Vtiger_Request $request) {
-	}
-
-	public function process(Vtiger_Request $request) {
-		$moduleName = $request->getModule();
-
-		$viewer = $this->getViewer($request);
-		$viewer->assign('MODULE', $moduleName);
-		$viewer->assign('ACTION', 'ExportData');
-		
-		$viewer->view('Export.tpl', $moduleName);
-	}
-
-	public function postprocess(Vtiger_Request $request) {
-	}
 }
\ No newline at end of file
diff --git a/modules/Calendar/views/Import.php b/modules/Calendar/views/Import.php
index 996c44f726a95d559e405b2118bdb4e5a5dc6a9c..85db9b8b9bfe6fc7d4588b52b801c1a29a5b6561 100644
--- a/modules/Calendar/views/Import.php
+++ b/modules/Calendar/views/Import.php
@@ -89,6 +89,9 @@ class Calendar_Import_View extends Vtiger_Import_View {
 					if(strtotime($dueDate) < strtotime($currentDate))
 						$activityFieldsList['eventstatus'] = 'Held';
 				}
+				if (!$activityFieldsList['time_end']) {
+					$activityFieldsList['time_end'] = '';
+				}
 
 				$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
 				$recordModel->setData($activityFieldsList);
diff --git a/modules/Documents/models/Module.php b/modules/Documents/models/Module.php
index 5ec6234180748143f9fb2bc76c4a32f8e92d7852..89a8a3d535a6084cdb08b2b893b6b190f352be78 100644
--- a/modules/Documents/models/Module.php
+++ b/modules/Documents/models/Module.php
@@ -121,50 +121,6 @@ class Documents_Module_Model extends Vtiger_Module_Model {
 		return $relatedListFields;
 	}
     
-    public function getSettingLinks() {
-        vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
-        
-        
-		$layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
-        $editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png');
-		$settingsLinks = array();
-        $currentUserModel = Users_Record_Model::getCurrentUserModel();
-        if($currentUserModel->isAdminUser()) {
-            if(VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
-                $settingsLinks[] = array(
-                    'linktype' => 'LISTVIEWSETTING',
-                    'linklabel' => 'LBL_EDIT_WORKFLOWS',
-                    'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule='.$this->getName(),
-                    'linkicon' => $editWorkflowsImagePath
-                );
-            }
-
-            $settingsLinks[] = array(
-                     'linktype' => 'LISTVIEWSETTING',
-                        'linklabel' => 'LBL_EDIT_FIELDS',
-                            'linkurl' => 'index.php?parent=Settings&module=LayoutEditor&sourceModule='.$this->getName(),
-                        'linkicon' => $layoutEditorImagePath
-            );
-		
-			$settingsLinks[] = array(
-						'linktype' => 'LISTVIEWSETTING',
-						'linklabel' => 'LBL_EDIT_PICKLIST_VALUES',
-					'linkurl' => 'index.php?parent=Settings&module=Picklist&source_module='.$this->getName(),
-					'linkicon' => ''
-			);
-	        
-	        if($this->hasSequenceNumberField()) {
-			$settingsLinks[] = array(
-					'linktype' => 'LISTVIEWSETTING',
-					'linklabel' => 'LBL_MODULE_SEQUENCE_NUMBERING',
-					'linkurl' => 'index.php?parent=Settings&module=Vtiger&view=CustomRecordNumbering&sourceModule='.$this->getName(),
-						'linkicon' => ''
-				);
-			}
-		}
-        return $settingsLinks;
-    }
-    
     /**
 	* Function is used to give links in the All menu bar
 	*/
diff --git a/modules/Documents/views/QuickCreateAjax.php b/modules/Documents/views/QuickCreateAjax.php
index 5ad17797ae9f3c356081765899945b85c3eabe14..97a66313f3969fd72e08be2c18292ac8be701d19 100644
--- a/modules/Documents/views/QuickCreateAjax.php
+++ b/modules/Documents/views/QuickCreateAjax.php
@@ -41,9 +41,21 @@ class Documents_QuickCreateAjax_View extends Vtiger_IndexAjax_View {
 
 		$picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
 
-		$fieldsInfo = array();
+		$relationOperation = $request->get('relationOperation');
 		$fieldList = $moduleModel->getFields();
-		foreach($fieldList as $name => $model){
+		$requestFieldList = array_intersect_key($request->getAll(), $fieldList);
+        foreach($requestFieldList as $requestFieldName => $requestFieldValue) {
+            if(array_key_exists($requestFieldName, $fieldList)) {
+                $moduleFieldModel = $fieldList[$requestFieldName];
+                $recordModel->set($requestFieldName, $moduleFieldModel->getDBInsertValue($requestFieldValue));
+            }
+        }
+
+		$fieldsInfo = array();
+		foreach ($fieldList as $name => $model) {
+			if ($relationOperation && array_key_exists($name, $requestFieldList)) {
+				$relationFieldName = $name;
+			}
 			$fieldsInfo[$name] = $model->getFieldInfo();
 		}
 
@@ -61,6 +73,15 @@ class Documents_QuickCreateAjax_View extends Vtiger_IndexAjax_View {
 		$viewer->assign('FILE_LOCATION_TYPE', $request->get('type'));
 		$viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
 
+		if ($relationOperation) {
+			$viewer->assign('RELATION_OPERATOR', $relationOperation);
+			$viewer->assign('PARENT_MODULE', $request->get('sourceModule'));
+			$viewer->assign('PARENT_ID', $request->get('sourceRecord'));
+			if ($relationFieldName) {
+				$viewer->assign('RELATION_FIELD_NAME', $relationFieldName);
+			}
+		}
+
 		$viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
 		$viewer->assign('MAX_UPLOAD_LIMIT_BYTES', Vtiger_Util_Helper::getMaxUploadSizeInBytes());
 		echo $viewer->view('QuickCreate.tpl',$moduleName,true);
diff --git a/modules/Migration/schema/660_to_700.php b/modules/Migration/schema/660_to_700.php
index 2c244d16edbfb4671c05cc910f5115cf54eff970..ca2db5568bd41de1d27455c2c93cd4ff2771ef6f 100644
--- a/modules/Migration/schema/660_to_700.php
+++ b/modules/Migration/schema/660_to_700.php
@@ -12,10 +12,15 @@ if(defined('VTIGER_UPGRADE')) {
 	global $adb, $current_user;
 	$db = PearDatabase::getInstance();
 
+	if (!Vtiger_Utils::CheckTable('vtiger_activity_recurring_info')) {
+		$db->pquery('CREATE TABLE IF NOT EXISTS vtiger_activity_recurring_info(activityid INT(19) NOT NULL, recurrenceid INT(19) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=UTF8;', array());
+	}
+
 	$columns = $db->getColumnNames('vtiger_crmentity');
 	if (!in_array('smgroupid', $columns)) {
 		$db->pquery('ALTER TABLE vtiger_crmentity ADD COLUMN smgroupid INT(19)', array());
 	}
+
 	$db->pquery('UPDATE vtiger_settings_field SET name=? WHERE name=?', array('Configuration Editor', 'LBL_CONFIG_EDITOR'));
 	$db->pquery('UPDATE vtiger_links SET linktype=? WHERE linklabel=?', array('DETAILVIEW', 'LBL_SHOW_ACCOUNT_HIERARCHY'));
 	$db->pquery('UPDATE vtiger_field SET defaultvalue=? WHERE fieldname=?', array('1', 'discontinued'));
diff --git a/test/template_imgfiles/default.png b/test/template_imgfiles/default.png
new file mode 100644
index 0000000000000000000000000000000000000000..796b3d5d65febfb585da2a71395c58a82320a975
Binary files /dev/null and b/test/template_imgfiles/default.png differ