Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  URL linking with join

phpMyEdit General     URL linking with join
Post new topic   Reply to topic    
 
bentuinstra     Joined: 12 Sep 2004   Posts: 29  
Post Posted: 2005-06-08 13:16
Back to top  Reply with quote     

Hi all,

I'm looking for a solution for a url linking in a joined field. When I use code below, I'll get the whole joined text as a value of $link. I only would like to send the id of the field which is an integer.

Any ideas,

Kind regards, Ben


Code:

$opts['fdd']['SUPPORT']['values']['table']   =  'leverancier';
$opts['fdd']['SUPPORT']['values']['column']  =  'ID';
$opts['fdd']['SUPPORT']['values']['description']['columns'][0]  =  'ID';
$opts['fdd']['SUPPORT']['values']['description']['divs'][0]  =  ' & - ';
$opts['fdd']['SUPPORT']['values']['description']['columns'][1]  =  'NAAM';
$opts['fdd']['SUPPORT']['values']['description']['divs'][1]  =  ' - ';
$opts['fdd']['SUPPORT']['values']['description']['columns'][2]  =  'FUNCTIE';
$opts['fdd']['SUPPORT']['values']['description']['divs'][2]  =  ' - ';
$opts['fdd']['SUPPORT']['values']['description']['columns'][3]  =  'VERKORT';
$opts['fdd']['SUPPORT']['values']['description']['divs'][3]  =  ' - ';
$opts['fdd']['SUPPORT']['values']['description']['columns'][4]  =  'TELEFOON';
$opts['fdd']['SUPPORT']['name'] = 'SUPPORT';
$opts['fdd']['SUPPORT']['options'] = 'ADCVL';
$opts['fdd']['SUPPORT']['URL'] = 'http://intranet.gsf.kappapackaging.com/apps/kappagsf/leverancier.php?PME_sys_fl=0&PME_sys_fm=0&PME_sys_sfn[0]=3&PME_sys_operation=PME_op_View&PME_sys_rec=$link';
$opts['fdd']['SUPPORT']['URLtarget'] = '_blank'; $opts['fdd']['SUPPORT']['select'] = 'D';

$opts['fdd']['SUPPORT']['sort'] = 'true';
$opts['fdd']['SUPPORT']['values2'] = '  Selecteer Service Provider ...';
$opts['fdd']['SUPPORT']['values']['filters']='SWSUPPORT = "YES"';

[/code]

 
phredbroughton     Joined: 07 Mar 2004   Posts: 17  
Post Posted: 2005-07-28 19:42
Back to top  Reply with quote     

I fought with this one for a while too!
Not sure if it's the best way, but I found that I could create an additional "virtual" field to display the link. Similar to your example I had a table with an integer id field that I joined to another table using the ['values'] option. I never could find a way to get the integer id for the URL link. In list mode I chose to display the joined data as one column then created the next column to read "EDIT" or whatever. Using the ['sql'] command to create in essence a duplicate copy of the id field without the ['values'] join, the $value variable had the correct integer id needed for the link.
Example:
Code:

$opts['fdd']['uid'] = array(
  'name'     => 'Assigned User',
  'select'   => 'T',
  'maxlen'   => 20,
  'default'  => '0',
  'sort'     => true,
  'values'   => array(
      'table' => 'users',
      'column' => 'uid',
      'description'=> array(
             'columns' => array(
                   '0' => 'lname',
                   '1' => 'fname',
                   '2' => 'mname',
                   '3' => 'auth_name'
                    ),
             'divs'    => array(
                   '0' => ', ',
                   '1' => ' ',
                   '2' => '  --  '
                    ),
             ),
      'orderby'=>'lname'
      )
);
$opts['fdd']['edit_link'] = array(
   'name'     => 'Edit User Information',
     'select'   => 'T',
     'options'  => 'L',
     'maxlen'   => 20,
     'default'  => '0',
     'sort'     => false,
      'sql'       => 'PMEtable0.uid', // This was in a tabbed/subform environment. You might just use 'uid'
      'URL'   => 'users.php?User_fl=0&User_fm=0&User_sfn[0]=0&&oper=list&User_operation=PME_op_Change&User_rec=$value',
      'URLdisp' => 'Edit User'
);

There may be better ways, but this worked for me.

 
bentuinstra     Joined: 12 Sep 2004   Posts: 29  
Post Posted: 2005-08-04 08:48
Back to top  Reply with quote     

Thank you Phredbroughton,

I will try your version. It looks promissing.

Kind regards,

Ben


phredbroughton wrote:
I fought with this one for a while too!
Not sure if it's the best way, but I found that I could create an additional "virtual" field to display the link. Similar to your example I had a table with an integer id field that I joined to another table using the ['values'] option. I never could find a way to get the integer id for the URL link. In list mode I chose to display the joined data as one column then created the next column to read "EDIT" or whatever. Using the ['sql'] command to create in essence a duplicate copy of the id field without the ['values'] join, the $value variable had the correct integer id needed for the link.
Example:
Code:

$opts['fdd']['uid'] = array(
  'name'     => 'Assigned User',
  'select'   => 'T',
  'maxlen'   => 20,
  'default'  => '0',
  'sort'     => true,
  'values'   => array(
      'table' => 'users',
      'column' => 'uid',
      'description'=> array(
             'columns' => array(
                   '0' => 'lname',
                   '1' => 'fname',
                   '2' => 'mname',
                   '3' => 'auth_name'
                    ),
             'divs'    => array(
                   '0' => ', ',
                   '1' => ' ',
                   '2' => '  --  '
                    ),
             ),
      'orderby'=>'lname'
      )
);
$opts['fdd']['edit_link'] = array(
   'name'     => 'Edit User Information',
     'select'   => 'T',
     'options'  => 'L',
     'maxlen'   => 20,
     'default'  => '0',
     'sort'     => false,
      'sql'       => 'PMEtable0.uid', // This was in a tabbed/subform environment. You might just use 'uid'
      'URL'   => 'users.php?User_fl=0&User_fm=0&User_sfn[0]=0&&oper=list&User_operation=PME_op_Change&User_rec=$value',
      'URLdisp' => 'Edit User'
);

There may be better ways, but this worked for me.


 
phredbroughton     Joined: 07 Mar 2004   Posts: 17  
Post Posted: 2005-08-04 20:05
Back to top  Reply with quote     

Be careful not to fall into the same trap I did by copying the entire url from the browser address window and inserting it as the URL value. It will contain sort variables that will override the default sort order of your list display on return from save or cancel.
In my example I showed
"somefile.php?User_fl=0&User_fm=0&User_sfn[0]=0&&oper=list&User_operation=PME_op_Change&User_rec=$value'"
when all you really need is
"somefile.php?User_operation=PME_op_Change&User_rec=$value'

Obviously the variable prefixes will vary for different configs. User_operation, User_rec etc could be anything_operation etc........
Just thought this might save someone else some time trying to figure out why the default sort order is getting lost :-)

 
perepapple     Joined: 19 Aug 2005   Posts: 1  
Post Posted: 2005-08-19 01:34
Back to top  Reply with quote     

Hi this is kinda related, I am just using guesswork to put an URL around a field on one page like this:

cust.php?fm=0&fl=1&qf1=1

at the moment, it's opening a page showing all the results where field 1 is "like" 1. Can I change one of those bits so that it goes to a page showing results where field 1 = 1, instead of "like"?

 
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