Skip to content
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

Allow section copy & global copy from another encounter for the same … #7279

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

gauravsontakke
Copy link
Contributor

@gauravsontakke gauravsontakke commented Mar 20, 2024

…LBF Form

#7278

Fixes #

Short description of what this resolves:

Allow section copy & global copy from another encounter.

Changes proposed in this pull request:

Allowing user to either use global copy or section copy in the layout based forms. This is an improvement to the usage adds flexibility while using the layout based forms.

Copy link
Sponsor Member

@stephenwaite stephenwaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted some escaping stuff @gauravsontakke , thanks for the PR, looks like a neat feature

interface/forms/LBF/new.php Outdated Show resolved Hide resolved
interface/forms/LBF/new.php Outdated Show resolved Hide resolved
interface/forms/LBF/new.php Outdated Show resolved Hide resolved
interface/forms/LBF/new.php Outdated Show resolved Hide resolved
interface/forms/LBF/new.php Outdated Show resolved Hide resolved
interface/forms/LBF/php/find_encounter_form_popup.php Outdated Show resolved Hide resolved
interface/forms/LBF/php/find_encounter_form_popup.php Outdated Show resolved Hide resolved
interface/forms/LBF/php/find_encounter_form_popup.php Outdated Show resolved Hide resolved
interface/super/edit_layout_props.php Outdated Show resolved Hide resolved
sql/7_0_2-to-7_0_3_upgrade.sql Show resolved Hide resolved
// This invokes the find lbf forms popup.
function handleLBFFormsPopup(formname = '', encounter = '', pid = '') {
let url = '<?php echo $GLOBALS['webroot']; ?>/interface/forms/LBF/php/find_encounter_form_popup.php?pid=' + encodeURIComponent(pid) + '&formname=' + encodeURIComponent(formname) + '&encounter=' + encodeURIComponent(encounter);
let title = "<?php echo xlt('Select Encounter'); ?>";
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xlj (note dropped the outside quotes):

let title = <?php echo xlj('Select Encounter'); ?>;

return false;
}

if (confirm(<?php echo xlj('Load data from selected encounter form into this form?') . '' ?> + '\n' + <?php echo xlj('Current data in this form will be overwritten.'); ?>)) {
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the . '' supposed to do?


<html>
<head>
<title><?php echo xl('Select Encounter'); ?></title>
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xlt instead of xl

<html>
<head>
<title><?php echo xl('Select Encounter'); ?></title>
<link rel="stylesheet" href='<?php echo $css_header ?>' type='text/css'>
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't need line above (below line does that and note that the below line does not need dialog, jquery, fontawesome, or main-theme in the parameters since these are always included when call below function)


function selEncounterForm(encounter_id, form_id, pid) {
if (opener.closed || ! opener.setEncounterForm)
alert("<?php echo xl('The destination form was closed; I cannot act on your selection.'); ?>");
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xlj instead of xl and need to then remove the outside quotes

$pName = ' - ' . $pName;
}

$signed = $item['signed'] === true ? 'Signed' : 'Unsigned';
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support translate via xl:

$signed = $item['signed'] === true ? xl('Signed') : xl('Unsigned');


$signed = $item['signed'] === true ? 'Signed' : 'Unsigned';
if (!empty($signed)) {
$signed = ' - <i>' . $signed . '</i>';
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

htmlescape via text()

$signed = ' - <i>' . text($signed) . '</i>';

$signed = ' - <i>' . $signed . '</i>';
}

$titleLink = trim($edate . ' ' . $cCat . $pName . $signed);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

htmlescape via text()

$titleLink = trim(text($edate) . ' ' . text($cCat) . text($pName) . $signed);

@@ -113,3 +113,7 @@
ALTER TABLE `form_encounter` ADD `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
#EndIf


#IfMissingColumn layout_group_properties grpsec_copy_allow
ALTER TABLE `layout_group_properties` ADD `grpsec_copy_allow` tinyint(1) DEFAULT 0 AFTER `grp_last_update`;
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the AFTER grp_last_update
(just potential for breaking in upgrade in future if for some reason that column is removed)

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also would make it identical to the type you have in database.sql to ensure no differences in upgraded versions. ie. not null default 0

@adunsulag
Copy link
Sponsor Member

@gauravsontakke This PR has a conflict that needs to be addressed. Also, if you've resolved your PR issues please comment in each area where an admin has flagged an issue that you've resolved it so it can be re-reviewed.

@adunsulag adunsulag added this to the 7.0.2.2 milestone Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants