Index: CRM/Core/Config.php
===================================================================
--- CRM/Core/Config.php	(revision 783)
+++ CRM/Core/Config.php	(working copy)
@@ -264,10 +264,10 @@
             }
             if ($this->userFramework == 'Drupal' and function_exists('variable_get')) {
                 global $language;
-                $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE);
-                if (isset($language->prefix) and $language->prefix
-                    and ($mode == LANGUAGE_NEGOTIATION_PATH_DEFAULT or $mode == LANGUAGE_NEGOTIATION_PATH)) {
-                    $this->userFrameworkBaseURL .= $language->prefix . '/';
+                if (module_exists('locale') && $mode = variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE))
+                    if (isset($language->prefix) and $language->prefix
+                        and ($mode == LANGUAGE_NEGOTIATION_PATH_DEFAULT or $mode == LANGUAGE_NEGOTIATION_PATH)) {
+                        $this->userFrameworkBaseURL .= $language->prefix . '/';
                 }
             }
         }
Index: CRM/Contribute/BAO/Contribution.php
===================================================================
--- CRM/Contribute/BAO/Contribution.php	(revision 783)
+++ CRM/Contribute/BAO/Contribution.php	(working copy)
@@ -249,19 +249,33 @@
             CRM_Activity_BAO_Activity::addActivity( $contribution, 'Offline' );
         }
 
-
-        if ( CRM_Utils_Array::value( 'soft_credit_to', $params ) ) {
-
+        //add soft contribution due to pcp or Submit Credit / Debit Card Contribution by admin.
+        if ( CRM_Utils_Array::value( 'pcp_made_through_id', $params ) || CRM_Utils_Array::value( 'soft_credit_to', $params ) ) { 
             $csParams = array();
-            if ( $id = CRM_Utils_Array::value( 'softID', $params ) ) {
-                $csParams['id'] = $params['softID'];
+            
+            $csParams['pcp_display_in_roll'] = $params['pcp_display_in_roll']? 1 : 0;
+            
+            foreach ( array ( 'pcp_roll_nickname', 'pcp_personal_note' ) as $val ) {
+                if ( CRM_Utils_Array::value( $val, $params ) ) {
+                    $csParams[$val] = $params[$val];
+                }
             }
+            
             $csParams['contribution_id'] = $contribution->id;
-            $csParams['contact_id'] = $params['soft_credit_to'];
             // first stage: we register whole amount as credited to given person
-            $csParams['amount'] = $contribution->total_amount;
+            $csParams['amount']          = $contribution->total_amount;
 
-            self::addSoftContribution( $csParams );
+            //if its due to pcp
+            if ( CRM_Utils_Array::value( 'pcp_made_through_id', $params ) ) {
+                $csParams['pcp_id']          = $params['pcp_made_through_id'];
+                $csParams['contact_id']      = CRM_Core_DAO::getFieldValue( 'CRM_Contribute_DAO_PCP', 
+                                                                                     $params['pcp_made_through_id'], 
+                                                                                     'contact_id' );
+            }
+            if ( $id = CRM_Utils_Array::value( 'softID', $params ) ) {
+                $csParams['id'] = $params['softID'];
+            }
+            CRM_Contribute_BAO_Contribution::addSoftContribution( $csParams );
         }
 
         $transaction->commit( );
@@ -992,10 +1006,11 @@
                 foreach ( array ('pcp_id','pcp_display_in_roll', 'pcp_roll_nickname', 'pcp_personal_note' ) as $key=>$val ) {
                     $softContribution[$val] = $cs->$val;
                 }
-                return $softContribution;
-            }else {
-                return array( 'soft_credit_to' => $cs->contact_id, 'soft_credit_id' => $cs->id );
             }
+            $softContribution['soft_credit_to'] = $cs->contact_id;
+            $softContribution['soft_credit_id'] = $cs->id;
+            
+            return $softContribution;
         }
         return null;
     }
@@ -1012,6 +1027,9 @@
         $query = "SELECT ccs.id, ccs.amount as amount,
                          ccs.contribution_id, 
                          ccs.pcp_id,
+                         ccs.pcp_display_in_roll,
+                         ccs.pcp_roll_nickname,
+                         ccs.pcp_personal_note,
                          cc.receive_date,
                          cc.contact_id as contributor_id,
                          cc.contribution_status_id as contribution_status_id,
