Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • vtiger/vtigercrm
  • varma/vtigercrm
  • alanbell/vtigercrm
  • mariusz.krzaczkowski/vtigercrm
  • manu.k/vtigercrm
  • adrgranado/vtigercrm
  • uma.s/vtigercrm
  • sardoj/vtigercrm
  • preexo/vtigercrm
  • david.valminos/vtigercrm
  • luca.saba/vtigercrm
  • dubwise/vtigercrm
  • valmir.ttcasolucoes/vtigercrm
  • lord_alan/vtigercrm
  • adrien.futschik/vtigercrm
  • edonit.rexhepi/vtigercrm
  • robert.heinze/vtigercrm
  • nrdimatteo/vtigercrm
  • sebastianzahan/vtigercrm
  • Miky/vtigercrm
  • germanf/vtigercrm
  • bernhardkau1/vtigercrm
  • olegtsoy/vtigercrm
  • grandel/vtigercrm
  • mario.thummler/vtigercrm
  • sutharsan/vtigercrm
  • james.douglas/vtigercrm
  • vikas/vtigercrm
  • jeffmchristensen/vtigercrm
  • lukasz.g/vtigercrm
  • nicolas.gasnier/vtigercrm
  • hamish.theitcompany/vtigercrm
  • engrbm87/vtigercrm
  • Quoc/vtigercrm
  • peter.maria.engeli/vtigercrm
  • kiranraju.j/vtigercrm
  • manuel.lozano/vtigercrm
  • dhaupin/vtigercrm
  • Ragupathyranesh/vtigercrm
  • Stefanbauer/vtigercrm
  • ruben.estrada/vtigercrm
  • sg_mwi1/vtigercrm
  • khaluk/vtigercrm
  • franzfroemel/vtigercrm
  • milan9615/vtigercrm
  • carlos.martin/vtigercrm
  • cmaggi/vtigercrm
  • Soltoon.theLeader/vtigercrm
  • alex.kaplun/vtigercrm
  • navid.hosseini/vtigercrm
  • maie/vtigercrm
  • simonetravaglini/vtigercrm
  • bertrand.wattel/vtigercrm
  • balaji.m/vtigercrm
  • mclarke4/vtigercrm
  • lajeeshk/vtigercrm
  • liam/vtigercrm
  • novikov.sergey/vtigercrm
  • johnwayne.williamson/vtigercrm
  • florian.strahberger-schramm/vtigercrm
  • daniel.schaefer/vtigercrm
  • christopher.gunther/vtigercrm
  • adrien.faveraux/vtigercrm
  • carsten.brandt/vtigercrm
  • stephane.molano/vtigercrm
  • krastan.petrov/vtigercrm
  • alfredo.bravo/vtigercrm
  • flipflop.Joe/vtigercrm
  • mirko.stagni/vtigercrm
  • remigio.ruberto/vtigercrm
  • gautam.dhudashiya/vtigercrm
  • manish.devitechnosolutions1/vtigercrm
  • matinbeigi/vtigercrm
  • devs/vtigercrm
  • happy.dev/vtigercrm
  • m.gigon/vtigercrm
  • manuelmigone/vtigercrm
  • eduardo.gqf/vtigercrm
  • elsayedEl-araby/vtigercrm
  • mirza.mehran/vtigercrm
  • maurice.courtois/vtigercrm
  • zuhri.utama/vtigercrm
  • shilpa.k/vtigercrm
  • Ignazio/vtigercrm
  • code80team/vtigercrm
  • code80/vtigercrm
  • nilay.automatesmb/cache
  • greeshma.kk/vtigercrm
  • vijay.tilak/vtigercrm
  • Paolo.Palamini/vtigercrm
  • estevan/vtigercrm
  • mobilcmcdk/vtigercrm
  • massimiliano.vessi/vtigercrm
  • daniel.voelskow/vtigercrm
  • james1/vtigercrm
  • lokesh.s/vtigercrm
  • rdb/vtigercrm
  • neftaliyagua/vtigercrm
  • angelo.paglialonga/vtigercrm
  • webmarka/vtigercrm
  • javanile/vtigercrm
  • akshath/vtigercrm
  • Hemanth/vtigercrm
  • opencrmitalia/vtigercrm
  • direzione/vtigercrm
  • umadas306/vtigercrm
  • jd-wraptec/vtigercrm
  • felipe.camacho/vtigercrm
  • Martin.allen/vtigercrm
  • amit.r/vtigercrm
  • vicus/vtigercrm
  • dev.osmi/vtigercrm
  • laurent.guillout/vtigercrm
  • christian.blaeul/vtigercrm
  • ap.js100/vtigercrm
  • yoann.mourot/vtigercrm-temp
  • christian.cruz/vtigercrm
  • zyli/vtigercrm
  • kaushik.p/vtigercrm
  • Madhuk/vtigercrm
  • cinakzm/vtigercrm
  • raquel.martinez/vtigercrm
  • tosajibadhi/vtigercrm
  • melvin.i/vtigercrm-melvin
  • ashashingadia/vtigercrm
  • stefanwarnat/vtigercrm
  • saran.s/vtigercrm
  • eduardomozart/vtigercrm
  • Daniel.Lennartz1/vtigercrm
  • juergen.fassmann/vtigercrm
  • Michel.Ram/vtigercrm
  • vincenzo.bruno/vtigercrm
