Exemplo n.º 1
0
    <div class="cpm-edit-project" style="display:none;">
        <?php 
if (cpm_user_can_access($project_id)) {
    cpm_project_form($project);
}
?>
    </div>

    <div id="cpm-create-user-wrap" title="<?php 
_e('Create a new user', 'cpm');
?>
">
        <?php 
if (cpm_user_can_access($project_id)) {
    cpm_user_create_form();
}
?>
    </div>

    <div class="cpm-clear"></div>
    <div class="cpm-single-project-search-wrap"><input type="text" data-project_id="<?php 
echo $project_id;
?>
" placeholder="<?php 
_e('Search...', 'cpm');
?>
" id="cpm-single-project-search"></div>
</div>

<h2 class="nav-tab-wrapper">
Exemplo n.º 2
0
    /**
     * List all projects
     *
     * @since 1.0
     */
    function list_projects()
    {
        $project_obj = CPM_Project::getInstance();
        $projects = $project_obj->get_projects();
        $status_class = isset($_GET['status']) ? $_GET['status'] : 'active';
        if (function_exists('cpm_project_count')) {
            $count = cpm_project_count();
        }
        ?>

        <div class="icon32" id="icon-themes"><br></div>
        <h2><?php 
        _e('Project Manager', 'cpm');
        ?>
</h2>

        <?php 
        if (function_exists('cpm_project_filters')) {
            cpm_project_filters();
        }
        ?>

        <div class="cpm-projects">

            <?php 
        if (function_exists('cpm_project_filters')) {
            ?>
                <ul class="list-inline order-statuses-filter">
                    <li<?php 
            echo $status_class == 'all' ? ' class="active"' : '';
            ?>
>
                        <a href="<?php 
            echo cpm_url_all();
            ?>
"><?php 
            _e('All', 'cpm');
            ?>
</a>
                    </li>
                    <li<?php 
            echo $status_class == 'active' ? ' class="active"' : '';
            ?>
>
                        <a class="cpm-active" href="<?php 
            echo cpm_url_active();
            ?>
"><?php 
            printf(__('Active (%d)', 'cpm'), $count['active']);
            ?>
</a>
                    </li>
                    <li<?php 
            echo $status_class == 'archive' ? ' class="active"' : '';
            ?>
>
                        <a class="cpm-archive-head" href="<?php 
            echo cpm_url_archive();
            ?>
"><?php 
            printf(__('Completed (%d)', 'cpm'), $count['archive']);
            ?>
</a>
                    </li>
                </ul>
            <?php 
        }
        ?>

            <?php 
        if (cpm_manage_capability('project_create_role')) {
            ?>
                <nav class="cpm-new-project">
                    <a href="#" id="cpm-create-project"><span><?php 
            _e('New Project', 'cpm');
            ?>
</span></a>
                </nav>
            <?php 
        }
        ?>

            <?php 
        foreach ($projects as $project) {
            if (!$project_obj->has_permission($project)) {
                continue;
            }
            ?>
                <article class="cpm-project">
                    <?php 
            if (cpm_is_project_archived($project->ID)) {
                ?>
                        <div class="cpm-completed-wrap"><div class="ribbon-green"><?php 
                _e('Completed', 'cpm');
                ?>
</div></div>
                    <?php 
            }
            ?>

                    <a href="<?php 
            echo cpm_url_project_details($project->ID);
            ?>
">
                        <h5><?php 
            echo get_the_title($project->ID);
            ?>
</h5>

                        <div class="cpm-project-detail"><?php 
            echo cpm_excerpt($project->post_content, 55);
            ?>
</div>
                        <div class="cpm-project-meta">
                            <?php 
            echo cpm_project_summary($project->info);
            ?>
                        </div>

                        <footer class="cpm-project-people">
                            <div class="cpm-scroll">
                            <?php 
            if (count($project->users)) {
                foreach ($project->users as $id => $user_meta) {
                    echo get_avatar($id, 48, '', $user_meta['name']);
                }
            }
            ?>
                            </div>
                        </footer>
                    </a>

                    <?php 
            $progress = $project_obj->get_progress_by_tasks($project->ID);
            echo cpm_task_completeness($progress['total'], $progress['completed']);
            if (cpm_user_can_access($project->ID)) {
                cpm_project_actions($project->ID);
            }
            ?>


                </article>

            <?php 
        }
        ?>

        </div>

        <div id="cpm-project-dialog" title="<?php 
        _e('Start a new project', 'cpm');
        ?>
" style="display: none;">
            <?php 
        if ($project_obj->has_admin_rights()) {
            ?>
                <?php 
            cpm_project_form();
            ?>
            <?php 
        }
        ?>
        </div>

        <div id="cpm-create-user-wrap">
            <?php 
        if ($project_obj->has_admin_rights()) {
            ?>
                <?php 
            cpm_user_create_form();
            ?>
            <?php 
        }
        ?>
        </div>


        <script type="text/javascript">
            jQuery(function($) {
                $( "#cpm-project-dialog, #cpm-create-user-wrap" ).dialog({
                    autoOpen: false,
                    modal: true,
                    dialogClass: 'cpm-ui-dialog',
                    width: 485,
                    height: 425,
                    position:['middle', 100]
                });
            });

            jQuery(function($) {
                $( "#cpm-create-user-wrap" ).dialog({
                    autoOpen: false,
                    modal: true,
                    dialogClass: 'cpm-ui-dialog',
                    width: 400,
                    height: 353,
                    position:['middle', 100]
                });
            });
        </script>
        <?php 
    }