sandeep
Založený: 01.07.2003
Príspevky: 6
Zaslal: 2003-07-08 14:22
Návrat hore
Odpovedať s citátom
|
Hi,
In the script below, I want DOW and LISTS to have multiple SELECT option.
Surprisingly, the def. of both the fields are absolutely same, but still only DOW shows MULTIPLE SELECT not LISTS.
Can someone pls see the code below and suggest.
Thx in advance...
sandeep
<?php
$opts['options'] = 'ACVDH';
$opts['multiple'] = '7';
$opts['navigation'] = 'DB';
$opts['display'] = array(
'query' => false,
'sort' => false,
'time' => true
);
$opts['fdd']['username'] = array(
'name' => 'Username',
'select' => 'T',
'maxlen' => 20,
'required' => true,
'sort' => true
);
$opts['fdd']['dow'] = array(
'name' => 'Days of week',
'select' => 'M',
'maxlen' => 5,
'sort' => true,
'required' => true
);
$opts['fdd']['lists'] = array(
'name' => 'Allow OR Deny lists',
'select' => 'M',
'maxlen' => 5,
'sort' => true,
'required' => true
);
$opts['fdd']['dow']['values2'] = array(
'm' => 'Mon',
't' => 'Tue',
'w' => 'Wed',
'h' => 'Thr',
'f' => 'Fri',
'a' => 'Sat',
's' => 'Sun'
);
$opts['fdd']['username']['values']['table'] = 'users';
$opts['fdd']['username']['values']['column'] = 'username';
$opts['fdd']['username']['values']['description'] = 'username';
$opts['fdd']['username']['values']['filters'] = 'access IN ("CTRL")';
$opts['fdd']['lists']['values']['table'] = 'lists';
$opts['fdd']['lists']['values']['column'] = 'list_name';
$opts['fdd']['lists']['values']['description']['columns'][0] = 'list_type';
$opts['fdd']['lists']['values']['description']['columns'][1] = 'list_name';
$opts['fdd']['lists']['values']['description']['divs'][0] = ' => ';
Naposledy upravil sandeep dňa 2003-07-15 14:48, celkom upravené 1 krát
|
nepto
Založený: 06.01.2003
Príspevky: 320
Bydlisko: Phoenix, Arizona (USA)
Zaslal: 2003-07-09 15:51
Návrat hore
Odpovedať s citátom
|
['values2']
is missing in
['lists']
|
sandeep
Založený: 01.07.2003
Príspevky: 6
Zaslal: 2003-07-15 14:15
Návrat hore
Odpovedať s citátom
|
I donot want to add additional values, using [values2].
Rather I want the values being called from another table to be "MULTIPLE SELECT" instead of "DROP DOWN".
Pls advise.
Sandeep
|
nepto
Založený: 06.01.2003
Príspevky: 320
Bydlisko: Phoenix, Arizona (USA)
Zaslal: 2003-07-15 16:52
Návrat hore
Odpovedať s citátom
|
I believe, that if
'select' => 'M'
is specified, filtering will contain MULTIPLE SELECT.
Or you want this on Add, Copy and Change pages?
|
sandeep
Založený: 01.07.2003
Príspevky: 6
Zaslal: 2003-07-15 17:43
Návrat hore
Odpovedať s citátom
|
I have defined
SELECT => 'M'
.
I want this in
Add/Change page
.
PLs advise.
Sandeep
|
mckenna
Založený: 25.01.2004
Príspevky: 4
Bydlisko: Philadelphia, PA
Zaslal: 2004-01-25 04:08
Návrat hore
Odpovedať s citátom
|
| sandeep Napísal: |
I have defined
SELECT => 'M'
.
I want this in
Add/Change page
.
PLs advise.
Sandeep |
I'm in a similar bind. Was there ever a resolution to this issue?
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-25 15:31
Návrat hore
Odpovedať s citátom
|
| mckenna Napísal: |
I'm in a similar bind. Was there ever a resolution to this issue? |
Current release (and CVS) of phpMyEdit doesn't handle multiple select comming from external table.
That's why there is in the class :
| Kód: |
function col_has_multiple_select($k)
{ return $this->fdd[$k]['select'] == 'M' && ! $this->fdd[$k]['values']['table']; } |
But basic things would be doable.
You have to hack the main class :
| Kód: |
//<hbernard - Line 2650 - add this lines to make 'M'ultiple work with ['values']['table']
if ($this->fdd[$key]['select'] == 'M' && isset($this->fdd[$key]['values']['table'])) {
$this->connect(); //connection to mysql, required for set_values_from....
$this->fdd[$key]['values2'] = (array)$this->fdd[$key]['values2']
+ (array)$this->set_values_from_table($key);
unset($this->fdd[$key]['values']); //useless values
}
//>hbernard |
This fill in 'values2' according to 'values' parameter, then unset 'values'.
Thus there is no join, only an external table for possible value.
This works for me.
Does it for you ?
|
mckenna
Založený: 25.01.2004
Príspevky: 4
Bydlisko: Philadelphia, PA
Zaslal: 2004-01-25 17:33
Návrat hore
Odpovedať s citátom
|
This doesn't work for me yet.
and I apologize for being a bit ignorant of what this code will do.
If I simply cut and paste this code into my main class, running my scripts generates:
Parse error: parse error in path/phpMyEdit.class.php on line 2637
I'm not sure what that means, as that line is:
$opts['execute'] && $this->execute();
What, if anything, should I customize in this code chunk?
-Chris
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-25 19:48
Návrat hore
Odpovedať s citátom
|
Hmm, You're not using the last up-to-date CVS version, aren't you ?
Maybe the 5.3 release.
Anyway, You have to find the
function recreate_displayed()
in the class.
Then, about 20 lines below,
| Kód: |
if ($this->displayed[$field_num] = $this->displayed($field_num)) {
$num_fields_displayed++;
} |
//INSERT CODE HERE
| Kód: |
if (is_array(@$this->fdd[$key]['values']) && ! isset($this->fdd[$key]['values']['table'])) {
foreach ($this->fdd[$key]['values'] as $val) {
$this->fdd[$key]['values2'][$val] = $val;
}
unset($this->fdd[$key]['values']);
} |
I'm interested to know if this is working for you.
Don't give up !
-Hugues
|
mckenna
Založený: 25.01.2004
Príspevky: 4
Bydlisko: Philadelphia, PA
Zaslal: 2004-01-25 20:29
Návrat hore
Odpovedať s citátom
|
| hbernard Napísal: |
Hmm, You're not using the last up-to-date CVS version, aren't you ?
Maybe the 5.3 release.
Anyway, You have to find the
function recreate_displayed()
in the class.
Then, about 20 lines below,
| Kód: |
if ($this->displayed[$field_num] = $this->displayed($field_num)) {
$num_fields_displayed++;
} |
//INSERT CODE HERE
| Kód: |
if (is_array(@$this->fdd[$key]['values']) && ! isset($this->fdd[$key]['values']['table'])) {
foreach ($this->fdd[$key]['values'] as $val) {
$this->fdd[$key]['values2'][$val] = $val;
}
unset($this->fdd[$key]['values']);
} |
I'm interested to know if this is working for you.
Don't give up !
-Hugues |
Hugues-
I'm using the 5.3 release(the class file I have is marked phpMyEdit.class.php,v 1.71). Do I need a later version of the class to make these changes work?
Should I take the code from your previous post and simply paste in between the two snippets you mention above?
if so, these changes result in:
parse error on line 2324 of the class file
and
Fatal error: Cannot instantiate non-existent class: on the script file associated with the line:
new phpMyEdit($opts);
thanks again.
-Chris
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-25 20:48
Návrat hore
Odpovedať s citátom
|
see the message I sent you privately.
(or mail me your class file at
hbernard (@_at_@) gynov.org
|
mckenna
Založený: 25.01.2004
Príspevky: 4
Bydlisko: Philadelphia, PA
Zaslal: 2004-01-25 22:39
Návrat hore
Odpovedať s citátom
|
| hbernard Napísal: |
see the message I sent you privately.
(or mail me your class file at
hbernard (@_at_@) gynov.org |
working now w the new class file. Thanks!
|
phirschybar
Založený: 18.09.2003
Príspevky: 43
Zaslal: 2004-10-15 03:33
Návrat hore
Odpovedať s citátom
|
Hugues,
Thanks for the hack. In my class file, the insertion is on line 2605 not 2650.
|
|
Odoslať novú tému
Odpovedať na tému
|