r61589 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61588‎ | r61589 | r61590 >
Date:19:04, 27 January 2010
Author:diana
Status:deferred
Tags:
Comment:
changes to ContributionView page, public link
Modified paths:
  • /civicrm/trunk/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution.php (modified) (history)
  • /civicrm/trunk/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php (modified) (history)
  • /civicrm/trunk/sites/all/modules/civicrm/CRM/Dedupe/Finder.php (modified) (history)
  • /civicrm/trunk/sites/all/modules/civicrm_fix_notes/civicrm_fix_notes.module (modified) (history)
  • /civicrm/trunk/sites/all/themes/civicrm_custom/CRM/Contribute/Form/ContributionView.tpl (added) (history)

Diff [purge]

Index: civicrm/trunk/sites/all/themes/civicrm_custom/CRM/Contribute/Form/ContributionView.tpl
@@ -0,0 +1,152 @@
 2+<div class="form-item">
 3+<fieldset><legend>{ts}View Contribution{/ts}</legend>
 4+<dl>
 5+ <dt class="font-size12pt">{ts}From{/ts}</dt>
 6+ <dd class="font-size12pt"><strong>{$displayName}</strong>&nbsp;</dd>
 7+
 8+ <dt>{ts}Contribution Type{/ts}</dt>
 9+ <dd>{$contribution_type}&nbsp; {if $is_test} {ts}(test){/ts} {/if}</dd>
 10+
 11+ <dt>{ts}Total Amount{/ts}</dt>
 12+ <dd class="bold">{$total_amount|crmMoney}&nbsp;
 13+{if $contribution_recur_id}
 14+ <strong>{ts}Recurring Contribution{/ts}</strong> <br/>
 15+ {ts}Installments{/ts}: {$recur_installments}, {ts}Interval{/ts}: {$recur_frequency_interval} {$recur_frequency_unit}(s)
 16+{/if}
 17+</dd>
 18+
 19+ {if $non_deductible_amount}
 20+ <dt>{ts}Non-deductible Amount{/ts}</dt>
 21+ <dd>{$non_deductible_amount|crmMoney}&nbsp;</dd>
 22+ {/if}
 23+
 24+ {if $fee_amount}
 25+ <dt>{ts}Fee Amount{/ts}</dt>
 26+ <dd>{$fee_amount|crmMoney}&nbsp;</dd>
 27+ {/if}
 28+
 29+ {if $net_amount}
 30+ <dt>{ts}Net Amount{/ts}</dt>
 31+ <dd>{$net_amount|crmMoney}&nbsp;</dd>
 32+ {/if}
 33+
 34+ <dt>{ts}Received{/ts}</dt>
 35+ <dd>{if $receive_date}{$receive_date|truncate:10:''|crmDate}{else}({ts}pending{/ts}){/if}&nbsp;</dd>
 36+
 37+ <dt>{ts}Contribution Status{/ts}</dt>
 38+ <dd {if $contribution_status_id eq 3} class="font-red bold"{/if}>{$contribution_status}
 39+ {if $contribution_status_id eq 2} {if $is_pay_later}: {ts}Pay Later{/ts} {else} : {ts}Incomplete Transaction{/ts} {/if}{/if}</dd>
 40+
 41+ {if $cancel_date}
 42+ <dt>{ts}Cancelled Date{/ts}</dt>
 43+ <dd>{$cancel_date|truncate:10:''|crmDate}</dd>
 44+
 45+ {if $cancel_reason}
 46+ <dt>{ts}Cancellation Reason{/ts}</dt>
 47+ <dd>{$cancel_reason}</dd>
 48+ {/if}
 49+ {/if}
 50+
 51+ <dt>{ts}Paid By{/ts}</dt>
 52+ <dd>{$payment_instrument}&nbsp;</dd>
 53+
 54+ {if $payment_instrument eq 'Check'}
 55+ <dt>{ts}Check Number{/ts}</dt>
 56+ <dd>{$check_number}&nbsp;</dd>
 57+ {/if}
 58+
 59+ <dt>{ts}Source{/ts}</dt>
 60+ <dd>{$source}&nbsp;</dd>
 61+
 62+ {if $receipt_date}
 63+ <dt>{ts}Receipt Sent{/ts}</dt>
 64+ <dd>{$receipt_date|truncate:10:''|crmDate}</dd>
 65+ {/if}
 66+
 67+ {foreach from=$note item="rec"}
 68+ {if $rec }
 69+ <dt>{ts}Note:{/ts}</dt> <dd>{$rec}</dd>
 70+ {/if}
 71+ {/foreach}
 72+
 73+ {if $trxn_id}
 74+ <dt>{ts}Transaction ID{/ts}</dt>
 75+ <dd>{$trxn_id}&nbsp;</dd>
 76+ {/if}
 77+
 78+ {if $invoice_id}
 79+ <dt>{ts}Invoice ID{/ts}</dt>
 80+ <dd>{$invoice_id}&nbsp;</dd>
 81+ {/if}
 82+
 83+ {if $honor_display}
 84+ <dt>{ts}{$honor_type}{/ts}</dt>
 85+ <dd>{$honor_display}&nbsp;</dd>
 86+ {/if}
 87+
 88+ {if $thankyou_date}
 89+ <dt>{ts}Thank-you Sent{/ts}</dt>
 90+ <dd>{$thankyou_date|truncate:10:''|crmDate}</dd>
 91+ {/if}
 92+
 93+</dl>
 94+
 95+{if $premium}
 96+<fieldset><legend>{ts}Premium Information{/ts}</legend>
 97+<dl>
 98+ <dt>{ts}Premium{/ts}</dt><dd>{$premium}&nbsp;</dd>
 99+ <dt>{ts}Option{/ts}</dt><dd>{$option}&nbsp;</dd>
 100+ <dt>{ts}Fulfilled{/ts}</dt><dd>{$fulfilled|truncate:10:''|crmDate}&nbsp;</dd>
 101+</dl>
 102+</fieldset>
 103+{/if}
 104+
 105+{if $softCreditToName}
 106+<dl>
 107+ <dt>{ts}Soft Credit To{/ts}</dt>
 108+ <dd><a href="{crmURL p="civicrm/contact/view" q="reset=1&cid=`$soft_credit_to`"}" id="view_contact" title="{ts}View contact record{/ts}">{$softCreditToName}</a>&nbsp;</dd>
 109+</dl>
 110+{/if}
 111+
 112+{if $pcp_id}
 113+<fieldset><legend>{ts}Personal Campaign Page{/ts}</legend>
 114+<dl>
 115+ <dt>{ts}Campaign Page{/ts}</dt>
 116+ <dd><a href="{crmURL p="civicrm/contribute/pcp/info" q="reset=1&id=`$pcp_id`"}">{$pcp}</a><br />
 117+ <span class="description">{ts}Contribution was made through this personal campaign page.{/ts}</span>
 118+ </dd>
 119+ <dt>{ts}In Public Honor Roll?{/ts}</dt><dd>{if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}</dd>
 120+ {if $pcp_roll_nickname}
 121+ <dt>{ts}Honor Roll Name{/ts}</dt><dd>{$pcp_roll_nickname}</dd>
 122+ {/if}
 123+</dl>
 124+</fieldset>
 125+{/if}
 126+
 127+{include file="CRM/Custom/Page/CustomDataView.tpl"}
 128+
 129+{if $billing_address}
 130+<fieldset><legend>{ts}Billing Address{/ts}</legend>
 131+ <div class="form-item">
 132+ {$billing_address|nl2br}
 133+ </div>
 134+</fieldset>
 135+{/if}
 136+
 137+<fieldset><legend>{ts}Contribution Comments{/ts}</legend>
 138+<dl>
 139+<dt>{$form.donor_comment.label}</dt>
 140+<dd>{$form.donor_comment.html}</dd>
 141+</dl>
 142+<dl>
 143+<dt>{ts}Public Page{/ts}</dt>
 144+ <dd>{$form.comments_page.html}</dd>
 145+</dl>
 146+</fieldset>
 147+
 148+<dl>
 149+ <dt></dt>
 150+ <dd>{$form.buttons.html}</dd>
 151+</dl>
 152+</fieldset>
 153+</div>
