Welcome Guest, Not a member yet? Register   Sign In
BackendPro 0.6.1

[eluser]ReyPM[/eluser]
Hi:
It's possible to build my administration on top of BackendPro? I have a few tables that need to be administrated by someone in the system. As far as I understood BackendPro just only take care about Users, Permissions and so on in others words ACL ç, I'm right? If so then how to achieve this? Can any help me with this part?
Cheers and thanks in advance

[eluser]adamp1[/eluser]
@ReyPM: Yes of course you can do this, just add your own controller let it inherit from Admin_Controller. Then create a new menu item in the backendpro to go to your new controller.

Its just a normal CI application the only difference is it has some features done for you by default. Open an exiting administration controller and have a look how it works (i.e. calls its views) then just apply that to your own.

[eluser]ReyPM[/eluser]
Ok, good. Now after get installed BackendPro I did't know where the things goes. For example images, styles and so on are lost so I need to change something in somewhere but "where"? I check the User Guide at your site but didn't find something usefull.

[eluser]adamp1[/eluser]
what do you mean lost. The current BackendPro files can't find them? Is the site displaying but without the images/css?

What dir structure have your installed BackendPro to? Have you moved the assets folder from its original level? Have you turned asset caching off?

[eluser]ReyPM[/eluser]
[quote author="adamp1" date="1289951182"]what do you mean lost. The current BackendPro files can't find them? Is the site displaying but without the images/css?[/quote]

The site is displaying but without images/css and I don´t know why Sad

[quote author="adamp1" date="1289951182"]What dir structure have your installed BackendPro to? Have you moved the assets folder from its original level? Have you turned asset caching off?[/quote]
Well I just unzip the file and copy in empy directory without any CI previous installation. The Guide doesn't tell how to install it step by step or I miss something

[eluser]ReyPM[/eluser]
Well after some headaches I have BeP installed and working ;-) so now I'm trying to integrate my system with BeP but some parts are not clear yet to me. I will explain what I'm doing and what errors appear to me.

First and following Matchbox approach I create a module called "clientes" inside /modules folder and then I create the directory structure like this one:
Quote: - modules
- clientes
- controllers
- model
- view

After that I create a file under controllers dir and called it clientes.php. I get the code from /modules/auth/controllers and try to change to achieve my goals. The code at this moment is very simple, just trying to understand how BeP works, and it's:
Code:
class Clientes extends Admin_Controller {

  function Clientes() {
    parent::Admin_Controller();
    $this->load->helper('form');
    // Set breadcrumb
    $this->bep_site->set_crumb($this->lang->line('backendpro_cientes'), 'clientes');
    // Check for access permission
    check('Clientes');
    // Load the validation library
    $this->load->library('validation');
    log_message('debug', 'BackendPro : Clientes class loaded');
  }

  function index() {
    // Get Client Infomation
    $data['clients'] = $this->clientes_model->getClientes();

    // Display Page
    $data['header'] = $this->lang->line('backendpro_cientes');
    $data['page'] = $this->config->item('backendpro_template_admin') . "clientes/view";
    $data['module'] = 'clientes';
    $this->load->view($this->_container, $data);
  }
}
I create a model file (/modules/clientes/model/clientes_model.php) too based on model from auth (/modules/auth/model/user_model.php) and contains this code:
Code:
class Clientes_model extends Base_model {

  function Clientes_model() {
    parent::Base_model();

    $this->_prefix = $this->config->item('backendpro_system_table_prefix');
    $this->_TABLES = array('Clientes' => $this->_prefix . 'clientes');

    $this->pagination_enabled = FALSE;
    $this->pagination_per_page = 10;
    $this->pagination_num_links = 5;
    $this->pager = '';

    log_message('debug', 'BackendPro : Clientes_model class loaded');
  }

  function getClientes($where = NULL, $limit = array('limit' => NULL, 'offset' => '')) {
    // Load the khacl config file so we can get the correct table name
    $this->load->config('khaos', true, true);
    $options = $this->config->item('acl', 'khaos');
    $acl_tables = $options['tables'];

    $this->db->select('clientes.id, clientes.nombre, clientes.correo, clientes.fecha_ingreso, clientes.responsable, clientes.direccion, clientes.telefono, clientes.movil, clientes.id_tipo, clientes.id_modalidades, groups.name `group`, groups.id group_id' . $profile_columns);
    $this->db->from($this->_TABLES['Clientes'] . " clientes");
    $this->db->join($this->_TABLES['Tipos'] . " tipo", 'clientes.id_tipo=tipo.id');
    $this->db->join($this->_TABLES['Modalidades'] . " modl", 'clientes.id_tipo=modl.id');
    $this->db->join($acl_tables['aros'] . " groups", 'groups.id=users.group');
    if (!is_null($where)) {
      $this->db->where($where);
    }
    if (!is_null($limit['limit'])) {
      $this->db->limit($limit['limit'], ( isset($limit['offset']) ? $limit['offset'] : ''));
    }
    return $this->db->get();
  }

}
Also I create a view file under /modules/clientes/view and called it view.php (I think called by default when no view file is specified).

When I call the method from Cliente class I get this errors:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: Clientes::$clientes_model
Filename: controllers/clientes.php
Line Number: 48

Fatal error: Call to a member function getClientes() on a non-object in D:\Webserver\htdocs\sisges\modules\clientes\controllers\clientes.php on line 48

