First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
|
@ -0,0 +1,40 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* this template is used for confirmation of delete for a group *}
|
||||
<div class="crm-block crm-form-block crm-group-delete-form-block">
|
||||
|
||||
<h3>{ts}Delete Group{/ts}</h3>
|
||||
<div class="messages status no-popup">
|
||||
<img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
|
||||
{ts 1=$title}Are you sure you want to delete the group %1?{/ts}<br /><br />
|
||||
{if $count}
|
||||
{ts count=$count plural='This group currently has %count members in it.'}This group currently has one member in it.{/ts}
|
||||
{/if}
|
||||
{ts}Deleting this group will NOT delete the member contact records. However, all contact subscription information and history for this group will be deleted.{/ts} {ts}If this group is used in CiviCRM profiles, those fields will be reset.{/ts} {ts}This action cannot be undone.{/ts}
|
||||
</div>
|
||||
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
</div>
|
122
sites/all/modules/civicrm/templates/CRM/Group/Form/Edit.tpl
Normal file
122
sites/all/modules/civicrm/templates/CRM/Group/Form/Edit.tpl
Normal file
|
@ -0,0 +1,122 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{* this template is used for adding/editing group (name and description only) *}
|
||||
<div class="crm-block crm-form-block crm-group-form-block">
|
||||
<div class="help">
|
||||
{if $action eq 2}
|
||||
{capture assign=crmURL}class="no-popup" href="{crmURL p="civicrm/group/search" q="reset=1&force=1&context=smog&gid=`$group.id`"}"{/capture}
|
||||
{ts 1=$crmURL}You can edit the Name and Description for this group here. Click <a %1>Contacts in this Group</a> to view, add or remove contacts in this group.{/ts}
|
||||
{else}
|
||||
{ts}Enter a unique name and a description for your new group here. Then click 'Continue' to find contacts to add to your new group.{/ts}
|
||||
{/if}
|
||||
</div>
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
|
||||
<table class="form-layout">
|
||||
<tr class="crm-group-form-block-title">
|
||||
<td class="label">{$form.title.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_group' field='title' id=$group.id}{/if}</td>
|
||||
<td>{$form.title.html|crmAddClass:huge}
|
||||
{if $group.saved_search_id} ({ts}Smart Group{/ts}){/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if $group.created_by}
|
||||
<tr class="crm-group-form-block-created">
|
||||
<td class="label">{ts}Created By{/ts}</td>
|
||||
<td>{$group.created_by}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $group.modified_by}
|
||||
<tr class="crm-group-form-block-modified">
|
||||
<td class="label">{ts}Modified By{/ts}</td>
|
||||
<td>{$group.modified_by}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr class="crm-group-form-block-description">
|
||||
<td class="label">{$form.description.label}</td>
|
||||
<td>{$form.description.html}<br />
|
||||
<span class="description">{ts}Group description is displayed when groups are listed in Profiles and Mailing List Subscribe forms.{/ts}</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if $form.group_type}
|
||||
<tr class="crm-group-form-block-group_type">
|
||||
<td class="label">{$form.group_type.label}</td>
|
||||
<td>{$form.group_type.html} {help id="id-group-type" file="CRM/Group/Page/Group.hlp"}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr class="crm-group-form-block-visibility">
|
||||
<td class="label">{$form.visibility.label}</td>
|
||||
<td>{$form.visibility.html|crmAddClass:huge} {help id="id-group-visibility" file="CRM/Group/Page/Group.hlp"}</td>
|
||||
</tr>
|
||||
|
||||
<tr class="crm-group-form-block-isReserved">
|
||||
<td class="report-label">{$form.is_reserved.label}</td>
|
||||
<td>{$form.is_reserved.html}
|
||||
<span class="description">{ts}If reserved, only users with 'administer reserved groups' permission can disable, delete, or change settings for this group. The reserved flag does NOT affect users ability to add or remove contacts from a group.{/ts}</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2>{include file="CRM/Custom/Form/CustomData.tpl"}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
{*CRM-14190*}
|
||||
{include file="CRM/Group/Form/GroupsCommon.tpl"}
|
||||
|
||||
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
|
||||
{if $action neq 1}
|
||||
<div class="action-link">
|
||||
<a {$crmURL}>» {ts}Contacts in this Group{/ts}</a>
|
||||
{if $group.saved_search_id}
|
||||
<br />
|
||||
{if $group.mapping_id}
|
||||
<a class="no-popup" href="{crmURL p="civicrm/contact/search/builder" q="reset=1&force=1&ssID=`$group.saved_search_id`"}">» {ts}Edit Smart Group Criteria{/ts}</a>
|
||||
{elseif $group.search_custom_id}
|
||||
<a class="no-popup" href="{crmURL p="civicrm/contact/search/custom" q="reset=1&force=1&ssID=`$group.saved_search_id`"}">» {ts}Edit Smart Group Criteria{/ts}</a>
|
||||
{else}
|
||||
<a class="no-popup" href="{crmURL p="civicrm/contact/search/advanced" q="reset=1&force=1&ssID=`$group.saved_search_id`"}">» {ts}Edit Smart Group Criteria{/ts}</a>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
{/literal}{if $freezeMailignList}{literal}
|
||||
cj('input[type=checkbox][name="group_type[{/literal}{$freezeMailignList}{literal}]"]').prop('disabled',true);
|
||||
{/literal}{/if}{literal}
|
||||
{/literal}{if $hideMailignList}{literal}
|
||||
cj('input[type=checkbox][name="group_type[{/literal}{$hideMailignList}{literal}]"]').hide();
|
||||
cj('label[for="group_type[{/literal}{$hideMailignList}{literal}]"]').hide();
|
||||
{/literal}{/if}{literal}
|
||||
</script>
|
||||
{/literal}
|
||||
</div>
|
|
@ -0,0 +1,59 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
{*CRM-14190*}
|
||||
{if $parent_groups|@count > 0 or $form.parents.html}
|
||||
<h3>{ts}Parent Groups{/ts} {help id="id-group-parent" file="CRM/Group/Page/Group.hlp"}</h3>
|
||||
{if $parent_groups|@count > 0}
|
||||
<table class="form-layout-compressed">
|
||||
<tr>
|
||||
<td><label>{ts}Remove Parent?{/ts}</label></td>
|
||||
</tr>
|
||||
{foreach from=$parent_groups item=cgroup key=group_id}
|
||||
{assign var="element_name" value="remove_parent_group_"|cat:$group_id}
|
||||
<tr>
|
||||
<td> {$form.$element_name.html} {$form.$element_name.label}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
<br />
|
||||
{/if}
|
||||
<table class="form-layout-compressed">
|
||||
<tr class="crm-group-form-block-parents">
|
||||
<td class="label"> {$form.parents.label}</td>
|
||||
<td>{$form.parents.html|crmAddClass:huge}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
{if $form.organization_id}
|
||||
<h3>{ts}Associated Organization{/ts} {help id="id-group-organization" file="CRM/Group/Page/Group.hlp"}</h3>
|
||||
<table class="form-layout-compressed">
|
||||
<tr class="crm-group-form-block-organization">
|
||||
<td class="label"> {$form.organization_id.label}</td>
|
||||
<td>{$form.organization_id.html|crmAddClass:huge}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
242
sites/all/modules/civicrm/templates/CRM/Group/Form/Search.tpl
Normal file
242
sites/all/modules/civicrm/templates/CRM/Group/Form/Search.tpl
Normal file
|
@ -0,0 +1,242 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| This file is a part of CiviCRM. |
|
||||
| |
|
||||
| CiviCRM is free software; you can copy, modify, and distribute it |
|
||||
| under the terms of the GNU Affero General Public License |
|
||||
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
|
||||
| |
|
||||
| CiviCRM is distributed in the hope that it will be useful, but |
|
||||
| WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| See the GNU Affero General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU Affero General Public |
|
||||
| License and the CiviCRM Licensing Exception along |
|
||||
| with this program; if not, contact CiviCRM LLC |
|
||||
| at info[AT]civicrm[DOT]org. If you have questions about the |
|
||||
| GNU Affero General Public License or the licensing of CiviCRM, |
|
||||
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
<div class="crm-block crm-form-block crm-group-search-form-block">
|
||||
|
||||
<h3>{ts}Find Groups{/ts}</h3>
|
||||
<table class="form-layout">
|
||||
<tr>
|
||||
<td>
|
||||
{$form.title.label}<br />
|
||||
{$form.title.html}<br />
|
||||
<span class="description font-italic">
|
||||
{ts}Complete OR partial group name.{/ts}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{$form.created_by.label}<br />
|
||||
{$form.created_by.html}<br />
|
||||
<span class="description font-italic">
|
||||
{ts}Complete OR partial creator name.{/ts}
|
||||
</span>
|
||||
</td>
|
||||
<td id="group_type-block">
|
||||
{$form.group_type_search.label}<br />
|
||||
{$form.group_type_search.html}<br />
|
||||
<span class="description font-italic">
|
||||
{ts}Filter search by group type(s).{/ts}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{$form.visibility.label}<br />
|
||||
{$form.visibility.html}<br />
|
||||
<span class="description font-italic">
|
||||
{ts}Filter search by visibility.{/ts}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{$form.group_status.label}<br />
|
||||
{$form.group_status.html}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="css_right">
|
||||
<a class="crm-hover-button action-item" href="{crmURL q="reset=1&update_smart_groups=1"}">{ts}Update Smart Group Counts{/ts}</a> {help id="update_smart_groups"}
|
||||
</div>
|
||||
<table class="crm-group-selector crm-ajax-table" data-order='[[0,"asc"]]'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-data="title" cell-class="crm-group-name crm-editable crmf-title" class='crm-group-name'>{ts}Name{/ts}</th>
|
||||
<th data-data="count" cell-class="crm-group-count right" class='crm-group-count'>{ts}Count{/ts}</th>
|
||||
<th data-data="created_by" cell-class="crm-group-created_by" class='crm-group-created_by'>{ts}Created By{/ts}</th>
|
||||
<th data-data="description" data-orderable="false" cell-class="crm-group-description crmf-description crm-editable" class='crm-group-description'>{ts}Description{/ts}</th>
|
||||
<th data-data="group_type" cell-class="crm-group-group_type" class='crm-group-group_type'>{ts}Group Type{/ts}</th>
|
||||
<th data-data="visibility" cell-class="crm-group-visibility crmf-visibility crm-editable" cell-data-type="select" class='crm-group-visibility'>{ts}Visibility{/ts}</th>
|
||||
{if $showOrgInfo}
|
||||
<th data-data="org_info" data-orderable="false" cell-class="crm-group-org_info" class='crm-group-org_info'>{ts}Organization{/ts}</th>
|
||||
{/if}
|
||||
<th data-data="links" data-orderable="false" cell-class="crm-group-group_links" class='crm-group-group_links'> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
{* handle enable/disable actions*}
|
||||
{include file="CRM/common/enableDisableApi.tpl"}
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
// for CRM-11310 and CRM-10635 : processing just parent groups on initial display
|
||||
// passing '1' for parentsOnlyArg to show parent child hierarchy structure display
|
||||
// on initial load of manage group page and
|
||||
// also to handle search filtering for initial load of same page.
|
||||
var parentsOnly = 1
|
||||
var ZeroRecordText = {/literal}'{ts escape="js"}<div class="status messages">No Groups have been created for this site.{/ts}</div>'{literal};
|
||||
$('table.crm-group-selector').data({
|
||||
"ajax": {
|
||||
"url": {/literal}'{crmURL p="civicrm/ajax/grouplist" h=0 q="snippet=4"}'{literal},
|
||||
"data": function (d) {
|
||||
|
||||
var groupTypes = ($('.crm-group-search-form-block #group_type_search_1').prop('checked')) ? '1' : '';
|
||||
if (groupTypes) {
|
||||
groupTypes = ($('.crm-group-search-form-block #group_type_search_2').prop('checked')) ? groupTypes + ',2' : groupTypes;
|
||||
} else {
|
||||
groupTypes = ($('.crm-group-search-form-block #group_type_search_2').prop('checked')) ? '2' : '';
|
||||
}
|
||||
|
||||
var groupStatus = ($('.crm-group-search-form-block #group_status_1').prop('checked')) ? 1 : '';
|
||||
if (groupStatus) {
|
||||
groupStatus = ($('.crm-group-search-form-block #group_status_2').prop('checked')) ? 3 : groupStatus;
|
||||
} else {
|
||||
groupStatus = ($('.crm-group-search-form-block #group_status_2').prop('checked')) ? 2 : '';
|
||||
}
|
||||
|
||||
d.title = $(".crm-group-search-form-block input#title").val(),
|
||||
d.created_by = $(".crm-group-search-form-block input#created_by").val(),
|
||||
d.group_type = groupTypes,
|
||||
d.visibility = $(".crm-group-search-form-block select#visibility").val(),
|
||||
d.status = groupStatus,
|
||||
d.showOrgInfo = {/literal}"{$showOrgInfo}"{literal},
|
||||
d.parentsOnly = parentsOnly
|
||||
}
|
||||
},
|
||||
"language": {
|
||||
"zeroRecords": ZeroRecordText
|
||||
},
|
||||
"drawCallback": function(settings) {
|
||||
//Add data attributes to cells
|
||||
$('thead th', settings.nTable).each( function( index ) {
|
||||
$.each(this.attributes, function() {
|
||||
if(this.name.match("^cell-")) {
|
||||
var cellAttr = this.name.substring(5);
|
||||
var cellValue = this.value;
|
||||
$('tbody tr', settings.nTable).each( function() {
|
||||
$('td:eq('+ index +')', this).attr( cellAttr, cellValue );
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
//Reload table after draw
|
||||
$(settings.nTable).trigger('crmLoad');
|
||||
if (parentsOnly) {
|
||||
CRM.loadScript(CRM.config.resourceBase + 'js/jquery/jquery.crmEditable.js').done(function () {
|
||||
$('tbody tr.crm-group-parent', settings.nTable).each(function () {
|
||||
$(this).find('td:first')
|
||||
.prepend('{/literal}<span class="collapsed show-children" title="{ts}show child groups{/ts}"/></span>{literal}')
|
||||
.find('div').css({'display': 'inline'});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
$(function($) {
|
||||
$('.crm-group-search-form-block :input').change(function(){
|
||||
parentsOnly = 0;
|
||||
ZeroRecordText = '<div class="status messages">{/literal}{ts escape="js"}No matching Groups found for your search criteria. Suggestions:{/ts}{literal}<div class="spacer"></div><ul><li>{/literal}{ts escape="js"}Check your spelling.{/ts}{literal}</li><li>{/literal}{ts escape="js"}Try a different spelling or use fewer letters.{/ts}{literal}</li><li>{/literal}{ts escape="js"}Make sure you have enough privileges in the access control system.{/ts}{literal}</li></ul></div>';
|
||||
$('table.crm-group-selector').DataTable().draw();
|
||||
});
|
||||
});
|
||||
$('#crm-container')
|
||||
.on('click', 'a.button, a.action-item[href*="action=update"], a.action-item[href*="action=delete"]', CRM.popup)
|
||||
.on('crmPopupFormSuccess', 'a.button, a.action-item[href*="action=update"], a.action-item[href*="action=delete"]', function() {
|
||||
// Refresh datatable when form completes
|
||||
$('table.crm-group-selector').DataTable().draw();
|
||||
});
|
||||
// show hide children
|
||||
var context = $('#crm-main-content-wrapper');
|
||||
$('table.crm-group-selector', context).on( 'click', 'span.show-children', function(){
|
||||
var showOrgInfo = {/literal}"{$showOrgInfo}"{literal};
|
||||
var rowID = $(this).parents('tr').prop('id');
|
||||
var parentRow = rowID.split('_');
|
||||
var parent_id = parentRow[1];
|
||||
var group_id = '';
|
||||
if ( parentRow[2]) {
|
||||
group_id = parentRow[2];
|
||||
}
|
||||
var levelClass = 'level_2';
|
||||
// check enclosing td if already at level 2
|
||||
if ( $(this).parent().hasClass('level_2') ) {
|
||||
levelClass = 'level_3';
|
||||
}
|
||||
if ( $(this).hasClass('collapsed') ) {
|
||||
$(this).removeClass("collapsed").addClass("expanded").attr("title",{/literal}"{ts escape='js'}hide child groups{/ts}"{literal});
|
||||
showChildren( parent_id, showOrgInfo, group_id, levelClass );
|
||||
}
|
||||
else {
|
||||
$(this).removeClass("expanded").addClass("collapsed").attr("title",{/literal}"{ts escape='js'}show child groups{/ts}"{literal});
|
||||
$('.parent_is_' + parent_id).find('.show-children').removeClass("expanded").addClass("collapsed").attr("title",{/literal}"{ts escape='js'}show child groups{/ts}"{literal});
|
||||
$('.parent_is_' + parent_id).hide();
|
||||
$('.parent_is_' + parent_id).each(function(i, obj) {
|
||||
// also hide children of children
|
||||
var gID = $(this).data('id');
|
||||
$('.parent_is_' + gID).hide();
|
||||
});
|
||||
}
|
||||
});
|
||||
function showChildren( parent_id, showOrgInfo, group_id, levelClass) {
|
||||
var rowID = '#row_' + parent_id;
|
||||
if ( group_id ) {
|
||||
rowID = '#row_' + parent_id + '_' + group_id;
|
||||
}
|
||||
if ( $(rowID).next().hasClass('parent_is_' + parent_id ) ) {
|
||||
// child rows for this parent have already been retrieved so just show them
|
||||
$('.parent_is_' + parent_id ).show();
|
||||
} else {
|
||||
//FIXME Is it possible to replace all this with a datatables call?
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
"url": {/literal}'{crmURL p="civicrm/ajax/grouplist" h=0 q="snippet=4"}'{literal},
|
||||
"data": {'parent_id': parent_id, 'showOrgInfo': showOrgInfo},
|
||||
"success": function(response){
|
||||
var appendHTML = '';
|
||||
$.each( response.data, function( i, val ) {
|
||||
appendHTML += '<tr id="row_'+val.group_id+'_'+parent_id+'" data-entity="group" data-id="'+val.group_id+'" class="crm-entity parent_is_'+parent_id+' crm-row-child">';
|
||||
if ( val.is_parent ) {
|
||||
appendHTML += '<td class="crm-group-name crmf-title ' + levelClass + '">' + '{/literal}<span class="collapsed show-children" title="{ts}show child groups{/ts}"/></span><div class="crmf-title crm-editable" style="display:inline">{literal}' + val.title + '</div></td>';
|
||||
}
|
||||
else {
|
||||
appendHTML += '<td class="crm-group-name crmf-title crm-editable ' + levelClass + '"><span class="crm-no-children"></span>' + val.title + '</td>';
|
||||
}
|
||||
appendHTML += '<td class="right">' + val.count + "</td>";
|
||||
appendHTML += "<td>" + val.created_by + "</td>";
|
||||
appendHTML += '<td class="crm-editable crmf-description">' + (val.description || '') + "</td>";
|
||||
appendHTML += "<td>" + val.group_type + "</td>";
|
||||
appendHTML += '<td class="crm-editable crmf-visibility" data-type="select">' + val.visibility + "</td>";
|
||||
if (showOrgInfo) {
|
||||
appendHTML += "<td>" + val.org_info + "</td>";
|
||||
}
|
||||
appendHTML += "<td>" + val.links + "</td>";
|
||||
appendHTML += "</tr>";
|
||||
});
|
||||
$( rowID ).after( appendHTML );
|
||||
$( '.parent_is_'+parent_id ).trigger('crmLoad');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})(CRM.$);
|
||||
</script>
|
||||
{/literal}
|
Loading…
Add table
Add a link
Reference in a new issue