Skip to content

Commit

Permalink
Merge pull request #35 from AlexKay85/master
Browse files Browse the repository at this point in the history
QoL changes
  • Loading branch information
AlexKay85 authored Aug 7, 2018
2 parents 067b870 + 0d729a9 commit 5909432
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/Webservices/LineItem/VtigerLineItemOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ public function describe($elementType) {
unset($describe['fields'][$key]);
}
}
//crm-now: fix gap in numeric keys that will lead to a different JSON contruct
$describe['fields'] = array_values($describe['fields']);
return $describe;
}
}
Expand Down
8 changes: 8 additions & 0 deletions modules/Reports/ReportRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -3219,6 +3219,14 @@ function GenerateReport($outputformat,$filtersql, $directOutput=false, $startLim

$sSQL = $this->sGetSQLforReport($this->reportid,$filtersql,$outputformat,false,$startLimit,$endLimit);
$result = $adb->pquery($sSQL,array());

if (!$result) {
$rSQL = str_ireplace('INNER JOIN', '<br>INNER JOIN', $sSQL);
$rSQL = str_ireplace('WHERE', '<br>WHERE', $sSQL);
echo '<div style="color:red;">'.$rSQL.'<br><br>'.$adb->database->errorMsg().'</div>';
return;
}

if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1)
$picklistarray = $this->getAccessPickListValues();

Expand Down
7 changes: 6 additions & 1 deletion modules/Reports/models/ScheduleReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Reports_ScheduleReports_Model extends Vtiger_Base_Model {

var $scheduledFormat = 'CSV';
var $scheduledFormat = 'XLS';

static $SCHEDULED_DAILY = 1;
static $SCHEDULED_WEEKLY = 2;
Expand Down Expand Up @@ -204,6 +204,11 @@ public function sendEmail() {
$filePath = 'storage/' . $fileName;
$attachments[$fileName] = $filePath;
$oReportRun->writeReportToCSVFile($filePath);
} elseif ($reportFormat == 'XLS') {
$fileName = $baseFileName . '.xls';
$filePath = 'storage/' . $fileName;
$attachments[$fileName] = $filePath;
$oReportRun->writeReportToExcelFile($filePath);
}

foreach ($attachments as $attachmentName => $path) {
Expand Down

0 comments on commit 5909432

Please sign in to comment.