http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15163

--- Comment #11 from Jonathan Druart <jonathan.dru...@bugs.koha-community.org> 
---
Jesse, yes it should be the way to go but..
I have already tried something and was stuck. I have a wip branch but I don't
remember what was wrong.

Looking at the diff it seems that I have tried to add a
DeleteBorrowerAttributes subroutines and the code looks quite complicated:

+sub DeleteBorrowerAttributes {
+    my $borrowernumber = shift;
+    my $no_branch_limit = @_ ? shift : 0;
+    my $branch_limit = $no_branch_limit
+        ? 0
+        : C4::Context->userenv ? C4::Context->userenv->{"branch"} : 0;
+
+    my $dbh = C4::Context->dbh;
+    my $query = q{
+        DELETE FROM borrower_attributes
+        };
+    $query .= q{
+        LEFT JOIN borrower_attribute_types_branches ON bat_code = code
+        WHERE b_branchcode = ? OR b_branchcode IS NULL
+    } if $branch_limit;
+    $query .= q{
+        WHERE borrowernumber = ?
+    };
+
+    $dbh->do( $query, undef, $branch_limit ? $branch_limit : (),
$borrowernumber );
+}

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to