Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
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
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
c481c79f
Commit
c481c79f
authored
11 years ago
by
deepak-srivastava
Browse files
Options
Downloads
Plain Diff
Merge pull request #1032 from ravishnair/CRM-12823
-- CRM-12823 created a popup for "Add New Record"
parents
1f5849cb
591e7c66
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
templates/CRM/Profile/Form/Dynamic.tpl
+5
-6
5 additions, 6 deletions
templates/CRM/Profile/Form/Dynamic.tpl
templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl
+41
-40
41 additions, 40 deletions
templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl
with
46 additions
and
46 deletions
templates/CRM/Profile/Form/Dynamic.tpl
+
5
−
6
View file @
c481c79f
...
...
@@ -28,13 +28,14 @@
{
if
(
$context
eq
'multiProfileDialog'
)
}
{
literal
}
<script
type=
"text/javascript"
>
cj
(
function
()
{
cj
(
function
(
$
)
{
$
(
'
#profile-dialog .crm-container-snippet #Edit
'
).
validate
(
CRM
.
validate
.
params
);
var
formOptions
=
{
beforeSubmit
:
proccessMultiRecordForm
//pre-submit callback
};
//binding the callback to snippet profile form
cj
(
'
.crm-container-snippet #Edit
'
).
ajaxForm
(
formOptions
);
$
(
'
.crm-container-snippet #Edit
'
).
ajaxForm
(
formOptions
);
});
// pre-submit callback
...
...
@@ -55,10 +56,7 @@ function proccessMultiRecordForm(formData, jqForm, options) {
//if there is any form error show the dialog
//else redirect to post url
if
(
cj
(
response
).
find
(
'
.crm-error
'
).
html
())
{
cj
(
'
#profile-dialog
'
).
show
().
html
(
response
);
}
else
{
if
(
!
cj
(
response
).
find
(
'
.crm-error
'
).
html
())
{
window
.
location
=
'
{/
literal
}{
$postUrl
}{
literal
}
'
;
}
...
...
@@ -69,6 +67,7 @@ function proccessMultiRecordForm(formData, jqForm, options) {
}
</script>
{/
literal
}
{
include
file
=
"CRM/Form/validate.tpl"
}
{/
if
}
{
if
$deleteRecord
}
<div
class=
"messages status no-popup"
>
...
...
This diff is collapsed.
Click to expand it.
templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl
+
41
−
40
View file @
c481c79f
...
...
@@ -52,44 +52,6 @@
</div>
</div>
<div
id=
'profile-dialog'
class=
"hiddenElement"
></div>
{
literal
}
<script
type=
'text/javascript'
>
cj
(
function
()
{
function
formDialog
(
dataURL
,
dialogTitle
)
{
cj
.
ajax
({
url
:
dataURL
,
success
:
function
(
content
)
{
cj
(
'
#profile-dialog
'
).
show
().
html
(
content
).
dialog
({
title
:
dialogTitle
,
modal
:
true
,
width
:
680
,
overlay
:
{
opacity
:
0.5
,
background
:
"
black
"
},
close
:
function
(
event
,
ui
)
{
cj
(
'
#profile-dialog
'
).
html
(
''
);
}
});
cj
(
'
.action-link
'
).
hide
();
cj
(
'
#profile-dialog #crm-profile-block .edit-value label
'
).
css
(
'
display
'
,
'
inline
'
);
}});
}
cj
(
'
.action-item
'
).
each
(
function
()
{
cj
(
this
).
attr
(
'
jshref
'
,
cj
(
this
).
attr
(
'
href
'
));
cj
(
this
).
attr
(
'
href
'
,
'
#browseValues
'
);
});
cj
(
"
.action-item
"
).
click
(
function
()
{
dataURL
=
cj
(
this
).
attr
(
'
jshref
'
);
dialogTitle
=
cj
(
this
).
attr
(
'
title
'
);
formDialog
(
dataURL
,
dialogTitle
);
});
});
</script>
{/
literal
}
{
elseif
!
$records
}
<div
class=
"messages status no-popup"
>
<div
class=
"icon inform-icon"
></div>
...
...
@@ -100,10 +62,49 @@
{
ts
}
No multi-record entries found. Note: check is Include in multi-record listing property of the fields you want to display in listings
{/
ts
}
{/
if
}
</div>
<div
id=
'profile-dialog'
class=
"hiddenElement"
></div>
{/
if
}
{
if
!
$reachedMax
}
<a
accesskey=
"N"
href=
"
{
crmURL
p
=
'civicrm/profile/edit'
q
=
"id=`$contactId`&multiRecord=add&gid=`$gid`"
}
"
class=
"button"
><span><div
class=
"icon add-icon"
></div>
{
ts
}
Add New Record
{/
ts
}
</span></a>
<a
accesskey=
"N"
href=
"
{
crmURL
p
=
'civicrm/profile/edit'
q
=
"id=`$contactId`&multiRecord=add&gid=`$gid`
&snippet=1&context=multiProfileDialog
"
}
"
class=
"button
action-item
"
><span><div
class=
"icon add-icon"
></div>
{
ts
}
Add New Record
{/
ts
}
</span></a>
{/
if
}
{/
if
}
{
literal
}
<script
type=
'text/javascript'
>
cj
(
function
()
{
function
formDialog
(
dataURL
,
dialogTitle
)
{
cj
.
ajax
({
url
:
dataURL
,
success
:
function
(
content
)
{
cj
(
'
#profile-dialog
'
).
show
().
html
(
content
).
dialog
({
title
:
dialogTitle
,
modal
:
true
,
width
:
680
,
overlay
:
{
opacity
:
0.5
,
background
:
"
black
"
},
close
:
function
(
event
,
ui
)
{
cj
(
'
#profile-dialog
'
).
html
(
''
);
}
});
cj
(
'
.action-link
'
).
hide
();
cj
(
'
#profile-dialog #crm-profile-block .edit-value label
'
).
css
(
'
display
'
,
'
inline
'
);
}});
}
cj
(
'
.action-item
'
).
each
(
function
()
{
cj
(
this
).
attr
(
'
jshref
'
,
cj
(
this
).
attr
(
'
href
'
));
cj
(
this
).
attr
(
'
href
'
,
'
#browseValues
'
);
});
cj
(
"
.action-item
"
).
click
(
function
()
{
dataURL
=
cj
(
this
).
attr
(
'
jshref
'
);
dialogTitle
=
cj
(
this
).
attr
(
'
title
'
);
formDialog
(
dataURL
,
dialogTitle
);
});
});
</script>
{/
literal
}
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