diff --git a/core/dashboard/dashboard.php b/core/dashboard/dashboard.php index 5f0139375c..d604b33683 100644 --- a/core/dashboard/dashboard.php +++ b/core/dashboard/dashboard.php @@ -89,100 +89,100 @@ //action add or update - if (isset($_REQUEST["export"])) { - $export = $_REQUEST["export"]; - } - -//expore provider settings - if (isset($export) && $export == 'true') { - - //get the dashboard - $sql = "select "; - $sql .= "dashboard_uuid, "; - $sql .= "dashboard_name, "; - $sql .= "dashboard_path, "; - $sql .= "dashboard_order, "; - $sql .= "cast(dashboard_enabled as text), "; - $sql .= "dashboard_description "; - $sql .= "from v_dashboard "; - $database = new database; - $dashboard_widgets = $database->select($sql, $parameters, 'all'); - unset($sql, $parameters); - - //prepare the array - if (is_array($dashboard_widgets)) { - $x = 0; - $y = 0; - foreach ($dashboard_widgets as $row) { - //add to the array - $array['dashboard'][$x]['dashboard_uuid'] = $row["dashboard_uuid"]; - $array['dashboard'][$x]['dashboard_name'] = $row["dashboard_name"]; - $array['dashboard'][$x]['dashboard_path'] = $row["dashboard_path"]; - $array['dashboard'][$x]['dashboard_order'] = $row["dashboard_order"]; - $array['dashboard'][$x]['dashboard_enabled'] = $row["dashboard_enabled"]; - $array['dashboard'][$x]['dashboard_description'] = $row["dashboard_description"]; - - //get the dashboard groups - $sql = "select "; - $sql .= "dashboard_group_uuid, "; - $sql .= "dashboard_uuid, "; - $sql .= "group_uuid, "; - $sql .= "(select group_name from v_groups where v_dashboard_groups.group_uuid = group_uuid) as group_name "; - $sql .= "from v_dashboard_groups "; - $sql .= "where dashboard_uuid = :dashboard_uuid "; - $parameters['dashboard_uuid'] = $row["dashboard_uuid"]; - $database = new database; - $dashboard_groups = $database->select($sql, $parameters, 'all'); - unset($sql, $parameters); - if (is_array($dashboard_groups)) { - $y = 0; - foreach ($dashboard_groups as $row) { - $array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_group_uuid'] = $row["dashboard_group_uuid"]; - $array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_uuid'] = $row["dashboard_uuid"]; - //$array['dashboard'][$x]['dashboard_groups'][$y]['group_uuid'] = $row["group_uuid"]; - $array['dashboard'][$x]['dashboard_groups'][$y]['group_name'] = $row["group_name"]; - $y++; - } - } - - $x++; - } - } - - //write the code - echo "\n"; - exit; - } +// if (isset($_REQUEST["export"])) { +// $export = $_REQUEST["export"]; +// } +// +//expore settings +// if (isset($export) && $export == 'true') { +// +// //get the dashboard +// $sql = "select "; +// $sql .= "dashboard_uuid, "; +// $sql .= "dashboard_name, "; +// $sql .= "dashboard_path, "; +// $sql .= "dashboard_order, "; +// $sql .= "cast(dashboard_enabled as text), "; +// $sql .= "dashboard_description "; +// $sql .= "from v_dashboard "; +// $database = new database; +// $dashboard_widgets = $database->select($sql, $parameters, 'all'); +// unset($sql, $parameters); +// +// //prepare the array +// if (is_array($dashboard_widgets)) { +// $x = 0; +// $y = 0; +// foreach ($dashboard_widgets as $row) { +// //add to the array +// $array['dashboard'][$x]['dashboard_uuid'] = $row["dashboard_uuid"]; +// $array['dashboard'][$x]['dashboard_name'] = $row["dashboard_name"]; +// $array['dashboard'][$x]['dashboard_path'] = $row["dashboard_path"]; +// $array['dashboard'][$x]['dashboard_order'] = $row["dashboard_order"]; +// $array['dashboard'][$x]['dashboard_enabled'] = $row["dashboard_enabled"] ?: 'false'; +// $array['dashboard'][$x]['dashboard_description'] = $row["dashboard_description"]; +// +// //get the dashboard groups +// $sql = "select "; +// $sql .= "dashboard_group_uuid, "; +// $sql .= "dashboard_uuid, "; +// $sql .= "group_uuid, "; +// $sql .= "(select group_name from v_groups where v_dashboard_groups.group_uuid = group_uuid) as group_name "; +// $sql .= "from v_dashboard_groups "; +// $sql .= "where dashboard_uuid = :dashboard_uuid "; +// $parameters['dashboard_uuid'] = $row["dashboard_uuid"]; +// $database = new database; +// $dashboard_groups = $database->select($sql, $parameters, 'all'); +// unset($sql, $parameters); +// if (is_array($dashboard_groups)) { +// $y = 0; +// foreach ($dashboard_groups as $row) { +// $array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_group_uuid'] = $row["dashboard_group_uuid"]; +// $array['dashboard'][$x]['dashboard_groups'][$y]['dashboard_uuid'] = $row["dashboard_uuid"]; +// //$array['dashboard'][$x]['dashboard_groups'][$y]['group_uuid'] = $row["group_uuid"]; +// $array['dashboard'][$x]['dashboard_groups'][$y]['group_name'] = $row["group_name"]; +// $y++; +// } +// } +// +// $x++; +// } +// } +// +// //write the code +// echo "\n"; +// exit; +// } //get the count $sql = "select count(dashboard_uuid) "; @@ -324,11 +324,11 @@ if (permission_exists('dashboard_edit')) { echo " \n"; echo " \n"; - echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['dashboard_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]); + echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['dashboard_enabled']?:'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]); } else { echo " \n"; - echo $text['label-'.$row['dashboard_enabled']]; + echo $text['label-'.($row['dashboard_enabled']?:'false')]; } echo " \n"; echo " ".escape($row['dashboard_description'])."\n"; diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 126e6fa9b5..705bc32aae 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -218,15 +218,12 @@ $dashboard_column_span = $row["dashboard_column_span"]; $dashboard_details_state = $row["dashboard_details_state"]; $dashboard_order = $row["dashboard_order"]; - $dashboard_enabled = $row["dashboard_enabled"]; + $dashboard_enabled = $row["dashboard_enabled"] ?: 'false'; $dashboard_description = $row["dashboard_description"]; } unset($sql, $parameters, $row); } -//set the defaults - if (strlen($dashboard_enabled) == 0) { $dashboard_enabled = true; } - //get the child data if (is_uuid($dashboard_uuid)) { $sql = "select "; @@ -474,14 +471,14 @@ echo "\n"; if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { echo " \n"; } else { echo " \n"; } echo "
\n";