<?php

class GrdIntegrationServer extends GSearchGrid
{
    public $MIOLO;
    public $module;
    public $action;

    public function __construct($data)
    {
        $this->MIOLO  = MIOLO::getInstance();
        $this->module = MIOLO::getCurrentModule();
        $this->action = MIOLO::getCurrentAction();
        
        
        $home = 'main:configuration:serverVirtual';

        $columns = array(
            new MGridColumn(_M('Código', $this->module), MGrid::ALIGN_RIGHT, null, NULL, true, null, true),
            new MGridColumn(_M('Biblioteca', $this->module), MGrid::ALIGN_LEFT, null, NULL, true, null, true),
            new MGridColumn(_M('Endereço', $this->module), MGrid::ALIGN_CENTER,  null, NULL, true, null, true),
            new MGridColumn(_M('Status', $this->module), MGrid::ALIGN_CENTER,  null, NULL, true, null, true),
            new MGridColumn(_M('Justificativa', $this->module), MGrid::ALIGN_CENTER, null, NULL, true, null, true),
            new MGridColumn(_M('Ultima atualização', $this->module), MGrid::ALIGN_CENTER,null, NULL, true, null, true),
        );

        parent::__construct($data, $columns);

        $args = array(
            'function'      => 'update',
            'integrationServerId' => '%0%',
            'nameServer'   => '%1%',
            'hostServer' => '%2%',
            'emailServer' => '%3%',
            'nameClient' => '%4%',
            'emailClient' => '%5%',
            'userClient' => '%6%',
            'password' => '%7%',
            'serverWorkflowInstanceId' => '%8%',
            'clientWorkflowInstanceId' => '%9%'
        );

        $hrefUpdate = $this->MIOLO->getActionURL($this->module, $this->action, null, $args);
        
        
        
        $args = array(
            'function' => 'delete',
            'integrationServerId' => '%0%',
            'nameServer' => '%1%'
        );
        
        $args['function'] = 'search';
        
        $this->setIsScrollable();
        $this->addActionUpdate( $hrefUpdate );
        $this->addActionDelete( GUtil::getAjax('tbBtnDelete_click', $args) );
    }
}
?>