How to make my changes as module?

Hi!

I have created an override function for the contacts sub panel which in the Accounts Detail view page. And I want to make this as a simple module , How can I do that?

Below is my overriding function


$layout_defs["Accounts"]["subpanel_setup"]["contacts"]["top_buttons"] = array(
    array(
        'widget_class' => 'SubPanelTopCreateButton',
    ),
    array(
        'widget_class' => 'SubPanelTopSelectButton',
        'mode' => 'MultiSelect',
    ),
);

I tried all the way to make it , but i could not make it, Can any one please make this as a module and explain me how to do this?

Hi Nadil,

before getting into the solution, can you explain what the purpose of this modification is?

Looks like he has removed the quick create option so when you click create on the contacts subpanel you go straight to full form. I dont understand how this can be a module though?

Do you mean you want to create an installer for it?

If so look here: http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.6/API/Application/Module_Loader/Package_Examples/Creating_an_Installable_Package_That_Copies_Files/

Hi,

  • save the file you quoted above with the name “contacts_subpanel_full_form.php”, make sure you start with a “<?php” tag

  • create a file “manifest.php” in the same folder with the following contents:


<?php
$manifest = array(
		'acceptable_sugar_versions' => array (),
		'acceptable_sugar_flavors' => array(),
		'name' => 'Contacts Subpanel Full Form',
		'description' => 'Opens Full Form for contacts when creating a new Contact in Accounts',
		'author' => '',
		'published_date' => '',
		'version' => '1.00',
		'type' => 'module',
		'icon' => '',
		'is_uninstallable' => 'Yes',
		);

$installdefs = array(
		'id'=> 'contacts_subpanel_full_form',
		'layoutdefs' => array(
				array(
					'from'=> '<basepath>/contacts_subpanel_full_form.php',
					'to_module'=> 'Accounts'
			     		),
				),
		);
  • Compress both files to a zip file to create your installable module