-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-orbis_project.php
executable file
·179 lines (118 loc) · 4.34 KB
/
single-orbis_project.php
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="row">
<div class="col-md-8">
<div class="panel">
<header>
<h3><?php _e( 'Description', 'orbis' ); ?></h3>
</header>
<div class="content">
<?php the_content(); ?>
</div>
</div>
<?php get_template_part( 'templates/project_sections' ); ?>
<?php do_action( 'orbis_after_main_content' ); ?>
<?php comments_template( '', true ); ?>
</div>
<div class="col-md-4">
<?php if ( function_exists( 'orbis_project_the_time' ) && is_singular( 'orbis_project' ) ) : ?>
<div class="panel">
<header>
<h3><?php _e( 'Project status', 'orbis' ); ?></h3>
</header>
<div class="content">
<span class="entry-meta"><?php _e( 'Project budget', 'orbis' ); ?></span> <br />
<p class="project-time">
<?php orbis_project_the_time(); ?>
<?php if ( function_exists( 'orbis_project_the_logged_time' ) ) : ?>
<?php
$classes = array();
$classes[] = orbis_project_in_time() ? 'text-success' : 'text-error';
?>
<span class="<?php echo implode( $classes, ' ' ); ?>"><?php orbis_project_the_logged_time(); ?></span>
<?php endif; ?>
</p>
</div>
</div>
<?php endif; ?>
<div class="panel">
<header>
<h3><?php _e( 'Project Details', 'orbis' ); ?></h3>
</header>
<div class="content">
<dl>
<?php if ( function_exists( 'orbis_project_has_principal' ) && orbis_project_has_principal() ) : ?>
<dt><?php _e( 'Client', 'orbis' ); ?></dt>
<dd>
<?php
printf(
'<a href="%s">%s</a>',
esc_attr( orbis_project_principal_get_permalink() ),
orbis_project_principel_get_the_name()
);
?>
</dd>
<?php endif; ?>
<dt><?php _e( 'Posted on', 'orbis' ); ?></dt>
<dd><?php echo esc_html( get_the_date() ); ?></dd>
<dt><?php _e( 'Posted by', 'orbis' ); ?></dt>
<dd><?php echo esc_html( get_the_author() ); ?></dd>
<?php
$agreement_id = get_post_meta( get_the_ID(), '_orbis_project_agreement_id', true );
if ( ! empty( $agreement_id ) && $agreement = get_post( $agreement_id ) ) : ?>
<dt><?php _e( 'Agreement', 'orbis' ); ?></dt>
<dd>
<a href="<?php echo get_permalink( $agreement ); ?>"><?php echo get_the_title( $agreement ); ?></a>
</dd>
<?php endif; ?>
<dt><?php _e( 'Status', 'orbis' ); ?></dt>
<dd>
<?php if ( orbis_project_is_finished() ) : ?>
<span class="label label-success"><?php _e( 'Finished', 'orbis' ); ?></span>
<?php else : ?>
<span class="label label-default"><?php _e( 'Not finished', 'orbis' ); ?></span>
<?php endif; ?>
<?php if ( function_exists( 'orbis_finance_bootstrap' ) ) : ?>
<?php if ( orbis_project_is_invoiced() ) : ?>
<span class="label label-success"><?php _e( 'Invoiced', 'orbis' ); ?></span>
<?php else : ?>
<span class="label label-default"><?php _e( 'Not invoiced', 'orbis' ); ?></span>
<?php endif; ?>
<?php if ( orbis_project_is_invoicable() ) : ?>
<span class="label label-success"><?php _e( 'Invoicable', 'orbis' ); ?></span>
<?php else : ?>
<span class="label label-default"><?php _e( 'Not invoicable', 'orbis' ); ?></span>
<?php endif; ?>
<?php endif; ?>
</dd>
<?php
$invoice_number = get_post_meta( get_the_ID(), '_orbis_project_invoice_number', true );
if ( ! empty( $invoice_number ) ) : ?>
<dt><?php _e( 'Invoice', 'orbis' ); ?></dt>
<dd>
<?php
$invoice_link = orbis_get_invoice_link( $invoice_number );
if ( ! empty( $invoice_link ) ) {
printf(
'<a href="%s" target="_blank">%s</a>',
esc_attr( $invoice_link ),
$invoice_number
);
} else {
echo $invoice_number;
}
?>
</dd>
<?php endif; ?>
<dt><?php _e( 'Actions', 'orbis' ); ?></dt>
<dd><?php edit_post_link( __( 'Edit', 'orbis' ) ); ?></dd>
</dl>
</div>
</div>
<?php if ( function_exists( 'p2p_register_connection_type' ) ) : ?>
<?php get_template_part( 'templates/project_persons' ); ?>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php get_footer(); ?>