@@ -1032,6 +1050,8 @@
                   WHERE cc.is_test = {$isTest} AND ccs.contact_id = " . $contact_id;
        
         $cs = CRM_Core_DAO::executeQuery( $query, CRM_Core_DAO::$_nullArray );
+
+        require_once 'CRM/Contribute/PseudoConstant.php';
         $contributionStatus = CRM_Contribute_Pseudoconstant::contributionStatus( );
         $result = array();
         while( $cs->fetch( ) ) {
@@ -1043,6 +1063,9 @@
             $result[$cs->id]['receive_date']      = $cs->receive_date;
             $result[$cs->id]['pcp_id']            = $cs->pcp_id;
             $result[$cs->id]['pcp_title']         = $cs->pcp_title;
+            $result[$cs->id]['pcp_display_in_roll'] = $cs->pcp_display_in_roll;
+            $result[$cs->id]['pcp_roll_nickname'] = $cs->pcp_roll_nickname;
+            $result[$cs->id]['pcp_personal_note'] = $cs->pcp_personal_note;
             $result[$cs->id]['contribution_status'] = CRM_Utils_Array::value($cs->contribution_status_id, $contributionStatus );
 
             if ( $isTest ) {
Index: CRM/Contribute/BAO/PCP.php
===================================================================
--- CRM/Contribute/BAO/PCP.php	(revision 783)
+++ CRM/Contribute/BAO/PCP.php	(working copy)
@@ -249,7 +249,7 @@
     static function honorRoll( $pcpId )
     {
         $query = "
-            SELECT cc.id, cs.pcp_roll_nickname, 
+            SELECT cc.id, cs.pcp_roll_nickname, cs.pcp_personal_note,
                    cc.total_amount, cc.currency
             FROM civicrm_contribution cc 
                  LEFT JOIN civicrm_contribution_soft cs ON cc.id = cs.contribution_id
Index: CRM/Contribute/Form/Contribution/Main.php
===================================================================
--- CRM/Contribute/Form/Contribution/Main.php	(revision 783)
+++ CRM/Contribute/Form/Contribution/Main.php	(working copy)
@@ -375,17 +375,17 @@
             }
             $this->assign( 'pcp', true );
             $this->add( 'checkbox', 'pcp_display_in_roll', ts('Show my contribution in the public honor roll'), null, null,
-                        array('onclick' => "showHideByValue('pcp_display_in_roll','','nameID|nickID','table-row','radio',false); pcpAnonymous( );")
+                        array('onclick' => "showHideByValue('pcp_display_in_roll','','nameID|nickID|personalNoteID','table-row','radio',false); pcpAnonymous( );")
                         );
             $extraOption = array('onclick' =>"return pcpAnonymous( );");
             $elements = array( );
-            $elements[] =& $this->createElement('radio', null, '', ts( 'Include my name'), 0, $extraOption );
+            $elements[] =& $this->createElement('radio', null, '', ts( 'Include my name and message'), 0, $extraOption );
             $elements[] =& $this->createElement('radio', null, '', ts( 'List my contribution anonymously'), 1, $extraOption );
             $this->addGroup( $elements, 'pcp_is_anonymous', null, '&nbsp;&nbsp;&nbsp;' );
             $this->_defaults['pcp_is_anonymous'] = 0;
             
             $this->add( 'text', 'pcp_roll_nickname', ts('Name'), array( 'size' => 25, 'maxlength' => 20 ) );
-            // $this->add( 'textarea', "pcp_personal_note", ts( 'Personal Note' ), array( 'rows' => 4, 'coloums' => 80 ) );
+            $this->add( 'textarea', "pcp_personal_note", ts( 'Personal Note' ), array( 'rows' => 4, 'coloums' => 80 ) );
         }
         
         if ( !( $this->_paymentProcessor['billing_mode'] == CRM_Core_Payment::BILLING_MODE_BUTTON &&
Index: CRM/Contribute/Form/Contribution.php
===================================================================
--- CRM/Contribute/Form/Contribution.php	(revision 783)
+++ CRM/Contribute/Form/Contribution.php	(working copy)
@@ -333,15 +333,19 @@
             $this->_contributionType = $this->_values['contribution_type_id'];
             
             $csParams = array( 'contribution_id' => $this->_id );
-            $softCredit = CRM_Contribute_BAO_Contribution::getSoftContribution( $csParams );
+            $softCredit = CRM_Contribute_BAO_Contribution::getSoftContribution( $csParams, TRUE );
            
             if ( $softCredit ) {
                 require_once 'CRM/Core/DAO.php';
                 $softCredit['sort_name']           = CRM_Core_DAO::getFieldValue( 'CRM_Contact_DAO_Contact', 
                                                                                   $softCredit['soft_credit_to'], 'sort_name' );
-                $this->_values['soft_credit_to'  ] = $softCredit['sort_name'     ];
-                $this->_values['softID'          ] = $softCredit['soft_credit_id'];
-                $this->_values['soft_contact_id' ] = $softCredit['soft_credit_to'];
+                $this->_values['soft_credit_to']        = $softCredit['sort_name'];
+                $this->_values['softID'          ]      = $softCredit['soft_credit_id'];
+                $this->_values['soft_contact_id' ]      = $softCredit['soft_credit_to'];
+                $this->_values['pcp_made_through_id']   = $softCredit['pcp_id'];
+                $this->_values['pcp_display_in_roll' ]  = $softCredit['pcp_display_in_roll'];
+                $this->_values['pcp_roll_nickname' ]    = $softCredit['pcp_roll_nickname'];
+                $this->_values['pcp_personal_note' ]    = $softCredit['pcp_personal_note'];
             }
 
             //display check number field only if its having value or its offline mode.
@@ -454,6 +458,18 @@
             $defaults["honor_type"]       = $honorType[$defaults["honor_type_id"]];
         }
         
+        if (isset($this->pcp_display_in_roll)) {
+            $defaults['pcp_display_in_roll'] = $this->pcp_display_in_roll;
+        }
+        
+        if (isset($this->pcp_roll_nickname)) {
+            $defaults['pcp_roll_nickname'] = $this->pcp_roll_nickname;
+        }
+        
+        if (isset($this->pcp_personal_note)) {
+            $defaults['pcp_personal_note'] = $this->pcp_personal_note;
+        }
+
         $this->assign('showOption',true);
         // for Premium section
         if( $this->_premiumID ) {
@@ -714,6 +730,16 @@
         $this->assign('dataUrl',$dataUrl );                                          
         $this->addElement( 'text', 'soft_credit_to', ts('Soft Credit To') );
         $this->addElement( 'hidden', 'soft_contact_id', '', array( 'id' => 'soft_contact_id' ) );
+        
+        $this->addElement('select', 'pcp_made_through_id', 
+                   ts( 'Personal Campaign Page' ),
+                   array( '' => ts( '- select -' ) ) +
+                   CRM_Contribute_PseudoConstant::pcPage( ) );
+                   
+        $this->addElement('checkbox','pcp_display_in_roll', ts('Honor Roll?'), null, array('onclick' =>"return showHideByValue('pcp_display_in_roll','','softCreditInfo','table-row','radio',false);") );
+        $this->addElement('text', 'pcp_roll_nickname', ts('Nickname') );
+        $this->addElement('textarea', 'pcp_personal_note', ts('Personal Note'));
+
         $js = null;
         if ( !$this->_mode ) {
             $js = array( 'onclick' => "return verify( );" );    
@@ -897,6 +923,15 @@
             if ( CRM_Utils_Array::value('soft_credit_to', $params) ) {
                 $this->_params['soft_credit_to'] =  $params['soft_credit_to'];
             } 
+
+            if ( CRM_Utils_Array::value('soft_credit_to', $params) ) {
+                $this->_params['pcp_made_through_id'] = $params['pcp_made_through_id'];
+            }
+
+            $this->_params['pcp_display_in_roll'] =  $params['pcp_display_in_roll'];
+            $this->_params['pcp_roll_nickname'] =  $params['pcp_roll_nickname'];
+            $this->_params['pcp_personal_note'] =  $params['pcp_personal_note'];
+
             //Add common data to formatted params
             CRM_Contribute_Form_AdditionalInfo::postProcessCommon( $params, $this->_params );
             
@@ -1072,16 +1107,21 @@
                              'cancel_reason',
                              'source',
                              'check_number',
-                             'soft_credit_to'
+                             'soft_credit_to',
+                             'pcp_made_through_id',
+                             'pcp_display_in_roll',
+                             'pcp_roll_nickname',
+                             'pcp_personal_note',
                              );
             
             foreach ( $fields as $f ) {
                 $params[$f] = CRM_Utils_Array::value( $f, $formValues );
             }
-           
+
             if ( $softID = CRM_Utils_Array::value( 'softID', $this->_values ) ){
                 $params['softID'] = $softID;
             }
+
             $dates = array( 'receive_date',
                             'receipt_date',
                             'cancel_date' );
Index: templates/CRM/Contribute/Form/Contribution/ThankYou.tpl
===================================================================
--- templates/CRM/Contribute/Form/Contribution/ThankYou.tpl	(revision 783)
+++ templates/CRM/Contribute/Form/Contribution/ThankYou.tpl	(working copy)
@@ -152,7 +152,12 @@
                 {if $pcp_is_anonymous}
                     <strong>{ts}anonymously{/ts}.</strong>
                 {else}
-                    {ts}and my name{/ts}: <strong>{$pcp_roll_nickname}</strong>
+                    {ts}under the name{/ts}: <strong>{$pcp_roll_nickname}</strong><br/>
+                    {if $pcp_personal_note}
+                        {ts}With the personal note{/ts}: <strong>{$pcp_personal_note}</strong>
+                    {else}
+                     <strong>{ts}With no personal note{/ts}</strong>
+                     {/if}
                 {/if}
             {else}
 		{ts}Don't list my contribution in the honor roll.{/ts}
Index: templates/CRM/Contribute/Form/Contribution/Main.tpl
===================================================================
--- templates/CRM/Contribute/Form/Contribution/Main.tpl	(revision 783)
+++ templates/CRM/Contribute/Form/Contribution/Main.tpl	(working copy)
@@ -158,10 +158,12 @@
 		<span class="description">{ts}Enter the name you want listed with this contribution. You can use a nick name like 'The Jones Family' or 'Sarah and Sam'.{/ts}</span>
 	    </td>
 	</tr>
-	<!--tr>
-		<td style="vertical-align: top">{$form.pcp_personal_note.label}</td>
-		<td>{$form.pcp_personal_note.html}</td>
-	</tr-->
+	<tr id="personalNoteID">
+            <td style="vertical-align: top">{$form.pcp_personal_note.label}</td>
+            <td>{$form.pcp_personal_note.html}<br />
+                <span class="description">{ts}Enter a message to accompany this contribution.'.{/ts}</span>
+            </td>
+        </tr>
     </table>
     </fieldset>
     {/if} 
@@ -302,13 +304,16 @@
     if ( ! document.getElementsByName("pcp_display_in_roll")[0].checked ) { 
         hide('nickID', 'table-row');
         hide('nameID', 'table-row');
+        hide('personalNoteID', 'table-row');
     } else {
         if ( document.getElementsByName("pcp_is_anonymous")[0].checked ) {
             show('nameID', 'table-row');
             show('nickID', 'table-row');
+            show('personalNoteID', 'table-row');
         } else {
             show('nameID', 'table-row');
             hide('nickID', 'table-row');
+            hide('personalNoteID', 'table-row');
         }
     }
 }
Index: templates/CRM/Contribute/Form/Contribution/Confirm.tpl
===================================================================
--- templates/CRM/Contribute/Form/Contribution/Confirm.tpl	(revision 783)
+++ templates/CRM/Contribute/Form/Contribution/Confirm.tpl	(working copy)
@@ -94,7 +94,12 @@
                 {if $pcp_is_anonymous}
                     <strong>{ts}anonymously{/ts}.</strong>
                 {else}
-                    {ts}and my name{/ts}: <strong>{$pcp_roll_nickname}</strong>
+                    {ts}under the name{/ts}: <strong>{$pcp_roll_nickname}</strong><br/>
+                    {if $pcp_personal_note}
+                        {ts}With the personal note{/ts}: <strong>{$pcp_personal_note}</strong>
+                    {else}
+                     <strong>{ts}With no personal note{/ts}</strong>
+                     {/if}
                 {/if}
             {else}
                 {ts}Don't list my contribution in the honor roll.{/ts}
Index: templates/CRM/Contribute/Form/ContributionView.tpl
===================================================================
--- templates/CRM/Contribute/Form/ContributionView.tpl	(revision 783)
+++ templates/CRM/Contribute/Form/ContributionView.tpl	(working copy)
@@ -144,6 +144,9 @@
     {if $pcp_roll_nickname}
         <td>{ts}Honor Roll Name{/ts}</td><td>{$pcp_roll_nickname}</td>
     {/if}
+    {if $pcp_personal_note}
+        <dt>{ts}Honor Roll Note{/ts}</dt><dd>{$pcp_personal_note}</dd>
+    {/if}
 </table>
 </fieldset>
 {/if}
@@ -173,4 +176,4 @@
     </tr>    
 </table>
 
-</fieldset>
\ No newline at end of file
+</fieldset>
Index: templates/CRM/Contribute/Form/Contribution.tpl
===================================================================
--- templates/CRM/Contribute/Form/Contribution.tpl	(revision 783)
+++ templates/CRM/Contribute/Form/Contribution.tpl	(working copy)
@@ -122,6 +122,24 @@
         <tr><td class="label">{$form.soft_credit_to.label}</td>
             <td>{$form.soft_credit_to.html} {help id="id-soft_credit"}</td>
         </tr>
+        
+        
+<tr>
+        <tr><td class="label">{$form.pcp_made_through_id.label}</td><td>{$form.pcp_made_through_id.html}</td></tr>
+        <tr><td class="label">{$form.pcp_display_in_roll.label}</td><td>{$form.pcp_display_in_roll.html} <span class="description">{ts}Display nickname and personal message in Honor Roll?{/ts}</span></td></tr>
+        
+	    {* Soft credit fields are hidden unless display is set to true *}
+	    <tr id="softCreditInfo"> 
+	        <td>&nbsp;</td> 
+	        <td><fieldset><legend>{ts}Honor Roll Information{/ts}</legend>
+	        <table class="form-layout-compressed">
+	        <tr id="softCreditNicknameID"><td class="label" style="vertical-align: top;">{$form.pcp_roll_nickname.label}</td><td>{$form.pcp_roll_nickname.html|crmReplace:class:huge}</td></tr>
+            <tr id="softCreditPersonalNoteID"><td class="label" style="vertical-align: top;">{$form.pcp_personal_note.label}</td><td>{$form.pcp_personal_note.html}</td></tr>
+            </table>
+	       </fieldset>
+	       </td>
+	    </tr>
+	    
 
       </table>
 
@@ -274,6 +292,14 @@
     invert              = 0
 }
 {include file="CRM/common/showHideByFieldValue.tpl" 
+    trigger_field_id    ="pcp_display_in_roll"
+    trigger_value       =""
+    target_element_id   ="softCreditInfo" 
+    target_element_type ="table-row"
+    field_type          ="radio"
+    invert              = 0
+}
+{include file="CRM/common/showHideByFieldValue.tpl" 
     trigger_field_id    ="payment_instrument_id"
     trigger_value       = '4'
     target_element_id   ="checkNumber" 
Index: templates/CRM/Contribute/Page/PCPInfo.tpl
===================================================================
--- templates/CRM/Contribute/Page/PCPInfo.tpl	(revision 783)
+++ templates/CRM/Contribute/Page/PCPInfo.tpl	(working copy)
@@ -73,9 +73,13 @@
 	    <td style="width:120px"><strong>{ts}HONOR ROLL{/ts}</strong><br />
         <div class="honor_roll">
             <marquee behavior="scroll" direction="up" id="pcp_roll"	scrolldelay="200" bgcolor="#fafafa"> 
-              {foreach from = $honor item = v} 
-              {$v.nickname}<br />{$v.total_amount}
-              <br /><br /><br />
+              {foreach from = $honor item = v}
+              <div class="pcp_honor_roll_entry">
+                  <strong>{$v.nickname}</strong><br />{$v.total_amount|crmMoney}
+                  <br />
+                  {$v.personal_note}
+                  <br /><br />
+	      </div>
               {/foreach} 
             </marquee>
         </div>	

