-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Hide dashboard cards on demographics page #7423
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -645,6 +645,38 @@ function checkBackgroundServices() | |
echo "</option>\n"; | ||
} | ||
echo " </select>\n"; | ||
} elseif ($fldtype == GlobalSetting::DATA_TYPE_MULTI_DASHBOARD_CARDS) { | ||
$hiddenList = []; | ||
$ret = sqlStatement("SELECT gl_value FROM `globals` WHERE `gl_name` = 'hide_dashboard_cards'"); | ||
while ($row = sqlFetchArray($ret)) { | ||
$hiddenList[] = $row['gl_value']; | ||
} | ||
// The list of cards to hide. For now add to array new cards. | ||
$res = array( | ||
['card_abrev' => '', 'card_name' => xlt('None or Reset')], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how does this work for a multiselect? Couldn't they select this and still select other items? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could but why would you! Even if selected will be ignored. 1 in 100 chance for user doing that. I'll take the odds rather adding a JS or having user unselect to an unselected box. |
||
['card_abrev' => attr('card_allergies'), 'card_name' => xlt('Allergies')], | ||
['card_abrev' => attr('card_amendments'), 'card_name' => xlt('Amendments')], | ||
['card_abrev' => attr('card_disclosure'), 'card_name' => xlt('Disclosures')], | ||
['card_abrev' => attr('card_lab'), 'card_name' => xlt('Labs')], | ||
['card_abrev' => attr('card_medicalproblems'), 'card_name' => xlt('Medical Problems')], | ||
['card_abrev' => attr('card_medication'), 'card_name' => xlt('Medications')], | ||
//['card_abrev' => 'card_rx', 'card_name' => 'Prescriptions'], // For now don't hide because can be disabled as feature. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. up to you, but i think ok if you want to also include prescriptions in this feature There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bradymiller prescriptions already have its own disable feature. No need to include it here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still say this should be user selectable simply for fact all user don't need all cards but don't want to reargue here!:) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But I think I see @bradymiller point is to move the old turn-off feature into here so that people don't have to go to two spots to turn off a card. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree but I left to others to decide and I asked admins on signal is why Brady chimed in. but i'll add in my PR. thanks |
||
['card_abrev' => attr('card_vitals'), 'card_name' => xlt('Vitals')] | ||
); | ||
echo " <select multiple class='form-control' name='form_{$i}[]' id='form_{$i}[]' size='8'>\n"; | ||
foreach ($res as $row) { | ||
echo " <option value='" . attr($row['card_abrev']) . "'"; | ||
foreach ($glarr as $glrow) { | ||
if ($glrow['gl_value'] == $row['card_abrev']) { | ||
echo " selected"; | ||
break; | ||
} | ||
} | ||
echo ">"; | ||
echo xlt($row['card_name']); | ||
echo "</option>\n"; | ||
} | ||
echo " </select>\n"; | ||
} elseif ($fldtype == GlobalSetting::DATA_TYPE_COLOR_CODE) { | ||
if ($userMode) { | ||
$globalTitle = $globalValue; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't this result in boolean instead of 1 or 0. Wouldn't this make more sense:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd think so but think how PHP handles truthy though your way would work but I left same logic as original.