|
1
|
|
|
<?php |
|
2
|
|
|
// ------------------------------------------------------------------------ // |
|
3
|
|
|
// BOOKSHOP - MODULE FOR XOOPS 2 // |
|
4
|
|
|
// Copyright (c) 2007, 2008 Instant Zero // |
|
5
|
|
|
// <http://www.instant-zero.com/> // |
|
6
|
|
|
// ------------------------------------------------------------------------- // |
|
7
|
|
|
// This program is free software; you can redistribute it and/or modify // |
|
8
|
|
|
// it under the terms of the GNU General Public License as published by // |
|
9
|
|
|
// the Free Software Foundation; either version 2 of the License, or // |
|
10
|
|
|
// (at your option) any later version. // |
|
11
|
|
|
// // |
|
12
|
|
|
// You may not change or alter any portion of this comment or credits // |
|
13
|
|
|
// of supporting developers from this source code or any supporting // |
|
14
|
|
|
// source code which is considered copyrighted (c) material of the // |
|
15
|
|
|
// original comment or credit authors. // |
|
16
|
|
|
// // |
|
17
|
|
|
// This program is distributed in the hope that it will be useful, // |
|
18
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|
19
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|
20
|
|
|
// GNU General Public License for more details. // |
|
21
|
|
|
// // |
|
22
|
|
|
// You should have received a copy of the GNU General Public License // |
|
23
|
|
|
// along with this program; if not, write to the Free Software // |
|
24
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|
25
|
|
|
// ------------------------------------------------------------------------ // |
|
26
|
|
|
/** |
|
27
|
|
|
* Page called by Paypal in the case of cancellation of an order |
|
28
|
|
|
*/ |
|
29
|
|
|
include __DIR__ . '/header.php'; |
|
30
|
|
|
$GLOBALS['current_category'] = -1; |
|
31
|
|
|
$xoopsOption['template_main'] = 'bookshop_cancelpurchase.tpl'; |
|
32
|
|
|
include_once XOOPS_ROOT_PATH . '/header.php'; |
|
33
|
|
|
|
|
34
|
|
|
include_once BOOKSHOP_PATH . 'class/bookshop_paypal.php'; |
|
35
|
|
|
if (isset($_GET['id'])) { |
|
36
|
|
|
$critere = new Criteria('cmd_cancel', $myts->addSlashes($_GET['id']), '='); |
|
37
|
|
|
$cnt = 0; |
|
38
|
|
|
$tblCmd = array(); |
|
39
|
|
|
$cnt = $h_bookshop_commands->getCount($critere); |
|
40
|
|
|
if ($cnt > 0) { |
|
41
|
|
|
$tblCmd = $h_bookshop_commands->getObjects($critere); |
|
42
|
|
|
if (count($tblCmd) > 0) { |
|
43
|
|
|
$commande = null; |
|
44
|
|
|
$commande = $tblCmd[0]; |
|
45
|
|
|
if (is_object($commande)) { |
|
46
|
|
|
$commande->setVar('cmd_state', COMMAND_STATE_CANCELED); |
|
47
|
|
|
$h_bookshop_commands->insert($commande, true); |
|
48
|
|
|
$msg['NUM_COMMANDE'] = $commande->getVar('cmd_id'); |
|
49
|
|
|
bookshop_send_email_from_tpl('command_shop_cancel.tpl', bookshop_getEmailsFromGroup(bookshop_getmoduleoption('grp_sold')), _BOOKSHOP_ORDER_CANCELED, $msg); |
|
|
|
|
|
|
50
|
|
|
bookshop_send_email_from_tpl('command_client_cancel.tpl', $commande->getVar('cmd_email'), _BOOKSHOP_ORDER_CANCELED, $msg); |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
$h_bookshop_caddy->emptyCart(); |
|
54
|
|
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
$title = _BOOKSHOP_VALIDATE_CMD . ' - ' . bookshop_get_module_name(); |
|
58
|
|
|
bookshop_set_metas($title, $title); |
|
59
|
|
|
bookshop_setCSS(); |
|
60
|
|
|
include_once(XOOPS_ROOT_PATH . '/footer.php'); |
|
61
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: