This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //custom/Extension/modules/Project/Ext/Vardefs/from_template_c.php | |
| $dictionary['Project']['fields']['from_template_c'] = array ( | |
| 'name' => 'from_template_c', | |
| 'vname' => 'LBL_FROM_TEMPLATE', | |
| 'function' => 'getProjectTemplates', | |
| 'type' => 'enum', | |
| 'len' => '100', | |
| 'comment' => 'The template that the project was created from.', | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //custom/Extension/application/Ext/Utils/getProjectTemplates.php | |
| function getProjectTemplates(){ | |
| static $projectTemplates = null; | |
| if(!$projectTemplates){ | |
| global $db; | |
| $query = "SELECT id, name FROM project where deleted = 0 and is_template = 1 order by name asc "; | |
| $result = $db->query($query, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); | |
| //custom/modules/Cases/SOCustomCase.php | |
| require_once("modules/Cases/Case.php"); | |
| class SOCustomCase extends aCase { | |
| function get_list_view_data(){ | |
| $temp_array = parent::get_list_view_data(); //let it work as it does by default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); | |
| //custom/modules/Cases/controller.php | |
| require_once('include/MVC/Controller/SugarController.php'); | |
| require_once('custom/modules/Cases/SOCustomCase.php'); | |
| class CustomCasesController extends SugarController { | |
| function action_listview() { | |
| $this->bean = new SOCustomCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // /extensions/application/utils/contract_products_utils.php | |
| function getProducts(){ | |
| static $products = null; | |
| if(!$products){ | |
| global $db; | |
| $query = "SELECT id, name FROM products where deleted = 0 order by name asc "; | |
| $result = $db->query($query, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // /extensions/modules/Contracts/vardefs/product_dropdown_vardefs.php | |
| $dictionary['Contract']['fields']['product_c'] = array ( | |
| 'name' => 'product_c', | |
| 'vname' => 'LBL_PRODUCT', | |
| 'function' => 'getProducts', | |
| 'type' => 'enum', | |
| 'len' => '100', | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //manifest.php | |
| //............... | |
| 'vardefs' => | |
| array ( | |
| //copies to custom/Extension/modules/Contracts/Ext/Vardefs | |
| array ( | |
| 'from' => '<basepath>/extensions/modules/Contracts/vardefs/product_dropdown_vardefs.php', | |
| 'to_module' => 'Contracts', | |
| ), | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form name="ConfigureSettings" id="EditView" method="POST" > | |
| <input type="hidden" name="module" value="abc_Module"> | |
| <input type="hidden" name="action" value=”SaveConfig”> | |
| API URL: <input type=”text” name=”api_url” value=”” size=”35”/><br/> | |
| <input type='submit' value='Save Configuration' /> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_once('modules/Administration/Administration.php'); | |
| $administration = new Administration(); | |
| //do data validation, etc here | |
| //.... | |
| //save the setting to the config table | |
| $administration->saveSetting("abc_Module", "api_url", $_REQUEST['api_url']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_once('modules/Administration/Administration.php'); | |
| $administration = new Administration(); | |
| $administration->retrieveSettings(); | |
| $api_url = $administration->settings['abc_Module_api_url']; |