Lançado Adianti Framework 7.6!
Clique aqui para saber mais
TSession se mantem em nova aba/guia Bom dia! Prezados, tenho uma Datagrid(SystemRegistrationsList) que chama uma nova tela(SystemSubscriptionView), nesta é armazenada o $param[‘key’] em uma TSession na função onView para ser utilizado em outras funções. Porém quando o usuário abre uma nova aba/guia do navegador o valor da TSession se mantem o da última aba/guia aberta. SystemRegistrationsList ...
HL
TSession se mantem em nova aba/guia  
Bom dia!
Prezados, tenho uma Datagrid(SystemRegistrationsList) que chama uma nova tela(SystemSubscriptionView), nesta é armazenada o $param[‘key’] em uma TSession na função onView para ser utilizado em outras funções.

Porém quando o usuário abre uma nova aba/guia do navegador o valor da TSession se mantem o da última aba/guia aberta.

SystemRegistrationsList
  1. <?php
  2. /**
  3.  * SystemRegistrationsList
  4.  *
  5.  * @version    1.0
  6.  * @package    control
  7.  * @subpackage ps
  8.  * @author     Hellton Lacerda
  9.  * @copyright  Serviço Social da Indústria
  10.  * @license    http://www.adianti.com.br/framework-license
  11.  */
  12. class SystemRegistrationsList extends TPage
  13. {
  14.    
  15.     private $datagrid// listing
  16.     private $pageNavigation;
  17.     private $loaded;
  18.    
  19.     
  20.     /**
  21.      * Class constructor
  22.      * Creates the page, the form and the listing
  23.      */
  24.     public function __construct()
  25.     {
  26.         parent::__construct();
  27.         
  28.         $this->form = new BootstrapFormBuilder('form_search_Registrations');
  29.         $this->form->setFormTitle'Buscar inscrições' );
  30.         
  31.         $this->datagrid = new BootstrapDatagridWrapper(new TDataGrid);
  32.         $this->datagrid->datatable 'true';
  33.         $this->datagrid->width '100%';
  34.         $this->datagrid->setHeight(320);
  35.         
  36.         $notice          = new TDataGridColumn('notice''Edital''center'NULL);
  37.         $dtinscricao     = new TDataGridColumn('dtinscricao''Data inscrição''center'NULL);
  38.         $dtinscricao->setTransformer(array($this'formatDate_01'));
  39.         $unit       = new TDataGridColumn('unit''Unidade''center'NULL);
  40.         $situacao      = new TDataGridColumn('situacao''Situação''left'NULL);
  41.        
  42.         $order1= new TAction(array($this'onReload'));
  43.         $order2= new TAction(array($this'onReload'));
  44.         $order3= new TAction(array($this'onReload'));
  45.         $order4= new TAction(array($this'onReload'));
  46.         
  47.         $order1->setParameter('order''notice');
  48.         $order2->setParameter('order''dtinscricao');
  49.         $order3->setParameter('order''unit');
  50.         $order4->setParameter('order''situacao');
  51.         
  52.         $notice->setAction($order1);
  53.         $dtinscricao->setAction($order2);
  54.         $unit->setAction($order3);
  55.         $situacao->setAction($order4);
  56.         
  57.         $this->datagrid->addColumn($notice);
  58.         $this->datagrid->addColumn($dtinscricao);
  59.         $this->datagrid->addColumn($unit);
  60.         $this->datagrid->addColumn($situacao);
  61.         
  62.         $class 'SystemSubscriptionView';
  63.         $action1 = new TDataGridAction(array($class'onView'));
  64.         $action1->setLabel(('Visualizar edital'));
  65.         $action1->setImage('fa:file-text-o fa-fw green');
  66.         $action1->setField('id');
  67.         
  68. //         $class = 'SystemRegistrationsForm';
  69. //         $action2 = new TDataGridAction(array($class, 'onEdit'));
  70. //         $action2->setLabel(('Inscrição'));
  71. //         $action2->setImage('fa:pencil-square-o blue fa-lg');
  72. //         $action2->setField('id');
  73.         
  74.         
  75.         $this->datagrid->addAction($action1);
  76. //         $this->datagrid->addAction($action2); 
  77.         
  78.         // create the datagrid model
  79.         $this->datagrid->createModel();
  80.         
  81.         // creates the page navigation
  82.         $this->pageNavigation = new TPageNavigation;
  83.         $this->pageNavigation->setAction(new TAction(array($this'onReload')));
  84.         $this->pageNavigation->setWidth($this->datagrid->getWidth());
  85.         
  86.         $panel = new TPanelGroup;
  87.         $panel->add($this->datagrid);
  88.         $panel->addFooter($this->pageNavigation);
  89.         
  90.         // creates the page structure using a vbox
  91.         $container = new TVBox;
  92.         $container->style 'width: 100%';
  93.         $container->add($panel);
  94.         
  95.         // add the vbox inside the page
  96.         parent::add($container);
  97.    
  98.     }
  99.      
  100.     public function formatDate_01($data_inicio$object)
  101.     {
  102.         $data_inicio = new DateTime($data_inicio);
  103.         return $data_inicio->format('d/m/Y');
  104.     }
  105.     public function formatDate_02($data_termino$object)
  106.     {
  107.         $data_termino = new DateTime($data_termino);
  108.         return $data_termino->format('d/m/Y');
  109.     }
  110.      
  111.  
  112.     function onReload($param NULL)
  113.     {
  114.         try
  115.         {
  116.             
  117.             TTransaction::open('permission');
  118.             
  119.             
  120.             
  121.             
  122.             $repository = new TRepository('ViewSystemSubscription');
  123.             
  124.             $limit 10;
  125.             
  126.             $criteria = new TCriteria;
  127.           
  128.             $criteria->add(new TFilter('system_user_id','=',TSession::getValue('userid')));
  129.             
  130.             if (empty($param['order']))
  131.             {
  132.                 $param['order'] = 'dtinscricao';
  133.                 $param['direction'] = 'asc';
  134.             }
  135.             
  136.             $criteria->setProperties($param); 
  137.             $criteria->setProperty('limit'$limit);
  138.             
  139.             if (TSession::getValue('SystemRegistrationsList_filter_id')) {
  140.                 $criteria->add(TSession::getValue('SystemRegistrationsList_filter_id')); 
  141.             }
  142.             
  143.             
  144.             $objects $repository->load($criteriaFALSE);
  145.             
  146.             $this->datagrid->clear();
  147.             if ($objects)
  148.             {
  149.                
  150.                 foreach ($objects as $object)
  151.                 {
  152.                     
  153.                     $this->datagrid->addItem($object);
  154.                     
  155.                 }
  156.             }
  157.             
  158.            
  159.             $criteria->resetProperties();
  160.             $count$repository->count($criteria);
  161.             
  162.             $this->pageNavigation->setCount($count); 
  163.             $this->pageNavigation->setProperties($param); 
  164.             $this->pageNavigation->setLimit($limit); 
  165.                   
  166.             
  167.             TTransaction::close();
  168.             
  169.             
  170.             $this->loaded true;
  171.             
  172.              
  173.         }
  174.         catch (Exception $e
  175.         {
  176.            
  177.             new TMessage('error''<b>Error</b> ' $e->getMessage());
  178.             
  179.            
  180.             TTransaction::rollback();
  181.         }
  182.     }
  183.     function show()
  184.     {
  185.         
  186.         if (!$this->loaded AND (!isset($_GET['method']) OR $_GET['method'] !== 'onReload') )
  187.         {
  188.             $this->onReloadfunc_get_arg(0) );
  189.         }
  190.         parent::show();
  191.     }
  192.     
  193.     function onGenerate($param)
  194.     {
  195.         $key=$param['key'];
  196.         new TMessage('info''The name is :'$key);
  197.         
  198.         $arquivo './edital/'.$key.'/'.$key.'.pdf';
  199.         
  200.            
  201.                     if (!file_exists($arquivo) OR is_writable($arquivo))
  202.                     {
  203.                      parent::openFile($arquivo);
  204.                     }
  205.                     else
  206.                     {
  207.                         throw new Exception(_t('Permission denied') . ': ' $arquivo);
  208.                     }
  209.                     TApplication::gotoPage('SystemNoticeList'); 
  210.     }
  211.     
  212.     
  213. }
  214. ?>


