<?php
/**
 * Preference search form
 *
 * @author Sandro Roberto Weisheimer [sandrow@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 13/03/2009
 *
 * \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 FrmPrefixSuffixSearch extends GnutecaForm
{
    public function __construct()
    {
        $this->setAllFunctions('PrefixSuffix', array('prefixSuffixIdS','fieldIdS', 'subFieldIdS', 'contentS', 'typeS'));
        parent::__construct();
        if ( $this->primeiroAcessoAoForm() && strlen(MIOLO::_REQUEST('event')) == 0 )
        {
            $this->setFocus('prefixSuffixIdS');
        }
    }


    public function createFields()
    {
        $fieldIdS    = new MTextField('prefixSuffixIdS', $this->prefixSuffixIdS->value, _M('Code', $this->module), 3);
        $fields[]    = $fieldIdS;

        $fieldIdS    = new MTextField('fieldIdS', $this->fieldIdS->value, _M('Field', $this->module), FIELD_DESCRIPTION_SIZE);
        $fields[]    = $fieldIdS;

        $subFieldIdS = new MTextField('subFieldIdS', $this->subFieldIdS->value, _M('Subfield',$this->module), FIELD_DESCRIPTION_SIZE);
        $fields[]    = $subFieldIdS;

        $contentS    = new MTextField('contentS', $this->contentS->value, _M('Content',$this->module), FIELD_DESCRIPTION_SIZE);
        $fields[]    = $contentS;


        $typeS       = new GnutecaSelection('typeS', $this->typeS->value, _M('Type', $this->module), $this->business->listTypes(), null, null, null, FALSE);

        $fields[]    = $typeS;

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