示例#1
0
 public function runAction()
 {
     $_job = new Profile_Model_Job_Mapper();
     $_job->setId($this->getRequest()->getParam('id'))->retrive()->setDhUltExec("SYSDATE")->update();
     $_view = new Profile_DataView_Job_Users();
     $where = new ZendT_Db_Where();
     $where->addFilter('profile_job.id', $this->getRequest()->getParam('id'));
     $where->addFilter('usuario.email', "", "!NULL");
     $data = $_view->recordset($where);
     while ($row = $data->getRow()) {
         try {
             $uri = $row['uri']->get();
             if ($uri == '') {
                 $uri = ZendT_Lib::convertObjectToUri($row['objeto']->get());
             }
             $uriOriginal = $uri . '/dynamic/profile/' . $row['id_profile']->get();
             $uri .= '/found/profile/' . $row['id_profile']->get() . '/no_location/1?' . $row['uri_token']->get();
             $client = new Zend_Http_Client($uri, array('timeout' => '80'));
             $response = $client->request();
             if ($response->getBody() == 'OK') {
                 $mail = new ZendT_Mail();
                 $mail->addTo($row['email_usuario']->get(), $row['nome_usuario']->get());
                 $mail->addFrom('*****@*****.**', 'Transportadora Americana');
                 $mail->setTitle($row['nome']->get());
                 $mail->setSubject($row['nome']->get());
                 $comment = $row['observacao']->get();
                 if (!$comment) {
                     $comment = $row['nome']->get();
                 }
                 $comment .= '<br><br>Para acessar o relatório clique <a href = "' . str_replace(array('/found/', '/no_location/1'), array('/dynamic/', ''), $uri) . '">aqui</a>';
                 $mail->setComment($comment);
                 $body = '<br>';
                 $user = array();
                 $user['id'] = $row['id_usuario']->get();
                 $user['role'] = $row['nome_papel']->get();
                 $listProfile = ZendT_Profile::listProfile($row['objeto']->get(), '', $user);
                 if (count($listProfile) > 0) {
                     $body .= '<style type="text/css">';
                     $body .= '    <!--';
                     $body .= '    td {';
                     $body .= '            font-family: Arial, Helvetica, sans-serif;';
                     $body .= '            font-size: 12px;';
                     $body .= '    }';
                     $body .= '    .TitleTable {';
                     $body .= '            font-weight: bold;';
                     $body .= '            border-bottom: 0px;';
                     $body .= '    }';
                     $body .= '    .viewTitle {';
                     $body .= '            background-color: #F9F9F9;';
                     $body .= '            font-weight: bold;';
                     $body .= '    }';
                     $body .= '    .viewTable {';
                     $body .= '            border:1px solid #CCCCCC;';
                     $body .= '    }';
                     $body .= '    -->';
                     $body .= '</style>';
                     $body .= '<table width="100%" border="0" cellpadding="5" cellspacing="0" class="viewTable">';
                     $body .= '	<tr >';
                     $body .= '		<td class="viewTitle">Visões Disponíveis</td>';
                     $body .= '	</tr>';
                     $body .= '	<tr>';
                     $body .= '		<td>';
                     $body .= '			<table width="100%" border="0" cellpadding="5" cellspacing="0">';
                     $body .= '				<tr>';
                     $body .= '					<td class="TitleTable">Tipo</td>';
                     $body .= '					<td class="TitleTable">Visão</td>';
                     $body .= '					<td class="TitleTable">Observação</td>';
                     $body .= '				</tr>';
                     foreach ($listProfile as $profile => $detailProfile) {
                         $uri = ZendT_Lib::convertObjectToUri($row['objeto']->get()) . '/found/profile/' . $profile . '?' . $row['uri_token']->get();
                         $body .= '				<tr>';
                         $body .= '					<td>' . $detailProfile['tipoDescricao'] . '</td>';
                         $body .= '					<td><a href = "' . str_replace('/found/', '/dynamic/', $uri) . '">' . $detailProfile['nome'] . '</a></td>';
                         $body .= '					<td>' . $detailProfile['observacao'] . '</td>';
                         $body .= '				</tr>';
                     }
                     $body .= '			</table>';
                     $body .= '		</td>';
                     $body .= '	</tr>';
                     $body .= '</table>';
                 }
                 $mail->setBody($body);
                 $mail->save();
             }
         } catch (Exception $ex) {
             $mail = new ZendT_Mail();
             /* $mail->addTo("*****@*****.**"); */
             $mail->addTo("*****@*****.**");
             $mail->addFrom('*****@*****.**', 'Transportadora Americana');
             $mail->setTitle('Erro no envio de e-mail pelo agendamento de tarefa');
             $mail->setSubject($mail->getTitle());
             $comment = $row['nome']->get() . '<br><br>Para acessar o relatório clique <a href = "' . $uriOriginal . '">aqui</a>';
             $mail->setComment($comment);
             $mail->setBody($ex->getMessage());
             $mail->save();
             /*echo 'Erro';
               exit;*/
         }
     }
     echo 'Processado';
     exit;
 }
