]> git.agnieray.net Git - galette.git/commitdiff
Fix contribution selection from transaction
authorJohan Cwiklinski <johan@x-tnd.be>
Sat, 9 Oct 2021 06:50:17 +0000 (08:50 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sat, 9 Oct 2021 07:00:49 +0000 (09:00 +0200)
galette/lib/Galette/Controllers/Crud/TransactionsController.php
galette/templates/default/ajouter_transaction.tpl

index 067c71061d110adce40bcdcfea57278d0fff3fbd..bc58aa6c67491b3b40ffb589dd8e197d852f1796 100644 (file)
@@ -275,7 +275,7 @@ class TransactionsController extends ContributionsController
         }
 
         if (count($error_detected) == 0) {
-            if ($trans->getMissingAmount() > 0) {
+            if (isset($post['contrib_type']) && $trans->getMissingAmount() > 0) {
                 $rparams = [
                     'type' => $post['contrib_type']
                 ];
index ba7e5bfa1c82d18352ef0468b6a4817e0bbaad21..522cfe333e7ebca08603f540fe83da503888bb9e 100644 (file)
             }
 
             var _contribs_ajax_mapper = function(res){
-                $("#contributions_list #legende").remove();
                 $('#contributions_list').append( res );
+                $("#contributions_list #legende").remove();
+                $("#contributions_list i.fa-filter").remove();
 
                 //Deactivate contributions list links
                 $('#contributions_list tbody a').click(function(){
                     });
                     return false;
                 });
-                //Bind pagination links
-                $('#contributions_list .pages a').bind({
+                //Bind pagination and ordering links
+                $('#contributions_list .pages a, #contributions_list thead a').bind({
                     click: function(){
                         $.ajax({
                             url: this.href.substring(this.href.indexOf('?')) + (this.href.indexOf('?') > -1 ? "&" : "?") + "ajax=true",
                 //Select a row
                 $('#contributions_list .contribution_row').click(function(){
                     $('#contributions_list').dialog("close");
-                    var _cid = $(this).find('input[name="contrib_id"]').val();
+                    var _cid = $(this).find('input[name="contrib_sel[]"]').val();
                     window.location.href = '{path_for name="attach_contribution" data=["id" => $transaction->id, "cid" => "%cid"]}'.replace(/%cid/, _cid);
                 }).css('cursor', 'pointer').attr('title', '{_T string="Click on a contribution row to attach it to the current transaction" escape="js"}');
             }