I need child record button to open in new window

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
jbaldree
Posts: 5
Joined: 2020-07-23 06:44

I need child record button to open in new window

Post by jbaldree » 2021-01-10 15:30

How do I edit the code to make the button open in a new window on a child record?

// child table: starmath
$res = sql("SELECT `st_id` FROM `students` WHERE `st_id`='{$selected_id}'", $eo);
$st_id = db_fetch_row($res);
$rires = sql("SELECT COUNT(1) FROM `starmath` WHERE `student`='" . makeSafe($st_id[0]) . "'", $eo);
$rirow = db_fetch_row($rires);
if($rirow[0] && !$AllowDeleteOfParents && !$skipChecks) {
$RetMsg = $Translation["couldn't delete"];
$RetMsg = str_replace('<RelatedRecords>', $rirow[0], $RetMsg);
$RetMsg = str_replace('<TableName>', 'starmath', $RetMsg);
return $RetMsg;
} elseif($rirow[0] && $AllowDeleteOfParents && !$skipChecks) {
$RetMsg = $Translation['confirm delete'];
$RetMsg = str_replace('<RelatedRecords>', $rirow[0], $RetMsg);
$RetMsg = str_replace('<TableName>', 'starmath', $RetMsg);
$RetMsg = str_replace('<Delete>', '<input type="button" class="button" value="' . $Translation['yes'] . '" onClick="window.location = \'students_view.php?SelectedID=' . urlencode($selected_id) . '&delete_x=1&confirmed=1\';">', $RetMsg);
$RetMsg = str_replace('<Cancel>', '<input type="button" class="button" value="' . $Translation[ 'no'] . '" onClick="window.location = \'students_view.php?SelectedID=' . urlencode($selected_id) . '\';">', $RetMsg);
return $RetMsg;
}

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 1158
Joined: 2018-04-01 10:12

Re: I need child record button to open in new window

Post by pböttcher » 2021-01-10 19:39

Hi,

can you be a bit more specific. I do not see a button in this code.

jbaldree
Posts: 5
Joined: 2020-07-23 06:44

Re: I need child record button to open in new window

Post by jbaldree » 2021-01-11 00:21

Is this the button?

<a class="visible-xs btn btn-default btn-lg btn-block hidden vspacer-sm" href="Contacts_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>" id="xs_Contacts_link"><i class="glyphicon glyphicon-list-alt"></i> Contacts</a>

jbaldree
Posts: 5
Joined: 2020-07-23 06:44

Re: I need child record button to open in new window

Post by jbaldree » 2021-01-11 00:37

<a class="hidden-xs btn btn-default btn-lg pull-right hidden hspacer-sm" href="starmath_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>" id="starmath_link"><i class="glyphicon glyphicon-list-alt"></i> STAR Math</a>
<a class="visible-xs btn btn-default btn-lg btn-block hidden vspacer-sm" href="starmath_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>" id="xs_starmath_link"><i class="glyphicon glyphicon-list-alt"></i> STAR Math</a>
<input type="hidden" id="starmath_hclink" value="starmath_view.php?filterer_student=<%%URLVALUE(st_id)%%>&<%%EMBEDDED%%>">
<div class="clearfix"></div>
</div>

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 1158
Joined: 2018-04-01 10:12

Re: I need child record button to open in new window

Post by pböttcher » 2021-01-11 07:39

Hi,

that is a least a link that will be displayed like a button.

Can you make a screenshot to show where you want to click to open the record in a new window.

Post Reply