Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Field turns noedit without apparent cause
Field turns noedit without apparent cause [message #1537] Tue, 12 August 2008 15:12 Go to previous message
bonzo_bcn is currently offline  bonzo_bcn
Messages: 152
Registered: June 2008
Senior Member
I have a table called 'team'.
In this table there is a field entidad_id that has a dropdown list that retrieves data from the 'entidad' table.

If in the team.class.inc I include this code (which I use to filter the records so each 'entidad' can see only their records):
	    function _cm_pre_getData ($where, $where_array, $fieldarray=null){
			require_once 'classes/entidad.class.inc';
			$entidad = new entidad;       
		    $entidad->sql_select = 'entidad_id';
			$entidad_id = $entidad->getData("entidad_id='" .$_SESSION['role_id'] ."'");

			if ($entidad->numrows == 1){
				if (empty($where)){
					$where = "entidad_id=" .$entidad_id[0]['entidad_id'] ;	
				}else{
					$where .= " AND entidad_id=" .$entidad_id[0]['entidad_id'] ;
				}

		    }
			return $where;
	}

then, when adding a new record (logged as an 'entidad') with an add1 transaction in the 'team' table, the entidad_id field becomes a noedit field automatically (I haven't defined it 'noedit' in the dictionary).

For a user that is not an 'entidad' the dropdown list is displayed correctly.

I'm trying to understand what is happening here but can't seem to find the explanation.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to change node_desc in Tree_structure (TREE2)
Next Topic: Filter values of fields depending on other fields
Goto Forum:
  


Current Time: Mon Nov 25 18:44:21 EST 2024

Total time taken to generate the page: 0.20390 seconds