|
@@ -36,22 +36,34 @@ if (!class_exists("plug_wookook")) {
|
|
|
|
|
|
$defaults['abostatus'] = __('Abo Status', 'id-column');
|
|
|
$defaults['aboproduct'] = __('Abo Product', 'id-column');
|
|
|
+ $defaults['aboorder'] = __('Abo Order', 'id-column');
|
|
|
return $defaults;
|
|
|
|
|
|
}
|
|
|
|
|
|
function imel_custom_column_userfield($value, $column_name, $id) {
|
|
|
if ($column_name == 'aboproduct') {
|
|
|
-
|
|
|
- $burl = get_option($this->pluginname . "_wookook_baseurl_order");
|
|
|
+ $burl = get_option($this->pluginname . "_wookook_baseurl_product");
|
|
|
$pid = get_user_meta($id, 'abo_prod', true);
|
|
|
+ $s = '<a href="' . $burl . '' . $pid . '">' . $pid . '</a>';
|
|
|
+ return $s;
|
|
|
+ }
|
|
|
+ if ($column_name == 'aboorder') {
|
|
|
+ $burl = get_option($this->pluginname . "_wookook_baseurl_order");
|
|
|
+
|
|
|
+ $pid = get_user_meta($id, 'abo_order', true);
|
|
|
+ if ($pid) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $pid = get_user_meta($id, 'abo_statuscode', true);
|
|
|
+ }
|
|
|
|
|
|
$s = '<a href="' . $burl . '' . $pid . '">' . $pid . '</a>';
|
|
|
return $s;
|
|
|
}
|
|
|
+
|
|
|
if ($column_name == 'abostatus') {
|
|
|
$s = get_user_meta($id, 'abo_status', true);
|
|
|
- $s .= " " . get_user_meta($id, 'abo_statuscode', true);
|
|
|
return $s;
|
|
|
}
|
|
|
}
|
|
@@ -164,8 +176,8 @@ if (!class_exists("plug_wookook")) {
|
|
|
$xrole = $active ? $therole : $exitrole;
|
|
|
wp_update_user(array('ID' => $user_id, 'role' => $xrole, 'first_name' => $order['billing']['first_name'], 'last_name' => $order['billing']['last_name']));
|
|
|
|
|
|
- update_user_meta($user_id, 'abo_status', "ACTIVE");
|
|
|
- update_user_meta($user_id, 'abo_statuscode', $order['id']);
|
|
|
+ update_user_meta($user_id, 'abo_status', $order['status'] . " " . ($active ? " " : " SUSPENDED"));
|
|
|
+ update_user_meta($user_id, 'abo_order', $order['id']);
|
|
|
update_user_meta($user_id, 'abo_prod', $theproduct);
|
|
|
|
|
|
wp_send_new_user_notifications($user_id, 'both');
|
|
@@ -180,8 +192,8 @@ if (!class_exists("plug_wookook")) {
|
|
|
$u = new WP_User($user_id);
|
|
|
$u->set_role($xrole);
|
|
|
|
|
|
- update_user_meta($user_id, 'abo_status', $active ? "ACTIVE" : "SUSPENDED");
|
|
|
- update_user_meta($user_id, 'abo_statuscode', $order['id']);
|
|
|
+ update_user_meta($user_id, 'abo_status', $order['status'] . " " . ($active ? " " : " SUSPENDED"));
|
|
|
+ update_user_meta($user_id, 'abo_order', $order['id']);
|
|
|
update_user_meta($user_id, 'abo_prod', $theproduct);
|
|
|
|
|
|
$resu[] = "UPDATED: " . $order['status'] . " $active :: $theproduct :: $user_id or $user_email exists role > '$xrole'";
|
|
@@ -221,10 +233,14 @@ if (!class_exists("plug_wookook")) {
|
|
|
function admin_line($pre) {
|
|
|
|
|
|
?>
|
|
|
+
|
|
|
+<hr>
|
|
|
<?php echo (__("Shop baseurl products:", "dagsopt")) ?><br>
|
|
|
- <input name="<?php echo ($pre . '_baseurl_product'); ?>" value="<?php echo (stripcslashes(get_option($pre . "_baseurl_product"))); ?>">
|
|
|
+ <input name="<?php echo ($pre . '_baseurl_product'); ?>" class="large-text " value="<?php echo (stripcslashes(get_option($pre . "_baseurl_product"))); ?>">
|
|
|
+ <hr>
|
|
|
<?php echo (__("Shop baseurl orders:", "dagsopt")) ?><br>
|
|
|
- <input name="<?php echo ($pre . '_baseurl_order'); ?>" value="<?php echo (stripcslashes(get_option($pre . "_baseurl_order"))); ?>">
|
|
|
+ <input name="<?php echo ($pre . '_baseurl_order'); ?>" class="large-text " value="<?php echo (stripcslashes(get_option($pre . "_baseurl_order"))); ?>">
|
|
|
+ <hr>
|
|
|
|
|
|
|
|
|
|