Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Show more breadcrumbs
beppo.it
vtigercrm
Commits
b789aea1
Commit
b789aea1
authored
8 years ago
by
Prasad
Browse files
Options
Downloads
Patches
Plain Diff
Removed redundant logic in finding related record.
parent
c5ba6f07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/vtiger/modules/MailManager/modules/MailManager/views/Relation.php
+14
-16
14 additions, 16 deletions
...odules/MailManager/modules/MailManager/views/Relation.php
with
14 additions
and
16 deletions
pkg/vtiger/modules/MailManager/modules/MailManager/views/Relation.php
+
14
−
16
View file @
b789aea1
...
...
@@ -423,28 +423,26 @@ class MailManager_Relation_View extends MailManager_Abstract_View {
*/
public
function
lookupModuleRecordsWithEmail
(
$module
,
$emails
)
{
$currentUserModel
=
vglobal
(
'current_user'
);
//could be to multiple email addresses
//could be to multiple email addresses
$results
=
array
();
foreach
(
explode
(
","
,
$emails
)
as
$email
){
$query
=
$this
->
buildSearchQuery
(
$module
,
$email
,
'EMAIL'
);
$qresults
=
vtws_query
(
$query
,
$currentUserModel
);
$describe
=
$this
->
ws_describe
(
$module
);
$labelFields
=
explode
(
','
,
$describe
[
'labelFields'
]);
foreach
(
$qresults
as
$qresult
)
{
$labelValues
=
array
();
foreach
(
$labelFields
as
$fieldname
)
{
if
(
isset
(
$qresult
[
$fieldname
]))
$labelValues
[]
=
$qresult
[
$fieldname
];
}
$ids
=
vtws_getIdComponents
(
$qresult
[
'id'
]);
$results
[]
=
array
(
'wsid'
=>
$qresult
[
'id'
],
'id'
=>
$ids
[
1
],
'label'
=>
implode
(
' '
,
$labelValues
));
foreach
(
explode
(
","
,
$emails
)
as
$email
){
$query
=
$this
->
buildSearchQuery
(
$module
,
$email
,
'EMAIL'
);
$qresults
=
vtws_query
(
$query
,
$currentUserModel
);
$describe
=
$this
->
ws_describe
(
$module
);
$labelFields
=
explode
(
','
,
$describe
[
'labelFields'
]);
foreach
(
$qresults
as
$qresult
)
{
$labelValues
=
array
();
foreach
(
$labelFields
as
$fieldname
)
{
if
(
isset
(
$qresult
[
$fieldname
]))
$labelValues
[]
=
$qresult
[
$fieldname
];
}
$ids
=
vtws_getIdComponents
(
$qresult
[
'id'
]);
$results
[]
=
array
(
'wsid'
=>
$qresult
[
'id'
],
'id'
=>
$ids
[
1
],
'label'
=>
implode
(
' '
,
$labelValues
));
}
$ids
=
vtws_getIdComponents
(
$qresult
[
'id'
]);
$results
[]
=
array
(
'wsid'
=>
$qresult
[
'id'
],
'id'
=>
$ids
[
1
],
'label'
=>
implode
(
' '
,
$labelValues
));
}
return
$results
;
}
public
function
validateRequest
(
Vtiger_Request
$request
)
{
public
function
validateRequest
(
Vtiger_Request
$request
)
{
return
$request
->
validateWriteAccess
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment