Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
8a0f1789
authored
2011-03-11 01:17:09 +0000
by
Kevin Burton
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
partial update - unfinished
1 parent
f653cfac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
183 additions
and
5 deletions
com/UserManager/UserManager.js
com/UserManager/UserManager.php
com/UserManager/views/partials/edit_invoice.php
com/UserManager/UserManager.js
View file @
8a0f178
...
...
@@ -161,6 +161,64 @@ jQuery(function($) {
};
jQuery
(
'#edit-event-form'
).
ajaxForm
(
options
);
}});
jQuery
(
'.invoice-refund-btn'
).
live
(
'click'
,
function
(
e
)
{
var
iid
=
$
(
this
).
attr
(
'rel'
);
jConfirm
(
'<strong>Are you sure</strong> you want to <em>refund</em> this invoice?'
,
'Refund Invoice'
,
function
(
c
)
{
if
(
c
)
{
jQuery
.
ajax
({
url
:
'/wp-admin/admin-ajax.php'
,
data
:
({
ajax
:
"yes"
,
action
:
'admin_refund_invoice'
,
invoice_id
:
iid
})
,
dataType
:
'json'
,
type
:
'POST'
,
success
:
function
(
data
)
{
document
.
location
.
reload
();
}
});
}
});
e
.
preventDefault
();
return
false
;
});
jQuery
(
'.invoice-cancel-btn'
).
live
(
'click'
,
function
(
e
)
{
var
iid
=
$
(
this
).
attr
(
'rel'
);
jConfirm
(
'<strong>Are you sure</strong> you want to <em>cancel</em> the invoice?'
,
'Cancel Invoice'
,
function
(
c
)
{
if
(
c
)
{
jQuery
.
ajax
({
url
:
'/wp-admin/admin-ajax.php'
,
data
:
({
ajax
:
"yes"
,
action
:
'admin_cancel_invoice'
,
invoice_id
:
iid
})
,
dataType
:
'json'
,
type
:
'POST'
,
success
:
function
(
data
)
{
document
.
location
.
reload
();
}
});
}
});
e
.
preventDefault
();
return
false
;
});
jQuery
(
'.admin-mark-invoice-paid'
).
colorbox
({
onComplete
:
function
()
{
var
cb
=
this
;
var
options
=
{
success
:
function
(
data
)
{
if
(
data
.
refresh
==
"true"
)
{
document
.
location
.
href
=
document
.
location
.
href
;
}
else
{
jQuery
.
colorbox
.
close
();
}
}
,
data
:
({
ajax
:
"yes"
,
action
:
'admin_update_invoice'
})
,
dataType
:
'json'
,
url
:
'/wp-admin/admin-ajax.php'
};
jQuery
(
'#edit-invoice-form'
).
ajaxForm
(
options
);
}});
jQuery
(
'.course-edit'
).
colorbox
({
onComplete
:
function
()
{
var
cb
=
this
;
...
...
@@ -261,7 +319,8 @@ jQuery(function($) {
,
data
:
({
ajax
:
"yes"
,
action
:
'cancel_registration'
,
uid
:
user_id
,
eid
:
link
.
attr
(
'rel'
)})
,
type
:
'post'
,
success
:
function
(
data
)
{
document
.
location
.
href
=
document
.
location
.
href
;
/*
if (data.ask_credit=="true") {
// ask if they want to credit....
jPrompt('How much (if any) would you like to credit their account?', '0.00', 'Registration has been cancelled', function(r) {
...
...
@@ -278,6 +337,7 @@ jQuery(function($) {
} else {
document.location.href = document.location.href;
}
*/
}
,
dataType
:
'json'
...
...
com/UserManager/UserManager.php
View file @
8a0f178
...
...
@@ -705,8 +705,8 @@ class Actions {
public
static
function
wp_ajax_create_invoice_note
(
$uid
=
0
)
{
global
$wpdb
;
if
(
$uid
=
0
)
{
$uid
=
$_POST
[
'uid'
];
if
(
$uid
=
=
0
)
{
$uid
=
$_POST
[
'uid'
];
}
$amount
=
$_POST
[
'amount'
];
$invoice_type
=
$_POST
[
'invoice_type'
];
...
...
@@ -717,7 +717,7 @@ class Actions {
$amount
=
"-"
.
$amount
;
}
$paid
=
isset
(
$_POST
[
'paid'
]
)
?
true
:
false
;
$paid
=
(
isset
(
$_POST
[
'paid'
])
&&
$_POST
[
'paid'
]
==
"on"
)
?
true
:
false
;
if
(
$invoice_type
==
"invoice"
)
{
if
(
!
$paid
)
{
$paid_by
=
""
;
...
...
@@ -768,7 +768,7 @@ class Actions {
if
(
$invoice_type
==
"credit"
)
{
$status
=
"credit"
;
}
else
{
$paid
=
isset
(
$_POST
[
'paid'
]
)
?
true
:
false
;
$paid
=
(
isset
(
$_POST
[
'paid'
])
&&
$_POST
[
'paid'
]
==
"on"
)
?
true
:
false
;
if
(
$paid
)
{
$status
=
"paid"
;
}
else
{
...
...
@@ -1097,6 +1097,36 @@ class Actions {
}
public
static
function
wp_ajax_admin_cancel_invoice
()
{
$invoice_id
=
$_POST
[
'invoice_id'
];
update_post_meta
(
$invoice_id
,
'trans_status'
,
'cancelled'
);
$return
=
array
(
'success'
=>
'true'
);
die
(
json_encode
(
$return
));
}
public
static
function
wp_ajax_admin_refund_invoice
()
{
$invoice_id
=
$_POST
[
'invoice_id'
];
$invoice
=
get_post
(
$invoice_id
);
$payment
=
get_post_meta
(
$invoice_id
,
'payment'
,
true
);
$trans_amount
=
get_post_meta
(
$invoice_id
,
'trans_amount'
,
true
);
$invoice_for
=
get_post_meta
(
$invoice_id
,
'invoice_for'
,
true
);
$items
=
get_post_meta
(
$invoice_id
,
'items'
,
true
);
update_post_meta
(
$invoice
->
ID
,
'refunded'
,
date
(
'Y-m-d H:i:s'
));
$invoice_data
[
'items'
]
=
$items
;
$invoice_data
[
'payment'
]
=
$payment
;
$new_invoice_id
=
Invoice\create
(
$invoice_data
,
$invoice_for
,
$invoice
->
post_title
,
$invoice
->
post_author
,
'credit'
,
'publish'
,
$trans_amount
);
}
public
static
function
wp_ajax_build_cehour_form
()
{
$user
=
new
User\Account
(
$_GET
[
'uid'
]);
$uid
=
$user
->
ID
;
...
...
@@ -1217,6 +1247,23 @@ class Actions {
}
public
static
function
wp_ajax_build_invoice_mark_paid_form
()
{
$user
=
new
User\Account
(
$_GET
[
'uid'
]);
ob_start
();
$invoice
=
get_post
(
$_GET
[
'invoice_id'
]);
$payment
=
get_post_meta
(
$_GET
[
'invoice_id'
],
'payment'
,
true
);
$trans_status
=
get_post_meta
(
$_GET
[
'invoice_id'
],
'trans_status'
,
true
);
$how_paid
=
strtolower
(
$payment
[
'bt_card_type'
]);
require_once
(
__DIR__
.
DIRECTORY_SEPARATOR
.
'views'
.
DIRECTORY_SEPARATOR
.
'partials'
.
DIRECTORY_SEPARATOR
.
'edit_invoice.php'
);
$content
=
ob_get_contents
();
ob_end_clean
();
die
(
$content
);
}
public
static
function
wp_ajax_admin_search_merge_users
()
{
global
$wpdb
;
...
...
com/UserManager/views/partials/edit_invoice.php
0 → 100644
View file @
8a0f178
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xml:lang=
"en"
lang=
"en"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<title>
Edit Event
</title>
<style
type=
"text/css"
>
html
,
body
{
margin
:
0px
;
padding
:
0
;}
.title-link
{
color
:
#f7bd55
;
font-size
:
12px
;
font-weight
:
bold
;
text-align
:
left
;
line-height
:
1.75em
;
background
:
#3b0d32
;
border
:
solid
1px
#FFF
;
border-bottom
:
solid
1px
#999
;
cursor
:
default
;
padding
:
0em
;
padding
:
3px
10px
3px
10px
;
margin
:
0em
;
}
form
{
display
:
block
;
margin-right
:
20px
;
}
.dashboard-section-title
{
font-weight
:
bold
;
color
:
#3b0d32
;
}
</style>
</head>
<body>
<div
class=
"title-link"
style=
"display:block;color:#f7bd55; font-size: 12px;font-weight: bold;text-align: left;line-height: 1.75em; background-color: #3b0d32; border: solid 1px #FFF; border-bottom: solid 1px #999; cursor: default; padding: 0em; padding:3px 10px 3px 10px; margin: 0em;"
>
Mark Invoice Paid:
</div>
<div
style=
"padding: 0px 0px 10px 0px;"
>
<form
method=
"post"
action=
""
id=
"edit-invoice-form"
>
<input
type=
"hidden"
name=
"uid"
value=
"
<?php
echo
$uid
;
?>
"
/>
<input
type=
"hidden"
name=
"invoice_id"
value=
"
<?php
echo
$post
->
ID
;
?>
"
/>
<input
type=
"hidden"
name=
"type"
value=
"
<?php
echo
$action
;
?>
"
/>
<div
class=
"dashboard-section"
style=
"margin-left:20px;margin-top:10px;"
>
<div
class=
"dashboard-section-content small"
>
<select
name=
"status"
>
<option
value=
""
>
Select payment type...
</option>
<option
value=
"PPV"
>
Pre-paid with Visa
</option>
<option
value=
"PPMC"
>
Pre-paid with Mastercard
</option>
<option
value=
"PPAMEX"
>
Pre-paid with American Express
</option>
<option
value=
"CHEQUE"
>
Paid by Cheque
</option>
</select>
</div>
</div>
<div
class=
"dashboard-section"
style=
"margin-left:20px;margin-top:10px;"
>
<div
class=
"dashboard-section-title"
></div>
<div
class=
"dashboard-section-links"
></div>
<div
class=
"dashboard-section-content small"
>
<div><input
type=
"submit"
value=
"Update"
/></div>
</div>
</div>
</form>
</div>
</body>
</html>
\ No newline at end of file
Please
register
or
sign in
to post a comment