diff --git a/SendSupportNotification.php b/SendSupportNotification.php
index b4984f6091c14091417295f26f86bc5d99df6a6c..70dd063710909f5703e62e837921b7650a0276fe 100755
--- a/SendSupportNotification.php
+++ b/SendSupportNotification.php
@@ -58,7 +58,7 @@ if($adb->num_rows($result) >= 1)
 }
 //comment / uncomment this line if you want to hide / show the sent mail status
 //showstatus($status);
-$log->debug(" Send Support Notification Befoe a week - Status: ".$status);
+$log->debug(" Send Support Notification Before a week - Status: ".$status);
 
 //To send email notification before a month
 $query="select vtiger_contactdetails.contactid,vtiger_contactdetails.email,vtiger_contactdetails.firstname,vtiger_contactdetails.lastname,contactid  from vtiger_customerdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_customerdetails.customerid inner join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_customerdetails.customerid  where vtiger_crmentity.deleted=0 and support_end_date=DATE_ADD(now(), INTERVAL 1 MONTH)";
diff --git a/config.template.php b/config.template.php
index 3935f38e72bf88052d5cba4cec894b8cea29d84f..90a7a851468dcda5d2c3dbcb299fe2ea926522bc 100644
--- a/config.template.php
+++ b/config.template.php
@@ -170,7 +170,7 @@ $default_charset = '_VT_CHARSET_';
 
 // default language
 // default_language default value = en_us
-$default_language = 'en_us';
+$default_language = '_VT_DEFAULT_LANGUAGE_';
 
 // add the language pack name to every translation string in the display.
 // translation_string_prefix default value = false
diff --git a/data/CRMEntity.php b/data/CRMEntity.php
index 10a83cad5ae53f85c93a6e1ee39b488eeda84cad..9331a77ad75beade18d154d27cf28f94974c9479 100755
--- a/data/CRMEntity.php
+++ b/data/CRMEntity.php
@@ -136,7 +136,8 @@ class CRMEntity {
 		} else {
 			$file_name = $file_details['name'];
 		}
-                
+
+		// Check 1
                 $save_file = 'true'; 
                 //only images are allowed for Image Attachmenttype 
                 $mimeType = vtlib_mime_content_type($file_details['tmp_name']); 
@@ -149,6 +150,13 @@ class CRMEntity {
                         return false; 
                 } 
 
+		// Check 2
+		$save_file = 'true';
+		//only images are allowed for these modules
+		if ($module == 'Contacts' || $module == 'Products') {
+			$save_file = validateImageFile($file_details);
+		}
+
 		$binFile = sanitizeUploadFileName($file_name, $upload_badext);
 
 		$current_id = $adb->getUniqueID("vtiger_crmentity");
@@ -164,12 +172,6 @@ class CRMEntity {
 		//upload the file in server
 		$upload_status = move_uploaded_file($filetmp_name, $upload_file_path . $current_id . "_" . $binFile);
 
-		$save_file = 'true';
-		//only images are allowed for these modules
-		if ($module == 'Contacts' || $module == 'Products') {
-			$save_file = validateImageFile($file_details);
-		}
-
 		if ($save_file == 'true' && $upload_status == 'true') {
 			//This is only to update the attached filename in the vtiger_notes vtiger_table for the Notes module
 			if ($module == 'Contacts' || $module == 'Products') {
@@ -2366,6 +2368,9 @@ class CRMEntity {
 				}
 			}
 		}
+		if($this->table_name == 'vtiger_leaddetails') {
+			$query .= " AND $this->table_name.converted = 0 ";
+		}
 		return $query;
 	}
 
diff --git a/include/Webservices/ConvertLead.php b/include/Webservices/ConvertLead.php
index 0ed67b05926e91e96b02185d1d0fbb3a85078d28..82c0b75524cc943805a0f3ddd3338f4a20be3c94 100644
--- a/include/Webservices/ConvertLead.php
+++ b/include/Webservices/ConvertLead.php
@@ -174,6 +174,12 @@ function vtws_populateConvertLeadEntities($entityvalue, $entity, $entityHandler,
 		$entityFields = $entityHandler->getMeta()->getModuleFields();
 		$row = $adb->fetch_array($result);
 		$count = 1;
+                foreach ($entityFields as $fieldname=>$field){
+                        $defaultvalue=$field->getDefault();
+                        if($defaultvalue){
+                                $entity[$fieldname]=$defaultvalue;
+                        }
+                }
 		do {
 			$entityField = vtws_getFieldfromFieldId($row[$column], $entityFields);
 			if ($entityField == null) {
@@ -265,6 +271,12 @@ function vtws_updateConvertLeadStatus($entityIds, $leadId, $user) {
 		$leadModifiedTime = $adb->formatDate(date('Y-m-d H:i:s'), true);
 		$crmentityUpdateSql = "UPDATE vtiger_crmentity SET modifiedtime=?, modifiedby=? WHERE crmid=?";
 		$adb->pquery($crmentityUpdateSql, array($leadModifiedTime, $user->id, $leadIdComponents[1]));
+                //raise an event so that modules can take their actions on lead conversion
+                require_once("include/events/include.inc");
+                $em = new VTEventsManager($adb);
+                $em->initTriggerCache();
+                $entityData = VTEntityData::fromEntityId($adb, $leadIdComponents[1]);
+                $em->triggerEvent("vtiger.entity.leadconverted", $entityData);
 	}
     $moduleArray = array('Accounts','Contacts','Potentials');
 
diff --git a/include/events/VTEventTrigger.inc b/include/events/VTEventTrigger.inc
index 1d4e8ace414e270e3810cb563bfaccb1f856f701..f7c4f5cd30fd631b02fab4e1467a52046df7c444 100644
--- a/include/events/VTEventTrigger.inc
+++ b/include/events/VTEventTrigger.inc
@@ -15,7 +15,7 @@
 		private static $cache = array();
 		private static $cacheLookupType = '';
 
-		private static $mandatoryEventClass = array('VTEntityDelta', 'ModTrackerHandler');
+		private static $mandatoryEventClass = array('VTEntityDelta', 'ModTrackerHandler', 'PBXManagerBatchHandler');
 
 		const CACHE_LOOKUP_TYPE_ALL = 'ALL';
 
diff --git a/include/utils/VtlibUtils.php b/include/utils/VtlibUtils.php
index 24a0bfc9e6165c14ece3e86ed1c56bd01cfd20a2..57852c7b8120d1e55b178771f301839d28c0c80d 100644
--- a/include/utils/VtlibUtils.php
+++ b/include/utils/VtlibUtils.php
@@ -648,6 +648,7 @@ function vtlib_purify($input, $ignore=false) {
 				}
 			} else { // Simple type
 				$value = $__htmlpurifier_instance->purify($input);
+				$value = purifyHtmlEventAttributes($value);
 			}
 		}
 		$purified_cache[$md5OfInput] = $value;
@@ -656,6 +657,23 @@ function vtlib_purify($input, $ignore=false) {
 	return $value;
 }
 
+/**
+ * To purify malicious html event attributes
+ * @param <String> $value
+ * @return <String>
+ */
+function purifyHtmlEventAttributes($value){
+    $htmlEventAttributes = "onerror|onblur|onchange|oncontextmenu|onfocus|oninput|oninvalid|".
+                        "onreset|onsearch|onselect|onsubmit|onkeydown|onkeypress|onkeyup|".
+                        "onclick|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|".
+                        "ondragstart|ondrop|onmousedown|onmousemove|onmouseout|onmouseover|".
+                        "onmouseup|onmousewheel|onscroll|onwheel|oncopy|oncut|onpaste";
+    if(preg_match("/\s(".$htmlEventAttributes.")\s*=/i", $value)) {
+        $value = str_replace("=", "&equals;", $value);
+    }
+    return $value;
+}
+
 /**
  * Function to return the valid SQl input.
  * @param <String> $string
diff --git a/include/utils/utils.php b/include/utils/utils.php
index 1fc5cb04feb8c1047a4e79fcda3225c7f10fe77f..d0291ea2b2b7d69f9c634696b3eeb96859149307 100755
--- a/include/utils/utils.php
+++ b/include/utils/utils.php
@@ -345,9 +345,14 @@ $toHtml = array(
        */
 function to_html($string, $encode=true)
 {
+        $startstring=$string;
+	$cachedresult=Vtiger_Cache::get('to_html',$startstring);
+	if($cachedresult){
+		return $cachedresult;
+	}
+
 	global $log,$default_charset;
 	//$log->debug("Entering to_html(".$string.",".$encode.") method ...");
-	global $toHtml;
 	$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
 	$search = isset($_REQUEST['search']) ? $_REQUEST['search'] : null;
 
@@ -387,6 +392,7 @@ function to_html($string, $encode=true)
 	}
 
 	//$log->debug("Exiting to_html method ...");
+	Vtiger_Cache::set('to_html', $startstring, $string);
 	return $string;
 }
 