Wich I don't know how to fix :down:

Also I have a little question regarding the query in auth model: why the selection from groups? Have something to see with ACL or is something else and I don't get it?

Cheers, thanks in advance and sorry for my bad english

[eluser]desgraci[/eluser]
[quote author="desgraci" date="1289941966"]again, one more problem...

Warning: Call-time pass-by-reference has been deprecated in /home/content/v/i/r/virtualtec/html/virtual/proyectos/rafa/install/RUN.php on line 97

Warning: Call-time pass-by-reference has been deprecated in /home/content/v/i/r/virtualtec/html/virtual/proyectos/rafa/install/RUN.php on line 98
BackendPro Install was Unsuccessful

FileSystem Check
Setup FileSystem
Create new system config file - 1
Create new database config file
Create new ReCAPTCHA config file
Setup Database
Connect to database
Update table schema
Create administrator user account
An error has occured during the installation of BackendPro. Please check the details above to fix the problem before trying to install again. A log file has been created which more in depth details about what went wrong.


INFO - 2010-11-16 08:11:24 --> Base path set to: /var/chroot/home/content/v/i/r/virtualtec/html/proyectos/rafa/
INFO - 2010-11-16 08:11:24 --> Base dir set to: /proyectos/rafa/
INFO - 2010-11-16 08:11:24 --> System path set to: /var/chroot/home/content/v/i/r/virtualtec/html/proyectos/rafa/system/
INFO - 2010-11-16 08:11:24 --> Application path set to: /var/chroot/home/content/v/i/r/virtualtec/html/proyectos/rafa/system/application/
INFO - 2010-11-16 08:11:24 --> Modules path set to: /var/chroot/home/content/v/i/r/virtualtec/html/proyectos/rafa/modules/
INFO - 2010-11-16 08:11:24 --> Logs path set to: /var/chroot/home/content/v/i/r/virtualtec/html/proyectos/rafa/system/logs/
INFO - 2010-11-16 08:11:24 --> Cache path set to: /var/chroot/home/content/v/i/r/virtualtec/html/proyectos/rafa/system/cache/
INFO - 2010-11-16 08:11:24 --> New feature 'FileSystem Check' created
INFO - 2010-11-16 08:11:24 --> New feature 'Setup FileSystem' created
INFO - 2010-11-16 08:11:24 --> New feature 'Setup Database' created
INFO - 2010-11-16 08:11:24 --> Feature 'Setup FileSystem' now has prerequisite 'FileSystem Check'
INFO - 2010-11-16 08:11:24 --> Feature 'Setup Database' now has prerequisite 'Setup FileSystem'
INFO - 2010-11-16 08:11:24 --> Component 'Create new system config file' attached to feature 'Setup FileSystem'
INFO - 2010-11-16 08:11:24 --> Component 'Create new database config file' attached to feature 'Setup FileSystem'
INFO - 2010-11-16 08:11:24 --> Component 'Create new ReCAPTCHA config file' attached to feature 'Setup FileSystem'
INFO - 2010-11-16 08:11:24 --> Component 'Connect to database' attached to feature 'Setup Database'
INFO - 2010-11-16 08:11:24 --> Component 'Update table schema' attached to feature 'Setup Database'
INFO - 2010-11-16 08:11:24 --> Component 'Create administrator user account' attached to feature 'Setup Database'
INFO - 2010-11-16 08:11:24 --> FileSystem Check Feature installed
ERROR - 2010-11-16 08:11:24 --> Create new system config file Component install failed: 1
INFO - 2010-11-16 08:11:24 --> Attempting to roll back Components for 'Setup FileSystem' Feature
INFO - 2010-11-16 08:11:24 --> Setup Database Feature installation haulted since its prerequisite feature 'Setup FileSystem' failed to install[/quote]

Any answer?

[eluser]Jiaqi[/eluser]
Hey, ~

Yes, I have encountered with these issues.
It seems there is something not working with PHP 5.3.1

And I am not sure it's CI's bug ,or Backendpro's.

Helps~~ here is the error

Code:
PHP

A PHP Error was encountered

Severity: 8192

Message: Assigning the return value of new by reference is deprecated

Filename: libraries/Loader.php

Line Number: 414

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started
at D:/0_TOOLS/xampplite/htdocs/backendpro/system/application/libraries/Loader.php:414)

Filename: libraries/Session.php

Line Number: 662

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started
at D:/0_TOOLS/xampplite/htdocs/backendpro/system/application/libraries/Loader.php:414)

Filename: libraries/Session.php

Line Number: 662

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started
at D:/0_TOOLS/xampplite/htdocs/backendpro/system/application/libraries/Loader.php:414)

Filename: helpers/url_helper.php

Line Number: 541

[eluser]broswilli[/eluser]
BackendPro is a powerfull tool for creating the backend of an application i also appreciate the ability to create matchboxes so that my sites can be extended with modules i've not tested this functionality but when i do i intent creating a screencast on it. I encourage developers to use this tool

[eluser]adamp1[/eluser]
@ReyPM: This means you are trying to access a property on an object which is null. In this case it seems the client model hasn't been loaded. Also your file structure is wrong it should be
Code:
modules
  clientes
    controllers
    models
    views

@desgraci: Please read through my blog post on upgrading to php 5 http://www.kaydoo.co.uk/2010/04/patch-ba...with-php-5




Theme © iAndrew 2016 - Forum software by © MyBB