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 (772)
Showing
with 1046 additions and 101 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
......
This diff is collapsed.
......@@ -10,7 +10,7 @@
/* Performance paramters can be configured to fine tune vtiger CRM runtime */
$PERFORMANCE_CONFIG = Array(
// Enable Vtiger Log Level for debugging only if requried
'LOGLEVEl_DEBUG' => false,
'LOGLEVEL_DEBUG' => false,
// Should the caller information be captured in SQL Logging?
// It adds little overhead for performance but will be useful to debug
......
......@@ -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;
......@@ -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,6 +411,7 @@ 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];
......@@ -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.
......@@ -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,12 +3143,14 @@ class TrackableObject implements ArrayAccess, IteratorAggregate {
$this->storage = $value;
}
#[\ReturnTypeWillChange]
function offsetExists($key) {
return isset($this->storage[$key]) || array_key_exists($key, $this->storage);
}
#[\ReturnTypeWillChange]
function offsetSet($key, $value) {
if(is_array($value)) $value = empty($value) ? "" : $value[0];
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
......@@ -3138,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]) || array_key_exists($key, $this->storage) ? $this->storage[$key] : null;
}
#[\ReturnTypeWillChange]
public function getIterator() {
$iterator = new ArrayObject($this->storage);
return $iterator->getIterator();
......
......@@ -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');
......
......@@ -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
?>
......@@ -234,6 +234,10 @@ class ListViewController {
$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
......@@ -269,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;
}
......@@ -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
?>
......@@ -90,6 +90,7 @@ class EnhancedQueryGenerator extends QueryGenerator {
$dateSpecificConditions = $customView->getStdFilterConditions();
$specialDateTimeConditions = Vtiger_Functions::getSpecialDateTimeCondtions();
foreach ($advFilterList as $groupindex => $groupcolumns) {
if(! $groupcolumns)continue;
$filtercolumns = $groupcolumns['columns'];
if (php7_count($filtercolumns) > 0) {
$this->startGroup('');
......@@ -196,7 +197,7 @@ class EnhancedQueryGenerator extends QueryGenerator {
}
}
$this->endGroup();
$groupConditionGlue = $groupcolumns['condition'];
$groupConditionGlue = isset($groupcolumns['condition']) ? $groupcolumns['condition'] : "";
if ($groupConditionGlue) {
$this->addConditionGlue($groupConditionGlue);
}
......@@ -578,7 +579,7 @@ class EnhancedQueryGenerator extends QueryGenerator {
foreach ($tableJoinCondition as $fieldName => $conditionInfo) {
foreach ($conditionInfo as $tableName => $condition) {
if ($tableList[$tableName]) {
if (isset($tableList[$tableName])) {
$tableNameAlias = $tableName.'2';
$condition = str_replace($tableName, $tableNameAlias, $condition);
} else {
......
......@@ -19,6 +19,7 @@ require_once 'include/Webservices/RelatedModuleMeta.php';
*
* @author MAK
*/
#[\AllowDynamicProperties]
class QueryGenerator {
protected $module;
protected $customViewColumnList;
......@@ -52,6 +53,7 @@ class QueryGenerator {
public static $AND = 'AND';
public static $OR = 'OR';
protected $customViewFields;
protected $referenceModuleField;
/**
* Import Feature
*/
......@@ -762,7 +764,13 @@ class QueryGenerator {
$columnList[] = "$referenceTable.$column";
}
if(php7_count($columnList) > 1) {
$columnSql = getSqlForNameInDisplayFormat(array('first_name'=>$columnList[0],'last_name'=>$columnList[1]),'Users');
if ($module == "Users") {
// Special case
$columnSql = getSqlForNameInDisplayFormat(array('first_name'=>$columnList[0],'last_name'=>$columnList[1]),'Users');
} else {
// Leads or contacts
$columnSql = getSqlForNameInDisplayFormat(array('firstname'=>$columnList[0],'lastname'=>$columnList[1]), $module);
}
} else {
$columnSql = implode('', $columnList);
}
......@@ -1026,6 +1034,8 @@ class QueryGenerator {
return $sql;
}
foreach ($valueArray as $value) {
$isvaluefn = false; /* flag to use when value becomes a sql function */
if(!$this->isStringType($field->getFieldDataType())) {
$value = trim($value);
}
......@@ -1123,6 +1133,7 @@ class QueryGenerator {
if($field->getFieldName() == 'birthday' && !$this->isRelativeSearchOperators(
$operator)) {
$value = "DATE_FORMAT(".$db->quote($value).", '%m%d')";
$isvaluefn = true;
} else {
$value = is_array($value) ? NULL : $db->sql_escape_string($value);
}
......@@ -1191,7 +1202,7 @@ class QueryGenerator {
$value = $value."%";
}
if( ($field->getFieldDataType() != 'birthday' || ($field->getFieldDataType() == 'birthday'
if( ($field->getFieldName() != 'birthday' || ($field->getFieldName() == 'birthday'
&& $this->isRelativeSearchOperators($operator)))){
if($field->getFieldDataType() !== 'integer'){
$value = "'$value'";
......@@ -1329,7 +1340,7 @@ class QueryGenerator {
public function addUserSearchConditions($input) {
global $log,$default_charset;
if($input['searchtype']=='advance') {
if(isset($input['searchtype']) && $input['searchtype']=='advance') {
$json = new Zend_Json();
$advft_criteria = $_REQUEST['advft_criteria'];
......@@ -1376,7 +1387,7 @@ class QueryGenerator {
}
}
$this->endGroup();
} elseif($input['type']=='dbrd') {
} elseif(isset($input['type']) && $input['type']=='dbrd') {
if($this->conditionInstanceCount > 0) {
$this->startGroup(self::$AND);
} else {
......
......@@ -145,18 +145,25 @@ function vtws_convertlead($entityvalues, $user) {
try {
$accountIdComponents = vtws_getIdComponents($entityIds['Accounts']);
$accountId = $accountIdComponents[1];
$contactIdComponents = vtws_getIdComponents($entityIds['Contacts']);
$contactId = $contactIdComponents[1];
if(!empty($entityIds['Potentials'])){
$accountId = null;
if (isset($entityIds['Accounts']) && $entityIds['Accounts']) {
$accountIdComponents = vtws_getIdComponents($entityIds['Accounts']);
$accountId = $accountIdComponents[1];
}
$contactId = null;
if (isset($entityIds['Contacts']) && $entityIds['Contacts']) {
$contactIdComponents = vtws_getIdComponents($entityIds['Contacts']);
$contactId = $contactIdComponents[1];
}
$potentialId = null;
if(isset($entityIds['Potentials']) && $entityIds['Potentials']){
$potentialIdComponents = vtws_getIdComponents($entityIds['Potentials']);
$potentialId = $potentialIdComponents[1];
}
if (!empty($accountId) && !empty($contactId) && !empty($potentialId)) {
if (!empty($contactId) && !empty($potentialId)) {
$sql = "insert into vtiger_contpotentialrel values(?,?)";
$result = $adb->pquery($sql, array($contactId, $potentialId));
if ($result === false) {
......