|
Lines 33-56
my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($cgi, undef);
Link Here
|
| 33 |
my $result; |
33 |
my $result; |
| 34 |
|
34 |
|
| 35 |
if ($status eq 'ok') { # if authentication is ok |
35 |
if ($status eq 'ok') { # if authentication is ok |
|
|
36 |
|
| 37 |
$userid = $cgi->param('userid') || ''; |
| 38 |
$branchcode = $cgi->param('branchcode') || ''; |
| 39 |
$timestamp = $cgi->param('timestamp') || ''; |
| 40 |
$action = $cgi->param('action') || ''; |
| 41 |
$barcode = $cgi->param('barcode') || ''; |
| 42 |
$barcode =~ s/^\s+|\s+$//; |
| 43 |
$cardnumber = $cgi->param('cardnumber') || ''; |
| 44 |
$cardnumber =~ s/^\s+|\s+$//; |
| 45 |
|
| 36 |
if ( $cgi->param('pending') eq 'true' ) { # if the 'pending' flag is true, we store the operation in the db instead of directly processing them |
46 |
if ( $cgi->param('pending') eq 'true' ) { # if the 'pending' flag is true, we store the operation in the db instead of directly processing them |
| 37 |
$result = AddOfflineOperation( |
47 |
$result = AddOfflineOperation( |
| 38 |
$cgi->param('userid') || '', |
48 |
$userid, |
| 39 |
$cgi->param('branchcode') || '', |
49 |
$branchcode, |
| 40 |
$cgi->param('timestamp') || '', |
50 |
$timestamp, |
| 41 |
$cgi->param('action') || '', |
51 |
$action, |
| 42 |
$cgi->param('barcode') || '', |
52 |
$barcode, |
| 43 |
$cgi->param('cardnumber') || '', |
53 |
$cardnumber, |
| 44 |
); |
54 |
); |
| 45 |
} else { |
55 |
} else { |
| 46 |
$result = ProcessOfflineOperation( |
56 |
$result = ProcessOfflineOperation( |
| 47 |
{ |
57 |
{ |
| 48 |
'userid' => $cgi->param('userid'), |
58 |
'userid' => $userid, |
| 49 |
'branchcode' => $cgi->param('branchcode'), |
59 |
'branchcode' => $branchcode, |
| 50 |
'timestamp' => $cgi->param('timestamp'), |
60 |
'timestamp' => $timestamp, |
| 51 |
'action' => $cgi->param('action'), |
61 |
'action' => $action, |
| 52 |
'barcode' => $cgi->param('barcode'), |
62 |
'barcode' => $barcode, |
| 53 |
'cardnumber' => $cgi->param('cardnumber'), |
63 |
'cardnumber' => $cardnumber, |
| 54 |
} |
64 |
} |
| 55 |
); |
65 |
); |
| 56 |
} |
66 |
} |
| 57 |
- |
|
|