diff --git a/includes/main/WebUI.php b/includes/main/WebUI.php
index e01feea800900d71e1bedf98680388d0403e043b..fa8527dab9257925455a5507ef057c69edcfa581 100644
--- a/includes/main/WebUI.php
+++ b/includes/main/WebUI.php
@@ -22,15 +22,15 @@ class Vtiger_WebUI extends Vtiger_EntryPoint {
 	 * @throws AppException
 	 */
 	protected function checkLogin (Vtiger_Request $request) {
-		 if (!$this->hasLogin()) {
-			    $return_params = $_SERVER['QUERY_STRING'];
-                 if($return_params && !$_SESSION['return_params']) {
-                    //Take the url that user would like to redirect after they have successfully logged in.
-                    $return_params = urlencode($return_params);
-                    Vtiger_Session::set('return_params', $return_params);
-                }
-                header ('Location: index.php');
-                throw new AppException('Login is required');
+		if (!$this->hasLogin()) {
+			$return_params = $_SERVER['QUERY_STRING'];
+            if($return_params && !$_SESSION['return_params']) {
+                //Take the url that user would like to redirect after they have successfully logged in.
+                $return_params = urlencode($return_params);
+                Vtiger_Session::set('return_params', $return_params);
+            }
+            header ('Location: index.php');
+            throw new AppException('Login is required');
 		}
 	}
 
@@ -42,7 +42,7 @@ class Vtiger_WebUI extends Vtiger_EntryPoint {
 		$user = parent::getLogin();
 		if (!$user && isset($_SESSION['authenticated_user_id'])) {
 			$userid = Vtiger_Session::get('AUTHUSERID', $_SESSION['authenticated_user_id']);
-			if ($userid) {
+			if ($userid && vglobal('application_unique_key')==$_SESSION['app_unique_key']) {
 				$user = CRMEntity::getInstance('Users');
 				$user->retrieveCurrentUserInfoFromFile($userid);
 				$this->setLogin($user);
@@ -212,8 +212,9 @@ class Vtiger_WebUI extends Vtiger_EntryPoint {
 			}
 		} catch(Exception $e) {
 			if ($view) {
-				// Log for developement.
-				error_log($e->getTraceAsString(), E_NOTICE);
+				// log for development
+				global $log;
+				$log->debug($e->getMessage().":".$e->getTraceAsString());
 
 				$viewer = new Vtiger_Viewer();
 				$viewer->assign('MESSAGE', $e->getMessage());
diff --git a/languages/en_us/Install.php b/languages/en_us/Install.php
index 83c21d54d560b4b19f79b54d9a18bf1d524ac94d..08da15bdb61fdaa559005223fb87a287e5b055d0 100644
--- a/languages/en_us/Install.php
+++ b/languages/en_us/Install.php
@@ -17,6 +17,7 @@ $languageStrings = array(
 	'ERR_UNABLE_CREATE_DATABASE' => 'Unable to Create database',
 	'LBL_ADMIN_INFORMATION'=>'Admin User Information',
 	'LBL_ADMIN_USER_INFORMATION' => 'Admin User Information',
+	'LBL_CHOOSE_LANGUAGE' => 'Choose the default language for this installation:',
 	'LBL_CONFIRM_CONFIGURATION_SETTINGS' => 'Confirm Configuration Settings',
 	'LBL_CREATE_NEW_DB'=>'Create new database',
 	'LBL_CURRENCIES'=>'Currency',
diff --git a/languages/fr_fr/Calendar.php b/languages/fr_fr/Calendar.php
index 9d3d3e9ca1b7a1eb1f85462daee8a94f21db67bd..6e07fca506f3ba9be6e41160cccb9e1afa968208 100644
--- a/languages/fr_fr/Calendar.php
+++ b/languages/fr_fr/Calendar.php
@@ -17,9 +17,9 @@ $languageStrings = array(
 	'LBL_CALENDAR_SETTINGS'        => 'Calendar Settings'           , // TODO: Review
 	'LBL_CALENDAR_SHARING'         => 'Calendar Sharing'            , // TODO: Review
 	'LBL_DEFAULT_EVENT_DURATION'   => 'Default Event Duration'      , // TODO: Review
-	'LBL_CALL'                     => 'Call'                        , // TODO: Review
+	'LBL_CALL'                     => 'Appel'                        ,
 	'LBL_OTHER_EVENTS'             => 'Other Events'                , // TODO: Review
-	'LBL_MINUTES'                  => 'Minutes'                     , // TODO: Review
+	'LBL_MINUTES'                  => 'Minutes'                     ,
 	'LBL_SELECT_USERS'             => 'Select Users'                , // TODO: Review
 	'LBL_EVENT_OR_TASK'            => 'Evénement / Pour faire'                ,
 	'LBL_TASK_INFORMATION'         => 'Pour faire Information'                 , 
@@ -30,9 +30,9 @@ $languageStrings = array(
 	'Send Notification'            => 'Envoyer notification'        , 
 	'Location'                     => 'Localisation'                , 
 	'End Date & Time'              => 'Date et heure de fin'        , 
-	'LBL_ACTIVITY_TYPES'           => 'Activity Types'              , 
+	'LBL_ACTIVITY_TYPES'           => 'Activity Types'              , // TODO: Review 
 	'LBL_CONTACTS_SUPPORT_END_DATE' => 'Fin de support'              , 
-	'LBL_CONTACTS_BIRTH_DAY'       => 'Date of Birth'               , 
+	'LBL_CONTACTS_BIRTH_DAY'       => 'Date of Birth'               , // TODO: Review
 	'LBL_ADDED_CALENDARS'          => 'Added Calendars'             , // TODO: Review
 	'Call'                         => 'Appels'                      , 
 	'Meeting'                      => 'Rendez-vous'                 , 
@@ -48,23 +48,23 @@ $languageStrings = array(
 	'LBL_CHANGE_OWNER'             => 'Changer assignation'         , 
 	'LBL_EVENT'                    => 'Activité'                   , 
 	'LBL_TASK'                     => 'Pour faire'                      , 
-	'LBL_TASKS'					   => 'Pour faire',
+	'LBL_TASKS'		       => 'Pour faire',
 	'LBL_CALENDAR_VIEW'            => 'Calendar View'               , 
 	'LBL_SHARED_CALENDAR'          => 'Shared Calendar'             , // TODO: Review
-	'LBL_DAY0'                     => 'Sunday'                      , // TODO: Review
-	'LBL_DAY1'                     => 'Monday'                      , // TODO: Review
-	'LBL_DAY2'                     => 'Tuesday'                     , // TODO: Review
-	'LBL_DAY3'                     => 'Wednesday'                   , // TODO: Review
-	'LBL_DAY4'                     => 'Thursday'                    , // TODO: Review
-	'LBL_DAY5'                     => 'Friday'                      , // TODO: Review
-	'LBL_DAY6'                     => 'Saturday'                    , // TODO: Review
-	'first'                        => 'First'                       , // TODO: Review
-	'last'                         => 'Last'                        , // TODO: Review
+	'LBL_DAY0'                     => 'Dimanche'                      , // TODO: Review
+	'LBL_DAY1'                     => 'Lundi'                      ,
+	'LBL_DAY2'                     => 'Mardi'                     ,
+	'LBL_DAY3'                     => 'Mercredi'                   ,
+	'LBL_DAY4'                     => 'Jeudi'                    ,
+	'LBL_DAY5'                     => 'Vendredi'                      ,
+	'LBL_DAY6'                     => 'Samedi'                    ,
+	'first'                        => 'Premier'                       ,
+	'last'                         => 'Dernier'                        ,
 	'LBL_DAY_OF_THE_MONTH'         => 'day of the month'            , // TODO: Review
-	'LBL_ON'                       => 'on'                          , // TODO: Review
-	'Daily'                        => 'Day(s)'                      , // TODO: Review
-	'Weekly'                       => 'Week(s)'                     , // TODO: Review
-	'Monthly'                      => 'Month(s)'                    , // TODO: Review
+	'LBL_ON'                       => 'le'                          ,
+	'Daily'                        => 'Jour(s)'                      ,
+	'Weekly'                       => 'Semaine(s)'                     ,
+	'Monthly'                      => 'Mois'                    ,
 	'Yearly'                       => 'Year'                        , // TODO: Review
         'LBL_DEFAULT_STATUS_TYPE'      => 'Statut par défaut & Type'    ,
         'LBL_STATUS'                   => 'Statut'                      ,
@@ -86,55 +86,55 @@ $jsLanguageStrings = array(
         'JS_FUTURE_EVENT_CANNOT_BE_HELD' => 'Ne peut être tenue Pour l\'avenir',
 	
 	//Calendar view label translation
-	'LBL_MONTH' => 'Month',
-	'LBL_TODAY' => 'Today',
-	'LBL_DAY' => 'Day',
-	'LBL_WEEK' => 'Week',
+	'LBL_MONTH' => 'Mois',
+	'LBL_TODAY' => 'Aujourd\'hui',
+	'LBL_DAY' => 'Jour',
+	'LBL_WEEK' => 'Semaine',
 	
-	'LBL_SUNDAY' => 'Sunday',
-	'LBL_MONDAY' => 'Monday',
-	'LBL_TUESDAY' => 'Tuesday',
-	'LBL_WEDNESDAY' => 'Wednesday',
-	'LBL_THURSDAY' => 'Thursday',
-	'LBL_FRIDAY' => 'Friday',
-	'LBL_SATURDAY' => 'Saturday',
+	'LBL_SUNDAY' => 'Dimanche',
+	'LBL_MONDAY' => 'Lundi',
+	'LBL_TUESDAY' => 'Mardi',
+	'LBL_WEDNESDAY' => 'Mercredi',
+	'LBL_THURSDAY' => 'Jeudi',
+	'LBL_FRIDAY' => 'Vendredi',
+	'LBL_SATURDAY' => 'Samedi',
 	
-	'LBL_SUN' => 'Sun',
-	'LBL_MON' => 'Mon',
-	'LBL_TUE' => 'Tue',
-	'LBL_WED' => 'Wed',
-	'LBL_THU' => 'Thu',
-	'LBL_FRI' => 'Fri',
-	'LBL_SAT' => 'Sat',
+	'LBL_SUN' => 'Dim',
+	'LBL_MON' => 'Lun',
+	'LBL_TUE' => 'Mar',
+	'LBL_WED' => 'Mer',
+	'LBL_THU' => 'Jeu',
+	'LBL_FRI' => 'Ven',
+	'LBL_SAT' => 'Sam',
 	
-	'LBL_JANUARY' => 'January',
-	'LBL_FEBRUARY' => 'February',
-	'LBL_MARCH' => 'March',
-	'LBL_APRIL' => 'April',
-	'LBL_MAY' => 'May',
-	'LBL_JUNE' => 'June',
-	'LBL_JULY' => 'July',
-	'LBL_AUGUST' => 'August',
-	'LBL_SEPTEMBER' => 'September',
-	'LBL_OCTOBER' => 'October',
-	'LBL_NOVEMBER' => 'November',
-	'LBL_DECEMBER' => 'December',
+	'LBL_JANUARY' => 'Janvier',
+	'LBL_FEBRUARY' => 'February', // TODO: Review
+	'LBL_MARCH' => 'Mars',
+	'LBL_APRIL' => 'Avril',
+	'LBL_MAY' => 'Mai',
+	'LBL_JUNE' => 'Juin',
+	'LBL_JULY' => 'Juillet',
+	'LBL_AUGUST' => 'August', // TODO: Review
+	'LBL_SEPTEMBER' => 'Septembre',
+	'LBL_OCTOBER' => 'Octobre',
+	'LBL_NOVEMBER' => 'Novembre',
+	'LBL_DECEMBER' => 'Decembre',
 	
 	'LBL_JAN' => 'Jan',
-	'LBL_FEB' => 'Feb',
+	'LBL_FEB' => 'Fev',
 	'LBL_MAR' => 'Mar',
-	'LBL_APR' => 'Apr',
-	'LBL_MAY' => 'May',
+	'LBL_APR' => 'Avr',
+	'LBL_MAY' => 'Mai',
 	'LBL_JUN' => 'Jun',
 	'LBL_JUL' => 'Jul',
-	'LBL_AUG' => 'Aug',
+	'LBL_AUG' => 'Aou',
 	'LBL_SEP' => 'Sep',
 	'LBL_OCT' => 'Oct',
 	'LBL_NOV' => 'Nov',
 	'LBL_DEC' => 'Dec',
 	
-	'LBL_ALL_DAY' => 'All-Day',
-	'Mobile Call' => 'Mobile Call',
+	'LBL_ALL_DAY' => 'All-Day', // TODO: Review
+	'Mobile Call' => 'Mobile Call', // TODO: Review
 	//End
 	
 	//Fixing colors for Shared Calendar and My Calendar
diff --git a/layouts/vlayout/modules/Calendar/resources/Edit.js b/layouts/vlayout/modules/Calendar/resources/Edit.js
index e52b21a48d53d5b60bdc9bf33906242508b1f8e9..8f6d26d30cdf92865cf67a7774571dc3496f7c1d 100644
--- a/layouts/vlayout/modules/Calendar/resources/Edit.js
+++ b/layouts/vlayout/modules/Calendar/resources/Edit.js
@@ -209,9 +209,6 @@ Vtiger_Edit_Js("Calendar_Edit_Js",{
 			var dateStartElement = container.find('[name="date_start"]');
             var endDateElement = container.find('[name="due_date"]');
 			
-            if(endDateElement.data('userChangedTime') == true) {
-                return;
-            }
             if(jQuery('[name="userChangedEndDateTime"]').val() == '1') {
                 return;
             }
@@ -452,4 +449,4 @@ Vtiger_Edit_Js("Calendar_Edit_Js",{
         this.registerRelatedContactSpecificEvents();
 		this._super();
 	}
-});
\ No newline at end of file
+});
diff --git a/layouts/vlayout/modules/Install/Step1.tpl b/layouts/vlayout/modules/Install/Step1.tpl
index 5bff3cdd82031df3b6fd4e8c07b25ecb314ac6ac..011a83ab6701811462afb13bd003171a2ed3aeb7 100644
--- a/layouts/vlayout/modules/Install/Step1.tpl
+++ b/layouts/vlayout/modules/Install/Step1.tpl
@@ -37,6 +37,17 @@
 						<h3>{vtranslate('LBL_WELCOME_TO_VTIGER6_SETUP_WIZARD', 'Install')}</h3>
 						{vtranslate('LBL_VTIGER6_SETUP_WIZARD_DESCRIPTION','Install')}
 					</div>
+					{if $LANGUAGES|@count > 1}
+					<div>
+						<label>{vtranslate('LBL_CHOOSE_LANGUAGE', 'Install')}
+							<select name="lang" id="lang">
+							{foreach key=header item=language from=$LANGUAGES}
+								<option value="{$header}" {if $header eq $CURRENT_LANGUAGE}selected{/if}>{vtranslate("$language",'Install')}</option>
+							{/foreach}
+							</select>
+						</label>
+					</div>
+					{/if}
 				</div>
 			</div>
 			<div class="row-fluid">
diff --git a/layouts/vlayout/modules/Install/Step6.tpl b/layouts/vlayout/modules/Install/Step6.tpl
index 9060fe6b195b27d62f365e501183aa18a1550f5c..1779dff126f71010ac2a2231f186091e3145cae7 100644
--- a/layouts/vlayout/modules/Install/Step6.tpl
+++ b/layouts/vlayout/modules/Install/Step6.tpl
@@ -109,7 +109,7 @@
 
 <div id="progressIndicator" class="row-fluid main-container hide">
 	<div class="inner-container">
-		<div class="span12 inner-container">
+		<div class="inner-container">
 			<div class="row-fluid">
 				<div class="span12 welcome-div alignCenter">
 					<h3>{vtranslate('LBL_INSTALLATION_IN_PROGRESS','Install')}...</h3><br>
diff --git a/layouts/vlayout/modules/Migration/MigrationStep1.tpl b/layouts/vlayout/modules/Migration/MigrationStep1.tpl
index e559e4dfee5e1cc61b9ac66862e16ed95be1acd6..fbf97fbfb78ad988305ea56cc40ec0329d44a209 100644
--- a/layouts/vlayout/modules/Migration/MigrationStep1.tpl
+++ b/layouts/vlayout/modules/Migration/MigrationStep1.tpl
@@ -44,7 +44,7 @@
 					<input type="hidden" id="module" name="module" value="Migration">
 					<input type="hidden" id="view" name="view" value="Index">
 					<input type="hidden" name="mode" value="step2">
-					<input type="submit" class="btn btn-large btn-primary" value="Next"/>
+					<input type="submit" class="btn btn-large btn-primary" value="{vtranslate('Next', $MODULE)}"/>
 				</form>
 			</div>
 		</div>
diff --git a/layouts/vlayout/modules/Migration/MigrationStep2.tpl b/layouts/vlayout/modules/Migration/MigrationStep2.tpl
index 166dba08f41fb3ecd33a0eaaa633b25ab509cabe..5452d20ad7aee08a808faa43d81b2232227a636f 100644
--- a/layouts/vlayout/modules/Migration/MigrationStep2.tpl
+++ b/layouts/vlayout/modules/Migration/MigrationStep2.tpl
@@ -49,7 +49,7 @@
 	                            &nbsp;&nbsp;<a href="//www.vtiger.com/products/crm/privacy_policy.html" target="_blank"><img src="{vimage_path('linkedin.png')}"></a> 
 								<br><br>
 							<div class="button-container">
-								<input type="button" onclick="window.location.href='index.php'" class="btn btn-large btn-primary" value="Finish"/>
+								<input type="button" onclick="window.location.href='index.php'" class="btn btn-large btn-primary" value="{vtranslate('Finish', $MODULE)}"/>
 							</div>
 					</div>
 				</div>
diff --git a/layouts/vlayout/modules/Potentials/dashboards/TopPotentialsContents.tpl b/layouts/vlayout/modules/Potentials/dashboards/TopPotentialsContents.tpl
index 049ce6ea978fdaa642813ee557927e60949f8ec7..2074c8e11e86ae4a69af14000f7b29fad1e30b52 100644
--- a/layouts/vlayout/modules/Potentials/dashboards/TopPotentialsContents.tpl
+++ b/layouts/vlayout/modules/Potentials/dashboards/TopPotentialsContents.tpl
@@ -40,7 +40,7 @@
 	</div>
 {else}
 	<span class="noDataMsg">
-		{vtranslate('LBL_NO')} {vtranslate($MODULE_NAME, $MODULE_NAME)} {vtranslate('LBL_MATCHED_THIS_CRITERIA')}
+		{vtranslate('LBL_EQ_ZERO')} {vtranslate($MODULE_NAME, $MODULE_NAME)} {vtranslate('LBL_MATCHED_THIS_CRITERIA')}
 	</span>
 {/if}
-</div>
\ No newline at end of file
+</div>
diff --git a/layouts/vlayout/modules/Settings/Groups/EditView.tpl b/layouts/vlayout/modules/Settings/Groups/EditView.tpl
index fcddbbfc21c69c7aec40b4c17f53fb0b84f90f67..ad23aeae82eeb8060ee8acd8e1c0120faf298901 100644
--- a/layouts/vlayout/modules/Settings/Groups/EditView.tpl
+++ b/layouts/vlayout/modules/Settings/Groups/EditView.tpl
@@ -51,7 +51,7 @@
 						{assign var="GROUP_MEMBERS" value=$RECORD_MODEL->getMembers()}
 						<select id="memberList" class="row-fluid members" multiple="true" name="members[]" data-placeholder="{vtranslate('LBL_ADD_USERS_ROLES', $QUALIFIED_MODULE)}" data-validation-engine="validate[required]">
 							{foreach from=$MEMBER_GROUPS key=GROUP_LABEL item=ALL_GROUP_MEMBERS}
-								<optgroup label="{$GROUP_LABEL}">
+								<optgroup label="{vtranslate($GROUP_LABEL, $QUALIFIED_MODULE)}">
 								{foreach from=$ALL_GROUP_MEMBERS item=MEMBER}
 									{if $MEMBER->getName() neq $RECORD_MODEL->getName()}
 										<option value="{$MEMBER->getId()}"  data-member-type="{$GROUP_LABEL}" {if isset($GROUP_MEMBERS[$GROUP_LABEL][$MEMBER->getId()])}selected="true"{/if}>{$MEMBER->getName()}</option>
diff --git a/layouts/vlayout/modules/Settings/MailConverter/ListViewContents.tpl b/layouts/vlayout/modules/Settings/MailConverter/ListViewContents.tpl
index ea1232738c2e7f9dab441716b085acdc8c5b03eb..325e785da03af191f4edbc275cb503c8135be89f 100644
--- a/layouts/vlayout/modules/Settings/MailConverter/ListViewContents.tpl
+++ b/layouts/vlayout/modules/Settings/MailConverter/ListViewContents.tpl
@@ -18,7 +18,7 @@
 						<span class="font-x-large">{$RECORD->getName()}</span>
 					<div class="pull-right btn-group">
 						<button class="btn dropdown-toggle" data-toggle="dropdown">
-							Actions
+							{vtranslate('Actions',$QUALIFIED_MODULE)}
 							<span class="caret"></span>
 						</button>
 						<ul class="dropdown-menu pull-right">
diff --git a/layouts/vlayout/modules/Settings/Profiles/EditView.tpl b/layouts/vlayout/modules/Settings/Profiles/EditView.tpl
index 09eca1f21e04aa3a84974a21391c24b222138b48..d814a90cabaec83c9dc4e1cee336832966e7422b 100644
--- a/layouts/vlayout/modules/Settings/Profiles/EditView.tpl
+++ b/layouts/vlayout/modules/Settings/Profiles/EditView.tpl
@@ -215,7 +215,7 @@
 										{else}
 											style="border-right: 1px solid #DDD !important;"
 										{/if}>
-									<input type="checkbox" class="alignTop"  name="permissions[{$TABID}][actions][{$ACTIONID}]" {if $RECORD_MODEL->hasModuleActionPermission($PROFILE_MODULE, $ACTIONID)}checked="true" {elseif empty($RECORD_ID) && empty($IS_DUPLICATE_RECORD)} checked="true" {/if}> {$ACTION_MODEL->getName()}</td>
+									<input type="checkbox" class="alignTop"  name="permissions[{$TABID}][actions][{$ACTIONID}]" {if $RECORD_MODEL->hasModuleActionPermission($PROFILE_MODULE, $ACTIONID)}checked="true" {elseif empty($RECORD_ID) && empty($IS_DUPLICATE_RECORD)} checked="true" {/if}> {vtranslate($ACTION_MODEL->getName(), $MODULE)}</td>
 									{if $smarty.foreach.actions.last OR ($smarty.foreach.actions.index+1) % 3 == 0}
 										</div>
 									{/if}
diff --git a/layouts/vlayout/modules/Settings/Vtiger/ListViewContents.tpl b/layouts/vlayout/modules/Settings/Vtiger/ListViewContents.tpl
index 2c2d112a1b5f938bb9e69e373f17744d9b1382c5..9fe2d2183f851f469acc06390cc301d96de78cbe 100644
--- a/layouts/vlayout/modules/Settings/Vtiger/ListViewContents.tpl
+++ b/layouts/vlayout/modules/Settings/Vtiger/ListViewContents.tpl
@@ -94,4 +94,4 @@
 	</table>
 	{/if}
 </div>
-{/strip}
\ No newline at end of file
+{/strip}
diff --git a/layouts/vlayout/modules/Settings/Workflows/EditTask.tpl b/layouts/vlayout/modules/Settings/Workflows/EditTask.tpl
index f8e1b02f1a87c4f6a1689b06eab71489b077c88f..f446dac8a02ae909dbfd8e79b61bc91e81858f80 100644
--- a/layouts/vlayout/modules/Settings/Workflows/EditTask.tpl
+++ b/layouts/vlayout/modules/Settings/Workflows/EditTask.tpl
@@ -14,7 +14,7 @@
 	<div class='modelContainer' id="addTaskContainer">
 		<div class="modal-header contentsBackground">
 			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-			<h3>{vtranslate('LBL_ADD_TASKS_FOR_WORKFLOW', $QUALIFIED_MODULE)} -> {$TASK_TYPE_MODEL->get('label')}</h3>
+			<h3>{vtranslate('LBL_ADD_TASKS_FOR_WORKFLOW', $QUALIFIED_MODULE)} -> {vtranslate($TASK_TYPE_MODEL->get('label'), $QUALIFIED_MODULE)}</h3>
 		</div>
 		<form class="form-horizontal" id="saveTask" method="post" action="index.php">
 			<input type="hidden" name="module" value="{$MODULE}" />
diff --git a/layouts/vlayout/modules/Users/ForgotPassword.tpl b/layouts/vlayout/modules/Users/ForgotPassword.tpl
index f0593237009f96587db8b92f52eb947fb38f4664..0c740c66b7fd960098f109d85965d6577eaab69d 100644
--- a/layouts/vlayout/modules/Users/ForgotPassword.tpl
+++ b/layouts/vlayout/modules/Users/ForgotPassword.tpl
@@ -99,7 +99,7 @@
 								<tr><td></td></tr>
 								<tr>
 									<td></td>
-									<td><input type="submit" id="btn" value="Submit" onclick="return checkPassword();"/></td>
+									<td><input type="submit" id="btn" value={vtranslate('Submit', $MODULE)} onclick="return checkPassword();"/></td>
 								</tr>
 							</table>
 						</form>
diff --git a/layouts/vlayout/modules/Users/ListViewContents.tpl b/layouts/vlayout/modules/Users/ListViewContents.tpl
index 950024ab87ec17560d8c0bb05e110176de61a22d..79eff817fa8bdd850290000e5d1ec73ebcb588c9 100644
--- a/layouts/vlayout/modules/Users/ListViewContents.tpl
+++ b/layouts/vlayout/modules/Users/ListViewContents.tpl
@@ -139,4 +139,4 @@
 	{/if}
 
 </div>
-{/strip}
\ No newline at end of file
+{/strip}
diff --git a/layouts/vlayout/modules/Users/UserSetup.tpl b/layouts/vlayout/modules/Users/UserSetup.tpl
index 395eac2dd06611e640c9c766a694119dae1ecd09..d07613b16ce04bd224cad23c1c69a8dea68b78de 100644
--- a/layouts/vlayout/modules/Users/UserSetup.tpl
+++ b/layouts/vlayout/modules/Users/UserSetup.tpl
@@ -1,459 +1,459 @@
-{*<!--
-/*********************************************************************************
-** 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.
-*
-********************************************************************************/
--->*}
-{strip}
-<!DOCTYPE html>
-<html>
-	<head>
-		<title>Vtiger</title>
-		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-
-		<link REL="SHORTCUT ICON" HREF="layouts/vlayout/skins/images/favicon.ico">
-		<link rel="stylesheet" href="libraries/bootstrap/css/bootstrap.css" type="text/css" media="screen" />
-		<link rel="stylesheet" href="resources/styles.css" type="text/css" media="screen" />
-		<link rel="stylesheet" href="libraries/jquery/select2/select2.css" />
-		<link rel="stylesheet" href="libraries/jquery/posabsolute-jQuery-Validation-Engine/css/validationEngine.jquery.css" />
-
-		<script type="text/javascript" src="libraries/jquery/jquery.min.js"></script>
-		<script type="text/javascript" src="libraries/bootstrap/js/bootstrap-tooltip.js"></script>
-		<script type="text/javascript" src="libraries/jquery/select2/select2.min.js"></script>
-		<script type="text/javascript" src="libraries/jquery/posabsolute-jQuery-Validation-Engine/js/jquery.validationEngine.js" ></script>
-		<script type="text/javascript" src="libraries/jquery/posabsolute-jQuery-Validation-Engine/js/jquery.validationEngine-en.js" ></script>
-
-		<script type="text/javascript">{literal}
-			jQuery(function(){
-				jQuery('select').select2({blurOnChange:true});
-				jQuery('[rel="tooltip"]').tooltip();
-				jQuery('form').validationEngine({
-					prettySelect: true,
-					usePrefix: 's2id_',
-					autoPositionUpdate: true,
-					promptPosition : "topLeft",
-					showOneMessage: true
-				});
-				jQuery('#currency_name_controls').mouseenter(function() {
-					jQuery('#currency_name_tooltip').tooltip('show');
-				});
-				jQuery('#currency_name_controls').mouseleave(function() {
-					jQuery('#currency_name_tooltip').tooltip('hide');
-				});
-			});
-		{/literal}</script>
-		<style type="text/css">{literal}
-			 body { background: #ffffff url('layouts/vlayout/skins/images/usersetupbg.png') no-repeat center top; background-size: 100%; font-size: 14px; }
-			.modal-backdrop { opacity: 0.35; }
-			.tooltip { z-index: 1055; }
-			input, select, textarea { font-size: 14px; }
-		{/literal}</style>
-	</head>
-	<body>
-
-		<div class="container">
-			<div class="modal-backdrop"></div>
-			<form class="form" method="POST" action="index.php?module=Users&action=UserSetupSave">
-				<div class="modal" {if false && $IS_FIRST_USER}style="width: 700px;"{/if}> {* FirstUser information gather - paused *}
-					<div class="modal-header">
-						<h3>{vtranslate('LBL_ALMOST_THERE', $MODULE)}</h3>
-					</div>
-					<div class="modal-body">
-						<div class="row">
-							{if false && $IS_FIRST_USER} {* FirstUser information gather - paused *}
-							<div class="span4">
-								<label class="control-label"><strong>{vtranslate('LBL_ABOUT_ME', $MODULE)}</strong> <span class="muted">{vtranslate('LBL_WE_PROMISE_TO_KEEP_THIS_PRIVATE', $MODULE)}</span></label>
-								<div class="controls">
-									<input type="text" name="about[phone]" id="phone" placeholder="{vtranslate('LBL_PHONE', $MODULE)}" rel="tooltip" title="{vtranslate('LBL_YOUR_CONTACT_NUMBER', $MODULE)}" style="width:250px;">
-								</div>
-								<div class="controls">
-									<select name="about[country]" id="country" placeholder="{vtranslate('LBL_SELECT_COUNTRY', $MODULE)}" rel="tooltip" title="{vtranslate('LBL_WHERE_ARE_YOU_FROM', $MODULE)}" style="width:250px;">
-										<option value=""></option><!-- to allow select2 pick placeholder -->
-										<option value="Prefer Not to Disclose">Prefer Not to Disclose</option>
-										<option value="United States">United States</option>
-										<option value="Afghanistan">Afghanistan</option>
-										<option value="Africa">Africa</option>
-										<option value="Albania">Albania</option>
-										<option value="Algeria">Algeria</option>
-										<option value="American Samoa">American Samoa</option>
-										<option value="Andorra">Andorra</option>
-										<option value="Angola">Angola</option>
-										<option value="Anguilla">Anguilla</option>
-										<option value="Antarctica">Antarctica</option>
-										<option value="Antigua &amp; Barbuda">Antigua &amp; Barbuda</option>
-										<option value="Antilles, Netherlands">Antilles, Netherlands</option>
-										<option value="Arabia, Saudi">Arabia, Saudi</option>
-										<option value="Argentina">Argentina</option>
-										<option value="Armenia">Armenia</option>
-										<option value="Aruba">Aruba</option>
-										<option value="Asia">Asia</option>
-										<option value="Australia">Australia</option>
-										<option value="Austria">Austria</option>
-										<option value="Azerbaijan">Azerbaijan</option>
-										<option value="Bahamas, The">Bahamas, The</option>
-										<option value="Bahrain">Bahrain</option>
-										<option value="Bangladesh">Bangladesh</option>
-										<option value="Barbados">Barbados</option>
-										<option value="Belarus">Belarus</option>
-										<option value="Belgium">Belgium</option>
-										<option value="Belize">Belize</option>
-										<option value="Benin">Benin</option>
-										<option value="Bermuda">Bermuda</option>
-										<option value="Bhutan">Bhutan</option>
-										<option value="Bolivia">Bolivia</option>
-										<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
-										<option value="Botswana">Botswana</option>
-										<option value="Bouvet Island">Bouvet Island</option>
-										<option value="Brazil">Brazil</option>
-										<option value="British Indian Ocean T.">British Indian Ocean T.</option>
-										<option value="British Virgin Islands">British Virgin Islands</option>
-										<option value="Brunei Darussalam">Brunei Darussalam</option>
-										<option value="Bulgaria">Bulgaria</option>
-										<option value="Burkina Faso">Burkina Faso</option>
-										<option value="Burundi">Burundi</option>
-										<option value="Cambodia">Cambodia</option>
-										<option value="Cameroon">Cameroon</option>
-										<option value="Canada">Canada</option>
-										<option value="Cape Verde">Cape Verde</option>
-										<option value="Caribbean, the">Caribbean, the</option>
-										<option value="Cayman Islands">Cayman Islands</option>
-										<option value="Central African Republic">Central African Republic</option>
-										<option value="Central America">Central America</option>
-										<option value="Chad">Chad</option>
-										<option value="Chile">Chile</option>
-										<option value="China">China</option>
-										<option value="Christmas Island">Christmas Island</option>
-										<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
-										<option value="Colombia">Colombia</option>
-										<option value="Comoros">Comoros</option>
-										<option value="Congo">Congo</option>
-										<option value="Congo, Dem. Rep. of the">Congo, Dem. Rep. of the</option>
-										<option value="Cook Islands">Cook Islands</option>
-										<option value="Costa Rica">Costa Rica</option>
-										<option value="Cote D'Ivoire">Cote D'Ivoire</option>
-										<option value="Croatia">Croatia</option>
-										<option value="Cuba">Cuba</option>
-										<option value="Cyprus">Cyprus</option>
-										<option value="Czech Republic">Czech Republic</option>
-										<option value="Denmark">Denmark</option>
-										<option value="Djibouti">Djibouti</option>
-										<option value="Dominica">Dominica</option>
-										<option value="Dominican Republic">Dominican Republic</option>
-										<option value="East Timor (Timor-Leste)">East Timor (Timor-Leste)</option>
-										<option value="Ecuador">Ecuador</option>
-										<option value="Egypt">Egypt</option>
-										<option value="El Salvador">El Salvador</option>
-										<option value="Equatorial Guinea">Equatorial Guinea</option>
-										<option value="Eritrea">Eritrea</option>
-										<option value="Estonia">Estonia</option>
-										<option value="Ethiopia">Ethiopia</option>
-										<option value="Europe">Europe</option>
-										<option value="European Union">European Union</option>
-										<option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
-										<option value="Faroe Islands">Faroe Islands</option>
-										<option value="Fiji">Fiji</option>
-										<option value="Finland">Finland</option>
-										<option value="France">France</option>
-										<option value="French Guiana">French Guiana</option>
-										<option value="French Polynesia">French Polynesia</option>
-										<option value="French Southern Terr.">French Southern Terr.</option>
-										<option value="Gabon">Gabon</option>
-										<option value="Gambia, the">Gambia, the</option>
-										<option value="Georgia">Georgia</option>
-										<option value="Germany">Germany</option>
-										<option value="Ghana">Ghana</option>
-										<option value="Gibraltar">Gibraltar</option>
-										<option value="Greece">Greece</option>
-										<option value="Greenland">Greenland</option>
-										<option value="Grenada">Grenada</option>
-										<option value="Guadeloupe">Guadeloupe</option>
-										<option value="Guam">Guam</option>
-										<option value="Guatemala">Guatemala</option>
-										<option value="Guernsey and Alderney">Guernsey and Alderney</option>
-										<option value="Guiana, French">Guiana, French</option>
-										<option value="Guinea">Guinea</option>
-										<option value="Guinea-Bissau">Guinea-Bissau</option>
-										<option value="Guinea, Equatorial">Guinea, Equatorial</option>
-										<option value="Guyana">Guyana</option>
-										<option value="Haiti">Haiti</option>
-										<option value="Heard &amp; McDonald Is.(AU)">Heard &amp; McDonald Is.(AU)</option>
-										<option value="Holy See (Vatican)">Holy See (Vatican)</option>
-										<option value="Honduras">Honduras</option>
-										<option value="Hong Kong, (China)">Hong Kong, (China)</option>
-										<option value="Hungary">Hungary</option>
-										<option value="Iceland">Iceland</option>
-										<option value="India">India</option>
-										<option value="Indonesia">Indonesia</option>
-										<option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
-										<option value="Iraq">Iraq</option>
-										<option value="Ireland">Ireland</option>
-										<option value="Israel">Israel</option>
-										<option value="Italy">Italy</option>
-										<option value="Ivory Coast (Cote d'Ivoire)">Ivory Coast (Cote d'Ivoire)</option>
-										<option value="Jamaica">Jamaica</option>
-										<option value="Japan">Japan</option>
-										<option value="Jersey">Jersey</option>
-										<option value="Jordan">Jordan</option>
-										<option value="Kazakhstan">Kazakhstan</option>
-										<option value="Kenya">Kenya</option>
-										<option value="Kiribati">Kiribati</option>
-										<option value="Korea Dem. People's Rep.">Korea Dem. People's Rep.</option>
-										<option value="Korea, (South) Republic of">Korea, (South) Republic of</option>
-										<option value="Kosovo">Kosovo</option>
-										<option value="Kuwait">Kuwait</option>
-										<option value="Kyrgyzstan">Kyrgyzstan</option>
-										<option value="Lao People's Democ. Rep.">Lao People's Democ. Rep.</option>
-										<option value="Latvia">Latvia</option>
-										<option value="Lebanon">Lebanon</option>
-										<option value="Lesotho">Lesotho</option>
-										<option value="Liberia">Liberia</option>
-										<option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option>
-										<option value="Liechtenstein">Liechtenstein</option>
-										<option value="Lithuania">Lithuania</option>
-										<option value="Luxembourg">Luxembourg</option>
-										<option value="Macao, (China)">Macao, (China)</option>
-										<option value="Macedonia, TFYR">Macedonia, TFYR</option>
-										<option value="Madagascar">Madagascar</option>
-										<option value="Malawi">Malawi</option>
-										<option value="Malaysia">Malaysia</option>
-										<option value="Maldives">Maldives</option>
-										<option value="Mali">Mali</option>
-										<option value="Malta">Malta</option>
-										<option value="Man, Isle of">Man, Isle of</option>
-										<option value="Marshall Islands">Marshall Islands</option>
-										<option value="Martinique (FR)">Martinique (FR)</option>
-										<option value="Mauritania">Mauritania</option>
-										<option value="Mauritius">Mauritius</option>
-										<option value="Mayotte (FR)">Mayotte (FR)</option>
-										<option value="Mexico">Mexico</option>
-										<option value="Micronesia, Fed. States of">Micronesia, Fed. States of</option>
-										<option value="Middle East">Middle East</option>
-										<option value="Moldova, Republic of">Moldova, Republic of</option>
-										<option value="Monaco">Monaco</option>
-										<option value="Mongolia">Mongolia</option>
-										<option value="Montenegro">Montenegro</option>
-										<option value="Montserrat">Montserrat</option>
-										<option value="Morocco">Morocco</option>
-										<option value="Mozambique">Mozambique</option>
-										<option value="Myanmar (ex-Burma)">Myanmar (ex-Burma)</option>
-										<option value="Namibia">Namibia</option>
-										<option value="Nauru">Nauru</option>
-										<option value="Nepal">Nepal</option>
-										<option value="Netherlands">Netherlands</option>
-										<option value="Netherlands Antilles">Netherlands Antilles</option>
-										<option value="New Caledonia">New Caledonia</option>
-										<option value="New Zealand">New Zealand</option>
-										<option value="Nicaragua">Nicaragua</option>
-										<option value="Niger">Niger</option>
-										<option value="Nigeria">Nigeria</option>
-										<option value="Niue">Niue</option>
-										<option value="Norfolk Island">Norfolk Island</option>
-										<option value="North America">North America</option>
-										<option value="Northern Mariana Islands">Northern Mariana Islands</option>
-										<option value="Norway">Norway</option>
-										<option value="Oceania">Oceania</option>
-										<option value="Oman">Oman</option>
-										<option value="Pakistan">Pakistan</option>
-										<option value="Palau">Palau</option>
-										<option value="Palestinian Territory">Palestinian Territory</option>
-										<option value="Panama">Panama</option>
-										<option value="Papua New Guinea">Papua New Guinea</option>
-										<option value="Paraguay">Paraguay</option>
-										<option value="Peru">Peru</option>
-										<option value="Philippines">Philippines</option>
-										<option value="Pitcairn Island">Pitcairn Island</option>
-										<option value="Poland">Poland</option>
-										<option value="Portugal">Portugal</option>
-										<option value="Puerto Rico">Puerto Rico</option>
-										<option value="Qatar">Qatar</option>
-										<option value="Reunion (FR)">Reunion (FR)</option>
-										<option value="Romania">Romania</option>
-										<option value="Russia (Russian Fed.)">Russia (Russian Fed.)</option>
-										<option value="Rwanda">Rwanda</option>
-										<option value="Sahara, Western">Sahara, Western</option>
-										<option value="Saint Barthelemy (FR)">Saint Barthelemy (FR)</option>
-										<option value="Saint Helena (UK)">Saint Helena (UK)</option>
-										<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
-										<option value="Saint Lucia">Saint Lucia</option>
-										<option value="Saint Martin (FR)">Saint Martin (FR)</option>
-										<option value="S Pierre &amp; Miquelon(FR)">S Pierre &amp; Miquelon(FR)</option>
-										<option value="S Vincent &amp; Grenadines">S Vincent &amp; Grenadines</option>
-										<option value="Samoa">Samoa</option>
-										<option value="San Marino">San Marino</option>
-										<option value="Sao Tome and Principe">Sao Tome and Principe</option>
-										<option value="Saudi Arabia">Saudi Arabia</option>
-										<option value="Senegal">Senegal</option>
-										<option value="Serbia">Serbia</option>
-										<option value="Seychelles">Seychelles</option>
-										<option value="Sierra Leone">Sierra Leone</option>
-										<option value="Singapore">Singapore</option>
-										<option value="Slovakia">Slovakia</option>
-										<option value="Slovenia">Slovenia</option>
-										<option value="Solomon Islands">Solomon Islands</option>
-										<option value="Somalia">Somalia</option>
-										<option value="South Africa">South Africa</option>
-										<option value="South America">South America</option>
-										<option value="S.George &amp; S.Sandwich">S.George &amp; S.Sandwich</option>
-										<option value="South Sudan">South Sudan</option>
-										<option value="Spain">Spain</option>
-										<option value="Sri Lanka (ex-Ceilan)">Sri Lanka (ex-Ceilan)</option>
-										<option value="Sudan">Sudan</option>
-										<option value="Suriname">Suriname</option>
-										<option value="Svalbard &amp; Jan Mayen Is.">Svalbard &amp; Jan Mayen Is.</option>
-										<option value="Swaziland">Swaziland</option>
-										<option value="Sweden">Sweden</option>
-										<option value="Switzerland">Switzerland</option>
-										<option value="Syrian Arab Republic">Syrian Arab Republic</option>
-										<option value="Taiwan">Taiwan</option>
-										<option value="Tajikistan">Tajikistan</option>
-										<option value="Tanzania, United Rep. of">Tanzania, United Rep. of</option>
-										<option value="Thailand">Thailand</option>
-										<option value="Timor-Leste (East Timor)">Timor-Leste (East Timor)</option>
-										<option value="Togo">Togo</option>
-										<option value="Tokelau">Tokelau</option>
-										<option value="Tonga">Tonga</option>
-										<option value="Trinidad &amp; Tobago">Trinidad &amp; Tobago</option>
-										<option value="Tunisia">Tunisia</option>
-										<option value="Turkey">Turkey</option>
-										<option value="Turkmenistan">Turkmenistan</option>
-										<option value="Turks and Caicos Is.">Turks and Caicos Is.</option>
-										<option value="Tuvalu">Tuvalu</option>
-										<option value="Uganda">Uganda</option>
-										<option value="Ukraine">Ukraine</option>
-										<option value="United Arab Emirates">United Arab Emirates</option>
-										<option value="United Kingdom">United Kingdom</option>
-										<option value="US Minor Outlying Isl.">US Minor Outlying Isl.</option>
-										<option value="Uruguay">Uruguay</option>
-										<option value="Uzbekistan">Uzbekistan</option>
-										<option value="Vanuatu">Vanuatu</option>
-										<option value="Vatican (Holy See)">Vatican (Holy See)</option>
-										<option value="Venezuela">Venezuela</option>
-										<option value="Viet Nam">Viet Nam</option>
-										<option value="Virgin Islands, British">Virgin Islands, British</option>
-										<option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
-										<option value="Wallis and Futuna">Wallis and Futuna</option>
-										<option value="Western Sahara">Western Sahara</option>
-										<option value="Yemen">Yemen</option>
-										<option value="Zambia">Zambia</option>
-										<option value="Zimbabwe">Zimbabwe</option>
-									</select>
-									<div style="padding-top:10px;"></div>
-								</div>
-								<div class="controls">
-									<select name="about[company_size]" id="company_size" placeholder="{vtranslate('LBL_COMPANY_SIZE', $MODULE)}" style="width:250px;">
-										<option value=""></option><!-- to allow select2 pick placeholder -->
-										<option value="Prefer Not to Disclose">Prefer Not to Disclose</option>
-										<option value="1">1</option>
-										<option value="2 - 3">2 - 3</option>
-										<option value="4 - 7">4 - 7</option>
-										<option value="8 - 15">8 - 15</option>
-										<option value="16 - 25">16 - 25</option>
-										<option value="26 - 50">26 - 50</option>
-										<option value="51 - 100">51 - 100</option>
-										<option value="101 - 250">101 - 250</option>
-										<option value="251 - 500">251 - 500</option>
-										<option value="501 +">501 +</option>
-									</select>
-									<div style="padding-top:10px;"></div>
-								</div>
-								<div class="controls">
-									<select name="about[company_job]" id="company_job" placeholder="{vtranslate('LBL_JOB_TITLE', $MODULE)}" style="width:250px;">
-										<option value=""></option><!-- to allow select2 pick placeholder -->
-										<option value="Prefer Not to Disclose">Prefer Not to Disclose</option>
-										<option value="CEO/President">CEO/President</option>
-										<option value="Chief Officer">Chief Officer</option>
-										<option value="Vice President">Vice President</option>
-										<option value="Director">Director</option>
-										<option value="Manager">Manager</option>
-										<option value="Project Manager">Project Manager</option>
-										<option value="Specialist">Specialist</option>
-										<option value="Consultant">Consultant</option>
-										<option value="Employee">Employee</option>
-										<option value="Other">Other</option>
-									</select>
-									<div style="padding-top:10px;"></div>
-								</div>
-								<div class="controls">
-									<select name="about[department]" id="department" placeholder="{vtranslate('LBL_DEPARTMENT', $MODULE)}" style="width:250px;">
-										<option value=""></option><!-- to allow select2 pick placeholder -->
-										<option value="Prefer Not to Disclose">Prefer Not to Disclose</option>
-										<option value="Administration">Administration</option>
-										<option value="Sales">Sales</option>
-										<option value="Marketing">Marketing</option>
-										<option value="Support/Customer Service">Support/Customer Service</option>
-										<option value="Information Technology">Information Technology</option>
-										<option value="Finance/Accounting">Finance/Accounting</option>
-										<option value="Business Development">Business Development</option>
-										<option value="Product Development">Product Development</option>
-										<option value="Professional Services">Professional Services</option>
-										<option value="Project Management">Project Management</option>
-										<option value="Other">Other</option>
-									</select>
-									<div style="padding-top:10px;"></div>
-								</div>
-							</div>
-							{/if}
-
-							<div class="span4">
-								<label class="control-label"><strong>Preferences</strong> <span class="muted">{vtranslate('LBL_ALL_FIELDS_BELOW_ARE_REQUIRED', $MODULE)}</label>
-
-								{if $IS_FIRST_USER}
-								<div class="controls" id="currency_name_controls">
-									<select name="currency_name" id="currency_name" placeholder="{vtranslate('LBL_BASE_CURRENCY', $MODULE)}" data-errormessage="{vtranslate('LBL_CHOOSE_BASE_CURRENCY', $MODULE)}" class="validate[required]" style="width:250px;">
-										<option value=""></option>
+{*<!--
+/*********************************************************************************
+** 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.
+*
+********************************************************************************/
+-->*}
+{strip}
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>Vtiger</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+		<link REL="SHORTCUT ICON" HREF="layouts/vlayout/skins/images/favicon.ico">
+		<link rel="stylesheet" href="libraries/bootstrap/css/bootstrap.css" type="text/css" media="screen" />
+		<link rel="stylesheet" href="resources/styles.css" type="text/css" media="screen" />
+		<link rel="stylesheet" href="libraries/jquery/select2/select2.css" />
+		<link rel="stylesheet" href="libraries/jquery/posabsolute-jQuery-Validation-Engine/css/validationEngine.jquery.css" />
+
+		<script type="text/javascript" src="libraries/jquery/jquery.min.js"></script>
+		<script type="text/javascript" src="libraries/bootstrap/js/bootstrap-tooltip.js"></script>
+		<script type="text/javascript" src="libraries/jquery/select2/select2.min.js"></script>
+		<script type="text/javascript" src="libraries/jquery/posabsolute-jQuery-Validation-Engine/js/jquery.validationEngine.js" ></script>
+		<script type="text/javascript" src="libraries/jquery/posabsolute-jQuery-Validation-Engine/js/jquery.validationEngine-en.js" ></script>
+
+		<script type="text/javascript">{literal}
+			jQuery(function(){
+				jQuery('select').select2({blurOnChange:true});
+				jQuery('[rel="tooltip"]').tooltip();
+				jQuery('form').validationEngine({
+					prettySelect: true,
+					usePrefix: 's2id_',
+					autoPositionUpdate: true,
+					promptPosition : "topLeft",
+					showOneMessage: true
+				});
+				jQuery('#currency_name_controls').mouseenter(function() {
+					jQuery('#currency_name_tooltip').tooltip('show');
+				});
+				jQuery('#currency_name_controls').mouseleave(function() {
+					jQuery('#currency_name_tooltip').tooltip('hide');
+				});
+			});
+		{/literal}</script>
+		<style type="text/css">{literal}
+			 body { background: #ffffff url('layouts/vlayout/skins/images/usersetupbg.png') no-repeat center top; background-size: 100%; font-size: 14px; }
+			.modal-backdrop { opacity: 0.35; }
+			.tooltip { z-index: 1055; }
+			input, select, textarea { font-size: 14px; }
+		{/literal}</style>
+	</head>
+	<body>
+
+		<div class="container">
+			<div class="modal-backdrop"></div>
+			<form class="form" method="POST" action="index.php?module=Users&action=UserSetupSave">
+				<div class="modal" {if false && $IS_FIRST_USER}style="width: 700px;"{/if}> {* FirstUser information gather - paused *}
+					<div class="modal-header">
+						<h3>{vtranslate('LBL_ALMOST_THERE', $MODULE)}</h3>
+					</div>
+					<div class="modal-body">
+						<div class="row">
+							{if false && $IS_FIRST_USER} {* FirstUser information gather - paused *}
+							<div class="span4">
+								<label class="control-label"><strong>{vtranslate('LBL_ABOUT_ME', $MODULE)}</strong> <span class="muted">{vtranslate('LBL_WE_PROMISE_TO_KEEP_THIS_PRIVATE', $MODULE)}</span></label>
+								<div class="controls">
+									<input type="text" name="about[phone]" id="phone" placeholder="{vtranslate('LBL_PHONE', $MODULE)}" rel="tooltip" title="{vtranslate('LBL_YOUR_CONTACT_NUMBER', $MODULE)}" style="width:250px;">
+								</div>
+								<div class="controls">
+									<select name="about[country]" id="country" placeholder="{vtranslate('LBL_SELECT_COUNTRY', $MODULE)}" rel="tooltip" title="{vtranslate('LBL_WHERE_ARE_YOU_FROM', $MODULE)}" style="width:250px;">
+										<option value=""></option><!-- to allow select2 pick placeholder -->
+										<option value="Prefer Not to Disclose">Prefer Not to Disclose</option>
+										<option value="United States">United States</option>
+										<option value="Afghanistan">Afghanistan</option>
+										<option value="Africa">Africa</option>
+										<option value="Albania">Albania</option>
+										<option value="Algeria">Algeria</option>
+										<option value="American Samoa">American Samoa</option>
+										<option value="Andorra">Andorra</option>
+										<option value="Angola">Angola</option>
+										<option value="Anguilla">Anguilla</option>
+										<option value="Antarctica">Antarctica</option>
+										<option value="Antigua &amp; Barbuda">Antigua &amp; Barbuda</option>
+										<option value="Antilles, Netherlands">Antilles, Netherlands</option>
+										<option value="Arabia, Saudi">Arabia, Saudi</option>
+										<option value="Argentina">Argentina</option>
+										<option value="Armenia">Armenia</option>
+										<option value="Aruba">Aruba</option>
+										<option value="Asia">Asia</option>
+										<option value="Australia">Australia</option>
+										<option value="Austria">Austria</option>
+										<option value="Azerbaijan">Azerbaijan</option>
+										<option value="Bahamas, The">Bahamas, The</option>
+										<option value="Bahrain">Bahrain</option>
+										<option value="Bangladesh">Bangladesh</option>
+										<option value="Barbados">Barbados</option>
+										<option value="Belarus">Belarus</option>
+										<option value="Belgium">Belgium</option>
+										<option value="Belize">Belize</option>
+										<option value="Benin">Benin</option>
+										<option value="Bermuda">Bermuda</option>
+										<option value="Bhutan">Bhutan</option>
+										<option value="Bolivia">Bolivia</option>
+										<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
+										<option value="Botswana">Botswana</option>
+										<option value="Bouvet Island">Bouvet Island</option>
+										<option value="Brazil">Brazil</option>
+										<option value="British Indian Ocean T.">British Indian Ocean T.</option>
+										<option value="British Virgin Islands">British Virgin Islands</option>
+										<option value="Brunei Darussalam">Brunei Darussalam</option>
+										<option value="Bulgaria">Bulgaria</option>
+										<option value="Burkina Faso">Burkina Faso</option>
+										<option value="Burundi">Burundi</option>
+										<option value="Cambodia">Cambodia</option>
+										<option value="Cameroon">Cameroon</option>
+										<option value="Canada">Canada</option>
+										<option value="Cape Verde">Cape Verde</option>
+										<option value="Caribbean, the">Caribbean, the</option>
+										<option value="Cayman Islands">Cayman Islands</option>
+										<option value="Central African Republic">Central African Republic</option>
+										<option value="Central America">Central America</option>
+										<option value="Chad">Chad</option>
+										<option value="Chile">Chile</option>
+										<option value="China">China</option>
+										<option value="Christmas Island">Christmas Island</option>
+										<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
+										<option value="Colombia">Colombia</option>
+										<option value="Comoros">Comoros</option>
+										<option value="Congo">Congo</option>
+										<option value="Congo, Dem. Rep. of the">Congo, Dem. Rep. of the</option>
+										<option value="Cook Islands">Cook Islands</option>
+										<option value="Costa Rica">Costa Rica</option>
+										<option value="Cote D'Ivoire">Cote D'Ivoire</option>
+										<option value="Croatia">Croatia</option>
+										<option value="Cuba">Cuba</option>
+										<option value="Cyprus">Cyprus</option>
+										<option value="Czech Republic">Czech Republic</option>
+										<option value="Denmark">Denmark</option>
+										<option value="Djibouti">Djibouti</option>
+										<option value="Dominica">Dominica</option>
+										<option value="Dominican Republic">Dominican Republic</option>
+										<option value="East Timor (Timor-Leste)">East Timor (Timor-Leste)</option>
+										<option value="Ecuador">Ecuador</option>
+										<option value="Egypt">Egypt</option>
+										<option value="El Salvador">El Salvador</option>
+										<option value="Equatorial Guinea">Equatorial Guinea</option>
+										<option value="Eritrea">Eritrea</option>
+										<option value="Estonia">Estonia</option>
+										<option value="Ethiopia">Ethiopia</option>
+										<option value="Europe">Europe</option>
+										<option value="European Union">European Union</option>
+										<option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
+										<option value="Faroe Islands">Faroe Islands</option>
+										<option value="Fiji">Fiji</option>
+										<option value="Finland">Finland</option>
+										<option value="France">France</option>
+										<option value="French Guiana">French Guiana</option>
+										<option value="French Polynesia">French Polynesia</option>
+										<option value="French Southern Terr.">French Southern Terr.</option>
+										<option value="Gabon">Gabon</option>
+										<option value="Gambia, the">Gambia, the</option>
+										<option value="Georgia">Georgia</option>
+										<option value="Germany">Germany</option>
+										<option value="Ghana">Ghana</option>
+										<option value="Gibraltar">Gibraltar</option>
+										<option value="Greece">Greece</option>
+										<option value="Greenland">Greenland</option>
+										<option value="Grenada">Grenada</option>
+										<option value="Guadeloupe">Guadeloupe</option>
+										<option value="Guam">Guam</option>
+										<option value="Guatemala">Guatemala</option>
+										<option value="Guernsey and Alderney">Guernsey and Alderney</option>
+										<option value="Guiana, French">Guiana, French</option>
+										<option value="Guinea">Guinea</option>
+										<option value="Guinea-Bissau">Guinea-Bissau</option>
+										<option value="Guinea, Equatorial">Guinea, Equatorial</option>
+										<option value="Guyana">Guyana</option>
+										<option value="Haiti">Haiti</option>
+										<option value="Heard &amp; McDonald Is.(AU)">Heard &amp; McDonald Is.(AU)</option>
+										<option value="Holy See (Vatican)">Holy See (Vatican)</option>
+										<option value="Honduras">Honduras</option>
+										<option value="Hong Kong, (China)">Hong Kong, (China)</option>
+										<option value="Hungary">Hungary</option>
+										<option value="Iceland">Iceland</option>
+										<option value="India">India</option>
+										<option value="Indonesia">Indonesia</option>
+										<option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
+										<option value="Iraq">Iraq</option>
+										<option value="Ireland">Ireland</option>
+										<option value="Israel">Israel</option>
+										<option value="Italy">Italy</option>
+										<option value="Ivory Coast (Cote d'Ivoire)">Ivory Coast (Cote d'Ivoire)</option>
+										<option value="Jamaica">Jamaica</option>
+										<option value="Japan">Japan</option>
+										<option value="Jersey">Jersey</option>
+										<option value="Jordan">Jordan</option>
+										<option value="Kazakhstan">Kazakhstan</option>
+										<option value="Kenya">Kenya</option>
+										<option value="Kiribati">Kiribati</option>
+										<option value="Korea Dem. People's Rep.">Korea Dem. People's Rep.</option>
+										<option value="Korea, (South) Republic of">Korea, (South) Republic of</option>
+										<option value="Kosovo">Kosovo</option>
+										<option value="Kuwait">Kuwait</option>
+										<option value="Kyrgyzstan">Kyrgyzstan</option>
+										<option value="Lao People's Democ. Rep.">Lao People's Democ. Rep.</option>
+										<option value="Latvia">Latvia</option>
+										<option value="Lebanon">Lebanon</option>
+										<option value="Lesotho">Lesotho</option>
+										<option value="Liberia">Liberia</option>
+										<option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option>
+										<option value="Liechtenstein">Liechtenstein</option>
+										<option value="Lithuania">Lithuania</option>
+										<option value="Luxembourg">Luxembourg</option>
+										<option value="Macao, (China)">Macao, (China)</option>
+										<option value="Macedonia, TFYR">Macedonia, TFYR</option>
+										<option value="Madagascar">Madagascar</option>
+										<option value="Malawi">Malawi</option>
+										<option value="Malaysia">Malaysia</option>
+										<option value="Maldives">Maldives</option>
+										<option value="Mali">Mali</option>
+										<option value="Malta">Malta</option>
+										<option value="Man, Isle of">Man, Isle of</option>
+										<option value="Marshall Islands">Marshall Islands</option>
+										<option value="Martinique (FR)">Martinique (FR)</option>
+										<option value="Mauritania">Mauritania</option>
+										<option value="Mauritius">Mauritius</option>
+										<option value="Mayotte (FR)">Mayotte (FR)</option>
+										<option value="Mexico">Mexico</option>
+										<option value="Micronesia, Fed. States of">Micronesia, Fed. States of</option>
+										<option value="Middle East">Middle East</option>
+										<option value="Moldova, Republic of">Moldova, Republic of</option>
+										<option value="Monaco">Monaco</option>
+										<option value="Mongolia">Mongolia</option>
+										<option value="Montenegro">Montenegro</option>
+										<option value="Montserrat">Montserrat</option>
+										<option value="Morocco">Morocco</option>
+										<option value="Mozambique">Mozambique</option>
+										<option value="Myanmar (ex-Burma)">Myanmar (ex-Burma)</option>
+										<option value="Namibia">Namibia</option>
+										<option value="Nauru">Nauru</option>
+										<option value="Nepal">Nepal</option>
+										<option value="Netherlands">Netherlands</option>
+										<option value="Netherlands Antilles">Netherlands Antilles</option>
+										<option value="New Caledonia">New Caledonia</option>
+										<option value="New Zealand">New Zealand</option>
+										<option value="Nicaragua">Nicaragua</option>
+										<option value="Niger">Niger</option>
+										<option value="Nigeria">Nigeria</option>
+										<option value="Niue">Niue</option>
+										<option value="Norfolk Island">Norfolk Island</option>
+										<option value="North America">North America</option>
+										<option value="Northern Mariana Islands">Northern Mariana Islands</option>
+										<option value="Norway">Norway</option>
+										<option value="Oceania">Oceania</option>
+										<option value="Oman">Oman</option>
+										<option value="Pakistan">Pakistan</option>
+										<option value="Palau">Palau</option>
+										<option value="Palestinian Territory">Palestinian Territory</option>
+										<option value="Panama">Panama</option>
+										<option value="Papua New Guinea">Papua New Guinea</option>
+										<option value="Paraguay">Paraguay</option>
+										<option value="Peru">Peru</option>
+										<option value="Philippines">Philippines</option>
+										<option value="Pitcairn Island">Pitcairn Island</option>
+										<option value="Poland">Poland</option>
+										<option value="Portugal">Portugal</option>
+										<option value="Puerto Rico">Puerto Rico</option>
+										<option value="Qatar">Qatar</option>
+										<option value="Reunion (FR)">Reunion (FR)</option>
+										<option value="Romania">Romania</option>
+										<option value="Russia (Russian Fed.)">Russia (Russian Fed.)</option>
+										<option value="Rwanda">Rwanda</option>
+										<option value="Sahara, Western">Sahara, Western</option>
+										<option value="Saint Barthelemy (FR)">Saint Barthelemy (FR)</option>
+										<option value="Saint Helena (UK)">Saint Helena (UK)</option>
+										<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
+										<option value="Saint Lucia">Saint Lucia</option>
+										<option value="Saint Martin (FR)">Saint Martin (FR)</option>
+										<option value="S Pierre &amp; Miquelon(FR)">S Pierre &amp; Miquelon(FR)</option>
+										<option value="S Vincent &amp; Grenadines">S Vincent &amp; Grenadines</option>
+										<option value="Samoa">Samoa</option>
+										<option value="San Marino">San Marino</option>
+										<option value="Sao Tome and Principe">Sao Tome and Principe</option>
+										<option value="Saudi Arabia">Saudi Arabia</option>
+										<option value="Senegal">Senegal</option>
+										<option value="Serbia">Serbia</option>
+										<option value="Seychelles">Seychelles</option>
+										<option value="Sierra Leone">Sierra Leone</option>
+										<option value="Singapore">Singapore</option>
+										<option value="Slovakia">Slovakia</option>
+										<option value="Slovenia">Slovenia</option>
+										<option value="Solomon Islands">Solomon Islands</option>
+										<option value="Somalia">Somalia</option>
+										<option value="South Africa">South Africa</option>
+										<option value="South America">South America</option>
+										<option value="S.George &amp; S.Sandwich">S.George &amp; S.Sandwich</option>
+										<option value="South Sudan">South Sudan</option>
+										<option value="Spain">Spain</option>
+										<option value="Sri Lanka (ex-Ceilan)">Sri Lanka (ex-Ceilan)</option>
+										<option value="Sudan">Sudan</option>
+										<option value="Suriname">Suriname</option>
+										<option value="Svalbard &amp; Jan Mayen Is.">Svalbard &amp; Jan Mayen Is.</option>
+										<option value="Swaziland">Swaziland</option>
+										<option value="Sweden">Sweden</option>
+										<option value="Switzerland">Switzerland</option>
+										<option value="Syrian Arab Republic">Syrian Arab Republic</option>
+										<option value="Taiwan">Taiwan</option>
+										<option value="Tajikistan">Tajikistan</option>
+										<option value="Tanzania, United Rep. of">Tanzania, United Rep. of</option>
+										<option value="Thailand">Thailand</option>
+										<option value="Timor-Leste (East Timor)">Timor-Leste (East Timor)</option>
+										<option value="Togo">Togo</option>
+										<option value="Tokelau">Tokelau</option>
+										<option value="Tonga">Tonga</option>
+										<option value="Trinidad &amp; Tobago">Trinidad &amp; Tobago</option>
+										<option value="Tunisia">Tunisia</option>
+										<option value="Turkey">Turkey</option>
+										<option value="Turkmenistan">Turkmenistan</option>
+										<option value="Turks and Caicos Is.">Turks and Caicos Is.</option>
+										<option value="Tuvalu">Tuvalu</option>
+										<option value="Uganda">Uganda</option>
+										<option value="Ukraine">Ukraine</option>
+										<option value="United Arab Emirates">United Arab Emirates</option>
+										<option value="United Kingdom">United Kingdom</option>
+										<option value="US Minor Outlying Isl.">US Minor Outlying Isl.</option>
+										<option value="Uruguay">Uruguay</option>
+										<option value="Uzbekistan">Uzbekistan</option>
+										<option value="Vanuatu">Vanuatu</option>
+										<option value="Vatican (Holy See)">Vatican (Holy See)</option>
+										<option value="Venezuela">Venezuela</option>
+										<option value="Viet Nam">Viet Nam</option>
+										<option value="Virgin Islands, British">Virgin Islands, British</option>
+										<option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
+										<option value="Wallis and Futuna">Wallis and Futuna</option>
+										<option value="Western Sahara">Western Sahara</option>
+										<option value="Yemen">Yemen</option>
+										<option value="Zambia">Zambia</option>
+										<option value="Zimbabwe">Zimbabwe</option>
+									</select>
+									<div style="padding-top:10px;"></div>
+								</div>
+								<div class="controls">
+									<select name="about[company_size]" id="company_size" placeholder="{vtranslate('LBL_COMPANY_SIZE', $MODULE)}" style="width:250px;">
+										<option value=""></option><!-- to allow select2 pick placeholder -->
+										<option value="Prefer Not to Disclose">Prefer Not to Disclose</option>
+										<option value="1">1</option>
+										<option value="2 - 3">2 - 3</option>
+										<option value="4 - 7">4 - 7</option>
+										<option value="8 - 15">8 - 15</option>
+										<option value="16 - 25">16 - 25</option>
+										<option value="26 - 50">26 - 50</option>
+										<option value="51 - 100">51 - 100</option>
+										<option value="101 - 250">101 - 250</option>
+										<option value="251 - 500">251 - 500</option>
+										<option value="501 +">501 +</option>
+									</select>
+									<div style="padding-top:10px;"></div>
+								</div>
+								<div class="controls">
+									<select name="about[company_job]" id="company_job" placeholder="{vtranslate('LBL_JOB_TITLE', $MODULE)}" style="width:250px;">
+										<option value=""></option><!-- to allow select2 pick placeholder -->
+										<option value="Prefer Not to Disclose">Prefer Not to Disclose</option>
+										<option value="CEO/President">CEO/President</option>
+										<option value="Chief Officer">Chief Officer</option>
+										<option value="Vice President">Vice President</option>
+										<option value="Director">Director</option>
+										<option value="Manager">Manager</option>
+										<option value="Project Manager">Project Manager</option>
+										<option value="Specialist">Specialist</option>
+										<option value="Consultant">Consultant</option>
+										<option value="Employee">Employee</option>
+										<option value="Other">Other</option>
+									</select>
+									<div style="padding-top:10px;"></div>
+								</div>
+								<div class="controls">
+									<select name="about[department]" id="department" placeholder="{vtranslate('LBL_DEPARTMENT', $MODULE)}" style="width:250px;">
+										<option value=""></option><!-- to allow select2 pick placeholder -->
+										<option value="Prefer Not to Disclose">Prefer Not to Disclose</option>
+										<option value="Administration">Administration</option>
+										<option value="Sales">Sales</option>
+										<option value="Marketing">Marketing</option>
+										<option value="Support/Customer Service">Support/Customer Service</option>
+										<option value="Information Technology">Information Technology</option>
+										<option value="Finance/Accounting">Finance/Accounting</option>
+										<option value="Business Development">Business Development</option>
+										<option value="Product Development">Product Development</option>
+										<option value="Professional Services">Professional Services</option>
+										<option value="Project Management">Project Management</option>
+										<option value="Other">Other</option>
+									</select>
+									<div style="padding-top:10px;"></div>
+								</div>
+							</div>
+							{/if}
+
+							<div class="span4">
+								<label class="control-label"><strong>{vtranslate('Preferences', $MODULE)}</strong> <span class="muted">{vtranslate('LBL_ALL_FIELDS_BELOW_ARE_REQUIRED', $MODULE)}</label>
+
+								{if $IS_FIRST_USER}
+								<div class="controls" id="currency_name_controls">
+									<select name="currency_name" id="currency_name" placeholder="{vtranslate('LBL_BASE_CURRENCY', $MODULE)}" data-errormessage="{vtranslate('LBL_CHOOSE_BASE_CURRENCY', $MODULE)}" class="validate[required]" style="width:250px;">
+										<option value=""></option>
 										{foreach key=header item=currency from=$CURRENCIES}
-										<!--Open source fix to select user preferred currency during installation -->
-											<option value="{$header}" {if $header eq $CURRENT_USER_MODEL->get('currency_name')}selected{/if}>{$header|@getTranslatedCurrencyString}({$currency.1})</option> 
-										{/foreach}
-									</select>
-									&nbsp;
-									<span rel="tooltip" title="{vtranslate('LBL_OPERATING_CURRENCY', $MODULE)}" id="currency_name_tooltip" class="icon-info-sign"></span>
-									<div style="padding-top:10px;"></div>
-								</div>
-								{/if}
-
-								<div class="controls">
-									<select name="lang_name" id="lang_name" style="width:250px;" placeholder="{vtranslate('LBL_LANGUAGE', $MODULE)}" data-errormessage="{vtranslate('LBL_CHOOSE_LANGUAGE', $MODULE)}" class="validate[required]">
-										<option value=""></option>
-										{foreach key=header item=language from=$LANGUAGES}
-												<option value="{$header}" {if $header eq $CURRENT_USER_MODEL->get('language')}selected{/if}>{$language|@getTranslatedString:$MODULE}</option>
-										{/foreach}
-									</select>
-									<div style="padding-top:10px;"></div>
-								</div>
-								<div class="controls">
-									<select name="time_zone" id="time_zone" style="width:250px;" placeholder="{vtranslate('LBL_CHOOSE_TIMEZONE', $MODULE)}" data-errormessage="{vtranslate('LBL_CHOOSE_TIMEZONE', $MODULE)}" class="validate[required]">
-										<option value=""></option>
-										{foreach key=header item=time_zone from=$TIME_ZONES}
-												<option value="{$header}" {if $header eq $CURRENT_USER_MODEL->get('time_zone')}selected{/if}>{$time_zone|@getTranslatedString:$MODULE}</option>
-										{/foreach}
-									</select>
-									<div style="padding-top:10px;"></div>
-								</div>
-								<div class="controls">
-									<select name="date_format" id="date_format" style="width:250px;" placeholder="{vtranslate('LBL_DATE_FORMAT', $MODULE)}" data-errormessage="{vtranslate('LBL_CHOOSE_DATE_FORMAT', $MODULE)}" class="validate[required]">
-										<option value=""></option>
-										<option value="dd-mm-yyyy" {if $CURRENT_USER_MODEL->get('date_format') eq "dd-mm-yyyy"} selected{/if}>dd-mm-yyyy</option>
-										<option value="mm-dd-yyyy" {if $CURRENT_USER_MODEL->get('date_format') eq "mm-dd-yyyy"} selected{/if}>mm-dd-yyyy</option>
-										<option value="yyyy-mm-dd" {if $CURRENT_USER_MODEL->get('date_format') eq "yyyy-mm-dd"} selected{/if}>yyyy-mm-dd</option>
-									</select>
-									<div style="padding-top:10px;"></div>
-								</div>
-							</div>
-						</div>
-					</div>
-					<div class="modal-footer">
-						<button class="btn btn-success" type="submit">{vtranslate('LBL_GET_STARTED', $MODULE)}</button>
-					</div>
-				</div>
-			</form>
-		</div>
-
-	</body>
-</html>
-{/strip}
+										<!--Open source fix to select user preferred currency during installation -->
+											<option value="{$header}" {if $header eq $CURRENT_USER_MODEL->get('currency_name')}selected{/if}>{$header|@getTranslatedCurrencyString}({$currency.1})</option> 
+										{/foreach}
+									</select>
+									&nbsp;
+									<span rel="tooltip" title="{vtranslate('LBL_OPERATING_CURRENCY', $MODULE)}" id="currency_name_tooltip" class="icon-info-sign"></span>
+									<div style="padding-top:10px;"></div>
+								</div>
+								{/if}
+
+								<div class="controls">
+									<select name="lang_name" id="lang_name" style="width:250px;" placeholder="{vtranslate('LBL_LANGUAGE', $MODULE)}" data-errormessage="{vtranslate('LBL_CHOOSE_LANGUAGE', $MODULE)}" class="validate[required]">
+										<option value=""></option>
+										{foreach key=header item=language from=$LANGUAGES}
+												<option value="{$header}" {if $header eq $CURRENT_USER_MODEL->get('language')}selected{/if}>{$language|@getTranslatedString:$MODULE}</option>
+										{/foreach}
+									</select>
+									<div style="padding-top:10px;"></div>
+								</div>
+								<div class="controls">
+									<select name="time_zone" id="time_zone" style="width:250px;" placeholder="{vtranslate('LBL_CHOOSE_TIMEZONE', $MODULE)}" data-errormessage="{vtranslate('LBL_CHOOSE_TIMEZONE', $MODULE)}" class="validate[required]">
+										<option value=""></option>
+										{foreach key=header item=time_zone from=$TIME_ZONES}
+												<option value="{$header}" {if $header eq $CURRENT_USER_MODEL->get('time_zone')}selected{/if}>{$time_zone|@getTranslatedString:$MODULE}</option>
+										{/foreach}
+									</select>
+									<div style="padding-top:10px;"></div>
+								</div>
+								<div class="controls">
+									<select name="date_format" id="date_format" style="width:250px;" placeholder="{vtranslate('LBL_DATE_FORMAT', $MODULE)}" data-errormessage="{vtranslate('LBL_CHOOSE_DATE_FORMAT', $MODULE)}" class="validate[required]">
+										<option value=""></option>
+										<option value="dd-mm-yyyy" {if $CURRENT_USER_MODEL->get('date_format') eq "dd-mm-yyyy"} selected{/if}>dd-mm-yyyy</option>
+										<option value="mm-dd-yyyy" {if $CURRENT_USER_MODEL->get('date_format') eq "mm-dd-yyyy"} selected{/if}>mm-dd-yyyy</option>
+										<option value="yyyy-mm-dd" {if $CURRENT_USER_MODEL->get('date_format') eq "yyyy-mm-dd"} selected{/if}>yyyy-mm-dd</option>
+									</select>
+									<div style="padding-top:10px;"></div>
+								</div>
+							</div>
+						</div>
+					</div>
+					<div class="modal-footer">
+						<button class="btn btn-success" type="submit">{vtranslate('LBL_GET_STARTED', $MODULE)}</button>
+					</div>
+				</div>
+			</form>
+		</div>
+
+	</body>
+</html>
+{/strip}
diff --git a/layouts/vlayout/modules/Users/resources/Edit.js b/layouts/vlayout/modules/Users/resources/Edit.js
index 6bb55bdb02b6a53b9f60080c3d251600e8736bdc..23029954be44adb9335e2ee323f7d08559e98e82 100644
--- a/layouts/vlayout/modules/Users/resources/Edit.js
+++ b/layouts/vlayout/modules/Users/resources/Edit.js
@@ -67,6 +67,12 @@ Vtiger_Edit_Js("Users_Edit_Js",{},{
 	registerRecordPreSaveEvent : function(form){
 		var thisInstance = this;
 		form.on(Vtiger_Edit_Js.recordPreSave, function(e, data) {
+			var groupingSeperatorValue = jQuery('[name="currency_grouping_separator"]', form).val();
+			var decimalSeperatorValue = jQuery('[name="currency_decimal_separator"]', form).val();
+			if(groupingSeperatorValue == decimalSeperatorValue){
+				Vtiger_Helper_Js.showPnotify(app.vtranslate('JS_DECIMAL_SEPERATOR_AND_GROUPING_SEPERATOR_CANT_BE_SAME'));
+				e.preventDefault();
+			}
 			var userName = jQuery('input[name="user_name"]').val();
 			var newPassword = jQuery('input[name="user_password"]').val();
 			var confirmPassword = jQuery('input[name="confirm_password"]').val();
@@ -76,7 +82,6 @@ Vtiger_Edit_Js("Users_Edit_Js",{},{
 					Vtiger_Helper_Js.showPnotify(app.vtranslate('JS_REENTER_PASSWORDS'));
 					e.preventDefault();
 				}
-
 				if(!(userName in thisInstance.duplicateCheckCache)) {
 					thisInstance.checkDuplicateUser(userName).then(
 						function(data){
diff --git a/layouts/vlayout/modules/Vtiger/ListViewContents.tpl b/layouts/vlayout/modules/Vtiger/ListViewContents.tpl
index f047135d14588256ef50eeefc6c3ee118b1742bf..3a3e316d6f134ddb8341838585a030d8b0b6698d 100644
--- a/layouts/vlayout/modules/Vtiger/ListViewContents.tpl
+++ b/layouts/vlayout/modules/Vtiger/ListViewContents.tpl
@@ -137,7 +137,7 @@
 			<tr>
 				<td>
 					{assign var=SINGLE_MODULE value="SINGLE_$MODULE"}
-					{vtranslate('LBL_EQ_ZERO')} {vtranslate($MODULE, $MODULE)} {vtranslate('LBL_FOUND')}.{if $IS_MODULE_EDITABLE} {vtranslate('LBL_CREATE')} <a href="{$MODULE_MODEL->getCreateRecordUrl()}">{vtranslate($SINGLE_MODULE, $MODULE)}</a>{/if}
+					{vtranslate('LBL_EQ_ZERO')} {vtranslate($SINGLE_MODULE, $MODULE)} {vtranslate('LBL_FOUND')}.{if $IS_MODULE_EDITABLE} {vtranslate('LBL_CREATE')} <a href="{$MODULE_MODEL->getCreateRecordUrl()}">{vtranslate($SINGLE_MODULE, $MODULE)}</a>{/if}
 				</td>
 			</tr>
 		</tbody>
diff --git a/layouts/vlayout/modules/Vtiger/MenuBar.tpl b/layouts/vlayout/modules/Vtiger/MenuBar.tpl
index cbce281797c407ec58c09ad628a3f0dc7701c97e..2fdfcdc5ae98c8713b48380fb5feb5958c5436bb 100644
--- a/layouts/vlayout/modules/Vtiger/MenuBar.tpl
+++ b/layouts/vlayout/modules/Vtiger/MenuBar.tpl
@@ -128,7 +128,7 @@
 					<span id="headerLinksBig" class="pull-right headerLinksContainer">
 						<span class="dropdown span settingIcons">
 							<a class="dropdown-toggle" data-toggle="dropdown" href="#">
-								<img src="{vimage_path('theme_brush.png')}" alt="theme roller" title="Theme Roller" />
+								<img src="{vimage_path('theme_brush.png')}" alt="theme roller" title="{vtranslate('Theme Roller',$MODULE)}" />
 							</a>
 							<ul class="dropdown-menu themeMenuContainer">
 								<div id="themeContainer">
diff --git a/layouts/vlayout/modules/Vtiger/MergeRecords.tpl b/layouts/vlayout/modules/Vtiger/MergeRecords.tpl
index 0b94f7747d8ba42f5b2bce115fcea5ede231c7f3..d9d2ae3d1341a8cfa5a47324048ccfeab5a6b437 100644
--- a/layouts/vlayout/modules/Vtiger/MergeRecords.tpl
+++ b/layouts/vlayout/modules/Vtiger/MergeRecords.tpl
@@ -13,7 +13,7 @@
 <div style='background: white;'>
 	<div>
 		<br>
-		<div style='margin-left:10px'><h3>{vtranslate('LBL_MERGE_RECORDS_IN', $MODULE)} > {$MODULE}</h3></div><br>
+		<div style='margin-left:10px'><h3>{vtranslate('LBL_MERGE_RECORDS_IN', $MODULE)} > {vtranslate($MODULE, $MODULE)}</h3></div><br>
 		<div class='alert-info'>{vtranslate('LBL_MERGE_RECORDS_DESCRIPTION', $MODULE)}</div>
 	</div>
 
diff --git a/layouts/vlayout/modules/Vtiger/RecentActivities.tpl b/layouts/vlayout/modules/Vtiger/RecentActivities.tpl
index 0d49a85d07bc4a896ed83d7b03ce8134c4beb33c..dcdc7041a461ea325a81e85ace87de22d99c8a6d 100644
--- a/layouts/vlayout/modules/Vtiger/RecentActivities.tpl
+++ b/layouts/vlayout/modules/Vtiger/RecentActivities.tpl
@@ -64,7 +64,8 @@
 							<li>
 								<div class="row-fluid">
 									{assign var=RELATION value=$RECENT_ACTIVITY->getRelationInstance()}
-									<span>{vtranslate($RELATION->getLinkedRecord()->getModuleName(), $RELATION->getLinkedRecord()->getModuleName())}</span> <span>
+									<span><strong>{$RECENT_ACTIVITY->getModifiedBy()->getName()} </strong></span>
+									<span>
 											{if $RECENT_ACTIVITY->isRelationLink()}
 												{vtranslate('LBL_ADDED', $MODULE_NAME)}
 											{else}
@@ -73,6 +74,7 @@
 											{if $RELATION->getLinkedRecord()->getModuleName() eq 'Calendar'}
 												{if isPermitted('Calendar', 'DetailView', $RELATION->getLinkedRecord()->getId()) eq 'yes'} <strong>{$RELATION->getLinkedRecord()->getName()}</strong> {else} {/if}
 											{else} <strong>{$RELATION->getLinkedRecord()->getName()}</strong> {/if}</span>
+									(<span>{vtranslate($RELATION->getLinkedRecord()->getModuleName(), $RELATION->getLinkedRecord()->getModuleName())}</span>)
 									<span class="pull-right"><p class="muted"><small title="{Vtiger_Util_Helper::formatDateTimeIntoDayString($RELATION->get('changedon'))}">{Vtiger_Util_Helper::formatDateDiffInStrings($RELATION->get('changedon'))}</small></p></span>
 								</div>
 							</li>
@@ -99,4 +101,4 @@
 		</div>
 	<span class="clearfix"></span>
 </div>
-{/strip}
\ No newline at end of file
+{/strip}
diff --git a/layouts/vlayout/modules/Vtiger/RecordNamesList.tpl b/layouts/vlayout/modules/Vtiger/RecordNamesList.tpl
index ec395996437592bc8e5a2270574202e15952b1c7..55d1db8a21cc4556cdd87a4ee48abef89bba6e7c 100644
--- a/layouts/vlayout/modules/Vtiger/RecordNamesList.tpl
+++ b/layouts/vlayout/modules/Vtiger/RecordNamesList.tpl
@@ -27,4 +27,4 @@
 		</div>
 	</div>
 </div>
-{/strip}
\ No newline at end of file
+{/strip}
diff --git a/layouts/vlayout/modules/Vtiger/dashboards/MiniListWizard.tpl b/layouts/vlayout/modules/Vtiger/dashboards/MiniListWizard.tpl
index 679ff6b9aa2a87b4703a9febda83a1da4d44014e..729f2151cffd7d41f6e34acd5e4329ede75a8a50 100644
--- a/layouts/vlayout/modules/Vtiger/dashboards/MiniListWizard.tpl
+++ b/layouts/vlayout/modules/Vtiger/dashboards/MiniListWizard.tpl
@@ -57,7 +57,7 @@
 {elseif $WIZARD_STEP eq 'step2'}
 	<option></option>
 	{foreach from=$ALLFILTERS item=FILTERS key=FILTERGROUP}
-		<optgroup label="{$FILTERGROUP}">
+		<optgroup label="{vtranslate($FILTERGROUP)}">
 			{foreach from=$FILTERS item=FILTER key=FILTERNAME}
 				<option value="{$FILTER->getId()}">{$FILTER->get('viewname')}</option>
 			{/foreach}
@@ -69,4 +69,4 @@
 		<option value="{$FIELD_NAME}">{vtranslate($FIELD->getFieldLabelKey(),$SELECTED_MODULE)}</option>
 	{/foreach}
 {/if}
-{/strip}
\ No newline at end of file
+{/strip}
diff --git a/layouts/vlayout/modules/Vtiger/resources/Detail.js b/layouts/vlayout/modules/Vtiger/resources/Detail.js
index 791408bcc27ebaaaba01bfb8c77c92bfe73d6771..1239e86102064e2647fd2ad08d08cb46939ddb60 100644
--- a/layouts/vlayout/modules/Vtiger/resources/Detail.js
+++ b/layouts/vlayout/modules/Vtiger/resources/Detail.js
@@ -967,10 +967,9 @@ jQuery.Class("Vtiger_Detail_Js",{
 
 
 
-
                 fieldElement.validationEngine('hide');
                 //Before saving ajax edit values we need to check if the value is changed then only we have to save
-                if(previousValue == ajaxEditNewValue) {
+                if((""+previousValue) == (""+ajaxEditNewValue)) { // Normalize(99!="099") Fix http://code.vtiger.com/vtiger/vtigercrm/issues/16 
                     editElement.addClass('hide');
                     detailViewValue.removeClass('hide');
 					actionElement.show();
@@ -2046,4 +2045,4 @@ jQuery.Class("Vtiger_Detail_Js",{
 		app.registerEventForTextAreaFields(jQuery('.commentcontent'));
 		this.registerEventForTotalRecordsCount();
 	}
-});
\ No newline at end of file
+});
diff --git a/layouts/vlayout/modules/Vtiger/resources/Vtiger.js b/layouts/vlayout/modules/Vtiger/resources/Vtiger.js
index 09900085c9e7fc62dbe446f13fa13f9b76e87de8..2f988a692c5997107438a78f6a228b3b87e64907 100644
--- a/layouts/vlayout/modules/Vtiger/resources/Vtiger.js
+++ b/layouts/vlayout/modules/Vtiger/resources/Vtiger.js
@@ -382,6 +382,8 @@ var Vtiger_Index_Js = {
 			jQuery('button[name="vtTooltipClose"]').on('click', function(e){
 				var lastPopover = lastPopovers.pop();
 				lastPopover.popover('hide');
+				// Fix suggested http://code.vtiger.com/vtiger/vtigercrm/issues/43
+				jQuery('.popover').css( "display", "none", "important");
 			});
 		}
 	},
@@ -436,4 +438,4 @@ jQuery(document).ready(function() {
 	app.listenPostAjaxReady(function() {
 		Vtiger_Index_Js.registerPostAjaxEvents();
 	});
-});
\ No newline at end of file
+});
diff --git a/layouts/vlayout/modules/Vtiger/uitypes/Image.tpl b/layouts/vlayout/modules/Vtiger/uitypes/Image.tpl
index 838cbf3b4c6d1f20a28667385bd97aea46d15804..fa3de99f5432c6c883fdf13ec84f1c98ce24fa40 100644
--- a/layouts/vlayout/modules/Vtiger/uitypes/Image.tpl
+++ b/layouts/vlayout/modules/Vtiger/uitypes/Image.tpl
@@ -26,7 +26,7 @@
 				<span class="span8" name="existingImages"><img src="{$IMAGE_INFO.path}_{$IMAGE_INFO.orgname}" data-image-id="{$IMAGE_INFO.id}"></span>
 				<span class="span3 row-fluid">
 					<span class="row-fluid">[{$IMAGE_INFO.name}]</span>
-					<span class="row-fluid"><input type="button" id="file_{$ITER}" value="Delete" class="imageDelete"></span>
+					<span class="row-fluid"><input type="button" id="file_{$ITER}" value={vtranslate("LBL_DELETE")} class="imageDelete"></span>
 				</span>
 			{/if}
 		</div>
diff --git a/layouts/vlayout/modules/Vtiger/uitypes/StringDetailView.tpl b/layouts/vlayout/modules/Vtiger/uitypes/StringDetailView.tpl
index 89c4de2c2b213a5fb06604edba4910654ee3bea3..c6dcdb4e7eef304aa67e5953a49d2b90910667fa 100644
--- a/layouts/vlayout/modules/Vtiger/uitypes/StringDetailView.tpl
+++ b/layouts/vlayout/modules/Vtiger/uitypes/StringDetailView.tpl
@@ -12,4 +12,4 @@
 
 {* TODO: Review the order of parameters - good to eliminate $RECORD->getId, $RECORD should be used *}
 
-{$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'), $RECORD->getId(), $RECORD)}
\ No newline at end of file
+{$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'), $RECORD->getId(), $RECORD)}
diff --git a/modules/Calendar/Activity.php b/modules/Calendar/Activity.php
index 60e9df948f8a0ae8e5e9c43e30d304bf69f48cc7..89f49ca8537d34020d8222375ce133321a51c0da 100644
--- a/modules/Calendar/Activity.php
+++ b/modules/Calendar/Activity.php
@@ -204,19 +204,26 @@ class Activity extends CRMEntity {
 				$reminderid = $adb->query_result($reminderidres, 0, "reminderid");
 			}
 
-			if(isset($reminderid)) {
-                $current_date = new DateTime();
-                $record_date = new DateTime($cbdate.' '.$cbtime);
-
-                $current = $current_date->format('Y-m-d H:i:s');
-                $record = $record_date->format('Y-m-d H:i:s');
-                if(strtotime($record) > strtotime($current)){
-                    $callback_query = "UPDATE vtiger_activity_reminder_popup set status = 0, date_start = ?, time_start = ? WHERE reminderid = ?";
-                    $callback_params = array($cbdate, $cbtime, $reminderid);
-                }
+            $current_date = new DateTime();
+            $record_date = new DateTime($cbdate.' '.$cbtime);
+
+            $current = $current_date->format('Y-m-d H:i:s');
+			$record = $record_date->format('Y-m-d H:i:s');
+
+			$reminder = false;
+			if(strtotime($record) > strtotime($current)){
+				$status = 0;
+				$reminder = true;
 			} else {
-				$callback_query = "INSERT INTO vtiger_activity_reminder_popup (recordid, semodule, date_start, time_start) VALUES (?,?,?,?)";
-				$callback_params = array($cbrecord, $cbmodule, $cbdate, $cbtime);
+				$status = 1;
+			}
+
+            if(isset($reminderid)){
+                $callback_query = "UPDATE vtiger_activity_reminder_popup set status = 0, date_start = ?, time_start = ? WHERE reminderid = ?";
+                $callback_params = array($cbdate, $cbtime, $reminderid);
+			} else if ($reminder) {
+				$callback_query = "INSERT INTO vtiger_activity_reminder_popup (recordid, semodule, date_start, time_start, status) VALUES (?,?,?,?,?)";
+				$callback_params = array($cbrecord, $cbmodule, $cbdate, $cbtime, $status);
 			}
 
             if($callback_query)
diff --git a/modules/Contacts/ContactsHandler.php b/modules/Contacts/ContactsHandler.php
index 972f44a2ab9ca8797050239b6a768d5147dee132..000f807e54eb10f22dc1acb91eed5292c420f4cd 100644
--- a/modules/Contacts/ContactsHandler.php
+++ b/modules/Contacts/ContactsHandler.php
@@ -42,13 +42,13 @@ function Contacts_sendCustomerPortalLoginDetails($entityData){
 		$password = makeRandomPassword();
 		$md5_password = md5($password);
 		if ($insert == true) {
-			$sql = "INSERT INTO vtiger_portalinfo(id,user_name,user_password,type,isactive) VALUES(?,?,?,?,?)";
-			$params = array($entityId, $email, $md5_password, 'C', 1);
+			$sql = "INSERT INTO vtiger_portalinfo(id,user_name,user_password,cryptmode,type,isactive) VALUES(?,?,?,?,?,?)";
+			$params = array($entityId, $email, $md5_password, 'MD5', 'C', 1);
 			$adb->pquery($sql, $params);
 		}
 		if ($update == true && $portalChanged == true) {
-			$sql = "UPDATE vtiger_portalinfo SET user_password=? WHERE id=?";
-			$params = array($md5_password, $entityId);
+			$sql = "UPDATE vtiger_portalinfo SET user_password=?, cryptmode=? WHERE id=?";
+			$params = array($md5_password, 'MD5', $entityId);
 			$adb->pquery($sql, $params);
 		}
 		if (($insert == true || ($update = true && $portalChanged == true)) && $entityData->get('emailoptout') == 0) {
diff --git a/modules/CustomView/CustomView.php b/modules/CustomView/CustomView.php
index 0ee8adb10fe135b6ba1e93720dadacfbb0329e14..5dff22ccd18372ae93441e61aeb55f8da5a7c291 100644
--- a/modules/CustomView/CustomView.php
+++ b/modules/CustomView/CustomView.php
@@ -1899,11 +1899,7 @@ class CustomView extends CRMEntity {
 
 				if ($status == CV_STATUS_DEFAULT) {
 					$log->debug("Entering when status=0");
-					if ($action == 'ListView' || $action == $module . "Ajax" || $action == 'index' || $action == 'DetailView') {
-						$permission = "yes";
-					}
-					else
-						$permission = "no";
+					$permission = "yes";
 				}
 				elseif ($is_admin) {
 					$permission = 'yes';
@@ -1913,11 +1909,7 @@ class CustomView extends CRMEntity {
 						$permission = "yes";
 					} elseif ($status == CV_STATUS_PUBLIC) {
 						$log->debug("Entering when status=3");
-						if ($action == 'ListView' || $action == $module . "Ajax" || $action == 'index' || $action == 'DetailView') {
-							$permission = "yes";
-						}
-						else
-							$permission = "no";
+						$permission = "yes";
 					}
 					elseif ($status == CV_STATUS_PRIVATE || $status == CV_STATUS_PENDING) {
 						$log->debug("Entering when status=1 or 2");
diff --git a/modules/CustomView/models/Record.php b/modules/CustomView/models/Record.php
index 079dbc4cfc500477388ad05a7973b64d90f3bcca..a5ffd8442491f6b8b14e8001b99636de897dc933 100644
--- a/modules/CustomView/models/Record.php
+++ b/modules/CustomView/models/Record.php
@@ -188,8 +188,13 @@ class CustomView_Record_Model extends Vtiger_Base_Model {
         if(empty($searchParams)) {
             $searchParams = array();
         }
-        $transformedSearchParams = Vtiger_Util_Helper::transferListSearchParamsToFilterCondition($searchParams, $moduleModel);
-        $queryGenerator->parseAdvFilterList($transformedSearchParams);
+		$transformedSearchParams = Vtiger_Util_Helper::transferListSearchParamsToFilterCondition($searchParams, $moduleModel);
+
+		$glue = "";
+		if(count($queryGenerator->getWhereFields()) > 0 && (count($transformedSearchParams)) > 0) {
+			$glue = QueryGenerator::$AND;
+		}
+        $queryGenerator->parseAdvFilterList($transformedSearchParams, $glue);
 
 		$listQuery = $queryGenerator->getQuery();
 		if($module == 'RecycleBin'){
@@ -1073,4 +1078,4 @@ class CustomView_Record_Model extends Vtiger_Base_Model {
 		}
 		return self::getInstanceById($viewId);
 	}
-}
\ No newline at end of file
+}
diff --git a/modules/Install/models/ConfigFileUtils.php b/modules/Install/models/ConfigFileUtils.php
index 4814b031ad46741885f7db566af3c3d62198b165..34cbbf0238c1d745c84cbb27bd89c0a2021542c6 100644
--- a/modules/Install/models/ConfigFileUtils.php
+++ b/modules/Install/models/ConfigFileUtils.php
@@ -20,6 +20,7 @@ class Install_ConfigFileUtils_Model {
 	private $siteUrl;
 	private $cacheDir;
 	private $vtCharset = 'UTF-8';
+	private $vtDefaultLanguage = 'en_us';
 	private $currencyName;
 	private $adminEmail;
 
@@ -43,6 +44,7 @@ class Install_ConfigFileUtils_Model {
 		if (isset($configFileParameters['admin_email'])) $this->adminEmail = $configFileParameters['admin_email'];
 		if (isset($configFileParameters['currency_name'])) $this->currencyName = $configFileParameters['currency_name'];
 		if (isset($configFileParameters['vt_charset'])) $this->vtCharset = $configFileParameters['vt_charset'];
+		if (isset($configFileParameters['default_language'])) $this->vtDefaultLanguage = $configFileParameters['default_language'];
 
 		// update default port
 		if ($this->dbPort == '') $this->dbPort = self::getDbDefaultPort($this->dbType);
@@ -88,6 +90,9 @@ class Install_ConfigFileUtils_Model {
 					/* replace charset variable */
 					$buffer = str_replace( "_VT_CHARSET_", $this->vtCharset, $buffer);
 
+					/* replace default lanugage variable */
+					$buffer = str_replace( "_VT_DEFAULT_LANGUAGE_", $this->vtDefaultLanguage, $buffer);
+
 			      	/* replace master currency variable */
 		  			$buffer = str_replace( "_MASTER_CURRENCY_", $this->currencyName, $buffer);
 
@@ -254,7 +259,7 @@ ini_set('memory_limit','64M');
 
 // default language
 // default_language default value = en_us
-\$default_language = 'en_us';
+\$default_language = '{$this->vtDefaultLanguage}';
 
 // add the language pack name to every translation string in the display.
 // translation_string_prefix default value = false
diff --git a/modules/Install/models/InitSchema.php b/modules/Install/models/InitSchema.php
index 7b8e5a2498d3308225a89728a79ad33b91718c4f..144283ea97db524ebc6d4be571c8fc7a5a1703ca 100644
--- a/modules/Install/models/InitSchema.php
+++ b/modules/Install/models/InitSchema.php
@@ -770,6 +770,7 @@ class Install_InitSchema_Model {
 		//Fix for http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7974
         $userFirstName = $_SESSION['config_file_info']['firstname']; 
         $userLastName = $_SESSION['config_file_info']['lastname']; 
+        $userLanguage = $_SESSION['config_file_info']['default_language'];
         // create default admin user
     	$user = CRMEntity::getInstance('Users');
 		//Fix for http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/7974
@@ -781,6 +782,7 @@ class Install_InitSchema_Model {
         $user->column_fields["is_admin"] = 'on';
         $user->column_fields["user_password"] = $adminPassword;
         $user->column_fields["time_zone"] = $userTimeZone;
+        $user->column_fields["language"] = $userLanguage;
         $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,';
         $user->column_fields["workdays"] = '0,1,2,3,4,5,6,';
         $user->column_fields["weekstart"] = '1';
diff --git a/modules/Install/models/Utils.php b/modules/Install/models/Utils.php
index ee784f43d941f9a87e8bcd6e3949bd200263fa27..bdde524d7194525f8b1797f6b23df32147fbbb48 100644
--- a/modules/Install/models/Utils.php
+++ b/modules/Install/models/Utils.php
@@ -273,6 +273,33 @@ class Install_Utils_Model {
 		return $currencies;
 	}
 
+
+	/**
+	 * Returns an array with the list of languages which are available in source
+	 * Note: the DB has not been initialized at this point, so we have to look at
+	 * the contents of the `languages/` directory.
+	 * @return <Array>
+	 */
+	public static function getLanguageList() {
+		$languageFolder = 'languages/';
+		$handle = opendir($languageFolder);
+		$language_list = array();
+		while ($prefix = readdir($handle)) {
+			if (substr($prefix, 0, 1) === '.' || $prefix === 'Settings') {
+				continue;
+			}
+			if (is_dir('languages/' . $prefix) && is_file('languages/' . $prefix . '/Install.php')) {
+				$language_list[$prefix] = $prefix;
+			}
+		}
+
+		ksort($language_list);
+
+		return $language_list;
+	}
+
+
+
 	/**
 	 * Function checks if its mysql type
 	 * @param type $dbType
diff --git a/modules/Install/views/Index.php b/modules/Install/views/Index.php
index bf51d342ad08d2b1545d69b04ccfb5137252a29e..c8bace283c555f8a226fd9fb8a803dcbbd80e846 100644
--- a/modules/Install/views/Index.php
+++ b/modules/Install/views/Index.php
@@ -42,8 +42,12 @@ class Install_Index_view extends Vtiger_View_Controller {
 		parent::preProcess($request);
 		$viewer = $this->getViewer($request);
 		$moduleName = $request->getModule();
-		$defaultLanguage = ($request->get('lang'))?$request->get('lang'):'en_us';
-		vglobal('default_language', $defaultLanguage);
+		if ($chosenLanguage = $request->get('lang')) {
+			$_SESSION['config_file_info']['default_language'] = $chosenLanguage;
+		} elseif (empty($_SESSION['config_file_info']['default_language'])) {
+			$_SESSION['config_file_info']['default_language'] = 'en_us';
+		}
+		vglobal('default_language', $_SESSION['config_file_info']['default_language']);
 
 		define('INSTALLATION_MODE', true);
 		define('INSTALLATION_MODE_DEBUG', $this->debug);
@@ -68,6 +72,8 @@ class Install_Index_view extends Vtiger_View_Controller {
 	public function Step1(Vtiger_Request $request) {
 		$viewer = $this->getViewer($request);
 		$moduleName = $request->getModule();
+		$viewer->assign('CURRENT_LANGUAGE', vglobal('default_language'));
+		$viewer->assign('LANGUAGES', Install_Utils_model::getLanguageList());
 		$viewer->view('Step1.tpl', $moduleName);
 	}
 
diff --git a/modules/Migration/schema/540_to_600RC.php b/modules/Migration/schema/540_to_600RC.php
index 3aeac82e2cd62ba368a466abc298bb70c91e7e63..47b365403fddffa1d64a7a450386c2d6e071e894 100644
--- a/modules/Migration/schema/540_to_600RC.php
+++ b/modules/Migration/schema/540_to_600RC.php
@@ -744,13 +744,31 @@ Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_links MODIFY column linkt
 Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_links MODIFY column linklabel VARCHAR(50)', array());
 Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_links MODIFY column handler_class VARCHAR(50)', array());
 Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_links MODIFY column handler VARCHAR(50)', array());
+
 //--
 //Add ModComments to HelpDesk and Faq module
+
+$moduleInstance = Vtiger_Module::getInstance('ModComments');
+$customer = Vtiger_Field::getInstance('customer', $moduleInstance);
+if (!$customer) {
+	$customer = new Vtiger_Field();
+	$customer->name = 'customer';
+	$customer->label = 'Customer';
+	$customer->uitype = '10';
+	$customer->displaytype = '3';
+	$blockInstance = Vtiger_Block::getInstance('LBL_MODCOMMENTS_INFORMATION', $moduleInstance);
+	$blockInstance->addField($customer);
+	$customer->setRelatedModules(array('Contacts'));
+}
+
 require_once 'modules/ModComments/ModComments.php';
 ModComments::addWidgetTo(array("HelpDesk", "Faq"));
 global $current_user, $VTIGER_BULK_SAVE_MODE;
 $VTIGER_BULK_SAVE_MODE = true;
 
+$customerPortalSettings = new Settings_CustomerPortal_Module_Model();
+$portal_user_id = $customerPortalSettings->getCurrentPortalUser();
+
 $stopLoop = false;
 $pageCount = 0;
 do {
@@ -763,12 +781,21 @@ do {
 	for($i=0; $i<$rows; $i++) {
 		$modComments = CRMEntity::getInstance('ModComments');
 		$modComments->column_fields['commentcontent'] = decode_html($adb->query_result($ticketComments, $i, 'comments'));
-		$ownerId = $adb->query_result($ticketComments, $i, 'ownerid');
-		$current_user->id = $ownerId;
-		$modComments->column_fields['assigned_user_id'] = $modComments->column_fields['creator'] = $ownerId;
 		$modComments->column_fields['createdtime'] = $adb->query_result($ticketComments, $i, 'createdtime');
 		$modComments->column_fields['modifiedtime'] = $adb->query_result($ticketComments, $i, 'createdtime');
 		$modComments->column_fields['related_to'] = $adb->query_result($ticketComments, $i, 'ticketid');
+		
+		// Contact linked comments should be carried over (http://code.vtiger.com/vtiger/vtigercrm/issues/130)
+		$ownerId = $adb->query_result($ticketComments, $i, 'ownerid');
+		$ownerType = $adb->query_result($ticketComments, $i, 'ownertype');
+		if ($ownerType == 'customer') {
+			$modComments->column_fields['customer'] = $ownerId;
+			$current_user->id = $ownerId = $portal_user_id; // Owner of record marked to PortalUser, reference marked to Contact.
+		} else {
+			$current_user->id = $ownerId;
+		}
+		$modComments->column_fields['assigned_user_id'] = $modComments->column_fields['creator'] = $ownerId;
+		
 		$modComments->save('ModComments');
 		Migration_Index_View::ExecuteQuery('UPDATE vtiger_crmentity SET modifiedtime = ?, smcreatorid = ?, modifiedby = ? WHERE crmid = ?',
 			array($modComments->column_fields['createdtime'], $ownerId, $ownerId, $modComments->id));
@@ -776,6 +803,9 @@ do {
 	++$pageCount;
 } while (!$stopLoop);
 
+// Restore the UserId
+$current_user->id = Users::getActiveAdminId();
+
 $stopLoop = false;
 $pageCount = 0;
 do {
@@ -794,7 +824,7 @@ do {
 		$modComments->column_fields['related_to'] = $adb->query_result($faqComments, $i, 'faqid');
 		$modComments->save('ModComments');
 		Migration_Index_View::ExecuteQuery('UPDATE vtiger_crmentity SET modifiedtime = ?, smcreatorid = ?, modifiedby = ? WHERE crmid = ?',
-			array($modComments->column_fields['createdtime'], '6', '6', $modComments->id));
+			array($modComments->column_fields['createdtime'], $current_user->id, $current_user->id, $modComments->id));
 	}
 	++$pageCount;
 } while (!$stopLoop);
@@ -836,18 +866,7 @@ Migration_Index_View::ExecuteQuery('CREATE INDEX vtiger_crmentity_labelidx ON vt
 $homeModule = Vtiger_Module::getInstance('Home');
 Vtiger_Event::register($homeModule, 'vtiger.entity.aftersave', 'Vtiger_RecordLabelUpdater_Handler', 'modules/Vtiger/RecordLabelUpdater.php');
 
-$moduleInstance = Vtiger_Module::getInstance('ModComments');
-$customer = Vtiger_Field::getInstance('customer', $moduleInstance);
-if (!$customer) {
-	$customer = new Vtiger_Field();
-	$customer->name = 'customer';
-	$customer->label = 'Customer';
-	$customer->uitype = '10';
-	$customer->displaytype = '3';
-	$blockInstance = Vtiger_Block::getInstance('LBL_MODCOMMENTS_INFORMATION', $moduleInstance);
-	$blockInstance->addField($customer);
-	$customer->setRelatedModules(array('Contacts'));
-}
+
 
 $moduleInstance = Vtiger_Module::getInstance('Potentials');
 $filter = Vtiger_Filter::getInstance('All', $moduleInstance);
diff --git a/modules/Migration/schema/640_to_650.php b/modules/Migration/schema/640_to_650.php
index 432024594bba15a8e3d49c76429e8241d3a68934..cc39d3d310836e287da7067303237b3d10399ed6 100644
--- a/modules/Migration/schema/640_to_650.php
+++ b/modules/Migration/schema/640_to_650.php
@@ -11,14 +11,52 @@
 if(defined('VTIGER_UPGRADE')) {
 
 //Start add new currency - 'CFP Franc or Pacific Franc' 
-global $db;
+global $adb;
+
+Vtiger_Utils::AddColumn('vtiger_portalinfo', 'cryptmode', 'varchar(20)');
 
 //Updating existing users password to thier md5 hash
+$updateQuery = "UPDATE vtiger_portalinfo SET user_password=MD5(user_password),cryptmode='MD5' WHERE cryptmode is null";
+$adb->pquery($updateQuery, array());
+
+//Change column type of inventory line-item comment.
+$adb->pquery("ALTER TABLE vtiger_inventoryproductrel MODIFY COLUMN comment TEXT", array());
+
+
+// Initlize mailer_queue tables.
+include_once 'vtlib/Vtiger/Mailer.php';
+$mailer = new Vtiger_Mailer();
+$mailer->__initializeQueue();
+
+//set settings links, fixes translation issue on migrations from 5.x
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Users&parent=Settings&view=List' where name='LBL_USERS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Roles&parent=Settings&view=Index' where name='LBL_ROLES'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Profiles&parent=Settings&view=List' where name='LBL_PROFILES'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Groups&parent=Settings&view=List' where name='USERGROUPLIST'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=SharingAccess&parent=Settings&view=Index' where name='LBL_SHARING_ACCESS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=FieldAccess&parent=Settings&view=Index' where name='LBL_FIELDS_ACCESS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=LoginHistory&parent=Settings&view=List' where name='LBL_LOGIN_HISTORY_DETAILS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=ModuleManager&parent=Settings&view=List' where name='VTLIB_LBL_MODULE_MANAGER'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?parent=Settings&module=Picklist&view=Index' where name='LBL_PICKLIST_EDITOR'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?parent=Settings&module=PickListDependency&view=List' where name='LBL_PICKLIST_DEPENDENCY_SETUP'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=MenuEditor&parent=Settings&view=Index' where name='LBL_MENU_EDITOR'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Settings&view=listnotificationschedulers&parenttab=Settings' where name='NOTIFICATIONSCHEDULERS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Settings&view=listinventorynotifications&parenttab=Settings' where name='INVENTORYNOTIFICATION'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?parent=Settings&module=Vtiger&view=CompanyDetails' where name='LBL_COMPANY_DETAILS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?parent=Settings&module=Vtiger&view=OutgoingServerDetail' where name='LBL_MAIL_SERVER_SETTINGS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?parent=Settings&module=Currency&view=List' where name='LBL_CURRENCY_SETTINGS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Vtiger&parent=Settings&view=TaxIndex' where name='LBL_TAX_SETTINGS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Settings&submodule=Server&view=ProxyConfig' where name='LBL_SYSTEM_INFO'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?parent=Settings&module=Vtiger&view=AnnouncementEdit' where name='LBL_ANNOUNCEMENT'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Settings&action=DefModuleView&parenttab=Settings' where name='LBL_DEFAULT_MODULE_VIEW'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?parent=Settings&module=Vtiger&view=TermsAndConditionsEdit' where name='INVENTORYTERMSANDCONDITIONS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Vtiger&parent=Settings&view=CustomRecordNumbering' where name='LBL_CUSTOMIZE_MODENT_NUMBER'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?parent=Settings&module=MailConverter&view=List' where name='LBL_MAIL_SCANNER'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Workflows&parent=Settings&view=List' where name='LBL_LIST_WORKFLOWS'", array());
+$adb->pquery("Update vtiger_settings_field set linkto='index.php?module=Vtiger&parent=Settings&view=ConfigEditorDetail' where name='LBL_CONFIG_EDITOR'", array());
+
+//allow large emails to be stored.
+$adb->pquery("ALTER TABLE vtiger_crmentity MODIFY COLUMN description MEDIUMTEXT", array());
 
-$selectQuery = 'SELECT 1 FROM vtiger_portalinfo';
-$resultSet = $db->pquery($selectQuery, array());
-if ($db->num_rows($resultSet) > 0) {
-    $updateQuery = 'UPDATE vtiger_portalinfo SET user_password=MD5(user_password)';
-    $db->pquery($updateQuery, array());
 }
-}
\ No newline at end of file
+
diff --git a/modules/Reports/ReportRun.php b/modules/Reports/ReportRun.php
index dd983d759c73aa918c86b8512afa616e852cf83a..69ac4d88e6b185095c70c473ec678effa13c6626 100644
--- a/modules/Reports/ReportRun.php
+++ b/modules/Reports/ReportRun.php
@@ -619,7 +619,9 @@ class ReportRun extends CRMEntity
 				foreach($fieldSqlColumns as $columnSql) {
 					$queryColumn .= " WHEN $columnSql NOT LIKE '' THEN $columnSql";
 				}
-				$queryColumn .= " ELSE '' END) ELSE '' END) AS $moduleFieldLabel";
+				// Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/48
+				$moduleFieldLabel = vtlib_purify(decode_html($moduleFieldLabel));
+				$queryColumn .= " ELSE '' END) ELSE '' END) AS '$moduleFieldLabel'";
 				$this->queryPlanner->addTable($tableName);
 			}
 		}
@@ -4279,7 +4281,7 @@ class ReportRun extends CRMEntity
         $arr_val = $reportData['data'];
 
 		$fp = fopen($fileName, 'w+');
-
+		fputs($fp,chr(239) . chr(187) . chr(191));//UTF-8 byte order mark
 		if(isset($arr_val)) {
 			$csv_values = array();
 			// Header
diff --git a/modules/Reports/ReportUtils.php b/modules/Reports/ReportUtils.php
index eb27fb2140de1027b729c89d2bf3e071f5b17abf..a40486bd5409c8b1cc1a4d2a31d86565b9a28d9c 100644
--- a/modules/Reports/ReportUtils.php
+++ b/modules/Reports/ReportUtils.php
@@ -132,7 +132,7 @@ function getReportFieldValue ($report, $picklistArray, $dbField, $valueArray, $f
 			}
 			$date = new DateTimeField($value.' '.$endTime);
 			$fieldvalue = $date->getDisplayDate();
-		} else if(!($field->getUIType() == '5')) {
+		} else if(!($field->getUIType() == '5'||$field->getUiType() =='23')) {
             $date = new DateTimeField($fieldvalue);
             $fieldvalue = $date->getDisplayDateTimeValue();
 		}
@@ -210,4 +210,4 @@ function getReportFieldValue ($report, $picklistArray, $dbField, $valueArray, $f
 	return htmlentities($fieldvalue, ENT_QUOTES, $default_charset);
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/modules/Reports/models/Chart.php b/modules/Reports/models/Chart.php
index d31a32c35c276183cda3c9c7cc1b7ce17b1b3808..195469f18ca66690fb41524ec157cd35ab6afd93 100644
--- a/modules/Reports/models/Chart.php
+++ b/modules/Reports/models/Chart.php
@@ -218,6 +218,14 @@ abstract class Base_Chart extends Vtiger_Base_Model{
 
 		$columnSQL = $reportRunObject->getColumnSQL($selectedfields);
 
+		// Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/4
+		switch ($selectedfields[count($selectedfields)-1]) {
+			case 'MY':
+				$columnSQL = str_replace('%M', '%m', $columnSQL); // %M (yields Jan), %m - 01
+				break;
+		}
+		// End
+
 		$reportRunObject->append_currency_symbol_to_value = $append_currency_symbol_to_value;
 		return $columnSQL;
 	}
@@ -601,4 +609,4 @@ class HorizontalbarChart extends VerticalbarChart {
 
 class LineChart extends VerticalbarChart{
 
-}
\ No newline at end of file
+}
diff --git a/modules/Users/Users.php b/modules/Users/Users.php
index f41230ba7360388a708436a8c50a2f684aeb5e7f..b4642d00fcc776cc81544b1322079866f405546f 100755
--- a/modules/Users/Users.php
+++ b/modules/Users/Users.php
@@ -1057,17 +1057,6 @@ class Users extends CRMEntity {
 			$this->column_fields['currency_symbol_placement'] = $this->currency_symbol_placement = '$1.0';
 		}
 
-		// TODO - This needs to be cleaned up once default values for fields are picked up in a cleaner way.
-		// This is just a quick fix to ensure things doesn't start breaking when the user currency configuration is missing
-		if($this->column_fields['currency_grouping_pattern'] == ''
-				&& $this->column_fields['currency_symbol_placement'] == '') {
-
-			$this->column_fields['currency_grouping_pattern'] = $this->currency_grouping_pattern = '123,456,789';
-			$this->column_fields['currency_decimal_separator'] = $this->currency_decimal_separator = '.';
-			$this->column_fields['currency_grouping_separator'] = $this->currency_grouping_separator = ',';
-			$this->column_fields['currency_symbol_placement'] = $this->currency_symbol_placement = '$1.0';
-		}
-
 		$this->id = $record;
 		$log->debug("Exit from retrieve_entity_info($record, $module) method.");
 
diff --git a/modules/Users/actions/Login.php b/modules/Users/actions/Login.php
index 8af7b4eae42259890f091838ab39c85edad94027..b0ecdb3f9cdae4d50845f94224a3dfc66538dc60 100644
--- a/modules/Users/actions/Login.php
+++ b/modules/Users/actions/Login.php
@@ -21,7 +21,7 @@ class Users_Login_Action extends Vtiger_Action_Controller {
 
 	function process(Vtiger_Request $request) {
 		$username = $request->get('username');
-		$password = $request->get('password');
+		$password = $request->getRaw('password');
 
 		$user = CRMEntity::getInstance('Users');
 		$user->column_fields['user_name'] = $username;
diff --git a/modules/Vtiger/actions/ExportData.php b/modules/Vtiger/actions/ExportData.php
index 737775290901f328c6f1d4d87a4ee6506832187b..fedbe65d9bf1675763842b0d3597d5f06adae05d 100644
--- a/modules/Vtiger/actions/ExportData.php
+++ b/modules/Vtiger/actions/ExportData.php
@@ -170,17 +170,14 @@ class Vtiger_ExportData_Action extends Vtiger_Mass_Action {
 		header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
 		header("Cache-Control: post-check=0, pre-check=0", false );
 
-		$header = implode("\", \"", $headers);
-		$header = "\"" .$header;
-		$header .= "\"\r\n";
-		echo $header;
+		$fp = fopen("php://output", "w");
+		fputcsv($fp, $headers);
 
 		foreach($entries as $row) {
-			$line = implode("\",\"",$row);
-			$line = "\"" .$line;
-			$line .= "\"\r\n";
-			echo $line;
+			fputcsv($fp, $row);
 		}
+		
+		fclose($fp);
 	}
 
 	private $picklistValues;
@@ -271,4 +268,4 @@ class Vtiger_ExportData_Action extends Vtiger_Mass_Action {
 		}
 		return $arr;
 	}
-}
\ No newline at end of file
+}
diff --git a/modules/Vtiger/models/CssScript.php b/modules/Vtiger/models/CssScript.php
index fcda62033b2cadba727934cc41c558815d5e5a17..392a31694db53534a89c8e38e942127005fe36ad 100644
--- a/modules/Vtiger/models/CssScript.php
+++ b/modules/Vtiger/models/CssScript.php
@@ -14,7 +14,7 @@
 class Vtiger_CssScript_Model extends Vtiger_Base_Model {
 
 	const DEFAULT_REL = 'stylesheet';
-	const DEFAULT_MEDIA = 'screen';
+	const DEFAULT_MEDIA = 'all';
 	const DEFAULT_TYPE = 'text/css';
 
 	const LESS_REL = 'stylesheet/less';
diff --git a/modules/Vtiger/models/ListView.php b/modules/Vtiger/models/ListView.php
index 0b0c1c087dc5f21b281879fae7fd6f5f1d3abb19..aaa6028f73b2811b53a788ce482c49181437b39c 100644
--- a/modules/Vtiger/models/ListView.php
+++ b/modules/Vtiger/models/ListView.php
@@ -189,6 +189,10 @@ class Vtiger_ListView_Model extends Vtiger_Base_Model {
 		if(empty($orderBy) && empty($sortOrder) && $moduleName != "Users"){
 			$orderBy = 'modifiedtime';
 			$sortOrder = 'DESC';
+			if (PerformancePrefs::getBoolean('LISTVIEW_DEFAULT_SORTING', true)) {
+                                $orderBy = $moduleFocus->default_order_by;
+                                $sortOrder = $moduleFocus->default_sort_order;
+                        }
 		}
 
         if(!empty($orderBy)){
diff --git a/modules/Vtiger/models/RelationListView.php b/modules/Vtiger/models/RelationListView.php
index 32b3a95ff3f637e165d089237f78ec9b9ad85268..30256a61f265cb15dbb34413fe96afa569913375 100644
--- a/modules/Vtiger/models/RelationListView.php
+++ b/modules/Vtiger/models/RelationListView.php
@@ -213,6 +213,13 @@ class Vtiger_RelationListView_Model extends Vtiger_Base_Model {
 
 		$orderBy = $this->getForSql('orderby');
 		$sortOrder = $this->getForSql('sortorder');
+
+                if (!$orderBy & PerformancePrefs::getBoolean('LISTVIEW_DEFAULT_SORTING', true)) {
+                        $entityModule=CRMEntity::getInstance($relationModule->name);
+                        $orderBy=$entityModule->default_order_by;
+                        $sortorder=$entityModule->default_sort_order;
+                }
+
 		if($orderBy) {
 
             $orderByFieldModuleModel = $relationModule->getFieldByColumn($orderBy);
@@ -506,4 +513,4 @@ class Vtiger_RelationListView_Model extends Vtiger_Base_Model {
         }         
     }
 
-}
\ No newline at end of file
+}
diff --git a/modules/Vtiger/uitypes/Date.php b/modules/Vtiger/uitypes/Date.php
index 0d7280ad78534cffa409142be13a22d4b078370e..f8c9cc5442fec6878580e0aeecafd1de05086e24 100644
--- a/modules/Vtiger/uitypes/Date.php
+++ b/modules/Vtiger/uitypes/Date.php
@@ -101,6 +101,13 @@ class Vtiger_Date_UIType extends Vtiger_Base_UIType {
 	 * @return <String>
 	 */
 	public static function getDisplayDateValue($date) {
+		// Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/4
+		// Handle (MonthNumber Year) format value conversion.
+		if (preg_match("/([0-9]{1,2}) ([0-9]{1,4})/", $date, $m)) {
+        	return date("M Y", strtotime($m[2].'-'.$m[1].'-'.'1'));
+    	}
+		// End
+
 		$date = new DateTimeField($date);
 		return $date->getDisplayDate();
 	}
@@ -111,6 +118,13 @@ class Vtiger_Date_UIType extends Vtiger_Base_UIType {
 	 * @return <String>
 	 */
 	public static function getDisplayDateTimeValue($dateTime) {
+		// Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/4
+		// Handle (MonthNumber Year) format value conversion.
+		if (preg_match("/([0-9]{1,2}) ([0-9]{1,4})/", $date, $m)) {
+			return date("M Y", strtotime($m[2].'-'.$m[1].'-'.'1'));
+		}
+		// End
+
 		$date = new DateTimeField($dateTime);
 		return $date->getDisplayDateTimeValue();
 	}
@@ -119,4 +133,4 @@ class Vtiger_Date_UIType extends Vtiger_Base_UIType {
         return 'uitypes/DateFieldSearchView.tpl';
     }
 
-}
\ No newline at end of file
+}
diff --git a/modules/Vtiger/views/Header.php b/modules/Vtiger/views/Header.php
index 683e0558d2e66f18a4843cf4dfd3abd1c7d18959..6fa5faf1a69cd8741503d4cf738442b84a36001e 100644
--- a/modules/Vtiger/views/Header.php
+++ b/modules/Vtiger/views/Header.php
@@ -144,10 +144,15 @@ abstract class Vtiger_Header_View extends Vtiger_View_Controller {
 			}
 			$headerLinkInstances[$index++] = $headerLinkInstance;
 		}
+
+		// Fix for http://code.vtiger.com/vtiger/vtigercrm/issues/49
+		// Push HEADERLINKS to drop-down menu shown with username (last-one) as structured above.
+		$lastindex = count($headerLinkInstances)-1;
 		$headerLinks = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERLINK'));
+		if ($headerLinks) $headerLinkInstances[$lastindex]->addChildLink(Vtiger_Link_Model::getInstanceFromValues(array())); // Separator
 		foreach($headerLinks as $headerType => $headerLinks) {
 			foreach($headerLinks as $headerLink) {
-				$headerLinkInstances[$index++] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
+				$headerLinkInstances[$lastindex]->addChildLink(Vtiger_Link_Model::getInstanceFromLinkObject($headerLink));
 			}
 		}
 		return $headerLinkInstances;
diff --git a/packages/vtiger/mandatory/Import.zip b/packages/vtiger/mandatory/Import.zip
index b7c12eab6e3088cf85e23820b51c74e369ebdf8b..7745d16f9808a63d7fac89f16e29be44eade7bfe 100644
Binary files a/packages/vtiger/mandatory/Import.zip and b/packages/vtiger/mandatory/Import.zip differ
diff --git a/pkg/vtiger/modules/Import/modules/Import/helpers/Utils.php b/pkg/vtiger/modules/Import/modules/Import/helpers/Utils.php
index 2da70b661c1bbfd0afc7d807966d03bdeab93cb3..0b42706ea15da7737ea4b671b1875a4c986b3141 100644
--- a/pkg/vtiger/modules/Import/modules/Import/helpers/Utils.php
+++ b/pkg/vtiger/modules/Import/modules/Import/helpers/Utils.php
@@ -16,7 +16,19 @@ class Import_Utils_Helper {
 	static $AUTO_MERGE_OVERWRITE = 2;
 	static $AUTO_MERGE_MERGEFIELDS = 3;
 
-	static $supportedFileEncoding = array('UTF-8'=>'UTF-8', 'ISO-8859-1'=>'ISO-8859-1');
+	static $supportedFileEncoding = array(
+		'UTF-8'=>'UTF-8',
+		'ISO-8859-1'=>'ISO-8859-1',
+		'Windows-1250'=>'Windows-1250',
+		'Windows-1251'=>'Windows-1251',
+		'Windows-1252'=>'Windows-1252',
+		'Windows-1253'=>'Windows-1253',
+		'Windows-1254'=>'Windows-1254',
+		'Windows-1255'=>'Windows-1255',
+		'Windows-1256'=>'Windows-1256',
+		'Windows-1257'=>'Windows-1257',
+		'Windows-1258'=>'Windows-1258',
+		);
 	static $supportedDelimiters = array(','=>'comma', ';'=>'semicolon');
 	static $supportedFileExtensions = array('csv','vcf');
 
diff --git a/pkg/vtiger/modules/Import/modules/Import/readers/FileReader.php b/pkg/vtiger/modules/Import/modules/Import/readers/FileReader.php
index 8f55f64fad5947c7792db7c1d9d8c5eb04a6e143..dd77e669d1237577e549642cd6d1442758aac2ad 100644
--- a/pkg/vtiger/modules/Import/modules/Import/readers/FileReader.php
+++ b/pkg/vtiger/modules/Import/modules/Import/readers/FileReader.php
@@ -70,7 +70,10 @@ class Import_FileReader_Reader {
 	}
 
 	public function convertCharacterEncoding($value, $fromCharset, $toCharset) {
-		if (function_exists("mb_convert_encoding")) {
+		if (function_exists("mb_convert_encoding")
+				&& function_exists("mb_list_encodings")
+				&& in_array($fromCharset, mb_list_encodings())
+				&& in_array($toCharset, mb_list_encodings())) {
 			$value = mb_convert_encoding($value, $toCharset, $fromCharset);
 		} else {
 			$value = iconv($fromCharset, $toCharset, $value);
diff --git a/pkg/vtiger/modules/MailManager/modules/MailManager/views/Mail.php b/pkg/vtiger/modules/MailManager/modules/MailManager/views/Mail.php
old mode 100644
new mode 100755
index 51b1757b41c1794a29ace9fead44bf13e02c1317..a36ca4917b5d442393a834d838c19888865614fe
--- a/pkg/vtiger/modules/MailManager/modules/MailManager/views/Mail.php
+++ b/pkg/vtiger/modules/MailManager/modules/MailManager/views/Mail.php
@@ -39,6 +39,7 @@ class MailManager_Mail_View extends MailManager_Abstract_View {
 
 			$metainfo  = array(
 					'from' => $mail->from(), 'subject' => $mail->subject(),
+					'sendto'=>$mail->to(),
 					'msgno' => $mail->msgNo(), 'msguid' => $mail->uniqueid(),
 					'folder' => $foldername );
 
@@ -323,4 +324,4 @@ class MailManager_Mail_View extends MailManager_Abstract_View {
             return $request->validateReadAccess(); 
         } 
 }
-?>
\ No newline at end of file
+?>
diff --git a/pkg/vtiger/modules/MailManager/modules/MailManager/views/Relation.php b/pkg/vtiger/modules/MailManager/modules/MailManager/views/Relation.php
old mode 100644
new mode 100755
index 78e17176480e044ab9da4c3b2a14d73d302bbdd4..b8d9cd0826ed76c0ef4205929577d760a6bd31b9
--- a/pkg/vtiger/modules/MailManager/modules/MailManager/views/Relation.php
+++ b/pkg/vtiger/modules/MailManager/modules/MailManager/views/Relation.php
@@ -55,7 +55,13 @@ class MailManager_Relation_View extends MailManager_Abstract_View {
 
 			// Check if the message is already linked.
 			$linkedto = MailManager_Relate_Action::associatedLink($request->get('_msguid'));
-			// If the message was not linked, lookup for matching records, using FROM address
+			// If the message was not linked, lookup for matching records, using FROM address unless it is in the sent folder
+      $folder=$request->get('_folder');
+      if ($folder=="Sent"){
+        $contacts=$request->get('_msendto');
+      }else{
+			  $contacts=$request->get('_mfrom');
+			}
 			if (empty($linkedto)) {
 				$results = array();
 				$modules = array();
@@ -63,10 +69,8 @@ class MailManager_Relation_View extends MailManager_Abstract_View {
 				foreach (self::$MODULES as $MODULE) {
 					if(!in_array($MODULE, $allowedModules)) continue;
 
-					$from = $request->get('_mfrom');
-					if(empty($from)) continue;
-
-					$results[$MODULE] = $this->lookupModuleRecordsWithEmail($MODULE, $from);
+					if(empty($contacts)) continue;
+					$results[$MODULE] = $this->lookupModuleRecordsWithEmail($MODULE, $contacts);
 					$describe = $this->ws_describe($MODULE);
 					$modules[$MODULE] = array('label' => $describe['label'], 'name' => textlength_check($describe['name']), 'id' => $describe['idPrefix'] );
 
@@ -417,18 +421,22 @@ class MailManager_Relation_View extends MailManager_Abstract_View {
 	 * @param Email Address $email
 	 * @return Array
 	 */
-	public function lookupModuleRecordsWithEmail($module, $email) {
+	public function lookupModuleRecordsWithEmail($module, $emails) {
 		$currentUserModel = vglobal('current_user');
-		$query = $this->buildSearchQuery($module, $email, 'EMAIL');
-		$qresults = vtws_query( $query, $currentUserModel );
-		$describe = $this->ws_describe($module);
-		$labelFields = explode(',', $describe['labelFields']);
-
+    //could be to multiple email addresses
 		$results = array();
-		foreach($qresults as $qresult) {
-			$labelValues = array();
-			foreach($labelFields as $fieldname) {
-				if(isset($qresult[$fieldname])) $labelValues[] = $qresult[$fieldname];
+    foreach(explode(",",$emails) as $email){
+      $query = $this->buildSearchQuery($module, $email, 'EMAIL');
+      $qresults = vtws_query( $query, $currentUserModel );
+      $describe = $this->ws_describe($module);
+      $labelFields = explode(',', $describe['labelFields']);
+      foreach($qresults as $qresult) {
+        $labelValues = array();
+        foreach($labelFields as $fieldname) {
+          if(isset($qresult[$fieldname])) $labelValues[] = $qresult[$fieldname];
+        }
+        $ids = vtws_getIdComponents($qresult['id']);
+        $results[] = array( 'wsid' => $qresult['id'], 'id' => $ids[1], 'label' => implode(' ', $labelValues));
 			}
 			$ids = vtws_getIdComponents($qresult['id']);
 			$results[] = array( 'wsid' => $qresult['id'], 'id' => $ids[1], 'label' => implode(' ', $labelValues));
@@ -440,4 +448,4 @@ class MailManager_Relation_View extends MailManager_Abstract_View {
             return $request->validateWriteAccess(); 
         }
 }
-?>
\ No newline at end of file
+?>
diff --git a/pkg/vtiger/modules/MailManager/templates/resources/MailManager.js b/pkg/vtiger/modules/MailManager/templates/resources/MailManager.js
old mode 100644
new mode 100755
index ecc7388a487b335f4c0f5e2eee6ca2c493a9009a..e0368d335efaca5aa4f667d20a99d7be7e914bd0
--- a/pkg/vtiger/modules/MailManager/templates/resources/MailManager.js
+++ b/pkg/vtiger/modules/MailManager/templates/resources/MailManager.js
@@ -766,6 +766,7 @@ if (typeof(MailManager) == 'undefined') {
 
 			var meta = MailManager.mail_open_meta;
                         AppConnector.request(MailManager._baseurl() + "_operation=relation&_operationarg=find&_mfrom=" + encodeURIComponent(meta['from']) +
+                        '&_msendto='+ encodeURIComponent(meta['sendto']) +
 				'&_folder=' +encodeURIComponent(meta['folder']) +'&_msgno=' +encodeURIComponent(meta['msgno']) +'&_msguid=' +
 				encodeURIComponent(meta['msguid'].replace('<', '&lt;').replace('>', '&gt;'))).then(function(responseJSON) { 
                                         responseJSON = JSON.parse(responseJSON);
diff --git a/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/models/Record.php b/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/models/Record.php
index e7a5fc9f25c6ab298beebadfbff2c1c2b2e5b7f0..144c31081b92b50a38e113b799afe770f6cbbd55 100644
--- a/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/models/Record.php
+++ b/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/models/Record.php
@@ -20,7 +20,8 @@ class SMSNotifier_Record_Model extends Vtiger_Record_Model {
 
 		$statusColor = $this->getColorForStatus($statusDetails[0]['status']);
 
-		$this->setData($statusDetails[0]);
+		$data = array_merge($statusDetails[0], array('statuscolor' => $statusColor));
+		$this->setData($data);
 
 		return $this;
 	}
diff --git a/resources/app.js b/resources/app.js
index 5ffa9ce219f80255e2681af95c555d6857331222..6be563453ce148d4fd81b8b37eb2c89f4dea941e 100644
--- a/resources/app.js
+++ b/resources/app.js
@@ -406,24 +406,13 @@ var app = {
 
 	formAlignmentAfterValidation : function(form){
 		// to avoid hiding of error message under the fixed nav bar
-		var destination = form.find(".formError:not('.greenPopup'):first").offset().top;
-		var resizedDestnation = destination-105;
-		jQuery('html').animate({
-			scrollTop:resizedDestnation
-		}, 'slow');
-	},
-
-	/**
-	 * Function to push down the error message size when validation is invoked
-	 * @params : form Element
-	 */
-	formAlignmentAfterValidation : function(form){
-		// to avoid hiding of error message under the fixed nav bar
-		var destination = form.find(".formError:not('.greenPopup'):first").offset().top;
-		var resizedDestnation = destination-105;
-		jQuery('html').animate({
-			scrollTop:resizedDestnation
-		}, 'slow');
+        var formOffset = form.find(".formError:not('.greenPopup'):first").offset();
+        if(formOffset !== null && typeof(formOffset) === 'object' && formOffset.hasOwnProperty('top')) {
+            var resizedDestnation = formOffset.top - 105;
+            $('html, body').animate({
+                scrollTop:resizedDestnation
+            }, 'slow');
+        }
 	},
 
 	convertToDatePickerFormat: function(dateFormat){
diff --git a/schema/DatabaseSchema.xml b/schema/DatabaseSchema.xml
index 412532e560ae73b6d23c64335c2fa4291a1234d7..08c0f29bf5eb3e42344758725257a9d5b0c9ff45 100644
--- a/schema/DatabaseSchema.xml
+++ b/schema/DatabaseSchema.xml
@@ -587,6 +587,7 @@
 		<field name="user_name" type="C" size="50" />
 		<field name="user_password" type="C" size="30" />
 		<field name="type" type="C" size="5" />
+		<field name="cryptmode" type="C" size="20" />
 		<field name="last_login_time" type="T" />
 		<field name="login_time" type="T" />
 		<field name="logout_time" type="T" />
@@ -5401,7 +5402,7 @@
 		<field name="listprice" type="N" size="25.3" />
 		<field name="discount_percent" type="N" size="7.3" />
 		<field name="discount_amount" type="N" size="25.3" />
-		<field name="comment" type="C" size="250" />
+		<field name="comment" type="X" />
 		<field name="description" type="X" />
 		<field name="incrementondel" type="I" size="11">
 			<notnull />
diff --git a/vtlib/Vtiger/Field.php b/vtlib/Vtiger/Field.php
index 826d49b4914d82d0e1ccd032481e4b1a0e2bd77c..1b370795b86076b5178aa449cc80d50cfc4bd022 100644
--- a/vtlib/Vtiger/Field.php
+++ b/vtlib/Vtiger/Field.php
@@ -236,7 +236,7 @@ class Vtiger_Field extends Vtiger_FieldBasic {
 		global $adb;
 		$instances = false;
 
-		$query = "SELECT * FROM vtiger_field WHERE tabid=? ORDER BY sequence";
+		$query = "SELECT * FROM vtiger_field left join vtiger_blocks on vtiger_field.block=vtiger_blocks.blockid WHERE vtiger_field.tabid=? ORDER BY vtiger_blocks.sequence,vtiger_field.sequence";
 		$queryParams = Array($moduleInstance->id);
 
 		$result = $adb->pquery($query, $queryParams);
@@ -259,4 +259,4 @@ class Vtiger_Field extends Vtiger_FieldBasic {
 		self::log("Deleting fields of the module ... DONE");
 	}
 }
-?>
\ No newline at end of file
+?>