SystemSubscriptionView
  1. <?php
  2. /**
  3.  * SystemSubscriptionView
  4.  *
  5.  * @package    control
  6.  * @subpackage ps
  7.  * @author     Hellton Lacerda
  8.  * @copyright  Serviço Social da Indústria - Paraíba
  9.  */
  10. class SystemSubscriptionView extends TPage
  11. {
  12.     protected $form
  13.    
  14.     function __construct()
  15.     {
  16.         parent::__construct();
  17.         
  18.         $this->form = new BootstrapFormBuilder('form_System_subscription_view');
  19.         $this->form->setFormTitle(('Inscrição') );
  20.         
  21.         $id                        = new TEntry('id');
  22.       
  23.         $user                      = new TEntry('user');
  24.         $cpf                       = new TEntry('cpf');
  25.         $dtnascimento              = new TEntry('dtnascimento');
  26.         $unit                      = new TEntry('unit');
  27.         $notice                    = new TEntry('notice');
  28.     
  29.         $dtinscricao               = new TDate('dtinscricao');
  30.         
  31.         $nome_resp                 = new TEntry('nome_resp');
  32.         $cpf_resp                  = new TEntry('cpf_resp');
  33.         $empresa_resp              = new TEntry('empresa_resp');
  34.         $cnpj_resp                 = new TEntry('cnpj_resp');
  35.         
  36.         $escolaridade              = new TCombo('escolaridade');
  37.         $estadocivil               = new TCombo('estadocivil');
  38.         $renda                     = new TCombo('renda');
  39.         $tipo_escola               = new TCombo('tipo_escola');
  40.         $escolaanterior            = new TEntry('escolaanterior');
  41.         
  42.         $nt6lp                     = new TEntry('nt6lp');
  43.         $nt6mt                     = new TEntry('nt6mt');
  44.         $nt6geo                    = new TEntry('nt6geo');
  45.         $nt6his                    = new TEntry('nt6his');
  46.         
  47.         $nt7lp                     = new TEntry('nt7lp');
  48.         $nt7mt                     = new TEntry('nt7mt');
  49.         $nt7geo                    = new TEntry('nt7geo');
  50.         $nt7his                    = new TEntry('nt7his');
  51.         
  52.         $nt8lp                     = new TEntry('nt8lp');
  53.         $nt8mt                     = new TEntry('nt8mt');
  54.         $nt8geo                    = new TEntry('nt8geo');
  55.         $nt8his                    = new TEntry('nt8his');
  56.         
  57.         $ntflp                     = new TEntry('ntflp');
  58.         $ntfmt                     = new TEntry('ntfmt');
  59.         $ntfgeo                    = new TEntry('ntfgeo');
  60.         $ntfhis                    = new TEntry('ntfhis');
  61.         
  62.         $ntf                       = new TEntry('ntf');
  63.         
  64.         $situacao                  = new TCombo('situacao');
  65.         $motivo_cancelamento       = new TText('motivo_cancelamento');
  66.         
  67.         $situacao->addItems(['A' => 'AGUARDANDO''I' => 'INDEFERIDA''D' => 'DEFERIDA''M' => 'MATRICULADO']);
  68.         
  69.         $id->setEditable(FALSE);
  70.         
  71.         $user->setEditable(FALSE);
  72.         $cpf->setEditable(FALSE);
  73.         $nome_resp->setEditable(FALSE);
  74.         $cpf_resp->setEditable(FALSE);
  75.         $empresa_resp->setEditable(FALSE);
  76.         $cnpj_resp->setEditable(FALSE);
  77.         $unit->setEditable(FALSE);
  78.         $notice->setEditable(FALSE);
  79.         
  80.         $nt6lp->setEditable(FALSE);
  81.         $nt7lp->setEditable(FALSE);
  82.         $nt8lp->setEditable(FALSE);
  83.         
  84.         $nt6mt->setEditable(FALSE);
  85.         $nt7mt->setEditable(FALSE);
  86.         $nt8mt->setEditable(FALSE);
  87.         
  88.         $nt6geo->setEditable(FALSE);
  89.         $nt7geo->setEditable(FALSE);
  90.         $nt8geo->setEditable(FALSE);
  91.         
  92.         $nt6his->setEditable(FALSE);
  93.         $nt7his->setEditable(FALSE);
  94.         $nt8his->setEditable(FALSE);
  95.         
  96.         $ntflp->setEditable(FALSE);
  97.         $ntfmt->setEditable(FALSE);
  98.         $ntfgeo->setEditable(FALSE);
  99.         $ntfhis->setEditable(FALSE);
  100.         
  101.         $ntf->setEditable(FALSE);
  102.           
  103.         $id->setSize('10%');
  104.                 
  105.         $user->setSize('100%');
  106.         $cpf->setSize('100%');
  107.         $nome_resp->setSize('100%');
  108.         $cpf_resp->setSize('100%');
  109.         $empresa_resp->setSize('100%');
  110.         $cnpj_resp->setSize('100%');
  111.         
  112.         $unit->setSize('100%');
  113.         $notice->setSize('100%');
  114.         
  115.         $nt6lp->setSize('100%');
  116.         $nt7lp->setSize('100%');
  117.         $nt8lp->setSize('100%');
  118.         
  119.         $nt6mt->setSize('100%');
  120.         $nt7mt->setSize('100%');
  121.         $nt8mt->setSize('100%');
  122.         
  123.         $nt6geo->setSize('100%');
  124.         $nt7geo->setSize('100%');
  125.         $nt8geo->setSize('100%');
  126.         
  127.         $nt6his->setSize('100%');
  128.         $nt7his->setSize('100%');
  129.         $nt8his->setSize('100%');
  130.         
  131.         $ntflp->setSize('100%');
  132.         $ntfmt->setSize('100%');
  133.         $ntfgeo->setSize('100%');
  134.         $ntfhis->setSize('100%');
  135.         
  136.         $ntf->setSize('100%');
  137.         
  138.         $situacao->addValidation(('situação'), new TRequiredValidator);
  139.         $motivo_cancelamento->addValidation(('justificativa'), new TRequiredValidator);
  140.         
  141.         $this->form->addFields( [new TLabel(('Número da inscrição'))], [$id]);
  142.         $this->form->addFields( [new TLabel(('CPF do candidato'))], [$cpf], [new TLabel(('Candidato'))], [$user]);
  143.         $this->form->addFields( [new TLabel(('CPF do responsável'))], [$cpf_resp], [new TLabel(('Nome completo do responsável'))], [$nome_resp] );
  144.         $this->form->addFields( [new TLabel(('CNPJ da empresa a qual o responsável é vinculado'))], [$cnpj_resp], [new TLabel(('Nome da empresa a qual o responsável é vinculado'))], [$empresa_resp]); 
  145.         $this->form->addFields( [new TLabel(('Unidade'))], [$unit], [new TLabel(('Edital'))], [$notice]);
  146.         
  147.         $this->form->addFields( [new TFormSeparator(('Notas'))]);
  148.         $this->form->addFields( [new TLabel(('Língua Portuguesa'))], [$nt6lp], [$nt7lp], [$nt8lp]); 
  149.         $this->form->addFields( [new TLabel(('Matemática'))], [$nt6mt], [$nt7mt], [$nt8mt]); 
  150.         $this->form->addFields( [new TLabel(('Geografia'))], [$nt6geo], [$nt7geo], [$nt8geo]);
  151.         $this->form->addFields( [new TLabel(('História'))], [$nt6his], [$nt7his], [$nt8his]);
  152.         
  153.         $this->form->addFields( [new TLabel(('uuy'))], [new TLabel((''))]);
  154.         $this->form->addFields( [new TFormSeparator(('Médias'))]);
  155.         $this->form->addFields( [new TLabel(('Lingua Portuguesa'))], [$ntflp], [new TLabel(('Matemática'))], [$ntfmt]);
  156.         $this->form->addFields( [new TLabel(('Geografia'))], [$ntfgeo], [new TLabel(('História'))], [$ntfhis]);
  157.         $this->form->addFields( [new TLabel(('<br>'))]);
  158.         $this->form->addFields( [new TLabel(('Média Final'))], [$ntf]);
  159.         
  160.         TTransaction::open('permission');
  161.         
  162.         $criteria_group = new TCriteria();
  163.         $criteria_group->add(new TFilter('system_user_id''='TSession::getValue('userid')));
  164.         
  165.         $repository_user_group = new TRepository('SystemUserGroup');
  166.         $user_groups $repository_user_group->load($criteria_group);
  167.         
  168.         foreach($user_groups as $user_group){
  169.             $option_user_group[$user_group->system_group_id] = $user_group->system_group_id;
  170.         }
  171.         
  172.         TTransaction::close();
  173.     
  174.         
  175.         if(in_array('1'$option_user_group )){
  176.             
  177.             $this->form->addFields( [new TLabel(('Situação'))], [$situacao]);
  178.             $this->form->addFields( [new TLabel(('Justificativa'))], [$motivo_cancelamento]);
  179.         
  180.             $btn $this->form->addAction(('Salvar'), new TAction(array($this'onSave')), 'fa:floppy-o');
  181.             $btn->class 'btn btn-sm btn-primary';
  182.         }
  183.     
  184.         $this->datagrid = new BootstrapDatagridWrapper(new TDataGrid);
  185.         $this->datagrid->datatable 'true';
  186.         $this->datagrid->width '100%';
  187.         $this->datagrid->setHeight(320);
  188.         
  189.         $id          = new TDataGridColumn('id''Nº''center'null);
  190.         $documento   = new TDataGridColumn('documento''Documento''center'null);
  191.         $id_documento   = new TDataGridColumn('id_documento''id_documento''center'null);
  192.         
  193.         
  194.         $order1= new TAction(array($this'onReload'));
  195.         $order2= new TAction(array($this'onReload'));
  196.          
  197.         $order1->setParameter('order''id');
  198.         $order1->setParameter('order''documento');
  199.         
  200.         $id->setAction($order1);
  201.         $documento->setAction($order1);
  202.         
  203.         $this->datagrid->addColumn($id);
  204.         $this->datagrid->addColumn($documento);
  205.         
  206.         $class 'SystemSubscriptionView';
  207.         $action1 = new TDataGridAction(array($class'onGenerate'));
  208.         $action1->setLabel(_t('View'));
  209.         $action1->setImage('fa:edit');
  210.         $action1->setField('id_documento');
  211.         
  212.         $this->datagrid->addAction($action1);
  213.         
  214.         $this->datagrid->createModel();
  215.         
  216.         
  217.         $panel = new TPanelGroup;
  218.         $panel->add($this->datagrid);
  219.         
  220.         $this->datagrid2 = new BootstrapDatagridWrapper(new TDataGrid);
  221.         $this->datagrid2->datatable 'true';
  222.         $this->datagrid2->width '100%';
  223.         $this->datagrid2->setHeight(320);
  224.         
  225.        
  226.         
  227.         $dtchange   = new TDataGridColumn('dtchange''Data alteração''center'null);
  228.         $situacao   = new TDataGridColumn('situacao''Situação''center'null);
  229.         $situacao->setTransformer(array($this'status'));
  230.         
  231.         
  232.         $order1 = new TAction(array($this'onReload'));
  233.         $order2 = new TAction(array($this'onReload'));
  234.          
  235.         $order1->setParameter('order''dtchange');
  236.         $order1->setParameter('order''situacao');
  237.         
  238.         $dtchange->setAction($order1);
  239.         $situacao->setAction($order1);
  240.         
  241.         $this->datagrid2->addColumn($dtchange);
  242.         $this->datagrid2->addColumn($situacao);
  243.         
  244.         $this->datagrid2->createModel();
  245.         
  246.         
  247.         $panel2 = new TPanelGroup;
  248.         $panel2->add($this->datagrid2);
  249.         
  250.         
  251.                 
  252.         
  253.         $container = new TVBox;
  254.         $container->style 'wihgt: 100px';
  255.         
  256.         $container->add($this->form);
  257.         $container->add($panel);
  258.         $container->add($panel2);
  259.      
  260.         parent::add($container);
  261.     }
  262.     
  263.     public function status($situacao){
  264.        if($situacao == 'D'){
  265.            $situacao 'Deferida';
  266.        }
  267.        if($situacao == 'I'){
  268.            $situacao 'Indeferida';
  269.        }
  270.        if($situacao == 'A'){
  271.            $situacao 'Aguardando';
  272.        }
  273.        if($situacao == 'M'){
  274.            $situacao 'Matriculado';
  275.        }
  276.        return $situacao;
  277.     }
  278.     function onReload()
  279.     {
  280.     
  281.         $this->datagrid->clear();
  282.         
  283.         
  284.         $item = new StdClass;
  285.         $item->id     '1';
  286.         $item->documento     'Certidão de Nascimento';
  287.         $item->id_documento     'cn_';
  288.         $this->datagrid->addItem($item);
  289.         
  290.         $item = new StdClass;
  291.         $item->id     '2';
  292.         $item->documento     'CPF do Candidato';
  293.         $item->id_documento     'cpf_cand_';
  294.         $this->datagrid->addItem($item);
  295.         
  296.         $item = new StdClass;
  297.         $item->id     '3';
  298.         $item->documento     'CPF do Responsável';
  299.         $item->id_documento     'cpf_resp_';
  300.         $this->datagrid->addItem($item);
  301.         
  302.         $item = new StdClass;
  303.         $item->id     '4';
  304.         $item->documento     'RG do Responsável';
  305.         $item->id_documento     'rg_resp_';
  306.         $this->datagrid->addItem($item);
  307.         
  308.         $item = new StdClass;
  309.         $item->id     '5';
  310.         $item->documento     'Carteira de Trabalho do Responsável';
  311.         $item->id_documento     'ct_resp_';
  312.         $this->datagrid->addItem($item);
  313.         
  314.         $item = new StdClass;
  315.         $item->id     '6';
  316.         $item->documento     'Comprovante de Residência';
  317.         $item->id_documento     'cr_';
  318.         $this->datagrid->addItem($item);
  319.         
  320.         $item = new StdClass;
  321.         $item->id     '7';
  322.         $item->documento     'Anexo I';
  323.         $item->id_documento     'avali_nt_';
  324.         $this->datagrid->addItem($item);
  325.         
  326.         TTransaction::open('permission');
  327.         
  328.         $criteria_subscription = new TCriteria();
  329.         $criteria_subscription->add(new TFilter('system_subscription_id''='TSession::getValue('subscription')));
  330.         var_dump(TSession::getValue('subscription'));
  331.         $repository_historical_subscription = new TRepository('SystemHistoricalSubscription');
  332.         
  333.         $historical_subscriptions $repository_historical_subscription->load($criteria_subscription);
  334.         
  335.         $this->datagrid2->clear();
  336.         
  337.         if($historical_subscriptions){
  338.             foreach($historical_subscriptions as $historical_subscription){
  339.                 $this->datagrid2->addItem($historical_subscription);
  340.             }
  341.         }
  342.         
  343.         TTransaction::close();
  344.     }
  345.     
  346.     public function onGenerate($param){
  347.         
  348.                  
  349.         $key $param['key'];
  350.         
  351.         $subscription TSession::getValue('subscription');
  352.         
  353.         $subscription_array TSession::getValue('subscription_array');
  354.         
  355.         $arquivo './doc_alunos/'.$subscription.'/'.$key.''.$subscription.'.pdf';
  356.            
  357.                     if (!file_exists($arquivo) OR is_writable($arquivo))
  358.                     {
  359.                      parent::openFile($arquivo);
  360.                     }
  361.                     else
  362.                     {
  363.                         throw new Exception(_t('Permission denied') . ': ' $arquivo);
  364.                     }
  365.         
  366.         $this->form->setData($subscription_array);
  367.                    
  368.     }
  369.         
  370.     
  371.     
  372.    public function  onView($param)
  373.     {
  374.         try
  375.         {
  376.             TSession::setValue('subscription',$param['key']);
  377.            
  378.            
  379.             TTransaction::open('permission');
  380.             
  381.             $criteria_subscription = new TCriteria;
  382.             $criteria_subscription->add(new TFilter('id''=',$param['key']));
  383.             
  384.             $repository_subscription = new TRepository('ViewSystemSubscription');
  385.             $subscriptions $repository_subscription->load($criteria_subscription);
  386.             
  387.             foreach($subscriptions as $subscription){
  388.                $subscription;
  389.             }
  390.             
  391.             TSession::setValue('subscription_array'$subscription);
  392.            
  393.             $this->form->setData($subscription);
  394.             
  395.             TTransaction::close();
  396.            
  397.         }
  398.         catch (Exception $e
  399.         {
  400.            
  401.             new TMessage('error'$e->getMessage());
  402.         }
  403.     }
  404.     
  405.     public function onSave($param)
  406.     {
  407.         try
  408.         {
  409.             $object $this->form->getData('ViewSystemSubscription');
  410.             $this->form->validate();
  411.             TTransaction::open('permission');
  412.             $subscription = new SystemSubscription($object->id);
  413.             $subscription->situacao $object->situacao;
  414.             $subscription->motivo_cancelamento $object->motivo_cancelamento;
  415.             $subscription->store();
  416.             
  417.             $historical_subscription = new SystemHistoricalSubscription();
  418.             $historical_subscription->situacao $object->situacao;
  419.             $historical_subscription->justificativa $object->motivo_cancelamento;
  420.             $historical_subscription->dtchange date('Y-m-d H:i:s');
  421.             $historical_subscription->system_subscription_id $object->id;
  422.             $historical_subscription->system_user_id TSession::getValue('userid');
  423.             $historical_subscription->store();
  424.             
  425.             TTransaction::close();
  426.             new TMessage('info''Inscrição atualizada com sucesso.');
  427.             TApplication::gotoPage('SystemSubscriptionList');
  428.              
  429.         }
  430.         catch (Exception $e
  431.         {
  432.             new TMessage('error'$e->getMessage());
  433.             TTransaction::rollback();
  434.         }
  435.     }
  436.     
  437.     function show()
  438.     {
  439.         
  440.         if (!$this->loaded AND (!isset($_GET['method']) OR $_GET['method'] !== 'onReload') )
  441.         {
  442.             $this->onReloadfunc_get_arg(0) );
  443.         }
  444.         parent::show();
  445.     }
  446.     
  447.     
  448.     
  449.     
  450. }
  451. ?>


Segue vídeo (www.screencast.com/t/RpcZtz9j) demostrando o problema.

Curso completo Meu Negócio Pronto
Use para si, ou transforme em um negócio: Inclui aulas e códigos-fontes
Gestor de conteúdo (SITE) + Loja Virtual (E-Commerce) + Emissor de Notas para infoprodutos


Meu negócio pronto Quero me inscrever agora!

Comentários (2)


FC

O comportamento está correto a sessão somente se acaba quando fecha o navegador.
MA

Conseguiu resolver o problema?
Caso sim, como foi resolvido?