Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  checkboxes for values from another table

phpMyEdit General     checkboxes for values from another table
Odoslať novú tému   Odpovedať na tému    
 
dutchak     Založený: 12.11.2011   Príspevky: 1  
Príspevok Zaslal: 2011-11-12 09:32
Návrat hore  Odpovedať s citátom     

Hi all,
Maybe I'm missing something, but I have tried all founded solutions on this forum an no results unfortunatelly.
The task is seems to be simple:
Kód:

$opts['fdd']['price_id'] = array(
'name'     => 'Fixed price:',
'select'   => 'C');
$opts['fdd']['price_id']['values']['table'] = 'services';
$opts['fdd']['price_id']['values']['column'] = 'service_id';
$opts['fdd']['price_id']['values']['description'] = 'service_name';
$opts['fdd']['price_id']['values']['filters'] = 'service_group_id in (7)';

There should be checkboxes, but system forceing me to use Dropdown list only.
I'll appreciate any help on this.

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2011-11-12 17:42
Návrat hore  Odpovedať s citátom     

Set 'select' to M for multiple-select. Checkboxes are not an option.

 
trister     Založený: 01.12.2010   Príspevky: 15  
Príspevok Zaslal: 2011-11-17 10:03
Návrat hore  Odpovedať s citátom     

A solution I did for the checkbox problem was this :

main file :
Kód:
$opts['fdd']['assign_to_notify_only'] = array(
  'name'     => 'assign to name',
  'select'   => 'T',
  'select|CA'   => 'C', // Multiple Selection only under EDIT (C) and Add (A) 
  'sort'     => true
);
//The Following line includes some PHP code that creates a [values2] entry.
include "trister/query_values2_multiselect.php";

Included file :
query_values2_multiselect.php

Kód:
<?php
//To DO use better mysql connect
$db_link = mysql_connect($opts['hn'],$opts['un'],$opts['pw']);
mysql_select_db($opts['db'],$db_link);
/* SET NAMES 'utf-8' COLLATE 'collation_name' */
@mysql_query("SET NAMES 'utf8'",$db_link);   

$array_names='';
$query='SELECT name FROM assign_names';
  $name_templist = '';
  $res = mysql_query($query,$db_link);
  while ($row = @mysql_fetch_array($res)) {
      $name_temp = $row['name'];
      $array_names[$name_temp]=$name_temp;
  }
  mysql_close($db_link);
 
$opts['fdd']['assign_to_notify_only']['values2']=$array_names;
  ?>


It is a workarround that works ok for me.
I hope this helps people.
Any suggestions /corrections are welcome.
Note: I am using this with the latest CVS version.

 
trister     Založený: 01.12.2010   Príspevky: 15  
Príspevok Zaslal: 2011-11-28 11:23
Návrat hore  Odpovedať s citátom     

Fix to checkbox Filtering problem.
The solution I posted had a problem during filtering.

My solution was to hack phpMyEdit.class.php and
replace this line :
Kód:
= array('oper'  => 'IN', 'value' => '('.join(',', $ids).')');

With this

Kód:
=array('oper' => 'LIKE', 'value' => "'$afilter'");


I haven't tried to see if this breaks anything else but It have solved the checkbox add/edit/filter search problem[/code]

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov