Cloning users module

Discuss about Group-Office development here

Moderator: Developers

odesport
Posts: 7
Joined: Mon Dec 15, 2014 3:48 pm

Cloning users module

Postby odesport » Tue Dec 16, 2014 2:22 pm

Hello,

I need a user module for group administrators, where they can't modify or delete users. I can do this by commenting some files in the users module.

I've copied the "users" folder to "userslight" folder in modules/ and modified files but I can't see the new one in the Apps list.

In MainPanel.js :

Code: Select all

GO.moduleManager.addModule('userslight', GO.userslight.MainPanel, {
   title : "Utilisateurs light",
   iconCls : 'go-tab-icon-users',
   admin :true
});



Why should I do more ?

Thanks.
odesport

Posts: 1
Joined: Mon Dec 15, 2014 3:48 pm
odesport
Posts: 7
Joined: Mon Dec 15, 2014 3:48 pm

Re: Cloning users module

Postby odesport » Wed Dec 17, 2014 8:21 am

I've tried to make a very simple module named "toto" with 3 files (like presidents module) and it doesn't appear in the Apps list. I'm using the last community edition. What should I do to see new modules ?

totoModule.php

Code: Select all

class GO_Toto_TotoModule extends GO_Base_Module{
   
   public function autoInstall() {
      return true;
   }
   
   public function author() {
      return 'toto';
   }
   
   public function authorEmail() {
      return 'toto@mysite.com';
   }
}


MainPanel.js

Code: Select all

// Creates namespaces to be used for scoping variables and classes so that they are not global.
Ext.namespace('GO.toto');

/*
 * This is the constructor of our MainPanel
 */
GO.toto.MainPanel = function(config){

   if(!config)
   {
      config = {};
   }

   config.html='Hello World';
   
   /*
    * Explicitly call the superclass constructor
    */
    GO.toto.MainPanel.superclass.constructor.call(this, config);

}

/*
 * Extend our MainPanel from the ExtJS Panel
 */
Ext.extend(GO.toto.MainPanel, Ext.Panel,{

});

/*
 * This will add the module to the main tab-panel filled with all the modules
 */
GO.moduleManager.addModule(
   'toto', //Module alias
   GO.toto.MainPanel, //The main panel for this module
   {
      title : 'toto', //Module name in start-menu
      iconCls : 'go-module-icon-presidents' //The css class with icon for start-menu
   }
);


sripts.txt

Code: Select all

modules/toto/views/Extjs3/MainPanel.js
odesport
Posts: 7
Joined: Mon Dec 15, 2014 3:48 pm

Re: Cloning users module

Postby odesport » Wed Dec 17, 2014 10:08 am

I've renamed totoModule.php in TotoModule.php and now This error occurs :

JsonStore load exception occurred


Nothing appears in debug.log and error.log
odesport
Posts: 7
Joined: Mon Dec 15, 2014 3:48 pm

Re: Cloning users module

Postby odesport » Wed Dec 17, 2014 10:57 am

This error occured because script.txt wasn't in views/extjs3 folder. The error doesn't appear any more but My Toto module is not in the Apps list.
odesport
Posts: 7
Joined: Mon Dec 15, 2014 3:48 pm

Re: Cloning users module

Postby odesport » Wed Dec 17, 2014 11:45 am

I added

Code: Select all

public function package() {
    return self::PACKAGE_CUSTOM;
}


in TotoModule.js and the simple module appears in the list. I added the same lines in my cloned users module but it doesn't appear.
odesport
Posts: 7
Joined: Mon Dec 15, 2014 3:48 pm

Re: Cloning users module

Postby odesport » Wed Dec 17, 2014 2:08 pm

I had to modify language/<lang>.php and change $l['name'] and $l['description'].

I can see the module now.

Return to “Development Chats”

Who is online

Users browsing this forum: No registered users and 1 guest

cron