Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Development
Core
Commits
33913af6
Commit
33913af6
authored
Oct 22, 2014
by
colemanw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRM-15472 - Freeze activity target field if too many contacts
parent
29238896
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
CRM/Activity/Form/Activity.php
CRM/Activity/Form/Activity.php
+8
-0
templates/CRM/Activity/Form/Activity.tpl
templates/CRM/Activity/Form/Activity.tpl
+5
-3
No files found.
CRM/Activity/Form/Activity.php
View file @
33913af6
...
...
@@ -567,6 +567,14 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
$defaults
[
'target_contact_id'
]
=
$this
->
_contactIds
;
}
// CRM-15472 - 50 is around the practial limit of how many items a select2 entityRef can handle
if
(
!
empty
(
$defaults
[
'target_contact_id'
]))
{
$count
=
count
(
is_array
(
$defaults
[
'target_contact_id'
])
?
$defaults
[
'target_contact_id'
]
:
explode
(
','
,
$defaults
[
'target_contact_id'
]));
if
(
$count
>
50
)
{
$this
->
freeze
(
array
(
'target_contact_id'
));
}
}
if
(
$this
->
_action
&
(
CRM_Core_Action
::
DELETE
|
CRM_Core_Action
::
RENEW
))
{
$this
->
assign
(
'delName'
,
CRM_Utils_Array
::
value
(
'subject'
,
$defaults
));
}
...
...
templates/CRM/Activity/Form/Activity.tpl
View file @
33913af6
...
...
@@ -96,9 +96,11 @@
<td>
{
$form.assignee_contact_id.html
}
{
if
$action
neq
4
}
<a
href=
"#"
class=
"crm-hover-button"
id=
"swap_target_assignee"
title=
"
{
ts
}
Swap Target and Assignee Contacts
{/
ts
}
"
style=
"position:relative; bottom: 1em;"
>
<span><div
class=
"icon swap-icon"
></div></span>
</a>
{
if
!
$form.target_contact_id.frozen
}
<a
href=
"#"
class=
"crm-hover-button"
id=
"swap_target_assignee"
title=
"
{
ts
}
Swap Target and Assignee Contacts
{/
ts
}
"
style=
"position:relative; bottom: 1em;"
>
<span
class=
"icon ui-icon-shuffle"
></span>
</a>
{/
if
}
{
if
$activityAssigneeNotification
}
<br
/>
<span
class=
"description"
><span
class=
"icon email-icon"
></span>
{
ts
}
A copy of this activity will be emailed to each Assignee.
{/
ts
}
</span>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment