Jump to content


Photo

Customizing Zurmo

customize module zurmozoo

  • Please log in to reply
9 replies to this topic

#1 Turhan

Turhan

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 02 August 2012 - 08:43 AM

Hi there,

Being curious about your work (which looks very promising:), I have started investigating how this works and especially how to use zurmo as a basement to add new modules... As you said somewhere on the website : The purely open source nature of our application is free of technical roadblocks and encourages developers to build meaningful customizations...

So I have started reading http://zurmo.org/wik...stomizing-zurmo which shows how to customize zurmo.
I have zurmo already installed locally on my linux machine so what I wanted to do is to take relevant files from the zuromzoo repo and pick up only the required folders (protected/extensions/zurmozoo/, protected/modules/animals/ & protected/config/perInstanceConfig.php ) and drag them to my existing zurmo environment.

The 'animals' modules does not appear on the menu, but when I go to 'designer', I can see the 'Animals' module and I can even configure it.
So it is strange that the module is there but does not appear on the menu...

So I tried to manually launch the default controller of the 'Animals' module => http://localhost/zur...animals/default
But I get the following message => SQLSTATE[42S02]: Base table or view not found: 1146 Table 'zurmo.animal' doesn't exist

So I have 3 questions in mind regarding what happened:

#1 Picking-up just these files and adding them to my existing zurmo environment, is it the correct way to do ?

#2 I want to be able to have my custom module in a seperate own repository so I can just plug it in my zurmo environment in order to not pollute it and make zurmo update easily. Is this possible and how to do it ?

#3 When adding a module, what is the process of creating tables from models ? Is this automatic or is there any CLI to execute ?

Thank you for your help

Attached Thumbnails

  • ZurmoCRM - Oh no.png


#2 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 02 August 2012 - 09:05 AM

#1.
After you copied files, use the command line tool to run updateSchema by doing from the commands folder(app/protected/commands):
zurmoc updateSchema super

Clear content inside app/assets and app/protected/runtime folders.
Clear cache, by appending query to url '?clearCahe=1' to url, after you are logged in.
After those actions you should see new module in menu.

#2. Instead keeping just separate module into repository, I suggest you to keep whole your project is this repository. Mercurial allow merging between repositories, so you will be able to update your repository with recent code from Zurmo repository.

#3 You must run updateSchema command like I explained in step one.

#3 Turhan

Turhan

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 02 August 2012 - 09:19 AM

Hi Ivica,

Thank you for your prompt reply.
I will look further into item #2 to see how this works :)

Regarding your responses on item #1 et #3, now it works, I can use the 'Animals' module by launching the defaultController of the Animals module http://localhost/zur...nimals/default/
This allows me to CRUD on Animals. This is great :)

Would it be possible to have some pointers on how to add the 'Animals' module on the main menu inside the zurmo home page and also to make appear 'animal' inside the top right 'create' button ? This would be very nice.

Thanks again for your help

#4 jimf

jimf

    Advanced Member

  • Members
  • PipPipPip
  • 64 posts

Posted 02 August 2012 - 09:43 AM

I'd like to put in a vote for some more of these "customizing zurmo' intros. When someone want to create their first Zurmo Module, it seems like we'd want to have a 'Hello World' application so they can get something done easily. What if someone simply wants to change the logo, a menu item, or a default sort order. The Animals demo has over 15 files since it hitting nearly every function. If I'm building from scratch, I'd like to know:

1. What minimum files are required to customize zurmo.
2. What changes need to be made to Zurmo to activate the new module (configuration, persistance, etc)
3. What's the best upgrade safe / way todo things.
4. How do I easily change the metadata?
5. Document the clearCache=1 / resolveCustomData=1 command line flags
6. When will I need to use the Zurmoc UpdateSchema Super command?

It would be great when we have a dozen examples of different customizations, but it would also be good to have one quickly that is a very basic to complement the Zurmo Zoo.
Also the ZurmoZoo is done for a pretty old build that requires you do download an older copy of Yii, it would proably make sense to update the Zoo to the new UI and Yii for new developers that download and install it to learn Zurmo.

Jim

#5 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 02 August 2012 - 09:46 AM

Hi Ivica,

Thank you for your prompt reply.
I will look further into item #2 to see how this works :)

Regarding your responses on item #1 et #3, now it works, I can use the 'Animals' module by launching the defaultController of the Animals module http://localhost/zur...nimals/default/
This allows me to CRUD on Animals. This is great :)

Would it be possible to have some pointers on how to add the 'Animals' module on the main menu inside the zurmo home page and also to make appear 'animal' inside the top right 'create' button ? This would be very nice.

Thanks again for your help



I think this wiki article should help:
http://zurmo.org/wik...global-metadata

#6 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 02 August 2012 - 09:53 AM

