Skip to content
Permalink
Browse files

Deposit fixes (Replaces #4346) (#4352)

* Changed constructor from class name

* Added a check when a deposit created without status

* added a transaltion object for the 'blank' comment dialog box

* added bootstrap classes for nice and intactive table

* removed indentation. Used js translation function

* spacing

* spacing
  • Loading branch information...
crossan007 committed Jun 29, 2018
1 parent 62beb1f commit cf6ba093f393feea2d289eb97e0b91c3c3ad5cb2
Showing with 31 additions and 3 deletions.
  1. +1 −1 src/CSVImport.php
  2. +2 −1 src/FindDepositSlip.php
  3. +28 −1 src/skin/js/FindDepositSlip.js
@@ -39,7 +39,7 @@ class Family
public $_type; // 0=patriarch, 1=martriarch
// constructor, initialize variables
public function Family($famtype)
public function __construct($famtype)
{
$this->_type = $famtype;
$this->MemberCount = 0;
@@ -72,7 +72,7 @@
</div>
<div class="box-body">
<div class="container-fluid">
<table class="display responsive nowrap data-table" id="depositsTable" width="100%"></table>
<table class="display responsive nowrap data-table table table-striped table-hover" id="depositsTable" width="100%"></table>

<button type="button" id="deleteSelectedRows" class="btn btn-danger"
disabled> <?= gettext('Delete Selected Rows') ?> </button>
@@ -85,6 +85,7 @@
</div>
</div>
</div>

<script src="<?= SystemURLs::getRootPath() ?>/skin/js/FindDepositSlip.js"></script>

<script nonce="<?= SystemURLs::getCSPNonce() ?>">
@@ -8,6 +8,33 @@ $(document).ready(function () {
'depositComment': $("#depositComment").val(),
'depositDate': $("#depositDate").val()
};

if(!$("#depositComment").val().trim()){
bootbox.confirm({
title: i18next.t('Add New Deposit'),
message: i18next.t('You are about to add a new deposit without a comment'),
buttons: {
cancel: {
label: i18next.t('Cancel')
},
confirm: {
label: i18next.t('Confirm')
}
},
callback: function (result) {
if(result == true){
addNewDepositRequest(newDeposit);
}
}
});

}else{
addNewDepositRequest(newDeposit);
}

});

function addNewDepositRequest(newDeposit){
$.ajax({
method: "POST",
url: window.CRM.root + "/api/deposits",
@@ -19,7 +46,7 @@ $(document).ready(function () {
dataT.row.add(data);
dataT.rows().invalidate().draw(true);
});
});
};

dataT = $("#depositsTable").DataTable({
"language": {

0 comments on commit cf6ba09

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.