示例#2
0
 private function _getConfigDashboard($row)
 {
     //$_mapper = $this->_loadMapper($row['objeto']->get());
     $_profile = new ZendT_Profile();
     $profiles = $_profile->listProfile($row['objeto']->get());
     $columns = array();
     foreach ($profiles as $id => $profile) {
         $name = 'view-' . $id . '-' . str_replace(' ', '_', strtolower(removeAccent($profile['nome'])));
         if ($profile['tipo'] != 'B') {
             $columns[$name]['label'] = $profile['nome'];
             $columns[$name]['width'] = 300;
             $columns[$name]['order'] = null;
             $columns[$name]['align'] = 'left';
             $columns[$name]['column'] = $id;
             $columns[$name]['id'] = $id;
             $columns[$name]['type'] = null;
         }
     }
     $config = unserialize(html_entity_decode($row['config']->get()));
     /**
      * 
      */
     if (!isset($config['cols-panel'])) {
         $config = array('cols-panel' => array('name' => 'cols-panel', 'label' => 'Painel de Visões', 'draggable' => 0, 'fields' => array()), 'cols-filter' => array('name' => 'cols-filter', 'label' => 'Painel de Filtros', 'draggable' => 1, 'fields' => array()));
     }
     /**
      * Ordena as colunas 
      */
     if ($config) {
         foreach ($config as $key => $value) {
             unset($columns[$key]);
         }
     }
     /**
      * Adiciona as novas colunas ou as que não foram configuradas
      */
     foreach ($columns as $name => $column) {
         if ($columns[$name]['label']) {
             $column['hidden'] = 1;
             $config['ini']['fields'][$name] = $column;
         }
     }
     return $config;
 }
