Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
c1c1b937
Commit
c1c1b937
authored
6 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Refactor-Don't pass activity object to addCaseActivityLinks
parent
c1c1e89c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Case/BAO/Case.php
+16
-10
16 additions, 10 deletions
CRM/Case/BAO/Case.php
CRM/Case/Selector/Search.php
+1
-1
1 addition, 1 deletion
CRM/Case/Selector/Search.php
with
17 additions
and
11 deletions
CRM/Case/BAO/Case.php
+
16
−
10
View file @
c1c1b937
...
...
@@ -1151,9 +1151,18 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c
// Activity Status Label for Case activities list
$caseActivities
[
$caseActivityId
][
'status_id'
]
=
CRM_Core_PseudoConstant
::
getLabel
(
'CRM_Activity_BAO_Activity'
,
'activity_status_id'
,
$dao
->
status
);
$deleted
=
''
;
if
(
$dao
->
deleted
)
{
$deleted
=
'<br /> '
.
ts
(
'(deleted)'
);
}
$caseActivities
[
$caseActivityId
][
'status_id'
]
=
CRM_Core_PseudoConstant
::
getLabel
(
'CRM_Activity_BAO_Activity'
,
'activity_status_id'
,
$dao
->
status
)
.
$deleted
;
// if there are file attachments we will return how many
if
(
!
empty
(
$dao
->
attachment_ids
))
{
$attachmentIDs
=
array_unique
(
explode
(
','
,
$dao
->
attachment_ids
));
$caseActivity
[
'no_attachments'
]
=
count
(
$attachmentIDs
);
}
$caseActivities
[
$caseActivityId
]
=
self
::
addCaseActivityLinks
(
$caseID
,
$contactID
,
$userID
,
$context
,
$dao
,
$caseActivities
[
$caseActivityId
]);
$caseActivities
[
$caseActivityId
][
'links'
]
=
self
::
addCaseActivityLinks
(
$caseID
,
$contactID
,
$userID
,
$context
,
$dao
);
}
$caseActivitiesDT
=
array
();
...
...
@@ -1173,11 +1182,11 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c
* @param int $userID
* @param string $context
* @param \CRM_Core_DAO $dao
* @param array $caseActivity
*
* @return array caseActivity
* @return string
* HTML formatted Link
*/
p
ublic
static
function
addCaseActivityLinks
(
$caseID
,
$contactID
,
$userID
,
$context
,
$dao
,
$caseActivity
)
{
p
rivate
static
function
addCaseActivityLinks
(
$caseID
,
$contactID
,
$userID
,
$context
,
$dao
)
{
// FIXME: Why are we not using CRM_Core_Action for these links? This is too much manual work and likely to get out-of-sync with core markup.
$caseActivityId
=
$dao
->
id
;
$allowView
=
self
::
checkPermission
(
$caseActivityId
,
'view'
,
$dao
->
activity_type_id
,
$userID
);
...
...
@@ -1221,7 +1230,6 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c
}
elseif
(
!
$caseDeleted
)
{
$url
=
' <a '
.
$css
.
' href="'
.
$restoreUrl
.
$additionalUrl
.
'">'
.
ts
(
'Restore'
)
.
'</a>'
;
$caseActivity
[
'status_id'
]
=
$caseActivity
[
'status_id'
]
.
'<br /> (deleted)'
;
}
//check for operations.
...
...
@@ -1233,12 +1241,10 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c
}
// if there are file attachments we will return how many and, if only one, add a link to it
if
(
!
empty
(
$dao
->
attachment_ids
))
{
$attachmentIDs
=
array_unique
(
explode
(
','
,
$dao
->
attachment_ids
));
$caseActivity
[
'no_attachments'
]
=
count
(
$attachmentIDs
);
$url
.
=
implode
(
' '
,
CRM_Core_BAO_File
::
paperIconAttachment
(
'civicrm_activity'
,
$caseActivityId
));
}
$caseActivity
[
'links'
]
=
$url
;
return
$
caseActivity
;
return
$
url
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
CRM/Case/Selector/Search.php
+
1
−
1
View file @
c1c1b937
...
...
@@ -322,7 +322,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base {
$isDeleted
=
FALSE
;
if
(
$result
->
case_deleted
)
{
$isDeleted
=
TRUE
;
$row
[
'case_status_id'
]
=
empty
(
$row
[
'case_status_id'
])
?
""
:
$row
[
'case_status_id'
]
.
'<br />(deleted)'
;
$row
[
'case_status_id'
]
=
empty
(
$row
[
'case_status_id'
])
?
""
:
$row
[
'case_status_id'
]
.
'<br />
'
.
ts
(
'
(deleted)'
)
;
}
$scheduledInfo
[
'case_id'
][]
=
$result
->
case_id
;
...
...
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