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  »  Make field read only based on data in field

phpMyEdit General     Make field read only based on data in field
Odoslať novú tému   Odpovedať na tému    
 
scava     Založený: 12.02.2010   Príspevky: 1  
Príspevok Zaslal: 2010-02-12 23:06
Návrat hore  Odpovedať s citátom     

Hi Everyone,

I have looked all over the forums for a solution to this but can not seem to find the answer, so here goes...

i want to make a field "read only" based on the data in that field, for example, here is me sample code from one of my fields:

$opts['fdd']['excavation']= array(
'name' => 'Excavation',
'select' => 'D',
'maxlen' => 1,
'values' => array('','Complete','Draw Taken'),
'sort' => true,

The first person would run the script and select "Complete" from the drop down box when the task is complete.

Then the second person would log on and see the "Complete" status and know they can perform their task, once the second person has perform their task, they would select "Draw Taken" from the drop down box and save and exit,

Now when the first person goes in again later to update the schedule i do not want them (the first person) to be able to change the "Draw Taken" status previously set by the second person.

I would like this field, when the values is 'Draw Taken' to be read only from then on as a way of locking it from being changed back to complete.

I have tried using triggers i can't seem to grasp how to set the "input" state to "R" based on the value of the field.

Thanks in advance for any help.

Any Thoughts?

 
paddywwoof     Založený: 25.02.2010   Príspevky: 7  
Príspevok Zaslal: 2010-02-26 11:37
Návrat hore  Odpovedať s citátom     

****NB I had duped myself into thinking this works but it doesn't!***
even with
Kód:
$res = $this->myquery(..
$row = $this->sql_fetch($res)..

to replace the empty $oldvals, the trigger writes the 'R' in too late!
*************************************************
you could put a trigger in like this
Kód:


$opts['triggers']['update']['pre'] = "trig.php";



and the trig.php include file would be like this

Kód:

<?php
if ($oldvals['excavation'] == 'Draw Taken' ) {
  $this->fdd['excavation']['input'] = 'R';
}
return true;
?>


 
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