Browse Source

ckdb/php - add block B marks after the shift php shift names

master
kanoi 10 years ago
parent
commit
c754f1b06d
  1. BIN
      html/BTCSym.png
  2. 18
      pool/page_shifts.php
  3. 2
      src/ckdb.h
  4. 22
      src/ckdb_cmd.c

BIN
html/BTCSym.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

18
pool/page_shifts.php

@ -28,8 +28,22 @@ function doshifts($data, $user)
$row = 'odd';
$pg .= "<tr class=$row>";
$shif = preg_replace(array('/^.* to /','/^.*fin: /'), '', $ans['shift:'.$i]);
$pg .= "<td class=dl>$shif</td>";
$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 = ' <img src=/BTCSym.png border=0>';
else
$btc = '';
$pg .= "<td class=dl>$shif$btc</td>";
$start = $ans['start:'.$i];
$pg .= '<td class=dl>'.utcd($start).'</td>';
$nd = $ans['end:'.$i];

2
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__

22
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);

Loading…
Cancel
Save