'ecmworkcosts', 'audited' => true, 'fields' => array( 'date' => array( 'name' => 'date', 'vname' => 'Miesiąc', 'type' => 'date', 'reportable' => false, 'showFormats' => true, 'massupdate' => false, 'required' => false, ), 'worker_id' => array( 'name' => 'worker_id', 'rname' => 'name', 'type' => 'id', 'module' => 'EcmWorkers', 'vname' => 'LBL_WORKER_ID', 'group' => 'worker_name', 'massupdate' => false, 'reportable' => false, 'required' => true, ), 'worker_name' => array( 'name' => 'worker_name', 'rname' => 'name', 'id_name' => 'worker_id', 'vname' => 'LBL_WORKER_NAME', 'type' => 'relate', 'group' => 'worker_name', 'dbtype' => 'varchar', 'len' => '255', //'source'=>'non-db', 'module' => 'EcmWorkers', 'massupdate' => false, 'required' => true, ), 'price' => array( 'name' => 'price', 'dbtype' => 'decimal', 'label'=>'Ilość', 'len' => '14,2', 'required' => false, ), 'ecmprivatedocuments' => array( 'name' => 'ecmprivatedocuments', 'type' => 'link', 'relationship' => 'ecmworkcosts_ecmprivatedocuments', 'source' => 'non-db', 'vname' => 'LBL_ECMPRIVATEDOCUMENTS', ), ), 'relationships' => array( 'ecmworkcosts_ecmprivatedocuments' => array( 'lhs_module' => 'EcmWorkCosts', 'lhs_table' => 'ecmworkcosts', 'lhs_key' => 'id', 'rhs_module' => 'EcmPrivateDocuments', 'rhs_table' => 'ecmprivatedocuments', 'rhs_key' => 'parent_id', 'relationship_type' => 'one-to-many', //'relationship_role_column' => 'parent_type', //'relationship_role_column_value' => 'EcmPrivateDocuments', ), ), 'optimistic_locking' => true, ); if (!class_exists('VardefManager')) { require_once('include/SugarObjects/VardefManager.php'); } VardefManager::createVardef('EcmWorkCosts', 'EcmWorkCost', array('default'));