mirror of
https://github.com/espocrm/espocrm.git
synced 2026-03-10 07:27:00 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2deaf57dd | ||
|
|
0530d9deb8 | ||
|
|
b57ccf0c6a | ||
|
|
9ea9cf693d | ||
|
|
3460931fba | ||
|
|
b743d113cc | ||
|
|
f810371e70 |
@@ -5,8 +5,8 @@
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="rule 1G" stopProcessing="true">
|
||||
<match url="^" />
|
||||
<action type="Rewrite" url="index.php" appendQueryString="true" />
|
||||
<match url="^" />
|
||||
<action type="Rewrite" url="index.php" appendQueryString="true" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
@@ -175,7 +175,7 @@ class Table
|
||||
public function getLevel($scope, $action)
|
||||
{
|
||||
if (isset($this->data->table->$scope)) {
|
||||
if (isset($this->table->$scope->$action)) {
|
||||
if (isset($this->data->table->$scope->$action)) {
|
||||
return $this->data->table->$scope->$action;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Crm\Controllers;
|
||||
|
||||
@@ -43,10 +43,10 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
|
||||
$dateFrom = $request->get('dateFrom');
|
||||
$dateTo = $request->get('dateTo');
|
||||
|
||||
|
||||
return $this->getService('Opportunity')->reportByLeadSource($dateFrom, $dateTo);
|
||||
}
|
||||
|
||||
|
||||
public function actionReportByStage($params, $data, $request)
|
||||
{
|
||||
$level = $this->getAcl()->getLevel('Opportunity', 'read');
|
||||
@@ -56,10 +56,10 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
|
||||
$dateFrom = $request->get('dateFrom');
|
||||
$dateTo = $request->get('dateTo');
|
||||
|
||||
|
||||
return $this->getService('Opportunity')->reportByStage($dateFrom, $dateTo);
|
||||
}
|
||||
|
||||
|
||||
public function actionReportSalesByMonth($params, $data, $request)
|
||||
{
|
||||
$level = $this->getAcl()->getLevel('Opportunity', 'read');
|
||||
@@ -69,10 +69,10 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
|
||||
$dateFrom = $request->get('dateFrom');
|
||||
$dateTo = $request->get('dateTo');
|
||||
|
||||
return $this->getService('Opportunity')->reportSalesByMonth($dateFrom, $dateTo);
|
||||
|
||||
return $this->getService('Opportunity')->reportSalesByMonth($dateFrom, $dateTo);
|
||||
}
|
||||
|
||||
|
||||
public function actionReportSalesPipeline($params, $data, $request)
|
||||
{
|
||||
$level = $this->getAcl()->getLevel('Opportunity', 'read');
|
||||
@@ -82,7 +82,7 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
|
||||
$dateFrom = $request->get('dateFrom');
|
||||
$dateTo = $request->get('dateTo');
|
||||
|
||||
|
||||
return $this->getService('Opportunity')->reportSalesPipeline($dateFrom, $dateTo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
{
|
||||
"name":"activities",
|
||||
"label":"Activities",
|
||||
"view":"crm:views/record/panels/activities",
|
||||
"view":"crm:views/case/record/panels/activities",
|
||||
"aclScope": "Activities"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"layouts": true,
|
||||
"tab": true,
|
||||
"acl": true,
|
||||
"aclPortal": "recordAllAccountOwnNo",
|
||||
"aclPortal": "recordAllAccountNo",
|
||||
"module": "Crm",
|
||||
"customizable": true,
|
||||
"stream": true,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"layouts":true,
|
||||
"tab":true,
|
||||
"acl":true,
|
||||
"aclPortal": "recordAllAccountContactOwnNo",
|
||||
"aclPortal": "recordAllAccountContactNo",
|
||||
"module":"Crm",
|
||||
"customizable": true,
|
||||
"stream": true,
|
||||
|
||||
@@ -52,5 +52,22 @@ class Account extends \Espo\Core\SelectManagers\Base
|
||||
);
|
||||
}
|
||||
|
||||
protected function accessPortalOnlyAccount(&$result)
|
||||
{
|
||||
$d = array();
|
||||
|
||||
$accountIdList = $this->getUser()->getLinkMultipleIdList('accounts');
|
||||
|
||||
if (count($accountIdList)) {
|
||||
$result['whereClause'][] = array(
|
||||
'id' => $accountIdList
|
||||
);
|
||||
} else {
|
||||
$result['whereClause'][] = array(
|
||||
'id' => null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -44,5 +44,22 @@ class Contact extends \Espo\Core\SelectManagers\Base
|
||||
), $result);
|
||||
}
|
||||
|
||||
protected function accessPortalOnlyContact(&$result)
|
||||
{
|
||||
$d = array();
|
||||
|
||||
$contactId = $this->getUser()->get('contactId');
|
||||
|
||||
if ($contactId) {
|
||||
$result['whereClause'][] = array(
|
||||
'id' => $contactId
|
||||
);
|
||||
} else {
|
||||
$result['whereClause'][] = array(
|
||||
'id' => null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -421,6 +421,7 @@ class InboundEmail extends \Espo\Services\Record
|
||||
|
||||
if ($user) {
|
||||
$case->set('assignedUserId', $user->id);
|
||||
$case->set('status', 'Assigned');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,6 +438,7 @@ class InboundEmail extends \Espo\Services\Record
|
||||
|
||||
if ($user) {
|
||||
$case->set('assignedUserId', $user->id);
|
||||
$case->set('status', 'Assigned');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,19 +470,17 @@ class InboundEmail extends \Espo\Services\Record
|
||||
$caseDistribution = $params['caseDistribution'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$targetUserPosition = null;
|
||||
if (!empty($params['targetUserPosition'])) {
|
||||
$targetUserPosition = $params['targetUserPosition'];
|
||||
}
|
||||
|
||||
$case->set('status', 'Assigned');
|
||||
|
||||
switch ($caseDistribution) {
|
||||
case 'Direct-Assignment':
|
||||
if ($userId) {
|
||||
$case->set('assignedUserId', $userId);
|
||||
$case->set('status', 'Assigned');
|
||||
}
|
||||
break;
|
||||
case 'Round-Robin':
|
||||
|
||||
@@ -24,31 +24,31 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('Crm:Views.Case.Record.Panels.Activities', 'Crm:Views.Record.Panels.Activities', function (Dep) {
|
||||
Espo.define('crm:views/case/record/panels/activities', 'crm:views/record/panels/activities', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
|
||||
getComposeEmailAttributes: function (data, callback) {
|
||||
data = data || {};
|
||||
var attributes = {
|
||||
status: 'Draft',
|
||||
name: '[#' + this.model.get('number') + '] ' + this.model.get('name')
|
||||
};
|
||||
|
||||
|
||||
if (this.model.get('contactId')) {
|
||||
this.getModelFactory().create('Contact', function (contact) {
|
||||
contact.id = this.model.get('contactId');
|
||||
|
||||
|
||||
this.listenToOnce(contact, 'sync', function () {
|
||||
var emailAddress = contact.get('emailAddress');
|
||||
var emailAddress = contact.get('emailAddress');
|
||||
if (emailAddress) {
|
||||
attributes.to = emailAddress;
|
||||
}
|
||||
|
||||
|
||||
callback.call(this, attributes);
|
||||
});
|
||||
});
|
||||
contact.fetch({
|
||||
error: function () {
|
||||
callback.call(this, attributes);
|
||||
@@ -58,8 +58,7 @@ Espo.define('Crm:Views.Case.Record.Panels.Activities', 'Crm:Views.Record.Panels.
|
||||
} else {
|
||||
callback.call(this, attributes);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
id: '{{portalId}}',
|
||||
useCache: false,
|
||||
cacheTimestamp: {{cacheTimestamp}},
|
||||
url: 'api/v1/portal/{{portalId}}',
|
||||
url: 'api/v1/portal-access/{{portalId}}',
|
||||
basePath: '{{basePath}}'
|
||||
}, function (app) {
|
||||
{{runScript}}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
id: '{{portalId}}',
|
||||
useCache: {{useCache}},
|
||||
cacheTimestamp: {{cacheTimestamp}},
|
||||
url: 'api/v1/portal/{{portalId}}',
|
||||
url: 'api/v1/portal-access/{{portalId}}',
|
||||
basePath: '{{basePath}}'
|
||||
}, function (app) {
|
||||
{{runScript}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "espocrm",
|
||||
"version": "4.0.1",
|
||||
"version": "4.0.2",
|
||||
"description": "",
|
||||
"main": "index.php",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user