Пример #1
0
 function button_clicked($button, $data)
 {
     if (!CheckPermissao($this->Owner, $data[0], true)) {
         return;
     }
     $this->Owner->notebook->append(new $data[1]());
 }
Пример #2
0
 function __construct()
 {
     parent::__construct('Produtos', 'produtos.png');
     // barra de ferramentas
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'novo_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'editar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     $this->imprimir = $toolbar->append_stock('gtk-print-preview', 3, array($this, 'imprimir_clicked'));
     // filtro
     $this->pack_start($this->filtro = new TFiltroProdutos(array($this, 'pega_dados')), false);
     // grid
     $this->pack_start($this->grid = new TGridProdutos($this));
     $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_produto'));
     $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_produto'));
     $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_produto'));
     $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_produtos'));
 }
Пример #3
0
 function __construct()
 {
     parent::__construct(latin1('Unidades de Vendas'), 'unid_vendas.png');
     // barra de ferramentas
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'novo_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'editar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     $this->imprimir = $toolbar->append_stock('gtk-print-preview', 3, array($this, 'imprimir_clicked'));
     // grid
     $this->pack_start($this->grid = new TGridUnidVendas($this));
     $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_unid_venda'));
     $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_unid_venda'));
     $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_unid_venda'));
     $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_unid_vendas'));
     // preenche lista
     $this->pega_dados();
 }
Пример #4
0
 function __construct()
 {
     parent::__construct('Tipos de Despesa', 'tipos_despesa.png');
     // barra de ferramentas
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'novo_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'editar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     $this->imprimir = $toolbar->append_stock('gtk-print-preview', 3, array($this, 'imprimir_clicked'));
     // grid
     $this->pack_start($this->grid = new TGridTiposDespesa($this));
     $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_tipo_despesa'));
     $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_tipo_despesa'));
     $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_tipo_despesa'));
     $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_tipos_despesa'));
     // preenche lista
     $this->pega_dados();
 }
Пример #5
0
 function notebook_switch_page($notebook, $pointer, $page_num)
 {
     switch ($page_num) {
         case 0:
             $this->baixar->set_sensitive(CheckPermissao($this, 'baixar_contas_pagar'));
             $this->cancelar->set_sensitive(CheckPermissao($this, 'cancelar_conta_pagar'));
             $this->estornar->set_sensitive(false);
             break;
         case 1:
             $this->baixar->set_sensitive(false);
             $this->cancelar->set_sensitive(false);
             $this->estornar->set_sensitive(CheckPermissao($this, 'estornar_conta_pagar'));
             break;
         case 2:
             $this->baixar->set_sensitive(false);
             $this->cancelar->set_sensitive(false);
             $this->estornar->set_sensitive(false);
             break;
     }
 }
Пример #6
0
 function __construct()
 {
     parent::__construct('Transportadoras', 'transportadoras.png');
     // barra de ferramentas
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'novo_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'editar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     $this->enderecos = $toolbar->append('enderecos.png', latin1('Endereços'), 3, array($this, 'enderecos_clicked'));
     $this->imprimir = $toolbar->append_stock('gtk-print-preview', 4, array($this, 'imprimir_clicked'));
     // filtro
     $this->pack_start($this->filtro = new TFiltroTransportadoras(array($this, 'pega_dados')), false);
     // grid
     $this->pack_start($this->grid = new TGridTransportadoras($this));
     $this->filtro->set_focus();
     $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_transportadora'));
     $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_transportadora'));
     $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_transportadora'));
     $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_transportadoras'));
     $this->enderecos->set_sensitive(CheckPermissao($this, 'enderecos_transportadora'));
 }
Пример #7
0
 function __construct($CodFor, $NomeFor)
 {
     $this->CodFor = $CodFor;
     parent::__construct(latin1('Endereços do Fornecedor'), 'enderecos.png');
     // toolbar
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'incluir_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'alterar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     $this->imprimir = $toolbar->append_stock('gtk-print-preview', 3, array($this, 'imprimir_clicked'));
     // grid
     $this->pack_start($this->grid = new TGridEndFornecedores($this));
     // info fornecedor
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($label = new GtkLabel(), false);
     $label->set_markup('<b> Cod. Fornecedor: </b>' . $CodFor);
     $hbox->pack_start($label = new GtkLabel());
     $label->set_markup('<b>' . latin1(' Nome Fornecedor / Razão: ') . '</b>' . $NomeFor);
     $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_end_fornecedor'));
     $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_end_fornecedor'));
     $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_end_fornecedor'));
     $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_end_fornecedor'));
 }
Пример #8
0
 function __construct($CodTrans, $NomeTrans)
 {
     $this->CodTrans = $CodTrans;
     parent::__construct(latin1('Endereços da Transportadora'), 'enderecos.png');
     // toolbar
     $this->pack_start($toolbar = new TToolbar(), false);
     $this->incluir = $toolbar->append_stock('gtk-add', 0, array($this, 'incluir_clicked'));
     $this->alterar = $toolbar->append_stock('gtk-edit', 1, array($this, 'alterar_clicked'));
     $this->excluir = $toolbar->append_stock('gtk-delete', 2, array($this, 'excluir_clicked'));
     $this->imprimir = $toolbar->append_stock('gtk-print-preview', 3, array($this, 'imprimir_clicked'));
     // grid
     $this->pack_start($this->grid = new TGridEndTransportadoras($this));
     // info transportadora
     $this->pack_start($hbox = new GtkHBox(), false);
     $hbox->pack_start($label = new GtkLabel(), false);
     $label->set_markup('<b> Cod. Transp.: </b>' . $CodTrans);
     $hbox->pack_start($label = new GtkLabel());
     $label->set_markup('<b> Transportadora </b>' . $NomeTrans);
     $this->incluir->set_sensitive(CheckPermissao($this, 'incluir_end_transportadora'));
     $this->alterar->set_sensitive(CheckPermissao($this, 'alterar_end_transportadora'));
     $this->excluir->set_sensitive(CheckPermissao($this, 'excluir_end_transportadora'));
     $this->imprimir->set_sensitive(CheckPermissao($this, 'imprimir_end_transportadora'));
 }