I'd like to put in a vote for some more of these "customizing zurmo' intros. When someone want to create their first Zurmo Module, it seems like we'd want to have a 'Hello World' application so they can get something done easily. What if someone simply wants to change the logo, a menu item, or a default sort order. The Animals demo has over 15 files since it hitting nearly every function. If I'm building from scratch, I'd like to know:

1. What minimum files are required to customize zurmo.
2. What changes need to be made to Zurmo to activate the new module (configuration, persistance, etc)
3. What's the best upgrade safe / way todo things.
4. How do I easily change the metadata?
5. Document the clearCache=1 / resolveCustomData=1 command line flags
6. When will I need to use the Zurmoc UpdateSchema Super command?

It would be great when we have a dozen examples of different customizations, but it would also be good to have one quickly that is a very basic to complement the Zurmo Zoo.
Also the ZurmoZoo is done for a pretty old build that requires you do download an older copy of Yii, it would proably make sense to update the Zoo to the new UI and Yii for new developers that download and install it to learn Zurmo.

Jim

Good ideas Jim. We have most of those items covered in many different wikis, maybe we should make one that would summarize all those topics into one, with links to more detailed articles.
We updated ZurmoZoo about one month ago to use new Zurmo UI.

#7 Turhan

Turhan

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 02 August 2012 - 02:23 PM



I think this wiki article should help:
http://zurmo.org/wik...global-metadata




The Animals metadata already contains what is necessary to be displayed on Menu, but in some how, it is not displayed in the menu...

public static function getDefaultMetadata()
	    {
		    $metadata = array();
		    $metadata['global'] = array(
			    'tabMenuItems' => array(
				    array(
					    'label' => 'AnimalsModulePluralLabel',
					    'url'   => array('/animals/default'),
					    'right' => self::RIGHT_ACCESS_ANIMALS,
					    'items' => array(
						    array(
							    'label' => 'Create AnimalsModuleSingularLabel',
							    'url'   => array('/animals/default/create'),
							    'right' => self::RIGHT_CREATE_ANIMALS
						    ),
						    array(
							    'label' => 'AnimalsModulePluralLabel',
							    'url'   => array('/animals/default'),
							    'right' => self::RIGHT_ACCESS_ANIMALS
						    ),
					    ),
				    ),
			    ),
			    'designerMenuItems' => array(
				    'showFieldsLink' => true,
				    'showGeneralLink' => true,
				    'showLayoutsLink' => true,
				    'showMenusLink' => true,
			    ),
			    'globalSearchAttributeNames' => array(
				    'name'
			    )
		    );
		    return $metadata;
	    }

any clue why it isn't displayed on the zurmo menu ?
Thank you

#8 Ivica

Ivica

    Advanced Member

  • Moderators
  • 565 posts

Posted 03 August 2012 - 05:01 AM




The Animals metadata already contains what is necessary to be displayed on Menu, but in some how, it is not displayed in the menu...

public static function getDefaultMetadata()
		{
			$metadata = array();
			$metadata['global'] = array(
				'tabMenuItems' => array(
					array(
						'label' => 'AnimalsModulePluralLabel',
						'url'   => array('/animals/default'),
						'right' => self::RIGHT_ACCESS_ANIMALS,
						'items' => array(
							array(
								'label' => 'Create AnimalsModuleSingularLabel',
								'url'   => array('/animals/default/create'),
								'right' => self::RIGHT_CREATE_ANIMALS
							),
							array(
								'label' => 'AnimalsModulePluralLabel',
								'url'   => array('/animals/default'),
								'right' => self::RIGHT_ACCESS_ANIMALS
							),
						),
					),
				),
				'designerMenuItems' => array(
					'showFieldsLink' => true,
					'showGeneralLink' => true,
					'showLayoutsLink' => true,
					'showMenusLink' => true,
				),
				'globalSearchAttributeNames' => array(
					'name'
				)
			);
			return $metadata;
		}

any clue why it isn't displayed on the zurmo menu ?
Thank you

After you login into CRM, add '?resolveCustomData=1' to URL, and it should help. Eventually, you might need to clear system cache(by appending '?clearCache=1' to URL).
Here are some resources that might help you to better understand what is going on:
http://zurmo.org/for...obal-meta-data/
http://zurmo.org/wik...global-metadata

#9 Turhan

Turhan

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts

Posted 03 August 2012 - 09:32 AM

Thank you, that works :)

#10 LissaCoffey

LissaCoffey

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 17 October 2013 - 07:40 AM

You can try to copy just those files that are modified, and you will need to upgrade schema(so new tables will be created), clear cache and it should work, but we haven't test it, and that is why I suggest to clone and install new application from zurmozoo repository.







Also tagged with one or more of these keywords: customize, module, zurmozoo

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users