Commit 3288b6de authored by Simon's avatar Simon

release 1.4.2

parent fca6839c
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
## Production ## Production
- build CSS & JS assets - `C:\web\dev.biuro\ npm run build` - build CSS & JS assets - `C:\web\dev.biuro\ npm run build`
- build new image `docker build -t biuro/web:1.4.1 .` (update version number) - build new image `docker build -t biuro/web:1.4.2 .` (update version number)
- login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs` - login to biuro docker account `docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs`
- push image to docker repository - `docker push biuro/web:1.4.1` - push image to docker repository - `docker push biuro/web:1.4.2`
## Production ## Production
- update biuro/web image version in .env file (staging or www) - update biuro/web image version in .env file (staging or www)
......
...@@ -48,12 +48,25 @@ ...@@ -48,12 +48,25 @@
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '"'; $where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '"';
// WP Pods fix for multisite
global $wpdb;
$params = array( $params = array(
'orderby' => 'valid.meta_value DESC', 'orderby' => 'valid.meta_value DESC',
'where' => $where, 'where' => $where,
'limit' => 5 'limit' => 5
); );
if (get_current_blog_id() != 1):
$langs = pll_the_languages(array('raw'=>1));
$langID = $langs[pll_current_language('slug')]['id'];
$where = $where . ' AND ( `langs`.`object_id` IS NOT NULL )';
$params['join'] = ' LEFT JOIN `' . $wpdb->prefix . 'term_relationships` AS `langs` ON `langs`.`object_id` = `t`.`ID` AND `langs`.`term_taxonomy_id` = ' . $langID;
$params['where'] = $where;
endif;
// END WP Pods fix for multisite
$jobs = pods( 'job', $params ); $jobs = pods( 'job', $params );
if ( 0 < $jobs->total() ): if ( 0 < $jobs->total() ):
......
...@@ -691,12 +691,13 @@ add_action( 'template_redirect', 'livas_job_id_redirect' ); ...@@ -691,12 +691,13 @@ add_action( 'template_redirect', 'livas_job_id_redirect' );
// Add LIVAS ID column // Add LIVAS ID column
function jobs_columns_head($defaults) { function jobs_columns_head($defaults) {
$defaults['livas_id'] = 'LIVAS ID'; $defaults['livas_id'] = 'LIVAS ID';
$defaults['valid'] = 'Valid';
return $defaults; return $defaults;
} }
// Show LIVAS ID // Show LIVAS ID
function jobs_columns_content($column_name, $post_ID) { function jobs_columns_content($column_name, $post_ID) {
if ($column_name == 'livas_id') { if ($column_name == 'livas_id'):
$pod = pods( 'job', $post_ID ); $pod = pods( 'job', $post_ID );
if ($pod->field( 'livas-id' )): if ($pod->field( 'livas-id' )):
...@@ -704,7 +705,15 @@ function jobs_columns_content($column_name, $post_ID) { ...@@ -704,7 +705,15 @@ function jobs_columns_content($column_name, $post_ID) {
else: else:
echo '-'; echo '-';
endif; endif;
} elseif ($column_name == 'valid'):
$pod = pods( 'job', $post_ID );
if ($pod->field( 'valid' )):
echo $pod->field( 'valid' );
else:
echo '-';
endif;
endif;
} }
function jobs_livas_id_search( $wp ) { function jobs_livas_id_search( $wp ) {
...@@ -735,7 +744,7 @@ function jobs_livas_id_search( $wp ) { ...@@ -735,7 +744,7 @@ function jobs_livas_id_search( $wp ) {
'where' => 'livas-id.meta_value = "' . (int) $livasId . '"', 'where' => 'livas-id.meta_value = "' . (int) $livasId . '"',
]; ];
$pod = pods('job', $params); $pod = pods( 'job', $params);
$ids = []; $ids = [];
while ( $pod->fetch() ) { while ( $pod->fetch() ) {
......
...@@ -141,12 +141,25 @@ get_header(); ?> ...@@ -141,12 +141,25 @@ get_header(); ?>
endforeach; endforeach;
endif; endif;
// WP Pods fix for multisite
global $wpdb;
$params = array( $params = array(
'orderby' => 'valid.meta_value DESC', 'orderby' => 'valid.meta_value DESC',
'where' => $where, 'where' => $where,
'limit' => 20 'limit' => 20
); );
if (get_current_blog_id() != 1):
$langs = pll_the_languages(array('raw'=>1));
$langID = $langs[pll_current_language('slug')]['id'];
$where = $where . ' AND ( `langs`.`object_id` IS NOT NULL )';
$params['join'] = ' LEFT JOIN `' . $wpdb->prefix . 'term_relationships` AS `langs` ON `langs`.`object_id` = `t`.`ID` AND `langs`.`term_taxonomy_id` = ' . $langID;
$params['where'] = $where;
endif;
// END WP Pods fix for multisite
$jobs = pods( 'job', $params ); $jobs = pods( 'job', $params );
if ( 0 < $jobs->total() ): if ( 0 < $jobs->total() ):
......
...@@ -135,12 +135,25 @@ get_header(); ?> ...@@ -135,12 +135,25 @@ get_header(); ?>
endforeach; endforeach;
endif; endif;
// WP Pods fix for multisite
global $wpdb;
$params = array( $params = array(
'orderby' => 'valid.meta_value DESC', 'orderby' => 'valid.meta_value DESC',
'where' => $where, 'where' => $where,
'limit' => 20 'limit' => 20
); );
if (get_current_blog_id() != 1):
$langs = pll_the_languages(array('raw'=>1));
$langID = $langs[pll_current_language('slug')]['id'];
$where = $where . ' AND ( `langs`.`object_id` IS NOT NULL )';
$params['join'] = ' LEFT JOIN `' . $wpdb->prefix . 'term_relationships` AS `langs` ON `langs`.`object_id` = `t`.`ID` AND `langs`.`term_taxonomy_id` = ' . $langID;
$params['where'] = $where;
endif;
// END WP Pods fix for multisite
$jobs = pods( 'job', $params ); $jobs = pods( 'job', $params );
if ( 0 < $jobs->total() ): if ( 0 < $jobs->total() ):
......
<?php <?php
$jobID = get_the_ID(); // $jobID = get_the_ID();
$pod = pods( 'job', get_the_ID() ); $pod = pods( 'job', get_the_ID() );
...@@ -81,17 +81,20 @@ ...@@ -81,17 +81,20 @@
<div class="c-job-contacts"> <div class="c-job-contacts">
<?php <?php
$jobID = get_the_ID(); // $jobID = get_the_ID();
$params = array( // $params = array(
'where' => 't.id=' . $jobID, // 'where' => 't.id=' . get_the_ID(),
'limit' => 1 // 'limit' => 1
); // );
$contacts = pods( 'job', $params ); // $contacts = pods( 'job', $params );
while ( $contacts->fetch() ) : // while ( $contacts->fetch() ) :
echo $contacts->display( 'contact' ); // echo $contacts->display( 'contact' );
endwhile; // endwhile;
echo $pod->field('contact');
?> ?>
</div> </div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment