diff --git a/layouts/v7/modules/Vtiger/RecentComments.tpl b/layouts/v7/modules/Vtiger/RecentComments.tpl
index c0f80373c4eb0330f2cea89085a3c48629fb2858..18b574ac227dbc399d5e44bcde84720ffb3e098e 100644
--- a/layouts/v7/modules/Vtiger/RecentComments.tpl
+++ b/layouts/v7/modules/Vtiger/RecentComments.tpl
@@ -205,8 +205,8 @@
 		{/if}
 		{if $PAGING_MODEL->isNextPageExists()}
 			<div class="row">
-				<div class="pull-right">
-					<a href="javascript:void(0)" class="moreRecentComments">{vtranslate('LBL_MORE',$MODULE_NAME)}..</a>
+				<div class="textAlignCenter">
+					<a href="javascript:void(0)" class="moreRecentComments">{vtranslate('LBL_SHOW_MORE',$MODULE_NAME)}</a>
 				</div>
 			</div>
 		{/if}
diff --git a/layouts/v7/modules/Vtiger/RelatedActivities.tpl b/layouts/v7/modules/Vtiger/RelatedActivities.tpl
index 6923b3371f6644fea5c9684b53ade753ef232c2e..b9c0bdb3b54745c30bea56963535bd045fe3fe19 100644
--- a/layouts/v7/modules/Vtiger/RelatedActivities.tpl
+++ b/layouts/v7/modules/Vtiger/RelatedActivities.tpl
@@ -130,8 +130,8 @@
 		{/if}
 		{if $PAGING_MODEL->isNextPageExists()}
 			<div class="row">
-				<div class="pull-right">
-					<a href="javascript:void(0)" class="moreRecentActivities" style="line-height: 0px;padding-right:30px;">{vtranslate('LBL_SHOW_MORE',$MODULE_NAME)}</a>
+				<div class="textAlignCenter">
+					<a href="javascript:void(0)" class="moreRecentActivities">{vtranslate('LBL_SHOW_MORE',$MODULE_NAME)}</a>
 				</div>
 			</div>
 		{/if}
diff --git a/modules/Migration/schema/650_to_660.php b/modules/Migration/schema/650_to_660.php
index 5800057281b8cb4479cb2ee8889f689ee96d802a..5752695af1c6d17607d896dfdedaa82911feaa62 100644
--- a/modules/Migration/schema/650_to_660.php
+++ b/modules/Migration/schema/650_to_660.php
@@ -43,6 +43,19 @@ if(defined('VTIGER_UPGRADE')) {
 	$adb->pquery('UPDATE vtiger_convertleadmapping SET editable=? WHERE leadfid=?', array(1, $phoneFieldId));
 
 	// Migration for #261 - vtiger_portalinfo doesn't update contact
+	$columns = $db->getColumnNames('com_vtiger_workflows');
+	if (in_array('status', $columns)) {
+		$db->pquery('ALTER TABLE com_vtiger_workflows MODIFY COLUMN status TINYINT(1) DEFAULT 1', array());
+		$db->pquery('UPDATE com_vtiger_workflows SET status=? WHERE status IS NULL', array(1));
+	} else {
+		$db->pquery('ALTER TABLE com_vtiger_workflows ADD COLUMN status TINYINT DEFAULT 1', array());
+	}
+
+	if (!in_array('workflowname', $columns)) {
+		$db->pquery('ALTER TABLE com_vtiger_workflows ADD COLUMN workflowname VARCHAR(100)', array());
+	}
+	$db->pquery('UPDATE com_vtiger_workflows SET workflowname = summary', array());
+
 	$result = $adb->pquery('SELECT workflow_id FROM com_vtiger_workflows WHERE test LIKE ? AND module_name=? AND defaultworkflow=?', array('%portal%', 'Contacts', 1));
 	if ($adb->num_rows($result) == 1) {
 		$workflowId = $adb->query_result($result, 0, 'workflow_id');
diff --git a/modules/Migration/schema/660_to_700.php b/modules/Migration/schema/660_to_700.php
index 01234dcae23bd128eb66a7f5dc4477b79ec1da14..ddb4cf246852d8d1b49ef6c6a8f6327e78ccc6e0 100644
--- a/modules/Migration/schema/660_to_700.php
+++ b/modules/Migration/schema/660_to_700.php
@@ -52,10 +52,10 @@ if(defined('VTIGER_UPGRADE')) {
 	}
 
 	$db->pquery('UPDATE vtiger_def_org_share SET editstatus=? WHERE tabid=?', array(0, getTabid('Contacts')));
-	$db->pquery('UPDATE vtiger_field SET presence=0 WHERE columnname=? AND fieldname=?', array('emailoptout', 'emailoptout'));
 	$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 typeofdata=? WHERE fieldname IN (?, ?)', array('DT~O', 'createdtime', 'modifiedtime'));
+	$db->pquery('UPDATE vtiger_field SET presence=0 WHERE columnname=? AND fieldname=?', array('emailoptout', 'emailoptout'));
 	$db->pquery('UPDATE vtiger_field SET defaultvalue=? WHERE fieldname=?', array('1', 'discontinued'));
 	$db->pquery('UPDATE vtiger_field SET defaultvalue=? WHERE fieldname=?', array('.', 'currency_decimal_separator'));
 	$db->pquery('UPDATE vtiger_field SET defaultvalue=? WHERE fieldname=?', array(',', 'currency_grouping_separator'));
@@ -276,13 +276,13 @@ if(defined('VTIGER_UPGRADE')) {
 
 	$columns = $db->getColumnNames('vtiger_relatedlists');
 	if (!in_array('relationfieldid', $columns)) {
-		$db->pquery('ALTER TABLE vtiger_relatedlists ADD COLUMN relationfieldid INT(18)', array());
+		$db->pquery('ALTER TABLE vtiger_relatedlists ADD COLUMN relationfieldid INT(19)', array());
 	}
 	if (!in_array('source', $columns)) {
-		$db->pquery('ALTER TABLE vtiger_relatedlists ADD COLUMN source varchar(25)', array());
+		$db->pquery('ALTER TABLE vtiger_relatedlists ADD COLUMN source VARCHAR(25)', array());
 	}
 	if (!in_array('relationtype', $columns)) {
-		$db->pquery('ALTER TABLE vtiger_relatedlists ADD COLUMN relationtype varchar(10)', array());
+		$db->pquery('ALTER TABLE vtiger_relatedlists ADD COLUMN relationtype VARCHAR(10)', array());
 	}
 
 	$accountsTabId = getTabId('Accounts');
@@ -407,7 +407,7 @@ if(defined('VTIGER_UPGRADE')) {
 		$body = '<p>'.vtranslate('LBL_REMINDER_NOTIFICATION', $moduleName).'<br/>' .
 				vtranslate('LBL_DETAILS_STRING', $moduleName).' :<br/> 
 							&nbsp; '.vtranslate('Subject', $moduleName).' : $events-subject$<br/> 
-							&nbsp; '.vtranslate('Start Date & Time', $moduleName).' : $events-date_start$<br/>  
+							&nbsp; '.vtranslate('Start Date & Time', $moduleName).' : $events-date_start$<br/>
 							&nbsp; '.vtranslate('End Date & Time', $moduleName).' : $events-due_date$<br/> 
 							&nbsp; '.vtranslate('LBL_STATUS', $moduleName).' : $events-eventstatus$<br/> 
 							&nbsp; '.vtranslate('Location', $moduleName).' : $events-location$<br/> 
@@ -1283,10 +1283,10 @@ if(defined('VTIGER_UPGRADE')) {
 	//Add column to track public and private for tags
 	$columns = $db->getColumnNames('vtiger_freetags');
 	if (!in_array('visibility', $columns)) {
-		$db->pquery("ALTER TABLE vtiger_freetags ADD column visibility VARCHAR(100) NOT NULL DEFAULT 'PRIVATE'", array());
+		$db->pquery("ALTER TABLE vtiger_freetags ADD COLUMN visibility VARCHAR(100) NOT NULL DEFAULT 'PRIVATE'", array());
 	}
 	if (!in_array('owner', $columns)) {
-		$db->pquery('ALTER TABLE vtiger_freetags ADD column owner INT(19) NOT NULL', array());
+		$db->pquery('ALTER TABLE vtiger_freetags ADD COLUMN owner INT(19) NOT NULL', array());
 	}
 
 	//remove ON update field property for tagged_on since below script will update details but we dont want to change time stamp 
@@ -1408,19 +1408,6 @@ if(defined('VTIGER_UPGRADE')) {
 		}
 	}
 
-	//Workflows
-	$columns = $db->getColumnNames('com_vtiger_workflows');
-	if (in_array('status', $columns)) {
-		$db->pquery('ALTER TABLE com_vtiger_workflows MODIFY COLUMN status INT(11) DEFAULT 1', array());
-		$db->pquery('UPDATE com_vtiger_workflows SET status=? WHERE status IS NULL', array(1));
-	}
-
-	if (!in_array('workflowname', $columns)) {
-		$db->pquery('ALTER TABLE com_vtiger_workflows ADD COLUMN workflowname VARCHAR(100)', array());
-	}
-	$db->pquery('UPDATE com_vtiger_workflows SET workflowname = summary', array());
-	//End
-
 	//Adding color column for vtiger_salutationtype.
 	$fieldResult = $db->pquery('SELECT fieldname FROM vtiger_field WHERE fieldname=? AND tabid NOT IN (?)', array('salutationtype', getTabid('Users')));
 	$fieldRows = $db->num_rows($fieldResult);
@@ -2115,6 +2102,37 @@ if(defined('VTIGER_UPGRADE')) {
 	$db->pquery('DELETE FROM vtiger_settings_field WHERE name IN ('.generateQuestionMarks($duplicateOtherBlockFields).') AND blockid=?', array($duplicateOtherBlockFields, $otherBlockId));
 	//Migration of data to vtiger_settings blocks and fields ends
 
+	$result = $db->pquery('SELECT cvid, entitytype FROM vtiger_customview WHERE viewname=?', array('All'));
+	if ($result && $db->num_rows($result) > 0) {
+		while ($row = $db->fetch_array($result)) {
+			$cvId = $row['cvid'];
+			$cvModel = CustomView_Record_Model::getInstanceById($cvId);
+			$cvSelectedFields = $cvModel->getSelectedFields();
+
+			$moduleModel = Vtiger_Module_Model::getInstance($row['entitytype']);
+			if ($moduleModel) {
+				$fields = $moduleModel->getFields();
+				$cvSelectedFieldModels = array();
+
+				foreach ($fields as $fieldModel) {
+					$cvSelectedFieldModels[] = decode_html($fieldModel->getCustomViewColumnName());
+				}
+
+				foreach ($cvSelectedFields as $cvSelectedField) {
+					if (!in_array($cvSelectedField, $cvSelectedFieldModels)) {
+						$fieldData = explode(':', $cvSelectedField);
+						$fieldName = $fieldData[2];
+						$fieldInstance = Vtiger_Field_Model::getInstance($fieldName, $moduleModel);
+						if ($fieldInstance) {
+							$columnname = decode_html($fieldInstance->getCustomViewColumnName());
+							$db->pquery('UPDATE vtiger_cvcolumnlist SET columnname=? WHERE cvid=? AND columnname=?', array($columnname, $cvId, $cvSelectedField));
+						}
+					}
+				}
+			}
+		}
+	}
+
 	//Update existing package modules
 	Install_Utils_Model::installModules();
 
diff --git a/modules/Vtiger/views/Detail.php b/modules/Vtiger/views/Detail.php
index d84912985707d6468e04f9ff2a21f4b253cb4392..e7a4ec94910b1183f0233d4e88f5ed6898126366 100644
--- a/modules/Vtiger/views/Detail.php
+++ b/modules/Vtiger/views/Detail.php
@@ -478,6 +478,7 @@ class Vtiger_Detail_View extends Vtiger_Index_View {
 		}
 
 		$pagingModel->calculatePageRange($recentComments);
+		array_pop($recentComments);
 		$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
 
 		$fileNameFieldModel = Vtiger_Field::getInstance("filename", $modCommentsModel);
diff --git a/packages/vtiger/optional/ModComments.zip b/packages/vtiger/optional/ModComments.zip
index ca8f2eeef4ad0bc476360bca7df182e2497a3346..3c45a18e1e0aa973bc704f67f5b60055b754eae7 100644
Binary files a/packages/vtiger/optional/ModComments.zip and b/packages/vtiger/optional/ModComments.zip differ
diff --git a/pkg/vtiger/modules/ModComments/modules/ModComments/models/Record.php b/pkg/vtiger/modules/ModComments/modules/ModComments/models/Record.php
index 3e066457533fdd6c5ab344bcb63c0c7b98a1f6e3..5278b2c8d7d239d9c054f8c0aeb5b7c01042b35f 100644
--- a/pkg/vtiger/modules/ModComments/modules/ModComments/models/Record.php
+++ b/pkg/vtiger/modules/ModComments/modules/ModComments/models/Record.php
@@ -241,6 +241,7 @@ class ModComments_Record_Model extends Vtiger_Record_Model {
 		if($pagingModel){
 			$startIndex = $pagingModel->getStartIndex();
 			$limit = $pagingModel->getPageLimit();
+			$limit = $limit+1;
 			$query = $query . " LIMIT $startIndex, $limit";
 		}
 
diff --git a/schema/DatabaseSchema.xml b/schema/DatabaseSchema.xml
index acf68785bf301b35b48804e9e5d9c5d828d674f0..245ce1bf79d5a66f0b0010902be6addaa635ee42 100644
--- a/schema/DatabaseSchema.xml
+++ b/schema/DatabaseSchema.xml
@@ -152,6 +152,7 @@
 			<notnull />
 			<default value="0" />
 		</field>
+		<field name="smgroupid" type="I" size="19" />
 
 		<index name="crmentity_smcreatorid_idx">
 			<col>smcreatorid</col>
@@ -1151,6 +1152,9 @@
 			<notnull />
 			<default value="1" />
 		</field>
+		<field name="is_subproducts_viewable" type="I" size="1">
+			<default value="1" />
+		</field>
 		<opt platform="mysql">Engine=InnoDB</opt>
 	</table>
 
@@ -1716,6 +1720,9 @@
 		<field name="setype" type="C" size="30">
 			<notnull />
 		</field>
+		<field name="quantity" type="I" size="19">
+			<default value="1" />
+		</field>
 
 		<index name="seproductsrel_productid_idx">
 			<col>productid</col>
@@ -1864,6 +1871,7 @@
 	<table name="vtiger_emailtemplates">
 		<field name="foldername" type="C" size="100" />
 		<field name="templatename" type="C" size="100" />
+		<field name="templatepath" type="C" size="100" />
 		<field name="subject" type="C" size="100" />
 		<field name="description" type="X" />
 		<field name="body" type="X" />
@@ -1875,6 +1883,11 @@
 			<key />
 			<autoincrement />
 		</field>
+		<field name="systemtemplate" type="I" size="1">
+			<notnull />
+			<default value="0" />
+		</field>
+		<field name="module" type="C" size="100" />
 
 		<index name="emailtemplates_foldernamd_templatename_subject_idx">
 			<col>foldername</col>
@@ -2871,6 +2884,7 @@
 		<field name="enable_recurring" type="I">
 			<default value="0" />
 		</field>
+		<field name="compound_taxes_info" type="X" />
 		<index name="salesorder_vendorid_idx">
 			<col>vendorid</col>
 		</index>
@@ -3012,7 +3026,9 @@
 			<notnull />
 			<default value="" />
 		</field>
-		<field name="relationfieldid" type="I" size="100" />
+		<field name="relationfieldid" type="I" size="19" />
+		<field name="source" type="C" size="25" />
+		<field name="relationtype" type="C" size="10" />
 
 		<index name="relatedlists_relation_id_idx">
 			<col>relation_id</col>
@@ -3191,6 +3207,7 @@
 			<notnull />
 			<default value="1.000" />
 		</field>
+		<field name="compound_taxes_info" type="X" />
 		<index name="quote_quotestage_idx">
 			<col>quotestage</col>
 		</index>
@@ -3310,6 +3327,7 @@
 			<notnull />
 			<default value="1.000" />
 		</field>
+		<field name="compound_taxes_info" type="X" />
 
 		<index name="purchaseorder_vendorid_idx">
 			<col>vendorid</col>
@@ -3436,6 +3454,7 @@
 			<notnull />
 			<default value="1.000" />
 		</field>
+		<field name="compound_taxes_info" type="X" />
 		<index name="invoice_purchaseorderid_idx">
 			<col>invoiceid</col>
 		</index>
@@ -5075,6 +5094,13 @@
 			<notnull />
 			<default value="" />
 		</field>
+		<field name="visibility" type="C" size="100">
+			<notnull />
+			<default value="PRIVATE" />
+		</field>
+		<field name="owner" type="I" size="19">
+			<notnull />
+		</field>
 		<opt platform="mysql">Engine=InnoDB</opt>
 	</table>
 
@@ -5151,6 +5177,7 @@
 		<field name="inviteeid" type="I" size="19">
 			<KEY/>
 		</field>
+		<field name="status" type="C" size="50" />
 		<opt platform="mysql">Engine=InnoDB</opt>
 	</table>
 
@@ -5166,6 +5193,10 @@
 		<field name="percentage" type="N" size="7.3">
 		</field>
 		<field name="deleted" type="I" size="1" />
+		<field name="method" type="C" size="10" />
+		<field name="type" type="C" size="10" />
+		<field name="compoundon" type="C" size="400" />
+		<field name="regions" type="X" />
 
 		<index name="inventorytaxinfo_taxname_idx">
 			<col>taxname</col>
@@ -5183,6 +5214,7 @@
 		</field>
 		<field name="taxpercentage" type="N" size="7.3">
 		</field>
+		<field name="regions" type="X" />
 
 		<index name="producttaxrel_productid_idx">
 			<col>productid</col>
@@ -5445,6 +5477,10 @@
 		<field name="percentage" type="N" size="7.3">
 		</field>
 		<field name="deleted" type="I" size="1" />
+		<field name="method" type="C" size="10" />
+		<field name="type" type="C" size="10" />
+		<field name="compoundon" type="C" size="400" />
+		<field name="regions" type="X" />
 
 		<index name="shippingtaxinfo_taxname_idx">
 			<col>taxname</col>
@@ -6030,6 +6066,9 @@
 		<field name="searchfor" type="C" size="10"></field>
 		<field name="markas" type="C" size="10"></field>
 		<field name="isvalid" type="I" size="1"></field>
+		<field name="scanfrom" type="V" size="10">
+			<default value="ALL" />
+		</field>
 		<opt platform="mysql">Engine=InnoDB</opt>
 	</table>
 
@@ -6037,6 +6076,7 @@
 		<field name="scannerid" type="I"></field>
 		<field name="messageid" type="X"></field>
 		<field name="crmid" type="I"></field>
+		<field name="refids" type="X"></field>
 		<opt platform="mysql">Engine=InnoDB</opt>
 	</table>
 
@@ -6157,8 +6197,8 @@
 		</field>
 		<field name="nexttrigger_time" type="T">
 		</field>
-		<field name="status" type="I" size="255"></field>
-		<field name="workflowname" type="C" size="100"></field>
+		<field name="status" type="I" size="1" />
+		<field name="workflowname" type="C" size="100" />
 
 		<index name="com_vtiger_workflows_idx">
 			<unique />
@@ -6205,6 +6245,8 @@
 		</field>
 		<field name="do_after" type="I" >
 		</field>
+		<field name="relatedinfo" type="C" size="255" />
+		
 		<index name="com_vtiger_workflowtask_queue_idx">
 			<unique />
 			<col>task_id</col>
@@ -6448,6 +6490,7 @@
 		<field name="handler" type="C" size="50">
 			<default value="NULL" />
 		</field>
+		<field name="parent_link" type="I" size="19" />
 		<opt platform="mysql">Engine=InnoDB</opt>
 		<index name="link_tabidtype_idx">
 			<col>tabid</col>
@@ -6567,6 +6610,9 @@
 		<field name="productid" type="I" size="19">
 			<notnull />
 		</field>
+		<field name="quantity" type="I" size="19">
+			<default value="1" />
+		</field>
 		<opt platform="mysql">Engine=InnoDB</opt>
 	</table>
 
@@ -6928,6 +6974,12 @@
 		<field name="module" type="C" size="50" />
 		<field name="fieldname" type="C" size="50" />
 		<field name="defaultcolor" type="C" size="50" />
+		<field name="isdefault" type="I" size="11" >
+			<default value="1" />
+		</field>
+		<field name="conditions" type="C" size="255" >
+			<default value="1" />
+		</field>
 
 		<opt platform="mysql">Engine=InnoDB</opt>
 	</table>