From 7dd814407e1736ed977fb174fd2c644b0934d386 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 16 Oct 2015 12:08:27 +0100 Subject: [PATCH 1/3] prep module builder for php7 compatibility --- .../templates/basic/Dashlets/Dashlet/m-n-Dashlet.php | 4 ++-- .../SugarObjects/templates/file/views/view.edit.php | 4 ++-- modules/ModuleBuilder/tpls/MBModule/Class.tpl | 12 +++++++----- .../ModuleBuilder/tpls/MBModule/DeveloperClass.tpl | 6 +++--- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/SugarObjects/templates/basic/Dashlets/Dashlet/m-n-Dashlet.php b/include/SugarObjects/templates/basic/Dashlets/Dashlet/m-n-Dashlet.php index 4e4bda18fda..4473c292ed0 100755 --- a/include/SugarObjects/templates/basic/Dashlets/Dashlet/m-n-Dashlet.php +++ b/include/SugarObjects/templates/basic/Dashlets/Dashlet/m-n-Dashlet.php @@ -50,11 +50,11 @@ require_once('modules//.php'); class Dashlet extends DashletGeneric { - function Dashlet($id, $def = null) { + function __construct($id, $def = null) { global $current_user, $app_strings; require('modules//metadata/dashletviewdefs.php'); - parent::DashletGeneric($id, $def); + parent::__construct($id, $def); if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', ''); diff --git a/include/SugarObjects/templates/file/views/view.edit.php b/include/SugarObjects/templates/file/views/view.edit.php index a7431167604..d52f0563581 100755 --- a/include/SugarObjects/templates/file/views/view.edit.php +++ b/include/SugarObjects/templates/file/views/view.edit.php @@ -46,8 +46,8 @@ ********************************************************************************/ class ViewEdit extends ViewEdit{ - function ViewEdit(){ - parent::ViewEdit(); + function __construct(){ + parent::__construct(); } function display(){ if (isset($this->bean->id)) { diff --git a/modules/ModuleBuilder/tpls/MBModule/Class.tpl b/modules/ModuleBuilder/tpls/MBModule/Class.tpl index 90a2a09f0a2..3383483277a 100755 --- a/modules/ModuleBuilder/tpls/MBModule/Class.tpl +++ b/modules/ModuleBuilder/tpls/MBModule/Class.tpl @@ -1,4 +1,4 @@ - Date: Mon, 19 Oct 2015 13:43:25 +0100 Subject: [PATCH 2/3] Fixed #430 Create Calendar entry on mobile view --- themes/SuiteR/tpls/_headerModuleList.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/SuiteR/tpls/_headerModuleList.tpl b/themes/SuiteR/tpls/_headerModuleList.tpl index 920fb831287..b06a388b0af 100644 --- a/themes/SuiteR/tpls/_headerModuleList.tpl +++ b/themes/SuiteR/tpls/_headerModuleList.tpl @@ -322,7 +322,7 @@ {if $smarty.foreach.groupList.last} {capture name=extraparams assign=extraparams}parentTab={$group}{/capture} {foreach from=$modules.modules item=module key=modulekey} - {if $modulekey !='Home'} + {if $modulekey !='Home' && $modulekey !='Calendar'}
  • From cce722e2923916e06030963957cbc7c28261404f Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 19 Oct 2015 13:50:12 +0100 Subject: [PATCH 3/3] Fix report join issues --- modules/AOR_Reports/AOR_Report.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/AOR_Reports/AOR_Report.php b/modules/AOR_Reports/AOR_Report.php index c0bd7583898..9dea983f2dd 100755 --- a/modules/AOR_Reports/AOR_Report.php +++ b/modules/AOR_Reports/AOR_Report.php @@ -653,6 +653,7 @@ function build_report_query_select($query = array(), $group_value =''){ $field_module = $module; $table_alias = $field_module->table_name; + $oldAlias = $table_alias; if(!empty($path[0]) && $path[0] != $module->module_dir){ foreach($path as $rel){ $new_field_module = new $beanList[getRelatedModule($field_module->module_dir,$rel)]; @@ -820,6 +821,7 @@ function build_report_query_where($query = array()){ $condition_module = $module; $table_alias = $condition_module->table_name; + $oldAlias = $table_alias; if(!empty($path[0]) && $path[0] != $module->module_dir){ foreach($path as $rel){ if(empty($rel)){ @@ -849,12 +851,11 @@ function build_report_query_where($query = array()){ $data = $data_new; } - if ($data['type'] == 'link' && $data['source'] == 'non-db') { - $relModule = getRelatedModule($condition_module->module_dir, $data['relationship']); - $new_field_module = new $beanList[$relModule]; - $query = $this->build_report_query_join($data['relationship'], $table_alias . ':' . strtolower($relModule), $oldAlias, $condition_module, 'relationship', $query, $new_field_module); - $field_module = $new_field_module; - $table_alias = $table_alias . ':' . $data['relationship']; + if($data['type'] == 'link' && $data['source'] == 'non-db') { + $new_field_module = new $beanList[getRelatedModule($condition_module->module_dir,$data['relationship'])]; + $table_alias = $data['relationship']; + $query = $this->build_report_query_join($data['relationship'],$table_alias, $oldAlias, $condition_module, 'relationship', $query, $new_field_module); + $condition_module = $new_field_module; // Debugging: security groups conditions - It's a hack to just get the query working if($condition_module->module_dir = 'SecurityGroups' && count($path) > 1) { @@ -892,11 +893,11 @@ function build_report_query_where($query = array()){ } if ($data['type'] == 'link' && $data['source'] == 'non-db') { - $new_field_module = new $beanList[getRelatedModule($field_module->module_dir, $data['relationship'])]; - $query = $this->build_report_query_join($data['relationship'], $table_alias, $oldAlias, $field_module, 'relationship', $query, $new_field_module); - $field_module = $new_field_module; + $new_field_module = new $beanList[getRelatedModule($condition_module->module_dir, $data['relationship'])]; $table_alias = $data['relationship']; - $field->field = 'id'; + $query = $this->build_report_query_join($data['relationship'], $table_alias, $oldAlias, $condition_module, 'relationship', $query, $new_field_module); + $condition_module = $new_field_module; + $condition->field = 'id'; } if ((isset($data['source']) && $data['source'] == 'custom_fields')) { $value = $condition_module->table_name . '_cstm.' . $condition->value;