Welcome to Vtiger Community. To gain access for account, please contact [ info @ vtiger.com ]

Commit 947091314008ac85ef228d06425ac17127f79449

Authored by Satish
2 parents 303b06a3 614a9342

Merged with master

languages/en_gb/Calendar.php
... ... @@ -26,7 +26,7 @@ $languageStrings = array(
26 26 'LBL_EVENT_INFORMATION' => 'Event Details' ,
27 27 'Subject' => 'Subject' ,
28 28 'Start Date & Time' => 'Start Date & Time' ,
29   - 'Activity Type' => 'Activity Type' ,
  29 + 'Activity Type' => 'Event Type' ,
30 30 'Send Notification' => 'Send Notification' ,
31 31 'Location' => 'Location' ,
32 32 'End Date & Time' => 'End Date & Time' ,
... ...
languages/en_gb/Events.php
... ... @@ -25,7 +25,7 @@ $languageStrings = array(
25 25 'Location' => 'Location' ,
26 26 'Send Reminder' => 'Send Email Reminder Before' ,
27 27 'End Date & Time' => 'End Date & Time' ,
28   - 'Activity Type' => 'Activity Type' ,
  28 + 'Activity Type' => 'Event Type' ,
29 29 'Visibility' => 'Visibility' ,
30 30 'Private' => 'Private' ,
31 31 'Public' => 'Public' ,
... ...
languages/en_us/Calendar.php
... ... @@ -8,7 +8,7 @@
8 8 * All Rights Reserved.
9 9 * *********************************************************************************** */
10 10 $languageStrings = array(
11   - 'Activity Type' => 'Activity Type',
  11 + 'Activity Type' => 'Event Type', /* Event field */
12 12 'Call' => 'Call',
13 13 'Completed' => 'Completed',
14 14 'Daily' => 'Day(s)',
... ...
languages/en_us/Events.php
... ... @@ -11,7 +11,7 @@
11 11 /* NOTE: Should be inline with Calendar language translation but few variations */
12 12  
13 13 $languageStrings = array(
14   - 'Activity Type'=>'Activity Type',
  14 + 'Activity Type'=>'Event Type', /* Events Field */
15 15 'Busy' => 'Busy',
16 16 'Call' => 'Call',
17 17 'Daily'=>'Day(s)',
... ...
layouts/vlayout/modules/Vtiger/RecentActivities.tpl
... ... @@ -45,14 +45,14 @@
45 45 <div class='font-x-small updateInfoContainer'>
46 46 <i>{vtranslate($FIELDMODEL->getName(),$MODULE_NAME)}</i> :&nbsp;
47 47 {if $FIELDMODEL->get('prevalue') neq '' && $FIELDMODEL->get('postvalue') neq '' && !($FIELDMODEL->getFieldInstance()->getFieldDataType() eq 'reference' && ($FIELDMODEL->get('postvalue') eq '0' || $FIELDMODEL->get('prevalue') eq '0'))}
48   - &nbsp;{vtranslate('LBL_FROM')} <b style="white-space:pre;">{Vtiger_Util_Helper::toVtiger6SafeHTML($FIELDMODEL->getDisplayValue(decode_html($FIELDMODEL->get('prevalue'))))}</b>
  48 + &nbsp;{vtranslate('LBL_FROM')} <b style="white-space:pre-wrap;">{Vtiger_Util_Helper::toVtiger6SafeHTML($FIELDMODEL->getDisplayValue(decode_html($FIELDMODEL->get('prevalue'))))}</b>
49 49 {else if $FIELDMODEL->get('postvalue') eq '' || ($FIELDMODEL->getFieldInstance()->getFieldDataType() eq 'reference' && $FIELDMODEL->get('postvalue') eq '0')}
50 50 &nbsp; <b> {vtranslate('LBL_DELETED')} </b> ( <del>{Vtiger_Util_Helper::toVtiger6SafeHTML($FIELDMODEL->getDisplayValue(decode_html($FIELDMODEL->get('prevalue'))))}</del> )
51 51 {else}
52 52 &nbsp;{vtranslate('LBL_CHANGED')}
53 53 {/if}
54 54 {if $FIELDMODEL->get('postvalue') neq '' && !($FIELDMODEL->getFieldInstance()->getFieldDataType() eq 'reference' && $FIELDMODEL->get('postvalue') eq '0')}
55   - &nbsp;{vtranslate('LBL_TO')}&nbsp;<b style="white-space:pre;">{Vtiger_Util_Helper::toVtiger6SafeHTML($FIELDMODEL->getDisplayValue(decode_html($FIELDMODEL->get('postvalue'))))}</b>
  55 + &nbsp;{vtranslate('LBL_TO')}&nbsp;<b style="white-space:pre-wrap;">{Vtiger_Util_Helper::toVtiger6SafeHTML($FIELDMODEL->getDisplayValue(decode_html($FIELDMODEL->get('postvalue'))))}</b>
56 56 {/if}
57 57  
58 58 </div>
... ...
modules/Settings/Vtiger/actions/CompanyDetailsSave.php
... ... @@ -17,32 +17,17 @@ class Settings_Vtiger_CompanyDetailsSave_Action extends Settings_Vtiger_Basic_Ac
17 17 $status = false;
18 18  
19 19 if ($request->get('organizationname')) {
20   - $saveLogo = $status = true;
  20 + $saveLogo = $status = true;
  21 + $binFileName = false;
21 22 if(!empty($_FILES['logo']['name'])) {
22 23 $logoDetails = $_FILES['logo'];
23   - $fileType = explode('/', $logoDetails['type']);
24   - $fileType = $fileType[1];
  24 + $saveLogo = Vtiger_Functions::validateImage($logoDetails);
  25 + if (is_string($saveLogo)) $saveLogo = ($saveLogo == 'false')? false : true;
25 26  
26   - if (!$logoDetails['size'] || !in_array($fileType, Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
27   - $saveLogo = false;
28   - }
29   -
30   - if ($saveLogo) {
31   - //mime type check
32   - $mimeType = mime_content_type($logoDetails['tmp_name']);
33   - $mimeTypeContents = explode('/', $mimeType);
34   - if ($mimeTypeContents[0] != 'image' || !in_array($mimeTypeContents[1], Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
35   - $saveLogo = false;
36   - }
37   - }
38   -
39   - if ($saveLogo) {
40   - $saveLogo = Vtiger_Functions::validateImage($logoDetails);
41   - if (is_string($saveLogo)) $saveLogo = ($saveLogo == 'false')? false : true;
42   - }
43   -
44   - if ($saveLogo) {
45   - $moduleModel->saveLogo();
  27 + global $upload_badext;
  28 + $binFileName = sanitizeUploadFileName($logoDetails['name'], $upload_badext);
  29 + if ($saveLogo) {
  30 + $moduleModel->saveLogo($binFileName);
46 31 }
47 32 }else{
48 33 $saveLogo = true;
... ... @@ -51,8 +36,8 @@ class Settings_Vtiger_CompanyDetailsSave_Action extends Settings_Vtiger_Basic_Ac
51 36 foreach ($fields as $fieldName => $fieldType) {
52 37 $fieldValue = $request->get($fieldName);
53 38 if ($fieldName === 'logoname') {
54   - if (!empty($logoDetails['name'])) {
55   - $fieldValue = ltrim(basename(" " . $logoDetails['name']));
  39 + if (!empty($logoDetails['name']) && $binFileName) {
  40 + $fieldValue = ltrim(basename(" " . $binFileName));
56 41 } else {
57 42 $fieldValue = $moduleModel->get($fieldName);
58 43 }
... ...
modules/Settings/Vtiger/models/CompanyDetails.php
... ... @@ -89,11 +89,13 @@ class Settings_Vtiger_CompanyDetails_Model extends Settings_Vtiger_Module_Model
89 89 /**
90 90 * Function to save the logoinfo
91 91 */
92   - public function saveLogo() {
93   - $uploadDir = vglobal('root_directory'). '/' .$this->logoPath;
94   - $logoName = $uploadDir.$_FILES["logo"]["name"];
95   - move_uploaded_file($_FILES["logo"]["tmp_name"], $logoName);
96   - copy($logoName, $uploadDir.'application.ico');
  92 + public function saveLogo($binFileName) {
  93 + if ($binFileName) {
  94 + $uploadDir = vglobal('root_directory'). '/' .$this->logoPath;
  95 + $logoName = $uploadDir.$binFileName;
  96 + move_uploaded_file($_FILES["logo"]["tmp_name"], $logoName);
  97 + copy($logoName, $uploadDir.'application.ico');
  98 + }
97 99 }
98 100  
99 101 /**
... ... @@ -165,4 +167,4 @@ class Settings_Vtiger_CompanyDetails_Model extends Settings_Vtiger_Module_Model
165 167 }
166 168 return self::$settings[$fieldname];
167 169 }
168   -}
169 170 \ No newline at end of file
  171 +}
... ...