Property changes on: civicrm/trunk/sites/all/themes/civicrm_custom/CRM/Contribute/Form/ContributionView.tpl
___________________________________________________________________
Name: svn:executable
1154 + *
Index: civicrm/trunk/sites/all/modules/civicrm_fix_notes/civicrm_fix_notes.module
@@ -7,9 +7,9 @@
88
99 // if form is contribution edit
1010 if( $form->getName() == 'Contribution' && $form->getAction() == '2') {
11 -
 11+
1212 //add element and assign it to the template (overridden elsewhere)
13 - $form->addElement('text', 'donor_note', "Comment Submitted", $attributes = 'size=50', $required = false, $javascript = null );
 13+ $form->addElement('textarea', 'donor_note', "Comment Submitted", array('cols'=>60, 'rows'=>5));
1414 $form->assign( 'donor_note' );
1515
1616 //contribution id
@@ -20,8 +20,42 @@
2121 $note = db_result(db_query("SELECT note FROM {civicrm_contribution} WHERE id = '%d'", $curr_id));
2222
2323 $form->setDefaults(array('donor_note' => $note));
 24+
 25+
2426
25 - }//end if
 27+ }//end if
 28+
 29+ if( $form->getName() == 'ContributionView') {
 30+
 31+ //get contribution id from URL (not passed in $form data ?!?!)
 32+ global $base_root;
 33+
 34+ $curr_url = parse_url($base_root . request_uri(), PHP_URL_QUERY);
 35+ $output = array();
 36+ parse_str($curr_url, $output);
 37+
 38+ //contribution id
 39+ $curr_id = $output['id'];
 40+
 41+ //display current note as default
 42+ $db = new civicrm_api_db();
 43+ $note = db_result(db_query("SELECT note FROM {civicrm_contribution} WHERE id = '%d'", $curr_id));
 44+
 45+ $form->addElement('static', 'donor_comment', "Donor Comment", $note);
 46+ $form->assign( 'donor_comment' );
 47+
 48+ //get receive date as timestamp for offset param in URL
 49+ $db = new civicrm_api_db();
 50+ $offset = db_result(db_query("SELECT UNIX_TIMESTAMP(receive_date) FROM {civicrm_contribution} WHERE id = '%d'", $output['id']));
 51+
 52+ //looks like this: 'http://wikimediafoundation.org/wiki/Special:ContributionHistory?offset=1262978021#506056'
 53+ $link = 'http://wikimediafoundation.org/wiki/Special:ContributionHistory?offset=' . $offset . '#' . $output['id'];
 54+
 55+ $form->addElement('link','comments_page','WM Comment Page:', $link, 'View on WM Public Page', 'target="_blank"');
 56+ $form->assign( 'comments_page' );
 57+
 58+ }
 59+
