<?php
/**
 * FrmSearchableField 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 01/12/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 FrmSearchableFieldSearch extends GnutecaForm
{
    public function __construct()
    {
        $this->setAllFunctions('SearchableField', array('description'));
        parent::__construct();
        if ( $this->primeiroAcessoAoForm() && strlen(MIOLO::_REQUEST('event')) == 0 )
        {
            $this->setFocus('searchableFieldIdS');
        }
    }


    public function createFields()
    {
    	$fields[] = new MTextField('searchableFieldIdS', null, _M('Code', $this->module), FIELD_ID_SIZE);
    	$fields[] = new MTextField('descriptionS', null, _M('Description', $this->module), FIELD_DESCRIPTION_SIZE);
        $fields[] = new MTextField('fieldS', null, _M('Field', $this->module), FIELD_DESCRIPTION_SIZE);
        $fields[] = new MTextField('identifierS', null, _M('Identifier', $this->module), FIELD_DESCRIPTION_SIZE);
        $fields[] = new MTextField('observationS', null, _M('Observation', $this->module), FIELD_DESCRIPTION_SIZE);

        $lbl = new MLabel(_M('Is restricted', $this->module) . ':');
        $lbl->setWidth(FIELD_LABEL_SIZE);
        $isRestrictedS = new MRadioButtonGroup('isRestrictedS', null, GnutecaUtils::listYesNo(1), null, null, MRadioButtonGroup::LAYOUT_HORIZONTAL);
        $fields[] = new MHContainer('hctIsRestrictedS', array($lbl, $isRestrictedS));
        
        $fields[]        = new MTextField('levelS', $this->levelS->value, _M('Level',$this->module), 2);
        $validators[]   = new MIntegerValidator('levelS','','');

        $this->setFields($fields);
    }
}
?>
