It seems to me (as a relatively uneducated-in-databases layperson) that a 
simple (although not necessarily elegant) solution would be to see if there's a 
table in your database that has the rankings of senority by position in order. 
If there is, and a person's position is attached to their name, you could send 
a query that asks "Hey, is there anybody in that's high enough rank to 
potentially be in charge?", sort the returned list by rank, and then take only 
the person who is the highest rank off that list and discard the rest. If there 
are people of the same rank, then you may need to have it go back over the list 
of people with a secondary criterion for rank, like years of service, and 
return back the person who wins on that criterion.

Depending on how often you want to re-run that call, it could be taxing on the 
database, but I'm sure that people who are more experienced than I am that 
could elegant things up so that the database isn't called every time that 
someone loads up the Intranet to find out who's in charge, but instead displays 
the result from the last time the database was called by referencing a variable 
that is otherwise static Somewhere Else. 

There may be open-source plugins or programs that do just this, but I do not 
know of any right now. 

Hope this helps.

-Alex


---
Date:    Thu, 26 Mar 2015 15:56:54 +0000
From:    Rodney Griffith <[email protected]>
Subject: Mayor of Libraries

I'm sharing a dilemma to the list in hopes of getting in touch with anyone has 
been in a similar situation (although I have looked high and low without 
finding one similar case for over two months). Our library requires that the 
Senior employee In Charge be updated on our Intranet based on an old relational 
database which contains staff schedules. So when John Smith is in the library, 
if he outranks Kate Stewart, his name is posted at the top of the page. 
However, when John Smith's shift is over and Jo Grant appears, she's outranked 
by Kate Stewart, whose name then replaces John's.


That system has to be replaced, however. A few weeks back, I began likening the 
situation to the old, deprecated Foursquare: whoever is highest ranking when 
present is Mayor. Unfortunately, that was the old Foursquare, and no one left a 
recipe, how-to or breadcrumb trail behind.


There are lots of in/out boards (like Tabzon) online, and a few js calendars, 
but I have found absolutely nothing that ranks seniority and automagically 
pushes the name of the senior officer somewhere.


Worst-case scenario is that I'd have to write one from scratch, and I'm really 
more of a front-end person. But I'm posting here to see if anyone, anywhere has 
the same scenario and how they've dealt with it. I would honestly be surprised 
if there isn't an existing open-source solution for such a need--after all, all 
kinds of commercial enterprises, military situations etc. depend on seniority 
rankings.


I should mention that the quickest, most logical and least labor-intensive 
method, "just post it manually as a status update", is out. Don't ask why.

Reply via email to