Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Origional ID as value for links

phpMyEdit Features     Origional ID as value for links
Post new topic   Reply to topic    
 
maarten     Joined: 05 Jan 2004   Posts: 1  
Post Posted: 2004-01-05 23:03
Back to top  Reply with quote     

Hi,

I was working on a project yesterday where I wanted to link a field with a hyperlink to another table.

Unfortunatly this wasn't working as expected because the $value using being used referred to the value in the table, not to the actual table content.

I patched the following code in function cellDisplay to allow this:

Code:

if ($this->col_has_URL($k))
{
  $orig = $row['qf'.$k.'_idx'];
  return $this->urlDisplay($k, $value, $css, $key_rec, $orig);
}


This simple change can be used like this in a table:

Code:

$opts['fdd']['CompanyId'] = array(
  'name'     => 'Company',
  'select'   => 'T',
  'maxlen'   => 20,
  'URL'      => 'company.php?fl=0&fm=0&sfn[0]=0&sfn[1]=1&operation=Details&rec=$orig',
  'default'  => '0',
  'required' => true,
  'sort'     => true,
  'values'   => array(
      'table'       => 'Company',
      'column'      => 'Id',
      'description' => 'CompanyName')
);



This might be usefull to add to the original code. If you need any further comments on this, please ask me.

 
michal     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2004-02-15 21:44
Back to top  Reply with quote     

i was coping with a similar problem. see bug report on output_control.

$rough_row array might interest you ....

 
vang     Joined: 20 Feb 2004   Posts: 5  
Post Posted: 2004-02-20 21:46
Back to top  Reply with quote     

i wasn't able to understand/use rough_row, but following maarten's ideea, the patch for the newly released phpMyEdit-5.4 is something like:


1168c1168
< function urlDisplay($k, $link_val, $disp_val, $css, $key) /* {{{ */
---
> function urlDisplay($k, $link_val, $disp_val, $css, $key, $orig) /* {{{ */
1183c1183,1184
< 'url' => $url
---
> 'url' => $url,
> 'orig' => $orig
1267c1268,1273
< return $this->urlDisplay($k, $original_value, $value, $css,
$key_rec);
---
>
> //vang
> // patch from http://opensource.platon.sk/forum/projects/viewtopic.php?t=243
> //
> $orig = $row['qf'.$k.'_idx'];
> return $this->urlDisplay($k, $original_value, $value, $css, $key_rec, $orig);

(disclaimer: i'm newbie in php, but it works for me)

 
ajh     Joined: 17 Dec 2003   Posts: 236  
Post Posted: 2004-02-22 19:40
Back to top  Reply with quote     

5.4 has this feature as standard. $link now contains the raw data before any of the PME transformations - so you can use that in URL

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy