@@ -2,118 +2,118 @@ |
||
| 2 | 2 | $module_name = 'TemplateSectionLine'; |
| 3 | 3 | $searchdefs [$module_name] = |
| 4 | 4 | array ( |
| 5 | - 'layout' => |
|
| 6 | - array ( |
|
| 5 | + 'layout' => |
|
| 6 | + array ( |
|
| 7 | 7 | 'basic_search' => |
| 8 | 8 | array ( |
| 9 | - 'name' => |
|
| 10 | - array ( |
|
| 9 | + 'name' => |
|
| 10 | + array ( |
|
| 11 | 11 | 'name' => 'name', |
| 12 | 12 | 'default' => true, |
| 13 | 13 | 'width' => '10%', |
| 14 | - ), |
|
| 15 | - 'grp' => |
|
| 16 | - array ( |
|
| 14 | + ), |
|
| 15 | + 'grp' => |
|
| 16 | + array ( |
|
| 17 | 17 | 'type' => 'varchar', |
| 18 | 18 | 'label' => 'LBL_GRP', |
| 19 | 19 | 'width' => '10%', |
| 20 | 20 | 'default' => true, |
| 21 | 21 | 'name' => 'grp', |
| 22 | - ), |
|
| 23 | - 'description' => |
|
| 24 | - array ( |
|
| 22 | + ), |
|
| 23 | + 'description' => |
|
| 24 | + array ( |
|
| 25 | 25 | 'type' => 'text', |
| 26 | 26 | 'label' => 'LBL_DESCRIPTION', |
| 27 | 27 | 'sortable' => false, |
| 28 | 28 | 'width' => '10%', |
| 29 | 29 | 'default' => true, |
| 30 | 30 | 'name' => 'description', |
| 31 | - ), |
|
| 32 | - 'current_user_only' => |
|
| 33 | - array ( |
|
| 31 | + ), |
|
| 32 | + 'current_user_only' => |
|
| 33 | + array ( |
|
| 34 | 34 | 'name' => 'current_user_only', |
| 35 | 35 | 'label' => 'LBL_CURRENT_USER_FILTER', |
| 36 | 36 | 'type' => 'bool', |
| 37 | 37 | 'default' => true, |
| 38 | 38 | 'width' => '10%', |
| 39 | - ), |
|
| 40 | - 'assigned_user_id' => |
|
| 41 | - array ( |
|
| 39 | + ), |
|
| 40 | + 'assigned_user_id' => |
|
| 41 | + array ( |
|
| 42 | 42 | 'name' => 'assigned_user_id', |
| 43 | 43 | 'label' => 'LBL_ASSIGNED_TO', |
| 44 | 44 | 'type' => 'enum', |
| 45 | 45 | 'function' => |
| 46 | 46 | array ( |
| 47 | - 'name' => 'get_user_array', |
|
| 48 | - 'params' => |
|
| 49 | - array ( |
|
| 47 | + 'name' => 'get_user_array', |
|
| 48 | + 'params' => |
|
| 49 | + array ( |
|
| 50 | 50 | 0 => false, |
| 51 | - ), |
|
| 51 | + ), |
|
| 52 | 52 | ), |
| 53 | 53 | 'width' => '10%', |
| 54 | 54 | 'default' => true, |
| 55 | - ), |
|
| 55 | + ), |
|
| 56 | 56 | ), |
| 57 | 57 | 'advanced_search' => |
| 58 | 58 | array ( |
| 59 | - 'name' => |
|
| 60 | - array ( |
|
| 59 | + 'name' => |
|
| 60 | + array ( |
|
| 61 | 61 | 'name' => 'name', |
| 62 | 62 | 'default' => true, |
| 63 | 63 | 'width' => '10%', |
| 64 | - ), |
|
| 65 | - 'grp' => |
|
| 66 | - array ( |
|
| 64 | + ), |
|
| 65 | + 'grp' => |
|
| 66 | + array ( |
|
| 67 | 67 | 'type' => 'varchar', |
| 68 | 68 | 'label' => 'LBL_GRP', |
| 69 | 69 | 'width' => '10%', |
| 70 | 70 | 'default' => true, |
| 71 | 71 | 'name' => 'grp', |
| 72 | - ), |
|
| 73 | - 'description' => |
|
| 74 | - array ( |
|
| 72 | + ), |
|
| 73 | + 'description' => |
|
| 74 | + array ( |
|
| 75 | 75 | 'type' => 'text', |
| 76 | 76 | 'label' => 'LBL_DESCRIPTION', |
| 77 | 77 | 'sortable' => false, |
| 78 | 78 | 'width' => '10%', |
| 79 | 79 | 'default' => true, |
| 80 | 80 | 'name' => 'description', |
| 81 | - ), |
|
| 82 | - 'current_user_only' => |
|
| 83 | - array ( |
|
| 81 | + ), |
|
| 82 | + 'current_user_only' => |
|
| 83 | + array ( |
|
| 84 | 84 | 'label' => 'LBL_CURRENT_USER_FILTER', |
| 85 | 85 | 'type' => 'bool', |
| 86 | 86 | 'default' => true, |
| 87 | 87 | 'width' => '10%', |
| 88 | 88 | 'name' => 'current_user_only', |
| 89 | - ), |
|
| 90 | - 'assigned_user_id' => |
|
| 91 | - array ( |
|
| 89 | + ), |
|
| 90 | + 'assigned_user_id' => |
|
| 91 | + array ( |
|
| 92 | 92 | 'name' => 'assigned_user_id', |
| 93 | 93 | 'label' => 'LBL_ASSIGNED_TO', |
| 94 | 94 | 'type' => 'enum', |
| 95 | 95 | 'function' => |
| 96 | 96 | array ( |
| 97 | - 'name' => 'get_user_array', |
|
| 98 | - 'params' => |
|
| 99 | - array ( |
|
| 97 | + 'name' => 'get_user_array', |
|
| 98 | + 'params' => |
|
| 99 | + array ( |
|
| 100 | 100 | 0 => false, |
| 101 | - ), |
|
| 101 | + ), |
|
| 102 | 102 | ), |
| 103 | 103 | 'default' => true, |
| 104 | 104 | 'width' => '10%', |
| 105 | - ), |
|
| 105 | + ), |
|
| 106 | 106 | ), |
| 107 | - ), |
|
| 108 | - 'templateMeta' => |
|
| 109 | - array ( |
|
| 107 | + ), |
|
| 108 | + 'templateMeta' => |
|
| 109 | + array ( |
|
| 110 | 110 | 'maxColumns' => '3', |
| 111 | 111 | 'maxColumnsBasic' => '4', |
| 112 | 112 | 'widths' => |
| 113 | 113 | array ( |
| 114 | - 'label' => '10', |
|
| 115 | - 'field' => '30', |
|
| 114 | + 'label' => '10', |
|
| 115 | + 'field' => '30', |
|
| 116 | + ), |
|
| 116 | 117 | ), |
| 117 | - ), |
|
| 118 | 118 | ); |
| 119 | 119 | ?> |
@@ -1,19 +1,19 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | $module_name = 'TemplateSectionLine'; |
| 3 | 3 | $searchdefs [$module_name] = |
| 4 | -array ( |
|
| 4 | +array( |
|
| 5 | 5 | 'layout' => |
| 6 | - array ( |
|
| 6 | + array( |
|
| 7 | 7 | 'basic_search' => |
| 8 | - array ( |
|
| 8 | + array( |
|
| 9 | 9 | 'name' => |
| 10 | - array ( |
|
| 10 | + array( |
|
| 11 | 11 | 'name' => 'name', |
| 12 | 12 | 'default' => true, |
| 13 | 13 | 'width' => '10%', |
| 14 | 14 | ), |
| 15 | 15 | 'grp' => |
| 16 | - array ( |
|
| 16 | + array( |
|
| 17 | 17 | 'type' => 'varchar', |
| 18 | 18 | 'label' => 'LBL_GRP', |
| 19 | 19 | 'width' => '10%', |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | 'name' => 'grp', |
| 22 | 22 | ), |
| 23 | 23 | 'description' => |
| 24 | - array ( |
|
| 24 | + array( |
|
| 25 | 25 | 'type' => 'text', |
| 26 | 26 | 'label' => 'LBL_DESCRIPTION', |
| 27 | 27 | 'sortable' => false, |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | 'name' => 'description', |
| 31 | 31 | ), |
| 32 | 32 | 'current_user_only' => |
| 33 | - array ( |
|
| 33 | + array( |
|
| 34 | 34 | 'name' => 'current_user_only', |
| 35 | 35 | 'label' => 'LBL_CURRENT_USER_FILTER', |
| 36 | 36 | 'type' => 'bool', |
@@ -38,15 +38,15 @@ discard block |
||
| 38 | 38 | 'width' => '10%', |
| 39 | 39 | ), |
| 40 | 40 | 'assigned_user_id' => |
| 41 | - array ( |
|
| 41 | + array( |
|
| 42 | 42 | 'name' => 'assigned_user_id', |
| 43 | 43 | 'label' => 'LBL_ASSIGNED_TO', |
| 44 | 44 | 'type' => 'enum', |
| 45 | 45 | 'function' => |
| 46 | - array ( |
|
| 46 | + array( |
|
| 47 | 47 | 'name' => 'get_user_array', |
| 48 | 48 | 'params' => |
| 49 | - array ( |
|
| 49 | + array( |
|
| 50 | 50 | 0 => false, |
| 51 | 51 | ), |
| 52 | 52 | ), |
@@ -55,15 +55,15 @@ discard block |
||
| 55 | 55 | ), |
| 56 | 56 | ), |
| 57 | 57 | 'advanced_search' => |
| 58 | - array ( |
|
| 58 | + array( |
|
| 59 | 59 | 'name' => |
| 60 | - array ( |
|
| 60 | + array( |
|
| 61 | 61 | 'name' => 'name', |
| 62 | 62 | 'default' => true, |
| 63 | 63 | 'width' => '10%', |
| 64 | 64 | ), |
| 65 | 65 | 'grp' => |
| 66 | - array ( |
|
| 66 | + array( |
|
| 67 | 67 | 'type' => 'varchar', |
| 68 | 68 | 'label' => 'LBL_GRP', |
| 69 | 69 | 'width' => '10%', |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | 'name' => 'grp', |
| 72 | 72 | ), |
| 73 | 73 | 'description' => |
| 74 | - array ( |
|
| 74 | + array( |
|
| 75 | 75 | 'type' => 'text', |
| 76 | 76 | 'label' => 'LBL_DESCRIPTION', |
| 77 | 77 | 'sortable' => false, |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | 'name' => 'description', |
| 81 | 81 | ), |
| 82 | 82 | 'current_user_only' => |
| 83 | - array ( |
|
| 83 | + array( |
|
| 84 | 84 | 'label' => 'LBL_CURRENT_USER_FILTER', |
| 85 | 85 | 'type' => 'bool', |
| 86 | 86 | 'default' => true, |
@@ -88,15 +88,15 @@ discard block |
||
| 88 | 88 | 'name' => 'current_user_only', |
| 89 | 89 | ), |
| 90 | 90 | 'assigned_user_id' => |
| 91 | - array ( |
|
| 91 | + array( |
|
| 92 | 92 | 'name' => 'assigned_user_id', |
| 93 | 93 | 'label' => 'LBL_ASSIGNED_TO', |
| 94 | 94 | 'type' => 'enum', |
| 95 | 95 | 'function' => |
| 96 | - array ( |
|
| 96 | + array( |
|
| 97 | 97 | 'name' => 'get_user_array', |
| 98 | 98 | 'params' => |
| 99 | - array ( |
|
| 99 | + array( |
|
| 100 | 100 | 0 => false, |
| 101 | 101 | ), |
| 102 | 102 | ), |
@@ -106,11 +106,11 @@ discard block |
||
| 106 | 106 | ), |
| 107 | 107 | ), |
| 108 | 108 | 'templateMeta' => |
| 109 | - array ( |
|
| 109 | + array( |
|
| 110 | 110 | 'maxColumns' => '3', |
| 111 | 111 | 'maxColumnsBasic' => '4', |
| 112 | 112 | 'widths' => |
| 113 | - array ( |
|
| 113 | + array( |
|
| 114 | 114 | 'label' => '10', |
| 115 | 115 | 'field' => '30', |
| 116 | 116 | ), |
@@ -1,58 +1,58 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $module_name='TemplateSectionLine'; |
| 3 | 3 | $subpanel_layout = array ( |
| 4 | - 'top_buttons' => |
|
| 5 | - array ( |
|
| 4 | + 'top_buttons' => |
|
| 5 | + array ( |
|
| 6 | 6 | 0 => |
| 7 | 7 | array ( |
| 8 | - 'widget_class' => 'SubPanelTopCreateButton', |
|
| 8 | + 'widget_class' => 'SubPanelTopCreateButton', |
|
| 9 | 9 | ), |
| 10 | 10 | 1 => |
| 11 | 11 | array ( |
| 12 | - 'widget_class' => 'SubPanelTopSelectButton', |
|
| 13 | - 'popup_module' => 'TemplateSectionLine', |
|
| 12 | + 'widget_class' => 'SubPanelTopSelectButton', |
|
| 13 | + 'popup_module' => 'TemplateSectionLine', |
|
| 14 | + ), |
|
| 14 | 15 | ), |
| 15 | - ), |
|
| 16 | - 'where' => '', |
|
| 17 | - 'list_fields' => |
|
| 18 | - array ( |
|
| 16 | + 'where' => '', |
|
| 17 | + 'list_fields' => |
|
| 18 | + array ( |
|
| 19 | 19 | 'grp' => |
| 20 | 20 | array ( |
| 21 | - 'type' => 'varchar', |
|
| 22 | - 'vname' => 'LBL_GRP', |
|
| 23 | - 'width' => '10%', |
|
| 24 | - 'default' => true, |
|
| 21 | + 'type' => 'varchar', |
|
| 22 | + 'vname' => 'LBL_GRP', |
|
| 23 | + 'width' => '10%', |
|
| 24 | + 'default' => true, |
|
| 25 | 25 | ), |
| 26 | 26 | 'name' => |
| 27 | 27 | array ( |
| 28 | - 'vname' => 'LBL_NAME', |
|
| 29 | - 'widget_class' => 'SubPanelDetailViewLink', |
|
| 30 | - 'width' => '45%', |
|
| 31 | - 'default' => true, |
|
| 28 | + 'vname' => 'LBL_NAME', |
|
| 29 | + 'widget_class' => 'SubPanelDetailViewLink', |
|
| 30 | + 'width' => '45%', |
|
| 31 | + 'default' => true, |
|
| 32 | 32 | ), |
| 33 | 33 | 'description' => |
| 34 | 34 | array ( |
| 35 | - 'type' => 'text', |
|
| 36 | - 'vname' => 'LBL_DESCRIPTION', |
|
| 37 | - 'sortable' => false, |
|
| 38 | - 'width' => '10%', |
|
| 39 | - 'default' => true, |
|
| 35 | + 'type' => 'text', |
|
| 36 | + 'vname' => 'LBL_DESCRIPTION', |
|
| 37 | + 'sortable' => false, |
|
| 38 | + 'width' => '10%', |
|
| 39 | + 'default' => true, |
|
| 40 | 40 | ), |
| 41 | 41 | 'edit_button' => |
| 42 | 42 | array ( |
| 43 | - 'vname' => 'LBL_EDIT_BUTTON', |
|
| 44 | - 'widget_class' => 'SubPanelEditButton', |
|
| 45 | - 'module' => 'TemplateSectionLine', |
|
| 46 | - 'width' => '4%', |
|
| 47 | - 'default' => true, |
|
| 43 | + 'vname' => 'LBL_EDIT_BUTTON', |
|
| 44 | + 'widget_class' => 'SubPanelEditButton', |
|
| 45 | + 'module' => 'TemplateSectionLine', |
|
| 46 | + 'width' => '4%', |
|
| 47 | + 'default' => true, |
|
| 48 | 48 | ), |
| 49 | 49 | 'remove_button' => |
| 50 | 50 | array ( |
| 51 | - 'vname' => 'LBL_REMOVE', |
|
| 52 | - 'widget_class' => 'SubPanelRemoveButton', |
|
| 53 | - 'module' => 'TemplateSectionLine', |
|
| 54 | - 'width' => '5%', |
|
| 55 | - 'default' => true, |
|
| 51 | + 'vname' => 'LBL_REMOVE', |
|
| 52 | + 'widget_class' => 'SubPanelRemoveButton', |
|
| 53 | + 'module' => 'TemplateSectionLine', |
|
| 54 | + 'width' => '5%', |
|
| 55 | + 'default' => true, |
|
| 56 | + ), |
|
| 56 | 57 | ), |
| 57 | - ), |
|
| 58 | 58 | ); |
| 59 | 59 | \ No newline at end of file |
@@ -1,37 +1,37 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -$module_name='TemplateSectionLine'; |
|
| 3 | -$subpanel_layout = array ( |
|
| 2 | +$module_name = 'TemplateSectionLine'; |
|
| 3 | +$subpanel_layout = array( |
|
| 4 | 4 | 'top_buttons' => |
| 5 | - array ( |
|
| 5 | + array( |
|
| 6 | 6 | 0 => |
| 7 | - array ( |
|
| 7 | + array( |
|
| 8 | 8 | 'widget_class' => 'SubPanelTopCreateButton', |
| 9 | 9 | ), |
| 10 | 10 | 1 => |
| 11 | - array ( |
|
| 11 | + array( |
|
| 12 | 12 | 'widget_class' => 'SubPanelTopSelectButton', |
| 13 | 13 | 'popup_module' => 'TemplateSectionLine', |
| 14 | 14 | ), |
| 15 | 15 | ), |
| 16 | 16 | 'where' => '', |
| 17 | 17 | 'list_fields' => |
| 18 | - array ( |
|
| 18 | + array( |
|
| 19 | 19 | 'grp' => |
| 20 | - array ( |
|
| 20 | + array( |
|
| 21 | 21 | 'type' => 'varchar', |
| 22 | 22 | 'vname' => 'LBL_GRP', |
| 23 | 23 | 'width' => '10%', |
| 24 | 24 | 'default' => true, |
| 25 | 25 | ), |
| 26 | 26 | 'name' => |
| 27 | - array ( |
|
| 27 | + array( |
|
| 28 | 28 | 'vname' => 'LBL_NAME', |
| 29 | 29 | 'widget_class' => 'SubPanelDetailViewLink', |
| 30 | 30 | 'width' => '45%', |
| 31 | 31 | 'default' => true, |
| 32 | 32 | ), |
| 33 | 33 | 'description' => |
| 34 | - array ( |
|
| 34 | + array( |
|
| 35 | 35 | 'type' => 'text', |
| 36 | 36 | 'vname' => 'LBL_DESCRIPTION', |
| 37 | 37 | 'sortable' => false, |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | 'default' => true, |
| 40 | 40 | ), |
| 41 | 41 | 'edit_button' => |
| 42 | - array ( |
|
| 42 | + array( |
|
| 43 | 43 | 'vname' => 'LBL_EDIT_BUTTON', |
| 44 | 44 | 'widget_class' => 'SubPanelEditButton', |
| 45 | 45 | 'module' => 'TemplateSectionLine', |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | 'default' => true, |
| 48 | 48 | ), |
| 49 | 49 | 'remove_button' => |
| 50 | - array ( |
|
| 50 | + array( |
|
| 51 | 51 | 'vname' => 'LBL_REMOVE', |
| 52 | 52 | 'widget_class' => 'SubPanelRemoveButton', |
| 53 | 53 | 'module' => 'TemplateSectionLine', |
@@ -45,40 +45,40 @@ |
||
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | class TemplateSectionLine_sugar extends Basic { |
| 48 | - var $new_schema = true; |
|
| 49 | - var $module_dir = 'TemplateSectionLine'; |
|
| 50 | - var $object_name = 'TemplateSectionLine'; |
|
| 51 | - var $table_name = 'templatesectionline'; |
|
| 52 | - var $importable = false; |
|
| 53 | - var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 48 | + var $new_schema = true; |
|
| 49 | + var $module_dir = 'TemplateSectionLine'; |
|
| 50 | + var $object_name = 'TemplateSectionLine'; |
|
| 51 | + var $table_name = 'templatesectionline'; |
|
| 52 | + var $importable = false; |
|
| 53 | + var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 54 | 54 | |
| 55 | - var $id; |
|
| 56 | - var $name; |
|
| 57 | - var $date_entered; |
|
| 58 | - var $date_modified; |
|
| 59 | - var $modified_user_id; |
|
| 60 | - var $modified_by_name; |
|
| 61 | - var $created_by; |
|
| 62 | - var $created_by_name; |
|
| 63 | - var $description; |
|
| 64 | - var $deleted; |
|
| 65 | - var $created_by_link; |
|
| 66 | - var $modified_user_link; |
|
| 67 | - var $assigned_user_id; |
|
| 68 | - var $assigned_user_name; |
|
| 69 | - var $assigned_user_link; |
|
| 70 | - var $grp; |
|
| 55 | + var $id; |
|
| 56 | + var $name; |
|
| 57 | + var $date_entered; |
|
| 58 | + var $date_modified; |
|
| 59 | + var $modified_user_id; |
|
| 60 | + var $modified_by_name; |
|
| 61 | + var $created_by; |
|
| 62 | + var $created_by_name; |
|
| 63 | + var $description; |
|
| 64 | + var $deleted; |
|
| 65 | + var $created_by_link; |
|
| 66 | + var $modified_user_link; |
|
| 67 | + var $assigned_user_id; |
|
| 68 | + var $assigned_user_name; |
|
| 69 | + var $assigned_user_link; |
|
| 70 | + var $grp; |
|
| 71 | 71 | |
| 72 | - function __construct(){ |
|
| 73 | - parent::__construct(); |
|
| 74 | - } |
|
| 72 | + function __construct(){ |
|
| 73 | + parent::__construct(); |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - function bean_implements($interface){ |
|
| 77 | - switch($interface){ |
|
| 78 | - case 'ACL': return true; |
|
| 79 | - } |
|
| 80 | - return false; |
|
| 81 | - } |
|
| 76 | + function bean_implements($interface){ |
|
| 77 | + switch($interface){ |
|
| 78 | + case 'ACL': return true; |
|
| 79 | + } |
|
| 80 | + return false; |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | 83 | } |
| 84 | 84 | ?> |
| 85 | 85 | \ No newline at end of file |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | var $object_name = 'TemplateSectionLine'; |
| 51 | 51 | var $table_name = 'templatesectionline'; |
| 52 | 52 | var $importable = false; |
| 53 | - var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 53 | + var $disable_row_level_security = true; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 54 | 54 | |
| 55 | 55 | var $id; |
| 56 | 56 | var $name; |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | var $assigned_user_link; |
| 70 | 70 | var $grp; |
| 71 | 71 | |
| 72 | - function __construct(){ |
|
| 72 | + function __construct() { |
|
| 73 | 73 | parent::__construct(); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - function bean_implements($interface){ |
|
| 77 | - switch($interface){ |
|
| 76 | + function bean_implements($interface) { |
|
| 77 | + switch ($interface) { |
|
| 78 | 78 | case 'ACL': return true; |
| 79 | 79 | } |
| 80 | 80 | return false; |
@@ -42,48 +42,48 @@ |
||
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | class AM_TaskTemplates_sugar extends Basic { |
| 45 | - var $new_schema = true; |
|
| 46 | - var $module_dir = 'AM_TaskTemplates'; |
|
| 47 | - var $object_name = 'AM_TaskTemplates'; |
|
| 48 | - var $table_name = 'am_tasktemplates'; |
|
| 49 | - var $importable = false; |
|
| 50 | - var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 51 | - var $id; |
|
| 52 | - var $name; |
|
| 53 | - var $date_entered; |
|
| 54 | - var $date_modified; |
|
| 55 | - var $modified_user_id; |
|
| 56 | - var $modified_by_name; |
|
| 57 | - var $created_by; |
|
| 58 | - var $created_by_name; |
|
| 59 | - var $description; |
|
| 60 | - var $deleted; |
|
| 61 | - var $created_by_link; |
|
| 62 | - var $modified_user_link; |
|
| 63 | - var $assigned_user_id; |
|
| 64 | - var $assigned_user_name; |
|
| 65 | - var $assigned_user_link; |
|
| 66 | - var $status; |
|
| 67 | - var $priority; |
|
| 68 | - var $percent_complete; |
|
| 69 | - var $predecessors; |
|
| 70 | - var $milestone_flag; |
|
| 71 | - var $relationship_type; |
|
| 72 | - var $task_number; |
|
| 73 | - var $order_number; |
|
| 74 | - var $estimated_effort; |
|
| 75 | - var $utilization; |
|
| 76 | - var $duration; |
|
| 45 | + var $new_schema = true; |
|
| 46 | + var $module_dir = 'AM_TaskTemplates'; |
|
| 47 | + var $object_name = 'AM_TaskTemplates'; |
|
| 48 | + var $table_name = 'am_tasktemplates'; |
|
| 49 | + var $importable = false; |
|
| 50 | + var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 51 | + var $id; |
|
| 52 | + var $name; |
|
| 53 | + var $date_entered; |
|
| 54 | + var $date_modified; |
|
| 55 | + var $modified_user_id; |
|
| 56 | + var $modified_by_name; |
|
| 57 | + var $created_by; |
|
| 58 | + var $created_by_name; |
|
| 59 | + var $description; |
|
| 60 | + var $deleted; |
|
| 61 | + var $created_by_link; |
|
| 62 | + var $modified_user_link; |
|
| 63 | + var $assigned_user_id; |
|
| 64 | + var $assigned_user_name; |
|
| 65 | + var $assigned_user_link; |
|
| 66 | + var $status; |
|
| 67 | + var $priority; |
|
| 68 | + var $percent_complete; |
|
| 69 | + var $predecessors; |
|
| 70 | + var $milestone_flag; |
|
| 71 | + var $relationship_type; |
|
| 72 | + var $task_number; |
|
| 73 | + var $order_number; |
|
| 74 | + var $estimated_effort; |
|
| 75 | + var $utilization; |
|
| 76 | + var $duration; |
|
| 77 | 77 | |
| 78 | 78 | function __construct(){ |
| 79 | 79 | parent::__construct(); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - function bean_implements($interface){ |
|
| 83 | - switch($interface){ |
|
| 84 | - case 'ACL': return true; |
|
| 85 | - } |
|
| 86 | - return false; |
|
| 82 | + function bean_implements($interface){ |
|
| 83 | + switch($interface){ |
|
| 84 | + case 'ACL': return true; |
|
| 85 | + } |
|
| 86 | + return false; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | var $object_name = 'AM_TaskTemplates'; |
| 48 | 48 | var $table_name = 'am_tasktemplates'; |
| 49 | 49 | var $importable = false; |
| 50 | - var $disable_row_level_security = true ; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 50 | + var $disable_row_level_security = true; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO |
|
| 51 | 51 | var $id; |
| 52 | 52 | var $name; |
| 53 | 53 | var $date_entered; |
@@ -75,16 +75,16 @@ discard block |
||
| 75 | 75 | var $utilization; |
| 76 | 76 | var $duration; |
| 77 | 77 | |
| 78 | - function __construct(){ |
|
| 78 | + function __construct() { |
|
| 79 | 79 | parent::__construct(); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 84 | 84 | */ |
| 85 | - function AM_TaskTemplates_sugar(){ |
|
| 85 | + function AM_TaskTemplates_sugar() { |
|
| 86 | 86 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 87 | - if(isset($GLOBALS['log'])) { |
|
| 87 | + if (isset($GLOBALS['log'])) { |
|
| 88 | 88 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 89 | 89 | } |
| 90 | 90 | else { |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| 97 | - function bean_implements($interface){ |
|
| 98 | - switch($interface){ |
|
| 97 | + function bean_implements($interface) { |
|
| 98 | + switch ($interface) { |
|
| 99 | 99 | case 'ACL': return true; |
| 100 | 100 | } |
| 101 | 101 | return false; |
@@ -347,8 +347,7 @@ |
||
| 347 | 347 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 348 | 348 | if(isset($GLOBALS['log'])) { |
| 349 | 349 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 350 | - } |
|
| 351 | - else { |
|
| 350 | + } else { |
|
| 352 | 351 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 353 | 352 | } |
| 354 | 353 | self::__construct(); |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | class ParserSearchFields extends ModuleBuilderParser |
| 46 | 46 | { |
| 47 | 47 | |
| 48 | - var $searchFields; |
|
| 49 | - var $packageKey; |
|
| 48 | + var $searchFields; |
|
| 49 | + var $packageKey; |
|
| 50 | 50 | |
| 51 | 51 | function __construct ($moduleName, $packageName='') |
| 52 | 52 | { |
@@ -63,36 +63,36 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | function addSearchField($name, $searchField) |
| 65 | 65 | { |
| 66 | - if(empty($name) || empty($searchField) || !is_array($searchField)) |
|
| 67 | - { |
|
| 68 | - return; |
|
| 69 | - } |
|
| 66 | + if(empty($name) || empty($searchField) || !is_array($searchField)) |
|
| 67 | + { |
|
| 68 | + return; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - $key = isset($this->packageKey) ? $this->packageKey . '_' . $this->moduleName : $this->moduleName; |
|
| 71 | + $key = isset($this->packageKey) ? $this->packageKey . '_' . $this->moduleName : $this->moduleName; |
|
| 72 | 72 | $this->searchFields[$key][$name] = $searchField; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | function removeSearchField($name) |
| 76 | 76 | { |
| 77 | 77 | |
| 78 | - $key = isset($this->packageKey) ? $this->packageKey . '_' . $this->moduleName : $this->moduleName; |
|
| 78 | + $key = isset($this->packageKey) ? $this->packageKey . '_' . $this->moduleName : $this->moduleName; |
|
| 79 | 79 | |
| 80 | - if(isset($this->searchFields[$key][$name])) |
|
| 81 | - { |
|
| 82 | - unset($this->searchFields[$key][$name]); |
|
| 83 | - } |
|
| 80 | + if(isset($this->searchFields[$key][$name])) |
|
| 81 | + { |
|
| 82 | + unset($this->searchFields[$key][$name]); |
|
| 83 | + } |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | function getSearchFields() |
| 87 | 87 | { |
| 88 | - $searchFields = array(); |
|
| 88 | + $searchFields = array(); |
|
| 89 | 89 | if (!empty($this->packageName) && file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) //we are in Module builder |
| 90 | 90 | { |
| 91 | - include("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php"); |
|
| 91 | + include("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php"); |
|
| 92 | 92 | } else if(file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) { |
| 93 | - include("custom/modules/{$this->moduleName}/metadata/SearchFields.php"); |
|
| 93 | + include("custom/modules/{$this->moduleName}/metadata/SearchFields.php"); |
|
| 94 | 94 | } else if(file_exists("modules/{$this->moduleName}/metadata/SearchFields.php")) { |
| 95 | - include("modules/{$this->moduleName}/metadata/SearchFields.php"); |
|
| 95 | + include("modules/{$this->moduleName}/metadata/SearchFields.php"); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return $searchFields; |
@@ -102,19 +102,19 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | if (!empty($this->packageName)) //we are in Module builder |
| 104 | 104 | { |
| 105 | - $header = file_get_contents('modules/ModuleBuilder/MB/header.php'); |
|
| 105 | + $header = file_get_contents('modules/ModuleBuilder/MB/header.php'); |
|
| 106 | 106 | if(!file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) |
| 107 | 107 | { |
| 108 | - mkdir_recursive("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata"); |
|
| 108 | + mkdir_recursive("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata"); |
|
| 109 | 109 | } |
| 110 | - write_array_to_file("searchFields['{$this->packageKey}_{$this->moduleName}']", $searchFields["{$this->packageKey}_{$this->moduleName}"], "custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php", 'w', $header); |
|
| 110 | + write_array_to_file("searchFields['{$this->packageKey}_{$this->moduleName}']", $searchFields["{$this->packageKey}_{$this->moduleName}"], "custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php", 'w', $header); |
|
| 111 | 111 | } else { |
| 112 | - $header = file_get_contents('modules/ModuleBuilder/MB/header.php'); |
|
| 112 | + $header = file_get_contents('modules/ModuleBuilder/MB/header.php'); |
|
| 113 | 113 | if(!file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) |
| 114 | 114 | { |
| 115 | - mkdir_recursive("custom/modules/{$this->moduleName}/metadata"); |
|
| 115 | + mkdir_recursive("custom/modules/{$this->moduleName}/metadata"); |
|
| 116 | 116 | } |
| 117 | - write_array_to_file("searchFields['{$this->moduleName}']", $searchFields[$this->moduleName], "custom/modules/{$this->moduleName}/metadata/SearchFields.php", 'w', $header); |
|
| 117 | + write_array_to_file("searchFields['{$this->moduleName}']", $searchFields[$this->moduleName], "custom/modules/{$this->moduleName}/metadata/SearchFields.php", 'w', $header); |
|
| 118 | 118 | } |
| 119 | 119 | $this->searchFields = $searchFields; |
| 120 | 120 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined ( 'sugarEntry' ) || ! sugarEntry) |
|
| 3 | - die ( 'Not A Valid Entry Point' ) ; |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) |
|
| 3 | + die ('Not A Valid Entry Point'); |
|
| 4 | 4 | /********************************************************************************* |
| 5 | 5 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 6 | 6 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
| 40 | 40 | ********************************************************************************/ |
| 41 | 41 | |
| 42 | -require_once ('modules/ModuleBuilder/parsers/ModuleBuilderParser.php') ; |
|
| 42 | +require_once ('modules/ModuleBuilder/parsers/ModuleBuilderParser.php'); |
|
| 43 | 43 | require_once ('modules/ModuleBuilder/MB/MBPackage.php'); |
| 44 | 44 | |
| 45 | 45 | class ParserSearchFields extends ModuleBuilderParser |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | var $searchFields; |
| 49 | 49 | var $packageKey; |
| 50 | 50 | |
| 51 | - function __construct ($moduleName, $packageName='') |
|
| 51 | + function __construct($moduleName, $packageName = '') |
|
| 52 | 52 | { |
| 53 | 53 | $this->moduleName = $moduleName; |
| 54 | 54 | if (!empty($packageName)) |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | /** |
| 65 | 65 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 66 | 66 | */ |
| 67 | - function ParserSearchFields($moduleName, $packageName=''){ |
|
| 67 | + function ParserSearchFields($moduleName, $packageName = '') { |
|
| 68 | 68 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 69 | - if(isset($GLOBALS['log'])) { |
|
| 69 | + if (isset($GLOBALS['log'])) { |
|
| 70 | 70 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 71 | 71 | } |
| 72 | 72 | else { |
@@ -77,21 +77,21 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | function addSearchField($name, $searchField) |
| 79 | 79 | { |
| 80 | - if(empty($name) || empty($searchField) || !is_array($searchField)) |
|
| 80 | + if (empty($name) || empty($searchField) || !is_array($searchField)) |
|
| 81 | 81 | { |
| 82 | 82 | return; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $key = isset($this->packageKey) ? $this->packageKey . '_' . $this->moduleName : $this->moduleName; |
|
| 85 | + $key = isset($this->packageKey) ? $this->packageKey.'_'.$this->moduleName : $this->moduleName; |
|
| 86 | 86 | $this->searchFields[$key][$name] = $searchField; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | function removeSearchField($name) |
| 90 | 90 | { |
| 91 | 91 | |
| 92 | - $key = isset($this->packageKey) ? $this->packageKey . '_' . $this->moduleName : $this->moduleName; |
|
| 92 | + $key = isset($this->packageKey) ? $this->packageKey.'_'.$this->moduleName : $this->moduleName; |
|
| 93 | 93 | |
| 94 | - if(isset($this->searchFields[$key][$name])) |
|
| 94 | + if (isset($this->searchFields[$key][$name])) |
|
| 95 | 95 | { |
| 96 | 96 | unset($this->searchFields[$key][$name]); |
| 97 | 97 | } |
@@ -103,28 +103,28 @@ discard block |
||
| 103 | 103 | if (!empty($this->packageName) && file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) //we are in Module builder |
| 104 | 104 | { |
| 105 | 105 | include("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php"); |
| 106 | - } else if(file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) { |
|
| 106 | + } else if (file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) { |
|
| 107 | 107 | include("custom/modules/{$this->moduleName}/metadata/SearchFields.php"); |
| 108 | - } else if(file_exists("modules/{$this->moduleName}/metadata/SearchFields.php")) { |
|
| 108 | + } else if (file_exists("modules/{$this->moduleName}/metadata/SearchFields.php")) { |
|
| 109 | 109 | include("modules/{$this->moduleName}/metadata/SearchFields.php"); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | return $searchFields; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - function saveSearchFields ($searchFields) |
|
| 115 | + function saveSearchFields($searchFields) |
|
| 116 | 116 | { |
| 117 | 117 | if (!empty($this->packageName)) //we are in Module builder |
| 118 | 118 | { |
| 119 | 119 | $header = file_get_contents('modules/ModuleBuilder/MB/header.php'); |
| 120 | - if(!file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) |
|
| 120 | + if (!file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) |
|
| 121 | 121 | { |
| 122 | 122 | mkdir_recursive("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata"); |
| 123 | 123 | } |
| 124 | 124 | write_array_to_file("searchFields['{$this->packageKey}_{$this->moduleName}']", $searchFields["{$this->packageKey}_{$this->moduleName}"], "custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php", 'w', $header); |
| 125 | 125 | } else { |
| 126 | 126 | $header = file_get_contents('modules/ModuleBuilder/MB/header.php'); |
| 127 | - if(!file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) |
|
| 127 | + if (!file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) |
|
| 128 | 128 | { |
| 129 | 129 | mkdir_recursive("custom/modules/{$this->moduleName}/metadata"); |
| 130 | 130 | } |
@@ -1,6 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined ( 'sugarEntry' ) || ! sugarEntry) |
|
| 2 | +if (! defined ( 'sugarEntry' ) || ! sugarEntry) { |
|
| 3 | 3 | die ( 'Not A Valid Entry Point' ) ; |
| 4 | +} |
|
| 4 | 5 | /********************************************************************************* |
| 5 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 6 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -68,8 +69,7 @@ discard block |
||
| 68 | 69 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 69 | 70 | if(isset($GLOBALS['log'])) { |
| 70 | 71 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 71 | - } |
|
| 72 | - else { |
|
| 72 | + } else { |
|
| 73 | 73 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 74 | 74 | } |
| 75 | 75 | self::__construct($moduleName, $packageName); |
@@ -100,9 +100,11 @@ discard block |
||
| 100 | 100 | function getSearchFields() |
| 101 | 101 | { |
| 102 | 102 | $searchFields = array(); |
| 103 | - if (!empty($this->packageName) && file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) //we are in Module builder |
|
| 103 | + if (!empty($this->packageName) && file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) { |
|
| 104 | + //we are in Module builder |
|
| 104 | 105 | { |
| 105 | 106 | include("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php"); |
| 107 | + } |
|
| 106 | 108 | } else if(file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) { |
| 107 | 109 | include("custom/modules/{$this->moduleName}/metadata/SearchFields.php"); |
| 108 | 110 | } else if(file_exists("modules/{$this->moduleName}/metadata/SearchFields.php")) { |
@@ -114,9 +116,11 @@ discard block |
||
| 114 | 116 | |
| 115 | 117 | function saveSearchFields ($searchFields) |
| 116 | 118 | { |
| 117 | - if (!empty($this->packageName)) //we are in Module builder |
|
| 119 | + if (!empty($this->packageName)) { |
|
| 120 | + //we are in Module builder |
|
| 118 | 121 | { |
| 119 | 122 | $header = file_get_contents('modules/ModuleBuilder/MB/header.php'); |
| 123 | + } |
|
| 120 | 124 | if(!file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) |
| 121 | 125 | { |
| 122 | 126 | mkdir_recursive("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata"); |
@@ -69,16 +69,16 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | - * @see SugarView::_getModuleTitleParams() |
|
| 73 | - */ |
|
| 74 | - protected function _getModuleTitleParams($browserTitle = false) |
|
| 75 | - { |
|
| 76 | - global $mod_strings; |
|
| 77 | - |
|
| 78 | - return array( |
|
| 79 | - translate('LBL_MODULE_NAME','Administration'), |
|
| 80 | - ModuleBuilderController::getModuleTitle(), |
|
| 81 | - ); |
|
| 72 | + * @see SugarView::_getModuleTitleParams() |
|
| 73 | + */ |
|
| 74 | + protected function _getModuleTitleParams($browserTitle = false) |
|
| 75 | + { |
|
| 76 | + global $mod_strings; |
|
| 77 | + |
|
| 78 | + return array( |
|
| 79 | + translate('LBL_MODULE_NAME','Administration'), |
|
| 80 | + ModuleBuilderController::getModuleTitle(), |
|
| 81 | + ); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module |
@@ -99,13 +99,13 @@ discard block |
||
| 99 | 99 | $history = $parser->getHistory () ; |
| 100 | 100 | $smarty = new Sugar_Smarty ( ) ; |
| 101 | 101 | //Add in the module we are viewing to our current mod strings |
| 102 | - if (! $this->fromModuleBuilder) { |
|
| 103 | - global $current_language; |
|
| 104 | - $editModStrings = return_module_language($current_language, $this->editModule); |
|
| 105 | - $mod_strings = sugarArrayMerge($editModStrings, $mod_strings); |
|
| 106 | - } |
|
| 102 | + if (! $this->fromModuleBuilder) { |
|
| 103 | + global $current_language; |
|
| 104 | + $editModStrings = return_module_language($current_language, $this->editModule); |
|
| 105 | + $mod_strings = sugarArrayMerge($editModStrings, $mod_strings); |
|
| 106 | + } |
|
| 107 | 107 | $smarty->assign('mod', $mod_strings); |
| 108 | - $smarty->assign('MOD', $mod_strings); |
|
| 108 | + $smarty->assign('MOD', $mod_strings); |
|
| 109 | 109 | // assign buttons |
| 110 | 110 | $images = array ( 'icon_save' => 'studio_save' , 'icon_publish' => 'studio_publish' , 'icon_address' => 'icon_Address' , 'icon_emailaddress' => 'icon_EmailAddress' , 'icon_phone' => 'icon_Phone' ) ; |
| 111 | 111 | foreach ( $images as $image => $file ) |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | //Check if we need to synch edit view to other layouts |
| 129 | 129 | if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){ |
| 130 | - $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package); |
|
| 130 | + $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package); |
|
| 131 | 131 | if($this->editLayout == MB_DETAILVIEW){ |
| 132 | - $disableLayout = $parser2->getSyncDetailEditViews(); |
|
| 132 | + $disableLayout = $parser2->getSyncDetailEditViews(); |
|
| 133 | 133 | } |
| 134 | 134 | if(!empty($_REQUEST['copyFromEditView'])){ |
| 135 | 135 | $editViewPanels = $parser2->convertFromCanonicalForm ( $parser2->_viewdefs [ 'panels' ] , $parser2->_fielddefs ) ; |
@@ -138,34 +138,34 @@ discard block |
||
| 138 | 138 | $parser->setUseTabs($parser2->getUseTabs()); |
| 139 | 139 | $parser->setTabDefs($parser2->getTabDefs()); |
| 140 | 140 | } |
| 141 | - } |
|
| 141 | + } |
|
| 142 | 142 | |
| 143 | 143 | if (! $this->fromModuleBuilder) |
| 144 | 144 | { |
| 145 | - $buttons [] = array ( |
|
| 145 | + $buttons [] = array ( |
|
| 146 | 146 | 'id' => 'saveBtn' , |
| 147 | 147 | 'text' => translate ( 'LBL_BTN_SAVE' ) , |
| 148 | 148 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handleSave();'", |
| 149 | - 'disabled' => $disableLayout, |
|
| 149 | + 'disabled' => $disableLayout, |
|
| 150 | 150 | ) ; |
| 151 | 151 | $buttons [] = array ( |
| 152 | 152 | 'id' => 'publishBtn' , |
| 153 | 153 | 'text' => translate ( 'LBL_BTN_SAVEPUBLISH' ) , |
| 154 | 154 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'", |
| 155 | - 'disabled' => $disableLayout, |
|
| 155 | + 'disabled' => $disableLayout, |
|
| 156 | 156 | ) ; |
| 157 | 157 | $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ; |
| 158 | 158 | $buttons [] = array ( |
| 159 | - 'id' => 'historyBtn' , |
|
| 160 | - 'text' => translate ( 'LBL_HISTORY' ) , |
|
| 161 | - 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
|
| 159 | + 'id' => 'historyBtn' , |
|
| 160 | + 'text' => translate ( 'LBL_HISTORY' ) , |
|
| 161 | + 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
|
| 162 | 162 | 'disabled' => $disableLayout, |
| 163 | 163 | ) ; |
| 164 | 164 | $buttons [] = array ( |
| 165 | - 'id' => 'historyDefault' , |
|
| 166 | - 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
| 167 | - 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
|
| 168 | - 'disabled' => $disableLayout, |
|
| 165 | + 'id' => 'historyDefault' , |
|
| 166 | + 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
| 167 | + 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
|
| 168 | + 'disabled' => $disableLayout, |
|
| 169 | 169 | ) ; |
| 170 | 170 | } else |
| 171 | 171 | { |
@@ -205,15 +205,15 @@ discard block |
||
| 205 | 205 | foreach ( $buttons as $button ) |
| 206 | 206 | { |
| 207 | 207 | if ($button['id'] == "spacer") { |
| 208 | - $html .= "<td style='width:{$button['width']}'> </td>"; |
|
| 208 | + $html .= "<td style='width:{$button['width']}'> </td>"; |
|
| 209 | 209 | } else { |
| 210 | - $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " |
|
| 211 | - . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " |
|
| 212 | - . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ; |
|
| 213 | - if(!empty($button['disabled'])){ |
|
| 214 | - $html .= " disabled"; |
|
| 215 | - } |
|
| 216 | - $html .= "></td>"; |
|
| 210 | + $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " |
|
| 211 | + . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " |
|
| 212 | + . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ; |
|
| 213 | + if(!empty($button['disabled'])){ |
|
| 214 | + $html .= " disabled"; |
|
| 215 | + } |
|
| 216 | + $html .= "></td>"; |
|
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | |
@@ -243,10 +243,10 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | $labels = array ( |
| 246 | - MB_EDITVIEW => 'LBL_EDITVIEW' , |
|
| 247 | - MB_DETAILVIEW => 'LBL_DETAILVIEW' , |
|
| 248 | - MB_QUICKCREATE => 'LBL_QUICKCREATE', |
|
| 249 | - ) ; |
|
| 246 | + MB_EDITVIEW => 'LBL_EDITVIEW' , |
|
| 247 | + MB_DETAILVIEW => 'LBL_DETAILVIEW' , |
|
| 248 | + MB_QUICKCREATE => 'LBL_QUICKCREATE', |
|
| 249 | + ) ; |
|
| 250 | 250 | |
| 251 | 251 | $layoutLabel = 'LBL_LAYOUTS' ; |
| 252 | 252 | $layoutView = 'layouts' ; |
@@ -255,8 +255,8 @@ discard block |
||
| 255 | 255 | $ajax = new AjaxCompose ( ) ; |
| 256 | 256 | |
| 257 | 257 | $translatedViewType = '' ; |
| 258 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
| 259 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
| 258 | + if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
| 259 | + $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
| 260 | 260 | else if (isset($this->sm)) |
| 261 | 261 | { |
| 262 | 262 | foreach($this->sm->sources as $file => $def) |
@@ -294,20 +294,20 @@ discard block |
||
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | // set up language files |
| 297 | - $smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template |
|
| 297 | + $smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template |
|
| 298 | 298 | $smarty->assign('from_mb',$this->fromModuleBuilder); |
| 299 | 299 | $smarty->assign('calc_field_list', json_encode($parser->getCalculatedFields())); |
| 300 | - if ($this->fromModuleBuilder) { |
|
| 301 | - $mb = new ModuleBuilder ( ) ; |
|
| 300 | + if ($this->fromModuleBuilder) { |
|
| 301 | + $mb = new ModuleBuilder ( ) ; |
|
| 302 | 302 | $module = & $mb->getPackageModule ( $this->package, $this->editModule ) ; |
| 303 | - $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
| 304 | - } |
|
| 303 | + $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
| 304 | + } |
|
| 305 | 305 | |
| 306 | 306 | $ajax->addSection ( 'center', $translatedViewType, $smarty->fetch ( 'modules/ModuleBuilder/tpls/layoutView.tpl' ) ) ; |
| 307 | 307 | if ($preview) { |
| 308 | - echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' ); |
|
| 309 | - } else { |
|
| 310 | - echo $ajax->getJavascript () ; |
|
| 311 | - } |
|
| 308 | + echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' ); |
|
| 309 | + } else { |
|
| 310 | + echo $ajax->getJavascript () ; |
|
| 311 | + } |
|
| 312 | 312 | } |
| 313 | 313 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined ( 'sugarEntry' ) || ! sugarEntry) |
|
| 3 | - die ( 'Not A Valid Entry Point' ) ; |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) |
|
| 3 | + die ('Not A Valid Entry Point'); |
|
| 4 | 4 | |
| 5 | 5 | /********************************************************************************* |
| 6 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
@@ -41,28 +41,28 @@ discard block |
||
| 41 | 41 | ********************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | |
| 44 | -require_once ('modules/ModuleBuilder/parsers/ParserFactory.php') ; |
|
| 45 | -require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
| 46 | -require_once 'modules/ModuleBuilder/parsers/constants.php' ; |
|
| 44 | +require_once ('modules/ModuleBuilder/parsers/ParserFactory.php'); |
|
| 45 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
| 46 | +require_once 'modules/ModuleBuilder/parsers/constants.php'; |
|
| 47 | 47 | |
| 48 | 48 | class ViewLayoutView extends SugarView |
| 49 | 49 | { |
| 50 | 50 | function __construct() |
| 51 | 51 | { |
| 52 | - $GLOBALS [ 'log' ]->debug ( 'in ViewLayoutView' ) ; |
|
| 53 | - $this->editModule = $_REQUEST [ 'view_module' ] ; |
|
| 54 | - $this->editLayout = $_REQUEST [ 'view' ] ; |
|
| 52 | + $GLOBALS ['log']->debug('in ViewLayoutView'); |
|
| 53 | + $this->editModule = $_REQUEST ['view_module']; |
|
| 54 | + $this->editLayout = $_REQUEST ['view']; |
|
| 55 | 55 | $this->package = null; |
| 56 | - $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || !empty($_REQUEST [ 'view_package' ]); |
|
| 56 | + $this->fromModuleBuilder = isset ($_REQUEST ['MB']) || !empty($_REQUEST ['view_package']); |
|
| 57 | 57 | if ($this->fromModuleBuilder) |
| 58 | 58 | { |
| 59 | - $this->package = $_REQUEST [ 'view_package' ] ; |
|
| 59 | + $this->package = $_REQUEST ['view_package']; |
|
| 60 | 60 | $this->type = $this->editLayout; |
| 61 | 61 | } else |
| 62 | 62 | { |
| 63 | - global $app_list_strings ; |
|
| 64 | - $moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ; |
|
| 65 | - $this->translatedEditModule = $moduleNames [ strtolower ( $this->editModule ) ] ; |
|
| 63 | + global $app_list_strings; |
|
| 64 | + $moduleNames = array_change_key_case($app_list_strings ['moduleList']); |
|
| 65 | + $this->translatedEditModule = $moduleNames [strtolower($this->editModule)]; |
|
| 66 | 66 | $this->sm = StudioModuleFactory::getStudioModule($this->editModule); |
| 67 | 67 | $this->type = $this->sm->getViewType($this->editLayout); |
| 68 | 68 | } |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | /** |
| 72 | 72 | * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead |
| 73 | 73 | */ |
| 74 | - function ViewLayoutView(){ |
|
| 74 | + function ViewLayoutView() { |
|
| 75 | 75 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 76 | - if(isset($GLOBALS['log'])) { |
|
| 76 | + if (isset($GLOBALS['log'])) { |
|
| 77 | 77 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 78 | 78 | } |
| 79 | 79 | else { |
@@ -90,30 +90,30 @@ discard block |
||
| 90 | 90 | global $mod_strings; |
| 91 | 91 | |
| 92 | 92 | return array( |
| 93 | - translate('LBL_MODULE_NAME','Administration'), |
|
| 93 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
| 94 | 94 | ModuleBuilderController::getModuleTitle(), |
| 95 | 95 | ); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module |
| 99 | - function preDisplay () |
|
| 99 | + function preDisplay() |
|
| 100 | 100 | { |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - function display ($preview = false) |
|
| 103 | + function display($preview = false) |
|
| 104 | 104 | { |
| 105 | 105 | |
| 106 | - global $mod_strings ; |
|
| 107 | - $parser = ParserFactory::getParser($this->editLayout,$this->editModule,$this->package); |
|
| 106 | + global $mod_strings; |
|
| 107 | + $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $this->package); |
|
| 108 | 108 | |
| 109 | - if(isset($this->view_object_map['new_parser'])) { |
|
| 109 | + if (isset($this->view_object_map['new_parser'])) { |
|
| 110 | 110 | $parser = $this->view_object_map['new_parser']; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - $history = $parser->getHistory () ; |
|
| 114 | - $smarty = new Sugar_Smarty ( ) ; |
|
| 113 | + $history = $parser->getHistory(); |
|
| 114 | + $smarty = new Sugar_Smarty( ); |
|
| 115 | 115 | //Add in the module we are viewing to our current mod strings |
| 116 | - if (! $this->fromModuleBuilder) { |
|
| 116 | + if (!$this->fromModuleBuilder) { |
|
| 117 | 117 | global $current_language; |
| 118 | 118 | $editModStrings = return_module_language($current_language, $this->editModule); |
| 119 | 119 | $mod_strings = sugarArrayMerge($editModStrings, $mod_strings); |
@@ -121,171 +121,171 @@ discard block |
||
| 121 | 121 | $smarty->assign('mod', $mod_strings); |
| 122 | 122 | $smarty->assign('MOD', $mod_strings); |
| 123 | 123 | // assign buttons |
| 124 | - $images = array ( 'icon_save' => 'studio_save' , 'icon_publish' => 'studio_publish' , 'icon_address' => 'icon_Address' , 'icon_emailaddress' => 'icon_EmailAddress' , 'icon_phone' => 'icon_Phone' ) ; |
|
| 125 | - foreach ( $images as $image => $file ) |
|
| 124 | + $images = array('icon_save' => 'studio_save', 'icon_publish' => 'studio_publish', 'icon_address' => 'icon_Address', 'icon_emailaddress' => 'icon_EmailAddress', 'icon_phone' => 'icon_Phone'); |
|
| 125 | + foreach ($images as $image => $file) |
|
| 126 | 126 | { |
| 127 | - $smarty->assign ( $image, SugarThemeRegistry::current()->getImage($file,'',null,null,'.gif',$file) ) ; |
|
| 127 | + $smarty->assign($image, SugarThemeRegistry::current()->getImage($file, '', null, null, '.gif', $file)); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $requiredFields = implode($parser->getRequiredFields () , ','); |
|
| 130 | + $requiredFields = implode($parser->getRequiredFields(), ','); |
|
| 131 | 131 | $slashedRequiredFields = addslashes($requiredFields); |
| 132 | - $buttons = array ( ) ; |
|
| 132 | + $buttons = array( ); |
|
| 133 | 133 | $disableLayout = false; |
| 134 | 134 | |
| 135 | 135 | if ($preview) |
| 136 | 136 | { |
| 137 | - $smarty->assign ( 'layouttitle', translate ( 'LBL_LAYOUT_PREVIEW', 'ModuleBuilder' ) ) ; |
|
| 137 | + $smarty->assign('layouttitle', translate('LBL_LAYOUT_PREVIEW', 'ModuleBuilder')); |
|
| 138 | 138 | } else |
| 139 | 139 | { |
| 140 | - $smarty->assign ( 'layouttitle', translate ( 'LBL_CURRENT_LAYOUT', 'ModuleBuilder' ) ) ; |
|
| 140 | + $smarty->assign('layouttitle', translate('LBL_CURRENT_LAYOUT', 'ModuleBuilder')); |
|
| 141 | 141 | |
| 142 | 142 | //Check if we need to synch edit view to other layouts |
| 143 | - if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){ |
|
| 144 | - $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package); |
|
| 145 | - if($this->editLayout == MB_DETAILVIEW){ |
|
| 143 | + if ($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE) { |
|
| 144 | + $parser2 = ParserFactory::getParser(MB_EDITVIEW, $this->editModule, $this->package); |
|
| 145 | + if ($this->editLayout == MB_DETAILVIEW) { |
|
| 146 | 146 | $disableLayout = $parser2->getSyncDetailEditViews(); |
| 147 | 147 | } |
| 148 | - if(!empty($_REQUEST['copyFromEditView'])){ |
|
| 149 | - $editViewPanels = $parser2->convertFromCanonicalForm ( $parser2->_viewdefs [ 'panels' ] , $parser2->_fielddefs ) ; |
|
| 150 | - $parser->_viewdefs [ 'panels' ] = $editViewPanels; |
|
| 148 | + if (!empty($_REQUEST['copyFromEditView'])) { |
|
| 149 | + $editViewPanels = $parser2->convertFromCanonicalForm($parser2->_viewdefs ['panels'], $parser2->_fielddefs); |
|
| 150 | + $parser->_viewdefs ['panels'] = $editViewPanels; |
|
| 151 | 151 | $parser->_fielddefs = $parser2->_fielddefs; |
| 152 | 152 | $parser->setUseTabs($parser2->getUseTabs()); |
| 153 | 153 | $parser->setTabDefs($parser2->getTabDefs()); |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (! $this->fromModuleBuilder) |
|
| 157 | + if (!$this->fromModuleBuilder) |
|
| 158 | 158 | { |
| 159 | - $buttons [] = array ( |
|
| 160 | - 'id' => 'saveBtn' , |
|
| 161 | - 'text' => translate ( 'LBL_BTN_SAVE' ) , |
|
| 159 | + $buttons [] = array( |
|
| 160 | + 'id' => 'saveBtn', |
|
| 161 | + 'text' => translate('LBL_BTN_SAVE'), |
|
| 162 | 162 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handleSave();'", |
| 163 | 163 | 'disabled' => $disableLayout, |
| 164 | - ) ; |
|
| 165 | - $buttons [] = array ( |
|
| 166 | - 'id' => 'publishBtn' , |
|
| 167 | - 'text' => translate ( 'LBL_BTN_SAVEPUBLISH' ) , |
|
| 164 | + ); |
|
| 165 | + $buttons [] = array( |
|
| 166 | + 'id' => 'publishBtn', |
|
| 167 | + 'text' => translate('LBL_BTN_SAVEPUBLISH'), |
|
| 168 | 168 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'", |
| 169 | 169 | 'disabled' => $disableLayout, |
| 170 | - ) ; |
|
| 171 | - $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ; |
|
| 172 | - $buttons [] = array ( |
|
| 173 | - 'id' => 'historyBtn' , |
|
| 174 | - 'text' => translate ( 'LBL_HISTORY' ) , |
|
| 170 | + ); |
|
| 171 | + $buttons [] = array('id' => 'spacer', 'width' => '33px'); |
|
| 172 | + $buttons [] = array( |
|
| 173 | + 'id' => 'historyBtn', |
|
| 174 | + 'text' => translate('LBL_HISTORY'), |
|
| 175 | 175 | 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
| 176 | 176 | 'disabled' => $disableLayout, |
| 177 | - ) ; |
|
| 178 | - $buttons [] = array ( |
|
| 179 | - 'id' => 'historyDefault' , |
|
| 180 | - 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
| 177 | + ); |
|
| 178 | + $buttons [] = array( |
|
| 179 | + 'id' => 'historyDefault', |
|
| 180 | + 'text' => translate('LBL_RESTORE_DEFAULT'), |
|
| 181 | 181 | 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
| 182 | 182 | 'disabled' => $disableLayout, |
| 183 | - ) ; |
|
| 183 | + ); |
|
| 184 | 184 | } else |
| 185 | 185 | { |
| 186 | - $buttons [] = array ( |
|
| 187 | - 'id' => 'saveBtn' , |
|
| 188 | - 'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVE' ] , |
|
| 186 | + $buttons [] = array( |
|
| 187 | + 'id' => 'saveBtn', |
|
| 188 | + 'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVE'], |
|
| 189 | 189 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'", |
| 190 | 190 | 'disabled' => $disableLayout, |
| 191 | - ) ; |
|
| 192 | - $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ; |
|
| 193 | - $buttons [] = array ( |
|
| 194 | - 'id' => 'historyBtn' , |
|
| 195 | - 'text' => translate ( 'LBL_HISTORY' ) , |
|
| 191 | + ); |
|
| 192 | + $buttons [] = array('id' => 'spacer', 'width' => '33px'); |
|
| 193 | + $buttons [] = array( |
|
| 194 | + 'id' => 'historyBtn', |
|
| 195 | + 'text' => translate('LBL_HISTORY'), |
|
| 196 | 196 | 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
| 197 | 197 | 'disabled' => $disableLayout, |
| 198 | - ) ; |
|
| 199 | - $buttons [] = array ( |
|
| 200 | - 'id' => 'historyDefault' , |
|
| 201 | - 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
| 198 | + ); |
|
| 199 | + $buttons [] = array( |
|
| 200 | + 'id' => 'historyDefault', |
|
| 201 | + 'text' => translate('LBL_RESTORE_DEFAULT'), |
|
| 202 | 202 | 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
| 203 | 203 | 'disabled' => $disableLayout, |
| 204 | - ) ; |
|
| 204 | + ); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | |
| 208 | - if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){ |
|
| 209 | - $buttons [] = array ( |
|
| 210 | - 'id' => 'copyFromEditView' , |
|
| 211 | - 'text' => translate ( 'LBL_COPY_FROM_EDITVIEW' ) , |
|
| 208 | + if ($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE) { |
|
| 209 | + $buttons [] = array( |
|
| 210 | + 'id' => 'copyFromEditView', |
|
| 211 | + 'text' => translate('LBL_COPY_FROM_EDITVIEW'), |
|
| 212 | 212 | 'actionScript' => "onclick='ModuleBuilder.copyFromView(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
| 213 | 213 | 'disabled' => $disableLayout, |
| 214 | - ) ; |
|
| 214 | + ); |
|
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - $html = "" ; |
|
| 219 | - foreach ( $buttons as $button ) |
|
| 218 | + $html = ""; |
|
| 219 | + foreach ($buttons as $button) |
|
| 220 | 220 | { |
| 221 | 221 | if ($button['id'] == "spacer") { |
| 222 | 222 | $html .= "<td style='width:{$button['width']}'> </td>"; |
| 223 | 223 | } else { |
| 224 | 224 | $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " |
| 225 | 225 | . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " |
| 226 | - . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ; |
|
| 227 | - if(!empty($button['disabled'])){ |
|
| 226 | + . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'"; |
|
| 227 | + if (!empty($button['disabled'])) { |
|
| 228 | 228 | $html .= " disabled"; |
| 229 | 229 | } |
| 230 | 230 | $html .= "></td>"; |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $smarty->assign ( 'buttons', $html ) ; |
|
| 234 | + $smarty->assign('buttons', $html); |
|
| 235 | 235 | |
| 236 | 236 | // assign fields and layout |
| 237 | - $smarty->assign ( 'available_fields', $parser->getAvailableFields () ) ; |
|
| 238 | - |
|
| 239 | - $smarty->assign ( 'disable_layout', $disableLayout) ; |
|
| 240 | - $smarty->assign ( 'required_fields', $requiredFields) ; |
|
| 241 | - $smarty->assign ( 'layout', $parser->getLayout () ) ; |
|
| 242 | - $smarty->assign ( 'field_defs', $parser->getFieldDefs () ) ; |
|
| 243 | - $smarty->assign ( 'view_module', $this->editModule ) ; |
|
| 244 | - $smarty->assign ( 'view', $this->editLayout ) ; |
|
| 245 | - $smarty->assign ( 'maxColumns', $parser->getMaxColumns() ) ; |
|
| 246 | - $smarty->assign ( 'nextPanelId', $parser->getFirstNewPanelId() ) ; |
|
| 247 | - $smarty->assign ( 'displayAsTabs', $parser->getUseTabs() ) ; |
|
| 248 | - $smarty->assign ( 'tabDefs', $parser->getTabDefs() ) ; |
|
| 249 | - $smarty->assign ( 'syncDetailEditViews', $parser->getSyncDetailEditViews() ) ; |
|
| 250 | - $smarty->assign ( 'fieldwidth', 150 ) ; |
|
| 251 | - $smarty->assign ( 'translate', $this->fromModuleBuilder ? false : true ) ; |
|
| 237 | + $smarty->assign('available_fields', $parser->getAvailableFields()); |
|
| 238 | + |
|
| 239 | + $smarty->assign('disable_layout', $disableLayout); |
|
| 240 | + $smarty->assign('required_fields', $requiredFields); |
|
| 241 | + $smarty->assign('layout', $parser->getLayout()); |
|
| 242 | + $smarty->assign('field_defs', $parser->getFieldDefs()); |
|
| 243 | + $smarty->assign('view_module', $this->editModule); |
|
| 244 | + $smarty->assign('view', $this->editLayout); |
|
| 245 | + $smarty->assign('maxColumns', $parser->getMaxColumns()); |
|
| 246 | + $smarty->assign('nextPanelId', $parser->getFirstNewPanelId()); |
|
| 247 | + $smarty->assign('displayAsTabs', $parser->getUseTabs()); |
|
| 248 | + $smarty->assign('tabDefs', $parser->getTabDefs()); |
|
| 249 | + $smarty->assign('syncDetailEditViews', $parser->getSyncDetailEditViews()); |
|
| 250 | + $smarty->assign('fieldwidth', 150); |
|
| 251 | + $smarty->assign('translate', $this->fromModuleBuilder ? false : true); |
|
| 252 | 252 | |
| 253 | 253 | if ($this->fromModuleBuilder) |
| 254 | 254 | { |
| 255 | - $smarty->assign ( 'fromModuleBuilder', $this->fromModuleBuilder ) ; |
|
| 256 | - $smarty->assign ( 'view_package', $this->package ) ; |
|
| 255 | + $smarty->assign('fromModuleBuilder', $this->fromModuleBuilder); |
|
| 256 | + $smarty->assign('view_package', $this->package); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - $labels = array ( |
|
| 260 | - MB_EDITVIEW => 'LBL_EDITVIEW' , |
|
| 261 | - MB_DETAILVIEW => 'LBL_DETAILVIEW' , |
|
| 259 | + $labels = array( |
|
| 260 | + MB_EDITVIEW => 'LBL_EDITVIEW', |
|
| 261 | + MB_DETAILVIEW => 'LBL_DETAILVIEW', |
|
| 262 | 262 | MB_QUICKCREATE => 'LBL_QUICKCREATE', |
| 263 | - ) ; |
|
| 263 | + ); |
|
| 264 | 264 | |
| 265 | - $layoutLabel = 'LBL_LAYOUTS' ; |
|
| 266 | - $layoutView = 'layouts' ; |
|
| 265 | + $layoutLabel = 'LBL_LAYOUTS'; |
|
| 266 | + $layoutView = 'layouts'; |
|
| 267 | 267 | |
| 268 | 268 | |
| 269 | - $ajax = new AjaxCompose ( ) ; |
|
| 269 | + $ajax = new AjaxCompose( ); |
|
| 270 | 270 | |
| 271 | - $translatedViewType = '' ; |
|
| 272 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
| 273 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
| 271 | + $translatedViewType = ''; |
|
| 272 | + if (isset ($labels [strtolower($this->editLayout)])) |
|
| 273 | + $translatedViewType = translate($labels [strtolower($this->editLayout)], 'ModuleBuilder'); |
|
| 274 | 274 | else if (isset($this->sm)) |
| 275 | 275 | { |
| 276 | - foreach($this->sm->sources as $file => $def) |
|
| 276 | + foreach ($this->sm->sources as $file => $def) |
|
| 277 | 277 | { |
| 278 | 278 | if (!empty($def['view']) && $def['view'] == $this->editLayout && !empty($def['name'])) |
| 279 | 279 | { |
| 280 | 280 | $translatedViewType = $def['name']; |
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | - if(empty($translatedViewType)) |
|
| 283 | + if (empty($translatedViewType)) |
|
| 284 | 284 | { |
| 285 | - $label = "LBL_" . strtoupper($this->editLayout); |
|
| 285 | + $label = "LBL_".strtoupper($this->editLayout); |
|
| 286 | 286 | $translated = translate($label, $this->editModule); |
| 287 | 287 | if ($translated != $label) |
| 288 | - $translatedViewType = $translated; |
|
| 288 | + $translatedViewType = $translated; |
|
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
@@ -294,34 +294,34 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | if ($this->fromModuleBuilder) |
| 296 | 296 | { |
| 297 | - $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ; |
|
| 298 | - $ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $this->package . '")' ) ; |
|
| 299 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $this->package . '&view_module=' . $this->editModule . '")' ) ; |
|
| 300 | - $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
| 301 | - $ajax->addCrumb ( $translatedViewType, '' ) ; |
|
| 297 | + $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")'); |
|
| 298 | + $ajax->addCrumb($this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$this->package.'")'); |
|
| 299 | + $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$this->package.'&view_module='.$this->editModule.'")'); |
|
| 300 | + $ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view='.$layoutView.'&view_module='.$this->editModule.'&view_package='.$this->package.'")'); |
|
| 301 | + $ajax->addCrumb($translatedViewType, ''); |
|
| 302 | 302 | } else |
| 303 | 303 | { |
| 304 | - $ajax->addCrumb ( translate ( 'LBL_STUDIO', 'ModuleBuilder' ), 'ModuleBuilder.main("studio")' ) ; |
|
| 305 | - $ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' ) ; |
|
| 306 | - $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '")' ) ; |
|
| 307 | - $ajax->addCrumb ( $translatedViewType, '' ) ; |
|
| 304 | + $ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.main("studio")'); |
|
| 305 | + $ajax->addCrumb($this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->editModule.'")'); |
|
| 306 | + $ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module='.$this->editModule.'")'); |
|
| 307 | + $ajax->addCrumb($translatedViewType, ''); |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | // set up language files |
| 311 | - $smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template |
|
| 312 | - $smarty->assign('from_mb',$this->fromModuleBuilder); |
|
| 311 | + $smarty->assign('language', $parser->getLanguage()); // for sugar_translate in the smarty template |
|
| 312 | + $smarty->assign('from_mb', $this->fromModuleBuilder); |
|
| 313 | 313 | $smarty->assign('calc_field_list', json_encode($parser->getCalculatedFields())); |
| 314 | 314 | if ($this->fromModuleBuilder) { |
| 315 | - $mb = new ModuleBuilder ( ) ; |
|
| 316 | - $module = & $mb->getPackageModule ( $this->package, $this->editModule ) ; |
|
| 315 | + $mb = new ModuleBuilder( ); |
|
| 316 | + $module = & $mb->getPackageModule($this->package, $this->editModule); |
|
| 317 | 317 | $smarty->assign('current_mod_strings', $module->getModStrings()); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - $ajax->addSection ( 'center', $translatedViewType, $smarty->fetch ( 'modules/ModuleBuilder/tpls/layoutView.tpl' ) ) ; |
|
| 320 | + $ajax->addSection('center', $translatedViewType, $smarty->fetch('modules/ModuleBuilder/tpls/layoutView.tpl')); |
|
| 321 | 321 | if ($preview) { |
| 322 | - echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' ); |
|
| 322 | + echo $smarty->fetch('modules/ModuleBuilder/tpls/Preview/layoutView.tpl'); |
|
| 323 | 323 | } else { |
| 324 | - echo $ajax->getJavascript () ; |
|
| 324 | + echo $ajax->getJavascript(); |
|
| 325 | 325 | } |
| 326 | 326 | } |
| 327 | 327 | } |
@@ -1,6 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined ( 'sugarEntry' ) || ! sugarEntry) |
|
| 2 | +if (! defined ( 'sugarEntry' ) || ! sugarEntry) { |
|
| 3 | 3 | die ( 'Not A Valid Entry Point' ) ; |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /********************************************************************************* |
| 6 | 7 | * SugarCRM Community Edition is a customer relationship management program developed by |
@@ -75,8 +76,7 @@ discard block |
||
| 75 | 76 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
| 76 | 77 | if(isset($GLOBALS['log'])) { |
| 77 | 78 | $GLOBALS['log']->deprecated($deprecatedMessage); |
| 78 | - } |
|
| 79 | - else { |
|
| 79 | + } else { |
|
| 80 | 80 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
| 81 | 81 | } |
| 82 | 82 | self::__construct(); |
@@ -269,9 +269,9 @@ discard block |
||
| 269 | 269 | $ajax = new AjaxCompose ( ) ; |
| 270 | 270 | |
| 271 | 271 | $translatedViewType = '' ; |
| 272 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
| 273 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
| 274 | - else if (isset($this->sm)) |
|
| 272 | + if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) { |
|
| 273 | + $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
| 274 | + } else if (isset($this->sm)) |
|
| 275 | 275 | { |
| 276 | 276 | foreach($this->sm->sources as $file => $def) |
| 277 | 277 | { |
@@ -284,8 +284,9 @@ discard block |
||
| 284 | 284 | { |
| 285 | 285 | $label = "LBL_" . strtoupper($this->editLayout); |
| 286 | 286 | $translated = translate($label, $this->editModule); |
| 287 | - if ($translated != $label) |
|
| 288 | - $translatedViewType = $translated; |
|
| 287 | + if ($translated != $label) { |
|
| 288 | + $translatedViewType = $translated; |
|
| 289 | + } |
|
| 289 | 290 | } |
| 290 | 291 | } |
| 291 | 292 | |
@@ -42,28 +42,28 @@ discard block |
||
| 42 | 42 | require_once("include/utils/db_utils.php"); |
| 43 | 43 | |
| 44 | 44 | class jsAlerts{ |
| 45 | - var $script; |
|
| 45 | + var $script; |
|
| 46 | 46 | |
| 47 | 47 | public function __construct() { |
| 48 | - global $app_strings; |
|
| 49 | - $this->script .= <<<EOQ |
|
| 48 | + global $app_strings; |
|
| 49 | + $this->script .= <<<EOQ |
|
| 50 | 50 | if (!alertsTimeoutId) { |
| 51 | 51 | checkAlerts(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | EOQ; |
| 55 | - $this->addActivities(); |
|
| 56 | - Reminder::addNotifications($this); |
|
| 57 | - if(!empty($GLOBALS['sugar_config']['enable_timeout_alerts'])){ |
|
| 58 | - $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_1'], (session_cache_expire() - 2) * 60 ); |
|
| 59 | - $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_2'], (session_cache_expire()) * 60 , 'index.php'); |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - function addAlert($type, $name, $subtitle, $description, $countdown, $redirect='') |
|
| 55 | + $this->addActivities(); |
|
| 56 | + Reminder::addNotifications($this); |
|
| 57 | + if(!empty($GLOBALS['sugar_config']['enable_timeout_alerts'])){ |
|
| 58 | + $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_1'], (session_cache_expire() - 2) * 60 ); |
|
| 59 | + $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_2'], (session_cache_expire()) * 60 , 'index.php'); |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + function addAlert($type, $name, $subtitle, $description, $countdown, $redirect='') |
|
| 63 | 63 | { |
| 64 | - $script = 'addAlert(' . json_encode($type) .',' . json_encode($name). ',' . json_encode($subtitle). ','. json_encode(str_replace(array("\r", "\n"), array('','<br>'),$description)) . ',' . $countdown . ','.json_encode($redirect).');' . "\n"; |
|
| 64 | + $script = 'addAlert(' . json_encode($type) .',' . json_encode($name). ',' . json_encode($subtitle). ','. json_encode(str_replace(array("\r", "\n"), array('','<br>'),$description)) . ',' . $countdown . ','.json_encode($redirect).');' . "\n"; |
|
| 65 | 65 | $this->script .= $script; |
| 66 | - } |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | 68 | function getScript() |
| 69 | 69 | { |
@@ -87,29 +87,29 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | function addActivities(){ |
| 90 | - global $app_list_strings, $timedate, $current_user, $app_strings; |
|
| 91 | - global $sugar_config; |
|
| 90 | + global $app_list_strings, $timedate, $current_user, $app_strings; |
|
| 91 | + global $sugar_config; |
|
| 92 | 92 | |
| 93 | - if (empty($current_user->id)) { |
|
| 93 | + if (empty($current_user->id)) { |
|
| 94 | 94 | return; |
| 95 | - } |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | 97 | //Create separate variable to hold timedate value |
| 98 | 98 | $alertDateTimeNow = $timedate->nowDb(); |
| 99 | 99 | |
| 100 | - // cn: get a boundary limiter |
|
| 101 | - $dateTimeMax = $timedate->getNow()->modify("+{$app_list_strings['reminder_max_time']} seconds")->asDb(); |
|
| 102 | - $dateTimeNow = $timedate->nowDb(); |
|
| 100 | + // cn: get a boundary limiter |
|
| 101 | + $dateTimeMax = $timedate->getNow()->modify("+{$app_list_strings['reminder_max_time']} seconds")->asDb(); |
|
| 102 | + $dateTimeNow = $timedate->nowDb(); |
|
| 103 | 103 | |
| 104 | - global $db; |
|
| 105 | - $dateTimeNow = $db->convert($db->quoted($dateTimeNow), 'datetime'); |
|
| 106 | - $dateTimeMax = $db->convert($db->quoted($dateTimeMax), 'datetime'); |
|
| 107 | - $desc = $db->convert("description", "text2char"); |
|
| 108 | - if($desc != "description") { |
|
| 109 | - $desc .= " description"; |
|
| 110 | - } |
|
| 104 | + global $db; |
|
| 105 | + $dateTimeNow = $db->convert($db->quoted($dateTimeNow), 'datetime'); |
|
| 106 | + $dateTimeMax = $db->convert($db->quoted($dateTimeMax), 'datetime'); |
|
| 107 | + $desc = $db->convert("description", "text2char"); |
|
| 108 | + if($desc != "description") { |
|
| 109 | + $desc .= " description"; |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | - // Prep Meetings Query |
|
| 112 | + // Prep Meetings Query |
|
| 113 | 113 | $selectMeetings = "SELECT meetings.id, name,reminder_time, $desc,location, status, parent_type, parent_id, date_start, assigned_user_id |
| 114 | 114 | FROM meetings LEFT JOIN meetings_users ON meetings.id = meetings_users.meeting_id |
| 115 | 115 | WHERE meetings_users.user_id ='".$current_user->id."' |
@@ -119,61 +119,61 @@ discard block |
||
| 119 | 119 | AND meetings.status = 'Planned' |
| 120 | 120 | AND date_start >= $dateTimeNow |
| 121 | 121 | AND date_start <= $dateTimeMax"; |
| 122 | - $result = $db->query($selectMeetings); |
|
| 123 | - |
|
| 124 | - /////////////////////////////////////////////////////////////////////// |
|
| 125 | - //// MEETING INTEGRATION |
|
| 126 | - $meetingIntegration = null; |
|
| 127 | - if(isset($sugar_config['meeting_integration']) && !empty($sugar_config['meeting_integration'])) { |
|
| 128 | - if(!class_exists($sugar_config['meeting_integration'])) { |
|
| 129 | - require_once("modules/{$sugar_config['meeting_integration']}/{$sugar_config['meeting_integration']}.php"); |
|
| 130 | - } |
|
| 131 | - $meetingIntegration = new $sugar_config['meeting_integration'](); |
|
| 132 | - } |
|
| 133 | - //// END MEETING INTEGRATION |
|
| 134 | - /////////////////////////////////////////////////////////////////////// |
|
| 135 | - |
|
| 136 | - while($row = $db->fetchByAssoc($result)) { |
|
| 137 | - // need to concatenate since GMT times can bridge two local days |
|
| 138 | - $timeStart = strtotime($db->fromConvert($row['date_start'], 'datetime')); |
|
| 139 | - $timeRemind = $row['reminder_time']; |
|
| 140 | - $timeStart -= $timeRemind; |
|
| 141 | - |
|
| 142 | - $url = 'index.php?action=DetailView&module=Meetings&record=' . $row['id']; |
|
| 143 | - $instructions = $app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING_MSG']; |
|
| 144 | - |
|
| 145 | - /////////////////////////////////////////////////////////////////// |
|
| 146 | - //// MEETING INTEGRATION |
|
| 147 | - if(!empty($meetingIntegration) && $meetingIntegration->isIntegratedMeeting($row['id'])) { |
|
| 148 | - $url = $meetingIntegration->miUrlGetJsAlert($row); |
|
| 149 | - $instructions = $meetingIntegration->miGetJsAlertInstructions(); |
|
| 150 | - } |
|
| 151 | - //// END MEETING INTEGRATION |
|
| 152 | - /////////////////////////////////////////////////////////////////// |
|
| 153 | - |
|
| 154 | - $meetingName = from_html($row['name']); |
|
| 155 | - $desc1 = from_html($row['description']); |
|
| 156 | - $location = from_html($row['location']); |
|
| 122 | + $result = $db->query($selectMeetings); |
|
| 123 | + |
|
| 124 | + /////////////////////////////////////////////////////////////////////// |
|
| 125 | + //// MEETING INTEGRATION |
|
| 126 | + $meetingIntegration = null; |
|
| 127 | + if(isset($sugar_config['meeting_integration']) && !empty($sugar_config['meeting_integration'])) { |
|
| 128 | + if(!class_exists($sugar_config['meeting_integration'])) { |
|
| 129 | + require_once("modules/{$sugar_config['meeting_integration']}/{$sugar_config['meeting_integration']}.php"); |
|
| 130 | + } |
|
| 131 | + $meetingIntegration = new $sugar_config['meeting_integration'](); |
|
| 132 | + } |
|
| 133 | + //// END MEETING INTEGRATION |
|
| 134 | + /////////////////////////////////////////////////////////////////////// |
|
| 135 | + |
|
| 136 | + while($row = $db->fetchByAssoc($result)) { |
|
| 137 | + // need to concatenate since GMT times can bridge two local days |
|
| 138 | + $timeStart = strtotime($db->fromConvert($row['date_start'], 'datetime')); |
|
| 139 | + $timeRemind = $row['reminder_time']; |
|
| 140 | + $timeStart -= $timeRemind; |
|
| 141 | + |
|
| 142 | + $url = 'index.php?action=DetailView&module=Meetings&record=' . $row['id']; |
|
| 143 | + $instructions = $app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING_MSG']; |
|
| 144 | + |
|
| 145 | + /////////////////////////////////////////////////////////////////// |
|
| 146 | + //// MEETING INTEGRATION |
|
| 147 | + if(!empty($meetingIntegration) && $meetingIntegration->isIntegratedMeeting($row['id'])) { |
|
| 148 | + $url = $meetingIntegration->miUrlGetJsAlert($row); |
|
| 149 | + $instructions = $meetingIntegration->miGetJsAlertInstructions(); |
|
| 150 | + } |
|
| 151 | + //// END MEETING INTEGRATION |
|
| 152 | + /////////////////////////////////////////////////////////////////// |
|
| 153 | + |
|
| 154 | + $meetingName = from_html($row['name']); |
|
| 155 | + $desc1 = from_html($row['description']); |
|
| 156 | + $location = from_html($row['location']); |
|
| 157 | 157 | |
| 158 | 158 | $relatedToMeeting = $this->getRelatedName($row['parent_type'], $row['parent_id']); |
| 159 | 159 | |
| 160 | - $description = empty($desc1) ? '' : $app_strings['MSG_JS_ALERT_MTG_REMINDER_AGENDA'].$desc1."\n"; |
|
| 160 | + $description = empty($desc1) ? '' : $app_strings['MSG_JS_ALERT_MTG_REMINDER_AGENDA'].$desc1."\n"; |
|
| 161 | 161 | $description = $description ."\n" .$app_strings['MSG_JS_ALERT_MTG_REMINDER_STATUS'] . $row['status'] ."\n". $app_strings['MSG_JS_ALERT_MTG_REMINDER_RELATED_TO']. $relatedToMeeting; |
| 162 | 162 | |
| 163 | 163 | |
| 164 | - // standard functionality |
|
| 165 | - $this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING'], $meetingName, |
|
| 166 | - $app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($db->fromConvert($row['date_start'], 'datetime')), |
|
| 167 | - $app_strings['MSG_JS_ALERT_MTG_REMINDER_LOC'].$location. |
|
| 168 | - $description. |
|
| 169 | - $instructions, |
|
| 170 | - $timeStart - strtotime($alertDateTimeNow), |
|
| 171 | - $url |
|
| 172 | - ); |
|
| 173 | - } |
|
| 164 | + // standard functionality |
|
| 165 | + $this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING'], $meetingName, |
|
| 166 | + $app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($db->fromConvert($row['date_start'], 'datetime')), |
|
| 167 | + $app_strings['MSG_JS_ALERT_MTG_REMINDER_LOC'].$location. |
|
| 168 | + $description. |
|
| 169 | + $instructions, |
|
| 170 | + $timeStart - strtotime($alertDateTimeNow), |
|
| 171 | + $url |
|
| 172 | + ); |
|
| 173 | + } |
|
| 174 | 174 | |
| 175 | - // Prep Calls Query |
|
| 176 | - $selectCalls = " |
|
| 175 | + // Prep Calls Query |
|
| 176 | + $selectCalls = " |
|
| 177 | 177 | SELECT calls.id, name, reminder_time, $desc, date_start, status, parent_type, parent_id |
| 178 | 178 | FROM calls LEFT JOIN calls_users ON calls.id = calls_users.call_id |
| 179 | 179 | WHERE calls_users.user_id ='".$current_user->id."' |
@@ -184,14 +184,14 @@ discard block |
||
| 184 | 184 | AND date_start >= $dateTimeNow |
| 185 | 185 | AND date_start <= $dateTimeMax"; |
| 186 | 186 | |
| 187 | - $result = $db->query($selectCalls); |
|
| 187 | + $result = $db->query($selectCalls); |
|
| 188 | 188 | |
| 189 | - while($row = $db->fetchByAssoc($result)){ |
|
| 190 | - // need to concatenate since GMT times can bridge two local days |
|
| 191 | - $timeStart = strtotime($db->fromConvert($row['date_start'], 'datetime')); |
|
| 192 | - $timeRemind = $row['reminder_time']; |
|
| 193 | - $timeStart -= $timeRemind; |
|
| 194 | - $row['description'] = (isset($row['description'])) ? $row['description'] : ''; |
|
| 189 | + while($row = $db->fetchByAssoc($result)){ |
|
| 190 | + // need to concatenate since GMT times can bridge two local days |
|
| 191 | + $timeStart = strtotime($db->fromConvert($row['date_start'], 'datetime')); |
|
| 192 | + $timeRemind = $row['reminder_time']; |
|
| 193 | + $timeStart -= $timeRemind; |
|
| 194 | + $row['description'] = (isset($row['description'])) ? $row['description'] : ''; |
|
| 195 | 195 | |
| 196 | 196 | $relatedToCall = $this->getRelatedName($row['parent_type'], $row['parent_id']); |
| 197 | 197 | |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | |
| 201 | 201 | $this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_CALL'], $row['name'], $app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($db->fromConvert($row['date_start'], 'datetime')) , $app_strings['MSG_JS_ALERT_MTG_REMINDER_DESC'].$callDescription , $timeStart - strtotime($alertDateTimeNow), 'index.php?action=DetailView&module=Calls&record=' . $row['id']); |
| 202 | - } |
|
| 203 | - } |
|
| 202 | + } |
|
| 203 | + } |
|
| 204 | 204 | |
| 205 | 205 | |
| 206 | 206 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | require_once("include/utils/db_utils.php"); |
| 43 | 43 | |
| 44 | -class jsAlerts{ |
|
| 44 | +class jsAlerts { |
|
| 45 | 45 | var $script; |
| 46 | 46 | |
| 47 | 47 | public function __construct() { |
@@ -54,20 +54,20 @@ discard block |
||
| 54 | 54 | EOQ; |
| 55 | 55 | $this->addActivities(); |
| 56 | 56 | Reminder::addNotifications($this); |
| 57 | - if(!empty($GLOBALS['sugar_config']['enable_timeout_alerts'])){ |
|
| 58 | - $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_1'], (session_cache_expire() - 2) * 60 ); |
|
| 59 | - $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_2'], (session_cache_expire()) * 60 , 'index.php'); |
|
| 57 | + if (!empty($GLOBALS['sugar_config']['enable_timeout_alerts'])) { |
|
| 58 | + $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'], '', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_1'], (session_cache_expire() - 2) * 60); |
|
| 59 | + $this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'], '', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_2'], (session_cache_expire()) * 60, 'index.php'); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | - function addAlert($type, $name, $subtitle, $description, $countdown, $redirect='') |
|
| 62 | + function addAlert($type, $name, $subtitle, $description, $countdown, $redirect = '') |
|
| 63 | 63 | { |
| 64 | - $script = 'addAlert(' . json_encode($type) .',' . json_encode($name). ',' . json_encode($subtitle). ','. json_encode(str_replace(array("\r", "\n"), array('','<br>'),$description)) . ',' . $countdown . ','.json_encode($redirect).');' . "\n"; |
|
| 64 | + $script = 'addAlert('.json_encode($type).','.json_encode($name).','.json_encode($subtitle).','.json_encode(str_replace(array("\r", "\n"), array('', '<br>'), $description)).','.$countdown.','.json_encode($redirect).');'."\n"; |
|
| 65 | 65 | $this->script .= $script; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | function getScript() |
| 69 | 69 | { |
| 70 | - return "<script>secondsSinceLoad = 0; alertList = [];" . $this->script . "</script>"; |
|
| 70 | + return "<script>secondsSinceLoad = 0; alertList = [];".$this->script."</script>"; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /* |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return ''; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - function addActivities(){ |
|
| 89 | + function addActivities() { |
|
| 90 | 90 | global $app_list_strings, $timedate, $current_user, $app_strings; |
| 91 | 91 | global $sugar_config; |
| 92 | 92 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $dateTimeNow = $db->convert($db->quoted($dateTimeNow), 'datetime'); |
| 106 | 106 | $dateTimeMax = $db->convert($db->quoted($dateTimeMax), 'datetime'); |
| 107 | 107 | $desc = $db->convert("description", "text2char"); |
| 108 | - if($desc != "description") { |
|
| 108 | + if ($desc != "description") { |
|
| 109 | 109 | $desc .= " description"; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | /////////////////////////////////////////////////////////////////////// |
| 125 | 125 | //// MEETING INTEGRATION |
| 126 | 126 | $meetingIntegration = null; |
| 127 | - if(isset($sugar_config['meeting_integration']) && !empty($sugar_config['meeting_integration'])) { |
|
| 128 | - if(!class_exists($sugar_config['meeting_integration'])) { |
|
| 127 | + if (isset($sugar_config['meeting_integration']) && !empty($sugar_config['meeting_integration'])) { |
|
| 128 | + if (!class_exists($sugar_config['meeting_integration'])) { |
|
| 129 | 129 | require_once("modules/{$sugar_config['meeting_integration']}/{$sugar_config['meeting_integration']}.php"); |
| 130 | 130 | } |
| 131 | 131 | $meetingIntegration = new $sugar_config['meeting_integration'](); |
@@ -133,18 +133,18 @@ discard block |
||
| 133 | 133 | //// END MEETING INTEGRATION |
| 134 | 134 | /////////////////////////////////////////////////////////////////////// |
| 135 | 135 | |
| 136 | - while($row = $db->fetchByAssoc($result)) { |
|
| 136 | + while ($row = $db->fetchByAssoc($result)) { |
|
| 137 | 137 | // need to concatenate since GMT times can bridge two local days |
| 138 | 138 | $timeStart = strtotime($db->fromConvert($row['date_start'], 'datetime')); |
| 139 | 139 | $timeRemind = $row['reminder_time']; |
| 140 | 140 | $timeStart -= $timeRemind; |
| 141 | 141 | |
| 142 | - $url = 'index.php?action=DetailView&module=Meetings&record=' . $row['id']; |
|
| 142 | + $url = 'index.php?action=DetailView&module=Meetings&record='.$row['id']; |
|
| 143 | 143 | $instructions = $app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING_MSG']; |
| 144 | 144 | |
| 145 | 145 | /////////////////////////////////////////////////////////////////// |
| 146 | 146 | //// MEETING INTEGRATION |
| 147 | - if(!empty($meetingIntegration) && $meetingIntegration->isIntegratedMeeting($row['id'])) { |
|
| 147 | + if (!empty($meetingIntegration) && $meetingIntegration->isIntegratedMeeting($row['id'])) { |
|
| 148 | 148 | $url = $meetingIntegration->miUrlGetJsAlert($row); |
| 149 | 149 | $instructions = $meetingIntegration->miGetJsAlertInstructions(); |
| 150 | 150 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $relatedToMeeting = $this->getRelatedName($row['parent_type'], $row['parent_id']); |
| 159 | 159 | |
| 160 | 160 | $description = empty($desc1) ? '' : $app_strings['MSG_JS_ALERT_MTG_REMINDER_AGENDA'].$desc1."\n"; |
| 161 | - $description = $description ."\n" .$app_strings['MSG_JS_ALERT_MTG_REMINDER_STATUS'] . $row['status'] ."\n". $app_strings['MSG_JS_ALERT_MTG_REMINDER_RELATED_TO']. $relatedToMeeting; |
|
| 161 | + $description = $description."\n".$app_strings['MSG_JS_ALERT_MTG_REMINDER_STATUS'].$row['status']."\n".$app_strings['MSG_JS_ALERT_MTG_REMINDER_RELATED_TO'].$relatedToMeeting; |
|
| 162 | 162 | |
| 163 | 163 | |
| 164 | 164 | // standard functionality |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $result = $db->query($selectCalls); |
| 188 | 188 | |
| 189 | - while($row = $db->fetchByAssoc($result)){ |
|
| 189 | + while ($row = $db->fetchByAssoc($result)) { |
|
| 190 | 190 | // need to concatenate since GMT times can bridge two local days |
| 191 | 191 | $timeStart = strtotime($db->fromConvert($row['date_start'], 'datetime')); |
| 192 | 192 | $timeRemind = $row['reminder_time']; |
@@ -195,10 +195,10 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $relatedToCall = $this->getRelatedName($row['parent_type'], $row['parent_id']); |
| 197 | 197 | |
| 198 | - $callDescription = $row['description'] ."\n" .$app_strings['MSG_JS_ALERT_MTG_REMINDER_STATUS'] . $row['status'] ."\n". $app_strings['MSG_JS_ALERT_MTG_REMINDER_RELATED_TO']. $relatedToCall; |
|
| 198 | + $callDescription = $row['description']."\n".$app_strings['MSG_JS_ALERT_MTG_REMINDER_STATUS'].$row['status']."\n".$app_strings['MSG_JS_ALERT_MTG_REMINDER_RELATED_TO'].$relatedToCall; |
|
| 199 | 199 | |
| 200 | 200 | |
| 201 | - $this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_CALL'], $row['name'], $app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($db->fromConvert($row['date_start'], 'datetime')) , $app_strings['MSG_JS_ALERT_MTG_REMINDER_DESC'].$callDescription , $timeStart - strtotime($alertDateTimeNow), 'index.php?action=DetailView&module=Calls&record=' . $row['id']); |
|
| 201 | + $this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_CALL'], $row['name'], $app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($db->fromConvert($row['date_start'], 'datetime')), $app_strings['MSG_JS_ALERT_MTG_REMINDER_DESC'].$callDescription, $timeStart - strtotime($alertDateTimeNow), 'index.php?action=DetailView&module=Calls&record='.$row['id']); |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | class DetailViewMetaParser extends MetaParser { |
| 60 | 60 | |
| 61 | 61 | function __construct() { |
| 62 | - $this->mView = 'DetailView'; |
|
| 62 | + $this->mView = 'DetailView'; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | // Notes DetailView.html file is messed up |
| 87 | 87 | if($moduleDir == 'Notes') { |
| 88 | - $contents = str_replace('{PAGINATION}<tr><td>', '{PAGINATION}', $contents); |
|
| 89 | - $contents = str_replace('</td></tr></table><script>', '</table><script>', $contents); |
|
| 90 | - $contents = str_replace("<tr><div id='portal_flag_row' name='portal_flag_row' style='display:none'>", "<div id='portal_flag_row' name='portal_flag_row' style='display:none'>", $contents); |
|
| 88 | + $contents = str_replace('{PAGINATION}<tr><td>', '{PAGINATION}', $contents); |
|
| 89 | + $contents = str_replace('</td></tr></table><script>', '</table><script>', $contents); |
|
| 90 | + $contents = str_replace("<tr><div id='portal_flag_row' name='portal_flag_row' style='display:none'>", "<div id='portal_flag_row' name='portal_flag_row' style='display:none'>", $contents); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $contents = $this->fixDuplicateTrTags($contents); |
@@ -104,75 +104,75 @@ discard block |
||
| 104 | 104 | $metarow = array(); |
| 105 | 105 | foreach($tables as $table) { |
| 106 | 106 | |
| 107 | - $table = $this->fixTablesWithMissingTr($table); |
|
| 108 | - $tablerows = $this->getElementsByType("tr", $table); |
|
| 109 | - |
|
| 110 | - foreach($tablerows as $trow) { |
|
| 111 | - |
|
| 112 | - $metacolumns = array(); |
|
| 113 | - $columns = $this->getElementsByType("td", $trow); |
|
| 114 | - $columns = array_reverse($columns, true); |
|
| 115 | - foreach($columns as $tcols) { |
|
| 116 | - |
|
| 117 | - $sugarAttrValue = $this->getTagAttribute("sugar", $tcols, "'slot[0-9]+b$'"); |
|
| 118 | - if(empty($sugarAttrValue)) { |
|
| 119 | - continue; |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - $def = ''; |
|
| 123 | - $field = $this->getElementValue("span", $tcols); |
|
| 124 | - //If it's a space, simply add a blank string |
|
| 125 | - if($field == ' ') { |
|
| 126 | - $metacolumns[] = ""; |
|
| 127 | - } else if(!empty($field)) { |
|
| 128 | - |
|
| 129 | - preg_match_all('/[\{]([^\}].*?)[\}]/s', $field, $matches, PREG_SET_ORDER); |
|
| 130 | - if(!empty($matches)) { |
|
| 131 | - if(count($matches) > 1) { |
|
| 132 | - |
|
| 133 | - $def = array(); |
|
| 134 | - |
|
| 135 | - $def['name'] = preg_match('/_c$/i', $matches[0][1]) ? $matches[0][1] : strtolower($matches[0][1]); |
|
| 136 | - foreach($matches as $m) { |
|
| 137 | - if(isset($vardefs[strtolower($m[1])])) { |
|
| 138 | - $def['name'] = strtolower($m[1]); |
|
| 139 | - } |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - $field = preg_replace('/<\{tag\.[a-z_]*?\}/i', '<a', $field); |
|
| 143 | - $field = preg_replace('/<\/\{tag\.[a-z_]*?\}>/i', '</a>', $field); |
|
| 144 | - |
|
| 145 | - foreach($matches as $tag[1]) { |
|
| 146 | - if(preg_match("/^(mod[\.]|app[\.]).*?/i", $tag[1][1])) { |
|
| 147 | - $field = str_replace($tag[1][1], '$'.$tag[1][1], $field); |
|
| 148 | - } else { |
|
| 149 | - $theField = preg_match('/_c$/i', $tag[1][1]) ? $tag[1][1] : strtolower($tag[1][1]); |
|
| 150 | - if(!empty($vardefs[$theField])) { |
|
| 151 | - $field = str_replace($tag[1][1], '$fields.'. $theField.'.value', $field); |
|
| 152 | - } else { |
|
| 153 | - $phpName = $this->findAssignedVariableName($tag[1][1], $filePath); |
|
| 154 | - $field = str_replace($tag[1][1], '$fields.'. $theField.'.value', $field); |
|
| 155 | - } //if-else |
|
| 156 | - } |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - $def['customCode'] = $field; |
|
| 160 | - $def['description'] = 'This field was auto generated'; |
|
| 161 | - } else { |
|
| 162 | - $def = strtolower($matches[0][1]); |
|
| 163 | - } |
|
| 164 | - } //if |
|
| 165 | - $metacolumns[] = $def; |
|
| 166 | - } //if |
|
| 167 | - } //foreach($tablecolumns as $tcols) |
|
| 168 | - |
|
| 169 | - $metarow[] = array_reverse($metacolumns); |
|
| 170 | - } //foreach($tablerows as $trow) |
|
| 171 | - |
|
| 172 | - |
|
| 173 | - $id = $tableCount == 0 ? 'default' : $tableCount; |
|
| 174 | - $tableCount++; |
|
| 175 | - $panels[$id] = $metarow; |
|
| 107 | + $table = $this->fixTablesWithMissingTr($table); |
|
| 108 | + $tablerows = $this->getElementsByType("tr", $table); |
|
| 109 | + |
|
| 110 | + foreach($tablerows as $trow) { |
|
| 111 | + |
|
| 112 | + $metacolumns = array(); |
|
| 113 | + $columns = $this->getElementsByType("td", $trow); |
|
| 114 | + $columns = array_reverse($columns, true); |
|
| 115 | + foreach($columns as $tcols) { |
|
| 116 | + |
|
| 117 | + $sugarAttrValue = $this->getTagAttribute("sugar", $tcols, "'slot[0-9]+b$'"); |
|
| 118 | + if(empty($sugarAttrValue)) { |
|
| 119 | + continue; |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + $def = ''; |
|
| 123 | + $field = $this->getElementValue("span", $tcols); |
|
| 124 | + //If it's a space, simply add a blank string |
|
| 125 | + if($field == ' ') { |
|
| 126 | + $metacolumns[] = ""; |
|
| 127 | + } else if(!empty($field)) { |
|
| 128 | + |
|
| 129 | + preg_match_all('/[\{]([^\}].*?)[\}]/s', $field, $matches, PREG_SET_ORDER); |
|
| 130 | + if(!empty($matches)) { |
|
| 131 | + if(count($matches) > 1) { |
|
| 132 | + |
|
| 133 | + $def = array(); |
|
| 134 | + |
|
| 135 | + $def['name'] = preg_match('/_c$/i', $matches[0][1]) ? $matches[0][1] : strtolower($matches[0][1]); |
|
| 136 | + foreach($matches as $m) { |
|
| 137 | + if(isset($vardefs[strtolower($m[1])])) { |
|
| 138 | + $def['name'] = strtolower($m[1]); |
|
| 139 | + } |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + $field = preg_replace('/<\{tag\.[a-z_]*?\}/i', '<a', $field); |
|
| 143 | + $field = preg_replace('/<\/\{tag\.[a-z_]*?\}>/i', '</a>', $field); |
|
| 144 | + |
|
| 145 | + foreach($matches as $tag[1]) { |
|
| 146 | + if(preg_match("/^(mod[\.]|app[\.]).*?/i", $tag[1][1])) { |
|
| 147 | + $field = str_replace($tag[1][1], '$'.$tag[1][1], $field); |
|
| 148 | + } else { |
|
| 149 | + $theField = preg_match('/_c$/i', $tag[1][1]) ? $tag[1][1] : strtolower($tag[1][1]); |
|
| 150 | + if(!empty($vardefs[$theField])) { |
|
| 151 | + $field = str_replace($tag[1][1], '$fields.'. $theField.'.value', $field); |
|
| 152 | + } else { |
|
| 153 | + $phpName = $this->findAssignedVariableName($tag[1][1], $filePath); |
|
| 154 | + $field = str_replace($tag[1][1], '$fields.'. $theField.'.value', $field); |
|
| 155 | + } //if-else |
|
| 156 | + } |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + $def['customCode'] = $field; |
|
| 160 | + $def['description'] = 'This field was auto generated'; |
|
| 161 | + } else { |
|
| 162 | + $def = strtolower($matches[0][1]); |
|
| 163 | + } |
|
| 164 | + } //if |
|
| 165 | + $metacolumns[] = $def; |
|
| 166 | + } //if |
|
| 167 | + } //foreach($tablecolumns as $tcols) |
|
| 168 | + |
|
| 169 | + $metarow[] = array_reverse($metacolumns); |
|
| 170 | + } //foreach($tablerows as $trow) |
|
| 171 | + |
|
| 172 | + |
|
| 173 | + $id = $tableCount == 0 ? 'default' : $tableCount; |
|
| 174 | + $tableCount++; |
|
| 175 | + $panels[$id] = $metarow; |
|
| 176 | 176 | |
| 177 | 177 | } //foreach($tables as $table) |
| 178 | 178 | |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | $templateMeta = array(); |
| 183 | 183 | if($merge && !empty($masterCopy) && file_exists($masterCopy)) { |
| 184 | - $panels = $this->mergePanels($panels, $vardefs, $moduleDir, $masterCopy); |
|
| 185 | - $templateMeta = $this->mergeTemplateMeta($templateMeta, $moduleDir, $masterCopy); |
|
| 184 | + $panels = $this->mergePanels($panels, $vardefs, $moduleDir, $masterCopy); |
|
| 185 | + $templateMeta = $this->mergeTemplateMeta($templateMeta, $moduleDir, $masterCopy); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | $panels = $this->applyRules($moduleDir, $panels); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @param $masterCopy The file path of the mater copy of the metadata file to merge against |
| 74 | 74 | * @return String format of metadata contents |
| 75 | 75 | **/ |
| 76 | -function parse($filePath, $vardefs = array(), $moduleDir = '', $merge=false, $masterCopy=null) { |
|
| 76 | +function parse($filePath, $vardefs = array(), $moduleDir = '', $merge = false, $masterCopy = null) { |
|
| 77 | 77 | |
| 78 | 78 | // Grab file contents |
| 79 | 79 | $contents = file_get_contents($filePath); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | // Notes DetailView.html file is messed up |
| 87 | -if($moduleDir == 'Notes') { |
|
| 87 | +if ($moduleDir == 'Notes') { |
|
| 88 | 88 | $contents = str_replace('{PAGINATION}<tr><td>', '{PAGINATION}', $contents); |
| 89 | 89 | $contents = str_replace('</td></tr></table><script>', '</table><script>', $contents); |
| 90 | 90 | $contents = str_replace("<tr><div id='portal_flag_row' name='portal_flag_row' style='display:none'>", "<div id='portal_flag_row' name='portal_flag_row' style='display:none'>", $contents); |
@@ -102,39 +102,39 @@ discard block |
||
| 102 | 102 | $panels = array(); |
| 103 | 103 | $tableCount = 0; |
| 104 | 104 | $metarow = array(); |
| 105 | -foreach($tables as $table) { |
|
| 105 | +foreach ($tables as $table) { |
|
| 106 | 106 | |
| 107 | 107 | $table = $this->fixTablesWithMissingTr($table); |
| 108 | 108 | $tablerows = $this->getElementsByType("tr", $table); |
| 109 | 109 | |
| 110 | - foreach($tablerows as $trow) { |
|
| 110 | + foreach ($tablerows as $trow) { |
|
| 111 | 111 | |
| 112 | 112 | $metacolumns = array(); |
| 113 | 113 | $columns = $this->getElementsByType("td", $trow); |
| 114 | 114 | $columns = array_reverse($columns, true); |
| 115 | - foreach($columns as $tcols) { |
|
| 115 | + foreach ($columns as $tcols) { |
|
| 116 | 116 | |
| 117 | 117 | $sugarAttrValue = $this->getTagAttribute("sugar", $tcols, "'slot[0-9]+b$'"); |
| 118 | - if(empty($sugarAttrValue)) { |
|
| 118 | + if (empty($sugarAttrValue)) { |
|
| 119 | 119 | continue; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $def = ''; |
| 123 | 123 | $field = $this->getElementValue("span", $tcols); |
| 124 | 124 | //If it's a space, simply add a blank string |
| 125 | - if($field == ' ') { |
|
| 125 | + if ($field == ' ') { |
|
| 126 | 126 | $metacolumns[] = ""; |
| 127 | - } else if(!empty($field)) { |
|
| 127 | + } else if (!empty($field)) { |
|
| 128 | 128 | |
| 129 | 129 | preg_match_all('/[\{]([^\}].*?)[\}]/s', $field, $matches, PREG_SET_ORDER); |
| 130 | - if(!empty($matches)) { |
|
| 131 | - if(count($matches) > 1) { |
|
| 130 | + if (!empty($matches)) { |
|
| 131 | + if (count($matches) > 1) { |
|
| 132 | 132 | |
| 133 | 133 | $def = array(); |
| 134 | 134 | |
| 135 | 135 | $def['name'] = preg_match('/_c$/i', $matches[0][1]) ? $matches[0][1] : strtolower($matches[0][1]); |
| 136 | - foreach($matches as $m) { |
|
| 137 | - if(isset($vardefs[strtolower($m[1])])) { |
|
| 136 | + foreach ($matches as $m) { |
|
| 137 | + if (isset($vardefs[strtolower($m[1])])) { |
|
| 138 | 138 | $def['name'] = strtolower($m[1]); |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -142,16 +142,16 @@ discard block |
||
| 142 | 142 | $field = preg_replace('/<\{tag\.[a-z_]*?\}/i', '<a', $field); |
| 143 | 143 | $field = preg_replace('/<\/\{tag\.[a-z_]*?\}>/i', '</a>', $field); |
| 144 | 144 | |
| 145 | - foreach($matches as $tag[1]) { |
|
| 146 | - if(preg_match("/^(mod[\.]|app[\.]).*?/i", $tag[1][1])) { |
|
| 145 | + foreach ($matches as $tag[1]) { |
|
| 146 | + if (preg_match("/^(mod[\.]|app[\.]).*?/i", $tag[1][1])) { |
|
| 147 | 147 | $field = str_replace($tag[1][1], '$'.$tag[1][1], $field); |
| 148 | 148 | } else { |
| 149 | 149 | $theField = preg_match('/_c$/i', $tag[1][1]) ? $tag[1][1] : strtolower($tag[1][1]); |
| 150 | - if(!empty($vardefs[$theField])) { |
|
| 151 | - $field = str_replace($tag[1][1], '$fields.'. $theField.'.value', $field); |
|
| 150 | + if (!empty($vardefs[$theField])) { |
|
| 151 | + $field = str_replace($tag[1][1], '$fields.'.$theField.'.value', $field); |
|
| 152 | 152 | } else { |
| 153 | 153 | $phpName = $this->findAssignedVariableName($tag[1][1], $filePath); |
| 154 | - $field = str_replace($tag[1][1], '$fields.'. $theField.'.value', $field); |
|
| 154 | + $field = str_replace($tag[1][1], '$fields.'.$theField.'.value', $field); |
|
| 155 | 155 | } //if-else |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $panels = $this->applyPreRules($moduleDir, $panels); |
| 181 | 181 | |
| 182 | 182 | $templateMeta = array(); |
| 183 | -if($merge && !empty($masterCopy) && file_exists($masterCopy)) { |
|
| 183 | +if ($merge && !empty($masterCopy) && file_exists($masterCopy)) { |
|
| 184 | 184 | $panels = $this->mergePanels($panels, $vardefs, $moduleDir, $masterCopy); |
| 185 | 185 | $templateMeta = $this->mergeTemplateMeta($templateMeta, $moduleDir, $masterCopy); |
| 186 | 186 | } |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -46,60 +46,60 @@ discard block |
||
| 46 | 46 | class SugarWidgetSubPanelTopButton_c extends SugarWidget |
| 47 | 47 | { |
| 48 | 48 | var $module; |
| 49 | - var $title; |
|
| 50 | - var $access_key; |
|
| 51 | - var $form_value; |
|
| 52 | - var $additional_form_fields; |
|
| 53 | - var $acl; |
|
| 49 | + var $title; |
|
| 50 | + var $access_key; |
|
| 51 | + var $form_value; |
|
| 52 | + var $additional_form_fields; |
|
| 53 | + var $acl; |
|
| 54 | 54 | |
| 55 | 55 | //TODO rename defines to layout defs and make it a member variable instead of passing it multiple layers with extra copying. |
| 56 | 56 | |
| 57 | - /** Take the keys for the strings and look them up. Module is literal, the rest are label keys |
|
| 58 | - */ |
|
| 59 | - function __construct($module='', $title='', $access_key='', $form_value='') |
|
| 60 | - { |
|
| 61 | - global $app_strings; |
|
| 62 | - |
|
| 63 | - if(is_array($module)) |
|
| 64 | - { |
|
| 65 | - // it is really the class details from the mapping |
|
| 66 | - $class_details = $module; |
|
| 67 | - |
|
| 68 | - // If keys were passed into the constructor, translate them from keys to values. |
|
| 69 | - if(!empty($class_details['module'])) |
|
| 70 | - $this->module = $class_details['module']; |
|
| 71 | - if(!empty($class_details['title'])) |
|
| 72 | - $this->title = $app_strings[$class_details['title']]; |
|
| 73 | - if(!empty($class_details['access_key'])) |
|
| 74 | - $this->access_key = $app_strings[$class_details['access_key']]; |
|
| 75 | - if(!empty($class_details['form_value'])) |
|
| 76 | - $this->form_value = translate($class_details['form_value'], $this->module); |
|
| 77 | - if(!empty($class_details['additional_form_fields'])) |
|
| 78 | - $this->additional_form_fields = $class_details['additional_form_fields']; |
|
| 79 | - if(!empty($class_details['ACL'])){ |
|
| 80 | - $this->acl = $class_details['ACL']; |
|
| 81 | - } |
|
| 82 | - } |
|
| 83 | - else |
|
| 84 | - { |
|
| 85 | - $this->module = $module; |
|
| 86 | - |
|
| 87 | - // If keys were passed into the constructor, translate them from keys to values. |
|
| 88 | - if(!empty($title)) |
|
| 89 | - $this->title = $app_strings[$title]; |
|
| 90 | - if(!empty($access_key)) |
|
| 91 | - $this->access_key = $app_strings[$access_key]; |
|
| 92 | - if(!empty($form_value)) |
|
| 93 | - $this->form_value = translate($form_value, $module); |
|
| 94 | - } |
|
| 95 | - } |
|
| 57 | + /** Take the keys for the strings and look them up. Module is literal, the rest are label keys |
|
| 58 | + */ |
|
| 59 | + function __construct($module='', $title='', $access_key='', $form_value='') |
|
| 60 | + { |
|
| 61 | + global $app_strings; |
|
| 62 | + |
|
| 63 | + if(is_array($module)) |
|
| 64 | + { |
|
| 65 | + // it is really the class details from the mapping |
|
| 66 | + $class_details = $module; |
|
| 67 | + |
|
| 68 | + // If keys were passed into the constructor, translate them from keys to values. |
|
| 69 | + if(!empty($class_details['module'])) |
|
| 70 | + $this->module = $class_details['module']; |
|
| 71 | + if(!empty($class_details['title'])) |
|
| 72 | + $this->title = $app_strings[$class_details['title']]; |
|
| 73 | + if(!empty($class_details['access_key'])) |
|
| 74 | + $this->access_key = $app_strings[$class_details['access_key']]; |
|
| 75 | + if(!empty($class_details['form_value'])) |
|
| 76 | + $this->form_value = translate($class_details['form_value'], $this->module); |
|
| 77 | + if(!empty($class_details['additional_form_fields'])) |
|
| 78 | + $this->additional_form_fields = $class_details['additional_form_fields']; |
|
| 79 | + if(!empty($class_details['ACL'])){ |
|
| 80 | + $this->acl = $class_details['ACL']; |
|
| 81 | + } |
|
| 82 | + } |
|
| 83 | + else |
|
| 84 | + { |
|
| 85 | + $this->module = $module; |
|
| 86 | + |
|
| 87 | + // If keys were passed into the constructor, translate them from keys to values. |
|
| 88 | + if(!empty($title)) |
|
| 89 | + $this->title = $app_strings[$title]; |
|
| 90 | + if(!empty($access_key)) |
|
| 91 | + $this->access_key = $app_strings[$access_key]; |
|
| 92 | + if(!empty($form_value)) |
|
| 93 | + $this->form_value = translate($form_value, $module); |
|
| 94 | + } |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | 97 | public function getWidgetId($buttonSuffix = true) |
| 98 | 98 | { |
| 99 | - $widgetID = parent::getWidgetId() . '_'.preg_replace('[ ]', '', strtolower($this->form_value)); |
|
| 100 | - if($buttonSuffix){ |
|
| 101 | - $widgetID .= '_button'; |
|
| 102 | - } |
|
| 99 | + $widgetID = parent::getWidgetId() . '_'.preg_replace('[ ]', '', strtolower($this->form_value)); |
|
| 100 | + if($buttonSuffix){ |
|
| 101 | + $widgetID .= '_button'; |
|
| 102 | + } |
|
| 103 | 103 | return $widgetID; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | - if(!empty($this->module)) |
|
| 128 | + if(!empty($this->module)) |
|
| 129 | 129 | { |
| 130 | 130 | $defines['child_module_name'] = $this->module; |
| 131 | 131 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $defines['parent_bean_name'] = get_class( $defines['focus']); |
| 138 | - $relationship_name = $this->get_subpanel_relationship_name($defines); |
|
| 138 | + $relationship_name = $this->get_subpanel_relationship_name($defines); |
|
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | $formValues = array(); |
@@ -150,10 +150,10 @@ discard block |
||
| 150 | 150 | // #26451,add these fields for custom one-to-many relate field. |
| 151 | 151 | if(!empty($defines['child_module_name'])){ |
| 152 | 152 | $formValues[$relationship_name."_name"] = $defines['focus']->name; |
| 153 | - $childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : ""; |
|
| 154 | - if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){ |
|
| 155 | - $formValues[$GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name']] = $defines['focus']->id; |
|
| 156 | - } |
|
| 153 | + $childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : ""; |
|
| 154 | + if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){ |
|
| 155 | + $formValues[$GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name']] = $defines['focus']->id; |
|
| 156 | + } |
|
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
| 217 | 217 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
| 218 | 218 | } else if($defines['focus']->object_name=='Contract') { |
| 219 | - $additionalFormFields['contract_id'] = $defines['focus']->id; |
|
| 219 | + $additionalFormFields['contract_id'] = $defines['focus']->id; |
|
| 220 | 220 | } else { |
| 221 | 221 | $additionalFormFields['parent_id'] = $defines['focus']->id; |
| 222 | 222 | } |
@@ -266,17 +266,17 @@ discard block |
||
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - /** This default function is used to create the HTML for a simple button */ |
|
| 270 | - function display($defines, $additionalFormFields = null, $nonbutton = false) |
|
| 271 | - { |
|
| 272 | - $temp=''; |
|
| 273 | - $inputID = $this->getWidgetId(); |
|
| 269 | + /** This default function is used to create the HTML for a simple button */ |
|
| 270 | + function display($defines, $additionalFormFields = null, $nonbutton = false) |
|
| 271 | + { |
|
| 272 | + $temp=''; |
|
| 273 | + $inputID = $this->getWidgetId(); |
|
| 274 | 274 | |
| 275 | - if(!empty($this->acl) && ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], $this->acl, true)){ |
|
| 276 | - return $temp; |
|
| 277 | - } |
|
| 275 | + if(!empty($this->acl) && ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], $this->acl, true)){ |
|
| 276 | + return $temp; |
|
| 277 | + } |
|
| 278 | 278 | |
| 279 | - global $app_strings; |
|
| 279 | + global $app_strings; |
|
| 280 | 280 | |
| 281 | 281 | if ( isset($_REQUEST['layout_def_key']) && $_REQUEST['layout_def_key'] == 'UserEAPM' ) { |
| 282 | 282 | // Subpanels generally don't go on the editview, so we have to handle this special |
@@ -289,42 +289,42 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | if ($nonbutton) { |
| 292 | - // $button = "<a onclick=''>$this->form_value"; |
|
| 292 | + // $button = "<a onclick=''>$this->form_value"; |
|
| 293 | 293 | } |
| 294 | 294 | return $button; |
| 295 | - } |
|
| 296 | - |
|
| 297 | - /** |
|
| 298 | - * Returns a string that is the JSON encoded version of the popup request. |
|
| 299 | - * Perhaps this function should be moved to a more globally accessible location? |
|
| 300 | - */ |
|
| 301 | - function _create_json_encoded_popup_request($popup_request_data) |
|
| 302 | - { |
|
| 303 | - return json_encode($popup_request_data); |
|
| 304 | - } |
|
| 305 | - |
|
| 306 | - /** |
|
| 307 | - * get_subpanel_relationship_name |
|
| 308 | - * Get the relationship name based on the subapnel definition |
|
| 309 | - * @param mixed $defines The subpanel definition |
|
| 310 | - */ |
|
| 311 | - function get_subpanel_relationship_name($defines) { |
|
| 312 | - $relationship_name = ''; |
|
| 313 | - if(!empty($defines)) { |
|
| 314 | - $relationship_name = isset($defines['module']) ? $defines['module'] : ''; |
|
| 315 | - $dataSource = $defines['subpanel_definition']->get_data_source_name(true); |
|
| 316 | - if (!empty($dataSource)) { |
|
| 317 | - $relationship_name = $dataSource; |
|
| 318 | - //Try to set the relationship name to the real relationship, not the link. |
|
| 319 | - if (!empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]) |
|
| 320 | - && !empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship'])) |
|
| 321 | - { |
|
| 322 | - $relationship_name = $defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship']; |
|
| 323 | - } |
|
| 324 | - } |
|
| 325 | - } |
|
| 326 | - return $relationship_name; |
|
| 327 | - } |
|
| 295 | + } |
|
| 296 | + |
|
| 297 | + /** |
|
| 298 | + * Returns a string that is the JSON encoded version of the popup request. |
|
| 299 | + * Perhaps this function should be moved to a more globally accessible location? |
|
| 300 | + */ |
|
| 301 | + function _create_json_encoded_popup_request($popup_request_data) |
|
| 302 | + { |
|
| 303 | + return json_encode($popup_request_data); |
|
| 304 | + } |
|
| 305 | + |
|
| 306 | + /** |
|
| 307 | + * get_subpanel_relationship_name |
|
| 308 | + * Get the relationship name based on the subapnel definition |
|
| 309 | + * @param mixed $defines The subpanel definition |
|
| 310 | + */ |
|
| 311 | + function get_subpanel_relationship_name($defines) { |
|
| 312 | + $relationship_name = ''; |
|
| 313 | + if(!empty($defines)) { |
|
| 314 | + $relationship_name = isset($defines['module']) ? $defines['module'] : ''; |
|
| 315 | + $dataSource = $defines['subpanel_definition']->get_data_source_name(true); |
|
| 316 | + if (!empty($dataSource)) { |
|
| 317 | + $relationship_name = $dataSource; |
|
| 318 | + //Try to set the relationship name to the real relationship, not the link. |
|
| 319 | + if (!empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]) |
|
| 320 | + && !empty($defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship'])) |
|
| 321 | + { |
|
| 322 | + $relationship_name = $defines['subpanel_definition']->parent_bean->field_defs[$dataSource]['relationship']; |
|
| 323 | + } |
|
| 324 | + } |
|
| 325 | + } |
|
| 326 | + return $relationship_name; |
|
| 327 | + } |
|
| 328 | 328 | |
| 329 | 329 | } |
| 330 | 330 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,27 +56,27 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | /** Take the keys for the strings and look them up. Module is literal, the rest are label keys |
| 58 | 58 | */ |
| 59 | - function __construct($module='', $title='', $access_key='', $form_value='') |
|
| 59 | + function __construct($module = '', $title = '', $access_key = '', $form_value = '') |
|
| 60 | 60 | { |
| 61 | 61 | global $app_strings; |
| 62 | 62 | |
| 63 | - if(is_array($module)) |
|
| 63 | + if (is_array($module)) |
|
| 64 | 64 | { |
| 65 | 65 | // it is really the class details from the mapping |
| 66 | 66 | $class_details = $module; |
| 67 | 67 | |
| 68 | 68 | // If keys were passed into the constructor, translate them from keys to values. |
| 69 | - if(!empty($class_details['module'])) |
|
| 69 | + if (!empty($class_details['module'])) |
|
| 70 | 70 | $this->module = $class_details['module']; |
| 71 | - if(!empty($class_details['title'])) |
|
| 71 | + if (!empty($class_details['title'])) |
|
| 72 | 72 | $this->title = $app_strings[$class_details['title']]; |
| 73 | - if(!empty($class_details['access_key'])) |
|
| 73 | + if (!empty($class_details['access_key'])) |
|
| 74 | 74 | $this->access_key = $app_strings[$class_details['access_key']]; |
| 75 | - if(!empty($class_details['form_value'])) |
|
| 75 | + if (!empty($class_details['form_value'])) |
|
| 76 | 76 | $this->form_value = translate($class_details['form_value'], $this->module); |
| 77 | - if(!empty($class_details['additional_form_fields'])) |
|
| 77 | + if (!empty($class_details['additional_form_fields'])) |
|
| 78 | 78 | $this->additional_form_fields = $class_details['additional_form_fields']; |
| 79 | - if(!empty($class_details['ACL'])){ |
|
| 79 | + if (!empty($class_details['ACL'])) { |
|
| 80 | 80 | $this->acl = $class_details['ACL']; |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -85,19 +85,19 @@ discard block |
||
| 85 | 85 | $this->module = $module; |
| 86 | 86 | |
| 87 | 87 | // If keys were passed into the constructor, translate them from keys to values. |
| 88 | - if(!empty($title)) |
|
| 88 | + if (!empty($title)) |
|
| 89 | 89 | $this->title = $app_strings[$title]; |
| 90 | - if(!empty($access_key)) |
|
| 90 | + if (!empty($access_key)) |
|
| 91 | 91 | $this->access_key = $app_strings[$access_key]; |
| 92 | - if(!empty($form_value)) |
|
| 92 | + if (!empty($form_value)) |
|
| 93 | 93 | $this->form_value = translate($form_value, $module); |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | public function getWidgetId($buttonSuffix = true) |
| 98 | 98 | { |
| 99 | - $widgetID = parent::getWidgetId() . '_'.preg_replace('[ ]', '', strtolower($this->form_value)); |
|
| 100 | - if($buttonSuffix){ |
|
| 99 | + $widgetID = parent::getWidgetId().'_'.preg_replace('[ ]', '', strtolower($this->form_value)); |
|
| 100 | + if ($buttonSuffix) { |
|
| 101 | 101 | $widgetID .= '_button'; |
| 102 | 102 | } |
| 103 | 103 | return $widgetID; |
@@ -109,11 +109,11 @@ discard block |
||
| 109 | 109 | global $currentModule; |
| 110 | 110 | |
| 111 | 111 | // Create the additional form fields with real values if they were not passed in |
| 112 | - if(empty($additionalFormFields) && $this->additional_form_fields) |
|
| 112 | + if (empty($additionalFormFields) && $this->additional_form_fields) |
|
| 113 | 113 | { |
| 114 | - foreach($this->additional_form_fields as $key=>$value) |
|
| 114 | + foreach ($this->additional_form_fields as $key=>$value) |
|
| 115 | 115 | { |
| 116 | - if(!empty($defines['focus']->$value)) |
|
| 116 | + if (!empty($defines['focus']->$value)) |
|
| 117 | 117 | { |
| 118 | 118 | $additionalFormFields[$key] = $defines['focus']->$value; |
| 119 | 119 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | - if(!empty($this->module)) |
|
| 128 | + if (!empty($this->module)) |
|
| 129 | 129 | { |
| 130 | 130 | $defines['child_module_name'] = $this->module; |
| 131 | 131 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $defines['child_module_name'] = $defines['module']; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $defines['parent_bean_name'] = get_class( $defines['focus']); |
|
| 137 | + $defines['parent_bean_name'] = get_class($defines['focus']); |
|
| 138 | 138 | $relationship_name = $this->get_subpanel_relationship_name($defines); |
| 139 | 139 | |
| 140 | 140 | |
@@ -144,65 +144,65 @@ discard block |
||
| 144 | 144 | $formValues['module'] = $defines['child_module_name']; |
| 145 | 145 | $formValues[strtolower($defines['parent_bean_name'])."_id"] = $defines['focus']->id; |
| 146 | 146 | |
| 147 | - if(isset($defines['focus']->name)) |
|
| 147 | + if (isset($defines['focus']->name)) |
|
| 148 | 148 | { |
| 149 | 149 | $formValues[strtolower($defines['parent_bean_name'])."_name"] = $defines['focus']->name; |
| 150 | 150 | // #26451,add these fields for custom one-to-many relate field. |
| 151 | - if(!empty($defines['child_module_name'])){ |
|
| 151 | + if (!empty($defines['child_module_name'])) { |
|
| 152 | 152 | $formValues[$relationship_name."_name"] = $defines['focus']->name; |
| 153 | 153 | $childFocusName = !empty($GLOBALS['beanList'][$defines['child_module_name']]) ? $GLOBALS['beanList'][$defines['child_module_name']] : ""; |
| 154 | - if(!empty($GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name'])){ |
|
| 155 | - $formValues[$GLOBALS['dictionary'][ $childFocusName ]["fields"][$relationship_name .'_name']['id_name']] = $defines['focus']->id; |
|
| 154 | + if (!empty($GLOBALS['dictionary'][$childFocusName]["fields"][$relationship_name.'_name']['id_name'])) { |
|
| 155 | + $formValues[$GLOBALS['dictionary'][$childFocusName]["fields"][$relationship_name.'_name']['id_name']] = $defines['focus']->id; |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $formValues['return_module'] = $currentModule; |
| 161 | 161 | |
| 162 | - if($currentModule == 'Campaigns'){ |
|
| 162 | + if ($currentModule == 'Campaigns') { |
|
| 163 | 163 | $formValues['return_action'] = "DetailView"; |
| 164 | - }else{ |
|
| 164 | + } else { |
|
| 165 | 165 | $formValues['return_action'] = $defines['action']; |
| 166 | - if ( $formValues['return_action'] == 'SubPanelViewer' ) { |
|
| 166 | + if ($formValues['return_action'] == 'SubPanelViewer') { |
|
| 167 | 167 | $formValues['return_action'] = 'DetailView'; |
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $formValues['return_id'] = $defines['focus']->id; |
| 172 | 172 | $formValues['return_relationship'] = $relationship_name; |
| 173 | - switch ( strtolower( $currentModule ) ) |
|
| 173 | + switch (strtolower($currentModule)) |
|
| 174 | 174 | { |
| 175 | 175 | case 'prospects' : |
| 176 | - $name = $defines['focus']->account_name ; |
|
| 177 | - break ; |
|
| 176 | + $name = $defines['focus']->account_name; |
|
| 177 | + break; |
|
| 178 | 178 | case 'documents' : |
| 179 | - $name = $defines['focus']->document_name ; |
|
| 180 | - break ; |
|
| 179 | + $name = $defines['focus']->document_name; |
|
| 180 | + break; |
|
| 181 | 181 | case 'kbdocuments' : |
| 182 | - $name = $defines['focus']->kbdocument_name ; |
|
| 183 | - break ; |
|
| 182 | + $name = $defines['focus']->kbdocument_name; |
|
| 183 | + break; |
|
| 184 | 184 | case 'leads' : |
| 185 | 185 | case 'contacts' : |
| 186 | - $name = $defines['focus']->first_name . " " .$defines['focus']->last_name ; |
|
| 187 | - break ; |
|
| 186 | + $name = $defines['focus']->first_name." ".$defines['focus']->last_name; |
|
| 187 | + break; |
|
| 188 | 188 | default : |
| 189 | 189 | $name = (isset($defines['focus']->name)) ? $defines['focus']->name : ""; |
| 190 | 190 | } |
| 191 | 191 | $formValues['return_name'] = $name; |
| 192 | 192 | |
| 193 | 193 | // TODO: move this out and get $additionalFormFields working properly |
| 194 | - if(empty($additionalFormFields['parent_type'])) |
|
| 194 | + if (empty($additionalFormFields['parent_type'])) |
|
| 195 | 195 | { |
| 196 | - if($defines['focus']->object_name=='Contact') { |
|
| 196 | + if ($defines['focus']->object_name == 'Contact') { |
|
| 197 | 197 | $additionalFormFields['parent_type'] = 'Accounts'; |
| 198 | 198 | } |
| 199 | 199 | else { |
| 200 | 200 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | - if(empty($additionalFormFields['parent_name'])) |
|
| 203 | + if (empty($additionalFormFields['parent_name'])) |
|
| 204 | 204 | { |
| 205 | - if($defines['focus']->object_name=='Contact') { |
|
| 205 | + if ($defines['focus']->object_name == 'Contact') { |
|
| 206 | 206 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
| 207 | 207 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
| 208 | 208 | } |
@@ -210,55 +210,55 @@ discard block |
||
| 210 | 210 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | - if(empty($additionalFormFields['parent_id'])) |
|
| 213 | + if (empty($additionalFormFields['parent_id'])) |
|
| 214 | 214 | { |
| 215 | - if($defines['focus']->object_name=='Contact') { |
|
| 215 | + if ($defines['focus']->object_name == 'Contact') { |
|
| 216 | 216 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
| 217 | 217 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
| 218 | - } else if($defines['focus']->object_name=='Contract') { |
|
| 218 | + } else if ($defines['focus']->object_name == 'Contract') { |
|
| 219 | 219 | $additionalFormFields['contract_id'] = $defines['focus']->id; |
| 220 | 220 | } else { |
| 221 | 221 | $additionalFormFields['parent_id'] = $defines['focus']->id; |
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - if ($defines['focus']->object_name=='Opportunity') { |
|
| 225 | + if ($defines['focus']->object_name == 'Opportunity') { |
|
| 226 | 226 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
| 227 | 227 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - if (!empty($defines['child_module_name']) and $defines['child_module_name']=='Contacts' and !empty($defines['parent_bean_name']) and $defines['parent_bean_name']=='contact' ) { |
|
| 231 | - if (!empty($defines['focus']->id ) and !empty($defines['focus']->name)) { |
|
| 230 | + if (!empty($defines['child_module_name']) and $defines['child_module_name'] == 'Contacts' and !empty($defines['parent_bean_name']) and $defines['parent_bean_name'] == 'contact') { |
|
| 231 | + if (!empty($defines['focus']->id) and !empty($defines['focus']->name)) { |
|
| 232 | 232 | $formValues['reports_to_id'] = $defines['focus']->id; |
| 233 | 233 | $formValues['reports_to_name'] = $defines['focus']->name; |
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | $formValues['action'] = "EditView"; |
| 237 | 237 | |
| 238 | - if ( $asUrl ) { |
|
| 238 | + if ($asUrl) { |
|
| 239 | 239 | $returnLink = ''; |
| 240 | - foreach($formValues as $key => $value ) { |
|
| 240 | + foreach ($formValues as $key => $value) { |
|
| 241 | 241 | $returnLink .= $key.'='.$value.'&'; |
| 242 | 242 | } |
| 243 | - foreach($additionalFormFields as $key => $value ) { |
|
| 243 | + foreach ($additionalFormFields as $key => $value) { |
|
| 244 | 244 | $returnLink .= $key.'='.$value.'&'; |
| 245 | 245 | } |
| 246 | - $returnLink = rtrim($returnLink,'&'); |
|
| 246 | + $returnLink = rtrim($returnLink, '&'); |
|
| 247 | 247 | |
| 248 | 248 | return $returnLink; |
| 249 | 249 | } else { |
| 250 | 250 | |
| 251 | - $form = 'form' . $relationship_name; |
|
| 252 | - $button = '<form action="index.php" method="post" name="form" id="' . $form . "\">\n"; |
|
| 253 | - foreach($formValues as $key => $value) { |
|
| 251 | + $form = 'form'.$relationship_name; |
|
| 252 | + $button = '<form action="index.php" method="post" name="form" id="'.$form."\">\n"; |
|
| 253 | + foreach ($formValues as $key => $value) { |
|
| 254 | 254 | if (empty($value->defs)) { |
| 255 | - $button .= "<input type='hidden' name='" . $key . "' value='" . $value . "' />\n"; |
|
| 255 | + $button .= "<input type='hidden' name='".$key."' value='".$value."' />\n"; |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | // fill in additional form fields for all but action |
| 259 | - foreach($additionalFormFields as $key => $value) { |
|
| 260 | - if($key != 'action') { |
|
| 261 | - $button .= "<input type='hidden' name='" . $key . "' value='" . $value . "' />\n"; |
|
| 259 | + foreach ($additionalFormFields as $key => $value) { |
|
| 260 | + if ($key != 'action') { |
|
| 261 | + $button .= "<input type='hidden' name='".$key."' value='".$value."' />\n"; |
|
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
@@ -270,18 +270,18 @@ discard block |
||
| 270 | 270 | /** This default function is used to create the HTML for a simple button */ |
| 271 | 271 | function display($defines, $additionalFormFields = null, $nonbutton = false) |
| 272 | 272 | { |
| 273 | - $temp=''; |
|
| 273 | + $temp = ''; |
|
| 274 | 274 | $inputID = $this->getWidgetId(); |
| 275 | 275 | |
| 276 | - if(!empty($this->acl) && ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], $this->acl, true)){ |
|
| 276 | + if (!empty($this->acl) && ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], $this->acl, true)) { |
|
| 277 | 277 | return $temp; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | global $app_strings; |
| 281 | 281 | |
| 282 | - if ( isset($_REQUEST['layout_def_key']) && $_REQUEST['layout_def_key'] == 'UserEAPM' ) { |
|
| 282 | + if (isset($_REQUEST['layout_def_key']) && $_REQUEST['layout_def_key'] == 'UserEAPM') { |
|
| 283 | 283 | // Subpanels generally don't go on the editview, so we have to handle this special |
| 284 | - $megaLink = $this->_get_form($defines, $additionalFormFields,true); |
|
| 284 | + $megaLink = $this->_get_form($defines, $additionalFormFields, true); |
|
| 285 | 285 | //$button = "<input title='$this->title' accesskey='$this->access_key' class='button' type='submit' name='$inputID' id='$inputID' value='$this->form_value' onclick='javascript:document.location=\"index.php?".$megaLink."\"; return false;'/>"; |
| 286 | 286 | } else { |
| 287 | 287 | $button = $this->_get_form($defines, $additionalFormFields); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | */ |
| 312 | 312 | function get_subpanel_relationship_name($defines) { |
| 313 | 313 | $relationship_name = ''; |
| 314 | - if(!empty($defines)) { |
|
| 314 | + if (!empty($defines)) { |
|
| 315 | 315 | $relationship_name = isset($defines['module']) ? $defines['module'] : ''; |
| 316 | 316 | $dataSource = $defines['subpanel_definition']->get_data_source_name(true); |
| 317 | 317 | if (!empty($dataSource)) { |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -66,31 +68,38 @@ discard block |
||
| 66 | 68 | $class_details = $module; |
| 67 | 69 | |
| 68 | 70 | // If keys were passed into the constructor, translate them from keys to values. |
| 69 | - if(!empty($class_details['module'])) |
|
| 70 | - $this->module = $class_details['module']; |
|
| 71 | - if(!empty($class_details['title'])) |
|
| 72 | - $this->title = $app_strings[$class_details['title']]; |
|
| 73 | - if(!empty($class_details['access_key'])) |
|
| 74 | - $this->access_key = $app_strings[$class_details['access_key']]; |
|
| 75 | - if(!empty($class_details['form_value'])) |
|
| 76 | - $this->form_value = translate($class_details['form_value'], $this->module); |
|
| 77 | - if(!empty($class_details['additional_form_fields'])) |
|
| 78 | - $this->additional_form_fields = $class_details['additional_form_fields']; |
|
| 71 | + if(!empty($class_details['module'])) { |
|
| 72 | + $this->module = $class_details['module']; |
|
| 73 | + } |
|
| 74 | + if(!empty($class_details['title'])) { |
|
| 75 | + $this->title = $app_strings[$class_details['title']]; |
|
| 76 | + } |
|
| 77 | + if(!empty($class_details['access_key'])) { |
|
| 78 | + $this->access_key = $app_strings[$class_details['access_key']]; |
|
| 79 | + } |
|
| 80 | + if(!empty($class_details['form_value'])) { |
|
| 81 | + $this->form_value = translate($class_details['form_value'], $this->module); |
|
| 82 | + } |
|
| 83 | + if(!empty($class_details['additional_form_fields'])) { |
|
| 84 | + $this->additional_form_fields = $class_details['additional_form_fields']; |
|
| 85 | + } |
|
| 79 | 86 | if(!empty($class_details['ACL'])){ |
| 80 | 87 | $this->acl = $class_details['ACL']; |
| 81 | 88 | } |
| 82 | - } |
|
| 83 | - else |
|
| 89 | + } else |
|
| 84 | 90 | { |
| 85 | 91 | $this->module = $module; |
| 86 | 92 | |
| 87 | 93 | // If keys were passed into the constructor, translate them from keys to values. |
| 88 | - if(!empty($title)) |
|
| 89 | - $this->title = $app_strings[$title]; |
|
| 90 | - if(!empty($access_key)) |
|
| 91 | - $this->access_key = $app_strings[$access_key]; |
|
| 92 | - if(!empty($form_value)) |
|
| 93 | - $this->form_value = translate($form_value, $module); |
|
| 94 | + if(!empty($title)) { |
|
| 95 | + $this->title = $app_strings[$title]; |
|
| 96 | + } |
|
| 97 | + if(!empty($access_key)) { |
|
| 98 | + $this->access_key = $app_strings[$access_key]; |
|
| 99 | + } |
|
| 100 | + if(!empty($form_value)) { |
|
| 101 | + $this->form_value = translate($form_value, $module); |
|
| 102 | + } |
|
| 94 | 103 | } |
| 95 | 104 | } |
| 96 | 105 | |
@@ -116,8 +125,7 @@ discard block |
||
| 116 | 125 | if(!empty($defines['focus']->$value)) |
| 117 | 126 | { |
| 118 | 127 | $additionalFormFields[$key] = $defines['focus']->$value; |
| 119 | - } |
|
| 120 | - else |
|
| 128 | + } else |
|
| 121 | 129 | { |
| 122 | 130 | $additionalFormFields[$key] = ''; |
| 123 | 131 | } |
@@ -128,8 +136,7 @@ discard block |
||
| 128 | 136 | if(!empty($this->module)) |
| 129 | 137 | { |
| 130 | 138 | $defines['child_module_name'] = $this->module; |
| 131 | - } |
|
| 132 | - else |
|
| 139 | + } else |
|
| 133 | 140 | { |
| 134 | 141 | $defines['child_module_name'] = $defines['module']; |
| 135 | 142 | } |
@@ -161,7 +168,7 @@ discard block |
||
| 161 | 168 | |
| 162 | 169 | if($currentModule == 'Campaigns'){ |
| 163 | 170 | $formValues['return_action'] = "DetailView"; |
| 164 | - }else{ |
|
| 171 | + } else{ |
|
| 165 | 172 | $formValues['return_action'] = $defines['action']; |
| 166 | 173 | if ( $formValues['return_action'] == 'SubPanelViewer' ) { |
| 167 | 174 | $formValues['return_action'] = 'DetailView'; |
@@ -195,8 +202,7 @@ discard block |
||
| 195 | 202 | { |
| 196 | 203 | if($defines['focus']->object_name=='Contact') { |
| 197 | 204 | $additionalFormFields['parent_type'] = 'Accounts'; |
| 198 | - } |
|
| 199 | - else { |
|
| 205 | + } else { |
|
| 200 | 206 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
| 201 | 207 | } |
| 202 | 208 | } |
@@ -205,8 +211,7 @@ discard block |
||
| 205 | 211 | if($defines['focus']->object_name=='Contact') { |
| 206 | 212 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
| 207 | 213 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
| 208 | - } |
|
| 209 | - else { |
|
| 214 | + } else { |
|
| 210 | 215 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
| 211 | 216 | } |
| 212 | 217 | } |