132 results
Show changes
Commits on Source (1125)
Showing
with 1446 additions and 65 deletions
vendor/*
!vendor/.htaccess
.vscode/*
\ No newline at end of file
......@@ -99,6 +99,7 @@ $GLOBALS['_PEAR_error_handler_stack'] = array();
* @since Class available since PHP 4.0.2
* @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear
*/
#[\AllowDynamicProperties]
class PEAR
{
// {{{ properties
......@@ -814,6 +815,7 @@ function _PEAR_call_destructors()
* @see PEAR::raiseError(), PEAR::throwError()
* @since Class available since PHP 4.0.2
*/
#[\AllowDynamicProperties]
class PEAR_Error
{
// {{{ properties
......
Vtiger CRM
==========
# Vtiger CRM
Vtiger is a PHP based web application that enables businesses to increase sales wins, marketing ROI, and support satisfaction by providing tools for employees and management work more effectively, capture more data, and derive new actionable insights from across the customer lifecycle.
Get involved
------------
## Get involved
Development on vtiger is done at https://code.vtiger.com
......@@ -40,6 +38,8 @@ you will switch to that branch using the checkout command
git branch fix_projects_on_calendar
git checkout fix_projects_on_calendar
Before you install, you need to run ```composer update```
Now you can make your changes and commit all changed files with
git commit -a
......
{
"name": "vtiger/vtigercrm",
"description": "Vtiger CRM",
"type": "project",
"license": "VPL",
"authors": [
{
"name": "Vtiger",
"email": "info@vtiger.com"
}
],
"autoload": {
"files": ["includes/Loader.php"]
},
"minimum-stability": "stable",
"require": {
"php": ">=8.1",
"ext-mysqli": "*",
"ext-imap": "*",
"ext-curl": "*",
"smarty/smarty": "^4.3",
"dg/rss-php": "^1.5",
"ezyang/htmlpurifier": "^4.16",
"tecnickcom/tcpdf": "^6.6",
"monolog/monolog": "^3.5",
"league/oauth2-client": "^2.7",
"phpmailer/phpmailer": "^6.9",
"league/oauth2-google": "^4.0"
}
}
This diff is collapsed.
......@@ -9,8 +9,8 @@
************************************************************************************/
/* Performance paramters can be configured to fine tune vtiger CRM runtime */
$PERFORMANCE_CONFIG = Array(
// Enable log4php debugging only if requried
'LOG4PHP_DEBUG' => false,
// Enable Vtiger Log Level for debugging only if requried
'LOGLEVEL_DEBUG' => false,
// Should the caller information be captured in SQL Logging?
// It adds little overhead for performance but will be useful to debug
......
......@@ -22,6 +22,11 @@ include('config.inc.php');
$THIS_DIR = dirname(__FILE__);
/* Pre-install overrides */
if (!isset($dbconfig)) {
error_reporting(E_ERROR & ~E_NOTICE & ~E_DEPRECATED);
}
if (file_exists($THIS_DIR.'/config_override.php')) {
include_once $THIS_DIR.'/config_override.php';
}
......
......@@ -111,7 +111,7 @@ $allow_exports = 'all';
// files with one of these extensions will have '.txt' appended to their filename on upload
// upload_badext default value = php, php3, php4, php5, pl, cgi, py, asp, cfm, js, vbs, html, htm
$upload_badext = array('php', 'php3', 'php4', 'php5', 'pl', 'cgi', 'py', 'asp', 'cfm', 'js', 'vbs', 'html', 'htm', 'exe', 'bin', 'bat', 'sh', 'dll', 'phps', 'phtml', 'xhtml', 'rb', 'msi', 'jsp', 'shtml', 'sth', 'shtm');
$upload_badext = array('php', 'php3', 'php4', 'php5', 'pl', 'cgi', 'py', 'asp', 'cfm', 'js', 'vbs', 'html', 'htm', 'exe', 'bin', 'bat', 'sh', 'dll', 'phps', 'phtml', 'xhtml', 'rb', 'msi', 'jsp', 'shtml', 'sth', 'shtm', 'htaccess', 'phar');
// list_max_entries_per_page default value = 20
$list_max_entries_per_page = '20';
......
<?php
/** Logging configuration for Strict Development */
require_once "vtlib/Vtiger/Utils/PhpLogHandler.php";
Vtiger_PhpLogHandler::enableStrictLogging(__DIR__, "logs/phperr.log");
......@@ -22,8 +22,8 @@
//file modified by richie
require_once('include/utils/utils.php');
require_once("modules/Emails/class.smtp.php");
require_once("modules/Emails/class.phpmailer.php");
//require_once("modules/Emails/class.smtp.php");
//require_once("modules/Emails/class.phpmailer.php");
require_once("modules/Emails/mail.php");
require_once('include/logging.php');
require_once("config.php");
......@@ -197,8 +197,8 @@ if($adb->num_rows($result) >= 1)
if(php7_count($to_addr) >=1)
{
send_email($to_addr,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password);
$upd_query = "UPDATE vtiger_activity_reminder SET reminder_sent = ?";
$upd_params = array(1);
$upd_query = "UPDATE vtiger_activity_reminder SET reminder_sent = ? WHERE activity_id = ?";
$upd_params = array('1',$activity_id);
if($recur_id!=0)
{
......@@ -232,7 +232,7 @@ function send_email($to,$from,$subject,$contents,$mail_server,$mail_server_usern
$log->info("This is send_mail function in SendReminder.php(vtiger home).");
global $root_directory;
$mail = new PHPMailer();
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->Subject = $subject;
......
<?php
/*+***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*************************************************************************************/
require_once 'modules/Oauth2/handlers/TokenRefresher.php';
$tokenRefresher = new Oauth2_TokenRefresher_Handler();
$tokenRefresher->refreshAll();
\ No newline at end of file
......@@ -22,13 +22,13 @@
//file modified by richie
require_once("modules/Emails/class.smtp.php");
require_once("modules/Emails/class.phpmailer.php");
// require_once("modules/Emails/class.smtp.php");
// require_once("modules/Emails/class.phpmailer.php");
require_once 'include/utils/CommonUtils.php';
function sendmail($to,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password,$filename,$smtp_auth='')
{
$mail = new PHPMailer();
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->Subject = $subject;
$mail->Body = $contents;//"This is the HTML message body <b>in bold!</b>";
......
......@@ -28,12 +28,14 @@ require_once('include/utils/UserInfoUtil.php');
require_once("include/Zend/Json.php");
require_once 'include/RelatedListView.php';
#[\AllowDynamicProperties]
class CRMEntity {
var $ownedby;
var $recordSource = 'CRM';
var $mode;
public $moduleName;
/**
* Detect if we are in bulk save mode, where some features can be turned-off
* to improve performance.
......@@ -158,7 +160,7 @@ class CRMEntity {
*/
function uploadAndSaveFile($id, $module, $file_details, $attachmentType='Attachment') {
global $log;
$log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method.");
$log->debug("Entering into uploadAndSaveFile($id,$module) method.");
global $adb, $current_user;
global $upload_badext;
......@@ -177,7 +179,7 @@ class CRMEntity {
}
// Check 1
$save_file = 'true';
$save_file = true;
//only images are allowed for Image Attachmenttype
$mimeType = vtlib_mime_content_type($file_details['tmp_name']);
$mimeTypeContents = explode('/', $mimeType);
......@@ -186,12 +188,12 @@ class CRMEntity {
$save_file = validateImageFile($file_details);
}
$log->debug("File Validation status in Check1 save_file => $save_file");
if ($save_file == 'false') {
if (!$save_file) {
return false;
}
// Check 2
$save_file = 'true';
$save_file = true;
//only images are allowed for these modules
if ($module == 'Contacts' || $module == 'Products') {
$save_file = validateImageFile($file_details);
......@@ -213,7 +215,7 @@ class CRMEntity {
$upload_status = copy($filetmp_name, $upload_file_path . $current_id . "_" . $encryptFileName);
// temporary file will be deleted at the end of request
$log->debug("Upload status of file => $upload_status");
if ($save_file == 'true' && $upload_status == 'true') {
if ($save_file && $upload_status == 'true') {
if($attachmentType != 'Image' && $this->mode == 'edit') {
//Only one Attachment per entity delete previous attachments
$res = $adb->pquery('SELECT vtiger_seattachmentsrel.attachmentsid FROM vtiger_seattachmentsrel
......@@ -268,6 +270,7 @@ class CRMEntity {
$ownerid = $this->column_fields['assigned_user_id'];
$groupid = $this->column_fields['group_id'];
$insertion_mode = $this->mode;
if (empty($groupid))
$groupid = 0;
......@@ -408,12 +411,13 @@ class CRMEntity {
global $current_user, $app_strings;
$log->info("function insertIntoEntityTable " . $module . ' vtiger_table name ' . $table_name);
global $adb;
global $_FILES;
$insertion_mode = $this->mode;
$table_name = Vtiger_Util_Helper::validateStringForSql($table_name);
$tablekey = $this->tab_name_index[$table_name];
//Checkin whether an entry is already is present in the vtiger_table to update
if ($insertion_mode == 'edit') {
$tablekey = $this->tab_name_index[$table_name];
// Make selection on the primary key of the module table to check.
$check_query = "select $tablekey from $table_name where $tablekey=?";
$check_params = array($this->id);
......@@ -570,7 +574,7 @@ class CRMEntity {
} else {
$fldvalue = $this->column_fields[$fieldname];
}
} elseif ($uitype == 7) {
} elseif ($uitype == 7 || $uitype == 9) {
//strip out the spaces and commas in numbers if given ie., in amounts there may be ,
$fldvalue = str_replace(",", "", $this->column_fields[$fieldname]); //trim($this->column_fields[$fieldname],",");
if (in_array($datatype, array('N', 'NN'))) {
......@@ -598,7 +602,7 @@ class CRMEntity {
$fldvalue = decode_html($this->column_fields[$fieldname]);
}
} elseif ($uitype == 8) {
$this->column_fields[$fieldname] = rtrim($this->column_fields[$fieldname], ',');
$this->column_fields[$fieldname] = isset($this->column_fields[$fieldname]) ? rtrim($this->column_fields[$fieldname], ',') : '';
$ids = explode(',', $this->column_fields[$fieldname]);
$json = new Zend_Json();
$fldvalue = $json->encode($ids);
......@@ -646,9 +650,9 @@ class CRMEntity {
if(php7_count($IMG_FILES)){
foreach($IMG_FILES as $fileIndex => $file) {
if($file['error'] == 0 && $file['name'] != '' && $file['size'] > 0) {
if($_REQUEST[$fileIndex.'_hidden'] != '')
$file['original_name'] = vtlib_purify($_REQUEST[$fileindex.'_hidden']);
else {
if(isset($_REQUEST[$fileIndex.'_hidden']) && $_REQUEST[$fileIndex.'_hidden'] != '') {
$file['original_name'] = vtlib_purify($_REQUEST[$fileIndex.'_hidden']);
} else {
$file['original_name'] = stripslashes($file['name']);
}
$file['original_name'] = str_replace('"','',$file['original_name']);
......@@ -665,7 +669,7 @@ class CRMEntity {
$skipUpdateForField = true;
}
}
if (($insertion_mode == 'edit' && $skipUpdateForField == false) || $_REQUEST['imgDeleted']) {
if (($insertion_mode == 'edit' && $skipUpdateForField == false) || (isset($_REQUEST['imgDeleted']) && $_REQUEST['imgDeleted'])) {
$skipUpdateForField = false;
$uploadedFileNames = array();
$getImageNamesSql = 'SELECT name FROM vtiger_seattachmentsrel INNER JOIN vtiger_attachments ON
......@@ -685,8 +689,8 @@ class CRMEntity {
$uploadedFileNames = array();
foreach($UPLOADED_FILES as $fileIndex => $file) {
if($file['error'] == 0 && $file['name'] != '' && $file['size'] > 0) {
if($_REQUEST[$fileindex.'_hidden'] != '') {
$file['original_name'] = vtlib_purify($_REQUEST[$fileindex.'_hidden']);
if(isset($_REQUEST[$fileIndex.'_hidden']) && $_REQUEST[$fileIndex.'_hidden'] != '') {
$file['original_name'] = vtlib_purify($_REQUEST[$fileIndex.'_hidden']);
} else {
$file['original_name'] = stripslashes($file['name']);
}
......@@ -744,8 +748,12 @@ class CRMEntity {
$update = array();
$update_params = array();
foreach($changedFields as $field) {
if (!array_key_exists($field, $updateFieldNameColumnNameMap)) {
continue;
}
$fieldColumn = $updateFieldNameColumnNameMap[$field];
if(@array_key_exists($fieldColumn, $updateFieldValues)) {
if(array_key_exists($fieldColumn, $updateFieldValues)) {
array_push($update, $fieldColumn.'=?');
array_push($update_params, $updateFieldValues[$fieldColumn]);
}
......@@ -951,6 +959,13 @@ class CRMEntity {
if (isset($resultrow[$fieldkey])) {
$fieldvalue = $resultrow[$fieldkey];
}
// load picklist value with umlatus with explict decoding
// required for field-value strict check during save.
if ($fieldinfo["uitype"] == 15 || $fieldinfo["uitype"] == 16) {
$fieldvalue = decode_html($fieldvalue);
}
$this->column_fields[$fieldinfo['fieldname']] = $fieldvalue;
}
}
......@@ -979,7 +994,7 @@ class CRMEntity {
//Event triggering code
require_once("include/events/include.inc");
$em = null;
//In Bulk mode stop triggering events
if(!self::isBulkSaveMode()) {
$em = new VTEventsManager($adb);
......@@ -2033,7 +2048,7 @@ class CRMEntity {
*/
function transferRelatedRecords($module, $transferEntityIds, $entityId) {
global $adb, $log;
$log->debug("Entering function transferRelatedRecords ($module, $transferEntityIds, $entityId)");
$log->debug("Entering function transferRelatedRecords ($module, ".implode(',',$transferEntityIds).", $entityId)");
foreach ($transferEntityIds as $transferId) {
// Pick the records related to the entity to be transfered, but do not pick the once which are already related to the current entity.
......@@ -2398,7 +2413,7 @@ class CRMEntity {
where vtiger_role.parentrole like '" . $current_user_parent_role_seq . "::%') or vtiger_crmentity.smownerid
in(select shareduserid from vtiger_tmp_read_user_sharing_per
where userid=" . $current_user->id . " and tabid=" . $tabid . ") or (";
if (sizeof($current_user_groups) > 0) {
if (php7_sizeof($current_user_groups) > 0) {
$sec_query .= " vtiger_crmentity.smownerid in (" . implode(",", $current_user_groups) . ") or ";
}
$sec_query .= " vtiger_crmentity.smownerid in(select vtiger_tmp_read_group_sharing_per.sharedgroupid
......@@ -2422,7 +2437,7 @@ class CRMEntity {
$fields[] = $value;
}
$pritablename = $tables[0];
$sectablename = $tables[1];
$sectablename = isset($tables[1]) ? $tables[1] : '';
$prifieldname = $fields[0][0];
$secfieldname = $fields[0][1];
$tmpname = $pritablename . 'tmp' . $secmodule;
......@@ -2462,7 +2477,7 @@ class CRMEntity {
$secQuery = 'SELECT '.$selectColumns.' '.$secQueryFrom;
$secQueryTempTableQuery = $queryPlanner->registerTempTable($secQuery, array($column_name, $fields[1], $prifieldname),$secmodule);
$secQueryTempTableQuery = $queryPlanner->registerTempTable($secQuery, array($column_name, isset($fields[1]) ? $fields[1] : '', $prifieldname),$secmodule);
$query = '';
if ($pritablename == 'vtiger_crmentityrel') {
......@@ -2779,7 +2794,7 @@ class CRMEntity {
* @param <type> $userGroups
*/
function getNonAdminUserGroupAccessQuery($userGroups) {
$query .= " UNION (SELECT groupid FROM vtiger_groups WHERE groupid IN (".implode(",", $userGroups)."))";
$query = " UNION (SELECT groupid FROM vtiger_groups WHERE groupid IN (".implode(",", $userGroups)."))";
return $query;
}
......@@ -2792,7 +2807,7 @@ class CRMEntity {
require('user_privileges/sharing_privileges_' . $user->id . '.php');
$tabId = getTabid($module);
$sharingRuleInfoVariable = $module . '_share_read_permission';
$sharingRuleInfo = $$sharingRuleInfoVariable;
$sharingRuleInfo = isset($$sharingRuleInfoVariable) ? $$sharingRuleInfoVariable : array();
$sharedTabId = null;
$query = '';
if (!empty($sharingRuleInfo) && (php7_count($sharingRuleInfo['ROLE']) > 0 ||
......@@ -2998,9 +3013,11 @@ class CRMEntity {
* @param <String> $selectedColumns
* @param <Boolean> $ignoreEmpty
* @param <Array> $requiredTables
* @param <Array> $columnTypes
* @return string
*/
function getQueryForDuplicates($module, $tableColumns, $selectedColumns = '', $ignoreEmpty = false,$requiredTables = array()) {
function getQueryForDuplicates($module, $tableColumns, $selectedColumns = '', $ignoreEmpty = false,$requiredTables = array(),$columnTypes = null) {
$query='';
if(is_array($tableColumns)) {
$tableColumnsString = implode(',', $tableColumns);
}
......@@ -3030,7 +3047,11 @@ class CRMEntity {
if($ignoreEmpty) {
foreach($tableColumns as $tableColumn){
$whereClause .= " AND ($tableColumn IS NOT NULL AND $tableColumn != '') ";
if ($columnTypes && ($columnTypes[$tableColumn] == "date" || $columnTypes[$tableColumn] == "datetime")) {
$whereClause .= " AND ($tableColumn IS NOT NULL) ";
} else {
$whereClause .= " AND ($tableColumn IS NOT NULL AND $tableColumn != '') ";
}
}
}
......@@ -3047,6 +3068,7 @@ class CRMEntity {
}
$i = 1;
$duplicateCheckClause='';
foreach($tableColumns as $tableColumn){
$tableInfo = explode('.', $tableColumn);
$duplicateCheckClause .= " ifnull($tableColumn,'null') = ifnull(temp.$tableInfo[1],'null')";
......@@ -3111,6 +3133,7 @@ class CRMEntity {
}
}
#[\AllowDynamicProperties]
class TrackableObject implements ArrayAccess, IteratorAggregate {
private $storage;
private $trackingEnabled = true;
......@@ -3120,11 +3143,14 @@ class TrackableObject implements ArrayAccess, IteratorAggregate {
$this->storage = $value;
}
#[\ReturnTypeWillChange]
function offsetExists($key) {
return isset($this->storage[$key]);
return isset($this->storage[$key]) || array_key_exists($key, $this->storage);
}
#[\ReturnTypeWillChange]
function offsetSet($key, $value) {
if(is_array($value)) $value = empty($value) ? "" : (array_key_exists(0, $value) ? $value[0] : ""); //it is an associative (if array without a key 0) modified to prevent warning of Undefined array key 0 .
if($this->tracking && $this->trackingEnabled) {
$olderValue = $this->offsetGet($key);
// decode_html only expects string
......@@ -3137,14 +3163,17 @@ class TrackableObject implements ArrayAccess, IteratorAggregate {
$this->storage[$key] = $value;
}
#[\ReturnTypeWillChange]
public function offsetUnset($key) {
unset($this->storage[$key]);
}
#[\ReturnTypeWillChange]
public function offsetGet($key) {
return isset($this->storage[$key]) ? $this->storage[$key] : null;
return isset($this->storage[$key]) || array_key_exists($key, $this->storage) ? $this->storage[$key] : null;
}
#[\ReturnTypeWillChange]
public function getIterator() {
$iterator = new ArrayObject($this->storage);
return $iterator->getIterator();
......@@ -3181,4 +3210,4 @@ class TrackableObject implements ArrayAccess, IteratorAggregate {
function getColumnFieldNames(){
return array_keys($this->storage);
}
}
\ No newline at end of file
}
......@@ -92,12 +92,12 @@ class VTEntityDelta extends VTEventHandler {
function getOldValue($moduleName, $recordId, $fieldName) {
$entityDelta = self::$entityDelta[$moduleName][$recordId];
return $entityDelta[$fieldName]['oldValue'];
return isset($entityDelta[$fieldName]['oldValue']) ? $entityDelta[$fieldName]['oldValue'] : "";
}
function getCurrentValue($moduleName, $recordId, $fieldName) {
$entityDelta = self::$entityDelta[$moduleName][$recordId];
return $entityDelta[$fieldName]['currentValue'];
return isset($entityDelta[$fieldName]['currentValue']) ? $entityDelta[$fieldName]['currentValue'] : "";
}
function getOldEntity($moduleName, $recordId) {
......@@ -109,19 +109,25 @@ class VTEntityDelta extends VTEventHandler {
}
function hasChanged($moduleName, $recordId, $fieldName, $fieldValue = NULL) {
$result = false;
if(empty(self::$oldEntity[$moduleName][$recordId])) {
return false;
}
if (!array_key_exists($fieldName, self::$entityDelta[$moduleName][$recordId])) {
return false;
}
$fieldDelta = self::$entityDelta[$moduleName][$recordId][$fieldName];
if(is_array($fieldDelta)) {
$fieldDelta = array_map('decode_html', $fieldDelta);
}
$result = $fieldDelta['oldValue'] != $fieldDelta['currentValue'];
if(isset($fieldDelta['oldValue']) && isset($fieldDelta['currentValue'])) {
$result = $fieldDelta['oldValue'] != $fieldDelta['currentValue'];
}
if ($fieldValue !== NULL) {
$result = $result && ($fieldDelta['currentValue'] === $fieldValue);
}
return $result;
}
}
}
?>
\ No newline at end of file
?>
......@@ -54,6 +54,15 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
$mail->Subject = $subject;
$mail->AddAddress($email);
// ensure default sender if not coming from outgoing server
if (!$mail->From) {
global $HELPDESK_SUPPORT_EMAIL_ID;
// use only when config val is valid
if (strpos($HELPDESK_SUPPORT_EMAIL_ID, "@") !== false) {
$mail->From = $HELPDESK_SUPPORT_EMAIL_ID;
}
}
$status = $mail->Send(true);
if ($status === 1 || $status === true) {
header('Location: index.php?modules=Users&view=Login&mailStatus=success');
......
......@@ -370,7 +370,7 @@ Class ChartUtils {
if ($fieldDetails != '') {
list($tablename, $colname, $module_field, $fieldname, $single) = explode(":", $fieldDetails);
list($module, $field) = split("_", $module_field);
list($module, $field) = explode('_', $module_field);
$dateField = false;
if ($single == 'D') {
$dateField = true;
......
......@@ -355,8 +355,7 @@ $combo_strings = Array(
);
require_once('modules/Users/UserTimeZonesArray.php');
$usertimezonesClass = new UserTimeZones();
$arrayOfSupportedTimeZones = $usertimezonesClass->userTimeZones();
$arrayOfSupportedTimeZones = UserTimeZones::getAll();
$combo_strings['time_zone_dom'] = array_combine($arrayOfSupportedTimeZones,$arrayOfSupportedTimeZones);
?>
......
......@@ -17,7 +17,7 @@ include_once 'vtlib/Vtiger/PDF/inventory/ContentViewer2.php';
include_once 'vtlib/Vtiger/PDF/viewers/PagerViewer.php';
include_once 'vtlib/Vtiger/PDF/PDFGenerator.php';
include_once 'data/CRMEntity.php';
#[\AllowDynamicProperties]
class Vtiger_InventoryPDFController {
protected $module;
......@@ -114,7 +114,7 @@ class Vtiger_InventoryPDFController {
$taxable_total = number_format($taxable_total, $no_of_decimal_places,'.','');
$producttotal = $taxable_total;
if($this->focus->column_fields["hdnTaxType"] == "individual") {
for($tax_count=0;$tax_count<php7_count($productLineItem['taxes']);$tax_count++) {
foreach($productLineItem['taxes'] as $tax_count => $productLinetItemTaxInfo) {
$tax_percent = $productLineItem['taxes'][$tax_count]['percentage'];
$total_tax_percent += $tax_percent;
$tax_amount = (($taxable_total*$tax_percent)/100);
......@@ -131,7 +131,7 @@ class Vtiger_InventoryPDFController {
$discountPercentage = $productLineItem["discount_percent{$productLineItemIndex}"];
$productName = decode_html($productLineItem["productName{$productLineItemIndex}"]);
//get the sub product
$subProducts = $productLineItem["subProductArray{$productLineItemIndex}"];
$subProducts = isset($productLineItem["subProductArray{$productLineItemIndex}"]) ? $productLineItem["subProductArray{$productLineItemIndex}"] : "";
if($subProducts != '') {
foreach($subProducts as $subProduct) {
$productName .="\n"." - ".decode_html($subProduct);
......@@ -201,14 +201,14 @@ class Vtiger_InventoryPDFController {
//To calculate the group tax amount
if($final_details['taxtype'] == 'group') {
$group_tax_details = $final_details['taxes'];
for($i=0;$i<php7_count($group_tax_details);$i++) {
$group_total_tax_percent += $group_tax_details[$i]['percentage'];
foreach($group_tax_details as $i => $group_tax_info) {
$group_total_tax_percent += isset($group_tax_details[$i]['percentage']) ? $group_tax_details[$i]['percentage'] : 0.00;
}
$summaryModel->set(getTranslatedString("Tax:", $this->moduleName)."($group_total_tax_percent%)", $this->formatPrice($final_details['tax_totalamount']));
}
//Shipping & Handling taxes
$sh_tax_details = $final_details['sh_taxes'];
for($i=0;$i<php7_count($sh_tax_details);$i++) {
foreach($sh_tax_details as $i => $sh_tax_info) {
$sh_tax_percent = $sh_tax_percent + $sh_tax_details[$i]['percentage'];
}
//obtain the Currency Symbol
......@@ -429,4 +429,4 @@ class Vtiger_InventoryPDFController {
}
}
?>
\ No newline at end of file
?>
......@@ -228,11 +228,16 @@ class ListViewController {
}
$moduleInstance = Vtiger_Module_Model::getInstance("PBXManager");
$outgoingCallPermission = false;
if($moduleInstance && $moduleInstance->isActive()) {
$outgoingCallPermission = PBXManager_Server_Model::checkPermissionForOutgoingCall();
$clickToCallLabel = vtranslate("LBL_CLICK_TO_CALL");
}
$emailModuleInstance = Vtiger_Module_Model::getInstance("Emails");
//checking the email module is active.
$isEmailModuleActive = $emailModuleInstance ? $emailModuleInstance->isActive() : false;
$data = array();
for ($i = 0; $i < $rowCount; ++$i) {
//Getting the recordId
......@@ -268,7 +273,7 @@ class ListViewController {
}
if(in_array($uitype,array(15,33,16))){
$value = html_entity_decode($rawValue,ENT_QUOTES,$default_charset);
$value = isset($rawValue) ? html_entity_decode($rawValue,ENT_QUOTES,$default_charset) : '';
} else {
$value = $rawValue;
}
......@@ -300,7 +305,6 @@ class ListViewController {
} else{
$value = textlength_check($value);
}
$value = $fileicon.$value;
} elseif($module == 'Documents' && $fieldName == 'filesize') {
$downloadType = $db->query_result($result,$i,'filelocationtype');
if($downloadType == 'I') {
......@@ -412,7 +416,8 @@ class ListViewController {
}
} elseif ($fieldDataType == 'email') {
global $current_user;
if($current_user->internal_mailer == 1){
// checking email module is active and internal mail composer is on
if($isEmailModuleActive && $current_user->internal_mailer == 1){
//check added for email link in user detailview
$value = "<a class='emailField' data-rawvalue=\"$rawValue\" onclick=\"Vtiger_Helper_Js.getInternalMailer($recordId,".
"'$fieldName','$module');\">".textlength_check($value)."</a>";
......@@ -459,7 +464,7 @@ class ListViewController {
if(php7_count($moduleList) == 1) {
$parentModule = $moduleList[0];
} else {
$parentModule = $this->typeList[$value];
$parentModule = isset($this->typeList[$value]) ? $this->typeList[$value] : '';
}
if(!empty($value) && !empty($this->nameList[$fieldName]) && !empty($parentModule)) {
$parentMeta = $this->queryGenerator->getMeta($parentModule);
......
......@@ -75,6 +75,8 @@ class ListViewSession {
}
$cv = new CustomView();
$viewId = $cv->getViewId($currentModule);
$recordNavigationInfo = array();
$searchKey = array();
if(!empty($_SESSION[$currentModule.'_DetailView_Navigation'.$viewId])){
$recordNavigationInfo = Zend_Json::decode($_SESSION[$currentModule.'_DetailView_Navigation'.$viewId]);
$pageNumber =0;
......@@ -103,7 +105,7 @@ class ListViewSession {
}
}
$list_query = $_SESSION[$currentModule.'_listquery'];
$list_query = isset($_SESSION[$currentModule.'_listquery'])?$_SESSION[$currentModule.'_listquery']:'';
if($reUseData === false && !empty($list_query)){
$recordNavigationInfo = array();
......@@ -166,7 +168,7 @@ class ListViewSession {
$recordNavigationInfo = array();
if($searchKey !== false){
foreach ($navigationRecordList as $index => $recordId) {
if(!is_array($recordNavigationInfo[$current])){
if(!isset($recordNavigationInfo[$current])){
$recordNavigationInfo[$current] = array();
}
if($index == $firstPageRecordCount || $index == ($firstPageRecordCount+$pageCount * $list_max_entries_per_page)){
......@@ -248,4 +250,4 @@ class ListViewSession {
}
}
}
?>
\ No newline at end of file
?>