twzToDoList.class documentation v1.1.1 2019-06-17
In case there aren't enough to-do-list applications already, here's another one.
twzToDoList is a simple web-based project/task checklist, which is suitable for
people who spend most of their day in front of a browser.
Any number of projects can be added, and each project can have any number of tasks.
The words "project" and "task" are options you can change; for example you might
prefer to work with "Jobs", with each Job consisting of multiple "Items".
Projects are automatically given a Status depending on their due date, and that
of their tasks. The status names can be customised to suit yourself, but their
meaning is fixed (see setupStatus method description below).
twzToDoList is easy to set up - all you need is a web server that supports PHP
twzToDoList requires a MySQL database, and will try to create one if it
doesn't exist. In some environments (eg shared hosting), that won't work -
in that case, you should start by manually creating a MySQL database, and
adding a database user with full privileges to the database.
Unzip the package and copy or rename index-example.php to index.php.
Open index.php in your favourite plain text editor, and enter your preferred
settings as explained in the file - timezone, database name, password, etc,
and any twzToDoList options (described below).
UPGRADE NOTE: if you are upgrading from an ealier version of twzToDoList, you
should already have an index.php file. Usually this can be kept, but have
a look in index-example.php for any requirements that might have changed.
Upload all files to a directory on your web server, and point your browser
at that directory - that's it!
Set a single option, eg
Set multiple options at once, eg
$todo->setOptions( array('canBackup'=>true, 'progressType'=>'bartext') );
setupStatus($StatusNames=array(), $wordArchive='', $wordArchived='')
Change the name of one or more statuses. The defaults are:
NEW ..... New
INPROG .. In progress
DUE ..... Due soon
LATE .... Overdue
DONE .... Completed
CLOSED .. Archived
If the name for CLOSED is changed, you'll probably also want to change
$wordArchive ... used in the label 'Archive this project'
$wordArchived .. used in the link 'Show archived projects'
$todo->setupStatus( array('INPROG'=>'Ongoing', 'DONE'=>'Finished') );
Does all the work! Call this as the last step, eg
The list below shows the options that can be changed by calling the setOption() or
setOptions() method, and each option's default value. Option names are case sensitive.
wordProject ....... ('project') the word to use for a project, eg 'job to do'
wordProjects ...... ('projects') the word to use for projects (plural), eg 'jobs to do'
wordTask .......... ('task') the word to use for a task, eg 'item'
wordTasks ......... ('tasks') the word to use for tasks (plural), eg 'items'
canSearch ......... (true) whether user can search for projects
canAddProject ..... (true) whether user can add a new project
NOTE: all users can edit existing projects
canDeleteProject .. (true) whether user can delete a project
canEditPreset ..... (true) whether user can edit presets
canDeletePreset ... (true) whether user can delete a preset
canBackup ......... (false) whether user can download a database backup
dmyInput .......... (true) dates entered with slashes are normally assumed to
be in day/month/year order; if false, month/day/year order.
Eg if dmyInput is true, 5/3/19 means 5 March 2019; if
false it means 3 May 2019.
searchFrom ........ ('1 month ago') default search-From date
searchTo .......... ('now') default search-To date
setNowText ........ ('✓') text for 'set date to now' button, eg 'now'
or use '✓' for a checkmark, '✔' for a bold
checkmark. Empty string to disable this feature
defaultDue ........ ('+1 month') auto due date for new projects
dueSoonDays ....... (7) how many days in the future a due date is considered
to be "due soon"
dateFormat ........ ('D j M Y g:ia') display format for date of backup files;
ref PHP's date() function
backupDir ......... ('./backups/') directory to save database backups (only
applies if canBackup is true). The directory must exist,
and be writable by PHP.
backupAudit ....... (true) whether to include audit tables in backup (see canBackup)
gzipBackup ........ (true) whether downloaded backup should be gzipped (see canBackup)
backupAll ......... (false) ADMIN ONLY - whether the user can back up (and
download) all tables, with any tablePrefix
uniqueName ........ (true) whether each project name must be unique
progressType ...... ('textbar') progress indicator in project list; can be
one of: (none|text|textbar|bar|bartext)
useSession ........ (true) Use a session to remember search fields
newTaskCount ...... (5) number of new tasks that can be added at one time
(for a new project or preset)
addTaskCount ...... (1) number of tasks that can be added at one time (for an
existing project or preset)
pageMax ........... (20) maximum number of archived projects to list per page
allowTaskDue ...... (true) whether user can enter a due date for each task
applyTaskDue ...... (true) whether the task due date affects project status in
the project list (allowTaskDue must be true). This means that
even if a project's due date is in the future, it will be
listed as overdue if it has a task with an overdue date
updateCheck ....... (true) whether to check for updates. Updating is not automated;
this just informs you if an update is available.
updateDays ........ (30) minimum update check interval, in days
updateSendHost .... (true) whether to send server hostname with update check
tablePrefix ....... ('') database table prefix; allows multiple versions of
twzToDoList in the same database
createTables ...... (true) whether twzToDoList should attempt to create database
tables if they are missing
devDeleted ........ (false) whether user can view a deleted project (from the
devRestore ........ (false) whether user can restore a deleted project from the
audit tables - devDeleted must be true
By default, twzToDoList will check for updates every 30 days by contacting the
developer's server. This happens asynchronously in your browser so performance
won't be affected, even if the server can't be contacted. The hostname of your
web server may be sent as part of this process. If you don't want the hostname
sent, set the updateSendHost option to false. If you want to check for updates
more or less often, set the updateDays option (number of days). If you don't want
twzToDoList to check for updates at all, set the updateCheck option to false.