Skip to content

Commit

Permalink
debugging new additions
Browse files Browse the repository at this point in the history
  • Loading branch information
atwellpub committed Apr 30, 2015
1 parent b6166f5 commit 0dedb49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions classes/class.lead-management.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ public static function build_query() {
self::$query = null;
return;
}

/* set default args */
$args = array(
'post_type' => 'wp-lead',
Expand Down Expand Up @@ -844,10 +844,12 @@ public static function build_taxonomy_select( $taxonomy ) {
*/
public static function perform_actions() {
global $Inbound_Leads;

$static_vars = self::getStaticProperties();

print_r($static_vars);exit;
$referrer = $_REQUEST['_wp_http_referer'];
$params = explode( '?' , $referrer );

parse_str( $params[1] , $params );

if ( !current_user_can('level_9') ){
die ( __('User does not have admin level permissions.') );
}
Expand Down Expand Up @@ -888,13 +890,12 @@ public static function perform_actions() {
/* We've been told to tag these posts with the given category. */
if ( !empty($_REQUEST['add']) ) {

foreach ( $_REQUEST['ids'] as $id )
{
foreach ( $_REQUEST['ids'] as $id ) {
$fid = intval($id);
$Inbound_Leads->add_lead_to_list( $fid, $list_id ); // add to list
}

wp_redirect(get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=add&what=" . $name . "&num=".self::$num.$query);
wp_redirect( add_query_arg( $params , $get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=add&what=" . $name . "&num=".self::$num.$query ) );
die;
}
/* We've been told to remove these posts from the given category. */
Expand All @@ -904,7 +905,7 @@ public static function perform_actions() {
$Inbound_Leads->remove_lead_from_list( intval($id) , $list_id );
}

wp_redirect(get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=remove&what=" . $name . "&num=".self::$num);
wp_redirect( add_query_arg( $params , get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=remove&what=" . $name . "&num=".self::$num ) );
die;
}

Expand All @@ -915,7 +916,7 @@ public static function perform_actions() {
foreach ( (array) $_REQUEST['ids'] as $id ) {
$Inbound_Leads->add_tag_to_lead( intval($id) , explode( ',' , $tags ) );
}
wp_redirect(get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=tag&what=$tags&num=".self::$num.$query."&on=$pass_ids");
wp_redirect( add_query_arg( $params , get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=tag&what=$tags&num=".self::$num.$query."&on=$pass_ids" ) );
die;
}

Expand All @@ -940,7 +941,7 @@ public static function perform_actions() {
}

$tags = join(', ', $tags);
wp_redirect(get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=untag&what=$tags&num=self::$num$query");
wp_redirect( add_query_arg( $params , get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=untag&what=$tags&num=self::$num$query" ) );
die;
}
/* Delete selected leads */
Expand All @@ -950,7 +951,7 @@ public static function perform_actions() {
wp_delete_post( $id, true);
}

wp_redirect(get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=delete_leads&what=" . $name . "&num=self::$num$query");
wp_redirect( add_query_arg( $params , get_option('siteurl') . "/wp-admin/edit.php?post_type=wp-lead&page=lead_management&done=delete_leads&what=" . $name . "&num=self::$num$query" ) );
die;

}
Expand Down
2 changes: 1 addition & 1 deletion css/admin-management.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ div.wrap {
}

.media-upload-form div.error, .wrap div.error, .wrap div.updated {
//display: none;

}
#lead-tag-filter, #lead-keyword-filter, .action {
display: none;
Expand Down

0 comments on commit 0dedb49

Please sign in to comment.