app/control/admin/SystemGroupForm.class.php
/**
     * method onEdit()
     * Executed whenever the user clicks at the edit button da datagrid
     */
method onEdit()
Executed whenever the user clicks at the edit button da datagrid
method onEdit () Executed whenever the user clicks at the edit button da datagrid
function onEdit($param)
    {
        try
        {
            if (isset($param['key']))
            {
                $key=$param['key'];
                TTransaction::open('permission');
                $object = new SystemGroup($key);
                $program_ids = array();
                foreach ($object->getSystemPrograms() as $program)
                {
                    $program_ids[] = $program->id;
                }
                $object->program_list = $program_ids;
                $user_ids = array();
                foreach ($object->getSystemUsers() as $user)
                {
                    $user_ids[] = $user->id;
                }
                $object->user_list = $user_ids;
                $this->form->setData($object);
                TTransaction::close();
            }
            else
            {
                $this->form->clear();
            }
        }
        catch (Exception $e) 
        {
            new TMessage('error', $e->getMessage());
            TTransaction::rollback();
        }
    }
function onEdit ( $ param ) { try { if ( isset ( $ param [ 'key' ] ) ) { $ key = $ param [ 'key' ] ; TTransaction :: open ( 'permission' ) ; $ object = new SystemGroup ( $ key ) ; $ program_ids = array ( ) ; foreach ( $ object -> getSystemPrograms ( ) as $ program ) { $ program_ids [ ] = $ program -> id ; } $ object -> program_list = $ program_ids ; $ user_ids = array ( ) ; foreach ( $ object -> getSystemUsers ( ) as $ user ) { $ user_ids [ ] = $ user -> id ; } $ object -> user_list = $ user_ids ; $ this -> form -> setData ( $ object ) ; TTransaction :: close ( ) ; } else { $ this -> form -> clear ( ) ; } } catch ( Exception $ e ) { new TMessage ( 'error' , $ e -> getMessage ( ) ) ; TTransaction :: rollback ( ) ; } }
method onEdit()
 Executed whenever the user clicks at the edit button da datagrid
method onEdit () Executed whenever the user clicks at the edit button da datagrid
// get the parameter $key // open a transaction with database 'permission' // instantiates object System_group // fill the form with the active record data // close the transaction // in case of exception