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
Showing
with 451 additions and 290 deletions
......@@ -44,14 +44,21 @@ class Tracker {
"item_id",
"item_summary"
);
function Tracker()
function __construct()
{
$this->log = LoggerManager::getLogger('Tracker');
// $this->db = PearDatabase::getInstance();
global $adb;
$this->log = Logger::getLogger('Tracker');
// $this->db = PearDatabase::getInstance();
global $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)
......@@ -84,7 +91,7 @@ $log->info("in track view method ".$current_module);
$fl = array();
foreach($fieldlists as $w => $c)
{
if (count($fl))
if (php7_count($fl))
$fl[] = "' '";
$fl[] = $c;
}
......@@ -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($module_name == "" || $row[module_name] == $module_name)
if($module_name == "" || $row["module_name"] == $module_name)
{
//Adding Security check
require_once('include/utils/utils.php');
......
......@@ -75,8 +75,8 @@ class VTEntityDelta extends VTEventHandler {
$isModified = true;
}
if($isModified) {
$delta[$fieldName] = array('oldValue' => $oldData[$fieldName],
'currentValue' => $newData[$fieldName]);
$delta[$fieldName] = array('oldValue' => isset($oldData[$fieldName])? $oldData[$fieldName] : null,
'currentValue' => $newData[$fieldName] );
}
}
self::$entityDelta[$moduleName][$recordId] = $delta;
......@@ -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
?>
......@@ -34,7 +34,7 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
'username' => $username,
'email' => $email,
'time' => $time,
'hash' => md5($username.$time)
'hash' => hash('sha256',$username.$time)
)
);
$trackURL = Vtiger_ShortURL_Helper::generateURL($options);
......@@ -42,7 +42,7 @@ if (isset($_REQUEST['username']) && isset($_REQUEST['emailId'])) {
You recently requested a password reset for your VtigerCRM Open source Account.<br>
To create a new password, click on the link <a target="_blank" href='.$trackURL.'>here</a>.
<br><br>
This request was made on '.date("Y-m-d H:i:s").' and will expire in next 24 hours.<br><br>
This request was made on '.date("Y-m-d H:i:s").' and will expire in next 1 hour.<br><br>
Regards,<br>
VtigerCRM Open source Support Team.<br>';
......@@ -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');
......
......@@ -40,7 +40,7 @@ Class ChartUtils {
$alts = 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);
$pos = substr_count($name, " ");
$alts[] = $name;
......@@ -49,9 +49,9 @@ Class ChartUtils {
$name = substr($name, 0, 44);
if ($pos >= 2) {
$val = explode(" ", $name);
$n = count($val) - 1;
$n = php7_count($val) - 1;
$x = "";
for ($j = 0; $j < count($val); $j++) {
for ($j = 0; $j < php7_count($val); $j++) {
if ($j != $n) {
$x .=" " . $val[$j];
} else {
......@@ -97,7 +97,7 @@ Class ChartUtils {
$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;
if ($yaxisData[$i] >= $max)
$max = $yaxisData[$i];
......@@ -125,7 +125,7 @@ Class ChartUtils {
//You can change the width of the bars if you like
if (!empty($xaxisData))
$bplot->setBarWidth($barwidth / count($xaxisData), "%");
$bplot->setBarWidth($barwidth / php7_count($xaxisData), "%");
//$bplot->setPadding(array('top'=>10));
$bplot->setBackground(Image_Graph::factory('gradient', array(IMAGE_GRAPH_GRAD_HORIZONTAL, 'white', 'white')));
$xaxis = & $plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
......@@ -165,7 +165,7 @@ Class ChartUtils {
// The fix the tick marks
$xaxis->setDataPreprocessor($array_data);
$xaxis->forceMinimum(0.5);
$xaxis->forceMaximum(0.5 + count($yaxisData));
$xaxis->forceMaximum(0.5 + php7_count($yaxisData));
if ($charttype == 'vertical')
$xaxis->setFontAngle('vertical');
$xaxis->setLabelInterval(1);
......@@ -226,7 +226,7 @@ Class ChartUtils {
$alts = 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);
$pos = substr_count($name, " ");
$alts[] = $name;
......@@ -235,9 +235,9 @@ Class ChartUtils {
$name = substr($name, 0, 34);
if ($pos >= 2) {
$val = explode(" ", $name);
$n = count($val) - 1;
$n = php7_count($val) - 1;
$x = "";
for ($j = 0; $j < count($val); $j++) {
for ($j = 0; $j < php7_count($val); $j++) {
if ($j != $n) {
$x .=" " . $val[$j];
} else {
......@@ -269,15 +269,15 @@ Class ChartUtils {
// To create unique lables we need to keep track of lable name and its count
$uniquex = array();
// Generate colours
$colors = color_generator(count($yaxisData), '#33DDFF', '#3322FF');
$colors = color_generator(php7_count($yaxisData), '#33DDFF', '#3322FF');
$dataset = & Image_Graph::factory('dataset');
$fills = & Image_Graph::factory('Image_Graph_Fill_Array');
$sum = 0;
$pcvalues = array();
for ($i = 0; $i < count($yaxisData); $i++) {
for ($i = 0; $i < php7_count($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
$datalabel = $xaxisData[$i];
$xaxisData_appearance = $uniquex[$xaxisData[$i]];
......@@ -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>";
return $ChartDataArray;
}
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;
......@@ -411,7 +411,7 @@ Class ChartUtils {
$groupByFields[] = "Null";
}
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]);
}
else {
......@@ -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['xaxisData'] = $groupByFields;
......
......@@ -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);
?>
......
......@@ -31,7 +31,7 @@ function getComboArray($combofieldNames)
if(!is_admin($current_user))
{
$subrole = getRoleSubordinates($roleid);
if(count($subrole)> 0)
if(php7_count($subrole)> 0)
{
$roleids = $subrole;
array_push($roleids, $roleid);
......
......@@ -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<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<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<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
?>
......@@ -57,7 +57,7 @@ class ListViewController {
$isRoleBased = vtws_isRoleBasedPicklist($name);
$this->picklistRoleMap[$name] = $isRoleBased;
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 {
$rowCount = $this->db->num_rows($result);
$columnName = $field->getColumnName();
if($field->referenceFieldName) {
if(isset($field->referenceFieldName) && $field->referenceFieldName) {
preg_match('/(\w+) ; \((\w+)\) (\w+)/', $field->referenceFieldName, $matches);
if (count($matches) != 0) {
if (php7_count($matches) != 0) {
list($full, $parentReferenceFieldName, $referenceModule, $referenceFieldName) = $matches;
}
$columnName = $parentReferenceFieldName.$referenceFieldName;
......@@ -84,10 +84,10 @@ class ListViewController {
}
$idList = array_keys($idList);
if(count($idList) == 0) {
if(php7_count($idList) == 0) {
return;
}
if($parentReferenceFieldName) {
if(isset($parentReferenceFieldName) && $parentReferenceFieldName) {
$moduleList = $referenceFieldInfoList[$field->referenceFieldName];
} else {
$moduleList = $referenceFieldInfoList[$fieldName];
......@@ -127,7 +127,7 @@ class ListViewController {
$fields = $this->queryGenerator->getFields();
$headerFields = array();
foreach($fields as $fieldName) {
if(array_key_exists($fieldName, $moduleFields)) {
if(is_array($moduleFields) && array_key_exists($fieldName, $moduleFields)) {
$headerFields[$fieldName] = $moduleFields[$fieldName];
}
}
......@@ -142,7 +142,7 @@ class ListViewController {
$meta = $this->queryGenerator->getMeta($this->queryGenerator->getModule());
$baseModule = $module;
$moduleFields = $this->queryGenerator->getModuleFields();
$accessibleFieldList = array_keys($moduleFields);
$accessibleFieldList = is_array($moduleFields) ? array_keys($moduleFields) : array();
$listViewFields = array_intersect($fields, $accessibleFieldList);
$referenceFieldList = $this->queryGenerator->getReferenceFieldList();
......@@ -166,7 +166,7 @@ class ListViewController {
//if the assigned to is related to the reference field
preg_match('/(\w+) ; \((\w+)\) (\w+)/', $fieldName, $matches);
if(count($matches) > 0) {
if(php7_count($matches) > 0) {
list($full, $referenceParentField, $module, $fieldName) = $matches;
$columnName = strtolower($referenceParentField.$fieldName);
} else {
......@@ -179,8 +179,8 @@ class ListViewController {
$idList[] = $id;
}
}
if(count($idList) > 0) {
if(!is_array($this->ownerNameList[$fieldName])) {
if(php7_count($idList) > 0) {
if(isset($this->onwerNameList[$fieldName]) && !is_array($this->ownerNameList[$fieldName])) {
$this->ownerNameList[$fieldName] = getOwnerNameList($idList);
} else {
//array_merge API loses key information so need to merge the arrays
......@@ -208,7 +208,7 @@ class ListViewController {
//performance optimization for uitype 61
$attachmentsCache = array();
$attachmentIds = array();
if(count($fileTypeFields)) {
if(php7_count($fileTypeFields)) {
foreach($fileTypeFields as $fileTypeField) {
for ($i = 0; $i < $rowCount; ++$i) {
$attachmentId = $db->query_result($result,$i,$fileTypeField);
......@@ -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) . ')';
$attachmentNamesRes = $db->pquery($getAttachmentsNamesSql,$attachmentIds);
$attachmentNamesRowCount = $db->num_rows($attachmentNamesRes);
......@@ -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
......@@ -255,7 +260,7 @@ class ListViewController {
$fieldDataType = $field->getFieldDataType();
// for reference fields read the value differently
preg_match('/(\w+) ; \((\w+)\) (\w+)/', $fieldName, $matches);
if(count($matches) > 0) {
if(php7_count($matches) > 0) {
list($full, $referenceParentField, $module, $fieldName) = $matches;
$matches = null;
$rawValue = $this->db->query_result($result, $i, strtolower($referenceParentField.$fieldName));
......@@ -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;
}
......@@ -283,7 +288,7 @@ class ListViewController {
$fileIdRes = $db->pquery($fileIdQuery,array($recordId));
$fileId = $db->query_result($fileIdRes,0,'attachmentsid');
if($fileName != '' && $status == 1) {
if($downloadType == 'I' ) {
if($downloadType == 'I' && $fileId) {
$value = '<a href="index.php?module=Documents&action=DownloadFile&record='.$recordId.'&fileid='.$fileId.'"'.
' title="'. getTranslatedString('LBL_DOWNLOAD_FILE',$module).
'" >'.textlength_check($value).
......@@ -291,7 +296,7 @@ class ListViewController {
} elseif($downloadType == 'E') {
$value = '<a onclick="event.stopPropagation()"'.
' href="'.$fileName.'" target="_blank"'.
' title="'. getTranslatedString('LBL_DOWNLOAD_FILE',$module).
' title="'. getTranslatedString('LBL_DOWNLOAD_FILE',$module).
'" >'.textlength_check($value).
'</a>';
} else {
......@@ -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') {
......@@ -339,11 +343,6 @@ class ListViewController {
if($module == 'Calendar' && ($fieldName == 'taskstatus' || $fieldName == 'eventstatus' || $fieldName == 'activitytype')) {
$value = Vtiger_Language_Handler::getTranslatedString($value,$module);
$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 {
$value = Vtiger_Language_Handler::getTranslatedString($value,$module);
$value = textlength_check($value);
......@@ -417,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>";
......@@ -440,33 +440,7 @@ class ListViewController {
} elseif($field->getUIType() == 98) {
$value = '<a href="index.php?module=Roles&parent=Settings&view=Edit&record='.$value.'">'.textlength_check(getRoleName($value)).'</a>';
} elseif($fieldDataType == 'multipicklist') {
if(!$is_admin && $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 != '') {
if ($value != '') {
$moduleName = getTabModuleName($field->getTabId());
$value = explode(' |##| ', $value);
foreach ($value as $key => $val) {
......@@ -487,10 +461,10 @@ class ListViewController {
} elseif($field->getFieldDataType() == 'reference') {
$referenceFieldInfoList = $this->queryGenerator->getReferenceFieldInfoList();
$moduleList = $referenceFieldInfoList[$fieldName];
if(count($moduleList) == 1) {
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);
......@@ -522,7 +496,7 @@ class ListViewController {
}
} elseif ( in_array($uitype,array(7,9,90)) ) {
$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&".
"record=$recordId' title='".vtranslate($field->moduleName, $field->moduleName)."'>$value</a>";
} elseif($field->getUIType() == 61) {
......
......@@ -25,25 +25,31 @@ class ListViewSession {
* Portions created by vtigerCRM are Copyright (C) vtigerCRM.
* All Rights Reserved.
*/
function ListViewSession()
{
global $log,$currentModule;
function __construct()
{
global $log,$currentModule;
$log->debug("Entering ListViewSession() method ...");
$this->module = $currentModule;
$this->sortby = 'ASC';
$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'])){
return $_SESSION['lvs'][$currentModule][$viewId]['start'];
}
return 1;
}
function getRequestStartPage(){
public static function getRequestStartPage(){
$start = $_REQUEST['start'];
if(!is_numeric($start)){
$start = 1;
......@@ -55,7 +61,7 @@ class ListViewSession {
return $start;
}
function getListViewNavigation($currentRecordId){
public static function getListViewNavigation($currentRecordId){
global $currentModule,$current_user,$adb,$log,$list_max_entries_per_page;
Zend_Json::$useBuiltinEncoderDecoder = true;
$reUseData = false;
......@@ -69,10 +75,12 @@ 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;
if(count($recordNavigationInfo) == 1){
if(php7_count($recordNavigationInfo) == 1){
foreach ($recordNavigationInfo as $recordIdList) {
if(in_array($currentRecordId,$recordIdList)){
$reUseData = true;
......@@ -86,18 +94,18 @@ class ListViewSession {
$recordList[] = $recordId;
$recordPageMapping[$recordId] = $start;
if($recordId == $currentRecordId){
$searchKey = count($recordList)-1;
$searchKey = php7_count($recordList)-1;
$_REQUEST['start'] = $start;
}
}
}
if($searchKey > $displayBufferRecordCount -1 && $searchKey < count($recordList)-$displayBufferRecordCount){
if($searchKey > $displayBufferRecordCount -1 && $searchKey < php7_count($recordList)-$displayBufferRecordCount){
$reUseData= true;
}
}
}
$list_query = $_SESSION[$currentModule.'_listquery'];
$list_query = isset($_SESSION[$currentModule.'_listquery'])?$_SESSION[$currentModule.'_listquery']:'';
if($reUseData === false && !empty($list_query)){
$recordNavigationInfo = array();
......@@ -160,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)){
......@@ -176,7 +184,7 @@ class ListViewSession {
return $recordNavigationInfo;
}
function getRequestCurrentPage($currentModule, $query, $viewid, $queryMode = false) {
static function getRequestCurrentPage($currentModule, $query, $viewid, $queryMode = false) {
global $list_max_entries_per_page, $adb;
$start = 1;
if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true'&& $_REQUEST['start']!="last"){
......@@ -206,7 +214,7 @@ class ListViewSession {
return $start;
}
function setSessionQuery($currentModule,$query,$viewid){
public static function setSessionQuery($currentModule,$query,$viewid){
if(isset($_SESSION[$currentModule.'_listquery'])){
if($_SESSION[$currentModule.'_listquery'] != $query){
unset($_SESSION[$currentModule.'_DetailView_Navigation'.$viewid]);
......@@ -215,7 +223,7 @@ class ListViewSession {
$_SESSION[$currentModule.'_listquery'] = $query;
}
function hasViewChanged($currentModule) {
static function hasViewChanged($currentModule) {
if(empty($_SESSION['lvs'][$currentModule]['viewname'])) return true;
if(empty($_REQUEST['viewname'])) return false;
if($_REQUEST['viewname'] != $_SESSION['lvs'][$currentModule]['viewname']) return true;
......@@ -242,4 +250,4 @@ class ListViewSession {
}
}
}
?>
\ No newline at end of file
?>
......@@ -23,13 +23,20 @@ class RelatedListViewSession {
var $sorder = null;
var $sortby = null;
var $page_view = null;
function RelatedListViewSession() {
global $log,$currentModule;
function __construct()
{
global $log,$currentModule;
$log->debug("Entering RelatedListViewSession() method ...");
$this->module = $currentModule;
$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) {
......
......@@ -31,7 +31,7 @@ class PopulateComboValues
function insertComboValues($values, $tableName,$picklistid)
{
global $log;
$log->debug("Entering insertComboValues(".$values.", ".$tableName.") method ...");
$tableName = Vtiger_Util_Helper::validateStringForSql($tableName);
global $adb;
//inserting the value in the vtiger_picklistvalues_seq for the getting uniqueID for each picklist values...
$i=0;
......@@ -81,7 +81,7 @@ class PopulateComboValues
global $app_list_strings,$adb;
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);
for($i=0; $i<$noOfCombos; $i++)
{
......@@ -124,7 +124,7 @@ class PopulateComboValues
global $app_list_strings,$adb;
global $combo_strings;
// 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);
for($i=0; $i<$noOfCombos; $i++)
{
......@@ -136,7 +136,6 @@ class PopulateComboValues
function insertNonPicklistValues($values, $tableName)
{
global $log;
$log->debug("Entering insertNonPicklistValues(".$values.", ".$tableName.") method ...");
global $adb;
$i=0;
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.