2660 }
2761
2862 /**
Index: civicrm/trunk/sites/all/modules/civicrm/CRM/Dedupe/Finder.php
@@ -67,7 +67,7 @@
6868 $dupes[] = array( $dao->id1, $dao->id2, $dao->weight );
6969 }
7070 $dao->query($rgBao->tableDropQuery());
71 -
 71+
7272 return $dupes;
7373 }
7474
@@ -136,6 +136,7 @@
137137 }
138138 $ctype = $dao->contact_type;
139139 }
 140+
140141 $rgBao =& new CRM_Dedupe_BAO_RuleGroup();
141142 $rgBao->level = $level;
142143 $rgBao->contact_type = $ctype;
@@ -143,8 +144,9 @@
144145 if (!$rgBao->find(true)) {
145146 CRM_Core_Error::fatal("$level rule for $ctype does not exist");
146147 }
 148+
147149 $dupes = self::dupes($rgBao->id, array($cid));
148 -
 150+
149151 // get the dupes for this cid
150152 $result = array( );
151153 foreach ( $dupes as $dupe ) {
Index: civicrm/trunk/sites/all/modules/civicrm/CRM/Contribute/Form/ContributionView.php
@@ -114,7 +114,7 @@
115115 $noteValue = CRM_Core_BAO_Note::getNote( $values['id'], 'civicrm_contribution' );
116116 $values['note'] = array_values($noteValue);
117117
118 - // show billing address location details, if exists
 118+ // show billing address location details, if existsXXX
119119 if ( CRM_Utils_Array::value( 'address_id', $values ) ) {
120120 $addressParams = array( 'id' => CRM_Utils_Array::value( 'address_id', $values ) );
121121 $addressDetails = CRM_Core_BAO_Address::getValues( $addressParams, false, 'id' );
@@ -122,7 +122,7 @@
123123 $values['billing_address'] = $addressDetails[0]['display'];
124124 }
125125
126 - //get soft credit record if exists.
 126+ //get soft credit record if existsXXX.
127127 if( $softContribution = CRM_Contribute_BAO_Contribution::getSoftContribution( $softParams ) ) {
128128 $softContribution['softCreditToName'] = CRM_Core_DAO::getFieldValue( 'CRM_Contact_DAO_Contact', $softContribution['soft_credit_to'], 'display_name' );
129129 //hack to avoid dispalyName conflict
Index: civicrm/trunk/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution.php
@@ -643,7 +643,7 @@
644644 'onClick' => "if (this.value != 3) status(); else return false",
645645 'onChange' => "return showHideByValue('contribution_status_id','3','cancelInfo','table-row','select',false);"));
646646 // add various dates
647 - $element =& $this->add('date', 'receive_date', ts('Received'), CRM_Core_SelectValues::date('activityDate'), false );
 647+ $element =& $this->add('date', 'receive_date', ts('Received'), CRM_Core_SelectValues::date('activityDatetime'), false );
648648 $this->addRule('receive_date', ts('Select a valid date.'), 'qfDate');
649649 if ( $this->_online ) {
650650 $this->assign("hideCalender" , true );
@@ -1026,9 +1026,9 @@
10271027
10281028 foreach ( $dates as $d ) {
10291029 if ( ! CRM_Utils_System::isNull( $formValues[$d] ) ) {
1030 - $formValues[$d]['H'] = '00';
1031 - $formValues[$d]['i'] = '00';
1032 - $formValues[$d]['s'] = '00';
 1030+ // $formValues[$d]['H'] = '00';
 1031+ // $formValues[$d]['i'] = '00';
 1032+ // $formValues[$d]['s'] = '00';
10331033 $params[$d] = CRM_Utils_Date::format( $formValues[$d] );
10341034 } else if ( array_key_exists( $d, $formValues ) ) {
10351035 $params[$d] = 'null';

Status & tagging log