App-Dochazka-CLI
view release on metacpan or search on metacpan
lib/App/Dochazka/CLI/Guide.pm view on Meta::CPAN
DELETE activity aid $AID
DELETE activity code $CODE
=head2 Employees
=head3 Specify an employee
Wherever it is necessary to specify an employee, the command is shown as
EMPLOYEE_SPEC
This has a special meaning and is not meant to be typed in verbatim.
C<EMPLOYEE_SPEC> can be given in any of the following ways:
EMPLOYEE=$NICK
EMPLOYEE=$SEC_ID
EMPLOYEE=$EID
(where C<$NICK> is an employee nick, C<$SEC_ID> is an employee secondary ID,
and C<$EID> is an employee ID (EID))
If, for some reason, this does not lead to the desired result, you can
force a lookup on a particular property:
NICK=$NICK
SEC_ID=$SEC_ID
EID=$EID
Note that there must not be any whitespace before or after the equal sign.
=head3 Get list of employees
Commands to list all employees, or just those with a given
privilege level:
EMPLOYEE LIST # lists all employees
EMPLOYEE LIST admin
EMPLOYEE LIST active
EMPLOYEE LIST inactive
EMPLOYEE LIST passerby
Only nicks are shown, in alphabetical order.
=head3 Create a new employee
If you are using LDAP authentication, your employees are in the LDAP database
and you can turn on DOCHAZKA_LDAP_AUTOCREATE. Then employees will be created
automatically the first time they log in. Alternatively, employees can be
created manually:
PUT employee nick $NICK { "fullname" : "King George III" }
In addition to "fullname", the following properties can be specified inside
the curly brackets:
sec_id
email
password
remark
For example, to add an employee with nick 'nancy' the command might look like
this:
PUT employee nick nancy { "fullname" : "Nancy Bright Red", "email" : "nancy@identity.org" }
The new employee will have passerby privileges only until a privhistory record
is created (see L<"Add privilege history record">, below).
=head3 Set employee secondary ID
To manually change an employee's secondary ID, do one of the following:
EMPLOYEE_SPEC SEC_ID $SEC_ID
EMPLOYEE_SPEC SET SEC_ID $SEC_ID
Example:
EMPLOYEE=joe SET SEC_ID 4553
=head3 Set employee full name
To manually change an employee's full name, do one of the following:
EMPLOYEE_SPEC FULLNAME $WHATEVER
EMPLOYEE_SPEC SET FULLNAME $WHATEVER
Examples:
EMPLOYEE=baird FULLNAME Joseph Baird
EMPLOYEE=baird FULLNAME JUDr. Joseph Peacock Baird LLM, Esq.
Do not use any quotes in or around the full name.
=head3 Set employee password
To manually change an employee's password, do:
EMPLOYEE_SPEC PASSWORD
EMPLOYEE_SPEC SET PASSWORD
You will be asked to type in the new password twice. This updates the password
that Dochazka stores in the 'employees' table. Whether this has any effect on
the user's ability to log in depends on what authentication method is being
used and where the passwords for that method are stored.
=head2 Schedules
=head3 View all schedules (including disabled schedules)
All existing schedules can be dumped to the screen:
SCHEDULES FETCH ALL
Note that this does not include disabled schedules. To include those in the
listing, use this command:
SCHEDULES FETCH ALL DISABLED
=head3 View an individual schedule (by SID or SCODE)
If the SID or SCODE of a schedule is known, it can be looked up like so:
SID=12 SHOW
SCODE=SAMPLE SHOW
The first example looks up the schedule with SID 12, and the second looks
up the schedule with SCODE "SAMPLE".
=head3 Define a new schedule
The following commands can be used to "create" a schedule, i.e. define it and
save it in the database. The idea is to first build up the schedule in memory
and then, when this "working" schedule is complete, submit it to the REST
server.
=head4 View working schedule
To see the current state of the working schedule, do:
SCHEDULE DUMP
SCHEDULE MEMORY
=head4 Add a line to the working schedule
Each line of the working schedule corresponds to a time interval. Time
intervals are defined by specifying when they begin and end. Ordinarily,
this format should be sufficient:
SCHEDULE MON 8:00-12:00
(This sets up a time interval that begins on Monday 8:00 a.m. and ends
at 12:00 noon that same day.)
This method might not work if the interval starts and ends on different days -
in which case we would use a different format:
SCHEDULE MON 23:00 TUE 03:30
SCHEDULE MON 23:00 - TUE 03:30
Note that it is possible for the working schedule to contain overlapping
or otherwise nonsensical intervals.
=head4 Quickly add identical intervals MON-FRI
lib/App/Dochazka/CLI/Guide.pm view on Meta::CPAN
Although C<EMPLOYEE_SPEC PROFILE> shows the employee's privilege level, there
is also a dedicated command:
EMPLOYEE_SPEC PRIV
=head2 Schedules
=head3 View an employee's schedule
Provided the employee has a schedule defined, it can be displayed by typing:
EMPLOYEE_SPEC SCHEDULE
=head2 Histories
For each employee, Dochazka maintains two "histories": privilege history and
schedule history. Each time an employee's privilege or schedule status changes,
a history record should be added.
=head3 View an employee's privilege history
EMPLOYEE_SPEC PRIV HISTORY
=head3 View an employee's schedule history
EMPLOYEE_SPEC SCHEDULE HISTORY
=head1 USER WORKFLOWS
=head2 Activities
=head3 View a list of all activities
To view a list of all activities, do:
ACTIVITIES
ACTIVITIES ALL
=head2 Employees
=head3 View own employee profile
Each Dochazka employee has a "profile" with some basic information. One's own
profile can be viewed by doing any of the following:
EMPLOYEE
EMPLOYEE PROFILE
EMPLOYEE SHOW
=head3 Set own password
To manually change your password, do:
EMPLOYEE PASSWORD
EMPLOYEE SET PASSWORD
You will be asked to type in the new password twice. If you still can't log in
after doing this, contact your local Dochazka administrator.
=head2 Privilege levels
=head3 View one's own privilege level
Although C<EMPLOYEE PROFILE> shows the employee's privilege level, there
is also a dedicated command:
PRIV
Example
Dochazka(2015-04-08) demo PASSERBY> priv
The current privilege level of demo (EID 2) is passerby
=head2 Schedules
=head3 View one's own schedule
Provided the employee has a schedule defined, it can be displayed by typing:
SCHEDULE
=head3 Display an arbitrary schedule
=head2 Histories
=head3 View own privilege history
PRIV HISTORY
=head3 View own schedule history
SCHEDULE HISTORY
=head2 Intervals
=head3 Enter an interval
=head4 "Canonical" form
The canonical way to enter an attendance interval:
INTERVAL $TIME_BEGIN $TIME_END $ACTIVITY_CODE $DESCRIPTION
INTERVAL $TIME_BEGIN - $TIME_END $ACTIVITY_CODE $DESCRIPTION
Use the above command variant if you need to enter the date along with the
time, or if the interval begins and ends on a different date. Example:
INTERVAL 2015-04-27 08:00 - 2015-04-27 12:00 WORK Prepare notes for meeting
If the date is omitted, the "prompt date" will be used:
( run in 0.563 second using v1.01-cache-2.11-cpan-ceb78f64989 )