<?php
/**
 *
 * Class Layout form
 *
 * @author Luiz Gilberto Gregory Filho [luiz@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 05/ago/08
 *
 * \b Organization: \n
 * SOLIS - Cooperativa de Solucoes Livres \n
 * The Gnuteca3 Development Team
 *
 * \b CopyLeft: \n
 * CopyLeft (L) 2007 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 FrmLibraryGroup extends GnutecaForm
{
    function __construct()
    {
        $this->MIOLO    = MIOLO::getInstance();
        $this->module   = MIOLO::getCurrentModule();
        $this->function = MIOLO::_REQUEST('function');
        $this->setAllFunctions('LibraryGroup', null, 'libraryGroupId', 'description');
        parent::__construct();
        $this->setFocus('description');
    }


    public function createFields()
    {
        $fields[] = new MTextField       ("description", $this->description->value,  _M("Description",   $this->module), FIELD_DESCRIPTION_SIZE);
        $fields[] = new MMultiLIneField  ("observation", $this->observation->value,  _M("Observation",   $this->module), null, FIELD_MULTILINE_ROWS_SIZE, FIELD_MULTILINE_COLS_SIZE);

        if( MIOLO::_REQUEST('function') == 'update')
        {
            $fields[] = new HiddenField("libraryGroupId", MIOLO::_REQUEST('libraryGroupId'), null, 0);
        }
        $this->setFields( $fields );
        $validators[] = new MRequiredValidator  ("description", _M("Description", $this->module) );
        $this->setValidators($validators);
    }
}
?>
