Skip to content

Commit

Permalink
+ Fixed Pledge Analytics to display business names (Fixes #1335).
Browse files Browse the repository at this point in the history
  • Loading branch information
azturner committed Jan 9, 2016
1 parent fc0676b commit 19f9a8a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
4 changes: 1 addition & 3 deletions RockWeb/Blocks/Finance/BusinessDetail.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@
<Content>
<asp:HiddenField ID="hfModalOpen" runat="server" />
<asp:ValidationSummary ID="valSummaryAddContact" runat="server" HeaderText="Please Correct the Following" CssClass="alert alert-danger" ValidationGroup="AddContact"/>
<div class="row col-md-12">
<Rock:PersonPicker ID="ppContact" runat="server" Label="Contact" Required="true" ValidationGroup="AddContact" />
</div>
<Rock:PersonPicker ID="ppContact" runat="server" Label="Contact" Required="true" ValidationGroup="AddContact" />
</Content>
</Rock:ModalDialog>
</asp:Panel>
Expand Down
6 changes: 5 additions & 1 deletion RockWeb/Blocks/Finance/PledgeAnalytics.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
ExportSource="ColumnOutput" ExportFilename="PledgeAnalytics">
<Columns>
<Rock:SelectField />
<Rock:RockBoundField DataField="PersonName" HeaderText="Person" SortExpression="LastName,NickName" />
<Rock:RockTemplateField HeaderText="Person" SortExpression="LastName,NickName">
<ItemTemplate>
<%# FormatName( Eval("LastName"), Eval("NickName") ) %>
</ItemTemplate>
</Rock:RockTemplateField>
<Rock:RockBoundField DataField="Email" HeaderText="Email" SortExpression="Email" Visible="false" ExcelExportBehavior="AlwaysInclude" />
<Rock:CurrencyField DataField="PledgeAmount" HeaderText="Pledge Total" SortExpression="PledgeAmount" />
<Rock:CurrencyField DataField="GiftAmount" HeaderText="Total Giving Amount" SortExpression="GiftAmount" />
Expand Down
28 changes: 28 additions & 0 deletions RockWeb/Blocks/Finance/PledgeAnalytics.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,34 @@ private void LoadSettingsFromUserPreferences()
}
}

/// <summary>
/// Formats the name.
/// </summary>
/// <param name="lastname">The lastname.</param>
/// <param name="nickname">The nickname.</param>
/// <returns></returns>
protected string FormatName( object lastname, object nickname )
{
string result = string.Empty;

if ( nickname != null )
{
result = nickname.ToString();
}

if ( lastname != null )
{
if ( !string.IsNullOrWhiteSpace( result ) )
{
result += " ";
}

result += lastname;
}

return result;
}

#endregion


Expand Down

0 comments on commit 19f9a8a

Please sign in to comment.