|
1
|
|
|
<?php |
|
2
|
|
|
/* +*********************************************************************************** |
|
3
|
|
|
* The contents of this file are subject to the vtiger CRM Public License Version 1.0 |
|
4
|
|
|
* ("License"); You may not use this file except in compliance with the License |
|
5
|
|
|
* The Original Code is: vtiger CRM Open Source |
|
6
|
|
|
* The Initial Developer of the Original Code is vtiger. |
|
7
|
|
|
* Portions created by vtiger are Copyright (C) vtiger. |
|
8
|
|
|
* All Rights Reserved. |
|
9
|
|
|
* *********************************************************************************** */ |
|
10
|
|
|
|
|
11
|
|
|
class Leads_LeadsCreated_Dashboard extends Vtiger_IndexAjax_View |
|
12
|
|
|
{ |
|
13
|
|
|
public function process(App\Request $request) |
|
14
|
|
|
{ |
|
15
|
|
|
$currentUserId = \App\User::getCurrentUserId(); |
|
16
|
|
|
$viewer = $this->getViewer($request); |
|
17
|
|
|
$moduleName = $request->getModule(); |
|
18
|
|
|
$owner = $request->getByType('owner', 2); |
|
19
|
|
|
$data = Vtiger_Module_Model::getInstance($moduleName)->getLeadsCreated($owner, $request->getDateRange('createdtime')); |
|
|
|
|
|
|
20
|
|
|
$widget = Vtiger_Widget_Model::getInstance($request->getInteger('linkid'), $currentUserId); |
|
21
|
|
|
//Include special script and css needed for this widget |
|
22
|
|
|
$viewer->assign('SCRIPTS', $this->getHeaderScripts($request)); |
|
23
|
|
|
$viewer->assign('WIDGET', $widget); |
|
24
|
|
|
$viewer->assign('MODULE_NAME', $moduleName); |
|
25
|
|
|
$viewer->assign('CURRENTUSERID', $currentUserId); |
|
26
|
|
|
$viewer->assign('DATA', $data); |
|
27
|
|
|
$viewer->assign('ACCESSIBLE_USERS', \App\Fields\Owner::getInstance('Leads', $currentUserId)->getAccessibleUsersForModule()); |
|
28
|
|
|
if ($request->has('content')) { |
|
29
|
|
|
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName); |
|
30
|
|
|
} else { |
|
31
|
|
|
$viewer->view('dashboards/LeadsCreated.tpl', $moduleName); |
|
32
|
|
|
} |
|
33
|
|
|
} |
|
34
|
|
|
} |
|
35
|
|
|
|