-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive-orbis_project.php
More file actions
executable file
·120 lines (86 loc) · 2.71 KB
/
archive-orbis_project.php
File metadata and controls
executable file
·120 lines (86 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
use Pronamic\WordPress\Money\Money;
get_header();
?>
<div class="card">
<div class="card-block">
<?php get_template_part( 'templates/search_form' ); ?>
</div>
<?php if ( have_posts() ) : ?>
<div class="table-responsive">
<table class="table table-striped table-condense table-hover">
<thead>
<tr>
<?php if ( orbis_plugin_activated( 'companies' ) ) : ?>
<th><?php esc_html_e( 'Client', 'orbis-5' ); ?></th>
<?php endif ?>
<th><?php esc_html_e( 'Project', 'orbis-5' ); ?></th>
<?php if ( current_user_can( 'read_orbis_project_price', get_the_ID() ) ) : ?>
<th><?php esc_html_e( 'Price', 'orbis-5' ); ?></th>
<?php endif; ?>
<th><?php esc_html_e( 'Time', 'orbis-5' ); ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while ( have_posts() ) :
the_post();
?>
<tr id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( orbis_plugin_activated( 'companies' ) ) : ?>
<td>
<?php
if ( $orbis_project->has_principal() ) {
printf(
'<a href="%s">%s</a>',
esc_attr( get_permalink( $orbis_project->get_principal_post_id() ) ),
esc_html( $orbis_project->get_principal_name() )
);
}
?>
</td>
<?php endif ?>
<td>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php get_template_part( 'templates/table-cell-comments' ); ?>
</td>
<?php if ( current_user_can( 'read_orbis_project_price', get_the_ID() ) ) : ?>
<td>
<?php
$price = $orbis_project->get_price();
if ( ! empty( $price ) ) {
$money = new Money( $price, 'EUR' );
echo esc_html( $money->format_i18n() );
}
?>
</td>
<?php endif; ?>
<td class="project-time">
<?php
if ( isset( $orbis_project ) ) {
echo esc_html( $orbis_project->get_available_time()->format() );
if ( function_exists( 'orbis_project_the_logged_time' ) ) :
$classes = [];
$classes[] = orbis_project_in_time() ? 'text-success' : 'text-error';
?>
<span class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>"><?php orbis_project_the_logged_time(); ?></span>
<?php
endif;
}
?>
</td>
<td>
<?php get_template_part( 'templates/table-cell-actions' ); ?>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<?php else : ?>
<?php get_template_part( 'templates/content-none' ); ?>
<?php endif; ?>
</div>
<?php orbis_content_nav(); ?>
<?php get_footer(); ?>