Skip to content

Commit

Permalink
BTHAB-200: Refresh Case order table post delete
Browse files Browse the repository at this point in the history
  • Loading branch information
olayiwola-compucorp committed Jul 17, 2023
1 parent 2408411 commit 4492d08
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CRM/Civicase/Form/CaseSalesOrderDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function preProcess() {
* {@inheritDoc}
*/
public function buildQuickForm() {
$this->assign('id', $this->id);

$this->addButtons([
[
'type' => 'submit',
Expand Down
2 changes: 2 additions & 0 deletions ang/civicase-features.ang.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ function set_case_sales_order_status(&$options) {
'crmUi',
'crmUtil',
'civicase',
'ui.sortable',
'dialogService',
'civicase-base',
'afsearchQuotations',
'afsearchContactQuotations',
Expand Down
4 changes: 0 additions & 4 deletions js/sales-order-contribution.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
});
}

$("a[target='crm-popup']").on('crmPopupFormSuccess', function (e) {
CRM.refreshParent(e);
});

/**
* @param {number} quantity Item quantity
* @param {number} unitPrice Item unit price
Expand Down
5 changes: 4 additions & 1 deletion templates/CRM/Civicase/Form/CaseSalesOrderDelete.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
</div>

<script type="text/javascript">
const id = { $id }
{literal}
CRM.$(function($) {
$("a[target='crm-popup']").on('crmPopupFormSuccess', function (e) {
CRM.refreshParent(e);
const val = CRM.$('.civicase__features input#id-0').val();
CRM.$('.civicase__features input#id-0').val(id).change();
CRM.$('.civicase__features input#id-0').val(val).change();
});
});
{/literal}
Expand Down

0 comments on commit 4492d08

Please sign in to comment.