|
Lines 106-117
my $userenv = C4::Context->userenv;
Link Here
|
| 106 |
|
106 |
|
| 107 |
## Deal with guarantor stuff |
107 |
## Deal with guarantor stuff |
| 108 |
$template->param( relationships => scalar $patron->guarantor_relationships ) if $patron; |
108 |
$template->param( relationships => scalar $patron->guarantor_relationships ) if $patron; |
| 109 |
my $guarantorinfo = $input->param('guarantorinfo'); |
109 |
#Either use existing guarantor id or new from params |
| 110 |
my $guarantor_id = $input->param('new_guarantor_id'); |
110 |
my @guarantors = $patron->guarantor_relationships()->guarantors if $patron; |
|
|
111 |
my $found_guarantor_id; |
| 112 |
foreach my $guarantor (@guarantors){ |
| 113 |
$found_guarantor_id = $guarantor->id; |
| 114 |
}; |
| 115 |
my $guarantor_id = $input->param('new_guarantor_id') || $found_guarantor_id; |
| 111 |
my $guarantor = undef; |
116 |
my $guarantor = undef; |
| 112 |
$guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; |
117 |
$guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; |
| 113 |
$template->param( guarantor => $guarantor ); |
118 |
$template->param( guarantor => $guarantor ); |
| 114 |
|
|
|
| 115 |
my @delete_guarantor = $input->multi_param('delete_guarantor'); |
119 |
my @delete_guarantor = $input->multi_param('delete_guarantor'); |
| 116 |
foreach my $id ( @delete_guarantor ) { |
120 |
foreach my $id ( @delete_guarantor ) { |
| 117 |
my $r = Koha::Patron::Relationships->find( $id ); |
121 |
my $r = Koha::Patron::Relationships->find( $id ); |
| 118 |
- |
|
|