<?php
/**
 * Privilege Group form
 *
 * @author Moises Heberle [moises@solis.coop.br]
 *
 * @version $Id$
 *
 * \b Maintainers \n
 * Eduardo Bonfandini [eduardo@solis.coop.br]
 * Jamiel Spezia [jamiel@solis.coop.br]
 * Luiz Gregory Filho [luiz@solis.coop.br]
 * Moises Heberle [moises@solis.coop.br]
 *
 * @since
 * Class created on 30/07/2008
 *
 * \b Organization: \n
 * SOLIS - Cooperativa de Solucoes Livres \n
 * The Gnuteca3 Development Team
 *
 * \b CopyLeft: \n
 * CopyLeft (L) 2008 SOLIS - Cooperativa de Solucoes Livres \n
 *
 * \b License: \n
 * Licensed under GPL (for further details read the COPYING file or http://www.gnu.org/copyleft/gpl.html )
 *
 * \b History: \n
 * See history in SVN repository: http://gnuteca.solis.coop.br
 */
class FrmPrivilegeGroup extends GnutecaForm
{
    function __construct()
    {
        $this->setAllFunctions('PrivilegeGroup', array('privilegeGroupIdS','descriptionS'), 'privilegeGroupId', 'description');
        parent::__construct();
        $this->setFocus('description');
    }


    public function createFields()
    {
        $this->function = MIOLO::_REQUEST('function');
        if ( $this->function != 'insert' )
        {
            $privilegeGroupId = new MTextField('privilegeGroupId', $this->privilegeGroupId->value, _M('Privilege group code',$this->module), FIELD_ID_SIZE);
            $privilegeGroupId->setReadOnly(true);
            $fields[] = $privilegeGroupId;
        }

        $description = new MTextField('description', $this->description->value, _M('Description', $this->module), FIELD_DESCRIPTION_SIZE);
        $fields[] = $description;
        $validators[] = new MRequiredValidator('description');

        $this->setFields($fields);
        if ( isset($validators) )
        {
            $this->setValidators($validators);
        }
    }
}
?>
