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
  • Hitesh.Solanki/vtigercrm
133 results
Show changes
Showing
with 451 additions and 290 deletions
...@@ -44,14 +44,21 @@ class Tracker { ...@@ -44,14 +44,21 @@ class Tracker {
"item_id", "item_id",
"item_summary" "item_summary"
); );
function __construct()
function Tracker()
{ {
$this->log = LoggerManager::getLogger('Tracker'); $this->log = Logger::getLogger('Tracker');
// $this->db = PearDatabase::getInstance(); // $this->db = PearDatabase::getInstance();
global $adb; global $adb;
$this->db = $adb; $this->db = $adb;
} }
function Tracker()
{
// PHP4-style constructor.
// This will NOT be invoked, unless a sub-class that extends `foo` calls it.
// In that case, call the new-style constructor to keep compatibility.
self::__construct();
}
/** /**
* Add this new item to the vtiger_tracker vtiger_table. If there are too many items (global config for now) * Add this new item to the vtiger_tracker vtiger_table. If there are too many items (global config for now)
...@@ -84,7 +91,7 @@ $log->info("in track view method ".$current_module); ...@@ -84,7 +91,7 @@ $log->info("in track view method ".$current_module);
$fl = array(); $fl = array();
foreach($fieldlists as $w => $c) foreach($fieldlists as $w => $c)
{ {
if (count($fl)) if (php7_count($fl))
$fl[] = "' '"; $fl[] = "' '";
$fl[] = $c; $fl[] = $c;
} }
...@@ -137,7 +144,7 @@ $log->info("in track view method ".$current_module); ...@@ -137,7 +144,7 @@ $log->info("in track view method ".$current_module);
// If the module was not specified or the module matches the module of the row, add the row to the list // If the module was not specified or the module matches the module of the row, add the row to the list
if($module_name == "" || $row[module_name] == $module_name) if($module_name == "" || $row["module_name"] == $module_name)
{ {
//Adding Security check //Adding Security check
require_once('include/utils/utils.php'); require_once('include/utils/utils.php');
......
...@@ -75,8 +75,8 @@ class VTEntityDelta extends VTEventHandler { ...@@ -75,8 +75,8 @@ class VTEntityDelta extends VTEventHandler {
$isModified = true; $isModified = true;
} }
if($isModified) { if($isModified) {
$delta[$fieldName] = array('oldValue' => $oldData[$fieldName], $delta[$fieldName] = array('oldValue' => isset($oldData[$fieldName])? $oldData[$fieldName] : null,
'currentValue' => $newData[$fieldName]); 'currentValue' => $newData[$fieldName] );
} }
} }
self::$entityDelta[$moduleName][$recordId] = $delta; self::$entityDelta[$moduleName][$recordId] = $delta;
...@@ -92,12 +92,12 @@ class VTEntityDelta extends VTEventHandler { ...@@ -92,12 +92,12 @@ class VTEntityDelta extends VTEventHandler {
function getOldValue($moduleName, $recordId, $fieldName) { function getOldValue($moduleName, $recordId, $fieldName) {
$entityDelta = self::$entityDelta[$moduleName][$recordId]; $entityDelta = self::$entityDelta[$moduleName][$recordId];
return $entityDelta[$fieldName]['oldValue']; return isset($entityDelta[$fieldName]['oldValue']) ? $entityDelta[$fieldName]['oldValue'] : "";
} }
function getCurrentValue($moduleName, $recordId, $fieldName) { function getCurrentValue($moduleName, $recordId, $fieldName) {
$entityDelta = self::$entityDelta[$moduleName][$recordId]; $entityDelta = self::$entityDelta[$moduleName][$recordId];
return $entityDelta[$fieldName]['currentValue']; return isset($entityDelta[$fieldName]['currentValue']) ? $entityDelta[$fieldName]['currentValue'] : "";
} }
function getOldEntity($moduleName, $recordId) { function getOldEntity($moduleName, $recordId) {
...@@ -109,19 +109,25 @@ class VTEntityDelta extends VTEventHandler { ...@@ -109,19 +109,25 @@ class VTEntityDelta extends VTEventHandler {
} }
function hasChanged($moduleName, $recordId, $fieldName, $fieldValue = NULL) { function hasChanged($moduleName, $recordId, $fieldName, $fieldValue = NULL) {
$result = false;
if(empty(self::$oldEntity[$moduleName][$recordId])) { if(empty(self::$oldEntity[$moduleName][$recordId])) {
return false; return false;
} }
if (!array_key_exists($fieldName, self::$entityDelta[$moduleName][$recordId])) {
return false;
}
$fieldDelta = self::$entityDelta[$moduleName][$recordId][$fieldName]; $fieldDelta = self::$entityDelta[$moduleName][$recordId][$fieldName];
if(is_array($fieldDelta)) { if(is_array($fieldDelta)) {
$fieldDelta = array_map('decode_html', $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) { if ($fieldValue !== NULL) {
$result = $result && ($fieldDelta['currentValue'] === $fieldValue); $result = $result && ($fieldDelta['currentValue'] === $fieldValue);
} }
return $result; return $result;
}
} }
?>
}
?>
\ No newline at end of file
...@@ -34,7 +34,7 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) { ...@@ -34,7 +34,7 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
'username' => $username, 'username' => $username,
'email' => $email, 'email' => $email,
'time' => $time, 'time' => $time,
'hash' => md5($username.$time) 'hash' => hash('sha256',$username.$time)
) )
); );
$trackURL = Vtiger_ShortURL_Helper::generateURL($options); $trackURL = Vtiger_ShortURL_Helper::generateURL($options);
...@@ -42,7 +42,7 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) { ...@@ -42,7 +42,7 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
You recently requested a password reset for your VtigerCRM Open source Account.<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>. To create a new password, click on the link <a target="_blank" href='.$trackURL.'>here</a>.
<br><br> <br><br>
This request was made on '.date("Y-m-d H:i:s").' and will expire in next 24 hours.<br><br> This request was made on '.date("Y-m-d H:i:s").' and will expire in next 1 hour.<br><br>
Regards,<br> Regards,<br>
VtigerCRM Open source Support Team.<br>'; VtigerCRM Open source Support Team.<br>';
...@@ -54,6 +54,15 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) { ...@@ -54,6 +54,15 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
$mail->Subject = $subject; $mail->Subject = $subject;
$mail->AddAddress($email); $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); $status = $mail->Send(true);
if ($status === 1 || $status === true) { if ($status === 1 || $status === true) {
header('Location: index.php?modules=Users&view=Login&mailStatus=success'); header('Location: index.php?modules=Users&view=Login&mailStatus=success');
......
...@@ -40,7 +40,7 @@ Class ChartUtils { ...@@ -40,7 +40,7 @@ Class ChartUtils {
$alts = array(); $alts = array();
$temp = array(); $temp = array();
for ($i = 0; $i < count($xaxisData); $i++) { for ($i = 0; $i < php7_count($xaxisData); $i++) {
$name = html_entity_decode($xaxisData[$i], ENT_QUOTES, $default_charset); $name = html_entity_decode($xaxisData[$i], ENT_QUOTES, $default_charset);
$pos = substr_count($name, " "); $pos = substr_count($name, " ");
$alts[] = $name; $alts[] = $name;
...@@ -49,9 +49,9 @@ Class ChartUtils { ...@@ -49,9 +49,9 @@ Class ChartUtils {
$name = substr($name, 0, 44); $name = substr($name, 0, 44);
if ($pos >= 2) { if ($pos >= 2) {
$val = explode(" ", $name); $val = explode(" ", $name);
$n = count($val) - 1; $n = php7_count($val) - 1;
$x = ""; $x = "";
for ($j = 0; $j < count($val); $j++) { for ($j = 0; $j < php7_count($val); $j++) {
if ($j != $n) { if ($j != $n) {
$x .=" " . $val[$j]; $x .=" " . $val[$j];
} else { } else {
...@@ -97,7 +97,7 @@ Class ChartUtils { ...@@ -97,7 +97,7 @@ Class ChartUtils {
$fill = & Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED, $color, 'white')); $fill = & Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED, $color, 'white'));
} }
for ($i = 0; $i < count($yaxisData); $i++) { for ($i = 0; $i < php7_count($yaxisData); $i++) {
$x = 1 + $i; $x = 1 + $i;
if ($yaxisData[$i] >= $max) if ($yaxisData[$i] >= $max)
$max = $yaxisData[$i]; $max = $yaxisData[$i];
...@@ -125,7 +125,7 @@ Class ChartUtils { ...@@ -125,7 +125,7 @@ Class ChartUtils {
//You can change the width of the bars if you like //You can change the width of the bars if you like
if (!empty($xaxisData)) if (!empty($xaxisData))
$bplot->setBarWidth($barwidth / count($xaxisData), "%"); $bplot->setBarWidth($barwidth / php7_count($xaxisData), "%");
//$bplot->setPadding(array('top'=>10)); //$bplot->setPadding(array('top'=>10));
$bplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL, 'white', 'white'))); $bplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL, 'white', 'white')));
$xaxis = & $plotarea->getAxis(IMAGE_GRAPH_AXIS_X); $xaxis = & $plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
...@@ -165,7 +165,7 @@ Class ChartUtils { ...@@ -165,7 +165,7 @@ Class ChartUtils {
// The fix the tick marks // The fix the tick marks
$xaxis->setDataPreprocessor($array_data); $xaxis->setDataPreprocessor($array_data);
$xaxis->forceMinimum(0.5); $xaxis->forceMinimum(0.5);
$xaxis->forceMaximum(0.5 + count($yaxisData)); $xaxis->forceMaximum(0.5 + php7_count($yaxisData));
if ($charttype == 'vertical') if ($charttype == 'vertical')
$xaxis->setFontAngle('vertical'); $xaxis->setFontAngle('vertical');
$xaxis->setLabelInterval(1); $xaxis->setLabelInterval(1);
...@@ -226,7 +226,7 @@ Class ChartUtils { ...@@ -226,7 +226,7 @@ Class ChartUtils {
$alts = array(); $alts = array();
$temp = array(); $temp = array();
for ($i = 0; $i < count($xaxisData); $i++) { for ($i = 0; $i < php7_count($xaxisData); $i++) {
$name = html_entity_decode($xaxisData[$i], ENT_QUOTES, $default_charset); $name = html_entity_decode($xaxisData[$i], ENT_QUOTES, $default_charset);
$pos = substr_count($name, " "); $pos = substr_count($name, " ");
$alts[] = $name; $alts[] = $name;
...@@ -235,9 +235,9 @@ Class ChartUtils { ...@@ -235,9 +235,9 @@ Class ChartUtils {
$name = substr($name, 0, 34); $name = substr($name, 0, 34);
if ($pos >= 2) { if ($pos >= 2) {
$val = explode(" ", $name); $val = explode(" ", $name);
$n = count($val) - 1; $n = php7_count($val) - 1;
$x = ""; $x = "";
for ($j = 0; $j < count($val); $j++) { for ($j = 0; $j < php7_count($val); $j++) {
if ($j != $n) { if ($j != $n) {
$x .=" " . $val[$j]; $x .=" " . $val[$j];
} else { } else {
...@@ -269,15 +269,15 @@ Class ChartUtils { ...@@ -269,15 +269,15 @@ Class ChartUtils {
// To create unique lables we need to keep track of lable name and its count // To create unique lables we need to keep track of lable name and its count
$uniquex = array(); $uniquex = array();
// Generate colours // Generate colours
$colors = color_generator(count($yaxisData), '#33DDFF', '#3322FF'); $colors = color_generator(php7_count($yaxisData), '#33DDFF', '#3322FF');
$dataset = & Image_Graph::factory('dataset'); $dataset = & Image_Graph::factory('dataset');
$fills = & Image_Graph::factory('Image_Graph_Fill_Array'); $fills = & Image_Graph::factory('Image_Graph_Fill_Array');
$sum = 0; $sum = 0;
$pcvalues = array(); $pcvalues = array();
for ($i = 0; $i < count($yaxisData); $i++) { for ($i = 0; $i < php7_count($yaxisData); $i++) {
$sum += $yaxisData[$i]; $sum += $yaxisData[$i];
} }
for ($i = 0; $i < count($yaxisData); $i++) { for ($i = 0; $i < php7_count($yaxisData); $i++) {
// To have unique names even in case of duplicates let us add the id // To have unique names even in case of duplicates let us add the id
$datalabel = $xaxisData[$i]; $datalabel = $xaxisData[$i];
$xaxisData_appearance = $uniquex[$xaxisData[$i]]; $xaxisData_appearance = $uniquex[$xaxisData[$i]];
...@@ -363,14 +363,14 @@ Class ChartUtils { ...@@ -363,14 +363,14 @@ Class ChartUtils {
} }
} }
if(is_array($restrictedModules) && count($restrictedModules) > 0) { if(is_array($restrictedModules) && php7_count($restrictedModules) > 0) {
$ChartDataArray['error'] = "<h4>".getTranslatedString('LBL_NO_ACCESS', 'Reports').' - '.implode(',', $restrictedModules)."</h4>"; $ChartDataArray['error'] = "<h4>".getTranslatedString('LBL_NO_ACCESS', 'Reports').' - '.implode(',', $restrictedModules)."</h4>";
return $ChartDataArray; return $ChartDataArray;
} }
if ($fieldDetails != '') { if ($fieldDetails != '') {
list($tablename, $colname, $module_field, $fieldname, $single) = explode(":", $fieldDetails); list($tablename, $colname, $module_field, $fieldname, $single) = explode(":", $fieldDetails);
list($module, $field) = split("_", $module_field); list($module, $field) = explode('_', $module_field);
$dateField = false; $dateField = false;
if ($single == 'D') { if ($single == 'D') {
$dateField = true; $dateField = true;
...@@ -411,7 +411,7 @@ Class ChartUtils { ...@@ -411,7 +411,7 @@ Class ChartUtils {
$groupByFields[] = "Null"; $groupByFields[] = "Null";
} }
else if (in_array($fieldname, array_keys($referenceFields))) { else if (in_array($fieldname, array_keys($referenceFields))) {
if (count($referenceFields[$fieldname]) > 1) { if (php7_count($referenceFields[$fieldname]) > 1) {
$refenceModule = CustomReportUtils::getEntityTypeFromName($decodedGroupFieldValue, $referenceFields[$fieldname]); $refenceModule = CustomReportUtils::getEntityTypeFromName($decodedGroupFieldValue, $referenceFields[$fieldname]);
} }
else { else {
...@@ -471,7 +471,7 @@ Class ChartUtils { ...@@ -471,7 +471,7 @@ Class ChartUtils {
} }
} }
} }
if(count($groupByFields) == 0) { if(php7_count($groupByFields) == 0) {
$ChartDataArray['error'] = "<div class='componentName'>".getTranslatedString('LBL_NO_DATA', 'Reports')."</div"; $ChartDataArray['error'] = "<div class='componentName'>".getTranslatedString('LBL_NO_DATA', 'Reports')."</div";
} }
$ChartDataArray['xaxisData'] = $groupByFields; $ChartDataArray['xaxisData'] = $groupByFields;
......
...@@ -355,8 +355,7 @@ $combo_strings = Array( ...@@ -355,8 +355,7 @@ $combo_strings = Array(
); );
require_once('modules/Users/UserTimeZonesArray.php'); require_once('modules/Users/UserTimeZonesArray.php');
$usertimezonesClass = new UserTimeZones(); $arrayOfSupportedTimeZones = UserTimeZones::getAll();
$arrayOfSupportedTimeZones = $usertimezonesClass->userTimeZones();
$combo_strings['time_zone_dom'] = array_combine($arrayOfSupportedTimeZones,$arrayOfSupportedTimeZones); $combo_strings['time_zone_dom'] = array_combine($arrayOfSupportedTimeZones,$arrayOfSupportedTimeZones);
?> ?>
......
...@@ -31,7 +31,7 @@ function getComboArray($combofieldNames) ...@@ -31,7 +31,7 @@ function getComboArray($combofieldNames)
if(!is_admin($current_user)) if(!is_admin($current_user))
{ {
$subrole = getRoleSubordinates($roleid); $subrole = getRoleSubordinates($roleid);
if(count($subrole)> 0) if(php7_count($subrole)> 0)
{ {
$roleids = $subrole; $roleids = $subrole;
array_push($roleids, $roleid); array_push($roleids, $roleid);
......
...@@ -17,7 +17,7 @@ include_once 'vtlib/Vtiger/PDF/inventory/ContentViewer2.php'; ...@@ -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/viewers/PagerViewer.php';
include_once 'vtlib/Vtiger/PDF/PDFGenerator.php'; include_once 'vtlib/Vtiger/PDF/PDFGenerator.php';
include_once 'data/CRMEntity.php'; include_once 'data/CRMEntity.php';
#[\AllowDynamicProperties]
class Vtiger_InventoryPDFController { class Vtiger_InventoryPDFController {
protected $module; protected $module;
...@@ -114,7 +114,7 @@ class Vtiger_InventoryPDFController { ...@@ -114,7 +114,7 @@ class Vtiger_InventoryPDFController {
$taxable_total = number_format($taxable_total, $no_of_decimal_places,'.',''); $taxable_total = number_format($taxable_total, $no_of_decimal_places,'.','');
$producttotal = $taxable_total; $producttotal = $taxable_total;
if($this->focus->column_fields["hdnTaxType"] == "individual") { if($this->focus->column_fields["hdnTaxType"] == "individual") {
for($tax_count=0;$tax_count<count($productLineItem['taxes']);$tax_count++) { foreach($productLineItem['taxes'] as $tax_count => $productLinetItemTaxInfo) {
$tax_percent = $productLineItem['taxes'][$tax_count]['percentage']; $tax_percent = $productLineItem['taxes'][$tax_count]['percentage'];
$total_tax_percent += $tax_percent; $total_tax_percent += $tax_percent;
$tax_amount = (($taxable_total*$tax_percent)/100); $tax_amount = (($taxable_total*$tax_percent)/100);
...@@ -131,7 +131,7 @@ class Vtiger_InventoryPDFController { ...@@ -131,7 +131,7 @@ class Vtiger_InventoryPDFController {
$discountPercentage = $productLineItem["discount_percent{$productLineItemIndex}"]; $discountPercentage = $productLineItem["discount_percent{$productLineItemIndex}"];
$productName = decode_html($productLineItem["productName{$productLineItemIndex}"]); $productName = decode_html($productLineItem["productName{$productLineItemIndex}"]);
//get the sub product //get the sub product
$subProducts = $productLineItem["subProductArray{$productLineItemIndex}"]; $subProducts = isset($productLineItem["subProductArray{$productLineItemIndex}"]) ? $productLineItem["subProductArray{$productLineItemIndex}"] : "";
if($subProducts != '') { if($subProducts != '') {
foreach($subProducts as $subProduct) { foreach($subProducts as $subProduct) {
$productName .="\n"." - ".decode_html($subProduct); $productName .="\n"." - ".decode_html($subProduct);
...@@ -201,14 +201,14 @@ class Vtiger_InventoryPDFController { ...@@ -201,14 +201,14 @@ class Vtiger_InventoryPDFController {
//To calculate the group tax amount //To calculate the group tax amount
if($final_details['taxtype'] == 'group') { if($final_details['taxtype'] == 'group') {
$group_tax_details = $final_details['taxes']; $group_tax_details = $final_details['taxes'];
for($i=0;$i<count($group_tax_details);$i++) { foreach($group_tax_details as $i => $group_tax_info) {
$group_total_tax_percent += $group_tax_details[$i]['percentage']; $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'])); $summaryModel->set(getTranslatedString("Tax:", $this->moduleName)."($group_total_tax_percent%)", $this->formatPrice($final_details['tax_totalamount']));
} }
//Shipping & Handling taxes //Shipping & Handling taxes
$sh_tax_details = $final_details['sh_taxes']; $sh_tax_details = $final_details['sh_taxes'];
for($i=0;$i<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']; $sh_tax_percent = $sh_tax_percent + $sh_tax_details[$i]['percentage'];
} }
//obtain the Currency Symbol //obtain the Currency Symbol
...@@ -429,4 +429,4 @@ class Vtiger_InventoryPDFController { ...@@ -429,4 +429,4 @@ class Vtiger_InventoryPDFController {
} }
} }
?> ?>
\ No newline at end of file
...@@ -57,7 +57,7 @@ class ListViewController { ...@@ -57,7 +57,7 @@ class ListViewController {
$isRoleBased = vtws_isRoleBasedPicklist($name); $isRoleBased = vtws_isRoleBasedPicklist($name);
$this->picklistRoleMap[$name] = $isRoleBased; $this->picklistRoleMap[$name] = $isRoleBased;
if ($this->picklistRoleMap[$name]) { if ($this->picklistRoleMap[$name]) {
$this->picklistValueMap[$name] = getAssignedPicklistValues($name,$this->user->roleid, $this->db); $this->picklistValueMap[$name] = getAllPickListValues($name,$this->user->roleid, $this->db);
} }
} }
...@@ -67,9 +67,9 @@ class ListViewController { ...@@ -67,9 +67,9 @@ class ListViewController {
$rowCount = $this->db->num_rows($result); $rowCount = $this->db->num_rows($result);
$columnName = $field->getColumnName(); $columnName = $field->getColumnName();
if($field->referenceFieldName) { if(isset($field->referenceFieldName) && $field->referenceFieldName) {
preg_match('/(\w+) ; \((\w+)\) (\w+)/', $field->referenceFieldName, $matches); preg_match('/(\w+) ; \((\w+)\) (\w+)/', $field->referenceFieldName, $matches);
if (count($matches) != 0) { if (php7_count($matches) != 0) {
list($full, $parentReferenceFieldName, $referenceModule, $referenceFieldName) = $matches; list($full, $parentReferenceFieldName, $referenceModule, $referenceFieldName) = $matches;
} }
$columnName = $parentReferenceFieldName.$referenceFieldName; $columnName = $parentReferenceFieldName.$referenceFieldName;
...@@ -84,10 +84,10 @@ class ListViewController { ...@@ -84,10 +84,10 @@ class ListViewController {
} }
$idList = array_keys($idList); $idList = array_keys($idList);
if(count($idList) == 0) { if(php7_count($idList) == 0) {
return; return;
} }
if($parentReferenceFieldName) { if(isset($parentReferenceFieldName) && $parentReferenceFieldName) {
$moduleList = $referenceFieldInfoList[$field->referenceFieldName]; $moduleList = $referenceFieldInfoList[$field->referenceFieldName];
} else { } else {
$moduleList = $referenceFieldInfoList[$fieldName]; $moduleList = $referenceFieldInfoList[$fieldName];
...@@ -127,7 +127,7 @@ class ListViewController { ...@@ -127,7 +127,7 @@ class ListViewController {
$fields = $this->queryGenerator->getFields(); $fields = $this->queryGenerator->getFields();
$headerFields = array(); $headerFields = array();
foreach($fields as $fieldName) { foreach($fields as $fieldName) {
if(array_key_exists($fieldName, $moduleFields)) { if(is_array($moduleFields) && array_key_exists($fieldName, $moduleFields)) {
$headerFields[$fieldName] = $moduleFields[$fieldName]; $headerFields[$fieldName] = $moduleFields[$fieldName];
} }
} }
...@@ -142,7 +142,7 @@ class ListViewController { ...@@ -142,7 +142,7 @@ class ListViewController {
$meta = $this->queryGenerator->getMeta($this->queryGenerator->getModule()); $meta = $this->queryGenerator->getMeta($this->queryGenerator->getModule());
$baseModule = $module; $baseModule = $module;
$moduleFields = $this->queryGenerator->getModuleFields(); $moduleFields = $this->queryGenerator->getModuleFields();
$accessibleFieldList = array_keys($moduleFields); $accessibleFieldList = is_array($moduleFields) ? array_keys($moduleFields) : array();
$listViewFields = array_intersect($fields, $accessibleFieldList); $listViewFields = array_intersect($fields, $accessibleFieldList);
$referenceFieldList = $this->queryGenerator->getReferenceFieldList(); $referenceFieldList = $this->queryGenerator->getReferenceFieldList();
...@@ -166,7 +166,7 @@ class ListViewController { ...@@ -166,7 +166,7 @@ class ListViewController {
//if the assigned to is related to the reference field //if the assigned to is related to the reference field
preg_match('/(\w+) ; \((\w+)\) (\w+)/', $fieldName, $matches); preg_match('/(\w+) ; \((\w+)\) (\w+)/', $fieldName, $matches);
if(count($matches) > 0) { if(php7_count($matches) > 0) {
list($full, $referenceParentField, $module, $fieldName) = $matches; list($full, $referenceParentField, $module, $fieldName) = $matches;
$columnName = strtolower($referenceParentField.$fieldName); $columnName = strtolower($referenceParentField.$fieldName);
} else { } else {
...@@ -179,8 +179,8 @@ class ListViewController { ...@@ -179,8 +179,8 @@ class ListViewController {
$idList[] = $id; $idList[] = $id;
} }
} }
if(count($idList) > 0) { if(php7_count($idList) > 0) {
if(!is_array($this->ownerNameList[$fieldName])) { if(isset($this->onwerNameList[$fieldName]) && !is_array($this->ownerNameList[$fieldName])) {
$this->ownerNameList[$fieldName] = getOwnerNameList($idList); $this->ownerNameList[$fieldName] = getOwnerNameList($idList);
} else { } else {
//array_merge API loses key information so need to merge the arrays //array_merge API loses key information so need to merge the arrays
...@@ -208,7 +208,7 @@ class ListViewController { ...@@ -208,7 +208,7 @@ class ListViewController {
//performance optimization for uitype 61 //performance optimization for uitype 61
$attachmentsCache = array(); $attachmentsCache = array();
$attachmentIds = array(); $attachmentIds = array();
if(count($fileTypeFields)) { if(php7_count($fileTypeFields)) {
foreach($fileTypeFields as $fileTypeField) { foreach($fileTypeFields as $fileTypeField) {
for ($i = 0; $i < $rowCount; ++$i) { for ($i = 0; $i < $rowCount; ++$i) {
$attachmentId = $db->query_result($result,$i,$fileTypeField); $attachmentId = $db->query_result($result,$i,$fileTypeField);
...@@ -216,7 +216,7 @@ class ListViewController { ...@@ -216,7 +216,7 @@ class ListViewController {
} }
} }
} }
if(count($attachmentIds)) { if(php7_count($attachmentIds)) {
$getAttachmentsNamesSql = 'SELECT attachmentsid,name FROM vtiger_attachments WHERE attachmentsid IN (' . generateQuestionMarks($attachmentIds) . ')'; $getAttachmentsNamesSql = 'SELECT attachmentsid,name FROM vtiger_attachments WHERE attachmentsid IN (' . generateQuestionMarks($attachmentIds) . ')';
$attachmentNamesRes = $db->pquery($getAttachmentsNamesSql,$attachmentIds); $attachmentNamesRes = $db->pquery($getAttachmentsNamesSql,$attachmentIds);
$attachmentNamesRowCount = $db->num_rows($attachmentNamesRes); $attachmentNamesRowCount = $db->num_rows($attachmentNamesRes);
...@@ -228,11 +228,16 @@ class ListViewController { ...@@ -228,11 +228,16 @@ class ListViewController {
} }
$moduleInstance = Vtiger_Module_Model::getInstance("PBXManager"); $moduleInstance = Vtiger_Module_Model::getInstance("PBXManager");
$outgoingCallPermission = false;
if($moduleInstance && $moduleInstance->isActive()) { if($moduleInstance && $moduleInstance->isActive()) {
$outgoingCallPermission = PBXManager_Server_Model::checkPermissionForOutgoingCall(); $outgoingCallPermission = PBXManager_Server_Model::checkPermissionForOutgoingCall();
$clickToCallLabel = vtranslate("LBL_CLICK_TO_CALL"); $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(); $data = array();
for ($i = 0; $i < $rowCount; ++$i) { for ($i = 0; $i < $rowCount; ++$i) {
//Getting the recordId //Getting the recordId
...@@ -255,7 +260,7 @@ class ListViewController { ...@@ -255,7 +260,7 @@ class ListViewController {
$fieldDataType = $field->getFieldDataType(); $fieldDataType = $field->getFieldDataType();
// for reference fields read the value differently // for reference fields read the value differently
preg_match('/(\w+) ; \((\w+)\) (\w+)/', $fieldName, $matches); preg_match('/(\w+) ; \((\w+)\) (\w+)/', $fieldName, $matches);
if(count($matches) > 0) { if(php7_count($matches) > 0) {
list($full, $referenceParentField, $module, $fieldName) = $matches; list($full, $referenceParentField, $module, $fieldName) = $matches;
$matches = null; $matches = null;
$rawValue = $this->db->query_result($result, $i, strtolower($referenceParentField.$fieldName)); $rawValue = $this->db->query_result($result, $i, strtolower($referenceParentField.$fieldName));
...@@ -268,7 +273,7 @@ class ListViewController { ...@@ -268,7 +273,7 @@ class ListViewController {
} }
if(in_array($uitype,array(15,33,16))){ 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 { } else {
$value = $rawValue; $value = $rawValue;
} }
...@@ -283,7 +288,7 @@ class ListViewController { ...@@ -283,7 +288,7 @@ class ListViewController {
$fileIdRes = $db->pquery($fileIdQuery,array($recordId)); $fileIdRes = $db->pquery($fileIdQuery,array($recordId));
$fileId = $db->query_result($fileIdRes,0,'attachmentsid'); $fileId = $db->query_result($fileIdRes,0,'attachmentsid');
if($fileName != '' && $status == 1) { if($fileName != '' && $status == 1) {
if($downloadType == 'I' ) { if($downloadType == 'I' && $fileId) {
$value = '<a href="index.php?module=Documents&action=DownloadFile&record='.$recordId.'&fileid='.$fileId.'"'. $value = '<a href="index.php?module=Documents&action=DownloadFile&record='.$recordId.'&fileid='.$fileId.'"'.
' title="'. getTranslatedString('LBL_DOWNLOAD_FILE',$module). ' title="'. getTranslatedString('LBL_DOWNLOAD_FILE',$module).
'" >'.textlength_check($value). '" >'.textlength_check($value).
...@@ -291,7 +296,7 @@ class ListViewController { ...@@ -291,7 +296,7 @@ class ListViewController {
} elseif($downloadType == 'E') { } elseif($downloadType == 'E') {
$value = '<a onclick="event.stopPropagation()"'. $value = '<a onclick="event.stopPropagation()"'.
' href="'.$fileName.'" target="_blank"'. ' href="'.$fileName.'" target="_blank"'.
' title="'. getTranslatedString('LBL_DOWNLOAD_FILE',$module). ' title="'. getTranslatedString('LBL_DOWNLOAD_FILE',$module).
'" >'.textlength_check($value). '" >'.textlength_check($value).
'</a>'; '</a>';
} else { } else {
...@@ -300,7 +305,6 @@ class ListViewController { ...@@ -300,7 +305,6 @@ class ListViewController {
} else{ } else{
$value = textlength_check($value); $value = textlength_check($value);
} }
$value = $fileicon.$value;
} elseif($module == 'Documents' && $fieldName == 'filesize') { } elseif($module == 'Documents' && $fieldName == 'filesize') {
$downloadType = $db->query_result($result,$i,'filelocationtype'); $downloadType = $db->query_result($result,$i,'filelocationtype');
if($downloadType == 'I') { if($downloadType == 'I') {
...@@ -339,11 +343,6 @@ class ListViewController { ...@@ -339,11 +343,6 @@ class ListViewController {
if($module == 'Calendar' && ($fieldName == 'taskstatus' || $fieldName == 'eventstatus' || $fieldName == 'activitytype')) { if($module == 'Calendar' && ($fieldName == 'taskstatus' || $fieldName == 'eventstatus' || $fieldName == 'activitytype')) {
$value = Vtiger_Language_Handler::getTranslatedString($value,$module); $value = Vtiger_Language_Handler::getTranslatedString($value,$module);
$value = textlength_check($value); $value = textlength_check($value);
}
else if ($value != '' && !$is_admin && $this->picklistRoleMap[$fieldName] &&
!in_array($value, $this->picklistValueMap[$fieldName]) && strtolower($value) != '--none--' && strtolower($value) != 'none' ) {
$value = "<font color='red'>". Vtiger_Language_Handler::getTranslatedString('LBL_NOT_ACCESSIBLE',
$module)."</font>";
} else { } else {
$value = Vtiger_Language_Handler::getTranslatedString($value,$module); $value = Vtiger_Language_Handler::getTranslatedString($value,$module);
$value = textlength_check($value); $value = textlength_check($value);
...@@ -417,7 +416,8 @@ class ListViewController { ...@@ -417,7 +416,8 @@ class ListViewController {
} }
} elseif ($fieldDataType == 'email') { } elseif ($fieldDataType == 'email') {
global $current_user; 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 //check added for email link in user detailview
$value = "<a class='emailField' data-rawvalue=\"$rawValue\" onclick=\"Vtiger_Helper_Js.getInternalMailer($recordId,". $value = "<a class='emailField' data-rawvalue=\"$rawValue\" onclick=\"Vtiger_Helper_Js.getInternalMailer($recordId,".
"'$fieldName','$module');\">".textlength_check($value)."</a>"; "'$fieldName','$module');\">".textlength_check($value)."</a>";
...@@ -440,33 +440,7 @@ class ListViewController { ...@@ -440,33 +440,7 @@ class ListViewController {
} elseif($field->getUIType() == 98) { } elseif($field->getUIType() == 98) {
$value = '<a href="index.php?module=Roles&parent=Settings&view=Edit&record='.$value.'">'.textlength_check(getRoleName($value)).'</a>'; $value = '<a href="index.php?module=Roles&parent=Settings&view=Edit&record='.$value.'">'.textlength_check(getRoleName($value)).'</a>';
} elseif($fieldDataType == 'multipicklist') { } elseif($fieldDataType == 'multipicklist') {
if(!$is_admin && $value != '') { if ($value != '') {
$valueArray = ($rawValue != "") ? explode(' |##| ',$rawValue) : array();
$notaccess = '<font color="red">'.getTranslatedString('LBL_NOT_ACCESSIBLE',
$module)."</font>";
$tmp = '';
$tmpArray = array();
foreach($valueArray as $index => $val) {
$val = decode_html($val);
if(!$listview_max_textlength ||
!(strlen(preg_replace("/(<\/?)(\w+)([^>]*>)/i","",$tmp)) >
$listview_max_textlength)) {
if (!$is_admin && $this->picklistRoleMap[$fieldName] &&
!in_array(trim($val), $this->picklistValueMap[$fieldName])) {
$tmpArray[] = $notaccess;
$tmp .= ', '.$notaccess;
} else {
$tmpArray[] = $val;
$tmp .= ', '.$val;
}
} else {
$tmpArray[] = '...';
$tmp .= '...';
}
}
$value = implode(', ', $tmpArray);
$value = textlength_check($value);
} else if ($value != '') {
$moduleName = getTabModuleName($field->getTabId()); $moduleName = getTabModuleName($field->getTabId());
$value = explode(' |##| ', $value); $value = explode(' |##| ', $value);
foreach ($value as $key => $val) { foreach ($value as $key => $val) {
...@@ -487,10 +461,10 @@ class ListViewController { ...@@ -487,10 +461,10 @@ class ListViewController {
} elseif($field->getFieldDataType() == 'reference') { } elseif($field->getFieldDataType() == 'reference') {
$referenceFieldInfoList = $this->queryGenerator->getReferenceFieldInfoList(); $referenceFieldInfoList = $this->queryGenerator->getReferenceFieldInfoList();
$moduleList = $referenceFieldInfoList[$fieldName]; $moduleList = $referenceFieldInfoList[$fieldName];
if(count($moduleList) == 1) { if(php7_count($moduleList) == 1) {
$parentModule = $moduleList[0]; $parentModule = $moduleList[0];
} else { } else {
$parentModule = $this->typeList[$value]; $parentModule = isset($this->typeList[$value]) ? $this->typeList[$value] : '';
} }
if(!empty($value) && !empty($this->nameList[$fieldName]) && !empty($parentModule)) { if(!empty($value) && !empty($this->nameList[$fieldName]) && !empty($parentModule)) {
$parentMeta = $this->queryGenerator->getMeta($parentModule); $parentMeta = $this->queryGenerator->getMeta($parentModule);
...@@ -522,7 +496,7 @@ class ListViewController { ...@@ -522,7 +496,7 @@ class ListViewController {
} }
} elseif ( in_array($uitype,array(7,9,90)) ) { } elseif ( in_array($uitype,array(7,9,90)) ) {
$value = "<span align='right'>".textlength_check($value)."</span>"; $value = "<span align='right'>".textlength_check($value)."</span>";
} elseif($field && $field->isNameField) { } elseif($field && isset($field->isNameField) && $field->isNameField) {
$value = "<a href='?module=$field->moduleName&view=Detail&". $value = "<a href='?module=$field->moduleName&view=Detail&".
"record=$recordId' title='".vtranslate($field->moduleName, $field->moduleName)."'>$value</a>"; "record=$recordId' title='".vtranslate($field->moduleName, $field->moduleName)."'>$value</a>";
} elseif($field->getUIType() == 61) { } elseif($field->getUIType() == 61) {
......
...@@ -25,25 +25,31 @@ class ListViewSession { ...@@ -25,25 +25,31 @@ class ListViewSession {
* Portions created by vtigerCRM are Copyright (C) vtigerCRM. * Portions created by vtigerCRM are Copyright (C) vtigerCRM.
* All Rights Reserved. * All Rights Reserved.
*/ */
function __construct()
function ListViewSession() {
{ global $log,$currentModule;
global $log,$currentModule;
$log->debug("Entering ListViewSession() method ..."); $log->debug("Entering ListViewSession() method ...");
$this->module = $currentModule; $this->module = $currentModule;
$this->sortby = 'ASC'; $this->sortby = 'ASC';
$this->start =1; $this->start =1;
}
function ListViewSession()
{
// PHP4-style constructor.
// This will NOT be invoked, unless a sub-class that extends `foo` calls it.
// In that case, call the new-style constructor to keep compatibility.
self::__construct();
} }
function getCurrentPage($currentModule,$viewId){ public static function getCurrentPage($currentModule,$viewId){
if(!empty($_SESSION['lvs'][$currentModule][$viewId]['start'])){ if(!empty($_SESSION['lvs'][$currentModule][$viewId]['start'])){
return $_SESSION['lvs'][$currentModule][$viewId]['start']; return $_SESSION['lvs'][$currentModule][$viewId]['start'];
} }
return 1; return 1;
} }
function getRequestStartPage(){ public static function getRequestStartPage(){
$start = $_REQUEST['start']; $start = $_REQUEST['start'];
if(!is_numeric($start)){ if(!is_numeric($start)){
$start = 1; $start = 1;
...@@ -55,7 +61,7 @@ class ListViewSession { ...@@ -55,7 +61,7 @@ class ListViewSession {
return $start; return $start;
} }
function getListViewNavigation($currentRecordId){ public static function getListViewNavigation($currentRecordId){
global $currentModule,$current_user,$adb,$log,$list_max_entries_per_page; global $currentModule,$current_user,$adb,$log,$list_max_entries_per_page;
Zend_Json::$useBuiltinEncoderDecoder = true; Zend_Json::$useBuiltinEncoderDecoder = true;
$reUseData = false; $reUseData = false;
...@@ -69,10 +75,12 @@ class ListViewSession { ...@@ -69,10 +75,12 @@ class ListViewSession {
} }
$cv = new CustomView(); $cv = new CustomView();
$viewId = $cv->getViewId($currentModule); $viewId = $cv->getViewId($currentModule);
$recordNavigationInfo = array();
$searchKey = array();
if(!empty($_SESSION[$currentModule.'_DetailView_Navigation'.$viewId])){ if(!empty($_SESSION[$currentModule.'_DetailView_Navigation'.$viewId])){
$recordNavigationInfo = Zend_Json::decode($_SESSION[$currentModule.'_DetailView_Navigation'.$viewId]); $recordNavigationInfo = Zend_Json::decode($_SESSION[$currentModule.'_DetailView_Navigation'.$viewId]);
$pageNumber =0; $pageNumber =0;
if(count($recordNavigationInfo) == 1){ if(php7_count($recordNavigationInfo) == 1){
foreach ($recordNavigationInfo as $recordIdList) { foreach ($recordNavigationInfo as $recordIdList) {
if(in_array($currentRecordId,$recordIdList)){ if(in_array($currentRecordId,$recordIdList)){
$reUseData = true; $reUseData = true;
...@@ -86,18 +94,18 @@ class ListViewSession { ...@@ -86,18 +94,18 @@ class ListViewSession {
$recordList[] = $recordId; $recordList[] = $recordId;
$recordPageMapping[$recordId] = $start; $recordPageMapping[$recordId] = $start;
if($recordId == $currentRecordId){ if($recordId == $currentRecordId){
$searchKey = count($recordList)-1; $searchKey = php7_count($recordList)-1;
$_REQUEST['start'] = $start; $_REQUEST['start'] = $start;
} }
} }
} }
if($searchKey > $displayBufferRecordCount -1 && $searchKey < count($recordList)-$displayBufferRecordCount){ if($searchKey > $displayBufferRecordCount -1 && $searchKey < php7_count($recordList)-$displayBufferRecordCount){
$reUseData= true; $reUseData= true;
} }
} }
} }
$list_query = $_SESSION[$currentModule.'_listquery']; $list_query = isset($_SESSION[$currentModule.'_listquery'])?$_SESSION[$currentModule.'_listquery']:'';
if($reUseData === false && !empty($list_query)){ if($reUseData === false && !empty($list_query)){
$recordNavigationInfo = array(); $recordNavigationInfo = array();
...@@ -160,7 +168,7 @@ class ListViewSession { ...@@ -160,7 +168,7 @@ class ListViewSession {
$recordNavigationInfo = array(); $recordNavigationInfo = array();
if($searchKey !== false){ if($searchKey !== false){
foreach ($navigationRecordList as $index => $recordId) { foreach ($navigationRecordList as $index => $recordId) {
if(!is_array($recordNavigationInfo[$current])){ if(!isset($recordNavigationInfo[$current])){
$recordNavigationInfo[$current] = array(); $recordNavigationInfo[$current] = array();
} }
if($index == $firstPageRecordCount || $index == ($firstPageRecordCount+$pageCount * $list_max_entries_per_page)){ if($index == $firstPageRecordCount || $index == ($firstPageRecordCount+$pageCount * $list_max_entries_per_page)){
...@@ -176,7 +184,7 @@ class ListViewSession { ...@@ -176,7 +184,7 @@ class ListViewSession {
return $recordNavigationInfo; return $recordNavigationInfo;
} }
function getRequestCurrentPage($currentModule, $query, $viewid, $queryMode = false) { static function getRequestCurrentPage($currentModule, $query, $viewid, $queryMode = false) {
global $list_max_entries_per_page, $adb; global $list_max_entries_per_page, $adb;
$start = 1; $start = 1;
if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true'&& $_REQUEST['start']!="last"){ if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true'&& $_REQUEST['start']!="last"){
...@@ -206,7 +214,7 @@ class ListViewSession { ...@@ -206,7 +214,7 @@ class ListViewSession {
return $start; return $start;
} }
function setSessionQuery($currentModule,$query,$viewid){ public static function setSessionQuery($currentModule,$query,$viewid){
if(isset($_SESSION[$currentModule.'_listquery'])){ if(isset($_SESSION[$currentModule.'_listquery'])){
if($_SESSION[$currentModule.'_listquery'] != $query){ if($_SESSION[$currentModule.'_listquery'] != $query){
unset($_SESSION[$currentModule.'_DetailView_Navigation'.$viewid]); unset($_SESSION[$currentModule.'_DetailView_Navigation'.$viewid]);
...@@ -215,7 +223,7 @@ class ListViewSession { ...@@ -215,7 +223,7 @@ class ListViewSession {
$_SESSION[$currentModule.'_listquery'] = $query; $_SESSION[$currentModule.'_listquery'] = $query;
} }
function hasViewChanged($currentModule) { static function hasViewChanged($currentModule) {
if(empty($_SESSION['lvs'][$currentModule]['viewname'])) return true; if(empty($_SESSION['lvs'][$currentModule]['viewname'])) return true;
if(empty($_REQUEST['viewname'])) return false; if(empty($_REQUEST['viewname'])) return false;
if($_REQUEST['viewname'] != $_SESSION['lvs'][$currentModule]['viewname']) return true; if($_REQUEST['viewname'] != $_SESSION['lvs'][$currentModule]['viewname']) return true;
...@@ -242,4 +250,4 @@ class ListViewSession { ...@@ -242,4 +250,4 @@ class ListViewSession {
} }
} }
} }
?> ?>
\ No newline at end of file
...@@ -23,13 +23,20 @@ class RelatedListViewSession { ...@@ -23,13 +23,20 @@ class RelatedListViewSession {
var $sorder = null; var $sorder = null;
var $sortby = null; var $sortby = null;
var $page_view = null; var $page_view = null;
function RelatedListViewSession() { function __construct()
global $log,$currentModule; {
global $log,$currentModule;
$log->debug("Entering RelatedListViewSession() method ..."); $log->debug("Entering RelatedListViewSession() method ...");
$this->module = $currentModule; $this->module = $currentModule;
$this->start =1; $this->start =1;
}
function RelatedListViewSession() {
// PHP4-style constructor.
// This will NOT be invoked, unless a sub-class that extends `foo` calls it.
// In that case, call the new-style constructor to keep compatibility.
self::__construct();
} }
public static function addRelatedModuleToSession($relationId, $header) { public static function addRelatedModuleToSession($relationId, $header) {
......
...@@ -31,7 +31,7 @@ class PopulateComboValues ...@@ -31,7 +31,7 @@ class PopulateComboValues
function insertComboValues($values, $tableName,$picklistid) function insertComboValues($values, $tableName,$picklistid)
{ {
global $log; global $log;
$log->debug("Entering insertComboValues(".$values.", ".$tableName.") method ..."); $tableName = Vtiger_Util_Helper::validateStringForSql($tableName);
global $adb; global $adb;
//inserting the value in the vtiger_picklistvalues_seq for the getting uniqueID for each picklist values... //inserting the value in the vtiger_picklistvalues_seq for the getting uniqueID for each picklist values...
$i=0; $i=0;
...@@ -81,7 +81,7 @@ class PopulateComboValues ...@@ -81,7 +81,7 @@ class PopulateComboValues
global $app_list_strings,$adb; global $app_list_strings,$adb;
global $combo_strings; global $combo_strings;
$comboRes = $adb->query("SELECT distinct fieldname FROM vtiger_field WHERE uitype IN ('15') OR fieldname = 'salutationtype' and vtiger_field.presence in (0,2)"); $comboRes = $adb->pquery("SELECT distinct fieldname FROM vtiger_field WHERE uitype IN ('15') OR fieldname = 'salutationtype' and vtiger_field.presence in (0,2)", array());
$noOfCombos = $adb->num_rows($comboRes); $noOfCombos = $adb->num_rows($comboRes);
for($i=0; $i<$noOfCombos; $i++) for($i=0; $i<$noOfCombos; $i++)
{ {
...@@ -124,7 +124,7 @@ class PopulateComboValues ...@@ -124,7 +124,7 @@ class PopulateComboValues
global $app_list_strings,$adb; global $app_list_strings,$adb;
global $combo_strings; global $combo_strings;
// uitype -> 16 - Non standard picklist, 115 - User status, 83 - Tax Class // uitype -> 16 - Non standard picklist, 115 - User status, 83 - Tax Class
$comboRes = $adb->query("SELECT distinct fieldname FROM vtiger_field WHERE uitype IN ('16','115','83') AND fieldname NOT IN ('hdnTaxType','email_flag') and vtiger_field.presence in (0,2)"); $comboRes = $adb->pquery("SELECT distinct fieldname FROM vtiger_field WHERE uitype IN ('16','115','83') AND fieldname NOT IN ('hdnTaxType','email_flag') and vtiger_field.presence in (0,2)", array());
$noOfCombos = $adb->num_rows($comboRes); $noOfCombos = $adb->num_rows($comboRes);
for($i=0; $i<$noOfCombos; $i++) for($i=0; $i<$noOfCombos; $i++)
{ {
...@@ -136,7 +136,6 @@ class PopulateComboValues ...@@ -136,7 +136,6 @@ class PopulateComboValues
function insertNonPicklistValues($values, $tableName) function insertNonPicklistValues($values, $tableName)
{ {
global $log; global $log;
$log->debug("Entering insertNonPicklistValues(".$values.", ".$tableName.") method ...");
global $adb; global $adb;
$i=0; $i=0;
foreach ($values as $val => $cal) foreach ($values as $val => $cal)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.