[Vtigercrm-commits] [vtiger development] #4108: Bug when selecting an account in a popup window when Street Address has two lines in it

vtiger development vtiger-tickets at trac.vtiger.com
Mon Aug 6 02:49:19 EDT 2007


#4108: Bug when selecting an account in a popup window  when Street Address has
two lines in it
-------------------------+--------------------------------------------------
  Reporter:  jshope      |       Owner:  developer
      Type:  defect      |      Status:  new      
  Priority:  unassigned  |   Milestone:  5.0.4    
 Component:  vtigercrm   |     Version:  5.0.3    
Resolution:              |    Keywords:           
-------------------------+--------------------------------------------------
Comment (by jshope):

 Update 2: I found a fix for this in the forums!

 The vTiger team will have to validate the fix but it SEEMS TO WORK .

 [http://forums.vtiger.com/viewtopic.php?t=8740&highlight=br2nl]

 I think there are some typos in Argyle's code but the parts I used were
 these lines as well as placing the variables from these lines in the
 "onclick" line as shown by Argyle

 {{{
 $billstreet = $acct_focus->column_fields['bill_street'];
 $billstreet = str_replace("\n",'\\n',$billstreet);

 $shipstreet = $acct_focus->column_fields['ship_street'];
 $shipstreet = str_replace("\n",'\\n',$shipstreet);
 }}}
 As far as the rest goes I kept vtiger's code and it's use of "' '"
 (doublequote singlequote singlequote doublequote), instead of Argyle's '"
 "' (singlequote doublequote doublequote singlequote)way of doing it. Thus
 my billstreet and shipstreet variables that get changed in the "onclick"
 statement look like "'.$billstreet.'","'.$shipstreet.'" instead of Argyles
 '".$billstreet."','".$shipstreet"'

 I placed these changes in the ListViewUtils.php file starting at line 1645
 in the elseif that looks like this

 {{{
 elseif($popuptype == "specific_account_address")
         {
         require_once('modules/Accounts/Accounts.php');
         $acct_focus = new Accounts();
         $acct_focus->retrieve_entity_info($entity_id,"Accounts");

         $slashes_temp_val = popup_from_html($temp_val);
         $slashes_temp_val =
 htmlspecialchars($slashes_temp_val,ENT_QUOTES);

         /*** Jim Changes to allow multi line addresses when selected in
 popups ***/
         /*** http://forums.vtiger.com/viewtopic.php?t=8740&highlight=br2nl
 ***/

         $billstreet = $acct_focus->column_fields['bill_street'];
         $billstreet = str_replace("\n",'\\n',$billstreet);

         $shipstreet = $acct_focus->column_fields['ship_street'];
         $shipstreet = str_replace("\n",'\\n',$shipstreet);

         $value = '<a href="javascript:window.close();"
 onclick=\'set_return_address("'.$entity_id.'",
 "'.nl2br($slashes_temp_val).'", "'.$billstreet.'", "'.$shipstreet.'",
 "'.br2nl($acct_focus->column_fields['bill_city']).'",
 "'.br2nl($acct_focus->column_fields['ship_city']).'",
 "'.br2nl($acct_focus->column_fields['bill_state']).'",
 "'.br2nl($acct_focus->column_fields['ship_state']).'",
 "'.br2nl($acct_focus->column_fields['bill_code']).'",
 "'.br2nl($acct_focus->column_fields['ship_code']).'",
 "'.br2nl($acct_focus->column_fields['bill_country']).'",
 "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'",
 "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.'</a>';

           /*** End Jim Changes ***/
         }
 }}}

 I'm not sure if the two other elseif statements that are right after this
 one require this fix as well, since they use the same code for the billing
 and shipping addresses.

 This one at line ~1660
 elseif($popuptype == "specific_contact_account_address")

 And this one at line ~1672


 Vtiger team, please advise on the suitability of this fix.

 Thank you,

 ~jim (Central PA)

-- 
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/4108#comment:2>
vtiger development <http://trac.vtiger.com/>
vtigerCRM




More information about the vtigercrm-commits mailing list