/**
  * Add quick links
  * @param  object $post
  * @return
  */
 public static function name_box($post)
 {
     if (get_post_type($post) === Sprout_Client::POST_TYPE) {
         $client = Sprout_Client::get_instance($post->ID);
         self::load_view('admin/meta-boxes/clients/name', array('client' => $client, 'id' => $post->ID, 'type' => $client->get_type(), 'statuses' => $client->get_statuses(), 'all_statuses' => sc_get_client_statuses(), 'post_status' => $post->post_status));
     }
 }
    function sc_get_status_select($client_id = 0)
    {
        if (!$client_id) {
            $client_id = get_the_ID();
        }
        $client = Sprout_Client::get_instance($client_id);
        $statuses = $client->get_statuses();
        $all_statuses = sc_get_client_statuses();
        $status_terms = get_terms(Sprout_Client::STATUS_TAXONOMY, array('hide_empty' => false));
        $status_ids = !empty($statuses) ? wp_list_pluck($statuses, 'term_id') : array();
        ob_start();
        ?>
		<div id="statuses_<?php 
        echo (int) $client_id;
        ?>
" class="sc_statuses_update">
			<span class="status_change_button" data-sa-dropdown="#add_status_<?php 
        echo (int) $client_id;
        ?>
">
				<?php 
        printf('<button class="sc_add_status button" title="%1$s">%1$s&nbsp;<span class="dashicons dashicons-arrow-down"></span></button>', esc_attr(sc__('Status')));
        ?>
			</span>&nbsp;<span class="helptip client_status_help" data-sa-dropdown="#client_status_select_help_<?php 
        echo (int) $client_id;
        ?>
"></span>
			<div id="client_status_select_help_<?php 
        echo (int) $client_id;
        ?>
" class="sa-dropdown sa-dropdown-tip sa-dropdown-relative ">
				<div class="sa-dropdown-panel">
					<?php 
        sc_e('Select all statuses that currently fit this contact.');
        ?>
				</div>
			</div>
			<div id="add_status_<?php 
        echo (int) $client_id;
        ?>
" class="sa-dropdown sa-dropdown-tip sa-dropdown-relative status_change_selection" data-item-id="<?php 
        echo (int) $client_id;
        ?>
" data-nonce="<?php 
        echo esc_attr(wp_create_nonce(SC_Controller::NONCE));
        ?>
" data-vertical-offset="50">
				<ul class="sa-dropdown-menu">
					<?php 
        foreach ($all_statuses as $term_id => $label) {
            ?>
						<?php 
            $checked = !empty($statuses) && in_array($term_id, $status_ids) ? 'checked="checked"' : '';
            printf('<li><label><input type="checkbox" value="%1$s" %3$s/><b>%2$s</b></label></li>', (int) $term_id, esc_html($label), esc_attr($checked));
            ?>
					
					<?php 
        }
        ?>
					<li class="sa-dropdown-divider"></li>
					<li><a href="<?php 
        echo esc_url(admin_url('edit-tags.php?taxonomy=sc_client_status&post_type=sa_client'));
        ?>
"><?php 
        sc_e('Add/Edit Client Statuses');
        ?>
</a></li>
				</ul>
			</div>
		</div>
		<div id="current_statuses_<?php 
        echo (int) $client_id;
        ?>
" class="sc_current_statuses">
			<?php 
        foreach ($status_terms as $term) {
            ?>
				<?php 
            $current_status = !empty($statuses) && in_array($term->term_id, $status_ids) ? 'current' : '';
            $url = add_query_arg(array('post_type' => Sprout_Client::POST_TYPE, Sprout_Client::STATUS_TAXONOMY => $term->slug), admin_url('edit.php'));
            ?>
				<?php 
            printf('<a href="%4$s" class="button button-small sc_status %2$s status_id_%3$s" title="%1$s">%1$s</a>', esc_attr($term->name), esc_attr($current_status), (int) $term->term_id, esc_url_raw($url));
            ?>
			<?php 
        }
        ?>
		</div>
		<?php 
        $view = ob_get_clean();
        return apply_filters('sc_get_status_select', $view, $client_id);
    }