diff --git a/html/BTCSym.png b/html/BTCSym.png new file mode 100644 index 00000000..7e2114c2 Binary files /dev/null and b/html/BTCSym.png differ diff --git a/pool/page_shifts.php b/pool/page_shifts.php index 1092482f..1230d380 100644 --- a/pool/page_shifts.php +++ b/pool/page_shifts.php @@ -28,8 +28,22 @@ function doshifts($data, $user) $row = 'odd'; $pg .= ""; - $shif = preg_replace(array('/^.* to /','/^.*fin: /'), '', $ans['shift:'.$i]); - $pg .= "$shif"; + $shifname = $ans['shift:'.$i]; + $shif = preg_replace(array('/^.* to /','/^.*fin: /'), '', $shifname); + $ablock = false; + if (preg_match('/to.*Block.* fin/', $shifname) === true) + $ablock = true; + else + { + $shifex = $ans['endmarkextra:'.$i]; + if (preg_match('/Block .* fin/', $shifex) === true) + $ablock = true; + } + if ($ablock === true) + $btc = ' '; + else + $btc = ''; + $pg .= "$shif$btc"; $start = $ans['start:'.$i]; $pg .= ''.utcd($start).''; $nd = $ans['end:'.$i]; diff --git a/src/ckdb.h b/src/ckdb.h index 3e02c6e2..e59f475a 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -55,7 +55,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.0" -#define CKDB_VERSION DB_VERSION"-1.021" +#define CKDB_VERSION DB_VERSION"-1.022" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ diff --git a/src/ckdb_cmd.c b/src/ckdb_cmd.c index 43741df6..b61c0595 100644 --- a/src/ckdb_cmd.c +++ b/src/ckdb_cmd.c @@ -4543,12 +4543,13 @@ static char *cmd_shifts(__maybe_unused PGconn *conn, char *cmd, char *id, __maybe_unused tv_t *notcd, __maybe_unused K_TREE *trf_root) { - K_ITEM *i_username, *u_item, ms_look, *wm_item, *ms_item, *wi_item; + K_ITEM *i_username, *u_item, *m_item, ms_look, *wm_item, *ms_item, *wi_item; K_TREE_CTX wm_ctx[1], ms_ctx[1]; WORKMARKERS *wm; WORKINFO *wi; MARKERSUMMARY markersummary, *ms, ms_add; USERS *users; + MARKS *marks = NULL; char reply[1024] = ""; char tmp[1024]; size_t siz = sizeof(reply); @@ -4584,6 +4585,19 @@ static char *cmd_shifts(__maybe_unused PGconn *conn, char *cmd, char *id, if (CURRENT(&(wm->expirydate)) && WMPROCESSED(wm->status)) { K_RUNLOCK(workmarkers_free); + K_RLOCK(marks_free); + m_item = find_marks(wm->workinfoidend); + K_RUNLOCK(marks_free); + DATA_MARKS_NULL(marks, m_item); + if (m_item == NULL) { + // Log it but keep going + LOGERR("%s() missing mark for markerid " + "%"PRId64"/%s widend %"PRId64, + __func__, wm->markerid, + wm->description, + wm->workinfoidend); + } + bzero(&ms_add, sizeof(ms_add)); markersummary.markerid = wm->markerid; @@ -4652,6 +4666,12 @@ static char *cmd_shifts(__maybe_unused PGconn *conn, char *cmd, char *id, rows, reply, FLDSEP); APPEND_REALLOC(buf, off, len, tmp); + snprintf(tmp, sizeof(tmp), "endmarkextra:%d=%s%c", + rows, + m_item ? marks->extra : EMPTY, + FLDSEP); + APPEND_REALLOC(buf, off, len, tmp); + ftv_to_buf(&(wi->createdate), reply, sizeof(reply)); snprintf(tmp, sizeof(tmp), "start:%d=%s%c", rows, reply, FLDSEP);