diff --git a/forgotPassword.php b/forgotPassword.php index 2bcdf19e4a8481b45f2b7794e56e58fd2ff4b695..69a75ed13ae189da0a9203f2dc646480e6eb4b66 100644 --- a/forgotPassword.php +++ b/forgotPassword.php @@ -1,5 +1,4 @@ <?php - /* +********************************************************************************** * The contents of this file are subject to the vtiger CRM Public License Version 1.1 * ("License"); You may not use this file except in compliance with the License @@ -8,57 +7,64 @@ * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. * ********************************************************************************** */ + +require_once 'includes/main/WebUI.php'; require_once 'include/utils/utils.php'; require_once 'include/utils/VtlibUtils.php'; require_once 'modules/Emails/class.phpmailer.php'; require_once 'modules/Emails/mail.php'; require_once 'modules/Vtiger/helpers/ShortURL.php'; + global $adb; $adb = PearDatabase::getInstance(); -if (isset($_REQUEST['user_name']) && isset($_REQUEST['emailId'])) { - $username = vtlib_purify($_REQUEST['user_name']); - $result = $adb->pquery('select email1 from vtiger_users where user_name= ? ', array($username)); - if ($adb->num_rows($result) > 0) { - $email = $adb->query_result($result, 0, 'email1'); - } +if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) { + $username = vtlib_purify($_REQUEST['username']); + $result = $adb->pquery('select email1 from vtiger_users where user_name= ? ', array($username)); + if ($adb->num_rows($result) > 0) { + $email = $adb->query_result($result, 0, 'email1'); + } + + if (vtlib_purify($_REQUEST['emailId']) == $email) { + $time = time(); + $options = array( + 'handler_path' => 'modules/Users/handlers/ForgotPassword.php', + 'handler_class' => 'Users_ForgotPassword_Handler', + 'handler_function' => 'changePassword', + 'handler_data' => array( + 'username' => $username, + 'email' => $email, + 'time' => $time, + 'hash' => md5($username.$time) + ) + ); + $trackURL = Vtiger_ShortURL_Helper::generateURL($options); + $content = 'Dear Customer,<br><br> + You recently requested a password reset for your VtigerCRM Open source Account.<br> + To create a new password, click on the link <a target="_blank" href='.$trackURL.'>here</a>. + <br><br> + This request was made on '.date("Y-m-d H:i:s").' and will expire in next 24 hours.<br><br> + Regards,<br> + VtigerCRM Open source Support Team.<br>'; + $mail = new PHPMailer(); + $query = "select from_email_field,server_username from vtiger_systems where server_type=?"; + $params = array('email'); + $result = $adb->pquery($query, $params); + $from = $adb->query_result($result, 0, 'from_email_field'); + if ($from == '') { + $from = $adb->query_result($result, 0, 'server_username'); + } + $subject = 'Request : ForgotPassword - vtigercrm'; - if (vtlib_purify($_REQUEST['emailId']) == $email) { - $time = time(); - $options = array( - 'handler_path' => 'modules/Users/handlers/ForgotPassword.php', - 'handler_class' => 'Users_ForgotPassword_Handler', - 'handler_function' => 'changePassword', - 'handler_data' => array( - 'username' => $username, - 'email' => $email, - 'time' => $time, - 'hash' => md5($username . $time) - ) - ); - $trackURL = Vtiger_ShortURL_Helper::generateURL($options); - $content = 'Dear Customer,<br><br> - You recently requested a password reset for your VtigerCRM Open source Account.<br> - To create a new password, click on the link <a target="_blank" href=' . $trackURL . '>here</a>. - <br><br> - This request was made on ' . date("Y-m-d H:i:s") . ' and will expire in next 24 hours.<br><br> - Regards,<br> - VtigerCRM Open source Support Team.<br>' ; - $mail = new PHPMailer(); - $query = "select from_email_field,server_username from vtiger_systems where server_type=?"; - $params = array('email'); - $result = $adb->pquery($query,$params); - $from = $adb->query_result($result,0,'from_email_field'); - if($from == '') {$from =$adb->query_result($result,0,'server_username'); } - $subject='Request : ForgotPassword - vtigercrm'; - - setMailerProperties($mail,$subject, $content, $from, $username, $email); - $status = MailSend($mail); - if ($status === 1) - header('Location: index.php?modules=Users&view=Login&status=1'); - else - header('Location: index.php?modules=Users&view=Login&statusError=1'); - } else { - header('Location: index.php?modules=Users&view=Login&fpError=1'); - } + setMailerProperties($mail, $subject, $content, $from, $username, $email); + $status = MailSend($mail); + var_dump($status); + if ($status === 1) { + header('Location: index.php?modules=Users&view=Login&mailStatus=success'); + } else { + header('Location: index.php?modules=Users&view=Login&error=statusError'); + } + } else { + header('Location: index.php?modules=Users&view=Login&error=fpError'); + } } \ No newline at end of file diff --git a/includes/runtime/LanguageHandler.php b/includes/runtime/LanguageHandler.php index eb53dfa8684585f9a8440d97b5af2f436616f8eb..6af2e4b56e6e2c4835fbfbcef4877c4c44d799bb 100644 --- a/includes/runtime/LanguageHandler.php +++ b/includes/runtime/LanguageHandler.php @@ -207,7 +207,6 @@ class Vtiger_Language_Handler { } return $resultantLanguageString; - ; } /** diff --git a/layouts/v7/modules/Reports/ScheduleReport.tpl b/layouts/v7/modules/Reports/ScheduleReport.tpl index fb231588b1442a4d43721dc7228099edd18e7ed5..fbf5be99ab335cb8c80f2518445c10c712cc9d2f 100644 --- a/layouts/v7/modules/Reports/ScheduleReport.tpl +++ b/layouts/v7/modules/Reports/ScheduleReport.tpl @@ -104,8 +104,8 @@ </div> <div class='col-lg-2' id='schtime'> <div class='input-group inputElement time'> - <input type='text' class='timepicker-default form-control ui-timepicker-input' data-format='{$CURRENT_USER->get('hour_format')}' name='schtime' value="{$SCHEDULEDREPORTS->get('schtime')}" data-rule-required="true" /> - <span class="input-group-addon"><i class="fa fa-clock-o"></i></span> + <input type='text' class='timepicker-default form-control ui-timepicker-input' data-format='{$CURRENT_USER->get('hour_format')}' name='schtime' value="{$SCHEDULEDREPORTS->get('schtime')}" data-rule-required="true" data-rule-time="true" /> + <span class="input-group-addon"><i class="fa fa-clock-o"></i></span> </div> </div> </div> diff --git a/layouts/v7/modules/Users/DetailViewBlockView.tpl b/layouts/v7/modules/Users/DetailViewBlockView.tpl index 04dcd8e1fe53939cb596feca7107fe8771a9c86b..b446c540dc06f34c64b69ad6ff24b1101c28fa3f 100644 --- a/layouts/v7/modules/Users/DetailViewBlockView.tpl +++ b/layouts/v7/modules/Users/DetailViewBlockView.tpl @@ -1,143 +1,141 @@ -{*<!-- -/********************************************************************************* -** The contents of this file are subject to the vtiger CRM Public License Version 1.0 +{*+********************************************************************************** +* The contents of this file are subject to the vtiger CRM Public License Version 1.1 * ("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} - <input type=hidden name="timeFormatOptions" data-value='{$DAY_STARTS}' /> - {foreach key=BLOCK_LABEL_KEY item=FIELD_MODEL_LIST from=$RECORD_STRUCTURE} - {if $BLOCK_LABEL_KEY neq 'LBL_CALENDAR_SETTINGS'} - <div class="block block_{$BLOCK_LABEL_KEY}"> - {assign var=BLOCK value=$BLOCK_LIST[$BLOCK_LABEL_KEY]} - {if $BLOCK eq null or $FIELD_MODEL_LIST|@count lte 0}{continue}{/if} - {assign var=IS_HIDDEN value=$BLOCK->isHidden()} - {assign var=WIDTHTYPE value=$USER_MODEL->get('rowheight')} - <div> - <h4>{vtranslate({$BLOCK_LABEL_KEY},{$MODULE_NAME})}</h4> - </div> - <hr> - <div class="blockData"> - <table class="table detailview-table no-border"> - <tbody> - {assign var=COUNTER value=0} - <tr> - {foreach item=FIELD_MODEL key=FIELD_NAME from=$FIELD_MODEL_LIST} - {assign var=fieldDataType value=$FIELD_MODEL->getFieldDataType()} - {if !$FIELD_MODEL->isViewableInDetailView()} - {continue} - {/if} - {if $FIELD_MODEL->getName() eq 'theme' or $FIELD_MODEL->getName() eq 'rowheight'} - {continue} - {/if} - {if $FIELD_MODEL->get('uitype') eq "83"} - {foreach item=tax key=count from=$TAXCLASS_DETAILS} - {if $COUNTER eq 2} - </tr><tr> - {assign var="COUNTER" value=1} - {else} - {assign var="COUNTER" value=$COUNTER+1} - {/if} - <td class="fieldLabel {$WIDTHTYPE}"> - <span class='muted'>{vtranslate($tax.taxlabel, $MODULE)}(%)</span> - </td> - <td class="fieldValue {$WIDTHTYPE}"> - <span class="value textOverflowEllipsis" data-field-type="{$FIELD_MODEL->getFieldDataType()}" > - {if $tax.check_value eq 1} - {$tax.percentage} - {else} - 0 - {/if} - </span> - </td> - {/foreach} - {else if $FIELD_MODEL->get('uitype') eq "69" || $FIELD_MODEL->get('uitype') eq "105"} - {if $COUNTER neq 0} - {if $COUNTER eq 2} - </tr><tr> - {assign var=COUNTER value=0} - {/if} - {/if} - <td class="fieldLabel {$WIDTHTYPE}"><span class="muted">{vtranslate({$FIELD_MODEL->get('label')},{$MODULE_NAME})}</span></td> - <td class="fieldValue {$WIDTHTYPE}"> - <div id="imageContainer" width="300" height="200"> - {foreach key=ITER item=IMAGE_INFO from=$IMAGE_DETAILS} - {if !empty($IMAGE_INFO.path) && !empty({$IMAGE_INFO.orgname})} - <img src="{$IMAGE_INFO.path}_{$IMAGE_INFO.orgname}" width="300" height="200"> - {/if} - {/foreach} - </div> - </td> - {assign var=COUNTER value=$COUNTER+1} - {else} - {if $FIELD_MODEL->get('uitype') eq "20" or $FIELD_MODEL->get('uitype') eq "19" or $fieldDataType eq 'reminder' or $fieldDataType eq 'recurrence'} - {if $COUNTER eq '1'} - <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td></tr><tr> - {assign var=COUNTER value=0} - {/if} - {/if} - {if $COUNTER eq 2} - </tr><tr> - {assign var=COUNTER value=1} - {else} - {assign var=COUNTER value=$COUNTER+1} - {/if} - <td class="fieldLabel {$WIDTHTYPE} textOverflowEllipsis" id="{$MODULE_NAME}_detailView_fieldLabel_{$FIELD_MODEL->getName()}" {if $FIELD_MODEL->getName() eq 'description' or $FIELD_MODEL->get('uitype') eq '69'} style='width:8%'{/if}> - <span class="muted"> - {if $MODULE_NAME eq 'Documents' && $FIELD_MODEL->get('label') eq "File Name" && $RECORD->get('filelocationtype') eq 'E'} - {vtranslate("LBL_FILE_URL",{$MODULE_NAME})} - {else} - {vtranslate({$FIELD_MODEL->get('label')},{$MODULE_NAME})} - {/if} - {if ($FIELD_MODEL->get('uitype') eq '72') && ($FIELD_MODEL->getName() eq 'unit_price')} - ({$BASE_CURRENCY_SYMBOL}) - {/if} - </span> - </td> - <td class="fieldValue {$WIDTHTYPE}" id="{$MODULE_NAME}_detailView_fieldValue_{$FIELD_MODEL->getName()}" {if $FIELD_MODEL->get('uitype') eq '19' or $FIELD_MODEL->get('uitype') eq '20' or $fieldDataType eq 'reminder' or $fieldDataType eq 'recurrence'} colspan="3" {assign var=COUNTER value=$COUNTER+1} {/if}> + <input type=hidden name="timeFormatOptions" data-value='{$DAY_STARTS}' /> + {foreach key=BLOCK_LABEL_KEY item=FIELD_MODEL_LIST from=$RECORD_STRUCTURE} + {if $BLOCK_LABEL_KEY neq 'LBL_CALENDAR_SETTINGS'} + {assign var=BLOCK value=$BLOCK_LIST[$BLOCK_LABEL_KEY]} + {if $BLOCK eq null or $FIELD_MODEL_LIST|@count lte 0}{continue}{/if} + <div class="block block_{$BLOCK_LABEL_KEY}"> + {assign var=IS_HIDDEN value=$BLOCK->isHidden()} + {assign var=WIDTHTYPE value=$USER_MODEL->get('rowheight')} + <div> + <h4>{vtranslate({$BLOCK_LABEL_KEY},{$MODULE_NAME})}</h4> + </div> + <hr> + <div class="blockData"> + <table class="table detailview-table no-border"> + <tbody> + {assign var=COUNTER value=0} + <tr> + {foreach item=FIELD_MODEL key=FIELD_NAME from=$FIELD_MODEL_LIST} + {assign var=fieldDataType value=$FIELD_MODEL->getFieldDataType()} + {if !$FIELD_MODEL->isViewableInDetailView()} + {continue} + {/if} + {if $FIELD_MODEL->getName() eq 'theme' or $FIELD_MODEL->getName() eq 'rowheight'} + {continue} + {/if} + {if $FIELD_MODEL->get('uitype') eq "83"} + {foreach item=tax key=count from=$TAXCLASS_DETAILS} + {if $COUNTER eq 2} + </tr><tr> + {assign var="COUNTER" value=1} + {else} + {assign var="COUNTER" value=$COUNTER+1} + {/if} + <td class="fieldLabel {$WIDTHTYPE}"> + <span class='muted'>{vtranslate($tax.taxlabel, $MODULE)}(%)</span> + </td> + <td class="fieldValue {$WIDTHTYPE}"> + <span class="value textOverflowEllipsis" data-field-type="{$FIELD_MODEL->getFieldDataType()}" > + {if $tax.check_value eq 1} + {$tax.percentage} + {else} + 0 + {/if} + </span> + </td> + {/foreach} + {else if $FIELD_MODEL->get('uitype') eq "69" || $FIELD_MODEL->get('uitype') eq "105"} + {if $COUNTER neq 0} + {if $COUNTER eq 2} + </tr><tr> + {assign var=COUNTER value=0} + {/if} + {/if} + <td class="fieldLabel {$WIDTHTYPE}"><span class="muted">{vtranslate({$FIELD_MODEL->get('label')},{$MODULE_NAME})}</span></td> + <td class="fieldValue {$WIDTHTYPE}"> + <div id="imageContainer" width="300" height="200"> + {foreach key=ITER item=IMAGE_INFO from=$IMAGE_DETAILS} + {if !empty($IMAGE_INFO.path) && !empty({$IMAGE_INFO.orgname})} + <img src="{$IMAGE_INFO.path}_{$IMAGE_INFO.orgname}" width="300" height="200"> + {/if} + {/foreach} + </div> + </td> + {assign var=COUNTER value=$COUNTER+1} + {else} + {if $FIELD_MODEL->get('uitype') eq "20" or $FIELD_MODEL->get('uitype') eq "19" or $fieldDataType eq 'reminder' or $fieldDataType eq 'recurrence'} + {if $COUNTER eq '1'} + <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td></tr><tr> + {assign var=COUNTER value=0} + {/if} + {/if} + {if $COUNTER eq 2} + </tr><tr> + {assign var=COUNTER value=1} + {else} + {assign var=COUNTER value=$COUNTER+1} + {/if} + <td class="fieldLabel {$WIDTHTYPE} textOverflowEllipsis" id="{$MODULE_NAME}_detailView_fieldLabel_{$FIELD_MODEL->getName()}" {if $FIELD_MODEL->getName() eq 'description' or $FIELD_MODEL->get('uitype') eq '69'} style='width:8%'{/if}> + <span class="muted"> + {if $MODULE_NAME eq 'Documents' && $FIELD_MODEL->get('label') eq "File Name" && $RECORD->get('filelocationtype') eq 'E'} + {vtranslate("LBL_FILE_URL",{$MODULE_NAME})} + {else} + {vtranslate({$FIELD_MODEL->get('label')},{$MODULE_NAME})} + {/if} + {if ($FIELD_MODEL->get('uitype') eq '72') && ($FIELD_MODEL->getName() eq 'unit_price')} + ({$BASE_CURRENCY_SYMBOL}) + {/if} + </span> + </td> + <td class="fieldValue {$WIDTHTYPE}" id="{$MODULE_NAME}_detailView_fieldValue_{$FIELD_MODEL->getName()}" {if $FIELD_MODEL->get('uitype') eq '19' or $FIELD_MODEL->get('uitype') eq '20' or $fieldDataType eq 'reminder' or $fieldDataType eq 'recurrence'} colspan="3" {assign var=COUNTER value=$COUNTER+1} {/if}> - {assign var=FIELD_VALUE value=$FIELD_MODEL->get('fieldvalue')} - {if $fieldDataType eq 'multipicklist'} - {assign var=FIELD_DISPLAY_VALUE value=$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'))} - {else} - {assign var=FIELD_DISPLAY_VALUE value=Vtiger_Util_Helper::toSafeHTML($FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue')))} - {/if} + {assign var=FIELD_VALUE value=$FIELD_MODEL->get('fieldvalue')} + {if $fieldDataType eq 'multipicklist'} + {assign var=FIELD_DISPLAY_VALUE value=$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'))} + {else} + {assign var=FIELD_DISPLAY_VALUE value=Vtiger_Util_Helper::toSafeHTML($FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue')))} + {/if} - <span class="value textOverflowEllipsis" data-field-type="{$FIELD_MODEL->getFieldDataType()}" {if $FIELD_MODEL->get('uitype') eq '19' or $FIELD_MODEL->get('uitype') eq '20' or $FIELD_MODEL->get('uitype') eq '21'} style="white-space:normal;" {/if} {if $fieldDataType eq 'email'}title='{$FIELD_MODEL->get('fieldvalue')}'{/if} > - {include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getDetailViewTemplateName(),$MODULE_NAME) FIELD_MODEL=$FIELD_MODEL USER_MODEL=$USER_MODEL MODULE=$MODULE_NAME RECORD=$RECORD} - </span> - {if $IS_AJAX_ENABLED && $FIELD_MODEL->isEditable() eq 'true' && $FIELD_MODEL->isAjaxEditable() eq 'true'} - <span class="hide edit pull-left"> - {if $fieldDataType eq 'multipicklist'} - <input type="hidden" class="fieldBasicData" data-name='{$FIELD_MODEL->get('name')}[]' data-type="{$fieldDataType}" data-displayvalue='{$FIELD_DISPLAY_VALUE}' data-value="{$FIELD_VALUE}" /> - {else} - <input type="hidden" class="fieldBasicData" data-name='{$FIELD_MODEL->get('name')}' data-type="{$fieldDataType}" data-displayvalue='{$FIELD_DISPLAY_VALUE}' data-value="{$FIELD_VALUE}" /> - {/if} - </span> - <span class="action pull-right"><a href="#" onclick="return false;" class="editAction fa fa-pencil"></a></span> - {/if} - </td> - {/if} + <span class="value textOverflowEllipsis" data-field-type="{$FIELD_MODEL->getFieldDataType()}" {if $FIELD_MODEL->get('uitype') eq '19' or $FIELD_MODEL->get('uitype') eq '20' or $FIELD_MODEL->get('uitype') eq '21'} style="white-space:normal;" {/if} {if $fieldDataType eq 'email'}title='{$FIELD_MODEL->get('fieldvalue')}'{/if} > + {include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getDetailViewTemplateName(),$MODULE_NAME) FIELD_MODEL=$FIELD_MODEL USER_MODEL=$USER_MODEL MODULE=$MODULE_NAME RECORD=$RECORD} + </span> + {if $IS_AJAX_ENABLED && $FIELD_MODEL->isEditable() eq 'true' && $FIELD_MODEL->isAjaxEditable() eq 'true'} + <span class="hide edit pull-left"> + {if $fieldDataType eq 'multipicklist'} + <input type="hidden" class="fieldBasicData" data-name='{$FIELD_MODEL->get('name')}[]' data-type="{$fieldDataType}" data-displayvalue='{$FIELD_DISPLAY_VALUE}' data-value="{$FIELD_VALUE}" /> + {else} + <input type="hidden" class="fieldBasicData" data-name='{$FIELD_MODEL->get('name')}' data-type="{$fieldDataType}" data-displayvalue='{$FIELD_DISPLAY_VALUE}' data-value="{$FIELD_VALUE}" /> + {/if} + </span> + <span class="action pull-right"><a href="#" onclick="return false;" class="editAction fa fa-pencil"></a></span> + {/if} + </td> + {/if} - {if $FIELD_MODEL_LIST|@count eq 1 and $FIELD_MODEL->get('uitype') neq "19" and $FIELD_MODEL->get('uitype') neq "20" and $FIELD_MODEL->get('uitype') neq "30" and $FIELD_MODEL->get('name') neq "recurringtype" and $FIELD_MODEL->get('uitype') neq "69" and $FIELD_MODEL->get('uitype') neq "105"} - <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td> - {/if} - {/foreach} - {* adding additional column for odd number of fields in a block *} - {if $FIELD_MODEL_LIST|@end eq true and $FIELD_MODEL_LIST|@count neq 1 and $COUNTER eq 1} - <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td> - {/if} - </tr> - </tbody> - </table> - </div> - </div> - <br> - {/if} -{/foreach} + {if $FIELD_MODEL_LIST|@count eq 1 and $FIELD_MODEL->get('uitype') neq "19" and $FIELD_MODEL->get('uitype') neq "20" and $FIELD_MODEL->get('uitype') neq "30" and $FIELD_MODEL->get('name') neq "recurringtype" and $FIELD_MODEL->get('uitype') neq "69" and $FIELD_MODEL->get('uitype') neq "105"} + <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td> + {/if} + {/foreach} + {* adding additional column for odd number of fields in a block *} + {if $FIELD_MODEL_LIST|@end eq true and $FIELD_MODEL_LIST|@count neq 1 and $COUNTER eq 1} + <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td> + {/if} + </tr> + </tbody> + </table> + </div> + </div> + <br> + {/if} + {/foreach} {/strip} \ No newline at end of file diff --git a/layouts/v7/modules/Users/Login.tpl b/layouts/v7/modules/Users/Login.tpl index 50c5d7278f227127dc603a8c0f866f775332ab81..d15f4f9b16ee9fc82cc32afb72dac87070756c5a 100644 --- a/layouts/v7/modules/Users/Login.tpl +++ b/layouts/v7/modules/Users/Login.tpl @@ -9,191 +9,360 @@ {* modules/Users/views/Login.php *} {strip} -<!DOCTYPE html> -<html> - <head> - <title>Vtiger login page</title> + <style> + .container { + width: 380px; + height: 420px; + margin: 0 auto; + } + .loginDiv { + border-radius: 4px; + box-shadow: 0 0 10px gray; + background-color: #FFFFFF; + } + .inActiveImgDiv { + padding: 5px; + text-align: center; + margin: 30px 0px; + } + .user-logo { + height: 110px; + margin: 0 auto; + padding-top: 40px; + padding-bottom: 20px; + } + .failureMessage { + color: red; + display: block; + text-align: center; + padding: 0px 0px 10px; + } + .successMessage { + color: green; + display: block; + text-align: center; + padding: 0px 0px 10px; + } + .app-footer p { + margin-top: 0px; + padding-bottom: 0px !important; + } + .footer { + background-color: #fbfbfb; + height:26px; + } + .marketingDiv { + padding-right: 100px; + color: white; + } + .blockLink { + border: 1px solid white; + padding: 3px 5px; + } + #page { + padding-top: 100px; + } + body { + background: url(layouts/v7/resources/Images/login-background.jpg); + background-position: center; + background-size: cover; + width: 100%; + height: 100%; + background-repeat: no-repeat; + } + h3 { + margin-top: 10px; + } + h4 { + margin-top: 0px; + } + //New + hgroup { + text-align:center; + margin-top: 4em; + } + .group { + position: relative; + margin: 10px 10px 40px; + } + input { + font-size: 16px; + padding: 10px 10px 10px 0px; + -webkit-appearance: none; + display: block; + color: #636363; + width: 100%; + border: none; + border-radius: 0; + border-bottom: 1px solid #757575; + } + input:focus { + outline: none; + } + label { + font-size: 16px; + font-weight: normal; + position: absolute; + pointer-events: none; + left: 0px; + top: 10px; + transition: all 0.2s ease; + } + input:focus ~ label, input.used ~ label { + top: -20px; + transform: scale(.75); + left: -12px; + font-size: 18px; + } + .bar { + position: relative; + display: block; + width: 100%; + } + .bar:before, .bar:after { + content: ''; + width: 0; + bottom: 1px; + position: absolute; + height: 1px; + background: #35aa47; + transition: all 0.2s ease; + } + .bar:before { + left: 50%; + } + .bar:after { + right: 50%; + } + input:focus ~ .bar:before, input:focus ~ .bar:after { + width: 50%; + } + .button { + position: relative; + display: inline-block; + padding: 9px; + margin: .3em 0 1em 0; + width: 100%; + vertical-align: middle; + color: #fff; + font-size: 16px; + line-height: 20px; + -webkit-font-smoothing: antialiased; + text-align: center; + letter-spacing: 1px; + background: transparent; + border: 0; + cursor: pointer; + transition: all 0.15s ease; + } + .button:focus { + outline: 0; + } + .buttonBlue { + background-image: linear-gradient(to bottom, #35aa47 0px, #35aa47 100%) + } + .ripples { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + overflow: hidden; + background: transparent; + } - <style> - .login-logo{ - width: 233px; - margin: 0 auto; + //Animations + @keyframes inputHighlighter { + from { + background: #4a89dc; } - .header h1, .header h4{ - text-align: center; + to { + width: 0; + background: transparent; } - .login-form{ - width: 350px; - margin: 0 auto; - background-color: #F1F1F1; + } + @keyframes ripples { + 0% { + opacity: 0; } - .user-logo{ - width: 100px; - margin: 0 auto; - padding-top: 40px; - padding-bottom: 30px; + 25% { + opacity: 1; } - .form-control{ - background-color:white !important; - width: 200px; - margin: 0 auto; - margin-top: -15px; + 100% { + width: 200%; + padding-bottom: 200%; + opacity: 0; } - .form-group .login-submit-btn{ - width: 200px; - margin: 0 auto; - display: block; - margin-top: 10px; - } - .forgot-password-link { - width: 200px; - margin: 0 auto; - display: block; - } - #forgot-password #username{ - background-color:white !important; - width: 200px; - height:35px; - margin: 0 auto; - display: block; - margin-top: 30px; - } - #forgot-password #email{ - background-color:white !important; - width: 200px; - height:35px; - margin: 0 auto; - display: block; - margin-top: -15px; - margin-bottom: 20px; - } - - .form-group .forgot-submit-btn{ - width: 200px; - margin: 0 auto; - display: block; - margin-top: 20px; - } - #failure-message { - width: 200px; - margin: 0 auto; - display: block; - color: red; - } - .app-footer p { - margin-top: 0px; - } - #page { - padding-top: 55px; - } - </style> - </head> + } + </style> - <body> - <div class="header"> - <div class="login-logo"><img src='layouts/v7/resources/Images/vtiger.jpg'/></div> - <div><h1>One account. All of Vtiger.</h1></div> - <div><h4>Sign in to continue to Vtiger</h4></div> - </div> - <div class="body"> - <div class="container login-form" id="login-form-div"> + <span class="app-nav"></span> + <div class="col-lg-12"> + <div class="col-lg-6"> + <div class="container loginDiv"> + <img class="img-responsive user-logo" src="layouts/v7/resources/Images/vtiger.png"> + <div> + <span class="{if !$ERROR}hide{/if} failureMessage" id="validationMessage">{$MESSAGE}</span> + <span class="{if !$MAIL_STATUS}hide{/if} successMessage">{$MESSAGE}</span> + </div> - <img class="img-circle img-responsive user-logo" src='layouts/v7/resources/Images/user.png'> + <div id="loginFormDiv"> + <form class="form-horizontal" method="POST" action="index.php"> + <input type="hidden" name="module" value="Users"/> + <input type="hidden" name="action" value="Login"/> + <div class="group"> + <input id="username" type="text" name="username" placeholder="Username" value=""> + <span class="bar"></span> + <label>Username</label> + </div> + <div class="group"> + <input id="password" type="password" name="password" placeholder="Password" value=""> + <span class="bar"></span> + <label>Password</label> + </div> + <div class="group"> + <button type="submit" class="button buttonBlue">Sign in</button><br> + <a class="forgotPasswordLink" style="color: #15c;">forgot password?</a> + </div> + </form> + </div> - <form class="form-horizontal" method="POST" action="index.php"> - <input type="hidden" name="module" value="Users"/> - <input type="hidden" name="action" value="Login"/> - <div class="form-group"> - <input class="form-control" id="username" type="text" name="username" placeholder="Username" value="admin"> - </div> - <div class="form-group"> - <input class="form-control" id="password" type="password" name="password" placeholder="Password" value="admin"> - </div> - <div class="form-group"> - <button type="submit" class="btn btn-primary login-submit-btn">Sign in</button> - </div> - <div class="form-group"> - <label class="{if !$smarty.request.error}hide{/if}" id='failure-message'>Invalid credentials</label> - </div> - <div class="form-group"> - <a class="forgot-password-link">forgot password?</a> - </div> - </form> + <div id="forgotPasswordDiv" class="hide"> + <form class="form-horizontal" action="forgotPassword.php" method="POST"> + <div class="group"> + <input id="username" type="text" name="username" placeholder="Username" > + <span class="bar"></span> + <label>Username</label> + </div> + <div class="group"> + <input id="email" type="email" name="emailId" placeholder="Email" > + <span class="bar"></span> + <label>Email</label> + </div> + <div class="group"> + <button type="submit" class="button buttonBlue forgot-submit-btn">Submit</button><br> + <span>Please enter details and submit<a class="forgotPasswordLink pull-right" style="color: #15c;">Back</a></span> + </div> + </form> + </div> </div> - <div class ="container login-form hide" id="forgot-password"> - <form class="form-horizontal" action="forgotPassword.php" method="POST"> - <div class="form-group"> - <input class="forgot-password" type="text" id="username" name="username" placeholder="Username"> - </div> - <div class="form-group"> - <input class="forgot-password" type="email" id="email" name="email" placeholder="email"> - </div> - <div class="form-group"> - <button type="submit" class="btn btn-primary forgot-submit-btn" name="retrievePassword">Submit</button> - </div> - <div class="form-group"> - <label class="hide" id='failure-message'></label> - </div> - </form> + </div> + <div class="col-lg-6"> + <div class="marketingDiv"> + {if $JSON_DATA} + {foreach key=BLOCK_NAME item=BLOCK_DATA from=$JSON_DATA} + <div> + <h3><b>{$BLOCK_DATA.heading}</b></h3> + <div class="row"> + {if $BLOCK_DATA.image_url} + <div class="col-lg-3" style="min-height: 100px;"><img src="{$BLOCK_DATA.image_url}" style="width: 100%;height: 100%;"/></div> + <div class="col-lg-9" title="{$BLOCK_DATA.summary}"> + {else} + <div class="col-lg-12" title="{$BLOCK_DATA.summary}"> + {/if} + <h4>{$BLOCK_DATA.displayTitle}</h4> + {$BLOCK_DATA.displaySummary}<br><br> + <span class="blockLink"> + <a href="{$BLOCK_DATA.link}" target="_blank">{$BLOCK_DATA.link_text}</a> + </span> + </div> + </div> + </div> + <br> + {/foreach} + {else} + <div class="inActiveImgDiv"> + <div> + <h4>Get more out of Vtiger with extensions from</h4> + <h4>Vtiger Marketplace</h4> + </div> + <a href="https://marketplace.vtiger.com/app/listings" target="_blank" style="margin-right: 25px;"><img src="layouts/v7/resources/Images/extensionstore.png" style="width: 85%; height: 100%; margin-top: 25px;"/></a> + </div> + {/if} + </div> </div> </div> - <div class="footer"> - {include file="Footer.tpl"|vtemplate_path:$MODULE} - </div> - </body> - <script> - jQuery(document).ready(function () { - jQuery('#login-form-div #username').focus(); - jQuery("#login-form-div a").click(function () { - jQuery("#login-form-div").toggleClass('hide'); - jQuery("#forgot-password").toggleClass('hide'); - }); - jQuery(".forgot-password input").click(function () { - jQuery("#forgot-password label").hide(); - }); + <script> + jQuery(document).ready(function () { + var validationMessage = jQuery('#validationMessage'); + var forgotPasswordDiv = jQuery('#forgotPasswordDiv'); - jQuery("#login-form-div button").on("click", function () { - var username = jQuery('#login-form-div #username').val(); - var password = jQuery('#password').val(); - if (username === '') { - jQuery("#login-form-div label").text('Please enter valid username'); - jQuery("#login-form-div label").removeClass('hide'); - return false; - } else if (password === '') { - jQuery("#login-form-div label").text('Pleeease enter valid password'); - jQuery("#login-form-div label").removeClass('hide'); - return false; - } else { - return true; - } - }); + var loginFormDiv = jQuery('#loginFormDiv'); + loginFormDiv.find('#username').focus(); + + loginFormDiv.find('a').click(function () { + loginFormDiv.toggleClass('hide'); + forgotPasswordDiv.toggleClass('hide'); + validationMessage.addClass('hide'); + }); + + forgotPasswordDiv.find('a').click(function () { + loginFormDiv.toggleClass('hide'); + forgotPasswordDiv.toggleClass('hide'); + validationMessage.addClass('hide'); + }); + + loginFormDiv.find('button').on('click', function () { + var username = loginFormDiv.find('#username').val(); + var password = jQuery('#password').val(); + var result = true; + var errorMessage = ''; + if (username === '') { + errorMessage = 'Please enter valid username'; + result = false; + } else if (password === '') { + errorMessage = 'Please enter valid password'; + result = false; + } + if (errorMessage) { + validationMessage.removeClass('hide').text(errorMessage); + } + return result; + }); + + forgotPasswordDiv.find('button').on('click', function () { + var username = jQuery('#forgotPasswordDiv #username').val(); + var email = jQuery('#email').val(); + + var email1 = email.replace(/^\s+/, '').replace(/\s+$/, ''); + var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/; + var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/; - jQuery("#forgot-password button").on("click", function () { - var username = jQuery('#forgot-password #username').val(); - var email = jQuery('#email').val(); + var result = true; + var errorMessage = ''; + if (username === '') { + errorMessage = 'Please enter valid username'; + result = false; + } else if (!emailFilter.test(email1) || email == '') { + errorMessage = 'Please enter valid email address'; + result = false; + } else if (email.match(illegalChars)) { + errorMessage = 'The email address contains illegal characters.'; + result = false; + } + if (errorMessage) { + validationMessage.removeClass('hide').text(errorMessage); + } + return result; + }); + jQuery('input').blur(function (e) { + var currentElement = jQuery(e.currentTarget); + if (currentElement.val()) { + currentElement.addClass('used'); + } else { + currentElement.removeClass('used'); + } + }); - var email1 = email.replace(/^\s+/, '').replace(/\s+$/, ''); - var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/; - var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/; + var ripples = jQuery('.ripples'); + ripples.on('click.Ripples', function (e) { + jQuery(e.currentTarget).addClass('is-active'); + }); - if (username === '') { - jQuery("#forgot-password label").text('Please enter valid username'); - jQuery("#forgot-password label").removeClass('hide'); - return false; - } else if (!emailFilter.test(email1) || email == '') { - jQuery("#forgot-password label").text('Please enter valid email address'); - jQuery("#forgot-password label").removeClass('hide'); - return false; - } else if (email.match(illegalChars)) { - jQuery("#forgot-password label").text('The email address contains illegal characters.'); - jQuery("#forgot-password label").removeClass('hide'); - return false; - } else { - return true; - } + ripples.on('animationend webkitAnimationEnd mozAnimationEnd oanimationend MSAnimationEnd', function (e) { + jQuery(e.currentTarget).removeClass('is-active'); + }); }); - }); - </script> -</html> -{/strip} \ No newline at end of file + </script> + {/strip} \ No newline at end of file diff --git a/layouts/v7/modules/Users/resources/Detail.js b/layouts/v7/modules/Users/resources/Detail.js index 535b05b5dd977f9983e1cd6cffa769b173ae079f..402d8c0e16a5c3a3dbae9fcc6c4f8a333654b301 100644 --- a/layouts/v7/modules/Users/resources/Detail.js +++ b/layouts/v7/modules/Users/resources/Detail.js @@ -236,7 +236,7 @@ Vtiger_Detail_Js("Users_Detail_Js",{ }, validateDigitSeparators: function (e, params) { var fieldNamesToValidate = ['currency_decimal_separator', 'currency_grouping_separator']; - var fieldInfo = params.tiggeredFiledInfo; + var fieldInfo = params.triggeredFieldInfo; if (jQuery.inArray(fieldInfo.field, fieldNamesToValidate) === -1) { return true; diff --git a/layouts/v7/modules/Users/resources/PreferenceEdit.js b/layouts/v7/modules/Users/resources/PreferenceEdit.js index 7800975b64372f3cbd4ad2b613f8c2f7a6d8cf63..8b4a0a95891bc27e1a82babe34aabbe69d734c57 100644 --- a/layouts/v7/modules/Users/resources/PreferenceEdit.js +++ b/layouts/v7/modules/Users/resources/PreferenceEdit.js @@ -19,15 +19,10 @@ Users_Edit_Js("Settings_Users_PreferenceEdit_Js",{ var selectedValue = element.val(); var groupingSeperatorValue = jQuery('[name="currency_grouping_separator"]',form).data('selectedValue'); if(groupingSeperatorValue == selectedValue){ - var message = app.vtranslate('JS_DECIMAL_SEPERATOR_AND_GROUPING_SEPERATOR_CANT_BE_SAME'); - app.helper.showErrorNotification({ - 'message': message - }); + app.helper.showErrorNotification({'message': app.vtranslate('JS_DECIMAL_SEPERATOR_AND_GROUPING_SEPERATOR_CANT_BE_SAME')}); var previousSelectedValue = element.data('selectedValue'); - element.find('option').removeAttr('selected'); - element.find('option[value="'+previousSelectedValue+'"]').attr('selected','selected'); - element.trigger("liszt:updated"); - }else{ + element.select2('val', previousSelectedValue); + } else { element.data('selectedValue',selectedValue); } }) @@ -36,42 +31,37 @@ Users_Edit_Js("Settings_Users_PreferenceEdit_Js",{ var selectedValue = element.val(); var decimalSeperatorValue = jQuery('[name="currency_decimal_separator"]',form).data('selectedValue'); if(decimalSeperatorValue == selectedValue){ - var message = app.vtranslate('JS_DECIMAL_SEPERATOR_AND_GROUPING_SEPERATOR_CANT_BE_SAME'); - app.helper.showErrorNotification({ - 'message': message - }); + app.helper.showErrorNotification({'message': app.vtranslate('JS_DECIMAL_SEPERATOR_AND_GROUPING_SEPERATOR_CANT_BE_SAME')}); var previousSelectedValue = element.data('selectedValue'); - element.find('option').removeAttr('selected'); - element.find('option[value="'+previousSelectedValue+'"]').attr('selected','selected'); - element.trigger("liszt:updated"); - }else{ + element.select2('val', previousSelectedValue); + } else { element.data('selectedValue',selectedValue); } }) }, - - registerNameFieldChangeEvent : function() { - var form = jQuery('form'); - var specialChars = /[<\>\"\,]/; - jQuery('[name="first_name"]',form).on('change',function(e){ - var firstNameEle = jQuery(e.currentTarget); - var firstName = firstNameEle.val(); - var firstNameOldVal = firstNameEle.parent().find('.fieldname').data('prev-value'); - if(specialChars.test(firstName)) { - Vtiger_Helper_Js.showPnotify(app.vtranslate('JS_COMMA_NOT_ALLOWED_USERS')); - firstNameEle.val(firstNameOldVal); - } - }); - jQuery('[name="last_name"]',form).on('change',function(e){ - var lastNameEle = jQuery(e.currentTarget); - var lastName = lastNameEle.val(); - var lastNameOldVal = lastNameEle.parent().find('.fieldname').data('prev-value'); - if(specialChars.test(lastName)) { - Vtiger_Helper_Js.showPnotify(app.vtranslate('JS_COMMA_NOT_ALLOWED_USERS')); - lastNameEle.val(lastNameOldVal); - } - }); - } + + registerNameFieldChangeEvent : function() { + var form = jQuery('form'); + var specialChars = /[<\>\"\,]/; + jQuery('[name="first_name"]',form).on('change',function(e){ + var firstNameEle = jQuery(e.currentTarget); + var firstName = firstNameEle.val(); + var firstNameOldVal = firstNameEle.parent().find('.fieldname').data('prev-value'); + if(specialChars.test(firstName)) { + Vtiger_Helper_Js.showPnotify(app.vtranslate('JS_COMMA_NOT_ALLOWED_USERS')); + firstNameEle.val(firstNameOldVal); + } + }); + jQuery('[name="last_name"]',form).on('change',function(e){ + var lastNameEle = jQuery(e.currentTarget); + var lastName = lastNameEle.val(); + var lastNameOldVal = lastNameEle.parent().find('.fieldname').data('prev-value'); + if(specialChars.test(lastName)) { + Vtiger_Helper_Js.showPnotify(app.vtranslate('JS_COMMA_NOT_ALLOWED_USERS')); + lastNameEle.val(lastNameOldVal); + } + }); + } },{ registerNameFieldChangeEvent: function () { diff --git a/layouts/v7/modules/Vtiger/DetailViewBlockView.tpl b/layouts/v7/modules/Vtiger/DetailViewBlockView.tpl index 6dd13823f38aa57d0da8f82df3229090847a31d4..29afce2b45acd1c1c44f76f404bf123a889a9243 100644 --- a/layouts/v7/modules/Vtiger/DetailViewBlockView.tpl +++ b/layouts/v7/modules/Vtiger/DetailViewBlockView.tpl @@ -1,146 +1,143 @@ -{*<!-- -/********************************************************************************* -** The contents of this file are subject to the vtiger CRM Public License Version 1.0 +{*+********************************************************************************** +* The contents of this file are subject to the vtiger CRM Public License Version 1.1 * ("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} - {if !empty($PICKIST_DEPENDENCY_DATASOURCE)} - <input type="hidden" name="picklistDependency" value='{Vtiger_Util_Helper::toSafeHTML($PICKIST_DEPENDENCY_DATASOURCE)}' /> - {/if} - - {foreach key=BLOCK_LABEL_KEY item=FIELD_MODEL_LIST from=$RECORD_STRUCTURE} - <div class="block block_{$BLOCK_LABEL_KEY}"> - {assign var=BLOCK value=$BLOCK_LIST[$BLOCK_LABEL_KEY]} - {if $BLOCK eq null or $FIELD_MODEL_LIST|@count lte 0}{continue}{/if} - {assign var=IS_HIDDEN value=$BLOCK->isHidden()} - {assign var=WIDTHTYPE value=$USER_MODEL->get('rowheight')} - <input type=hidden name="timeFormatOptions" data-value='{$DAY_STARTS}' /> - <div> - <h4 class="textOverflowEllipsis maxWidth50"> - <img class="cursorPointer alignMiddle blockToggle {if !($IS_HIDDEN)} hide {/if} " src="{vimage_path('arrowRight.png')}" data-mode="hide" data-id={$BLOCK_LIST[$BLOCK_LABEL_KEY]->get('id')}> - <img class="cursorPointer alignMiddle blockToggle {if ($IS_HIDDEN)} hide {/if}" src="{vimage_path('arrowdown.png')}" data-mode="show" data-id={$BLOCK_LIST[$BLOCK_LABEL_KEY]->get('id')}> - {vtranslate({$BLOCK_LABEL_KEY},{$MODULE_NAME})} - </h4> - </div> - <hr> - <div class="blockData"> - <table class="table detailview-table no-border"> - <tbody {if $IS_HIDDEN} class="hide" {/if}> - {assign var=COUNTER value=0} - <tr> - {foreach item=FIELD_MODEL key=FIELD_NAME from=$FIELD_MODEL_LIST} - {assign var=fieldDataType value=$FIELD_MODEL->getFieldDataType()} - {if !$FIELD_MODEL->isViewableInDetailView()} - {continue} - {/if} - {if $FIELD_MODEL->get('uitype') eq "83"} - {foreach item=tax key=count from=$TAXCLASS_DETAILS} - {if $COUNTER eq 2} - </tr><tr> - {assign var="COUNTER" value=1} - {else} - {assign var="COUNTER" value=$COUNTER+1} - {/if} - <td class="fieldLabel {$WIDTHTYPE}"> - <span class='muted'>{vtranslate($tax.taxlabel, $MODULE)}(%)</span> - </td> - <td class="fieldValue {$WIDTHTYPE}"> - <span class="value textOverflowEllipsis" data-field-type="{$FIELD_MODEL->getFieldDataType()}" > - {if $tax.check_value eq 1} - {$tax.percentage} - {else} - 0 - {/if} - </span> - </td> - {/foreach} - {else if $FIELD_MODEL->get('uitype') eq "69" || $FIELD_MODEL->get('uitype') eq "105"} - {if $COUNTER neq 0} - {if $COUNTER eq 2} - </tr><tr> - {assign var=COUNTER value=0} - {/if} - {/if} - <td class="fieldLabel {$WIDTHTYPE}"><span class="muted">{vtranslate({$FIELD_MODEL->get('label')},{$MODULE_NAME})}</span></td> - <td class="fieldValue {$WIDTHTYPE}"> - <ul id="imageContainer"> - {foreach key=ITER item=IMAGE_INFO from=$IMAGE_DETAILS} - {if !empty($IMAGE_INFO.path) && !empty({$IMAGE_INFO.orgname})} - <li><img src="{$IMAGE_INFO.path}_{$IMAGE_INFO.orgname}" title="{$IMAGE_INFO.orgname}" width="400" height="300" /></li> - {/if} - {/foreach} - </ul> - </td> - {assign var=COUNTER value=$COUNTER+1} - {else} - {if $FIELD_MODEL->get('uitype') eq "20" or $FIELD_MODEL->get('uitype') eq "19" or $fieldDataType eq 'reminder' or $fieldDataType eq 'recurrence'} - {if $COUNTER eq '1'} - <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td></tr><tr> - {assign var=COUNTER value=0} - {/if} - {/if} - {if $COUNTER eq 2} - </tr><tr> - {assign var=COUNTER value=1} - {else} - {assign var=COUNTER value=$COUNTER+1} - {/if} - <td class="fieldLabel textOverflowEllipsis {$WIDTHTYPE}" id="{$MODULE_NAME}_detailView_fieldLabel_{$FIELD_MODEL->getName()}" {if $FIELD_MODEL->getName() eq 'description' or $FIELD_MODEL->get('uitype') eq '69'} style='width:8%'{/if}> - <span class="muted"> - {if $MODULE_NAME eq 'Documents' && $FIELD_MODEL->get('label') eq "File Name" && $RECORD->get('filelocationtype') eq 'E'} - {vtranslate("LBL_FILE_URL",{$MODULE_NAME})} - {else} - {vtranslate({$FIELD_MODEL->get('label')},{$MODULE_NAME})} - {/if} - {if ($FIELD_MODEL->get('uitype') eq '72') && ($FIELD_MODEL->getName() eq 'unit_price')} - ({$BASE_CURRENCY_SYMBOL}) - {/if} - </span> - </td> - <td class="fieldValue {$WIDTHTYPE}" id="{$MODULE_NAME}_detailView_fieldValue_{$FIELD_MODEL->getName()}" {if $FIELD_MODEL->get('uitype') eq '19' or $fieldDataType eq 'reminder' or $fieldDataType eq 'recurrence'} colspan="3" {assign var=COUNTER value=$COUNTER+1} {/if}> - {assign var=FIELD_VALUE value=$FIELD_MODEL->get('fieldvalue')} - {if $fieldDataType eq 'multipicklist'} - {assign var=FIELD_DISPLAY_VALUE value=$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'))} - {else} - {assign var=FIELD_DISPLAY_VALUE value=Vtiger_Util_Helper::toSafeHTML($FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue')))} - {/if} - - <span class="value" data-field-type="{$FIELD_MODEL->getFieldDataType()}" {if $FIELD_MODEL->get('uitype') eq '19' or $FIELD_MODEL->get('uitype') eq '21'} style="white-space:normal;" {/if}> - {include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getDetailViewTemplateName(),$MODULE_NAME) FIELD_MODEL=$FIELD_MODEL USER_MODEL=$USER_MODEL MODULE=$MODULE_NAME RECORD=$RECORD} - </span> - {if $IS_AJAX_ENABLED && $FIELD_MODEL->isEditable() eq 'true' && $FIELD_MODEL->isAjaxEditable() eq 'true'} - <span class="hide edit pull-left"> - {if $fieldDataType eq 'multipicklist'} - <input type="hidden" class="fieldBasicData" data-name='{$FIELD_MODEL->get('name')}[]' data-type="{$fieldDataType}" data-displayvalue='{$FIELD_DISPLAY_VALUE}' data-value="{$FIELD_VALUE}" /> - {else} - <input type="hidden" class="fieldBasicData" data-name='{$FIELD_MODEL->get('name')}' data-type="{$fieldDataType}" data-displayvalue='{$FIELD_DISPLAY_VALUE}' data-value="{$FIELD_VALUE}" /> - {/if} - </span> - <span class="action pull-right"><a href="#" onclick="return false;" class="editAction fa fa-pencil"></a></span> - {/if} - </td> - {/if} - - {if $FIELD_MODEL_LIST|@count eq 1 and $FIELD_MODEL->get('uitype') neq "19" and $FIELD_MODEL->get('uitype') neq "20" and $FIELD_MODEL->get('uitype') neq "30" and $FIELD_MODEL->get('name') neq "recurringtype" and $FIELD_MODEL->get('uitype') neq "69" and $FIELD_MODEL->get('uitype') neq "105"} - <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td> - {/if} - {/foreach} - {* adding additional column for odd number of fields in a block *} - {if $FIELD_MODEL_LIST|@end eq true and $FIELD_MODEL_LIST|@count neq 1 and $COUNTER eq 1} - <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td> - {/if} - </tr> - </tbody> - </table> - </div> - </div> - <br> - -{/foreach} + {if !empty($PICKIST_DEPENDENCY_DATASOURCE)} + <input type="hidden" name="picklistDependency" value='{Vtiger_Util_Helper::toSafeHTML($PICKIST_DEPENDENCY_DATASOURCE)}' /> + {/if} + + {foreach key=BLOCK_LABEL_KEY item=FIELD_MODEL_LIST from=$RECORD_STRUCTURE} + {assign var=BLOCK value=$BLOCK_LIST[$BLOCK_LABEL_KEY]} + {if $BLOCK eq null or $FIELD_MODEL_LIST|@count lte 0}{continue}{/if} + <div class="block block_{$BLOCK_LABEL_KEY}"> + {assign var=IS_HIDDEN value=$BLOCK->isHidden()} + {assign var=WIDTHTYPE value=$USER_MODEL->get('rowheight')} + <input type=hidden name="timeFormatOptions" data-value='{$DAY_STARTS}' /> + <div> + <h4 class="textOverflowEllipsis maxWidth50"> + <img class="cursorPointer alignMiddle blockToggle {if !($IS_HIDDEN)} hide {/if}" src="{vimage_path('arrowRight.png')}" data-mode="hide" data-id={$BLOCK_LIST[$BLOCK_LABEL_KEY]->get('id')}> + <img class="cursorPointer alignMiddle blockToggle {if ($IS_HIDDEN)} hide {/if}" src="{vimage_path('arrowdown.png')}" data-mode="show" data-id={$BLOCK_LIST[$BLOCK_LABEL_KEY]->get('id')}> + {vtranslate({$BLOCK_LABEL_KEY},{$MODULE_NAME})} + </h4> + </div> + <hr> + <div class="blockData"> + <table class="table detailview-table no-border"> + <tbody {if $IS_HIDDEN} class="hide" {/if}> + {assign var=COUNTER value=0} + <tr> + {foreach item=FIELD_MODEL key=FIELD_NAME from=$FIELD_MODEL_LIST} + {assign var=fieldDataType value=$FIELD_MODEL->getFieldDataType()} + {if !$FIELD_MODEL->isViewableInDetailView()} + {continue} + {/if} + {if $FIELD_MODEL->get('uitype') eq "83"} + {foreach item=tax key=count from=$TAXCLASS_DETAILS} + {if $COUNTER eq 2} + </tr><tr> + {assign var="COUNTER" value=1} + {else} + {assign var="COUNTER" value=$COUNTER+1} + {/if} + <td class="fieldLabel {$WIDTHTYPE}"> + <span class='muted'>{vtranslate($tax.taxlabel, $MODULE)}(%)</span> + </td> + <td class="fieldValue {$WIDTHTYPE}"> + <span class="value textOverflowEllipsis" data-field-type="{$FIELD_MODEL->getFieldDataType()}" > + {if $tax.check_value eq 1} + {$tax.percentage} + {else} + 0 + {/if} + </span> + </td> + {/foreach} + {else if $FIELD_MODEL->get('uitype') eq "69" || $FIELD_MODEL->get('uitype') eq "105"} + {if $COUNTER neq 0} + {if $COUNTER eq 2} + </tr><tr> + {assign var=COUNTER value=0} + {/if} + {/if} + <td class="fieldLabel {$WIDTHTYPE}"><span class="muted">{vtranslate({$FIELD_MODEL->get('label')},{$MODULE_NAME})}</span></td> + <td class="fieldValue {$WIDTHTYPE}"> + <ul id="imageContainer"> + {foreach key=ITER item=IMAGE_INFO from=$IMAGE_DETAILS} + {if !empty($IMAGE_INFO.path) && !empty({$IMAGE_INFO.orgname})} + <li><img src="{$IMAGE_INFO.path}_{$IMAGE_INFO.orgname}" title="{$IMAGE_INFO.orgname}" width="400" height="300" /></li> + {/if} + {/foreach} + </ul> + </td> + {assign var=COUNTER value=$COUNTER+1} + {else} + {if $FIELD_MODEL->get('uitype') eq "20" or $FIELD_MODEL->get('uitype') eq "19" or $fieldDataType eq 'reminder' or $fieldDataType eq 'recurrence'} + {if $COUNTER eq '1'} + <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td></tr><tr> + {assign var=COUNTER value=0} + {/if} + {/if} + {if $COUNTER eq 2} + </tr><tr> + {assign var=COUNTER value=1} + {else} + {assign var=COUNTER value=$COUNTER+1} + {/if} + <td class="fieldLabel textOverflowEllipsis {$WIDTHTYPE}" id="{$MODULE_NAME}_detailView_fieldLabel_{$FIELD_MODEL->getName()}" {if $FIELD_MODEL->getName() eq 'description' or $FIELD_MODEL->get('uitype') eq '69'} style='width:8%'{/if}> + <span class="muted"> + {if $MODULE_NAME eq 'Documents' && $FIELD_MODEL->get('label') eq "File Name" && $RECORD->get('filelocationtype') eq 'E'} + {vtranslate("LBL_FILE_URL",{$MODULE_NAME})} + {else} + {vtranslate({$FIELD_MODEL->get('label')},{$MODULE_NAME})} + {/if} + {if ($FIELD_MODEL->get('uitype') eq '72') && ($FIELD_MODEL->getName() eq 'unit_price')} + ({$BASE_CURRENCY_SYMBOL}) + {/if} + </span> + </td> + <td class="fieldValue {$WIDTHTYPE}" id="{$MODULE_NAME}_detailView_fieldValue_{$FIELD_MODEL->getName()}" {if $FIELD_MODEL->get('uitype') eq '19' or $fieldDataType eq 'reminder' or $fieldDataType eq 'recurrence'} colspan="3" {assign var=COUNTER value=$COUNTER+1} {/if}> + {assign var=FIELD_VALUE value=$FIELD_MODEL->get('fieldvalue')} + {if $fieldDataType eq 'multipicklist'} + {assign var=FIELD_DISPLAY_VALUE value=$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'))} + {else} + {assign var=FIELD_DISPLAY_VALUE value=Vtiger_Util_Helper::toSafeHTML($FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue')))} + {/if} + + <span class="value" data-field-type="{$FIELD_MODEL->getFieldDataType()}" {if $FIELD_MODEL->get('uitype') eq '19' or $FIELD_MODEL->get('uitype') eq '21'} style="white-space:normal;" {/if}> + {include file=vtemplate_path($FIELD_MODEL->getUITypeModel()->getDetailViewTemplateName(),$MODULE_NAME) FIELD_MODEL=$FIELD_MODEL USER_MODEL=$USER_MODEL MODULE=$MODULE_NAME RECORD=$RECORD} + </span> + {if $IS_AJAX_ENABLED && $FIELD_MODEL->isEditable() eq 'true' && $FIELD_MODEL->isAjaxEditable() eq 'true'} + <span class="hide edit pull-left"> + {if $fieldDataType eq 'multipicklist'} + <input type="hidden" class="fieldBasicData" data-name='{$FIELD_MODEL->get('name')}[]' data-type="{$fieldDataType}" data-displayvalue='{$FIELD_DISPLAY_VALUE}' data-value="{$FIELD_VALUE}" /> + {else} + <input type="hidden" class="fieldBasicData" data-name='{$FIELD_MODEL->get('name')}' data-type="{$fieldDataType}" data-displayvalue='{$FIELD_DISPLAY_VALUE}' data-value="{$FIELD_VALUE}" /> + {/if} + </span> + <span class="action pull-right"><a href="#" onclick="return false;" class="editAction fa fa-pencil"></a></span> + {/if} + </td> + {/if} + + {if $FIELD_MODEL_LIST|@count eq 1 and $FIELD_MODEL->get('uitype') neq "19" and $FIELD_MODEL->get('uitype') neq "20" and $FIELD_MODEL->get('uitype') neq "30" and $FIELD_MODEL->get('name') neq "recurringtype" and $FIELD_MODEL->get('uitype') neq "69" and $FIELD_MODEL->get('uitype') neq "105"} + <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td> + {/if} + {/foreach} + {* adding additional column for odd number of fields in a block *} + {if $FIELD_MODEL_LIST|@end eq true and $FIELD_MODEL_LIST|@count neq 1 and $COUNTER eq 1} + <td class="fieldLabel {$WIDTHTYPE}"></td><td class="{$WIDTHTYPE}"></td> + {/if} + </tr> + </tbody> + </table> + </div> + </div> + <br> + {/foreach} {/strip} \ No newline at end of file diff --git a/layouts/v7/modules/Vtiger/partials/SidebarEssentials.tpl b/layouts/v7/modules/Vtiger/partials/SidebarEssentials.tpl index 742e14afa016028b26daff7f0efc98547a03ae9d..0d746c42664a3dadf78981a401d17cd0fcf10a27 100644 --- a/layouts/v7/modules/Vtiger/partials/SidebarEssentials.tpl +++ b/layouts/v7/modules/Vtiger/partials/SidebarEssentials.tpl @@ -38,6 +38,7 @@ <input type="hidden" name="allCvId" value="{CustomView_Record_Model::getAllFilterByModule($MODULE)->get('cvid')}" /> <ul class="lists-menu"> {assign var=count value=0} + {assign var=LISTVIEW_URL value=$MODULE_MODEL->getListViewUrl()} {foreach item="CUSTOM_VIEW" from=$GROUP_CUSTOM_VIEWS name="customView"} {assign var=IS_DEFAULT value=$CUSTOM_VIEW->isDefault()} {assign var="CUSTOME_VIEW_RECORD_MODEL" value=CustomView_Record_Model::getInstanceById($CUSTOM_VIEW->getId())} @@ -51,7 +52,7 @@ <li style="font-size:12px;" class='listViewFilter {if $VIEWID eq $CUSTOM_VIEW->getId() && ($CURRENT_TAG eq '')} active {if $smarty.foreach.customView.iteration gt 10} {assign var=count value=1} {/if} {else if $smarty.foreach.customView.iteration gt 10} filterHidden hide{/if} '> {assign var=VIEWNAME value={vtranslate($CUSTOM_VIEW->get('viewname'), $MODULE)}} {append var="CUSTOM_VIEW_NAMES" value=$VIEWNAME} - <a class="filterName listViewFilterElipsis" href="javascript:;" oncontextmenu="return false;" data-filter-id="{$CUSTOM_VIEW->getId()}" title="{$VIEWNAME|@escape:'html'}">{$VIEWNAME|@escape:'html'}</a> + <a class="filterName listViewFilterElipsis" href="{$LISTVIEW_URL|cat:'&viewname='|cat:$CUSTOM_VIEW->getId()}" oncontextmenu="return false;" data-filter-id="{$CUSTOM_VIEW->getId()}" title="{$VIEWNAME|@escape:'html'}">{$VIEWNAME|@escape:'html'}</a> <div class="pull-right"> <span class="js-popover-container" style="cursor:pointer;"> <span class="fa fa-angle-down" rel="popover" data-toggle="popover" aria-expanded="true" diff --git a/layouts/v7/modules/Vtiger/resources/BasicSearch.js b/layouts/v7/modules/Vtiger/resources/BasicSearch.js index b73b9e35cfe318c082a9631447a742b515bd7475..e1871626df9ad570b19bd408223edbc06d745650 100644 --- a/layouts/v7/modules/Vtiger/resources/BasicSearch.js +++ b/layouts/v7/modules/Vtiger/resources/BasicSearch.js @@ -131,7 +131,7 @@ Vtiger.Class('Vtiger_BasicSearch_Js',{},{ addSearchListener : function () { jQuery('.search-link .keyword-input').on('VT_SEARCH_INTIATED',function(e,args){ var val = args.searchValue; - var url = '?module='+app.getModuleName()+'&view=ListAjax&mode=searchAll&value='+encodeURIComponent(val); + var url = '?module=Vtiger&view=ListAjax&mode=searchAll&value='+encodeURIComponent(val); app.helper.showProgress(); app.request.get({'url': url}).then(function (error, data) { if (error == null) { diff --git a/layouts/v7/modules/Vtiger/resources/Detail.js b/layouts/v7/modules/Vtiger/resources/Detail.js index e9087bb42b10161e50fd9d9bb4a5e8389cc0e37f..50e9ff09f2a63e5ceaf10f8a5bf8caa42f737265 100644 --- a/layouts/v7/modules/Vtiger/resources/Detail.js +++ b/layouts/v7/modules/Vtiger/resources/Detail.js @@ -1294,7 +1294,7 @@ Vtiger.Class("Vtiger_Detail_Js",{ 'ignore' : 'span.hide .inputElement,input[type="hidden"]', submitHandler : function(form){ var preAjaxSaveEvent = jQuery.Event(Vtiger_Detail_Js.PreAjaxSaveEvent); - app.event.trigger(preAjaxSaveEvent,{form:jQuery(form),tiggeredFiledInfo:fieldNameValueMap}); + app.event.trigger(preAjaxSaveEvent,{form:jQuery(form),triggeredFieldInfo:fieldNameValueMap}); if(preAjaxSaveEvent.isDefaultPrevented()) { return false; } diff --git a/layouts/v7/modules/Vtiger/resources/Field.js b/layouts/v7/modules/Vtiger/resources/Field.js index f85545dea5eebe24c02ccdae46006e40c480c9b2..c8fce927ab98cc9351d7aafe12a17f6156382d66 100644 --- a/layouts/v7/modules/Vtiger/resources/Field.js +++ b/layouts/v7/modules/Vtiger/resources/Field.js @@ -14,18 +14,18 @@ jQuery.Class("Vtiger_Field_Js",{ * @param moduleName module for which Instance should be created * @return Instance of field class */ - getInstance : function(data,moduleName){ + getInstance : function(data,moduleName){ if(typeof moduleName == 'undefined'){ var moduleName = app.getModuleName(); } - var moduleField = moduleName+"_Field_Js"; + var moduleField = moduleName+"_Field_Js"; var moduleFieldObj = window[moduleField]; - if (typeof moduleFieldObj != 'undefined'){ + if (typeof moduleFieldObj != 'undefined'){ var fieldClass = moduleFieldObj; }else{ - var fieldClass = Vtiger_Field_Js; - } - var fieldObj = new fieldClass(); + var fieldClass = Vtiger_Field_Js; + } + var fieldObj = new fieldClass(); if(typeof data == 'undefined'){ data = {}; @@ -41,7 +41,7 @@ jQuery.Class("Vtiger_Field_Js",{ * @return false if field is not mandatory */ isMandatory : function(){ - return this.get('mandatory'); + return this.get('mandatory'); }, @@ -50,12 +50,12 @@ jQuery.Class("Vtiger_Field_Js",{ * @return value for the passed key */ - get : function(key){ + get : function(key){ if(key in this.data){ return this.data[key]; } - return ''; - }, + return ''; + }, /** @@ -99,11 +99,11 @@ jQuery.Class("Vtiger_Field_Js",{ * Function to set data attribute of the class * @return Instance of the class */ - setData : function(fieldInfo){ - this.data = fieldInfo; + setData : function(fieldInfo){ + this.data = fieldInfo; return this; - }, - + }, + getModuleName : function() { return app.getModuleName(); }, @@ -121,24 +121,24 @@ jQuery.Class("Vtiger_Field_Js",{ var BasicUiTypeClassName = window["Vtiger_"+ typeClassName + "_Field_Js"]; if(typeof moduleUiTypeClassName != 'undefined') { - var instance = new moduleUiTypeClassName(); + var instance = new moduleUiTypeClassName(); return instance.setData(this.getData()); }else if (typeof BasicUiTypeClassName != 'undefined') { - var instance = new BasicUiTypeClassName(); + var instance = new BasicUiTypeClassName(); return instance.setData(this.getData()); } return this; }, /** - * Funtion to get the ui for the field - generally this will be extend by the child classes to + * Funtion to get the ui for the field - generally this will be extend by the child classes to * give ui type specific ui * return <String or Jquery> it can return either plain html or jquery object */ getUi : function() { var html = '<input class="inputElement" type="text" name="'+ this.getName() +'" data-label="'+this.get('label')+'" data-rule-'+this.getType()+'=true />'; html = jQuery(html).val(app.htmlDecode(this.getValue())); - return jQuery(html); + return this.addValidationToElement(html); }, /** @@ -157,68 +157,68 @@ jQuery.Class("Vtiger_Field_Js",{ addValidationToElement : function(element) { var element = jQuery(element); var addValidationToElement = element; - var elementInStructure = element.find('[name="'+this.getName()+'"]'); - if(elementInStructure.length > 0){ - addValidationToElement = elementInStructure; + var elementInStructure = element.find('[name="'+this.getName()+'"]'); + if(elementInStructure.length > 0){ + addValidationToElement = elementInStructure; } if(this.isMandatory()) { - addValidationToElement.attr('data-rule-required', 'true'); + addValidationToElement.attr('data-rule-required', 'true'); var type = this.getType(); if (type == 'reference') { addValidationToElement.attr('data-rule-reference_required', 'true'); } } addValidationToElement.attr('data-fieldinfo',JSON.stringify(this.getData())).attr('data-specific-rules',JSON.stringify(this.getData().specialValidator)); - return element; + return element; }, - + getNewFieldInfo : function() { return this.get('newfieldinfo'); }, - + }) Vtiger_Field_Js('Vtiger_Reference_Field_Js',{},{ - - getReferenceModules : function(){ - return this.get('referencemodules'); - }, - - getUi : function(){ - var referenceModules = this.getReferenceModules(); - var value = this.getValue(); - var html = '<div class="referencefield-wrapper'; - if(value){ - html += ' selected'; - } else { - html += '"'; - } - html += '">'; - html += '<input name="popupReferenceModule" type="hidden" value="'+referenceModules[0]+'"/>'; - html += '<div class="input-group ">' - html += '<input class="autoComplete inputElement sourceField" type="search" data-fieldtype="reference" name="'+this.getName()+'"'; - var reset = false; - if(value){ - html += ' value="'+value+'" disabled="disabled"'; - reset = true; - } - html += '/>'; - - if(reset){ - html += '<a href="#" class="clearReferenceSelection"> X </a>'; - }else { - html += '<a href="#" class="clearReferenceSelection hide"> X </a>'; - } - //popup search element - html += '<span class="input-group-addon relatedPopup cursorPointer" title="'+referenceModules[0]+'">'; - html += '<i class="fa fa-search"></i>'; - html += '</span>'; - - html += '</div>'; - html += '</div>'; - return this.addValidationToElement(html); - } - + + getReferenceModules : function(){ + return this.get('referencemodules'); + }, + + getUi : function(){ + var referenceModules = this.getReferenceModules(); + var value = this.getValue(); + var html = '<div class="referencefield-wrapper'; + if(value){ + html += ' selected'; + } else { + html += '"'; + } + html += '">'; + html += '<input name="popupReferenceModule" type="hidden" value="'+referenceModules[0]+'"/>'; + html += '<div class="input-group ">' + html += '<input class="autoComplete inputElement sourceField" type="search" data-fieldtype="reference" name="'+this.getName()+'"'; + var reset = false; + if(value){ + html += ' value="'+value+'" disabled="disabled"'; + reset = true; + } + html += '/>'; + + if(reset){ + html += '<a href="#" class="clearReferenceSelection"> X </a>'; + }else { + html += '<a href="#" class="clearReferenceSelection hide"> X </a>'; + } + //popup search element + html += '<span class="input-group-addon relatedPopup cursorPointer" title="'+referenceModules[0]+'">'; + html += '<i class="fa fa-search"></i>'; + html += '</span>'; + + html += '</div>'; + html += '</div>'; + return this.addValidationToElement(html); + } + }); @@ -237,12 +237,12 @@ Vtiger_Field_Js('Vtiger_Picklist_Field_Js',{},{ * @return - select element and chosen element */ getUi : function() { - //added class inlinewidth + //added class inlinewidth var html = '<select class="select2 inputElement inlinewidth" name="'+ this.getName() +'" id="field_'+this.getModuleName()+'_'+this.getName()+'">'; var pickListValues = this.getPickListValues(); var selectedOption = app.htmlDecode(this.getValue()); - - if(typeof pickListValues[' '] == 'undefined' || pickListValues[' '].length <= 0) { + + if(typeof pickListValues[' '] == 'undefined' || pickListValues[' '].length <= 0 || pickListValues[' '] != 'Select an Option') { html += '<option value="">Select an Option</option>'; } for(var option in pickListValues) { @@ -299,16 +299,16 @@ Vtiger_Field_Js('Vtiger_Multipicklist_Field_Js',{},{ getPickListValues : function() { return this.get('picklistvalues'); }, - - getSelectedOptions : function(selectedOption){ - var valueArray = selectedOption.split('|##|'); - var selectedOptionsArray = []; - for(var i=0;i<valueArray.length;i++){ - selectedOptionsArray.push(valueArray[i].trim()); - } - return selectedOptionsArray; - }, - + + getSelectedOptions : function(selectedOption){ + var valueArray = selectedOption.split('|##|'); + var selectedOptionsArray = []; + for(var i=0;i<valueArray.length;i++){ + selectedOptionsArray.push(valueArray[i].trim()); + } + return selectedOptionsArray; + }, + /** * Function to get the ui * @return - select element and chosen element @@ -318,7 +318,7 @@ Vtiger_Field_Js('Vtiger_Multipicklist_Field_Js',{},{ var pickListValues = this.getPickListValues(); var selectedOption = app.htmlDecode(this.getValue()); var selectedOptionsArray = this.getSelectedOptions(selectedOption); - + for(var option in pickListValues) { html += '<option value="'+option+'" '; if(jQuery.inArray(option,selectedOptionsArray) != -1){ @@ -341,7 +341,7 @@ Vtiger_Field_Js('Vtiger_Boolean_Field_Js',{},{ */ isChecked : function() { var value = this.getValue(); - if(value==1 || value == '1' || value.toLowerCase() == 'on' || value.toLowerCase() == 'yes'){ + if(value==1 || value == '1' || (value && (value.toLowerCase() == 'on' || value.toLowerCase() == 'yes'))){ return true; } return false; @@ -376,10 +376,10 @@ Vtiger_Field_Js('Vtiger_Date_Field_Js',{},{ * @return - input text field */ getUi : function() { - //wrappig with another div for consistency + //wrappig with another div for consistency var html = '<div class="referencefield-wrapper"><div class="input-group date">'+ - '<input class="inputElement dateField form-control" type="text" data-rule="date" data-format="'+ this.getDateFormat() +'" name="'+ this.getName() +'" value="'+ this.getValue() + '" />'+ - '<span class="input-group-addon"><i class="fa fa-calendar"></i></span>'+ + '<input class="inputElement dateField form-control" type="text" data-rule-date="true" data-format="'+ this.getDateFormat() +'" name="'+ this.getName() +'" value="'+ this.getValue() + '" />'+ + '<span class="input-group-addon"><i class="fa fa-calendar"></i></span>'+ '</div></div>'; var element = jQuery(html); return this.addValidationToElement(element); @@ -396,10 +396,10 @@ Vtiger_Field_Js('Vtiger_Currency_Field_Js',{},{ }, getUi : function() { - //wrappig with another div for consistency + //wrappig with another div for consistency var html = '<div class="referencefield-wrapper"><div class="input-group">'+ - '<span class="input-group-addon" id="basic-addon1">'+this.getCurrencySymbol()+'</span>'+ - '<input class="inputElement" type="text" name="'+ this.getName() +'" data-rule-currency="true" value="'+ this.getValue() + '" />'+ + '<span class="input-group-addon" id="basic-addon1">'+this.getCurrencySymbol()+'</span>'+ + '<input class="inputElement" type="text" name="'+ this.getName() +'" data-rule-currency="true" value="'+ this.getValue() + '" />'+ '</div></div>'; var element = jQuery(html); return this.addValidationToElement(element); @@ -445,7 +445,7 @@ Vtiger_Date_Field_Js('Vtiger_Datetime_Field_Js',{},{ }); Vtiger_Field_Js('Vtiger_Time_Field_Js',{},{ - + /** * Function to get the user date format */ @@ -459,8 +459,8 @@ Vtiger_Field_Js('Vtiger_Time_Field_Js',{},{ */ getUi : function() { var html = '<div class="referencefield-wrapper">'+'<div class="input-group time">'+ - '<input class="timepicker-default form-control" type="text" data-format="'+ this.getTimeFormat() +'" name="'+ this.getName() +'" value="'+ this.getValue() + '" />'+ - '<span class="input-group-addon"><i class="fa fa-clock-o"></i></span>'+ + '<input class="timepicker-default form-control inputElement" type="text" data-format="'+ this.getTimeFormat() +'" name="'+ this.getName() +'" value="'+ this.getValue() + '" />'+ + '<span class="input-group-addon"><i class="fa fa-clock-o"></i></span>'+ '</div>'+'</div>'; var element = jQuery(html); return this.addValidationToElement(element); @@ -474,7 +474,7 @@ Vtiger_Field_Js('Vtiger_Text_Field_Js',{},{ * @return - input text field */ getUi : function() { - var html = '<textarea class="input-xxlarge form-control inputElement" name="'+ this.getName() +'" value="'+ this.getValue() + '" style="max-width:80%; height:200px;">'+ this.getValue() + '</textarea>'; + var html = '<textarea class="input-xxlarge form-control inputElement" name="'+ this.getName() +'" value="'+ this.getValue() + '" >'+ this.getValue() + '</textarea>'; var element = jQuery(html); return this.addValidationToElement(element); } @@ -487,8 +487,8 @@ Vtiger_Field_Js('Vtiger_Percentage_Field_Js',{},{ * @return - input percentage field */ getUi : function() { - var html = '<div class="input-group">'+ - '<input type="number" class="form-control" min="0" max="100" name="'+this.getName() +'" value="'+ this.getValue() + '" step="any"/>'+ + var html = '<div class="input-group percentage-input-group">'+ + '<input type="text" class="form-control inputElement percentage-input-element" name="'+this.getName() +'" value="'+ this.getValue() + '" step="any" data-rule-'+this.getType()+'=true/>'+ '<span class="input-group-addon">%</span>'+ '</div>'; var element = jQuery(html); @@ -528,21 +528,21 @@ Vtiger_Field_Js('Vtiger_Recurrence_Field_Js',{},{ }); Vtiger_Field_Js('Vtiger_Email_Field_Js',{},{ - + /** * Funtion to get the ui for the email field * return <String or Jquery> it can return either plain html or jquery object */ getUi : function() { - var html = '<input class="inputElement" type="text" name="'+ this.getName() +'" data-label="'+this.get('label')+'" data-rule-email="true" data-rule-illegal="true"/>'; + var html = '<input class="inputElement" type="text" name="'+ this.getName() +'" data-label="'+this.get('label')+'" data-rule-email="true" data-rule-illegal="true"/>'; html = jQuery(html).val(app.htmlDecode(this.getValue())); - var element = jQuery(html); - return this.addValidationToElement(element); + this.addValidationToElement(html); + return jQuery(html); } }); Vtiger_Field_Js('Vtiger_Image_Field_Js',{},{ - + /** * Funtion to get the ui for the Image field * return <String or Jquery> it can return either plain html or jquery object @@ -551,4 +551,12 @@ Vtiger_Field_Js('Vtiger_Image_Field_Js',{},{ var html = ''; return jQuery(html); } -}); \ No newline at end of file +}); + +Vtiger_Field_Js('Vtiger_Integer_Field_Js',{},{ + getUi : function() { + var html = '<input class="inputElement" type="text" name="'+ this.getName() +'" data-label="'+this.get('label')+'" data-rule-'+this.getType()+'=true />'; + html = jQuery(html).val(app.htmlDecode(this.getValue())); + return this.addValidationToElement(html); + } +}); diff --git a/layouts/v7/resources/Images/extensionstore.png b/layouts/v7/resources/Images/extensionstore.png new file mode 100644 index 0000000000000000000000000000000000000000..5956d6e7beca946a6941a00e10abd72c0953a61e Binary files /dev/null and b/layouts/v7/resources/Images/extensionstore.png differ diff --git a/layouts/v7/resources/Images/login-background.jpg b/layouts/v7/resources/Images/login-background.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b7ebfec802310ffe3d3b5f35e4833353d649f3fe Binary files /dev/null and b/layouts/v7/resources/Images/login-background.jpg differ diff --git a/modules/Emails/Emails.php b/modules/Emails/Emails.php index 904dd6f6e4d26cd55b1888205ebb277ef5eff3c5..052c8106f71440e4247818845f916d3970c4dd02 100644 --- a/modules/Emails/Emails.php +++ b/modules/Emails/Emails.php @@ -173,13 +173,16 @@ class Emails extends CRMEntity { $file_saved = pdfAttach($this, $module, $pdfAttached, $id); } - //This is to added to store the existing attachment id of the contact where we should delete this when we give new image - foreach ($_FILES as $fileindex => $files) { - if ($files['name'] != '' && $files['size'] > 0) { - $files['original_name'] = vtlib_purify($_REQUEST[$fileindex . '_hidden']); - $file_saved = $this->uploadAndSaveFile($id, $module, $files); + if ($_FILES) { + //This is to added to store the existing attachment id of the contact where we should delete this when we give new image + foreach ($_FILES as $fileindex => $files) { + if ($files['name'] != '' && $files['size'] > 0) { + $files['original_name'] = vtlib_purify($_REQUEST[$fileindex . '_hidden']); + $file_saved = $this->uploadAndSaveFile($id, $module, $files); + } } } + if ($module == 'Emails' && isset($_REQUEST['att_id_list']) && $_REQUEST['att_id_list'] != '') { $att_lists = explode(";", $_REQUEST['att_id_list'], -1); $id_cnt = count($att_lists); diff --git a/modules/Emails/models/Record.php b/modules/Emails/models/Record.php index a4da3a8d4c9026d1a760193c580b9bc7147637d4..000502348ca58aaa145f360cdc5fc6929e226b5e 100644 --- a/modules/Emails/models/Record.php +++ b/modules/Emails/models/Record.php @@ -123,7 +123,7 @@ class Emails_Record_Model extends Vtiger_Record_Model { } if (strpos($description, '$logo$')) { - $description = str_replace('$logo$',"<img src='cid:logo' />", $description); + $description = str_replace('$logo$',"<img src='cid:companyLogo' />", $description); $logo = true; } @@ -161,8 +161,10 @@ class Emails_Record_Model extends Vtiger_Record_Model { } } if ($logo) { + $companyDetails = Vtiger_CompanyDetails_Model::getInstanceById(); + $companyLogoDetails = $companyDetails->getLogo(); //While sending email template and which has '$logo$' then it should replace with company logo - $mailer->AddEmbeddedImage(dirname(__FILE__).'/../../../layouts/v7/skins/images/logo_mail.jpg', 'logo', 'logo.jpg', 'base64', 'image/jpg'); + $mailer->AddEmbeddedImage($companyLogoDetails->get('imagepath'), 'companyLogo', 'attachment', 'base64', 'image/jpg'); } $ccs = array_filter(explode(',',$this->get('ccmail'))); diff --git a/modules/Inventory/models/RelationListView.php b/modules/Inventory/models/RelationListView.php index 478a6d77a1a788196ef807a6c1d21cd750f74f26..c73c2425bd8ad5a1f706f098455de19139d15387 100644 --- a/modules/Inventory/models/RelationListView.php +++ b/modules/Inventory/models/RelationListView.php @@ -31,7 +31,7 @@ class Inventory_RelationListView_Model extends Vtiger_RelationListView_Model { $addLinkList = array( array( 'linktype' => 'LISTVIEWBASIC', - 'linklabel' => vtranslate('LBL_ADD')." ".vtranslate($relatedModel->get('label')), + 'linklabel' => vtranslate('LBL_ADD')." ".vtranslate('SINGLE_'.$relatedModel->getName(), $relatedModel->getName()), 'linkurl' => $this->getCreateViewUrl(), 'linkicon' => '', ) diff --git a/modules/Migration/schema/660_to_700.php b/modules/Migration/schema/660_to_700.php index be6c22d2d4dacaa146a85a5146e8ed8c68440fdd..37938e38e16e3254633e7ae4479d5e2a089f9cb6 100644 --- a/modules/Migration/schema/660_to_700.php +++ b/modules/Migration/schema/660_to_700.php @@ -31,6 +31,8 @@ if(defined('VTIGER_UPGRADE')) { $db->pquery('UPDATE vtiger_links SET linktype=? WHERE linklabel=?', array('DETAILVIEW', 'LBL_SHOW_ACCOUNT_HIERARCHY')); $db->pquery('UPDATE vtiger_field SET defaultvalue=? WHERE fieldname=?', array('1', 'discontinued')); $db->pquery('UPDATE vtiger_field SET typeofdata=? WHERE fieldname IN (?, ?)', array('DT~O', 'createdtime', 'modifiedtime')); + $db->pquery('UPDATE vtiger_field SET defaultvalue=? WHERE fieldname=?', array('.','currency_decimal_separator')); + $db->pquery('UPDATE vtiger_field SET defaultvalue=? WHERE fieldname=?', array(',','currency_grouping_separator')); $lineItemModules = array('Products' => 'vtiger_products', 'Services' => 'vtiger_service'); foreach ($lineItemModules as $moduleName => $tableName) { diff --git a/modules/Reports/ReportUtils.php b/modules/Reports/ReportUtils.php index 084658ec3bd4ce55ea3fba69d6654c1a0189e200..dc0bf74408a7a57556744a15307a00c864859d40 100644 --- a/modules/Reports/ReportUtils.php +++ b/modules/Reports/ReportUtils.php @@ -341,7 +341,7 @@ function getReportSearchCondition($searchParams, $filterId) { $fieldName = $condition[0]; $searchValue = $condition[2]; if ($fieldName == 'reportname' || $fieldName == 'description') { - $conditionQuery .= " vtiger_report.$fieldName. LIKE ? "; + $conditionQuery .= " vtiger_report.$fieldName LIKE ? "; array_push($params, "%$searchValue%"); } else if ($fieldName == 'reporttype' || $fieldName == 'foldername' || $fieldName == 'owner') { $searchValue = explode(',', $searchValue); diff --git a/modules/Reports/Reports.php b/modules/Reports/Reports.php index c745d2dfa501a81c6d17627e5657e9d3135e494c..65efa848d6780969c49a20cd51a94017894d7d3f 100644 --- a/modules/Reports/Reports.php +++ b/modules/Reports/Reports.php @@ -492,35 +492,42 @@ class Reports extends CRMEntity{ if($searchCondition) { $sql .= $searchCondition; } - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require_once('include/utils/GetUserGroups.php'); - $userGroups = new GetUserGroups(); - $userGroups->getAllUserGroups($current_user->id); - $user_groups = $userGroups->user_groups; - if(!empty($user_groups) && ($rpt_fldr_id == 'shared' || $rpt_fldr_id == 'All')){ - $user_group_query = " (shareid IN (".generateQuestionMarks($user_groups).") AND setype='groups') OR"; - array_push($params, $user_groups); - } - - $non_admin_query = " vtiger_report.reportid IN (SELECT reportid FROM vtiger_reportsharing WHERE $user_group_query (shareid=? AND setype='users'))"; - if($rpt_fldr_id == 'shared' || $rpt_fldr_id == 'All'){ - $sql .= " AND ( ( (".$non_admin_query.") OR vtiger_report.sharingtype='Public' OR " - . "vtiger_report.owner = ? OR vtiger_report.owner IN (SELECT vtiger_user2role.userid " - . "FROM vtiger_user2role INNER JOIN vtiger_users ON vtiger_users.id=vtiger_user2role.userid " - . "INNER JOIN vtiger_role ON vtiger_role.roleid=vtiger_user2role.roleid " - . "WHERE vtiger_role.parentrole LIKE '".$current_user_parent_role_seq."::%'))"; - array_push($params, $current_user->id); - array_push($params, $current_user->id); - } - - //Report sharing for vtiger7 - $queryObj = new stdClass(); - $queryObj->query = $sql; - $queryObj->queryParams = $params; - //This function will append sharing access query for a current user - $queryObj = self::getReportSharingQuery($queryObj,$rpt_fldr_id); - $sql = $queryObj->query; - $params = $queryObj->queryParams; + + if (strtolower($current_user->is_admin) != "on") { + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require_once('include/utils/GetUserGroups.php'); + $userGroups = new GetUserGroups(); + $userGroups->getAllUserGroups($current_user->id); + $user_groups = $userGroups->user_groups; + if(!empty($user_groups) && ($rpt_fldr_id == 'shared' || $rpt_fldr_id == 'All')){ + $user_group_query = " (shareid IN (".generateQuestionMarks($user_groups).") AND setype='groups') OR"; + $non_admin_query = " vtiger_report.reportid IN (SELECT reportid FROM vtiger_reportsharing WHERE $user_group_query (shareid=? AND setype='users'))"; + foreach ($user_groups as $userGroup) { + array_push($params, $userGroup); + } + array_push($params, $current_user->id); + } + + if ($rpt_fldr_id == 'shared' || $rpt_fldr_id == 'All') { + if ($non_admin_query) { + $non_admin_query = "( $non_admin_query ) OR "; + } + $sql .= " AND ( ($non_admin_query vtiger_report.sharingtype='Public' OR " + . "vtiger_report.owner = ? OR vtiger_report.owner IN (SELECT vtiger_user2role.userid " + . "FROM vtiger_user2role INNER JOIN vtiger_users ON vtiger_users.id=vtiger_user2role.userid " + . "INNER JOIN vtiger_role ON vtiger_role.roleid=vtiger_user2role.roleid " + . "WHERE vtiger_role.parentrole LIKE '".$current_user_parent_role_seq."::%'))"; + array_push($params, $current_user->id); + } + + $queryObj = new stdClass(); + $queryObj->query = $sql; + $queryObj->queryParams = $params; + //This function will append sharing access query for a current user + $queryObj = self::getReportSharingQuery($queryObj,$rpt_fldr_id); + $sql = $queryObj->query; + $params = $queryObj->queryParams; + } if ($paramsList) { $startIndex = $paramsList['startIndex']; $pageLimit = $paramsList['pageLimit']; diff --git a/modules/Settings/LayoutEditor/models/Module.php b/modules/Settings/LayoutEditor/models/Module.php index 969a87afa37359b2580fbf3e303bfa022aef0a03..b590bdd1d4d7c6453965b14577d5106b18353f6d 100644 --- a/modules/Settings/LayoutEditor/models/Module.php +++ b/modules/Settings/LayoutEditor/models/Module.php @@ -359,6 +359,9 @@ class Settings_LayoutEditor_Module_Model extends Vtiger_Module_Model { for($i=0; $i<$numOfRows; $i++) { $moduleName = $db->query_result($result, $i, 'name'); $modulesList[$moduleName] = vtranslate($moduleName, $moduleName); + if ($moduleName == 'Calendar') { + $modulesList[$moduleName] = vtranslate($moduleName, 'Settings:LayoutEditor'); + } } // If calendar is disabled we should not show events module too // in layout editor diff --git a/modules/Users/actions/Login.php b/modules/Users/actions/Login.php index 9c975786d63bc6bd0fbd61d7d7ee6978119e0a44..d46d937168cfa6d56052cd80d5deacafe6e31f9c 100644 --- a/modules/Users/actions/Login.php +++ b/modules/Users/actions/Login.php @@ -58,7 +58,7 @@ class Users_Login_Action extends Vtiger_Action_Controller { header ('Location: index.php?module=Users&parent=Settings&view=SystemSetup'); exit(); } else { - header ('Location: index.php?module=Users&parent=Settings&view=Login&error=1'); + header ('Location: index.php?module=Users&parent=Settings&view=Login&error=login'); exit; } } diff --git a/modules/Users/views/Login.php b/modules/Users/views/Login.php index f7716eb4ea7fd6def67f693b4f42322de41bf33c..1d469481365a24064d3016264afe5d1a35282e3e 100644 --- a/modules/Users/views/Login.php +++ b/modules/Users/views/Login.php @@ -8,6 +8,7 @@ * All Rights Reserved. ************************************************************************************/ +vimport('~~/vtlib/Vtiger/Net/Client.php'); class Users_Login_View extends Vtiger_View_Controller { function loginRequired() { @@ -30,7 +31,47 @@ class Users_Login_View extends Vtiger_View_Controller { } function process (Vtiger_Request $request) { + $jsonData = array(); + $marketingJsonUrl = vglobal('MARKETING_JSON_URL'); + if ($marketingJsonUrl && !filter_var($marketingJsonUrl, FILTER_VALIDATE_URL) === false) { + $clientModel = new Vtiger_Net_Client($marketingJsonUrl); + if ($clientModel) { + $jsonData = $clientModel->doGet(); + $jsonData = Zend_Json::decode($jsonData); + if ($jsonData) { + $oldTextLength = vglobal('listview_max_textlength'); + foreach ($jsonData as $blockName => $blockData) { + vglobal('listview_max_textlength', $blockData['title_length']); + $blockData['displayTitle'] = textlength_check($blockData['title']); + + vglobal('listview_max_textlength', $blockData['summary_length']); + $blockData['displaySummary'] = textlength_check($blockData['summary']); + $jsonData[$blockName] = $blockData; + } + vglobal('listview_max_textlength', $oldTextLength); + } + } + } + $viewer = $this->getViewer($request); + $viewer->assign('JSON_DATA', $jsonData); + + $mailStatus = $request->get('mailStatus'); + $error = $request->get('error'); + $message = ''; + if ($error) { + switch ($error) { + case 'login' : $message = 'Invalid credentials'; break; + case 'fpError' : $message = 'Invalid Username or Email address'; break; + case 'statusError' : $message = 'Outgoing mail server was not configured'; break; + } + } else if ($mailStatus) { + $message = 'Mail has been sent to your inbox, please check your e-mail'; + } + + $viewer->assign('ERROR', $error); + $viewer->assign('MESSAGE', $message); + $viewer->assign('MAIL_STATUS', $mailStatus); $viewer->view('Login.tpl', 'Users'); } diff --git a/modules/Vtiger/views/List.php b/modules/Vtiger/views/List.php index b14686e6bb501661f2f164eabed028d151fb0b56..da535e853bc2cab03260c5addf012c5827492cf1 100644 --- a/modules/Vtiger/views/List.php +++ b/modules/Vtiger/views/List.php @@ -67,6 +67,8 @@ class Vtiger_List_View extends Vtiger_Index_View { $viewer->assign('QUICK_LINKS', $quickLinkModels); $this->initializeListViewContents($request, $viewer); $viewer->assign('VIEWID', $this->viewName); + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $viewer->assign('MODULE_MODEL', $moduleModel); if($display) { $this->preProcessDisplay($request); diff --git a/packages/vtiger/optional/EmailTemplates.zip b/packages/vtiger/optional/EmailTemplates.zip index ca8d54b0e7006ebcc13d712a1ff5b4ac00b7a88a..7067bee08933e07fc57493687e2390933deb1422 100644 Binary files a/packages/vtiger/optional/EmailTemplates.zip and b/packages/vtiger/optional/EmailTemplates.zip differ diff --git a/packages/vtiger/optional/SMSNotifier.zip b/packages/vtiger/optional/SMSNotifier.zip index 12b3640debe440698ab53d64d60b7d7cbf1209fd..36e52bee95cba261429cfcf999cdf0ef58466fbe 100644 Binary files a/packages/vtiger/optional/SMSNotifier.zip and b/packages/vtiger/optional/SMSNotifier.zip differ diff --git a/pkg/vtiger/modules/EmailTemplates/modules/EmailTemplates/models/Module.php b/pkg/vtiger/modules/EmailTemplates/modules/EmailTemplates/models/Module.php index 672e3d1d796384b1f6f1db52ad70fceee931e075..6e3e1dd3c16adcc747735429e810963f3653efb6 100644 --- a/pkg/vtiger/modules/EmailTemplates/modules/EmailTemplates/models/Module.php +++ b/pkg/vtiger/modules/EmailTemplates/modules/EmailTemplates/models/Module.php @@ -46,7 +46,7 @@ class EmailTemplates_Module_Model extends Vtiger_Module_Model { if($systemtemplate) { $sql = "UPDATE vtiger_emailtemplates SET templatename=?, description=?, module=?, body=?, deleted=?, systemtemplate=? WHERE templateid = ?"; } else { - $sql = "UPDATE vtiger_emailtemplates SET templatename=?, subject=?, description=?, module=?, body=?, deleted=?, systemtemplate=? WHERE templateid = ?"; + $sql = "UPDATE vtiger_emailtemplates SET templatename=?, subject=?, description=?, module=?, body=?, deleted=?, systemtemplate=? WHERE templateid = ?"; } } if(!empty($recordId) && $systemtemplate) { @@ -138,11 +138,11 @@ class EmailTemplates_Module_Model extends Vtiger_Module_Model { $logoPath = $site_URL . '/' . $companyModuleModel->getLogoPath(); foreach ($basicFields as $columnName => $value) { //For column logo we need place logo in content - if($columnName == 'logo'){ - $allFields[] = array($moduleName.':'. vtranslate($columnName, $qualifiedModule),"<img src='".$logoPath."'>"); - } else { - $allFields[] = array($moduleName.':'. vtranslate($columnName, $qualifiedModule),"$".strtolower("companydetails")."-".$columnName."$"); - } + if($columnName == 'logo'){ + $allFields[] = array($moduleName.':'. vtranslate($columnName, $qualifiedModule),"$$columnName$"); + } else { + $allFields[] = array($moduleName.':'. vtranslate($columnName, $qualifiedModule),"$".strtolower("companydetails")."-".$columnName."$"); + } } // Social links will be having hyperlink redirected to URL mentioned foreach($socialFields as $columnName => $value){ @@ -188,8 +188,8 @@ class EmailTemplates_Module_Model extends Vtiger_Module_Model { $moduleFields = $meta->getModuleFields(); $db = PearDatabase::getInstance(); //adding record id merge tag option - $fieldInfo = array('columnname' => 'id','fieldname' => 'id','fieldlabel' =>vtranslate('LBL_RECORD_ID', $this->getName())); - $recordIdField = WebserviceField::fromArray($db, $fieldInfo); + $fieldInfo = array('columnname' => 'id','fieldname' => 'id','fieldlabel' =>vtranslate('LBL_RECORD_ID', $this->getName())); + $recordIdField = WebserviceField::fromArray($db, $fieldInfo); $moduleFields[$recordIdField->getFieldName()] = $recordIdField; $returnData = array(); @@ -233,7 +233,7 @@ class EmailTemplates_Module_Model extends Vtiger_Module_Model { continue; } if($relModule == 'Users') { - if(in_array($relModuleField->getFieldDataType(),array('string','phone','email','text'))) { + if(in_array($relModuleField->getFieldDataType(),array('string','phone','email','text'))) { $skipFields = array(98,115,116,31,32); if(!in_array($relModuleField->getUIType(), $skipFields) && $relModuleField->getFieldName() != 'asterisk_extension'){ $relModuleFieldList[] = array('module' => $relModule, 'fieldname' => $relModuleField->getFieldName(), 'columnname' => $relModuleField->getColumnName(), 'fieldlabel' => $relModuleField->getFieldLabelKey()); @@ -254,8 +254,8 @@ class EmailTemplates_Module_Model extends Vtiger_Module_Model { $db = PearDatabase::getInstance(); // Get modules names only those are active $query = 'SELECT DISTINCT(name) AS modulename FROM vtiger_tab - LEFT JOIN vtiger_field ON vtiger_field.tabid = vtiger_tab.tabid - WHERE (vtiger_field.uitype = ? AND vtiger_tab.presence = ?) '; + LEFT JOIN vtiger_field ON vtiger_field.tabid = vtiger_tab.tabid + WHERE (vtiger_field.uitype = ? AND vtiger_tab.presence = ?) '; $params = array('13',0); // Check whether calendar module is active or not. if(vtlib_isModuleActive("Calendar")){ diff --git a/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/models/Module.php b/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/models/Module.php index 5a40fda4abc400f9052f86de73a1a171fde312dc..6d1e11c45476c8adcd9499bea35a7770ab1ab724 100644 --- a/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/models/Module.php +++ b/pkg/vtiger/modules/SMSNotifier/modules/SMSNotifier/models/Module.php @@ -33,7 +33,7 @@ class SMSNotifier_Module_Model extends Vtiger_Module_Model { * @return <boolean> */ public function isPermitted($actionName) { - if ($actionName === 'EditView') { + if ($actionName === 'EditView' || $actionName === 'CreateView') { return false; } return Users_Privileges_Model::isPermitted($this->getName(), $actionName);