Skip to content

Commit

Permalink
Merge pull request #12777 from jitendrapurohit/core-346-rc
Browse files Browse the repository at this point in the history
dev/core#346 - 5.5 submission for 12745
  • Loading branch information
totten authored Sep 5, 2018
2 parents ed2c8b0 + 0b8ecd5 commit b9ff6e6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
4 changes: 3 additions & 1 deletion CRM/Contact/Page/View/UserDashBoard.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public function __construct() {
$userChecksum = CRM_Utils_Request::retrieve('cs', 'String', $this);
$validUser = FALSE;
if (empty($userID) && $this->_contactId && $userChecksum) {
$this->assign('userChecksum', $userChecksum);
$validUser = CRM_Contact_BAO_Contact_Utils::validChecksum($this->_contactId, $userChecksum);
$this->_isChecksumUser = $validUser;
}

if (!$this->_contactId) {
Expand Down Expand Up @@ -168,7 +170,7 @@ public function buildUserDashBoard() {
$this->assign('pcpInfo', $pcpInfo);
}

if (!empty($this->_userOptions['Assigned Activities'])) {
if (!empty($this->_userOptions['Assigned Activities']) && empty($this->_isChecksumUser)) {
// Assigned Activities section
$dashboardElements[] = array(
'class' => 'crm-dashboard-assignedActivities',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $userChecksum}
{assign var=edit value='0'}
{/if}
{crmRegion name="crm-contact-userdashboard-groupcontact-pre"}
{/crmRegion}
<div id="groupContact">
Expand Down
7 changes: 4 additions & 3 deletions templates/CRM/Contribute/Page/PcpUserDashboard.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<th>{ts}In Support of{/ts}</th>
<th>{ts}Campaign Ends{/ts}</th>
<th>{ts}Status{/ts}</th>
<th></th>
{if !$userChecksum} <th></th> {/if}
</tr>

{foreach from=$pcpInfo item=row}
Expand All @@ -46,7 +46,9 @@
<td>{$row.pageTitle}</td>
<td>{if $row.end_date}{$row.end_date|truncate:10:''|crmDate}{else}({ts}ongoing{/ts}){/if}</td>
<td>{$row.pcpStatus}</td>
<td>{$row.action|replace:'xx':$row.pcpId}</td>
{if !$userChecksum}
<td>{$row.action|replace:'xx':$row.pcpId}</td>
{/if}
</tr>
{/foreach}
</table>
Expand All @@ -59,7 +61,6 @@
</div>
{/if}


{if $pcpBlock}
{strip}
{if $pcpInfo} {* Change layout and text if they already have a PCP. *}
Expand Down
6 changes: 5 additions & 1 deletion templates/CRM/Contribute/Page/UserDashboard.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@
{/if}
{if $defaultInvoicePage && $row.contribution_status_name == 'Pending' }
<td>
{assign var='checksum_url' value=""}
{if $userChecksum}
{assign var='checksum_url' value="&cid=$contactId&cs=$userChecksum"}
{/if}
{assign var='id' value=$row.contribution_id}
{capture assign=payNowLink}{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$defaultInvoicePage`&ccid=`$id`"}{/capture}
{capture assign=payNowLink}{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$defaultInvoicePage`&ccid=`$id`$checksum_url"}{/capture}
<a class="button" href="{$payNowLink}"><span class='nowrap'>{ts}Pay Now{/ts}</span></a>
</td>
{/if}
Expand Down
14 changes: 8 additions & 6 deletions templates/CRM/Pledge/Page/UserDashboard.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@
<td class="crm-pledge-pledge_next_pay_date">{$row.pledge_next_pay_date|truncate:10:''|crmDate}</td>
<td class="crm-pledge-pledge_next_pay_amount">{$row.pledge_next_pay_amount|crmMoney:$row.pledge_currency}</td>
<td class="crm-pledge-pledge_status crm-pledge-pledge_status_{$row.pledge_status}">{$row.pledge_status}</td>
<td>
{if $row.pledge_contribution_page_id and ($row.pledge_status_name neq 'Completed') and ( $row.contact_id eq $loggedUserID ) }
<a href="{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$row.pledge_contribution_page_id`&pledgeId=`$row.pledge_id`"}">{ts}Make Payment{/ts}</a><br/>
{/if}
<a class="crm-expand-row" title="{ts}view payments{/ts}" href="{crmURL p='civicrm/pledge/payment' q="action=browse&context=`$context`&pledgeId=`$row.pledge_id`&cid=`$row.contact_id`"}">{ts}Payments{/ts}</a>
</td>
{if !$userChecksum}
<td>
{if $row.pledge_contribution_page_id and ($row.pledge_status_name neq 'Completed') and ( $row.contact_id eq $loggedUserID ) }
<a href="{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$row.pledge_contribution_page_id`&pledgeId=`$row.pledge_id`"}">{ts}Make Payment{/ts}</a><br/>
{/if}
<a class="crm-expand-row" title="{ts}view payments{/ts}" href="{crmURL p='civicrm/pledge/payment' q="action=browse&context=`$context`&pledgeId=`$row.pledge_id`&cid=`$row.contact_id`"}">{ts}Payments{/ts}</a>
</td>
{/if}
</tr>
{/foreach}
</table>
Expand Down

0 comments on commit b9ff6e6

Please sign in to comment.