diff --git a/modules/cases/execute_attachement.php b/modules/cases/execute_attachement.php index 697ef889edce38bc7baf461abedf6f900a11a66b..b0669c90fcec73a8385d9bdc33886c28d62673d1 100755 --- a/modules/cases/execute_attachement.php +++ b/modules/cases/execute_attachement.php @@ -112,6 +112,23 @@ if (($core_tools->test_service('join_res_case', 'cases', false) == 1) || ($core_ case_id.value = '<?php functions::xecho($return_description['case_id'] ); ?>'; case_label.value = '<?php echo addslashes($return_description['case_label']); ?>'; case_description.value = '<?php echo addslashes($return_description['case_description']); ?>'; + lang_unlink_case = '<?php echo addslashes(_UNLINK_CASE);?>'; + url_script = '<?php echo $_SESSION['config']['businessappurl']?>'+'index.php?display=true&module=cases&page=unlink_case'; + case_id = '<?php echo $return_description['case_id']; ?>'; + res_id = '<?php echo $actual_res_id; ?>'; + strOnClick = 'if(confirm(\"'+lang_unlink_case+'?\")){unlink_case(\''+url_script+'\','+case_id+','+res_id+');}'; + + var btn_unlink_case = $j(' <input/>').attr({ + type : "button", + id : "btn_unlink_case", + onclick : strOnClick, + class : 'button', + value : lang_unlink_case + }); + + btn_search_case = window.opener.$j('#search_case'); + btn_search_case.after(btn_unlink_case); + btn_search_case.after('<span> </span>'); } //self.close(); diff --git a/modules/cases/js/functions.js b/modules/cases/js/functions.js index a50701116989822a0f90641ab6740b0c1f323b62..4e6ab313df6f1e69976d3b9643a0f0f94d184224 100755 --- a/modules/cases/js/functions.js +++ b/modules/cases/js/functions.js @@ -9,7 +9,7 @@ function unlink_case(path_manage_script,case_id,res_id){ onSuccess: function(answer){ eval('response='+answer.responseText); if(response){ - window.location.href='index.php?page=details&dir=indexing_searching&id='+res_id; + window.top.location.href='index.php?page=details&dir=indexing_searching&id='+res_id; }else{ alert('Something went wrong...'); } diff --git a/modules/cases/show_case_tab.php b/modules/cases/show_case_tab.php index 6f0bfd33e5c9b1f91aa20ade9d1878269a984f9c..a18369822bf121d6c44f37a726424b75392c5a32 100755 --- a/modules/cases/show_case_tab.php +++ b/modules/cases/show_case_tab.php @@ -73,7 +73,14 @@ if ($core_tools->test_service('join_res_case_in_process', 'cases', false) == 1) . 'index.php?display=true&module=cases&page=search_adv_for_cases' . '&searched_item=res_id_in_process&searched_value=' . $_SESSION['doc_id'] . '\',\'\', \'scrollbars=yes,menubar=no,toolbar=no,resizable=yes,' - . 'status=no,width=1020,height=710\');"/></td>'; + . 'status=no,width=1020,height=710\');"/>'; + + if($case_properties['case_id'] <> ''){ + $frm_str .= ' <input type="button" class="button" name="btn_unlink_case" ' + . 'id="btn_unlink_case" value="'._UNLINK_CASE.'"' + . 'onclick="if(confirm(\''.addslashes(_UNLINK_CASE).'?\')){unlink_case(\''.$_SESSION['config']['businessappurl'].'index.php?display=true&module=cases&page=unlink_case\','.$case_properties['case_id'].','. $res_id .');}"/>'; + } + $frm_str .= '</td>'; } $frm_str .= '</tr>'; $frm_str .= '</table>';