示例#3
0
 /**
  * Ação :: Formulário de Inclusão e Alteração
  */
 public function formAction()
 {
     $this->_form = new $this->_formName();
     $module = $this->getRequest()->getModuleName();
     $controller = $this->getRequest()->getControllerName();
     $params = $this->getRequest()->getParams();
     $action = $params['action_form'];
     if ($params['typeModal'] == 'AJAX') {
         Zend_Layout::getMvcInstance()->setLayout('ajax');
     } else {
         if ($params['typeModal'] == 'IFRAME') {
             Zend_Layout::getMvcInstance()->setLayout('iframe');
         } else {
             if ($params['typeModal'] == 'WINDOW') {
                 Zend_Layout::getMvcInstance()->setLayout('window');
             }
         }
     }
     $this->view->onLoad = stripslashes(urldecode($params['afterLoad']));
     if (substr($this->view->onLoad, 0, 7) == 'base64:') {
         $this->view->onLoad = base64_decode(substr($this->view->onLoad, 7));
     }
     $event = 'insert';
     $actionForm = Zend_Controller_Front::getInstance()->getRequest()->getParam('action_form');
     if ($actionForm) {
         $event = $actionForm;
     }
     $this->getForm()->loadElements($event);
     if ($params['id']) {
         $row = $this->_retrieve();
         $this->getForm()->populate($row);
     }
     $_buttons = array();
     $first = true;
     if (count($params['buttons']) > 0) {
         foreach ($params['buttons'] as $caption => $button) {
             $_button = array();
             $_button['caption'] = $caption;
             $_button['icon'] = $button['icon'];
             $_button['onClick'] = $button['onClick'];
             if ($first) {
                 $first = false;
                 $_button['class'] = 'btn primary';
             }
             $_buttons[] = $_button;
         }
     } else {
         if (!$params['grid']) {
             $formParams = array();
             if ($params['callback']) {
                 $params['callback'] = urldecode($params['callback']);
                 if (substr($params['callback'], 0, 7) == 'base64:') {
                     $params['callback'] = base64_decode(substr($params['callback'], 7));
                 }
                 if ($params['callback']) {
                     $formParams['success'] = new ZendT_JS_Command($params['callback']);
                 }
             }
             $formParams = ZendT_JS_Json::encode($formParams);
             $_button = array();
             $_button['caption'] = _i18n('Salvar');
             $_button['icon'] = 'ui-icon-disk';
             $_button['onClick'] = "function(){" . "   var form = jQuery('#" . $this->getForm()->getName() . "'); " . "   form.TForm('save'," . $formParams . ");" . "}";
             $_button['class'] = 'btn primary';
             $_buttons[] = $_button;
         }
     }
     $this->getForm()->loadElements($event);
     $profile = ZendT_Profile::get($this->_formName, 'F');
     /**
      * Utiliza o profile cadastrado, do contrário utiliza o Form Default
      */
     if ($profile) {
         $this->getForm()->loadProfile($profile);
     }
     $listProfile = ZendT_Profile::listProfile($this->_formName, 'F');
     $_profile = new ZendT_View_Profile('selProfile', $profile['id'], $listProfile, 'F', $this->_formName);
     $screenName = $this->view->screenName;
     $this->view->profileMenu = $_profile->render($screenName);
     $this->view->screenName = $screenName;
     $this->view->placeholder('title')->set($screenName);
     /* $screenName = $_profile->render($this->view->screenName);
        $this->view->screenName = $screenName;
        $this->view->placeholder('title')->set($screenName); */
     $this->getForm()->populate($params);
     $hasAction = $this->getForm()->setAction($action);
     if (!$hasAction) {
         $action = ZendT_Url::getBaseUrl() . '/' . $module . '/' . $controller . '/' . $action;
         $this->getForm()->setAction($action);
     }
     $buttons = $this->_createButtons($_buttons);
     $this->view->buttonsLoad = $buttons['buttons'];
     $buttons['buttons'] = $buttons['buttons'];
     $this->view->buttons = $buttons;
     $this->view->grid = '';
     if ($params['grid']) {
         $configColumns = $this->_mapper->getColumns()->toArray();
         foreach ($configColumns as $column => $key) {
             if ($key['subtotal']) {
                 $this->getGrid()->setFooterRow(true);
                 $this->getGrid()->setUserDataOnFooter(true);
                 break;
             }
         }
         $this->getColumns();
         $this->configGrid();
         $onCellSelect = "function(){\n                                    var grid  = jQuery('#" . $this->getGrid()->getID() . "');\n                                    var id = grid.jqGrid('getGridParam','selrow');\n                                    jQuery('#" . $this->getForm()->getName() . "').TForm('retrieve',id);\n                                }";
         $this->getGrid()->setOnCellSelect($onCellSelect);
         $this->getGrid()->setObjToolbar(null);
         /* getObjToolbar()->removeButton('add');
            $this->getGrid()->getObjToolbar()->removeButton('edit'); */
         //$this->getGrid()->getT
         //                      getToolbarButton('edit')
         $this->view->grid = $this->getGrid();
         $_element = new ZendT_Form_Element_Button('btn_save');
         $_element->setLabel('Salvar');
         $_element->setIcon('ui-icon ui-icon-disk');
         $_element->setAttrib('onClick', "jQuery('#" . $this->getForm()->getName() . "').TForm('save',{grid: '#" . $this->getGrid()->getID() . "'});");
         $this->getForm()->addElement($_element);
         $_element = new ZendT_Form_Element_Button('btn_new');
         $_element->setLabel('Novo');
         $_element->setIcon('ui-icon ui-icon-document');
         $_element->setAttrib('onClick', "jQuery('#" . $this->getForm()->getName() . "').TForm('clear',{});");
         $this->getForm()->addElement($_element);
         if (ZendT_Acl::getInstance()->isAllowed('delete', $this->_resourceBase)) {
             $_element = new ZendT_Form_Element_Button('btn_delete');
             $_element->setLabel('Excluir');
             $_element->setIcon('ui-icon ui-icon-trash');
             $_element->setAttrib('onClick', "jQuery('#" . $this->getForm()->getName() . "').TForm('delete',{grid: '#" . $this->getGrid()->getID() . "'});");
             $this->getForm()->addElement($_element);
         }
         $_element = new ZendT_Form_Element_Button('btn_next');
         $_element->setIcon('ui-icon ui-icon-seek-next');
         $_element->addStyle('float', 'right');
         $_element->addClass('ui-button-icon ui-state-default ui-group-item item last');
         $_element->setAttrib('onClick', "jQuery('#" . $this->getForm()->getName() . "').TForm('navByGrid',{grid: '#" . $this->getGrid()->getID() . "',move:'next'});");
         $this->getForm()->addElement($_element);
         $_element = new ZendT_Form_Element_Button('btn_prev');
         $_element->setIcon('ui-icon ui-icon-seek-prev');
         $_element->addStyle('float', 'right');
         $_element->addClass('ui-button-icon ui-state-default ui-group-item item first');
         $_element->setAttrib('onClick', "jQuery('#" . $this->getForm()->getName() . "').TForm('navByGrid',{grid: '#" . $this->getGrid()->getID() . "',move:'prev'});");
         $this->getForm()->addElement($_element);
         $this->getForm()->addDisplayGroup(array('btn_save', 'btn_new', 'btn_delete', 'btn_next', 'btn_prev'), 'group-nav-buttons', array('id' => 'group-nav-buttons-' . $this->getForm()->getName(), 'class' => 'ui-nav-form'));
     }
     $this->view->form = $this->getForm();
 }
示例#4
0
文件: Action.php 项目: rtsantos/mais
 /**
  * Pega o objeto grid pré-configurado para
  * manipulação.
  *
  * @return ZendT_Grid
  */
 public function configGrid()
 {
     $module = $this->getRequest()->getModuleName();
     $controller = $this->getRequest()->getControllerName();
     $params = $this->getRequest()->getParams();
     $profileKey = '';
     if (isset($params['profile_key'])) {
         $profileKey = $params['profile_key'];
     }
     $urlFilter = '?q=1';
     if (isset($params['filter_json'])) {
         $urlFilter .= '&filter_json=' . $params['filter_json'];
     }
     if (isset($params['mapper_view'])) {
         $urlFilter .= '&mapper_view=' . $params['mapper_view'];
     }
     if ($this->_mapper instanceof ZendT_Db_View) {
         $where = $this->getMapper()->getColumns()->getWhere($params);
         if ($where) {
             $params['postData'] = $where->toJsonPostData($params['postData']);
         }
     }
     if ($params['postData'] != '') {
         $autoFilter = true;
     } else {
         $autoFilter = false;
     }
     $type = 'G';
     #Grid
     $mapperName = get_class($this->_mapper);
     $profile = ZendT_Profile::get($mapperName, $type);
     $profileId = '';
     if (isset($profile['id'])) {
         $profileId = $profile['id'];
     }
     $profiles = ZendT_Profile::listProfile($mapperName, $type);
     $this->getGrid()->setUrl(ZendT_Url::getBaseUrl() . '/' . $module . '/' . $controller . '/grid-data/profile/' . $profileId . $urlFilter)->setDataType('json')->setMType('POST')->setRowNum(30)->setRowList(array(30, 60, 90))->setPager("#pager-" . $this->getGrid()->getID())->setViewRecords('true')->setToolbar(array('true', 'top'))->setMType('POST')->setWidth(960)->setAutoFilter($autoFilter)->setShrinkToFit(false)->setPostData(urldecode($params['postData']))->setBeforeRequest("function(){ gridResize('" . $this->getGrid()->getID() . "'); }")->setGridComplete(" function(){ jQuery.gridAtivaNavKey({ idGrid:'" . $this->getGrid()->getID() . "' }); }");
     /**
      * Analisa Parâmetros
      */
     $newPostData = array();
     foreach ($params as $name => $value) {
         $param = $this->getMapper()->paramName($name);
         if ($param) {
             $newPostData[$param] = $value;
         }
     }
     if (count($newPostData) > 0) {
         $this->getGrid()->setPostData($newPostData);
     }
     if ($this->getRequest()->getParam('seekerAjax')) {
         $objectRetrieve = 'TSeeker';
         if ($this->getRequest()->getParam('objectRetrive')) {
             $objectRetrieve = $this->getRequest()->getParam('objectRetrive');
         }
         $this->view->headScript()->appendFile(ZendT_Url::getBaseDiretoryPublic() . '/scripts/jquery/widget/' . $objectRetrieve . '.js');
         $seekerName = $this->getRequest()->getParam('seekerName');
         $seekerAccess = 'window.opener.jQuery';
         $seekerClose = 'window.close();';
         if ($params['typeModal'] == 'AJAX') {
             $seekerAccess = 'jQuery';
             $seekerClose = 'seeker.TSeeker(\'divClose\');';
             $functionResize = "function(){\n                                            var grid = jQuery('#" . $this->getGrid()->getID() . "');\n                                            var seeker = " . $seekerAccess . "('#" . $seekerName . "');\n                                            var div  = seeker.TSeeker('option','elements').div;\n                                            grid.setGridHeight(250);\n                                            grid.setGridWidth(700);\n                                        }";
         } else {
             $functionResize = "function(){\n                                            \$.gridResize({\n                                                idGrid: '" . $this->getGrid()->getID() . "'\n                                            });\n                                            \$(window).resize(function(){\n                                                \$.gridResize({\n                                                    idGrid: '" . $this->getGrid()->getID() . "'\n                                                });\n                                            });\n                                        }";
         }
         $functionRetorno = "function(){\n                                        var grid  = jQuery('#" . $this->getGrid()->getID() . "');\n                                        if( grid.jqGrid('getGridParam','multiselect') ){\n                                            var id = grid.jqGrid('getGridParam','selarrrow');\n                                        }else{\n                                            var id = grid.jqGrid('getGridParam','selrow');\n                                        }\n                                        var seeker = " . $seekerAccess . "('#" . $seekerName . "');\n                                        try{\n                                            seeker.{$objectRetrieve}('retrieve',{value: id});\n                                            {$seekerClose}\n                                        }catch(err){\n                                            {$seekerClose}\n                                        }\n                                    }";
         $this->getGrid()->setOndblClickRow($functionRetorno)->setBeforeRequest($functionResize)->setGridComplete("function(){\n                                                \$.gridAtivaNavKey({\n                                                    idGrid: '" . $this->getGrid()->getID() . "',\n                                                    functionEnter: " . $functionRetorno . "\n                                                });\n                                            }");
     }
     if ($params['callback']) {
         $functionCallback = base64_decode($params['callback']);
         $this->getGrid()->setOndblClickRow($functionCallback)->setGridComplete("function(){\n                                                \$.gridAtivaNavKey({\n                                                    idGrid: '" . $this->getGrid()->getID() . "',\n                                                    functionEnter: " . $functionCallback . "\n                                                });\n                                            }");
     }
     if ($params['multiple']) {
         $this->getGrid()->setMultiSelect(true);
         $idbt = 'selectGrid' . $this->getGrid()->getID();
         $multiSelect = new ZendT_Grid_Button($idbt);
         $multiSelect->setIdGrid($this->getGrid()->getID())->setButtonIcon("ui-icon-check")->setTitle("Selecionar")->setCaption("Selecionar")->setOnClick($functionRetorno);
         $this->view->hotkeys()->add('btMultiSelect', 'ctrl+s', '$("#' . $idbt . '").click();');
         $this->getGrid()->addToolbarButton("multiSel", $multiSelect);
     }
     $idbt = 'refreshGrid' . $this->getGrid()->getID();
     $refresh = new ZendT_Grid_Button_Refresh($idbt);
     $refresh->setIdGrid($this->getGrid()->getID())->setButtonIcon("ui-icon-refresh")->setTitle("Atualizar");
     $this->view->hotkeys()->add('btRefresh', 'ctrl+r', '$("#' . $idbt . '").click();');
     $this->getGrid()->addToolbarButton("refresh", $refresh, 'grid');
     /* $clearFiltro = new ZendT_Grid_Button();
        $clearFiltro->setIdGrid($this->getGrid()->getID())
        ->setButtonIcon('ui-icon ui-icon-arrowreturnthick-1-s')
        ->setOnClick('function(){$(\'#' . $this->getGrid()->getID() . '\')[0].clearToolbar();}')
        ->setTitle('Limpar Filtro');
        $this->getGrid()->addToolbarButton('clearFilter', $clearFiltro, 'grid'); */
     $autoFiltro = new ZendT_Grid_Button();
     $autoFiltro->setIdGrid($this->getGrid()->getID())->setButtonIcon('ui-icon  ui-icon-pin-s')->setOnClick('function(){$(\'#' . $this->getGrid()->getID() . '\')[0].toggleToolbar();}')->setTitle('Filtro');
     $this->getGrid()->addToolbarButton('autofiltro', $autoFiltro, 'grid');
     $_profile = new ZendT_View_Profile('selProfile', $profile['id'], $profiles, $type, $mapperName);
     $screenName = $this->view->screenName;
     $this->view->profileMenu = $_profile->render($screenName);
     $this->view->screenName = $screenName;
     $this->view->placeholder('title')->set($screenName);
     $navigator = '';
     if ($navigator) {
         $this->getGrid()->getNavigator()->addCommand('navigatorGrid', $navigator);
     }
     /**
      * Botão de adição de registro e
      * suas configurações vitais
      */
     if ($this instanceof ZendT_Controller_ActionCrud && ZendT_Acl::getInstance()->isAllowed('insert', $this->_resourceBase)) {
         $filterJson = $this->getRequest()->getParam('filter_json');
         $idbt = 'addGrid' . $this->getGrid()->getID();
         $add = new ZendT_Grid_Button_Add($idbt);
         $add->setIdGrid($this->getGrid()->getID())->setButtonIcon('ui-icon-plus')->setUrl(ZendT_Url::getBaseUrl() . '/' . $module . '/' . $controller . '/form?filter_json=' . $filterJson . '&profile_key=' . $profileKey)->setWindowWidth(860)->setWindowHeight(520)->setTitle('Adicionar');
         $this->view->hotkeys()->add('btInsert', 'ctrl+a', '$("#' . $idbt . '").click();');
         $this->getGrid()->addToolbarButton('add', $add, 'edit');
     }
     /**
      * Botão de edição de linha e
      * suas configurações vitais
      */
     if ($this instanceof ZendT_Controller_ActionCrud && ZendT_Acl::getInstance()->isAllowed('update', $this->_resourceBase)) {
         $idbt = 'editGrid' . $this->getGrid()->getID();
         $edit = new ZendT_Grid_Button_Edit($idbt);
         $edit->setIdGrid($this->getGrid()->getID())->setButtonIcon('ui-icon-pencil')->setUrl(ZendT_Url::getBaseUrl() . '/' . $module . '/' . $controller . '/form' . '?profile_key=' . $profileKey)->setUrlRetrieve(ZendT_Url::getBaseUrl() . '/' . $module . '/' . $controller . '/retrive')->setWindowWidth(860)->setWindowHeight(520)->setTitle('Editar');
         $this->view->hotkeys()->add('btEdit', 'ctrl+e', '$("#' . $idbt . '").click();');
         $this->getGrid()->addToolbarButton('edit', $edit, 'edit');
         if (!$this->getRequest()->getParam('seekerAjax')) {
             $this->getGrid()->setOndblClickRow("function(){jQuery('#" . $idbt . "').click();}");
         }
     }
     #Button - Delete
     if ($this instanceof ZendT_Controller_ActionCrud && ZendT_Acl::getInstance()->isAllowed('delete', $this->_resourceBase)) {
         $idbt = 'delGrid' . $this->getGrid()->getID();
         $del = new ZendT_Grid_Button_Delete($idbt);
         $del->setIdGrid($this->getGrid()->getID())->setButtonIcon('ui-icon-trash')->setUrl(ZendT_Url::getBaseUrl() . '/' . $module . '/' . $controller . '/delete')->setWindowWidth(800)->setWindowHeight(520)->setTitle('Excluir');
         $this->view->hotkeys()->add('btDelete', 'ctrl+d', '$("#' . $idbt . '").click();');
         $this->getGrid()->addToolbarButton('del', $del, 'edit');
     }
     if ($this instanceof ZendT_Controller_ActionCrud && ZendT_Acl::getInstance()->isAllowed('log', $this->_resourceBase) && method_exists($this->_mapper, 'isLogger') && $this->_mapper->isLogger()) {
         $log = new ZendT_Grid_Button_Window();
         $log->setIdGrid($this->getGrid()->getID())->setButtonIcon('ui-icon-info')->setUrl(ZendT_Url::getBaseUrl() . '/' . $module . '/' . $controller . '/log')->setWindowWidth(650)->setWindowHeight(450)->setTitle('Log');
         $this->getGrid()->addToolbarButton('Log', $log, 'edit');
     }
     $this->view->typeModal = $params['typeModal'];
     if ($params['typeModal'] == 'AJAX') {
         Zend_Layout::getMvcInstance()->setLayout('ajax');
     } else {
         if ($params['typeModal'] == 'WINDOW') {
             $this->view->onLoad = stripslashes(urldecode($params['afterLoad']));
             $this->view->onClose = stripslashes(urldecode($params['onClose']));
             Zend_Layout::getMvcInstance()->setLayout('window');
         }
     }
 }