From: <txm...@us...> - 2013-03-23 12:44:36
|
Revision: 11292 http://sourceforge.net/p/xoops/svn/11292 Author: txmodxoops Date: 2013-03-23 12:44:31 +0000 (Sat, 23 Mar 2013) Log Message: ----------- Separated code in single files admin gui 2.5.5 Added Paths: ----------- XoopsModules/xpayment/branches/timgno/ XoopsModules/xpayment/branches/timgno/xpayment/ XoopsModules/xpayment/branches/timgno/xpayment/accounts.php XoopsModules/xpayment/branches/timgno/xpayment/admin/ XoopsModules/xpayment/branches/timgno/xpayment/admin/about.php XoopsModules/xpayment/branches/timgno/xpayment/admin/discounts.php XoopsModules/xpayment/branches/timgno/xpayment/admin/gateways.php XoopsModules/xpayment/branches/timgno/xpayment/admin/groups.php XoopsModules/xpayment/branches/timgno/xpayment/admin/header.php XoopsModules/xpayment/branches/timgno/xpayment/admin/index.html XoopsModules/xpayment/branches/timgno/xpayment/admin/index.php XoopsModules/xpayment/branches/timgno/xpayment/admin/invoices.php XoopsModules/xpayment/branches/timgno/xpayment/admin/menu.php XoopsModules/xpayment/branches/timgno/xpayment/admin/permissions.php XoopsModules/xpayment/branches/timgno/xpayment/admin/tax.php XoopsModules/xpayment/branches/timgno/xpayment/admin/transactions.php XoopsModules/xpayment/branches/timgno/xpayment/broker.php XoopsModules/xpayment/branches/timgno/xpayment/cancel.php XoopsModules/xpayment/branches/timgno/xpayment/class/ XoopsModules/xpayment/branches/timgno/xpayment/class/autotax.php XoopsModules/xpayment/branches/timgno/xpayment/class/discounts.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/ XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/ccbill/ XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/ccbill/ccbill.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/ccbill/gateway_info.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/ccbill/index.html XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/ XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/gateway_info.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/google.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googlecart.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googleitem.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googlelog.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googlemerchantcalculations.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googlenotification.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googlenotificationhistory.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googlepoll.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googlerequest.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googleresponse.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googleresult.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googleshipping.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googlesubscription.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/googletax.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/htmlSignatureGen.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/index.html XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/xml-processing/ XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/xml-processing/gc_xmlbuilder.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/google/xml-processing/gc_xmlparser.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/index.html XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/paypal/ XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/paypal/gateway_info.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/paypal/index.html XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/paypal/paypal.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/twocheckout/ XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/twocheckout/gateway_info.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/twocheckout/index.html XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/twocheckout/twocheckout.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/zombaio/ XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/zombaio/gateway_info.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/zombaio/index.html XoopsModules/xpayment/branches/timgno/xpayment/class/gateway/zombaio/zombaio.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateways.php XoopsModules/xpayment/branches/timgno/xpayment/class/gateways_options.php XoopsModules/xpayment/branches/timgno/xpayment/class/groups.php XoopsModules/xpayment/branches/timgno/xpayment/class/index.html XoopsModules/xpayment/branches/timgno/xpayment/class/invoice.php XoopsModules/xpayment/branches/timgno/xpayment/class/invoice_items.php XoopsModules/xpayment/branches/timgno/xpayment/class/invoice_transactions.php XoopsModules/xpayment/branches/timgno/xpayment/class/ip2locationlite.class.php XoopsModules/xpayment/branches/timgno/xpayment/crons/ XoopsModules/xpayment/branches/timgno/xpayment/crons/actions.php XoopsModules/xpayment/branches/timgno/xpayment/docs/ XoopsModules/xpayment/branches/timgno/xpayment/docs/changelog.txt XoopsModules/xpayment/branches/timgno/xpayment/docs/credits.txt XoopsModules/xpayment/branches/timgno/xpayment/docs/index.html XoopsModules/xpayment/branches/timgno/xpayment/docs/install.txt XoopsModules/xpayment/branches/timgno/xpayment/docs/lang_diff.txt XoopsModules/xpayment/branches/timgno/xpayment/docs/licence.txt XoopsModules/xpayment/branches/timgno/xpayment/docs/readme.txt XoopsModules/xpayment/branches/timgno/xpayment/dojsongateway.php XoopsModules/xpayment/branches/timgno/xpayment/header.php XoopsModules/xpayment/branches/timgno/xpayment/images/ XoopsModules/xpayment/branches/timgno/xpayment/images/icons/ XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/ XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/index.html XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/xpayment.discounts.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/xpayment.gateways.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/xpayment.groups.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/xpayment.invoices.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/xpayment.permissions.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/xpayment.taxes.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/16/xpayment.transactions.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/ XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/index.html XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/xpayment.discounts.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/xpayment.gateways.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/xpayment.groups.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/xpayment.invoices.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/xpayment.permissions.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/xpayment.taxes.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/32/xpayment.transactions.png XoopsModules/xpayment/branches/timgno/xpayment/images/icons/index.html XoopsModules/xpayment/branches/timgno/xpayment/images/index.html XoopsModules/xpayment/branches/timgno/xpayment/images/pdf.png XoopsModules/xpayment/branches/timgno/xpayment/images/xpayment_slogo.png XoopsModules/xpayment/branches/timgno/xpayment/include/ XoopsModules/xpayment/branches/timgno/xpayment/include/JSON.php XoopsModules/xpayment/branches/timgno/xpayment/include/formselectgateway.php XoopsModules/xpayment/branches/timgno/xpayment/include/formselectinvoicemode.php XoopsModules/xpayment/branches/timgno/xpayment/include/formselectinvoiceremittion.php XoopsModules/xpayment/branches/timgno/xpayment/include/formselectplugin.php XoopsModules/xpayment/branches/timgno/xpayment/include/formselectuser.php XoopsModules/xpayment/branches/timgno/xpayment/include/index.html XoopsModules/xpayment/branches/timgno/xpayment/include/install.php XoopsModules/xpayment/branches/timgno/xpayment/include/onupdate.php XoopsModules/xpayment/branches/timgno/xpayment/include/uninstall.php XoopsModules/xpayment/branches/timgno/xpayment/include/xpayment.forms.php XoopsModules/xpayment/branches/timgno/xpayment/include/xpayment.functions.php XoopsModules/xpayment/branches/timgno/xpayment/include/xpayment.objects.php XoopsModules/xpayment/branches/timgno/xpayment/index.php XoopsModules/xpayment/branches/timgno/xpayment/ipn.php XoopsModules/xpayment/branches/timgno/xpayment/js/ XoopsModules/xpayment/branches/timgno/xpayment/js/index.html XoopsModules/xpayment/branches/timgno/xpayment/js/jquery.json.gateway.js XoopsModules/xpayment/branches/timgno/xpayment/language/ XoopsModules/xpayment/branches/timgno/xpayment/language/english/ XoopsModules/xpayment/branches/timgno/xpayment/language/english/admin.php XoopsModules/xpayment/branches/timgno/xpayment/language/english/block.php XoopsModules/xpayment/branches/timgno/xpayment/language/english/ccbill.php XoopsModules/xpayment/branches/timgno/xpayment/language/english/google.php XoopsModules/xpayment/branches/timgno/xpayment/language/english/help/ XoopsModules/xpayment/branches/timgno/xpayment/language/english/help/help.html XoopsModules/xpayment/branches/timgno/xpayment/language/english/help/index.html XoopsModules/xpayment/branches/timgno/xpayment/language/english/index.html XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/ XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/index.html XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_discount_more.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_discount_new.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_discount_reminder.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_collect.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_damaged.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_discounted.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_express.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_fraud.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_none.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_notice.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_pending.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_purchased.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_refunded.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_settled.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_canceled_undelivered.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_created.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_collect.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_damaged.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_discounted.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_express.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_fraud.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_none.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_notice.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_pending.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_purchased.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_refunded.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_settled.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_paid_undelieved.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_reminder.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_canceled_notice.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_canceled_other.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_canceled_payment.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_canceled_pending.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_canceled_refund.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_paid_notice.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_paid_other.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_paid_payment.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_paid_pending.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_paid_refund.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_unpaid_notice.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_unpaid_other.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_unpaid_payment.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_unpaid_pending.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_transaction_unpaid_refund.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_collect.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_damaged.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_discounted.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_express.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_fraud.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_none.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_notice.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_pending.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_purchased.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_refunded.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_settled.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/mail_templates/xpayment_invoice_unpaid_undelieved.tpl XoopsModules/xpayment/branches/timgno/xpayment/language/english/main.php XoopsModules/xpayment/branches/timgno/xpayment/language/english/modinfo.php XoopsModules/xpayment/branches/timgno/xpayment/language/english/paypal.php XoopsModules/xpayment/branches/timgno/xpayment/language/english/twocheckout.php XoopsModules/xpayment/branches/timgno/xpayment/language/english/zombaio.php XoopsModules/xpayment/branches/timgno/xpayment/language/index.html XoopsModules/xpayment/branches/timgno/xpayment/officers.php XoopsModules/xpayment/branches/timgno/xpayment/pdf.php XoopsModules/xpayment/branches/timgno/xpayment/plugin/ XoopsModules/xpayment/branches/timgno/xpayment/plugin/example.php XoopsModules/xpayment/branches/timgno/xpayment/plugin/xpayment.php XoopsModules/xpayment/branches/timgno/xpayment/return.php XoopsModules/xpayment/branches/timgno/xpayment/sql/ XoopsModules/xpayment/branches/timgno/xpayment/sql/index.html XoopsModules/xpayment/branches/timgno/xpayment/sql/mysql.sql XoopsModules/xpayment/branches/timgno/xpayment/templates/ XoopsModules/xpayment/branches/timgno/xpayment/templates/index.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cancel.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_discounts_list.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_gateways_list.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_gateways_options.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_groups.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_groups_edit.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_invoice_list.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_invoice_view.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_tax_list.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_transactions_list.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_cpanel_transactions_view.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_help.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_invoice.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_invoice_list.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_invoice_view.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_payment.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_payment_pdf.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_return.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_transactions_list.html XoopsModules/xpayment/branches/timgno/xpayment/templates/xpayment_transactions_view.html XoopsModules/xpayment/branches/timgno/xpayment/xoops_version.php Added: XoopsModules/xpayment/branches/timgno/xpayment/accounts.php =================================================================== --- XoopsModules/xpayment/branches/timgno/xpayment/accounts.php (rev 0) +++ XoopsModules/xpayment/branches/timgno/xpayment/accounts.php 2013-03-23 12:44:31 UTC (rev 11292) @@ -0,0 +1,241 @@ +<?php +/** + * Invoice Transaction Gateway with Modular Plugin set + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Co-Op http://www.chronolabs.coop/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package xpayment + * @since 1.30.0 + * @author Simon Roberts <si...@ch...> + * @translation Erol Konik <ap...@ap...> + * @translation Mariane <mar...@ho...> + * @translation Voltan <vo...@xo...> + * @translation Ezsky <ezs...@gm...> + * @translation Richardo Costa <lus...@gm...> + * @translation Kris_fr <kr...@fr...> + */ + include('header.php'); + + if (!is_object($GLOBALS['xoopsUser'])) { + redirect_header(XOOPS_URL.'/modules/xpayment/index.php', 3, _NOPERM); + exit(0); + } + + if (!in_array($GLOBALS['xoopsModuleConfig']['accounts'], $GLOBALS['xoopsUser']->getGroups())) { + redirect_header(XOOPS_URL.'/modules/xpayment/index.php', 3, _NOPERM); + exit(0); + } + + xoops_loadLanguage('admin', 'xpayment'); + + switch($_REQUEST['op']) { + default: + case "invoices": + switch ($_REQUEST['fct']) + { + default: + case "list": + $xoopsOption['template_main'] = 'xpayment_invoice_list.html'; + include_once $GLOBALS['xoops']->path( "/header.php" ); + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + + $invoice_handler =& xoops_getmodulehandler('invoice', 'xpayment'); + + $criteria = new CriteriaCompo(new Criteria('accounts_uids', '%"'.$GLOBALS['xoopsUser']->getVar('uid').'"%', 'LIKE')); + + $ttl = $invoice_handler->getCount($criteria); + $limit = !empty($_REQUEST['limit'])?intval($_REQUEST['limit']):30; + $start = !empty($_REQUEST['start'])?intval($_REQUEST['start']):0; + $order = !empty($_REQUEST['order'])?$_REQUEST['order']:'DESC'; + $sort = !empty($_REQUEST['sort'])?$_REQUEST['sort']:'created'; + + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct']); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); + + foreach (array( 'mode','invoicenumber','drawfor','drawto','drawto_email','amount','grand','shipping', + 'handling','weight','weight_unit','tax','currency','items','transactionid','created', + 'updated','actioned','reoccurence','reoccurences','reoccurence_period_days','occurence', + 'previous','occurence_grand','occurence_amount','occurence_tax','occurence_shipping', + 'occurence_handling','occurence_weight','remittion','remittion_settled', + 'donation','comment','user_ip','user_netaddy','user_uid','remitted','due', + 'collect','wait','offline','remittion') as $id => $key) { + $GLOBALS['xoopsTpl']->assign(strtolower($key.'_th'), '<a href="'.$_SERVER['PHP_SELF'].'?start='.$start.'&limit='.$limit.'&sort='.$key.'&order='.(($key==$sort)?($order=='ASC'?'DESC':'ASC'):$order).'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct'].'">'.(defined('_XPY_AM_TH_'.strtoupper($key))?constant('_XPY_AM_TH_'.strtoupper($key)):'_XPY_AM_TH_'.strtoupper($key)).'</a>'); + } + + $criteria->setStart($start); + $criteria->setLimit($limit); + $criteria->setSort($sort); + $criteria->setOrder($order); + + $invoices = $invoice_handler->getObjects($criteria, true); + foreach($invoices as $iid => $invoice) { + $GLOBALS['xoopsTpl']->append('invoices', $invoice->toArray()); + } + + break; + case 'view': + $xoopsOption['template_main'] = 'xpayment_invoice_view.html'; + include_once $GLOBALS['xoops']->path( "/header.php" ); + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + + $invoice_handler =& xoops_getmodulehandler('invoice', 'xpayment'); + $invoice_items_handler =& xoops_getmodulehandler('invoice_items', 'xpayment'); + + $invoice =& $invoice_handler->get($_GET['iid']); + + $GLOBALS['xoopsTpl']->assign('invoice', $invoice->toArray()); + + if ($invoice->getVar('mode')=='UNPAID') + $GLOBALS['xoopsTpl']->assign('payment_markup', $invoice->getAdminPaymentHtml()); + + if ($invoice->getVar('mode')=='UNPAID'&&($invoice->getVar('remittion')=='COLLECT'||$invoice->getVar('remittion')=='SETTLED')) + $GLOBALS['xoopsTpl']->assign('settle_markup', $invoice->getAdminSettleHtml()); + + $criteria = new Criteria('iid', $invoice->getVar('iid')); + $items = $invoice_items_handler->getObjects($criteria, true); + foreach($items as $iiid => $item) + $GLOBALS['xoopsTpl']->append('items', $item->toArray()); + + + + break; + case 'cancel': + + include_once $GLOBALS['xoops']->path( "/header.php" ); + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + + if (!isset($_POST['confirm'])) { + xoops_confirm(array('confirm'=>true,'op'=>$_REQUEST['op'],'fct'=>$_REQUEST['fct'],'iid'=>$_REQUEST['iid']), $_SERVER['PHP_SELF'], _XPY_MSG_CONFIRM_CANCEL); + include($GLOBALS['xoops']->path('/footer.php')); + exit(0); + } + + $invoice_handler =& xoops_getmodulehandler('invoice', 'xpayment'); + $invoice = $invoice_handler->get($_REQUEST['iid']); + $invoice->setVar('mode', 'CANCEL'); + $invoice_handler->insert($invoice); + $invoice->runPlugin(); + redirect_header($_SERVER['PHP_SELF'].'?op=invoices&fct=list', 3, _XPY_MSG_INVOICE_CANCELED); + exit(0); + break; + case 'transaction': + + $invoice_handler =& xoops_getmodulehandler('invoice', 'xpayment'); + $invoice_transactions_handler =& xoops_getmodulehandler('invoice_transactions', 'xpayment'); + $invoice_transactions = $invoice_transactions_handler->create(); + $invoice = $invoice_handler->get($_REQUEST['iid']); + $invoice_transactions->setVar('transactionid', $_REQUEST['transactionid']); + $invoice_transactions->setVar('iid', $_REQUEST['iid']); + $invoice_transactions->setVar('invoice', $_REQUEST['iid']); + $invoice_transactions->setVar('date', time()); + $invoice_transactions->setVar('email', $GLOBALS['xoopsConfig']['adminmail']); + $invoice_transactions->setVar('gross', $_REQUEST['amount']); + $invoice_transactions->setVar('status', 'Manual'); + $invoice_transactions_handler->insert($invoice_transactions); + $gross = $invoice_transactions_handler->sumOfGross($_REQUEST['iid']); + if ($gross>=$invoice->getVar('grand')) + $invoice->setVar('mode', 'PAID'); + $invoice->setVar('transactionid', $_REQUEST['transactionid']); + $invoice_handler->insert($invoice); + redirect_header($_SERVER['PHP_SELF'].'?op=invoices&fct=list', 3, _XPY_MSG_INVOICE_PAID); + exit(0); + break; + case 'settle': + $invoice_handler =& xoops_getmodulehandler('invoice', 'xpayment'); + $invoice = $invoice_handler->get($_REQUEST['iid']); + $invoice->setVar('remittion','SETTLED'); + $invoice->setVar('remittion_settled',$_REQUEST['settlement']); + $invoice_handler->insert($invoice); + redirect_header($_SERVER['PHP_SELF'].'?op=invoices&fct=list', 3, _XPY_MSG_INVOICE_SETTLEMENT); + exit(0); + break; + + } + break; + case "transactions": + + switch ($_REQUEST['fct']) + { + default: + case "list": + $xoopsOption['template_main'] = 'xpayment_transactions_list.html'; + include_once $GLOBALS['xoops']->path( "/header.php" ); + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + + $invoice_transactions_handler =& xoops_getmodulehandler('invoice_transactions', 'xpayment'); + + $ttl = $invoice_transactions_handler->getCount(NULL); + $limit = !empty($_REQUEST['limit'])?intval($_REQUEST['limit']):30; + $start = !empty($_REQUEST['start'])?intval($_REQUEST['start']):0; + $order = !empty($_REQUEST['order'])?$_REQUEST['order']:'DESC'; + $sort = !empty($_REQUEST['sort'])?$_REQUEST['sort']:'date'; + + if ($_GET['iid']==0) { + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct']); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); + + $criteria = new Criteria('1','1'); + $criteria->setStart($start); + $criteria->setLimit($limit); + $criteria->setSort($sort); + $criteria->setOrder($order); + } else { + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&iid='.$_REQUEST['iid'].'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct']); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); + + $criteria = new Criteria('iid',$_REQUEST['iid']); + $criteria->setStart($start); + $criteria->setLimit($limit); + $criteria->setSort($sort); + $criteria->setOrder($order); + + $invoice_handler =& xoops_getmodulehandler('invoice', 'xpayment'); + $invoice =& $invoice_handler->get($_GET['iid']); + $GLOBALS['xoopsTpl']->assign('invoice', $invoice->toArray()); + + } + + $transactions = $invoice_transactions_handler->getObjects($criteria, true); + + foreach($transactions as $tiid => $transaction) { + $GLOBALS['xoopsTpl']->append('transactions', $transaction->toArray()); + } + + if ($_GET['iid']==0) { + foreach (array( 'transactionid','email','invoice','status','date','gross','fee','settle', + 'exchangerate','firstname','lastname','street','city','state','postcode','country', + 'address_status','payer_email','payer_status','gateway', 'plugin') as $id => $key) { + $GLOBALS['xoopsTpl']->assign($key.'_th', '<a href="'.$_SERVER['PHP_SELF'].'?'.'start='.$start.'&limit='.$limit.'&sort='.$key.'&order='.(($key==$sort)?($order=='ASC'?'DESC':'ASC'):$order).'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct'].'">'.(defined('_XPY_AM_TH_'.strtoupper($key))?constant('_XPY_AM_TH_'.strtoupper($key)):'_XPY_AM_TH_'.strtoupper($key)).'</a>'); + } + } else { + foreach (array( 'transactionid','email','invoice','status','date','gross','fee','settle', + 'exchangerate','firstname','lastname','street','city','state','postcode','country', + 'address_status','payer_email','payer_status','gateway', 'plugin') as $id => $key) { + $GLOBALS['xoopsTpl']->assign($key.'_th', '<a href="'.$_SERVER['PHP_SELF'].'?'.'start='.$start.'&limit='.$limit.'&sort='.$key.'&order='.(($key==$sort)?($order=='ASC'?'DESC':'ASC'):$order).'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct'].'&iid='.$_REQUEST['iid'].'">'.(defined('_XPY_AM_TH_'.strtoupper($key))?constant('_XPY_AM_TH_'.strtoupper($key)):'_XPY_AM_TH_'.strtoupper($key)).'</a>'); + } + } + + break; + case 'view': + $xoopsOption['template_main'] = 'xpayment_transactions_view.html'; + include_once $GLOBALS['xoops']->path( "/header.php" ); + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + + $invoice_transactions_handler =& xoops_getmodulehandler('invoice_transactions', 'xpayment'); + $transaction =& $invoice_transactions_handler->get($_GET['tiid']); + $GLOBALS['xoopsTpl']->assign('transaction', $transaction->toArray()); + break; + } + break; + + } + + include($GLOBALS['xoops']->path('/footer.php')); +?> \ No newline at end of file Added: XoopsModules/xpayment/branches/timgno/xpayment/admin/about.php =================================================================== --- XoopsModules/xpayment/branches/timgno/xpayment/admin/about.php (rev 0) +++ XoopsModules/xpayment/branches/timgno/xpayment/admin/about.php 2013-03-23 12:44:31 UTC (rev 11292) @@ -0,0 +1,60 @@ +<?php +/** + * Invoice Transaction Gateway with Modular Plugin set + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Co-Op http://www.chronolabs.com.au/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package xpayment + * @since 2.5.5 + * @author Simon Roberts <si...@ch...> + * @translation Erol Konik <ap...@ap...> + * @translation Mariane <mar...@ho...> + * @translation Voltan <vo...@xo...> + * @translation Ezsky <ezs...@gm...> + * @translation Richardo Costa <lus...@gm...> + * @translation Kris_fr <kr...@fr...> + * @version $Id: permissions.php 11084 2013-02-23 15:44:20Z timgno $ + */ +include('header.php'); +$paypalitemno='XPAYMENTABOUT100'; +$aboutAdmin = new ModuleAdmin(); +$about = $aboutAdmin->renderabout($paypalitemno, false); +$donationform = array( 0 => '<form name="donation" id="donation" action="http://www.chronolabs.com.au/modules/xpayment/" method="post" onsubmit="return xoopsFormValidate_donation();">', +1 => '<table class="outer" cellspacing="1" width="100%"><tbody><tr><th colspan="2">'.constant('_XPY_AM_XPAYMENT_ABOUT_MAKEDONATE').'</th></tr><tr align="left" valign="top"><td class="head"><div class="xoops-form-element-caption-required"><span class="caption-text">Donation Amount</span><span class="caption-marker">*</span></div></td><td class="even"><select size="1" name="item[A][amount]" id="item[A][amount]" title="Donation Amount"><option value="5">5.00 AUD</option><option value="10">10.00 AUD</option><option value="20">20.00 AUD</option><option value="40">40.00 AUD</option><option value="60">60.00 AUD</option><option value="80">80.00 AUD</option><option value="90">90.00 AUD</option><option value="100">100.00 AUD</option><option value="200">200.00 AUD</option></select></td></tr><tr align="left" valign="top"><td class="head"></td><td class="even"><input class="formButton" name="submit" id="submit" value="'._SUBMIT.'" title="'._SUBMIT.'" type="submit"></td></tr></tbody></table>', +2 => '<input name="op" id="op" value="createinvoice" type="hidden"><input name="plugin" id="plugin" value="donations" type="hidden"><input name="donation" id="donation" value="1" type="hidden"><input name="drawfor" id="drawfor" value="Chronolabs Co-Operative" type="hidden"><input name="drawto" id="drawto" value="%s" type="hidden"><input name="drawto_email" id="drawto_email" value="%s" type="hidden"><input name="key" id="key" value="%s" type="hidden"><input name="currency" id="currency" value="AUD" type="hidden"><input name="weight_unit" id="weight_unit" value="kgs" type="hidden"><input name="item[A][cat]" id="item[A][cat]" value="XDN%s" type="hidden"><input name="item[A][name]" id="item[A][name]" value="Donation for %s" type="hidden"><input name="item[A][quantity]" id="item[A][quantity]" value="1" type="hidden"><input name="item[A][shipping]" id="item[A][shipping]" value="0" type="hidden"><input name="item[A][handling]" id="item[A][handling]" value="0" type="hidden"><input name="item[A][weight]" id="item[A][weight]" value="0" type="hidden"><input name="item[A][tax]" id="item[A][tax]" value="0" type="hidden"><input name="return" id="return" value="http://www.chronolabs.com.au/modules/donations/success.php" type="hidden"><input name="cancel" id="cancel" value="http://www.chronolabs.com.au/modules/donations/success.php" type="hidden"></form>', 'D'=>'', + 3 => '', + 4 => '<!-- Start Form Validation JavaScript //--> +<script type="text/javascript"> +<!--// +function xoopsFormValidate_donation() { var myform = window.document.donation; +var hasSelected = false; var selectBox = myform.item[A][amount];for (i = 0; i < selectBox.options.length; i++ ) { if (selectBox.options[i].selected == true && selectBox.options[i].value != \'\') { hasSelected = true; break; } }if (!hasSelected) { window.alert("Please enter Donation Amount"); selectBox.focus(); return false; }return true; +} +//--></script> +<!-- End Form Validation JavaScript //-->'); +$paypalform = array( 0 => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">', + 1 => '<input name="cmd" value="_s-xclick" type="hidden">', + 2 => '<input name="hosted_button_id" value="%s" type="hidden">', + 3 => '<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" height="1" border="0" width="1">', + 4 => '<input src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" border="0" type="image">', + 5 => '</form>'); +for($key=0;$key<=4;$key++) { + switch ($key) { + case 2: + $donationform[$key] = sprintf($donationform[$key], $GLOBALS['xoopsConfig']['sitename'] . ' - ' . (strlen($GLOBALS['xoopsUser']->getVar('name'))>0?$GLOBALS['xoopsUser']->getVar('name'). ' ['.$GLOBALS['xoopsUser']->getVar('uname').']':$GLOBALS['xoopsUser']->getVar('uname')), $GLOBALS['xoopsUser']->getVar('email'), XOOPS_LICENSE_KEY, strtoupper($GLOBALS['xpaymentModule']->getVar('dirname')), strtoupper($GLOBALS['xpaymentModule']->getVar('dirname')). ' '.$GLOBALS['xpaymentModule']->getVar('name')); + break; + } +} + +$istart = strpos($about, ($paypalform[0]), 1); +$iend = strpos($about, ($paypalform[5]), $istart+1)+strlen($paypalform[5])-1; +echo (substr($about, 0, $istart-1)); +echo implode("\n", $donationform); +echo (substr($about, $iend+1, strlen($about)-$iend-1)); +xoops_cp_footer(); \ No newline at end of file Added: XoopsModules/xpayment/branches/timgno/xpayment/admin/discounts.php =================================================================== --- XoopsModules/xpayment/branches/timgno/xpayment/admin/discounts.php (rev 0) +++ XoopsModules/xpayment/branches/timgno/xpayment/admin/discounts.php 2013-03-23 12:44:31 UTC (rev 11292) @@ -0,0 +1,117 @@ +<?php +/** + * Invoice Transaction Gateway with Modular Plugin set + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Co-Op http://www.chronolabs.com.au/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package xpayment + * @since 2.5.5 + * @author Simon Roberts <si...@ch...> + * @translation Erol Konik <ap...@ap...> + * @translation Mariane <mar...@ho...> + * @translation Voltan <vo...@xo...> + * @translation Ezsky <ezs...@gm...> + * @translation Richardo Costa <lus...@gm...> + * @translation Kris_fr <kr...@fr...> + * @version $Id: permissions.php 11084 2013-02-23 15:44:20Z timgno $ + */ +include('header.php'); + +$GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + +xoops_loadLanguage('admin', 'xpayment'); +echo $adminMenu->addNavigation('discounts.php'); +switch($_REQUEST['op']) +{ + default: + case "list": + $discount_handler =& xoops_getmodulehandler('discounts', 'xpayment'); + + $limit = !empty($_REQUEST['limit'])?intval($_REQUEST['limit']):30; + $start = !empty($_REQUEST['start'])?intval($_REQUEST['start']):0; + $order = !empty($_REQUEST['order'])?$_REQUEST['order']:'DESC'; + $sort = !empty($_REQUEST['sort'])?$_REQUEST['sort']:'created'; + $filter = !empty($_REQUEST['filter'])?$_REQUEST['filter']:'1,1'; + + $criteria = $discount_handler->getFilterCriteria($filter); + $ttl = $discount_handler->getCount($criteria); + + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&filter='.$filter.'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct']); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); + + foreach (array( 'did','uid','code','email','validtill','redeems','discount','redeemed', + 'iids','`created`','updated') as $id => $key) { + $GLOBALS['xoopsTpl']->assign(strtolower($key.'_th'), '<a href="'.$_SERVER['PHP_SELF'].'?start='.$start.'&limit='.$limit.'&sort='.$key.'&order='.(($key==$sort)?($order=='ASC'?'DESC':'ASC'):$order).'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct'].'">'.(defined('_XPY_AM_TH_'.strtoupper($key))?constant('_XPY_AM_TH_'.strtoupper($key)):'_XPY_AM_TH_'.strtoupper($key)).'</a>'); + $GLOBALS['xoopsTpl']->assign('filter_'.strtolower(str_replace('-','_',$key)).'_th', $discount_handler->getFilterForm($filter, $key, $sort, $fct)); + } + + $criteria->setStart($start); + $criteria->setLimit($limit); + $criteria->setSort('`'.$sort.'`'); + $criteria->setOrder($order); + + $GLOBALS['xoopsTpl']->assign('start', $start); + $GLOBALS['xoopsTpl']->assign('limit', $limit); + $GLOBALS['xoopsTpl']->assign('sort', $sort); + $GLOBALS['xoopsTpl']->assign('order', $order); + $GLOBALS['xoopsTpl']->assign('filter', $filter); + + $GLOBALS['xoopsTpl']->assign('form', xpayment_admincreatediscounts()); + + $discounts = $discount_handler->getObjects($criteria, true); + foreach($discounts as $iid => $discount) { + $GLOBALS['xoopsTpl']->append('discounts', $discount->toArray()); + } + + $GLOBALS['xoopsTpl']->display('db:xpayment_cpanel_discounts_list.html'); + break; + case "create": + extract($_POST); + if (intval($redeems)==0) { + redirect_header($_SERVER['PHP_SELF'].'?op=discounts&fct=list&sort='.$sort.'&order='.$order.'&start='.$start.'&limit='.$limit.'&filter='.$filter, 3, _XPY_MSG_DISCOUNT_NOREDEEMS_SPECIFIED); + exit(0); + } + if (intval($discount)==0) { + redirect_header($_SERVER['PHP_SELF'].'?op=discounts&fct=list&sort='.$sort.'&order='.$order.'&start='.$start.'&limit='.$limit.'&filter='.$filter, 3, _XPY_MSG_DISCOUNT_NODISCOUNT_SPECIFIED); + exit(0); + } + $created=0; + $reminders=0; + $prefix = str_replace(' ', '', $prefix); + $discount_handler =& xoops_getmodulehandler('discounts', 'xpayment'); + foreach(explode("|", $emails) as $email) { + if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { + if (!$dis = $discount_handler->getByEmail($email)) { + if ($discount_handler->sendDiscountCode($email, ($validtill_infinte==true?0:strtotime($validtill['date'])+$validtill['time']), intval($redeems), (float)$discount, $prefix, 0)) + $created++; + } else { + if ($dis->sendReminderEmail()) + $reminders++; + } + } + } + if ($scan==true) { + foreach($groups as $group) { + foreach($discount_handler->getUsersByGroup($group, ($logon==true?strtotime($logon_datetime['date'])+$logon_datetime['time']:0), ($since==true?strtotime($since_datetime['date'])+$since_datetime['time']:0), true) as $user) { + if (!$dis = $discount_handler->getByEmail($user->getVar('email'))) { + if ($discount_handler->sendDiscountCode($user->getVar('email'), ($validtill_infinte==true?0:strtotime($validtill['date'])+$validtill['time']), intval($redeems), (float)$discount, $prefix, $user->getVar('uid'))) + $created++; + } else { + if ($dis->sendReminderEmail()) + $reminders++; + } + } + } + } + redirect_header($_SERVER['PHP_SELF'].'?op=discounts&fct=list&sort='.$sort.'&order='.$order.'&start='.$start.'&limit='.$limit.'&filter='.$filter, 3, sprintf(_XPY_MSG_DISCOUNT_CREATED_REMINDED, $created, $reminders)); + exit(0); + break; +} +xoops_cp_footer(); \ No newline at end of file Added: XoopsModules/xpayment/branches/timgno/xpayment/admin/gateways.php =================================================================== --- XoopsModules/xpayment/branches/timgno/xpayment/admin/gateways.php (rev 0) +++ XoopsModules/xpayment/branches/timgno/xpayment/admin/gateways.php 2013-03-23 12:44:31 UTC (rev 11292) @@ -0,0 +1,141 @@ +<?php +/** + * Invoice Transaction Gateway with Modular Plugin set + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Co-Op http://www.chronolabs.com.au/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package xpayment + * @since 2.5.5 + * @author Simon Roberts <si...@ch...> + * @translation Erol Konik <ap...@ap...> + * @translation Mariane <mar...@ho...> + * @translation Voltan <vo...@xo...> + * @translation Ezsky <ezs...@gm...> + * @translation Richardo Costa <lus...@gm...> + * @translation Kris_fr <kr...@fr...> + * @version $Id: permissions.php 11084 2013-02-23 15:44:20Z timgno $ + */ +include('header.php'); + +$GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + +xoops_loadLanguage('admin', 'xpayment'); +echo $adminMenu->addNavigation('gateways.php'); +switch($_REQUEST['op']) +{ + case "list": + default: + $gateways_handler =& xoops_getmodulehandler('gateways', 'xpayment'); + $gateway = $gateways_handler->get($_REQUEST['gid']); + if (is_object($gateway)) + include_once($GLOBALS['xoops']->path('/modules/xpayment/class/gateway/'.$gateway->getVar('class').'/language/'.$GLOBALS['xoopsConfig']['language'].'/'.$gateway->getVar('class').'.php')); + + $ttl = $gateways_handler->getCount(NULL); + $limit = !empty($_REQUEST['limit'])?intval($_REQUEST['limit']):30; + $start = !empty($_REQUEST['start'])?intval($_REQUEST['start']):0; + $order = !empty($_REQUEST['order'])?$_REQUEST['order']:'DESC'; + $sort = !empty($_REQUEST['sort'])?$_REQUEST['sort']:'name'; + + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct']); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); + + foreach (array( 'name','description','author','testmode') as $id => $key) { + $GLOBALS['xoopsTpl']->assign(strtolower($key.'_th'), '<a href="'.$_SERVER['PHP_SELF'].'?start='.$start.'&limit='.$limit.'&sort='.$key.'&order='.(($key==$sort)?($order=='ASC'?'DESC':'ASC'):$order).'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct'].'">'.(defined('_XPY_AM_TH_'.strtoupper($key))?constant('_XPY_AM_TH_'.strtoupper($key)):'_XPY_AM_TH_'.strtoupper($key)).'</a>'); + } + + $criteria = new Criteria('1','1'); + $criteria->setStart($start); + $criteria->setLimit($limit); + $criteria->setSort('`'.$sort.'`'); + $criteria->setOrder($order); + + $gateways = $gateways_handler->getObjects($criteria, true); + foreach($gateways as $gid => $gateway) { + + xoops_loadLanguage($gateway->getVar('class'), 'xpayment'); + + $ret = $gateway->toArray(); + $ret['name'] = (defined($ret['name'])?constant($ret['name']):$ret['name']); + $ret['description'] = (defined($ret['description'])?constant($ret['description']):$ret['description']); + $ret['author'] = (defined($ret['author'])?constant($ret['author']):$ret['author']); + $GLOBALS['xoopsTpl']->append('gateways', $ret); + $installed[$gateway->getVar('class')] = $gateway->getVar('class'); + } + + xoops_load('XoopsLists'); + $gateways = XoopsLists::getDirListAsArray($GLOBALS['xoops']->path('/modules/xpayment/class/gateway/')); + + foreach($gateways as $class) { + if (!in_array($class, $installed)) { + include($GLOBALS['xoops']->path('/modules/xpayment/class/gateway/'.$class.'/gateway_info.php')); + if (!empty($gateway)) { + $ret = $gateway; + $ret['name'] = (defined($ret['name'])?constant($ret['name']):$ret['name']); + $ret['description'] = (defined($ret['description'])?constant($ret['description']):$ret['description']); + $ret['author'] = (defined($ret['author'])?constant($ret['author']):$ret['author']); + $GLOBALS['xoopsTpl']->append('uninstalled', $ret); + } + } + } + $GLOBALS['xoopsTpl']->display('db:xpayment_cpanel_gateways_list.html'); + break; + + case "options": + $gateways_options_handler =& xoops_getmodulehandler('gateways_options', 'xpayment'); + $gateways_handler =& xoops_getmodulehandler('gateways', 'xpayment'); + $gateway = $gateways_handler->get($_GET['gid']); + + xoops_loadLanguage($gateway->getVar('class'), 'xpayment'); + + $criteria = new Criteria('gid',$_GET['gid']); + + $options = $gateways_options_handler->getObjects($criteria, true); + foreach($options as $goid => $option) { + $ret=$option->toArray(); + $ret['name'] = (defined($ret['name'])?constant($ret['name']):$ret['name']); + $GLOBALS['xoopsTpl']->append('options', $ret); + } + loadModuleAdminMenu(3); + $GLOBALS['xoopsTpl']->display('db:xpayment_cpanel_gateways_options.html'); + break; + + case 'settestmode': + $gateways_handler =& xoops_getmodulehandler('gateways', 'xpayment'); + $gateways = $gateways_handler->getObjects(NULL, true); + + foreach($gateways as $gid => $gateway) { + $gateway->setVar('testmode', ($_POST['testmode'][$gid]==true?true:false)); + $gateways_handler->insert($gateway); + } + redirect_header($_SERVER['PHP_SELF'].'?op=gateways&fct=list', 3, _XPY_MSG_TESTMODES_SAVED); + exit(0); + break; + case 'setoptions': + $gateways_options_handler =& xoops_getmodulehandler('gateways_options', 'xpayment'); + foreach($_POST['value'] as $goid => $value) { + $option =$gateways_options_handler->get($goid); + $option->setVar('value', $value); + $gateways_options_handler->insert($option); + } + redirect_header($_SERVER['PHP_SELF'].'?op=gateways&fct=list', 3, _XPY_MSG_OPTIONS_SAVED); + exit(0); + break; + case 'update': + xpayment_update_gateway($_GET['class']); + redirect_header($_SERVER['PHP_SELF'].'?op=gateways&fct=list', 3, _XPY_MSG_GATEWAY_UPDATED); + exit(0); + break; + case 'install': + xpayment_install_gateway($_GET['class']); + redirect_header($_SERVER['PHP_SELF'].'?op=gateways&fct=list', 3, _XPY_MSG_GATEWAY_INSTALL); + exit(0); + break; +} +xoops_cp_footer(); \ No newline at end of file Added: XoopsModules/xpayment/branches/timgno/xpayment/admin/groups.php =================================================================== --- XoopsModules/xpayment/branches/timgno/xpayment/admin/groups.php (rev 0) +++ XoopsModules/xpayment/branches/timgno/xpayment/admin/groups.php 2013-03-23 12:44:31 UTC (rev 11292) @@ -0,0 +1,166 @@ +<?php +/** + * Invoice Transaction Gateway with Modular Plugin set + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Co-Op http://www.chronolabs.com.au/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package xpayment + * @since 2.5.5 + * @author Simon Roberts <si...@ch...> + * @translation Erol Konik <ap...@ap...> + * @translation Mariane <mar...@ho...> + * @translation Voltan <vo...@xo...> + * @translation Ezsky <ezs...@gm...> + * @translation Richardo Costa <lus...@gm...> + * @translation Kris_fr <kr...@fr...> + * @version $Id: permissions.php 11084 2013-02-23 15:44:20Z timgno $ + */ +include('header.php'); + +$GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); + +xoops_loadLanguage('admin', 'xpayment'); +echo $adminMenu->addNavigation('groups.php'); +switch($_REQUEST['op']) +{ + case "brokers": + case "accounts": + case "officers": + $groups_handler =& xoops_getmodulehandler('groups', 'xpayment'); + + switch ($_REQUEST['fct']) + { + case "brokers": + $criteria = new Criteria('mode', 'BROKERS'); + break; + case "accounts": + $criteria = new Criteria('mode', 'ACCOUNTS'); + break; + case "officers": + $criteria = new Criteria('mode', 'OFFICERS'); + break; + } + $ttl = $groups_handler->getCount($criteria); + $limit = !empty($_REQUEST['limit'])?intval($_REQUEST['limit']):30; + $start = !empty($_REQUEST['start'])?intval($_REQUEST['start']):0; + $order = !empty($_REQUEST['order'])?$_REQUEST['order']:'DESC'; + $sort = !empty($_REQUEST['sort'])?$_REQUEST['sort']:'plugin'; + + $pagenav = new XoopsPageNav($ttl, $limit, $start, 'start', 'limit='.$limit.'&sort='.$sort.'&order='.$order.'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct']); + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); + + foreach (array( 'rid','mode','plugin','uid','limit','maximum','minimum') as $id => $key) { + $GLOBALS['xoopsTpl']->assign(strtolower($key.'_th'), '<a href="'.$_SERVER['PHP_SELF'].'?start='.$start.'&limit='.$limit.'&sort='.$key.'&order='.(($key==$sort)?($order=='ASC'?'DESC':'ASC'):$order).'&op='.$_REQUEST['op'].'&fct='.$_REQUEST['fct'].'">'.(defined('_XPY_AM_TH_'.strtoupper($key))?constant('_XPY_AM_TH_'.strtoupper($key)):'_XPY_AM_TH_'.strtoupper($key)).'</a>'); + } + + $criteria->setStart($start); + $criteria->setLimit($limit); + $criteria->setSort('`'.$sort.'`'); + $criteria->setOrder($order); + + $groups = $groups_handler->getObjects($criteria, true); + foreach($groups as $rid => $group) { + $GLOBALS['xoopsTpl']->append('groups', $group->toArray()); + } + + $module_handler =& xoops_gethandler('module'); + $config_handler =& xoops_gethandler('config'); + $xoMod = $module_handler->getByDirname('xpayment'); + $xoConfig = $config_handler->getConfigList($xoMod->getVar('mid')); + + $GLOBALS['xoopsTpl']->assign('form', xpayment_adminrule(0, $xoConfig[$_REQUEST['fct']])); + + $opform = new XoopsSimpleForm(_XPY_AM_GROUP_FCT, 'actionform', 'index.php', "get"); + $op_select = new XoopsFormSelect("", 'fct', $_REQUEST['fct']); + $op_select->setExtra('onchange="document.forms.actionform.submit()"'); + $op_select->addOptionArray(array( + "brokers"=>_XPY_AM_GROUP_BROKERS, + "accounts"=>_XPY_AM_GROUP_ACCOUNTS, + "officers"=>_XPY_AM_GROUP_OFFICERS + )); + $opform->addElement($op_select); + $opform->addElement(new XoopsFormHidden('op', 'groups')); + $GLOBALS['xoopsTpl']->assign('selectform', $opform->render()); + + $GLOBALS['xoopsTpl']->display('db:xpayment_cpanel_groups.html'); + break; + case 'save': + $groups_handler =& xoops_getmodulehandler('groups', 'xpayment'); + if ($_REQUEST['rid']==0) + $group = $groups_handler->create(); + else + $group = $groups_handler->get($_REQUEST['rid']); + + $group->setVars($_POST); + + switch ($_REQUEST['action']) + { + case "brokers": + $group->setVar('mode', 'BROKERS'); + $fct = $_REQUEST['action']; + break; + case "accounts": + $group->setVar('mode', 'ACCOUNTS'); + $fct = $_REQUEST['action']; + break; + case "officers": + $group->setVar('mode', 'OFFICERS'); + $fct = $_REQUEST['action']; + break; + default: + $fct = 'brokers'; + break; + } + + $groups_handler->insert($group, true); + redirect_header($_SERVER['PHP_SELF'].'?op=groups&fct='.$fct, 3, _XPY_MSG_RULE_SAVED); + break; + + case 'edit': + $groups_handler =& xoops_getmodulehandler('groups', 'xpayment'); + if ($_REQUEST['rid']==0) + $group = $groups_handler->create(); + else + $group = $groups_handler->get($_REQUEST['rid']); + + $module_handler =& xoops_gethandler('module'); + $config_handler =& xoops_gethandler('config'); + $xoMod = $module_handler->getByDirname('xpayment'); + $xoConfig = $config_handler->getConfigList($xoMod->getVar('mid')); + + switch($group->getVar('mode')){ + case "BROKERS": + $groupid = $xoConfig['brokers']; + break; + case "ACCOUNTS": + $groupid = $xoConfig['accounts']; + break; + case "OFFICERS": + $groupid = $xoConfig['officers']; + break; + } + $GLOBALS['xoopsTpl']->assign('form', xpayment_adminrule($_REQUEST['rid'], $groupid)); + $GLOBALS['xoopsTpl']->display('db:xpayment_cpanel_groups_edit.html'); + break; + + case 'delete': + if (!isset($_POST['confirm'])) { + xoops_confirm(array('confirm'=>true,'op'=>$_REQUEST['op'],'fct'=>$_REQUEST['fct'],'rid'=>$_REQUEST['rid']), $_SERVER['PHP_SELF'], _XPY_MSG_CONFIRM_DELETE); + xoops_cp_footer(); + exit(0); + } + $groups_handler =& xoops_getmodulehandler('groups', 'xpayment'); + $group = $groups_handler->get($_REQUEST['rid']); + $groups_handler->delete($group); + redirect_header($_SERVER['PHP_SELF'].'?op=groups&fct=brokers', 3, _XPY_MSG_RULE_DELETED); + exit(0); + break; +} +xoops_cp_footer(); \ No newline at end of file Added: XoopsModules/xpayment/branches/timgno/xpayment/admin/header.php =================================================================== --- XoopsModules/xpayment/branches/timgno/xpayment/admin/header.php (rev 0) +++ XoopsModules/xpayment/branches/timgno/xpayment/admin/header.php 2013-03-23 12:44:31 UTC (rev 11292) @@ -0,0 +1,96 @@ +<?php +/** + * Invoice Transaction Gateway with Modular Plugin set + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright Chronolabs Co-Op http://www.chronolabs.coop/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package xpayment + * @since 2.5.5 + * @author Simon Roberts <si...@ch...> + * @translation Erol Konik <ap...@ap...> + * @translation Mariane <mar...@ho...> + * @translation Voltan <vo...@xo...> + * @translation Ezsky <ezs...@gm...> + * @translation Richardo Costa <lus...@gm...> + * @translation Kris_fr <kr...@fr...> + * @version $Id: permissions.php 11084 2013-02-23 15:44:20Z timgno $ + */ +include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; +include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; + +if (!defined('_CHARSET')) + define ("_CHARSET","UTF-8"); +if (!defined('_CHARSET_ISO')) + define ("_CHARSET_ISO","ISO-8859-1"); + +$GLOBALS['myts'] = MyTextSanitizer::getInstance(); + +$module_handler = xoops_gethandler('module'); +$config_handler = xoops_gethandler('config'); +$GLOBALS['xpaymentModule'] = $module_handler->getByDirname(... [truncated message content] |