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
d9160489
Unverified
Commit
d9160489
authored
3 years ago
by
DaveD
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #21192 from jitendrapurohit/reminder
#2777
- Fix js break on reminder form
parents
fc6f9f21
8d0972dc
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
templates/CRM/Contact/Form/Task/SMSCommon.tpl
+33
-33
33 additions, 33 deletions
templates/CRM/Contact/Form/Task/SMSCommon.tpl
with
33 additions
and
33 deletions
templates/CRM/Contact/Form/Task/SMSCommon.tpl
+
33
−
33
View file @
d9160489
...
...
@@ -9,8 +9,6 @@
*}
{*common template for compose sms*}
{
crmScript
file
=
bower_components
/
sms
-
counter
/
sms_counter
.
min
.
js
region
=
html
-
header
}
<div
class=
"crm-accordion-wrapper crm-plaint_text_sms-accordion "
>
<div
class=
"crm-accordion-header"
>
{
$form.sms_text_message.label
}
...
...
@@ -47,41 +45,43 @@
{
literal
}
<script
type=
"text/javascript"
>
{/
literal
}{
if
$max_sms_length
}{
literal
}
maxCharInfoDisplay
();
CRM
.
loadScript
(
CRM
.
config
.
resourceBase
+
'
bower_components/sms-counter/sms_counter.min.js
'
).
done
(
function
()
{
maxCharInfoDisplay
();
CRM
.
$
(
'
#sms_text_message
'
).
bind
({
change
:
function
()
{
maxLengthMessage
();
},
keyup
:
function
()
{
maxCharInfoDisplay
();
}
});
CRM
.
$
(
'
#sms_text_message
'
).
bind
({
change
:
function
()
{
maxLengthMessage
();
},
keyup
:
function
()
{
maxCharInfoDisplay
();
}
});
function
maxLengthMessage
()
{
var
len
=
CRM
.
$
(
'
#sms_text_message
'
).
val
().
length
;
var
maxLength
=
{/
literal
}{
$max_sms_length
}{
literal
}
;
if
(
len
>
maxLength
)
{
CRM
.
$
(
'
#sms_text_message
'
).
crmError
(
{/
literal
}
'
{
ts
escape
=
"js"
1
=
$max_sms_length
}
SMS body exceeding limit of %1 characters
{/
ts
}
'
{
literal
}
);
return
false
;
}
return
true
;
}
function
maxLengthMessage
()
{
var
len
=
CRM
.
$
(
'
#sms_text_message
'
).
val
().
length
;
var
maxLength
=
{/
literal
}{
$max_sms_length
}{
literal
}
;
if
(
len
>
maxLength
)
{
CRM
.
$
(
'
#sms_text_message
'
).
crmError
(
{/
literal
}
'
{
ts
escape
=
"js"
1
=
$max_sms_length
}
SMS body exceeding limit of %1 characters
{/
ts
}
'
{
literal
}
);
return
false
;
}
return
true
;
}
function
maxCharInfoDisplay
(){
var
maxLength
=
{/
literal
}{
$max_sms_length
}{
literal
}
;
var
enteredText
=
SmsCounter
.
count
(
CRM
.
$
(
'
#sms_text_message
'
).
val
());
var
count
=
enteredText
.
length
;
var
segments
=
enteredText
.
messages
;
function
maxCharInfoDisplay
(){
var
maxLength
=
{/
literal
}{
$max_sms_length
}{
literal
}
;
var
enteredText
=
SmsCounter
.
count
(
CRM
.
$
(
'
#sms_text_message
'
).
val
());
var
count
=
enteredText
.
length
;
var
segments
=
enteredText
.
messages
;
if
(
count
<
0
)
{
CRM
.
$
(
'
#sms_text_message
'
).
val
(
CRM
.
$
(
'
#sms_text_message
'
).
val
().
substring
(
0
,
maxLength
));
count
=
0
;
}
var
message
=
"
{/
literal
}{
$char_count_message
}{
literal
}
"
CRM
.
$
(
'
#char-count-message
'
).
text
(
message
.
replace
(
'
%1
'
,
maxLength
).
replace
(
'
%2
'
,
count
).
replace
(
'
%3
'
,
segments
));
}
if
(
count
<
0
)
{
CRM
.
$
(
'
#sms_text_message
'
).
val
(
CRM
.
$
(
'
#sms_text_message
'
).
val
().
substring
(
0
,
maxLength
));
count
=
0
;
}
var
message
=
"
{/
literal
}{
$char_count_message
}{
literal
}
"
CRM
.
$
(
'
#char-count-message
'
).
text
(
message
.
replace
(
'
%1
'
,
maxLength
).
replace
(
'
%2
'
,
count
).
replace
(
'
%3
'
,
segments
));
}
});
{/
literal
}{/
if
}{
literal
}
</script>
...
...
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