/**
 * Builds a list of tasks and returns an array of list items and task count
 *
 *
 * @param integer $id post ID
 * @param string $taskStyle (optional) for shortcodes, the type of tasks to return
 * @return array including a collection of tasks in list format and a count of items
 **/
function psp_populate_tasks($id, $taskStyle, $phase_id)
{
    if (empty($id)) {
        global $post;
        $id = $post->ID;
    }
    include psp_template_hierarchy('/parts/tasks.php');
    return $taskList;
}
function psp_custom_template($template)
{
    if ($theme_file = locate_template(array($template))) {
        $file = $theme_file;
        return apply_filters('rc_repl_template_' . $template, $file);
    } else {
        psp_template_hierarchy($template);
    }
}
Esempio n. 3
0
function psp_template_chooser($template)
{
    // Post ID
    $post_id = get_the_ID();
    // For all other CPT
    if (get_post_type($post_id) != 'psp_projects') {
        return $template;
    }
    // Else use custom template
    if (is_single()) {
        return psp_template_hierarchy('single');
    }
}
Esempio n. 4
0
/**
 *
 * Function psp_documents
 *
 * Stores all of the psp_documents into an unordered list and returns them
 *
 * @param $post_id
 * @return $psp_docs
 *
 */
function psp_documents($post_id)
{
    ob_start();
    include psp_template_hierarchy('/parts/documents.php');
    return ob_get_clean();
}
function psp_send_notification($to, $subject, $message, $post_id, $progress = NULL)
{
    // If a POST ID isn't set, let's use the current page
    if (empty($post_id)) {
        global $post;
        $post_id = $post->ID;
    }
    // Set the senders name
    if (get_option('psp_from_name')) {
        $from = get_option('psp_from_name');
    } else {
        $from = 'Project Panorama';
    }
    // Set the senders e-email
    if (get_option('psp_from_email')) {
        $email_from = get_option('psp_from_email');
    } else {
        $email_from = get_option('admin_email');
    }
    // Are we including a logo?
    if (get_option('psp_include_logo')) {
        $logo = get_option('psp_logo');
    }
    //Set the Headers
    $headers = 'From: ' . $from . ' <' . $email_from . '>' . "\r\n";
    // Get the users ID and E-Mail
    $user = get_user_by('id', $to);
    $user_email = $user->user_email;
    add_filter('wp_mail_content_type', 'psp_set_mail_content_type');
    ob_start();
    include psp_template_hierarchy('/parts/email.php');
    $message = ob_get_clean();
    wp_mail($user_email, $subject, $message, $headers);
    remove_filter('wp_mail_content_type', 'psp_set_mail_content_type');
}