function psp_user_project_list() { $user_id = $_GET['user']; $user = get_user_by('id', $user_id); $username = psp_username_by_id($user_id); ?> <div class="wrap"> <h2 class="psp-user-list-title"> <?php echo get_avatar($user_id); ?> <span><?php _e('Projects Assigned to', 'psp_projects'); ?> <?php echo $username; ?> </span> </h2> <br style="clear:both"> <table id="psp-user-list-table" class="wp-list-table widefat fixed posts"> <thead> <tr> <th><?php _e('Title', 'psp_projects'); ?> </th> <th><?php _e('Client', 'psp_projects'); ?> </th> <th><?php _e('% Complete', 'psp_projects'); ?> </th> <th><?php _e('Timing', 'psp_projects'); ?> </th> <th><?php _e('Project Types', 'psp_projects'); ?> </th> <th><span><span class="vers"><span title="Comments" class="comment-grey-bubble"></span></span></span></th> <th><?php _e('Last Updated', 'psp_projects'); ?> </th> </tr> </thead> <tbody> <?php $args = array('post_type' => 'psp_projects', 'posts_per_page' => '-1', 'meta_query' => array(array('key' => 'allowed_users_%_user', 'value' => $user_id))); $projects = new WP_Query($args); $i = 0; while ($projects->have_posts()) { $projects->the_post(); global $post; ?> <tr <?php if ($i % 2 == 0) { echo 'class="alternate"'; } ?> > <td><strong><a href="post.php?post=<?php echo $post->ID; ?> &action=edit"><?php the_title(); ?> </a></strong></td> <td><?php the_field('client'); ?> </td> <td> <?php $completed = psp_compute_progress($post->ID); if ($completed > 10) { echo '<p class="psp-progress"><span class="psp-' . $completed . '"><strong>%' . $completed . '</strong></span></p>'; } else { echo '<p class="psp-progress"><span class="psp-' . $completed . '"></span></p>'; } ?> </td> <td> <?php psp_the_timing_bar($post->ID); ?> </td> <td><?php the_terms($post->ID, 'psp_tax'); ?> </td> <td><div class="post-com-count-wrapper"> <a href='edit-comments.php?p=<?php echo $post->ID; ?> ' class='post-com-count'><span class='comment-count'><?php comments_number('0', '1', '%'); ?> </span></a></div></td> <td><?php the_modified_date(); ?> </td> </tr> <?php $i++; } ?> </tbody> </table> </div> <?php }
?> <input type="hidden" name="psp-project-id" value="<?php echo $post_id; ?> "> <input type="hidden" name="psp-document-id" value="<?php echo $i; ?> "> <input type="hidden" name="psp-document-name" value="<?php the_sub_field('title'); ?> "> <input type="hidden" name="psp-current-user" value="<?php echo psp_username_by_id(get_current_user_id()); ?> "> <?php } ?> <a href="<?php echo $doc_link; ?> " class="psp-icon <?php echo $icon; ?> "></a> <p class="psp-doc-title">