"; foreach($values as $value){ $checked = in_array($value, $selected)? " checked=checked ": " "; echo "
"; print_r($value); echo ""; } function display(){ $do = !empty($_REQUEST['do'])?$_REQUEST['do']:''; echo ""; echo <<
Vardefs are where we define information about the fields for a module. It also specifies 75% of the information on relationships. There are also special attributes that can enable additional functionality for a module. It's broken down into: fields: The fields of a module (most of these are stored in the database) indices: The indicies on the database relationships: The relationships for this module templates: the functionality/fields this module inherits from SugarObjects(located in include/SugarObjects). In a vardef these are specified by the third argument in VardefManager::createVardef For Example - VardefManager::createVardef('Contacts','Contact', array('default', 'assignable','team_security','person')); would add the fields for team security to contacts and make it an object that can be assigned to users. The 'person' value would indicate that that Contacts subclasses Person and gains all the fields/attributes that 'Person' would get. Since person extends basic it would also gain all the fields/attributes of basic as well. The SugarObjects that a module can extend are 'basic', 'company', 'file', 'issue', 'person'. These are the same objects you can build off of in ModuleBuilder. Adding a new SugarObject to include/SugarObjects/templates is the way to add modules to ModuleBuilder Besides extending base objects, a module can also implement functionality defined in SugarObjects. You can currenty implement 'assignable' and 'team_security'. attributes: [table] (string) (required) The database table where this module stores it's data - any custom fields will be stored in a new table with '_cstm' appended to the table name. The field id_c in the custom table will be the same value as id in the primary table allowing us to join the two tables together. [comment] (string) (optional) is a description of the module [unified_search] (bool)(optional) is global search (the search in the upper right corner on the screen) available for this module [unified_search_default_enabled] (bool)(optional) is this module available by default in global search [optimistic_locking] (bool) (optional) optimistic locking is the concept that on save if the record modifiy time (date_modified) is newer than the the modify time of the record when it was loaded to edit (this time is stored in the session). [favorites] (bool) (optional) should favorites be enabled for this module. Favorites are indicated by the stars next to a record on lists and deail views. It makes it easier for users to indicate what is important to them right now. It also allows them to filter by favorites. [duplicate_merge] (bool) (optional) is systematic merging allowed between records of this module or not. This option is available from the menu on list views. A user needs to select 2 records on the list view using the checkboxes, and then they can select merge from the actions menu. [audited] (bool) (optional) auditing allows for the tracking of any changes to specified fields. In order to enable auditing you need to enable it at both the module level and the field level. It will create an audit table for the module with the '_audit' appended to the table name. [custom_fields] (bool) (automatic) if the module has custom fields this will be set to true