1 Commits

Author SHA1 Message Date
3667c4358f Incorporate changes for 1.2.0 2026-02-24 19:48:08 -05:00
24 changed files with 1833 additions and 1061 deletions

View File

@@ -70,3 +70,8 @@ Changelog
ownership of the installed server directory tree if the http ownership of the installed server directory tree if the http
user and group names were left at the default. user and group names were left at the default.
- Updated and tested to support Raspberry Pi 4B hardware. - Updated and tested to support Raspberry Pi 4B hardware.
1.2.0 - 2021-05-05
- Added ability to customize the terminology used for Device,
Period, and Effective/Non-effective to make OpenDRS usable in
a wider range of applications.

754
LICENSE
View File

@@ -1,6 +1,3 @@
The following license applies to all OpenDRS code
Copyright (C) 2026 by Rod Wright :
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
@@ -12,88 +9,88 @@ Copyright (C) 2026 by Rod Wright :
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to the GNU Library General Public License instead.) You can apply it to
your programs, too. your programs, too.
When we speak of free software, we are referring to freedom, not When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things. in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights. anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it. distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their source code. And you must show them these terms so they know their
rights. rights.
We protect your rights with two steps: (1) copyright the software, and We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy, (2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software. distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original that any problems introduced by others will not reflect on the original
authors' reputations. authors' reputations.
Finally, any free program is threatened constantly by software Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all. patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains 0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The \"Program\", below, under the terms of this General Public License. The \"Program\", below,
refers to any such program or work, and a \"work based on the Program\" refers to any such program or work, and a \"work based on the Program\"
means either the Program or any derivative work under copyright law: means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it, that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in language. (Hereinafter, translation is included without limitation in
the term \"modification\".) Each licensee is addressed as \"you\". the term \"modification\".) Each licensee is addressed as \"you\".
Activities other than copying, distribution and modification are not Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program). Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does. Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's 1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty; notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License and give any other recipients of the Program a copy of this License
along with the Program. along with the Program.
You may charge a fee for the physical act of transferring a copy, and You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee. you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion 2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1 distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions: above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change. stating that you changed the files and the date of any change.
@@ -114,29 +111,29 @@ Copyright (C) 2026 by Rod Wright :
does not normally print such an announcement, your work based on does not normally print such an announcement, your work based on
the Program is not required to print an announcement.) the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program, identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it. entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or exercise the right to control the distribution of derivative or
collective works based on the Program. collective works based on the Program.
In addition, mere aggregation of another work not based on the Program In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under a storage or distribution medium does not bring the other work under
the scope of this License. the scope of this License.
3. You may copy and distribute the Program (or a work based on it, 3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following: Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections source code, which must be distributed under the terms of Sections
@@ -155,143 +152,143 @@ Copyright (C) 2026 by Rod Wright :
received the program in object code or executable form with such received the program in object code or executable form with such
an offer, in accord with Subsection b above.) an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component operating system on which the executable runs, unless that component
itself accompanies the executable. itself accompanies the executable.
If distribution of executable or object code is made by offering If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not distribution of the source code, even though third parties are not
compelled to copy the source along with the object code. compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program 4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License. void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such this License will not have their licenses terminated so long as such
parties remain in full compliance. parties remain in full compliance.
5. You are not required to accept this License, since you have not 5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying all its terms and conditions for copying, distributing or modifying
the Program or works based on it. the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the 6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein. restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to You are not responsible for enforcing compliance by third parties to
this License. this License.
7. If, as a consequence of a court judgment or allegation of patent 7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program. refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other apply and the section as a whole is intended to apply in other
circumstances. circumstances.
It is not the purpose of this section to induce you to infringe any It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is integrity of the free software distribution system, which is
implemented by public license practices. Many people have made implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot to distribute software through any other system and a licensee cannot
impose that choice. impose that choice.
This section is intended to make thoroughly clear what is believed to This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License. be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in 8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License. the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions 9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to be similar in spirit to the present version, but may differ in detail to
address new problems or concerns. address new problems or concerns.
Each version is given a distinguishing version number. If the Program Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and \"any specifies a version number of this License which applies to it and \"any
later version\", you have the option of following the terms and conditions later version\", you have the option of following the terms and conditions
either of that version or of any later version published by the Free either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software this License, you may choose any version ever published by the Free Software
Foundation. Foundation.
10. If you wish to incorporate parts of the Program into other free 10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally. of promoting the sharing and reuse of software generally.
NO WARRANTY NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION. REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms. free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least convey the exclusion of warranty; and each file should have at least
the \"copyright\" line and a pointer to where the full notice is found. the \"copyright\" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.> <one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author> Copyright (C) <year> <name of author>
@@ -311,24 +308,24 @@ Copyright (C) 2026 by Rod Wright :
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this If the program is interactive, make it output a short notice like this
when it starts in an interactive mode: when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details. under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program. mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your You should also get your employer (if you work as a programmer) or your
school, if any, to sign a \"copyright disclaimer\" for the program, if school, if any, to sign a \"copyright disclaimer\" for the program, if
necessary. Here is a sample; alter the names: necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker. `Gnomovision' (which makes passes at compilers) written by James Hacker.
@@ -336,370 +333,9 @@ Copyright (C) 2026 by Rod Wright :
<signature of Ty Coon>, 1 April 1989 <signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice Ty Coon, President of Vice
This General Public License does not permit incorporating your program into This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General library. If this is what you want to do, use the GNU Library General
Public License instead of this License. Public License instead of this License.
The following license applies to jquery code :
Copyright jQuery Foundation and other contributors, https://jquery.org/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery-ui
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code contained within the demos directory.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
The following license applies to the Fugue icon set :
Creative Commons Legal Code
Attribution 3.0 Unported
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
DAMAGES RESULTING FROM ITS USE.
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
CONDITIONS.
1. Definitions
a. "Adaptation" means a work based upon the Work, or upon the Work and
other pre-existing works, such as a translation, adaptation,
derivative work, arrangement of music or other alterations of a
literary or artistic work, or phonogram or performance and includes
cinematographic adaptations or any other form in which the Work may be
recast, transformed, or adapted including in any form recognizably
derived from the original, except that a work that constitutes a
Collection will not be considered an Adaptation for the purpose of
this License. For the avoidance of doubt, where the Work is a musical
work, performance or phonogram, the synchronization of the Work in
timed-relation with a moving image ("synching") will be considered an
Adaptation for the purpose of this License.
b. "Collection" means a collection of literary or artistic works, such as
encyclopedias and anthologies, or performances, phonograms or
broadcasts, or other works or subject matter other than works listed
in Section 1(f) below, which, by reason of the selection and
arrangement of their contents, constitute intellectual creations, in
which the Work is included in its entirety in unmodified form along
with one or more other contributions, each constituting separate and
independent works in themselves, which together are assembled into a
collective whole. A work that constitutes a Collection will not be
considered an Adaptation (as defined above) for the purposes of this
License.
c. "Distribute" means to make available to the public the original and
copies of the Work or Adaptation, as appropriate, through sale or
other transfer of ownership.
d. "Licensor" means the individual, individuals, entity or entities that
offer(s) the Work under the terms of this License.
e. "Original Author" means, in the case of a literary or artistic work,
the individual, individuals, entity or entities who created the Work
or if no individual or entity can be identified, the publisher; and in
addition (i) in the case of a performance the actors, singers,
musicians, dancers, and other persons who act, sing, deliver, declaim,
play in, interpret or otherwise perform literary or artistic works or
expressions of folklore; (ii) in the case of a phonogram the producer
being the person or legal entity who first fixes the sounds of a
performance or other sounds; and, (iii) in the case of broadcasts, the
organization that transmits the broadcast.
f. "Work" means the literary and/or artistic work offered under the terms
of this License including without limitation any production in the
literary, scientific and artistic domain, whatever may be the mode or
form of its expression including digital form, such as a book,
pamphlet and other writing; a lecture, address, sermon or other work
of the same nature; a dramatic or dramatico-musical work; a
choreographic work or entertainment in dumb show; a musical
composition with or without words; a cinematographic work to which are
assimilated works expressed by a process analogous to cinematography;
a work of drawing, painting, architecture, sculpture, engraving or
lithography; a photographic work to which are assimilated works
expressed by a process analogous to photography; a work of applied
art; an illustration, map, plan, sketch or three-dimensional work
relative to geography, topography, architecture or science; a
performance; a broadcast; a phonogram; a compilation of data to the
extent it is protected as a copyrightable work; or a work performed by
a variety or circus performer to the extent it is not otherwise
considered a literary or artistic work.
g. "You" means an individual or entity exercising rights under this
License who has not previously violated the terms of this License with
respect to the Work, or who has received express permission from the
Licensor to exercise rights under this License despite a previous
violation.
h. "Publicly Perform" means to perform public recitations of the Work and
to communicate to the public those public recitations, by any means or
process, including by wire or wireless means or public digital
performances; to make available to the public Works in such a way that
members of the public may access these Works from a place and at a
place individually chosen by them; to perform the Work to the public
by any means or process and the communication to the public of the
performances of the Work, including by public digital performance; to
broadcast and rebroadcast the Work by any means including signs,
sounds or images.
i. "Reproduce" means to make copies of the Work by any means including
without limitation by sound or visual recordings and the right of
fixation and reproducing fixations of the Work, including storage of a
protected performance or phonogram in digital form or other electronic
medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
limit, or restrict any uses free from copyright or rights arising from
limitations or exceptions that are provided for in connection with the
copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License,
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
perpetual (for the duration of the applicable copyright) license to
exercise the rights in the Work as stated below:
a. to Reproduce the Work, to incorporate the Work into one or more
Collections, and to Reproduce the Work as incorporated in the
Collections;
b. to create and Reproduce Adaptations provided that any such Adaptation,
including any translation in any medium, takes reasonable steps to
clearly label, demarcate or otherwise identify that changes were made
to the original Work. For example, a translation could be marked "The
original work was translated from English to Spanish," or a
modification could indicate "The original work has been modified.";
c. to Distribute and Publicly Perform the Work including as incorporated
in Collections; and,
d. to Distribute and Publicly Perform Adaptations.
e. For the avoidance of doubt:
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
which the right to collect royalties through any statutory or
compulsory licensing scheme cannot be waived, the Licensor
reserves the exclusive right to collect such royalties for any
exercise by You of the rights granted under this License;
ii. Waivable Compulsory License Schemes. In those jurisdictions in
which the right to collect royalties through any statutory or
compulsory licensing scheme can be waived, the Licensor waives the
exclusive right to collect such royalties for any exercise by You
of the rights granted under this License; and,
iii. Voluntary License Schemes. The Licensor waives the right to
collect royalties, whether individually or, in the event that the
Licensor is a member of a collecting society that administers
voluntary licensing schemes, via that society, from any exercise
by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now
known or hereafter devised. The above rights include the right to make
such modifications as are technically necessary to exercise the rights in
other media and formats. Subject to Section 8(f), all rights not expressly
granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made
subject to and limited by the following restrictions:
a. You may Distribute or Publicly Perform the Work only under the terms
of this License. You must include a copy of, or the Uniform Resource
Identifier (URI) for, this License with every copy of the Work You
Distribute or Publicly Perform. You may not offer or impose any terms
on the Work that restrict the terms of this License or the ability of
the recipient of the Work to exercise the rights granted to that
recipient under the terms of the License. You may not sublicense the
Work. You must keep intact all notices that refer to this License and
to the disclaimer of warranties with every copy of the Work You
Distribute or Publicly Perform. When You Distribute or Publicly
Perform the Work, You may not impose any effective technological
measures on the Work that restrict the ability of a recipient of the
Work from You to exercise the rights granted to that recipient under
the terms of the License. This Section 4(a) applies to the Work as
incorporated in a Collection, but this does not require the Collection
apart from the Work itself to be made subject to the terms of this
License. If You create a Collection, upon notice from any Licensor You
must, to the extent practicable, remove from the Collection any credit
as required by Section 4(b), as requested. If You create an
Adaptation, upon notice from any Licensor You must, to the extent
practicable, remove from the Adaptation any credit as required by
Section 4(b), as requested.
b. If You Distribute, or Publicly Perform the Work or any Adaptations or
Collections, You must, unless a request has been made pursuant to
Section 4(a), keep intact all copyright notices for the Work and
provide, reasonable to the medium or means You are utilizing: (i) the
name of the Original Author (or pseudonym, if applicable) if supplied,
and/or if the Original Author and/or Licensor designate another party
or parties (e.g., a sponsor institute, publishing entity, journal) for
attribution ("Attribution Parties") in Licensor's copyright notice,
terms of service or by other reasonable means, the name of such party
or parties; (ii) the title of the Work if supplied; (iii) to the
extent reasonably practicable, the URI, if any, that Licensor
specifies to be associated with the Work, unless such URI does not
refer to the copyright notice or licensing information for the Work;
and (iv) , consistent with Section 3(b), in the case of an Adaptation,
a credit identifying the use of the Work in the Adaptation (e.g.,
"French translation of the Work by Original Author," or "Screenplay
based on original Work by Original Author"). The credit required by
this Section 4 (b) may be implemented in any reasonable manner;
provided, however, that in the case of a Adaptation or Collection, at
a minimum such credit will appear, if a credit for all contributing
authors of the Adaptation or Collection appears, then as part of these
credits and in a manner at least as prominent as the credits for the
other contributing authors. For the avoidance of doubt, You may only
use the credit required by this Section for the purpose of attribution
in the manner set out above and, by exercising Your rights under this
License, You may not implicitly or explicitly assert or imply any
connection with, sponsorship or endorsement by the Original Author,
Licensor and/or Attribution Parties, as appropriate, of You or Your
use of the Work, without the separate, express prior written
permission of the Original Author, Licensor and/or Attribution
Parties.
c. Except as otherwise agreed in writing by the Licensor or as may be
otherwise permitted by applicable law, if You Reproduce, Distribute or
Publicly Perform the Work either by itself or as part of any
Adaptations or Collections, You must not distort, mutilate, modify or
take other derogatory action in relation to the Work which would be
prejudicial to the Original Author's honor or reputation. Licensor
agrees that in those jurisdictions (e.g. Japan), in which any exercise
of the right granted in Section 3(b) of this License (the right to
make Adaptations) would be deemed to be a distortion, mutilation,
modification or other derogatory action prejudicial to the Original
Author's honor and reputation, the Licensor will waive or not assert,
as appropriate, this Section, to the fullest extent permitted by the
applicable national law, to enable You to reasonably exercise Your
right under Section 3(b) of this License (right to make Adaptations)
but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate
automatically upon any breach by You of the terms of this License.
Individuals or entities who have received Adaptations or Collections
from You under this License, however, will not have their licenses
terminated provided such individuals or entities remain in full
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
survive any termination of this License.
b. Subject to the above terms and conditions, the license granted here is
perpetual (for the duration of the applicable copyright in the Work).
Notwithstanding the above, Licensor reserves the right to release the
Work under different license terms or to stop distributing the Work at
any time; provided, however that any such election will not serve to
withdraw this License (or any other license that has been, or is
required to be, granted under the terms of this License), and this
License will continue in full force and effect unless terminated as
stated above.
8. Miscellaneous
a. Each time You Distribute or Publicly Perform the Work or a Collection,
the Licensor offers to the recipient a license to the Work on the same
terms and conditions as the license granted to You under this License.
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
offers to the recipient a license to the original Work on the same
terms and conditions as the license granted to You under this License.
c. If any provision of this License is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this License, and without further action
by the parties to this agreement, such provision shall be reformed to
the minimum extent necessary to make such provision valid and
enforceable.
d. No term or provision of this License shall be deemed waived and no
breach consented to unless such waiver or consent shall be in writing
and signed by the party to be charged with such waiver or consent.
e. This License constitutes the entire agreement between the parties with
respect to the Work licensed here. There are no understandings,
agreements or representations with respect to the Work not specified
here. Licensor shall not be bound by any additional provisions that
may appear in any communication from You. This License may not be
modified without the mutual written agreement of the Licensor and You.
f. The rights granted under, and the subject matter referenced, in this
License were drafted utilizing the terminology of the Berne Convention
for the Protection of Literary and Artistic Works (as amended on
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
and the Universal Copyright Convention (as revised on July 24, 1971).
These rights and subject matter take effect in the relevant
jurisdiction in which the License terms are sought to be enforced
according to the corresponding provisions of the implementation of
those treaty provisions in the applicable national law. If the
standard suite of rights granted under applicable copyright law
includes additional rights not granted under this License, such
additional rights are deemed to be included in the License; this
License is not intended to restrict the license of any rights under
applicable law.
Creative Commons Notice
Creative Commons is not a party to this License, and makes no warranty
whatsoever in connection with the Work. Creative Commons will not be
liable to You or any party on any legal theory for any damages
whatsoever, including without limitation any general, special,
incidental or consequential damages arising in connection to this
license. Notwithstanding the foregoing two (2) sentences, if Creative
Commons has expressly identified itself as the Licensor hereunder, it
shall have all rights and obligations of Licensor.
Except for the limited purpose of indicating to the public that the
Work is licensed under the CCPL, Creative Commons does not authorize
the use by either party of the trademark "Creative Commons" or any
related trademark or logo of Creative Commons without the prior
written consent of Creative Commons. Any permitted use will be in
compliance with Creative Commons' then-current trademark usage
guidelines, as may be published on its website or otherwise made
available upon request from time to time. For the avoidance of doubt,
this trademark restriction does not form part of this License.
Creative Commons may be contacted at https://creativecommons.org/.

View File

@@ -0,0 +1,695 @@
<?xml version="1.0" encoding="UTF-8"?>
<openbox_config xmlns="http://openbox.org/3.4/rc"
xmlns:xi="http://www.w3.org/2001/XInclude">
<resistance>
<strength>10</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
<!-- always try to focus new windows when they appear. other rules do
apply -->
<followMouse>no</followMouse>
<!-- move focus to a window when you move the mouse into it -->
<focusLast>yes</focusLast>
<!-- focus the last used window when changing desktops, instead of the one
under the mouse pointer. when followMouse is enabled -->
<underMouse>no</underMouse>
<!-- move focus under the mouse, even when the mouse is not moving -->
<focusDelay>200</focusDelay>
<!-- when followMouse is enabled, the mouse must be inside the window for
this many milliseconds (1000 = 1 sec) before moving focus to it -->
<raiseOnFocus>no</raiseOnFocus>
<!-- when followMouse is enabled, and a window is given focus by moving the
mouse into it, also raise the window -->
</focus>
<placement>
<policy>Smart</policy>
<!-- 'Smart' or 'UnderMouse' -->
<center>yes</center>
<!-- whether to place windows in the center of the free area found or
the top left corner -->
<monitor>Primary</monitor>
<!-- with Smart placement on a multi-monitor system, try to place new windows
on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
the active window is, 'Primary' - only on the primary monitor -->
<primaryMonitor>1</primaryMonitor>
<!-- The monitor where Openbox should place popup dialogs such as the
focus cycling popup, or the desktop switch popup. It can be an index
from 1, specifying a particular monitor. Or it can be one of the
following: 'Mouse' - where the mouse is, or
'Active' - where the active window is -->
</placement>
<theme>
<name>Clearlooks</name>
<titleLayout>NLIMC</titleLayout>
<!--
available characters are NDSLIMC, each can occur at most once.
N: window icon
L: window label (AKA title).
I: iconify
M: maximize
C: close
S: shade (roll up/down)
D: omnipresent (on all desktops).
-->
<keepBorder>yes</keepBorder>
<animateIconify>yes</animateIconify>
<font place="ActiveWindow">
<name>sans</name>
<size>8</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="InactiveWindow">
<name>sans</name>
<size>8</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="MenuHeader">
<name>sans</name>
<size>9</size>
<!-- font size in points -->
<weight>normal</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="MenuItem">
<name>sans</name>
<size>9</size>
<!-- font size in points -->
<weight>normal</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="ActiveOnScreenDisplay">
<name>sans</name>
<size>9</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
<font place="InactiveOnScreenDisplay">
<name>sans</name>
<size>9</size>
<!-- font size in points -->
<weight>bold</weight>
<!-- 'bold' or 'normal' -->
<slant>normal</slant>
<!-- 'italic' or 'normal' -->
</font>
</theme>
<desktops>
<!-- this stuff is only used at startup, pagers allow you to change them
during a session
these are default values to use when other ones are not already set
by other applications, or saved in your session
use obconf if you want to change these without having to log out
and back in -->
<number>1</number>
<firstdesk>1</firstdesk>
<names>
<!-- set names up here if you want to, like this:
<name>desktop 1</name>
<name>desktop 2</name>
-->
</names>
<popupTime>875</popupTime>
<!-- The number of milliseconds to show the popup for when switching
desktops. Set this to 0 to disable the popup. -->
</desktops>
<resize>
<drawContents>yes</drawContents>
<popupShow>Nonpixel</popupShow>
<!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
<popupPosition>Center</popupPosition>
<!-- 'Center', 'Top', or 'Fixed' -->
<popupFixedPosition>
<!-- these are used if popupPosition is set to 'Fixed' -->
<x>10</x>
<!-- positive number for distance from left edge, negative number for
distance from right edge, or 'Center' -->
<y>10</y>
<!-- positive number for distance from top edge, negative number for
distance from bottom edge, or 'Center' -->
</popupFixedPosition>
</resize>
<!-- You can reserve a portion of your screen where windows will not cover when
they are maximized, or when they are initially placed.
Many programs reserve space automatically, but you can use this in other
cases. -->
<margins>
<top>0</top>
<bottom>0</bottom>
<left>0</left>
<right>0</right>
</margins>
<dock>
<position>TopLeft</position>
<!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
<floatingX>0</floatingX>
<floatingY>0</floatingY>
<noStrut>no</noStrut>
<stacking>Above</stacking>
<!-- 'Above', 'Normal', or 'Below' -->
<direction>Vertical</direction>
<!-- 'Vertical' or 'Horizontal' -->
<autoHide>no</autoHide>
<hideDelay>300</hideDelay>
<!-- in milliseconds (1000 = 1 second) -->
<showDelay>300</showDelay>
<!-- in milliseconds (1000 = 1 second) -->
<moveButton>Middle</moveButton>
<!-- 'Left', 'Middle', 'Right' -->
</dock>
<keyboard>
<!-- Chromium disable opening new window -->
<keybind key="C-n">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening new incognito window -->
<keybind key="C-S-n">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening new tab -->
<keybind key="C-t">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening home page -->
<keybind key="A-Home">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable back -->
<keybind key="A-Left">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable forward -->
<keybind key="A-Right">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening bookmark manager -->
<keybind key="C-S-o">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening history page -->
<keybind key="C-h">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening downloads page -->
<keybind key="C-j">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening task manager -->
<keybind key="S-Escape">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening help center -->
<keybind key="F1">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable saving current page -->
<keybind key="C-s">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable opening local file -->
<keybind key="C-o">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable display source -->
<keybind key="C-u">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable saving bookmark-->
<keybind key="C-d">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Chromium disable saving multi bookmarks -->
<keybind key="C-S-d">
<action name="Execute">
<command>true</command>
</action>
</keybind>
<!-- Enable rebooting with ctrl-alt-shift-del -->
<keybind key="C-A-S-Delete">
<action name="Execute">
<command>shutdown -P now</command>
</action>
</keybind>
<chainQuitKey>C-g</chainQuitKey>
</keyboard>
<mouse>
<dragThreshold>1</dragThreshold>
<!-- number of pixels the mouse must move before a drag begins -->
<doubleClickTime>500</doubleClickTime>
<!-- in milliseconds (1000 = 1 second) -->
<screenEdgeWarpTime>400</screenEdgeWarpTime>
<!-- Time before changing desktops when the pointer touches the edge of the
screen while moving a window, in milliseconds (1000 = 1 second).
Set this to 0 to disable warping -->
<screenEdgeWarpMouse>false</screenEdgeWarpMouse>
<!-- Set this to TRUE to move the mouse pointer across the desktop when
switching due to hitting the edge of the screen -->
<context name="Frame">
<mousebind button="A-Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="A-Left" action="Click">
<action name="Unshade"/>
</mousebind>
<mousebind button="A-Left" action="Drag">
<action name="Move"/>
</mousebind>
<mousebind button="A-Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="A-Right" action="Drag">
<action name="Resize"/>
</mousebind>
<mousebind button="A-Middle" action="Press">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="C-A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="C-A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="A-S-Up" action="Click">
<action name="SendToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="A-S-Down" action="Click">
<action name="SendToDesktop"><to>next</to></action>
</mousebind>
</context>
<context name="Titlebar">
<mousebind button="Left" action="Drag">
<action name="Move"/>
</mousebind>
<mousebind button="Left" action="DoubleClick">
<action name="ToggleMaximize"/>
</mousebind>
<mousebind button="Up" action="Click">
<action name="if">
<shaded>no</shaded>
<then>
<action name="Shade"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
<action name="Lower"/>
</then>
</action>
</mousebind>
<mousebind button="Down" action="Click">
<action name="if">
<shaded>yes</shaded>
<then>
<action name="Unshade"/>
<action name="Raise"/>
</then>
</action>
</mousebind>
</context>
<context name="Titlebar Top Right Bottom Left TLCorner TRCorner BRCorner BLCorner">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Lower"/>
<action name="FocusToBottom"/>
<action name="Unfocus"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu"><menu>client-menu</menu></action>
</mousebind>
</context>
<context name="Top">
<mousebind button="Left" action="Drag">
<action name="Resize"><edge>top</edge></action>
</mousebind>
</context>
<context name="Left">
<mousebind button="Left" action="Drag">
<action name="Resize"><edge>left</edge></action>
</mousebind>
</context>
<context name="Right">
<mousebind button="Left" action="Drag">
<action name="Resize"><edge>right</edge></action>
</mousebind>
</context>
<context name="Bottom">
<mousebind button="Left" action="Drag">
<action name="Resize"><edge>bottom</edge></action>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu"><menu>client-menu</menu></action>
</mousebind>
</context>
<context name="TRCorner BRCorner TLCorner BLCorner">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Drag">
<action name="Resize"/>
</mousebind>
</context>
<context name="Client">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
</context>
<context name="Icon">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
<action name="ShowMenu"><menu>client-menu</menu></action>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="ShowMenu"><menu>client-menu</menu></action>
</mousebind>
</context>
<context name="AllDesktops">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleOmnipresent"/>
</mousebind>
</context>
<context name="Shade">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleShade"/>
</mousebind>
</context>
<context name="Iconify">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="Iconify"/>
</mousebind>
</context>
<context name="Maximize">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Middle" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="ToggleMaximize"/>
</mousebind>
<mousebind button="Middle" action="Click">
<action name="ToggleMaximize"><direction>vertical</direction></action>
</mousebind>
<mousebind button="Right" action="Click">
<action name="ToggleMaximize"><direction>horizontal</direction></action>
</mousebind>
</context>
<context name="Close">
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
<action name="Unshade"/>
</mousebind>
<mousebind button="Left" action="Click">
<action name="Close"/>
</mousebind>
</context>
<context name="Desktop">
<mousebind button="Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="C-A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="C-A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="Left" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
<mousebind button="Right" action="Press">
<action name="Focus"/>
<action name="Raise"/>
</mousebind>
</context>
<context name="Root">
<!-- Menus -->
</context>
<context name="MoveResize">
<mousebind button="Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
<mousebind button="A-Up" action="Click">
<action name="GoToDesktop"><to>previous</to></action>
</mousebind>
<mousebind button="A-Down" action="Click">
<action name="GoToDesktop"><to>next</to></action>
</mousebind>
</context>
</mouse>
<menu>
</menu>
<applications>
<!--
# this is an example with comments through out. use these to make your
# own rules, but without the comments of course.
# you may use one or more of the name/class/role/title/type rules to specify
# windows to match
<application name="the window's _OB_APP_NAME property (see obxprop)"
class="the window's _OB_APP_CLASS property (see obxprop)"
groupname="the window's _OB_APP_GROUP_NAME property (see obxprop)"
groupclass="the window's _OB_APP_GROUP_CLASS property (see obxprop)"
role="the window's _OB_APP_ROLE property (see obxprop)"
title="the window's _OB_APP_TITLE property (see obxprop)"
type="the window's _OB_APP_TYPE property (see obxprob)..
(if unspecified, then it is 'dialog' for child windows)">
# you may set only one of name/class/role/title/type, or you may use more
# than one together to restrict your matches.
# the name, class, role, and title use simple wildcard matching such as those
# used by a shell. you can use * to match any characters and ? to match
# any single character.
# the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
# or desktop
# when multiple rules match a window, they will all be applied, in the
# order that they appear in this list
# each rule element can be left out or set to 'default' to specify to not
# change that attribute of the window
<decor>yes</decor>
# enable or disable window decorations
<shade>no</shade>
# make the window shaded when it appears, or not
<position force="no">
# the position is only used if both an x and y coordinate are provided
# (and not set to 'default')
# when force is "yes", then the window will be placed here even if it
# says you want it placed elsewhere. this is to override buggy
# applications who refuse to behave
<x>center</x>
# a number like 50, or 'center' to center on screen. use a negative number
# to start from the right (or bottom for <y>), ie -50 is 50 pixels from
# the right edge (or bottom). use 'default' to specify using value
# provided by the application, or chosen by openbox, instead.
<y>200</y>
<monitor>1</monitor>
# specifies the monitor in a xinerama setup.
# 1 is the first head, or 'mouse' for wherever the mouse is
</position>
<size>
# the size to make the window.
<width>20</width>
# a number like 20, or 'default' to use the size given by the application.
# you can use fractions such as 1/2 or percentages such as 75% in which
# case the value is relative to the size of the monitor that the window
# appears on.
<height>30%</height>
</size>
<focus>yes</focus>
# if the window should try be given focus when it appears. if this is set
# to yes it doesn't guarantee the window will be given focus. some
# restrictions may apply, but Openbox will try to
<desktop>1</desktop>
# 1 is the first desktop, 'all' for all desktops
<layer>normal</layer>
# 'above', 'normal', or 'below'
<iconic>no</iconic>
# make the window iconified when it appears, or not
<skip_pager>no</skip_pager>
# asks to not be shown in pagers
<skip_taskbar>no</skip_taskbar>
# asks to not be shown in taskbars. window cycling actions will also
# skip past such windows
<fullscreen>yes</fullscreen>
# make the window in fullscreen mode when it appears
<maximized>true</maximized>
# 'Horizontal', 'Vertical' or boolean (yes/no)
</application>
# end of the example
-->
</applications>
</openbox_config>

View File

@@ -0,0 +1,23 @@
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
/usr/bin/startx /etc/X11/Xsession /usr/local/bin/startdrs.sh -- :0

6
TODO.txt Normal file
View File

@@ -0,0 +1,6 @@
TODO
- Provide ability to change terminology for "device", "period", and
"effective" to broaden the use case for the application.
- Get Chromium to remember printer selection across reboots.

View File

@@ -2,7 +2,7 @@
/* /*
boilerplate.php boilerplate.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -52,7 +52,9 @@ $role=dblookup($drs_db,"users","id","role",$userid);
framework("begin","$appname","Boilerplate Page",$print); framework("begin","$appname","Boilerplate Page",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********

View File

@@ -3,7 +3,7 @@
/* /*
db.php db.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -1,5 +1,5 @@
OpenDRS - Online Discrepancy Reporting System OpenDRS - Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -70,3 +70,8 @@ Changelog
ownership of the installed server directory tree if the http ownership of the installed server directory tree if the http
user and group names were left at the default. user and group names were left at the default.
- Updated and tested to support Raspberry Pi 4B hardware. - Updated and tested to support Raspberry Pi 4B hardware.
1.2.0 - 2021-05-05
- Added ability to customize the terminology used for Device,
Period, and Effective/Non-effective to make OpenDRS usable in
a wider range of applications.

View File

@@ -2,7 +2,7 @@
/* /*
about.php about.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -53,7 +53,9 @@ $role=dblookup($mts_db,"users","id","role",$userid);
framework("begin","$appname","About OpenDRS",$print); framework("begin","$appname","About OpenDRS",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********

View File

@@ -2,7 +2,7 @@
/* /*
common.php common.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -26,7 +26,19 @@ if (!file_exists("db.php")) {
include("db.php"); include("db.php");
include("settings.php"); include("settings.php");
// define some constants // assign variables from constants
$device_term=DEVICE_TERM;
$discovered_term=DISCOVERED_TERM;
$discovered_term_short=DISCOVERED_TERM_SHORT;
$functional_term=FUNCTIONAL_TERM;
$functional_term_short=FUNCTIONAL_TERM_SHORT;
$disc_drop_data=DISC_DROP_DATA;
$functional_yes=FUNCTIONAL_YES;
$functional_no=FUNCTIONAL_NO;
$functional_yes_short=FUNCTIONAL_YES_SHORT;
$functional_no_short=FUNCTIONAL_NO_SHORT;
// define some other constants
define("STAT_OPEN",1); define("STAT_OPEN",1);
define("STAT_CLOSED",2); define("STAT_CLOSED",2);
define("STAT_DEFERRED",3); define("STAT_DEFERRED",3);
@@ -260,9 +272,9 @@ function framework($option,$htmltitle,$pagetitle,$print) {
$( \"#logoutall\" ).checkboxradio({ $( \"#logoutall\" ).checkboxradio({
icon: false icon: false
}); });
$( \"#device, #subsystem, #period, #period_effective, [id|='sel']\" ).selectmenu(); $( \"#device, #subsystem, #discoveredselect, #functional, [id|='sel']\" ).selectmenu();
$( \"#status, #user, #reason\" ).selectmenu(); $( \"#status, #user, #reason\" ).selectmenu();
$( \"#subsystem, #period, #searchstatus, #pass, #passconf\").tooltip(); $( \"#subsystem, #discovered, #searchstatus, #pass, #passconf\").tooltip();
$( \"[id|='ms']\").multiselect(); $( \"[id|='ms']\").multiselect();
$( \"#configtabs, #dbadmintabs, #profiletabs\" ).tabs(); $( \"#configtabs, #dbadmintabs, #profiletabs\" ).tabs();
</script> </script>
@@ -276,7 +288,6 @@ function framework($option,$htmltitle,$pagetitle,$print) {
exit(1); exit(1);
} }
} }
function pagetable($option) { function pagetable($option) {
if ($option=="begin") { if ($option=="begin") {
echo " echo "
@@ -532,17 +543,24 @@ function validate_password($pass,$passconf) {
} }
function displaywriteup($id) { function displaywriteup($id) {
// grab some important global variables
global $device_term;
global $discovered_term, $discovered_term_short, $disc_drop_data;
global $functional_term, $functional_term_short;
global $functional_yes, $functional_no;
global $functional_yes_short, $functional_no_short;
global $drs_db; global $drs_db;
$writeupdata=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from writeups where id=\"$id\"")); $writeupdata=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from writeups where id=\"$id\""));
// determine status indicator // determine status indicator
if ($writeupdata['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>"; if ($writeupdata['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>";
if ($writeupdata['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>"; if ($writeupdata['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>";
if ($writeupdata['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>"; if ($writeupdata['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>";
// determine effective icon // determine functional indicator
if($writeupdata["period_effective"]==1) { if($writeupdata["functional"]==1) {
$effind="<font color=\"#00FF00\" title=\"Period Effective\">EFF</font>"; $funcind="<font color=\"#00FF00\" title=\"$functional_yes\">$functional_yes_short</font>";
} else { } else {
$effind="<font color=\"#FF0000\" title=\"Period Non-effective\">NEF</font>"; $funcind="<font color=\"#FF0000\" title=\"$functional_no\">$functional_no_short</font>";
} }
// look up text data // look up text data
$devicename=dblookup($drs_db,"devices","id","name",$writeupdata["device"]); $devicename=dblookup($drs_db,"devices","id","name",$writeupdata["device"]);
@@ -552,8 +570,8 @@ function displaywriteup($id) {
$rdate=$writeupdata["report_date"]; $rdate=$writeupdata["report_date"];
$rtime=$writeupdata["report_time"]; $rtime=$writeupdata["report_time"];
$repby=$writeupdata["reported_by"]; $repby=$writeupdata["reported_by"];
$period=$writeupdata["period"]; $whendiscoveredname=dblookup($drs_db,"discovered","id","whendiscoveredname",$writeupdata["discovered"]);
$periodtimes=dblookup($drs_db,"periods","id","times",$period); $whendiscovereddesc=dblookup($drs_db,"discovered","id","whendiscovereddesc",$writeupdata["discovered"]);
$techfname=dblookup($drs_db,"users","id","firstname",$writeupdata["action_by"]); $techfname=dblookup($drs_db,"users","id","firstname",$writeupdata["action_by"]);
$techlname=dblookup($drs_db,"users","id","lastname",$writeupdata["action_by"]); $techlname=dblookup($drs_db,"users","id","lastname",$writeupdata["action_by"]);
$reasonname=dblookup($drs_db,"reasons","id","text",$writeupdata["action_reason"]); $reasonname=dblookup($drs_db,"reasons","id","text",$writeupdata["action_reason"]);
@@ -585,10 +603,10 @@ function displaywriteup($id) {
<table border=\"0\"> <table border=\"0\">
<tr><td><b>ID:</b> <a href=\"writeupdetail.php?id=$id\" title=\"View or change details of this writeup\">$id</a></td><td>&nbsp;&nbsp;&nbsp;</td> <tr><td><b>ID:</b> <a href=\"writeupdetail.php?id=$id\" title=\"View or change details of this writeup\">$id</a></td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>$statusind</b></td><td>&nbsp;&nbsp;&nbsp;</td> <td><b>$statusind</b></td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Device:</b> $devicename</td><td>&nbsp;&nbsp;&nbsp;</td> <td><b>$device_term:</b> $devicename</td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Subsystem:</b> <font title=\"$subsystemdesc\">$subsystemname</font></td><td>&nbsp;&nbsp;&nbsp;</td> <td><b>Subsystem:</b> <font title=\"$subsystemdesc\">$subsystemname</font></td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>Period:</b> <font title=\"$periodtimes\">$period</font></td><td>&nbsp;&nbsp;&nbsp;</td> <td><b>$discovered_term:</b> <font title=\"$whendiscovereddesc\">$whendiscoveredname</font></td><td>&nbsp;&nbsp;&nbsp;</td>
<td><b>$effind</b></td> <td><b>$funcind</b></td>
</tr> </tr>
</table> </table>
<table border=\"0\"> <table border=\"0\">
@@ -676,7 +694,14 @@ function putsetting($setting_name,$setting_value,$user_id) {
function group_table($groupid,$role=false,$mode="view",$selection="none",$expanded=false) { function group_table($groupid,$role=false,$mode="view",$selection="none",$expanded=false) {
// display a table for a single group // display a table for a single group
// grab some important global variables
global $device_term;
global $discovered_term, $discovered_term_short, $disc_drop_data;
global $functional_term, $functional_term_short;
global $functional_yes, $functional_no;
global $functional_yes_short, $functional_no_short;
global $drs_db; global $drs_db;
// print group id and name // print group id and name
if ($selection == "all") { if ($selection == "all") {
$sel_flag="checked"; $sel_flag="checked";
@@ -706,12 +731,12 @@ function group_table($groupid,$role=false,$mode="view",$selection="none",$expand
<th style=\"width:1%;\">ID</th> <th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th> <th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th> <th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th> <th style=\"width:1%;\">$discovered_term_short</th>
<th style=\"width:1%;\">Device</th> <th style=\"width:1%;\">$device_term</th>
<th style=\"width:1%;\">Subsystem</th> <th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th> <th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th> <th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th> <th style=\"width:1%;\">$functional_term_short</th>
</tr> </tr>
"; ";
} else { } else {
@@ -721,12 +746,12 @@ function group_table($groupid,$role=false,$mode="view",$selection="none",$expand
<th style=\"width:1%;\">ID</th> <th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th> <th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th> <th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th> <th style=\"width:1%;\">$discovered_term_short</th>
<th style=\"width:1%;\">Device</th> <th style=\"width:1%;\">$device_term</th>
<th style=\"width:1%;\">Subsystem</th> <th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th> <th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th> <th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th> <th style=\"width:1%;\">$functional_term_short</th>
</tr> </tr>
"; ";
} }
@@ -744,13 +769,14 @@ function group_table($groupid,$role=false,$mode="view",$selection="none",$expand
if ($writeupdata['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>"; if ($writeupdata['status']==1) $statusind="<font color=\"#FF0000\"><div title=\"Open\">OPEN</div></font>";
if ($writeupdata['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>"; if ($writeupdata['status']==2) $statusind="<font color=\"#00FF00\"><div title=\"Closed\">CLSD</div></font>";
if ($writeupdata['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>"; if ($writeupdata['status']==3) $statusind="<font color=\"#FFFF00\"><div title=\"Deferred\">DFRD</div></font>";
// determine times for period // determine whendiscovered text for discovered id
$ptimes=mysqli_fetch_row(mysqli_query($drs_db,"select times from periods where id=\"{$writeupdata['period']}\""))[0]; $whendiscname=mysqli_fetch_row(mysqli_query($drs_db,"select whendiscoveredname from discovered where id=\"{$writeupdata['discovered']}\""))[0];
// determine effective icon $whendiscdesc=mysqli_fetch_row(mysqli_query($drs_db,"select whendiscovereddesc from discovered where id=\"{$writeupdata['discovered']}\""))[0];
if($writeupdata["period_effective"]==1) { // determine functional icon
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">"; if($writeupdata["functional"]==1) {
$func_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"$functional_yes\" alt=\"$functional_yes_short\">";
} else { } else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">"; $func_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"$functional_no\" alt=\"$functional_no_short\">";
} }
// print table row // print table row
if ($role && $mode=="select") { if ($role && $mode=="select") {
@@ -771,12 +797,12 @@ function group_table($groupid,$role=false,$mode="view",$selection="none",$expand
$writeupdata["id"],$writeupdata["id"], $writeupdata["id"],$writeupdata["id"],
$statusind, $statusind,
$writeupdata["report_date"], $writeupdata["report_date"],
$ptimes, $writeupdata["period"], $whendiscdesc, $whendiscname,
$tname, $tname,
$ssname, $ssname,
$writeupdata["reported_by"], $writeupdata["reported_by"],
$writeupdata["discrepancy_text"], $writeupdata["discrepancy_text"],
$eff_icon $func_icon
); );
} else { } else {
printf( printf(
@@ -794,12 +820,12 @@ function group_table($groupid,$role=false,$mode="view",$selection="none",$expand
$writeupdata["id"],$writeupdata["id"], $writeupdata["id"],$writeupdata["id"],
$statusind, $statusind,
$writeupdata["report_date"], $writeupdata["report_date"],
$ptimes, $writeupdata["period"], $whendiscdesc, $whendiscname,
$tname, $tname,
$ssname, $ssname,
$writeupdata["reported_by"], $writeupdata["reported_by"],
$writeupdata["discrepancy_text"], $writeupdata["discrepancy_text"],
$eff_icon $func_icon
); );
} }
} }
@@ -807,4 +833,5 @@ function group_table($groupid,$role=false,$mode="view",$selection="none",$expand
} }
?> ?>

View File

@@ -2,7 +2,7 @@
/* /*
config.php config.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -45,7 +45,17 @@ $update_display=$incoming['update_display'];
$display_appname=$incoming['display_appname']; $display_appname=$incoming['display_appname'];
$display_banner=$incoming['display_banner']; $display_banner=$incoming['display_banner'];
$display_footer=$incoming['display_footer']; $display_footer=$incoming['display_footer'];
$display_pereffhlp=$incoming['display_pereffhlp']; $display_funchelp=$incoming['display_funchelp'];
$display_device_term=$incoming['display_device_term'];
$display_discovered_term=$incoming['display_discovered_term'];
$display_discovered_term_short=$incoming['display_discovered_term_short'];
$display_disc_drop_data=$incoming['display_disc_drop_data'];
$display_functional_term=$incoming['display_functional_term'];
$display_functional_term_short=$incoming['display_functional_term_short'];
$display_functional_yes=$incoming['display_functional_yes'];
$display_functional_no=$incoming['display_functional_no'];
$display_functional_yes_short=$incoming['display_functional_yes_short'];
$display_functional_no_short=$incoming['display_functional_no_short'];
$update_colors=$incoming['update_colors']; $update_colors=$incoming['update_colors'];
$reset_colors=$incoming['reset_colors']; $reset_colors=$incoming['reset_colors'];
@@ -81,7 +91,9 @@ if ($print=="Printer Friendly") {
framework("begin","$appname","Configuration",$print); framework("begin","$appname","Configuration",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********
@@ -92,14 +104,52 @@ if ($update_display) {
// remove html tags from app name and sanitize // remove html tags from app name and sanitize
$display_appname=strip_tags($display_appname); $display_appname=strip_tags($display_appname);
$clean_display_appname=mysqli_real_escape_string($drs_db,$display_appname); $clean_display_appname=mysqli_real_escape_string($drs_db,$display_appname);
// remove html tags from period effective help text and sanitize // remove html tags from functional help text and sanitize
$display_pereffhlp=strip_tags($display_pereffhlp); $display_funchelp=strip_tags($display_funchelp);
$clean_display_pereffhlp=mysqli_real_escape_string($drs_db,$display_pereffhlp); $clean_display_funchelp=mysqli_real_escape_string($drs_db,$display_funchelp);
// remove html tags from device term and sanitize
$display_device_term=strip_tags($display_device_term);
$clean_display_device_term=mysqli_real_escape_string($drs_db,$display_device_term);
// remove html tags from discovered term and sanitize
$display_discovered_term=strip_tags($display_discovered_term);
$clean_display_discovered_term=mysqli_real_escape_string($drs_db,$display_discovered_term);
// remove html tags from short discovered term and sanitize
$display_discovered_term_short=strip_tags($display_discovered_term_short);
$clean_display_discovered_term_short=mysqli_real_escape_string($drs_db,$display_discovered_term_short);
// remove html tags from functional term and sanitize
$display_functional_term=strip_tags($display_functional_term);
$clean_display_functional_term=mysqli_real_escape_string($drs_db,$display_functional_term);
// remove html tags from short functional term and sanitize
$display_functional_term_short=strip_tags($display_functional_term_short);
$clean_display_functional_term_short=mysqli_real_escape_string($drs_db,$display_functional_term_short);
// remove html tags from functional yes and sanitize
$display_functional_yes=strip_tags($display_functional_yes);
$clean_display_functional_yes=mysqli_real_escape_string($drs_db,$display_functional_yes);
// remove html tags from functional no and sanitize
$display_functional_no=strip_tags($display_functional_no);
$clean_display_functional_no=mysqli_real_escape_string($drs_db,$display_functional_no);
// remove html tags from short functional yes and sanitize
$display_functional_yes_short=strip_tags($display_functional_yes_short);
$clean_display_functional_yes_short=mysqli_real_escape_string($drs_db,$display_functional_yes_short);
// remove html tags from short functional no and sanitize
$display_functional_no_short=strip_tags($display_functional_no_short);
$clean_display_functional_no_short=mysqli_real_escape_string($drs_db,$display_functional_no_short);
mysqli_query($drs_db,"update config set value=\"$clean_display_appname\" where name=\"app_name\""); mysqli_query($drs_db,"update config set value=\"$clean_display_appname\" where name=\"app_name\"");
mysqli_query($drs_db,"update config set value=\"$display_banner\" where name=\"banner\""); mysqli_query($drs_db,"update config set value=\"$display_banner\" where name=\"banner\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_footer\" where name=\"footer_message\""); mysqli_query($drs_db,"update config set value=\"$clean_display_footer\" where name=\"footer_message\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_pereffhlp\" where name=\"period_eff_help_txt\""); mysqli_query($drs_db,"update config set value=\"$clean_display_funchelp\" where name=\"functional_help_txt\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_device_term\" where name=\"device_term\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_discovered_term\" where name=\"discovered_term\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_discovered_term_short\" where name=\"discovered_term_short\"");
mysqli_query($drs_db,"update config set value=\"$display_disc_drop_data\" where name=\"disc_drop_data\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_term\" where name=\"functional_term\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_term_short\" where name=\"functional_term_short\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_yes\" where name=\"functional_yes\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_no\" where name=\"functional_no\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_yes_short\" where name=\"functional_yes_short\"");
mysqli_query($drs_db,"update config set value=\"$clean_display_functional_no_short\" where name=\"functional_no_short\"");
echo "<meta http-equiv='refresh' content='0'>"; echo "<meta http-equiv='refresh' content='0'>";
} }
@@ -239,7 +289,18 @@ echo "
$curapn=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"app_name\""))[0]; $curapn=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"app_name\""))[0];
$curbnr=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"banner\""))[0]; $curbnr=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"banner\""))[0];
$curftr=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"footer_message\""))[0]; $curftr=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"footer_message\""))[0];
$curpereffhlp=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"period_eff_help_txt\""))[0]; $curfunchelp=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"functional_help_txt\""))[0];
$curdscterm=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"discovered_term\""))[0];
$curdscterms=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"discovered_term_short\""))[0];
$curdiscdropdata=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"disc_drop_data\""))[0];
$curfuncterm=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"functional_term\""))[0];
$curfuncterms=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"functional_term_short\""))[0];
$curfuncyes=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"functional_yes\""))[0];
$curfuncno=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"functional_no\""))[0];
$curfuncyess=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"functional_yes_short\""))[0];
$curfuncnos=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"functional_no_short\""))[0];
$curdevterm=mysqli_fetch_row(mysqli_query($drs_db,"select value from config where name=\"device_term\""))[0];
echo " echo "
<font size=\"+1\"><b>Display Configuration Parameters</b></font><br><br><br><br> <font size=\"+1\"><b>Display Configuration Parameters</b></font><br><br><br><br>
"; ";
@@ -259,12 +320,37 @@ while ($bannerrow=mysqli_fetch_assoc($bannerqry)) {
printf("<option value=\"%s\">%s</option>",$bannerrow["bannerid"],$bannerrow["bannername"]); printf("<option value=\"%s\">%s</option>",$bannerrow["bannerid"],$bannerrow["bannername"]);
} }
} }
$dropnamestate=$dropdescstate="";
if($curdiscdropdata=="Name") $dropnamestate="checked";
if($curdiscdropdata=="Desc") $dropdescstate="checked";
echo " echo "
</select><br><br><br> </select><br><br><br>
Footer Message (will appear at the bottom of pages):<br> Footer Message (will appear at the bottom of pages):<br>
<input type=\"text\" name=\"display_footer\" size=\"80\" value=\"$curftr\"><br><br><br> <input type=\"text\" name=\"display_footer\" size=\"80\" value=\"$curftr\"><br><br><br>
Period Effective Help Text :<br> Device Terminology :&nbsp;&nbsp;&nbsp;
<textarea rows=\"4\" cols=\"80\" name=\"display_pereffhlp\" wrap=\"soft\">$curpereffhlp</textarea><br><br><br><br> <input type=\"text\" name=\"display_device_term\" size=\"10\" value=\"$curdevterm\"><br><br><br>
When Discovered Terminology :&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"display_discovered_term\" size=\"20\" value=\"$curdscterm\"><br><br><br>
Short When Discovered Terminology (shown where space is limited, like table headers) :<br>
<input type=\"text\" name=\"display_discovered_term_short\" size=\"9\" value=\"$curdscterms\"><br><br><br>
When Discovered data to show in dropdowns:&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"display_disc_drop_data\" value=\"Name\" $dropnamestate> Name &nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"radio\" name=\"display_disc_drop_data\" value=\"Desc\" $dropdescstate> Description<br><br><br>
Functional Terminology :&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"display_functional_term\" size=\"20\" value=\"$curfuncterm\"><br><br><br>
Short Functional Terminology (shown where space is limited, like table headers) :<br>
<input type=\"text\" name=\"display_functional_term_short\" size=\"4\" value=\"$curfuncterms\"><br><br><br>
Functional Yes Terminology :&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"display_functional_yes\" size=\"20\" value=\"$curfuncyes\"><br><br><br>
Functional No Terminology :&nbsp;&nbsp;&nbsp;
<input type=\"text\" name=\"display_functional_no\" size=\"20\" value=\"$curfuncno\"><br><br><br>
Short Functional Yes Terminology (shown where space is limited, like table headers) :<br>
<input type=\"text\" name=\"display_functional_yes_short\" size=\"4\" value=\"$curfuncyess\"><br><br><br>
Short Functional No Terminology (shown where space is limited, like table headers) :<br>
<input type=\"text\" name=\"display_functional_no_short\" size=\"4\" value=\"$curfuncnos\"><br><br><br>
Functional Help Text :<br>
<textarea rows=\"4\" cols=\"80\" name=\"display_funchelp\" wrap=\"soft\">$curfunchelp</textarea><br><br><br><br>
<input type=\"submit\" name=\"update_display\" value=\"Update Options\">&nbsp;&nbsp;&nbsp;&nbsp; <input type=\"submit\" name=\"update_display\" value=\"Update Options\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"reset\" value=\"Reset\"><br><br><br> <input type=\"submit\" name=\"reset\" value=\"Reset\"><br><br><br>
</form> </form>

View File

@@ -2,7 +2,7 @@
/* /*
create.php create.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -34,8 +34,8 @@ if ($print) {
// load variables from incoming array // load variables from incoming array
$create=$incoming['create']; $create=$incoming['create'];
$device=$incoming['device']; $device=$incoming['device'];
$period=$incoming['period']; $discovered=$incoming['discovered'];
$period_effective=$incoming['period_effective']; $functional=$incoming['functional'];
$reported_by=$incoming['reported_by']; $reported_by=$incoming['reported_by'];
$report_date=$incoming['report_date']; $report_date=$incoming['report_date'];
$report_time=$incoming['report_time']; $report_time=$incoming['report_time'];
@@ -56,7 +56,9 @@ $role=dblookup($drs_db,"persons","id","role",$personid);
framework("begin","$appname","New Writeup",$print); framework("begin","$appname","New Writeup",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********
@@ -69,7 +71,7 @@ if (!$report_time || $report_time=="automatic") $report_time=$now;
if ($create) { if ($create) {
// add the entry if create is pressed // add the entry if create is pressed
if ($discrepancy_text && $reported_by && $device && $subsystem && $period) { if ($discrepancy_text && $reported_by && $device && $subsystem && $discovered) {
// sanitize and fix blank date and time // sanitize and fix blank date and time
$report_date=mysqli_real_escape_string($drs_db,$report_date); $report_date=mysqli_real_escape_string($drs_db,$report_date);
$report_time=mysqli_real_escape_string($drs_db,$report_time); $report_time=mysqli_real_escape_string($drs_db,$report_time);
@@ -82,8 +84,8 @@ if ($create) {
$clean_reported_by=mysqli_real_escape_string($drs_db,$reported_by); $clean_reported_by=mysqli_real_escape_string($drs_db,$reported_by);
// add the record to writeups // add the record to writeups
mysqli_query($drs_db,"insert into writeups(device,period,period_effective,reported_by,report_date,report_time,subsystem,discrepancy_text,status) mysqli_query($drs_db,"insert into writeups(device,discovered,functional,reported_by,report_date,report_time,subsystem,discrepancy_text,status)
values (\"$device\",\"$period\",\"$period_effective\",\"$clean_reported_by\",\"$report_date\",\"$report_time\",\"$subsystem\",\"$clean_discrepancy_text\",\"$status\")"); values (\"$device\",\"$discovered\",\"$functional\",\"$clean_reported_by\",\"$report_date\",\"$report_time\",\"$subsystem\",\"$clean_discrepancy_text\",\"$status\")");
} }
} }
@@ -105,15 +107,15 @@ if ($create) {
$preserve=FALSE; $preserve=FALSE;
} }
if (!$device) { if (!$device) {
format_message(1,"You didn't select a device. Please try again."); format_message(1,"You didn't select a $device_term. Please try again.");
$preserve=TRUE; $preserve=TRUE;
} }
if (!$subsystem) { if (!$subsystem) {
format_message(1,"You didn't select a subsystem. Please try again."); format_message(1,"You didn't select a subsystem. Please try again.");
$preserve=TRUE; $preserve=TRUE;
} }
if (!$period) { if (!$discovered) {
format_message(1,"You didn't select a period. Please try again."); format_message(1,"You didn't select a $discovered_term. Please try again.");
$preserve=TRUE; $preserve=TRUE;
} }
if (!$discrepancy_text) { if (!$discrepancy_text) {
@@ -140,7 +142,7 @@ if ($status==3) $statusind="<b><font color=\"#FFFF00\">DFRD</font></b>";
echo " echo "
<table border=\"0\" cellpadding=\"5\"> <table border=\"0\" cellpadding=\"5\">
<tr> <tr>
<td align=\"left\">Device<br> <td align=\"left\">$device_term<br>
<select name=\"device\" id=\"device\"> <select name=\"device\" id=\"device\">
<option value=\"\">Please select...</option> <option value=\"\">Please select...</option>
"; ";
@@ -170,16 +172,23 @@ echo "
</select></td><td></td> </select></td><td></td>
</tr> </tr>
<tr> <tr>
<td align=\"left\">Period<br> <td align=\"left\">$discovered_term<br>
<select name=\"period\" id=\"period\"> <select name=\"discovered\" id=\"discoveredselect\">
<option value=\"\">Please select...</option> <option value=\"\">Please select...</option>
"; ";
$prow=mysqli_query($drs_db,"select * from periods where active is true order by times asc"); if ($disc_drop_data=="Name") {
while ($pitem=mysqli_fetch_assoc($prow)) { $discddtitle="whendiscovereddesc";
if ($period==$pitem["id"] && $preserve) { $discddtext="whendiscoveredname";
printf("<option value=\"%s\" title=\"Period %s\" selected>%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]); } else if ($disc_drop_data=="Desc") {
$discddtitle="whendiscoveredname";
$discddtext="whendiscovereddesc";
}
$drow=mysqli_query($drs_db,"select * from discovered where active is true order by whendiscoveredname asc");
while ($ditem=mysqli_fetch_assoc($drow)) {
if ($discoverd==$ditem["id"] && $preserve) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$ditem["id"],$ditem["$discddtitle"],$ditem["$discddtext"]);
} else { } else {
printf("<option value=\"%s\" title=\"Period %s\">%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]); printf("<option value=\"%s\" title=\"%s\">%s</option>",$ditem["id"],$ditem["$discddtitle"],$ditem["$discddtext"]);
} }
} }
@@ -190,12 +199,12 @@ if (!$preserve) {
$reported_by=""; $reported_by="";
} }
$effstate=$nefstate=""; $funcyesstate=$funcnostate="";
if ($preserve) { if ($preserve) {
if($period_effective==1) $effstate="checked"; if($functional==1) $funcyesstate="checked";
if($period_effective==0) $nefstate="checked"; if($functional==0) $funcnostate="checked";
} else { } else {
$effstate="checked"; $funcyesstate="checked";
} }
echo " echo "
@@ -213,9 +222,9 @@ Discrepancy <font size=\"-2\">(required)</font><br>
<tr> <tr>
<td>Reported by <font size=\"-2\">(required)</font><br> <td>Reported by <font size=\"-2\">(required)</font><br>
<input type=\"text\" name=\"reported_by\" size=\"30\" value=\"$reported_by\" title=\"Who to contact with questions about this writeup\"></td> <input type=\"text\" name=\"reported_by\" size=\"30\" value=\"$reported_by\" title=\"Who to contact with questions about this writeup\"></td>
<td>Period effective? &nbsp; <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br> <td>$functional_term? &nbsp; <img src=\"icons/question.png\" title=\"" . FUNCTIONAL_HELP_TXT . "\"><br>
<input type=\"radio\" name=\"period_effective\" value=\"1\" $effstate> Yes &nbsp;&nbsp;&nbsp;&nbsp; <input type=\"radio\" name=\"functional\" value=\"1\" $funcyesstate> Yes &nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"radio\" name=\"period_effective\" value=\"0\" $nefstate> No <input type=\"radio\" name=\"functional\" value=\"0\" $funcnostate> No
</td> </td>
<td align=\"right\" valign=\"bottom\"><input type=\"submit\" name=\"create\" value=\"Submit Writeup\" id=\"createbutton\"></td> <td align=\"right\" valign=\"bottom\"><input type=\"submit\" name=\"create\" value=\"Submit Writeup\" id=\"createbutton\"></td>
</tr> </tr>

View File

@@ -2,7 +2,7 @@
/* /*
dbadmin.php dbadmin.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -79,13 +79,14 @@ $reason_id=$incoming['reason_id'];
$reason_text=$incoming['reason_text']; $reason_text=$incoming['reason_text'];
$reason_active=$incoming['reason_active']; $reason_active=$incoming['reason_active'];
$edit_period=$incoming['edit_period']; $edit_discovered=$incoming['edit_discovered'];
$add_period=$incoming['add_period']; $add_discovered=$incoming['add_discovered'];
$update_period=$incoming['update_period']; $update_discovered=$incoming['update_discovered'];
$delete_period=$incoming['delete_period']; $delete_discovered=$incoming['delete_discovered'];
$period_id=$incoming['period_id']; $discovered_id=$incoming['discovered_id'];
$period_times=$incoming['period_times']; $discovered_name=$incoming['discovered_name'];
$period_active=$incoming['period_active']; $discovered_desc=$incoming['discovered_desc'];
$discovered_active=$incoming['discovered_active'];
// define local functions // define local functions
@@ -101,7 +102,9 @@ if ($print=="Printer Friendly") {
framework("begin","$appname","Database Administration",$print); framework("begin","$appname","Database Administration",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********
@@ -526,102 +529,118 @@ if ($edit_reason) {
} }
} }
// periods----------------------------------- // when discovered-----------------------------------
if ($add_period) { if ($add_discovered) {
// do error checking // do error checking
// remove html tags from id and times // remove html tags from name and description
$period_id=strip_tags($period_id); $discovered_name=strip_tags($discovered_name);
$period_times=strip_tags($period_times); $discovered_desc=strip_tags($discovered_desc);
// test for id supplied // test for name supplied
if (strlen(trim($period_id))) { if (strlen(trim($discovered_name))) {
$peridsuppld=true; $discnamesuppld=true;
} else { } else {
$peridsuppld=false; $discnamesuppld=false;
$peridsuppld_err=true; $discnamesuppld_err=true;
} }
// test for id is integer // test for name unique
if (preg_match('/^[0-9]+$/',$period_id)) { if (mysqli_num_rows(mysqli_query($drs_db,"select id from discovered where whendiscoveredname=\"$discovered_name\""))) {
$peridisint=true; $discnameunique=false;
$discnameunique_err=true;
} else { } else {
$peridisint=false; $discnameunique=true;
$peridisint_err=true;
} }
// test for id unique // test for description supplied
if (mysqli_num_rows(mysqli_query($drs_db,"select id from periods where id=\"$period_id\""))) { if (strlen(trim($discovered_desc))) {
$peridunique=false; $discdescsuppld=true;
$peridunique_err=true;
} else { } else {
$peridunique=true; $discdescsuppld=false;
$discdescsuppld_err=true;
} }
// test for times supplied // test for description unique
if (strlen(trim($period_times))) { if (mysqli_num_rows(mysqli_query($drs_db,"select id from description where whendiscovereddesc =\"$discovered_desc\""))) {
$pertimessuppld=true; $discdescunique=false;
$discdescunique_err=true;
} else { } else {
$pertimessuppld=false; $discdescunique=true;
$pertimessuppld_err=true;
}
// test for times unique
if (mysqli_num_rows(mysqli_query($drs_db,"select id from periods where times=\"$period_times\""))) {
$pertimesunique=false;
$pertimesunique_err=true;
} else {
$pertimesunique=true;
} }
// set active status // set active status
if (!$period_active) $period_active=0; if (!$discovered_active) $discovered_active=0;
if ($pertimessuppld && $pertimesunique && $peridsuppld && $peridunique && $peridisint) { if ($discnamesuppld && $discnameunique && $discdescsuppld) {
// sanitize times // sanitize name
$clean_pertimes=mysqli_real_escape_string($drs_db,$period_times); $clean_discovered_name=mysqli_real_escape_string($drs_db,$discovered_name);
// sanitize description
$clean_discovered_desc=mysqli_real_escape_string($drs_db,$discovered_desc);
// modify the table // modify the table
mysqli_query($drs_db,"insert into periods(id,times,active) values(\"$period_id\",\"$clean_pertimes\",\"$period_active\")"); mysqli_query($drs_db,"insert into discovered(whendiscoveredname,whendiscovereddesc,active) values(\"$clean_discovered_name\",\"$clean_discovered_desc\",\"$discovered_active\")");
} else { } else {
$period_add_fail=true; $discovered_add_fail=true;
} }
} }
if ($edit_period) { if ($edit_discovered) {
if ($delete_period) { if ($delete_discovered) {
// check for writeups with this period // check for writeups with this when discovered
if (mysqli_num_rows(mysqli_query($drs_db,"select id from writeups where period=\"$period_id\""))) { if (mysqli_num_rows(mysqli_query($drs_db,"select id from writeups where discovered=\"$discovered_id\""))) {
$perhaswriteups=true; $dischaswriteups=true;
$perhaswriteups_err=true; $dischaswriteups_err=true;
} else { } else {
$perhaswriteups=false; $dischaswriteups=false;
} }
// if none, then remove from db // if none, then remove from db
if (!$perhaswriteups) mysqli_query($drs_db,"delete from periods where id=\"$period_id\""); if (!$dischaswriteups) mysqli_query($drs_db,"delete from discovered where id=\"$discovered_id\"");
} }
if ($update_period) { if ($update_discovered) {
// do error checking // do error checking
// remove html tags from times // remove html tags from name and description
$period_times=strip_tags($period_times); $discovered_name=strip_tags($discovered_name);
// test for times supplied $discovered_desc=strip_tags($discovered_desc);
if (strlen(trim($period_times))) { // test for name supplied
$pertimessuppld=true; if (strlen(trim($discovered_name))) {
$discnamesuppld=true;
} else { } else {
$pertimessuppld=false; $discnamesuppld=false;
$pertimessuppld_err=true; $discnamesuppld_err=true;
} }
// test for period times unique // test for name unique
if (mysqli_num_rows(mysqli_query($drs_db,"select id from periods where times=\"$period_times\" and id!=\"$period_id\""))) { if (mysqli_num_rows(mysqli_query($drs_db,"select id from discovered where whendiscoveredname=\"$discovered_name\" and id!=\"$discovered_id\""))) {
if (mysqli_num_rows(mysqli_query($drs_db,"select id from periods where times=\"$period_times\""))) { if (mysqli_num_rows(mysqli_query($drs_db,"select id from discovered where whendiscoveredname=\"$discovered_name\""))) {
$pertimesunique=false; $discnameunique=false;
$pertimesunique_err=true; $discnameunique_err=true;
} else { } else {
$pertimesunique=true; $discnameunique=true;
} }
} else { } else {
$pertimesunique=true; $discnameunique=true;
}
// test for description supplied
if (strlen(trim($discovered_desc))) {
$discdescsuppld=true;
} else {
$discdescsuppld=false;
$discdescsuppld_err=true;
}
// test for description unique
if (mysqli_num_rows(mysqli_query($drs_db,"select id from discovered where whendiscovereddesc=\"$discovered_text\" and id!=\"$discovered_id\""))) {
if (mysqli_num_rows(mysqli_query($drs_db,"select id from discovered where whendiscovereddesc =\"$discovered_desc\""))) {
$discdescunique=false;
$discdescunique_err=true;
} else {
$discdescunique=true;
}
} else {
$discdescunique=true;
} }
// set active status // set active status
if (!$period_active) $period_active=0; if (!$discovered_active) $discovered_active=0;
// sanitize times // sanitize name
$clean_pertimes=mysqli_real_escape_string($drs_db,$period_times); $clean_discovered_name=mysqli_real_escape_string($drs_db,$discovered_name);
$updqry="update periods set times=\"$clean_pertimes\",active=\"$period_active\" where id=\"$period_id\""; // sanitize description
if ($pertimessuppld && $pertimesunique) { $clean_discovered_desc=mysqli_real_escape_string($drs_db,$discovered_desc);
$updqry="update discovered set whendiscoveredname=\"$clean_discovered_name\",whendiscovereddesc=\"$clean_discovered_desc\",active=\"$discovered_active\" where id=\"$discovered_id\"";
if ($discnamesuppld && $discnameunique && $discdescsuppld && $discdescunique) {
// modify the table // modify the table
mysqli_query($drs_db,$updqry); mysqli_query($drs_db,$updqry);
} }
@@ -646,7 +665,7 @@ echo "
<li><a href=\"#devices\">Device Management</a></li> <li><a href=\"#devices\">Device Management</a></li>
<li><a href=\"#subsystems\">Subsystem Management</a></li> <li><a href=\"#subsystems\">Subsystem Management</a></li>
<li><a href=\"#reasons\">Action Reasons Management</a></li> <li><a href=\"#reasons\">Action Reasons Management</a></li>
<li><a href=\"#periods\">Period Management</a></li> <li><a href=\"#discovered\">When Discovered Management</a></li>
</ul> </ul>
<div id=\"users\"> <div id=\"users\">
@@ -1001,53 +1020,49 @@ echo "</table>";
echo " echo "
</div> </div>
<div id=\"periods\"> <div id=\"discovered\">
"; ";
if ($peridisint_err) format_message(1,"Period number must be an integer."); if ($discnamesuppld_err) format_message(1,"When Discovered name cannot be blank.");
if ($peridsuppld_err) format_message(1,"Period number cannot be blank."); if ($discnameunique_err) format_message(1,"When Discovered name already exists.");
if ($peridunique_err) format_message(1,"Period number already exists."); if ($dischaswriteups_err) format_message(1,"When Discovered has writeups in the database and cannot be deleted.");
if ($pertimesunique_err) format_message(1,"Period already exists.");
if ($pertimessuppld_err) format_message(1,"Period times cannot be blank.");
if ($perhaswriteups_err) format_message(1,"Period has writeups in the database and cannot be deleted.");
if ($edit_period && !$delete_period) { if ($edit_discovered && !$delete_discovered) {
// set form options for editing // set form options for editing
$sectiontitle="<b><font size=\"+1\">Modify Period</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"dbadmin.php#periods\">Click here to add a new period</a><br><br>"; $sectiontitle="<b><font size=\"+1\">Modify When Discovered</font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"dbadmin.php#discovered\">Click here to add a new when discovered</a><br><br>";
$formtag="<form method=\"post\" action=\"dbadmin.php?edit_period=1#periods\">"; $formtag="<form method=\"post\" action=\"dbadmin.php?edit_discovered=1#discovered\">";
$buttontags=" $buttontags="
<input type=\"hidden\" name=\"period_id\" value=\"$period_id\"> <input type=\"hidden\" name=\"discovered_id\" value=\"$discovered_id\">
<input type=\"submit\" name=\"update_period\" value=\"Update Period\">&nbsp;&nbsp;&nbsp;&nbsp; <input type=\"submit\" name=\"update_discovered\" value=\"Update When Discovered\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"delete_period\" value=\"Delete Period\">&nbsp;&nbsp;&nbsp;&nbsp; <input type=\"submit\" name=\"delete_discovered\" value=\"Delete When Discovered\">&nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"submit\" name=\"reset\" value=\"Reset\"><br> <input type=\"submit\" name=\"reset\" value=\"Reset\"><br>
"; ";
// pull current values from database // pull current values from database
$currentvalues=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from periods where id=$period_id")); $currentvalues=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from discovered where id=$discovered_id"));
$period_times=$currentvalues["times"]; $discovered_name=$currentvalues["whendiscoveredname"];
$discovered_desc=$currentvalues["whendiscovereddesc"];
if ($currentvalues["active"]==1) { if ($currentvalues["active"]==1) {
$activetag="<input type=\"checkbox\" name=\"period_active\" value=\"1\" checked>"; $activetag="<input type=\"checkbox\" name=\"discovered_active\" value=\"1\" checked>";
} else { } else {
$activetag="<input type=\"checkbox\" name=\"period_active\" value=\"1\">"; $activetag="<input type=\"checkbox\" name=\"discovered_active\" value=\"1\">";
} }
$idtag="$period_id";
} else { } else {
// set form options for add // set form options for add
if (!$period_add_fail) unset($period_id,$period_times,$period_active); if (!$discovered_add_fail) unset($discovered_id,$discovered_name,$discovered_desc,$discovered_active);
$sectiontitle="<b><font size=\"+1\">Add New Period</font></b><br><br>"; $sectiontitle="<b><font size=\"+1\">Add New When Discovered</font></b><br><br>";
$formtag="<form method=\"post\" action=\"dbadmin.php#periods\">"; $formtag="<form method=\"post\" action=\"dbadmin.php#discovered\">";
$buttontags=" $buttontags="
<input type=\"submit\" name=\"add_period\" value=\"Add Period\"> <input type=\"submit\" name=\"add_discovered\" value=\"Add When Discovered\">
"; ";
$idtag="<input type=\"text\" name=\"period_id\" size=\"3\" value=\"$period_id\">";
// set default values // set default values
$activetag="<input type=\"checkbox\" name=\"period_active\" value=\"1\" checked>"; $activetag="<input type=\"checkbox\" name=\"discovered_active\" value=\"1\" checked>";
} }
echo " echo "
$sectiontitle $sectiontitle
$formtag $formtag
<table border=\"0\"> <table border=\"0\">
<tr><td> <tr><td>
Period Number: &nbsp;$idtag<br><br> When Discovered Name: &nbsp;<input type=\"text\" name=\"discovered_name\" size=\"8\" value=\"$discovered_name\"><br><br>
Period Times: &nbsp;<input type=\"text\" name=\"period_times\" size=\"40\" value=\"$period_times\"><br><br> When Discovered Description: &nbsp;<input type=\"text\" name=\"discovered_desc\" size=\"60\" value=\"$discovered_desc\"><br><br>
Active: &nbsp; $activetag <br><br> Active: &nbsp; $activetag <br><br>
</td></tr> </td></tr>
</table> </table>
@@ -1057,11 +1072,11 @@ $buttontags
"; ";
// show the table of entities // show the table of entities
$existingdata=mysqli_query($drs_db,"select * from periods order by id asc"); $existingdata=mysqli_query($drs_db,"select * from discovered order by id asc");
echo " echo "
<b>Existing Periods</b>&nbsp;&nbsp;&nbsp;<font size=\"-1\">Click on the Period ID to edit.</font><br><br> <b>Existing When Discovereds</b>&nbsp;&nbsp;&nbsp;<font size=\"-1\">Click on the When Disc ID to edit.</font><br><br>
<table border=\"1\"> <table border=\"1\">
<tr><th>Period ID</th><th>Period Times</th><th>Active</th></tr> <tr><th>When Disc ID</th><th>Name</th><th>Description</th><th>Active</th></tr>
"; ";
while ($tablerow=mysqli_fetch_assoc($existingdata)) { while ($tablerow=mysqli_fetch_assoc($existingdata)) {
if ($tablerow["active"]) { if ($tablerow["active"]) {
@@ -1071,12 +1086,14 @@ while ($tablerow=mysqli_fetch_assoc($existingdata)) {
} }
printf(" printf("
<tr> <tr>
<td><a href=\"dbadmin.php?edit_period=1&period_id=%s#periods\">%s</a></td> <td><a href=\"dbadmin.php?edit_discovered=1&discovered_id=%s#discovered\">%s</a></td>
<td>%s</td>
<td>%s</td> <td>%s</td>
<td align=\"center\">%s</td> <td align=\"center\">%s</td>
</tr>", </tr>",
$tablerow["id"],$tablerow["id"], $tablerow["id"],$tablerow["id"],
$tablerow["times"], $tablerow["whendiscoveredname"],
$tablerow["whendiscovereddesc"],
$activedef); $activedef);
} }
echo "</table>"; echo "</table>";

View File

@@ -2,7 +2,7 @@
/* /*
gpl.php gpl.php
OpenMTS Online Maintenance Tracking System OpenMTS Online Maintenance Tracking System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -52,7 +52,9 @@ $role=dblookup($mts_db,"users","id","role",$userid);
framework("begin","$appname","GNU General Public License",$print); framework("begin","$appname","GNU General Public License",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********

View File

@@ -2,7 +2,7 @@
/* /*
groups.php groups.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -44,14 +44,14 @@ $search=$incoming['search'];
$s_status=$incoming['s_status']; $s_status=$incoming['s_status'];
$s_device=$incoming['s_device']; $s_device=$incoming['s_device'];
$s_subsystem=$incoming['s_subsystem']; $s_subsystem=$incoming['s_subsystem'];
$s_period=$incoming['s_period']; $s_discovered=$incoming['s_discovered'];
$s_report_date_start=$incoming['s_report_date_start']; $s_report_date_start=$incoming['s_report_date_start'];
$s_report_date_end=$incoming['s_report_date_end']; $s_report_date_end=$incoming['s_report_date_end'];
$s_report_time_start=$incoming['s_report_time_start']; $s_report_time_start=$incoming['s_report_time_start'];
$s_report_time_end=$incoming['s_report_time_end']; $s_report_time_end=$incoming['s_report_time_end'];
$s_discrepancy_text=$incoming['s_discrepancy_text']; $s_discrepancy_text=$incoming['s_discrepancy_text'];
$s_reported_by=$incoming['s_reported_by']; $s_reported_by=$incoming['s_reported_by'];
$s_period_effective=$incoming['s_period_effective']; $s_functional=$incoming['s_functional'];
$edit_status=$incoming['edit_status']; $edit_status=$incoming['edit_status'];
$edit_action_by=$incoming['edit_action_by']; $edit_action_by=$incoming['edit_action_by'];
@@ -78,7 +78,9 @@ $role=dblookup($drs_db,"users","id","role",$userid);
framework("begin","$appname","Writeup Groups",$print); framework("begin","$appname","Writeup Groups",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********
@@ -205,33 +207,33 @@ if ($search) {
$query_string="{$query_string})"; $query_string="{$query_string})";
$query_string="{$query_string} and "; $query_string="{$query_string} and ";
} }
// period // discovered
if ($s_period) { if ($s_discovered) {
$query_string="{$query_string}("; $query_string="{$query_string}(";
$period_param="Periods:"; $discovered_param="{$discovered_term_short}s:";
foreach ($s_period as $per_val) { foreach ($s_discovered as $disc_val) {
$query_string="{$query_string}period=\"{$per_val}\" or "; $query_string="{$query_string}discovered=\"{$disc_val}\" or ";
$period_dsp=$per_val; $disc_dsp=$disc_val;
$period_param="{$period_param} {$period_dsp}, "; $discovered_param="{$discovered_param} {$disc_dsp}, ";
} }
$period_param=rtrim($period_param,", "); $discovered_param=rtrim($discovered_param,", ");
$num_periods=mysqli_num_rows(mysqli_query($drs_db,"select id from periods")); $num_discovereds=mysqli_num_rows(mysqli_query($drs_db,"select id from discovered"));
if (count($s_period)==$num_periods) $period_param="Periods: any"; if (count($s_discovered)==$num_discovereds) $discovered_param="{$discovered_term_short}s: any";
$query_string=rtrim($query_string," or "); $query_string=rtrim($query_string," or ");
$query_string="{$query_string})"; $query_string="{$query_string})";
$query_string="{$query_string} and "; $query_string="{$query_string} and ";
} }
// period_effective // functional
if ($s_period_effective) { if ($s_functional) {
$query_string="{$query_string}("; $query_string="{$query_string}(";
$eff_param="Period effective:"; $func_param="$functional_term:";
foreach ($s_period_effective as $eff_val) { foreach ($s_functional as $func_val) {
$query_string="{$query_string}period_effective=\"{$eff_val}\" or "; $query_string="{$query_string}functional=\"{$func_val}\" or ";
if ($eff_val=="0") $eff_dsp="<font color=\"#FF0000\">NEF</font>"; if ($func_val=="0") $func_dsp="<font color=\"#FF0000\">$functional_no_short</font>";
if ($eff_val=="1") $eff_dsp="<font color=\"#00FF00\">EFF</font>"; if ($func_val=="1") $func_dsp="<font color=\"#00FF00\">$functional_yes_short</font>";
$eff_param="{$eff_param} {$eff_dsp}, "; $func_param="{$func_param} {$func_dsp}, ";
} }
$eff_param=rtrim($eff_param,", "); $func_param=rtrim($func_param,", ");
$query_string=rtrim($query_string," or "); $query_string=rtrim($query_string," or ");
$query_string="{$query_string})"; $query_string="{$query_string})";
$query_string="{$query_string} and "; $query_string="{$query_string} and ";
@@ -416,17 +418,17 @@ if ($action=="add") {
<tr> <tr>
<td align=\"left\"> <td align=\"left\">
"; ";
// Period cell ********************** // Discovered cell **********************
echo " echo "
Period<br> $discovered_term<br>
<select name=\"s_period[]\" id=\"ms-period\" multiple title=\"If you uncheck all, then this field will not be included in the search.\"> <select name=\"s_discovered[]\" id=\"ms-discovered\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
"; ";
$prow=mysqli_query($drs_db,"select * from periods order by times asc"); $discrow=mysqli_query($drs_db,"select * from discovered order by whendiscoveredname asc");
while ($pitem=mysqli_fetch_assoc($prow)) { while ($discitem=mysqli_fetch_assoc($discrow)) {
if (!$search || in_array($pitem["id"],$s_period,true)) { if (!$search || in_array($discitem["id"],$s_discovered,true)) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]); printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$discitem["id"],$discitem["whendiscovereddesc"],$discitem["whendiscoveredname"]);
} else { } else {
printf("<option value=\"%s\" title=\"%s\">%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]); printf("<option value=\"%s\" title=\"%s\">%s</option>",$discitem["id"],$discitem["whendiscovereddesc"],$discitem["whendiscoveredname"]);
} }
} }
echo " echo "
@@ -488,21 +490,21 @@ if ($action=="add") {
</td> </td>
<td align=\"left\"> <td align=\"left\">
"; ";
// Period effective cell ************ // functional cell ************
echo " echo "
Sim period effective? &nbsp; <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br> $functional_term? &nbsp; <img src=\"icons/question.png\" title=\"" . FUNCTIONAL_HELP_TXT . "\"><br>
"; ";
if ($search) { if ($search) {
$effstate=$nefstate=""; $funcyesstate=$funcnostate="";
if (in_array("1",$s_period_effective,true)) $effstate="selected"; if (in_array("1",$s_functional,true)) $funcyesstate="selected";
if (in_array("0",$s_period_effective,true)) $nefstate="selected"; if (in_array("0",$s_functional,true)) $funcnostate="selected";
} else { } else {
$effstate=$nefstate="selected"; $funcyesstate=$funcnostate="selected";
} }
echo " echo "
<select name=\"s_period_effective[]\" id=\"ms-period_effective\" multiple title=\"If you uncheck all, then this field will not be included in the search.\"> <select name=\"s_functional[]\" id=\"ms-functional\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option value=\"1\" $effstate title=\"Training objectives were achieved\">Effective</option> <option value=\"1\" $funcyesstate>$functional_yes</option>
<option value=\"0\" $nefstate title=\"Training objectives were not achieved\">Non-effective</option> <option value=\"0\" $funcnostate>$functional_no</option>
</select> </select>
</td> </td>
"; ";
@@ -530,15 +532,15 @@ if ($action=="add") {
<th style=\"width:1%;\">Device</th> <th style=\"width:1%;\">Device</th>
<th style=\"width:1%;\">Reported by</th> <th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th> <th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th> <th style=\"width:1%;\">$functional_term_short</th>
</tr> </tr>
"; ";
while ($tablerow = mysqli_fetch_assoc($writeup_qry)) { while ($tablerow = mysqli_fetch_assoc($writeup_qry)) {
// determine effective icon // determine functional icon
if($tablerow["period_effective"]==1) { if($tablerow["functional"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">"; $func_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"$functional_yes\" alt=\"$functional_yes\">";
} else { } else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">"; $func_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"$functional_no\" alt=\"$functional_no\">";
} }
// determine status indicator // determine status indicator
@@ -586,7 +588,7 @@ if ($action=="add") {
$dname, $dname,
$tablerow["reported_by"], $tablerow["reported_by"],
$disc_txt, $disc_txt,
$eff_icon $func_icon
); );
} }
echo " echo "

View File

@@ -2,7 +2,7 @@
/* /*
login.php login.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -31,7 +31,10 @@ if ($print) {
framework("begin","$appname","Login Page",$print); framework("begin","$appname","Login Page",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming);
pagetable("begin"); pagetable("begin");
if(!$print){ if(!$print){

View File

@@ -2,7 +2,7 @@
/* /*
profile.php profile.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -74,7 +74,9 @@ if ($print=="Printer Friendly") {
framework("begin","$appname","User Profile",$print); framework("begin","$appname","User Profile",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********

View File

@@ -46,8 +46,8 @@ if ($print || $exportcsv) {
$search=$incoming['search']; $search=$incoming['search'];
$viewtype=$incoming['viewtype']; $viewtype=$incoming['viewtype'];
$s_device=$incoming['s_device']; $s_device=$incoming['s_device'];
$s_period=$incoming['s_period']; $s_discovered=$incoming['s_discovered'];
$s_period_effective=$incoming['s_period_effective']; $s_functional=$incoming['s_functional'];
$s_reported_by=$incoming['s_reported_by']; $s_reported_by=$incoming['s_reported_by'];
$s_report_date_start=$incoming['s_report_date_start']; $s_report_date_start=$incoming['s_report_date_start'];
$s_report_date_end=$incoming['s_report_date_end']; $s_report_date_end=$incoming['s_report_date_end'];
@@ -110,7 +110,7 @@ if ($search) {
// device // device
if ($s_device) { if ($s_device) {
$query_string="{$query_string}("; $query_string="{$query_string}(";
$device_param="Devices:"; $device_param="{$device_term}s:";
foreach ($s_device as $dev_val) { foreach ($s_device as $dev_val) {
$query_string="{$query_string}device=\"{$dev_val}\" or "; $query_string="{$query_string}device=\"{$dev_val}\" or ";
$device_dsp=dblookup($drs_db,"devices","id","name",$dev_val); $device_dsp=dblookup($drs_db,"devices","id","name",$dev_val);
@@ -118,7 +118,7 @@ if ($search) {
} }
$device_param=rtrim($device_param,", "); $device_param=rtrim($device_param,", ");
$num_devices=mysqli_num_rows(mysqli_query($drs_db,"select id from devices")); $num_devices=mysqli_num_rows(mysqli_query($drs_db,"select id from devices"));
if (count($s_device)==$num_devices) $device_param="Devices: any"; if (count($s_device)==$num_devices) $device_param="{$device_term}s: any";
$query_string=rtrim($query_string," or "); $query_string=rtrim($query_string," or ");
$query_string="{$query_string})"; $query_string="{$query_string})";
$query_string="{$query_string} and "; $query_string="{$query_string} and ";
@@ -149,33 +149,33 @@ if ($search) {
} else { } else {
$id_param="ID: any"; $id_param="ID: any";
} }
// period // discovered
if ($s_period) { if ($s_discovered) {
$query_string="{$query_string}("; $query_string="{$query_string}(";
$period_param="Periods:"; $discovered_param="{$discovered_term_short}:";
foreach ($s_period as $per_val) { foreach ($s_discovered as $disc_val) {
$query_string="{$query_string}period=\"{$per_val}\" or "; $query_string="{$query_string}discovered=\"{$disc_val}\" or ";
$period_dsp=$per_val; $disc_dsp=$disc_val;
$period_param="{$period_param} {$period_dsp}, "; $discovered_param="{$discovered_param} {$disc_dsp}, ";
} }
$period_param=rtrim($period_param,", "); $discovered_param=rtrim($discovered_param,", ");
$num_periods=mysqli_num_rows(mysqli_query($drs_db,"select id from periods")); $num_discovereds=mysqli_num_rows(mysqli_query($drs_db,"select id from discovered"));
if (count($s_period)==$num_periods) $period_param="Periods: any"; if (count($s_discovered)==$num_discovereds) $discovered_param="{$discovered_term_short}s: any";
$query_string=rtrim($query_string," or "); $query_string=rtrim($query_string," or ");
$query_string="{$query_string})"; $query_string="{$query_string})";
$query_string="{$query_string} and "; $query_string="{$query_string} and ";
} }
// period_effective // functional
if ($s_period_effective) { if ($s_functional) {
$query_string="{$query_string}("; $query_string="{$query_string}(";
$eff_param="Period effective:"; $func_param="$functional_term:";
foreach ($s_period_effective as $eff_val) { foreach ($s_functional as $func_val) {
$query_string="{$query_string}period_effective=\"{$eff_val}\" or "; $query_string="{$query_string}functional=\"{$func_val}\" or ";
if ($eff_val=="0") $eff_dsp="<font color=\"#FF0000\">NEF</font>"; if ($func_val=="0") $func_dsp="<font color=\"#FF0000\">$functional_no_short</font>";
if ($eff_val=="1") $eff_dsp="<font color=\"#00FF00\">EFF</font>"; if ($func_val=="1") $func_dsp="<font color=\"#00FF00\">$functional_yes_short</font>";
$eff_param="{$eff_param} {$eff_dsp}, "; $func_param="{$func_param} {$func_dsp}, ";
} }
$eff_param=rtrim($eff_param,", "); $func_param=rtrim($func_param,", ");
$query_string=rtrim($query_string," or "); $query_string=rtrim($query_string," or ");
$query_string="{$query_string})"; $query_string="{$query_string})";
$query_string="{$query_string} and "; $query_string="{$query_string} and ";
@@ -348,7 +348,7 @@ if (! $exportcsv) {
"; ";
// Device cell ********************* // Device cell *********************
echo " echo "
Device<br> $device_term<br>
<select name=\"s_device[]\" id=\"ms-device\" multiple title=\"If you uncheck all, then this field will not be included in the search.\"> <select name=\"s_device[]\" id=\"ms-device\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
"; ";
$drow=mysqli_query($drs_db,"select * from devices order by id asc"); $drow=mysqli_query($drs_db,"select * from devices order by id asc");
@@ -392,17 +392,24 @@ if (! $exportcsv) {
<tr> <tr>
<td align=\"left\"> <td align=\"left\">
"; ";
// Period cell ********************** // Discovered cell **********************
echo " echo "
Period<br> $discovered_term<br>
<select name=\"s_period[]\" id=\"ms-period\" multiple title=\"If you uncheck all, then this field will not be included in the search.\"> <select name=\"s_discovered[]\" id=\"ms-discovered\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
"; ";
$prow=mysqli_query($drs_db,"select * from periods order by times asc"); if ($disc_drop_data=="Name") {
while ($pitem=mysqli_fetch_assoc($prow)) { $discddtitle="whendiscovereddesc";
if (!$search || in_array($pitem["id"],$s_period,true)) { $discddtext="whendiscoveredname";
printf("<option value=\"%s\" title=\"Period %s\" selected>%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]); } else if ($disc_drop_data=="Desc") {
$discddtitle="whendiscoveredname";
$discddtext="whendiscovereddesc";
}
$discrow=mysqli_query($drs_db,"select * from discovered order by whendiscoveredname asc");
while ($discitem=mysqli_fetch_assoc($discrow)) {
if (!$search || in_array($discitem["id"],$s_discovered,true)) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$discitem["id"],$discitem["$discddtitle"],$discitem["$discddtext"]);
} else { } else {
printf("<option value=\"%s\" title=\"Period %s\">%s</option>",$pitem["id"],$pitem["id"],$pitem["times"]); printf("<option value=\"%s\" title=\"%s\">%s</option>",$discitem["id"],$discitem["$discddtitle"],$discitem["$discddtext"]);
} }
} }
echo " echo "
@@ -464,21 +471,21 @@ if (! $exportcsv) {
</td> </td>
<td align=\"left\"> <td align=\"left\">
"; ";
// Period effective cell ************ // functional cell ************
echo " echo "
Sim period effective? &nbsp; <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br> $functional_term? &nbsp; <img src=\"icons/question.png\" title=\"" . FUNCTIONAL_HELP_TXT . "\"><br>
"; ";
if ($search) { if ($search) {
$effstate=$nefstate=""; $funcyesstate=$funcnostate="";
if (in_array("1",$s_period_effective,true)) $effstate="selected"; if (in_array("1",$s_functional,true)) $funcyesstate="selected";
if (in_array("0",$s_period_effective,true)) $nefstate="selected"; if (in_array("0",$s_functional,true)) $funcnostate="selected";
} else { } else {
$effstate=$nefstate="selected"; $funcyesstate=$funcnostate="selected";
} }
echo " echo "
<select name=\"s_period_effective[]\" id=\"ms-period_effective\" multiple title=\"If you uncheck all, then this field will not be included in the search.\"> <select name=\"s_functional[]\" id=\"ms-functional\" multiple title=\"If you uncheck all, then this field will not be included in the search.\">
<option value=\"1\" $effstate>Effective</option> <option value=\"1\" $funcyesstate>$functional_yes</option>
<option value=\"0\" $nefstate>Non-effective</option> <option value=\"0\" $funcnostate>$functional_no</option>
</select> </select>
"; ";
// ********************************** // **********************************
@@ -611,7 +618,7 @@ if (! $exportcsv) {
} else { } else {
$summarystat="checked"; $summarystat="checked";
} }
$idsort=$statussort=$datesort=$periodsort=$devicesort=$subsyssort=$repbysort=$discrepsort=$effsort=""; $idsort=$statussort=$datesort=$discsort=$devicesort=$subsyssort=$repbysort=$discrepsort=$funcsort="";
switch ($sort) { switch ($sort) {
case "id": case "id":
$idsort="checked"; $idsort="checked";
@@ -622,8 +629,8 @@ if (! $exportcsv) {
case "report_date": case "report_date":
$datesort="checked"; $datesort="checked";
break; break;
case "period": case "discovered":
$periodsort="checked"; $discsort="checked";
break; break;
case "device": case "device":
$devicesort="checked"; $devicesort="checked";
@@ -637,8 +644,8 @@ if (! $exportcsv) {
case "discrepancy_text": case "discrepancy_text":
$discrepsort="checked"; $discrepsort="checked";
break; break;
case "period_effective": case "functional":
$effsort="checked"; $funcsort="checked";
break; break;
default: default:
$datesort="checked"; $datesort="checked";
@@ -660,12 +667,12 @@ if (! $exportcsv) {
<input type=\"radio\" $idsort name=\"sort\" value=\"id\" id=\"idview\" ><label for=\"idview\" title=\"Sort by ID.\">ID</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $idsort name=\"sort\" value=\"id\" id=\"idview\" ><label for=\"idview\" title=\"Sort by ID.\">ID</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $statussort name=\"sort\" value=\"status\" id=\"statusview\" ><label for=\"statusview\" title=\"Sort by Status.\">Status</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $statussort name=\"sort\" value=\"status\" id=\"statusview\" ><label for=\"statusview\" title=\"Sort by Status.\">Status</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $datesort name=\"sort\" value=\"report_date\" id=\"dateview\" ><label for=\"dateview\" title=\"Sort by Report Date.\">Date</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $datesort name=\"sort\" value=\"report_date\" id=\"dateview\" ><label for=\"dateview\" title=\"Sort by Report Date.\">Date</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $periodsort name=\"sort\" value=\"period\" id=\"periodview\" ><label for=\"periodview\" title=\"Sort by Period.\">Period</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $discsort name=\"sort\" value=\"discovered\" id=\"discoveredview\" ><label for=\"discoveredview\" title=\"Sort by $discovered_term.\">$discovered_term_short</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $devicesort name=\"sort\" value=\"device\" id=\"deviceview\" ><label for=\"deviceview\" title=\"Sort by Device.\">Device</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $devicesort name=\"sort\" value=\"device\" id=\"deviceview\" ><label for=\"deviceview\" title=\"Sort by $device_term.\">$device_term</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $subsyssort name=\"sort\" value=\"subsystem\" id=\"subsysview\" ><label for=\"subsysview\" title=\"Sort by Subsystem.\">Subsystem</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $subsyssort name=\"sort\" value=\"subsystem\" id=\"subsysview\" ><label for=\"subsysview\" title=\"Sort by Subsystem.\">Subsystem</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $repbysort name=\"sort\" value=\"reported_by\" id=\"repbyview\" ><label for=\"repbyview\" title=\"Sort by Reported by.\">Reported by</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $repbysort name=\"sort\" value=\"reported_by\" id=\"repbyview\" ><label for=\"repbyview\" title=\"Sort by Reported by.\">Reported by</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $discrepsort name=\"sort\" value=\"discrepancy_text\" id=\"discrepview\" ><label for=\"discrepview\" title=\"Sort by Discrepancy.\">Discrepancy</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $discrepsort name=\"sort\" value=\"discrepancy_text\" id=\"discrepview\" ><label for=\"discrepview\" title=\"Sort by Discrepancy.\">Discrepancy</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $effsort name=\"sort\" value=\"period_effective\" id=\"effview\" ><label for=\"effview\" title=\"Sort by Mission Effective.\">Msn Eff</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $funcsort name=\"sort\" value=\"functional\" id=\"funcview\" ><label for=\"funcview\" title=\"Sort by $functional_term.\">$functional_term_short</label>&nbsp;&nbsp;&nbsp;
<br>Sort Order:<br> <br>Sort Order:<br>
<input type=\"radio\" $ascsort name=\"order\" value=\"asc\" id=\"ascview\" ><label for=\"ascview\" title=\"Sort results in ascending order.\">Ascending</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $ascsort name=\"order\" value=\"asc\" id=\"ascview\" ><label for=\"ascview\" title=\"Sort results in ascending order.\">Ascending</label>&nbsp;&nbsp;&nbsp;
<input type=\"radio\" $descsort name=\"order\" value=\"desc\" id=\"descview\" ><label for=\"descview\" title=\"Sort results in descending order.\">Descending</label>&nbsp;&nbsp;&nbsp; <input type=\"radio\" $descsort name=\"order\" value=\"desc\" id=\"descview\" ><label for=\"descview\" title=\"Sort results in descending order.\">Descending</label>&nbsp;&nbsp;&nbsp;
@@ -704,7 +711,7 @@ if ($search) {
</table> </table>
<table border=\"0\"> <table border=\"0\">
<tr> <tr>
<td>$period_param</td><td>&nbsp;&nbsp;&nbsp;</td> <td>$discovered_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$reportdate_param</td><td>&nbsp;&nbsp;&nbsp;</td> <td>$reportdate_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$reporttime_param</td><td>&nbsp;&nbsp;&nbsp;</td> <td>$reporttime_param</td><td>&nbsp;&nbsp;&nbsp;</td>
</tr> </tr>
@@ -717,7 +724,7 @@ if ($search) {
<table border=\"0\"> <table border=\"0\">
<tr> <tr>
<td>$repby_param</td><td>&nbsp;&nbsp;&nbsp;</td> <td>$repby_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$eff_param</td><td>&nbsp;&nbsp;&nbsp;</td> <td>$func_param</td><td>&nbsp;&nbsp;&nbsp;</td>
<td>$group_param</td><td>&nbsp;&nbsp;&nbsp;</td> <td>$group_param</td><td>&nbsp;&nbsp;&nbsp;</td>
</tr> </tr>
</table> </table>
@@ -780,7 +787,7 @@ if ($search) {
// generate csv file // generate csv file
// create an array of lines of the csv data // create an array of lines of the csv data
$csv_data=array(); $csv_data=array();
$csv_data[]=['WriteupID','Status','Device','Subsystem','Period','Effective','Discrepancy','Group','Report date','Report time','Reported by','Action taken by','Status Change Reason','Action taken','Action date','Action time']; $csv_data[]=['WriteupID','Status',$device_term,'Subsystem',$discovered_term_short,$functional_term,'Discrepancy','Group','Report date','Report time','Reported by','Action taken by','Status Change Reason','Action taken','Action date','Action time'];
$csv_fp=fopen('php://temp', 'w+'); $csv_fp=fopen('php://temp', 'w+');
while ($tablerow = mysqli_fetch_assoc($writeup)) { while ($tablerow = mysqli_fetch_assoc($writeup)) {
@@ -799,14 +806,14 @@ if ($search) {
// convert subsystem number to name for csv // convert subsystem number to name for csv
$csv_ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]); $csv_ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]);
// period number for csv // discovered name for csv
$csv_period="{$tablerow["period"]}"; $csv_discovered=dblookup($drs_db,"discovered","id","whendiscoveredname",$tablerow["discovered"]);
// determine effective text for csv // determine functional text for csv
if($tablerow["period_effective"]==1) { if($tablerow["functional"]==1) {
$csv_eff_text="EFF"; $csv_func_text="$functional_yes_short";
} else { } else {
$csv_eff_text="NEF"; $csv_func_text="$functional_no_short";
} }
// discrepancy text for csv // discrepancy text for csv
@@ -866,7 +873,7 @@ if ($search) {
if (($show_groupmems == $show_nongroupmems) || ($is_member && $show_groupmems) || (!$is_member && $show_nongroupmems)) { if (($show_groupmems == $show_nongroupmems) || ($is_member && $show_groupmems) || (!$is_member && $show_nongroupmems)) {
// add line of results to csv array // add line of results to csv array
$csv_data[]=[$csv_id, $csv_status_text, $csv_dname, $csv_ssname, $csv_period, $csv_eff_text, $csv_disc_txt, $csv_member_group_name, $csv_report_date, $csv_report_time, $csv_reported_by_text, $csv_action_by, $csv_reasonname, $csv_action_text, $csv_action_date, $csv_action_time]; $csv_data[]=[$csv_id, $csv_status_text, $csv_dname, $csv_ssname, $csv_discovered, $csv_func_text, $csv_disc_txt, $csv_member_group_name, $csv_report_date, $csv_report_time, $csv_reported_by_text, $csv_action_by, $csv_reasonname, $csv_action_text, $csv_action_date, $csv_action_time];
} }
} }
@@ -891,12 +898,12 @@ if ($search) {
<th style=\"width:1%;\">ID</th> <th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th> <th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th> <th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th> <th style=\"width:1%;\">$discovered_term_short</th>
<th style=\"width:1%;\">Device</th> <th style=\"width:1%;\">$device_term</th>
<th style=\"width:1%;\">Subsystem</th> <th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th> <th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th> <th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th> <th style=\"width:1%;\">$functional_term_short</th>
</tr> </tr>
"; ";
while ($tablerow = mysqli_fetch_assoc($writeup)) { while ($tablerow = mysqli_fetch_assoc($writeup)) {
@@ -904,11 +911,11 @@ if ($search) {
$member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\""); $member_qry=mysqli_query($drs_db,"select linkgroup from links where writeupid=\"{$tablerow['id']}\"");
$is_member=mysqli_num_rows($member_qry); $is_member=mysqli_num_rows($member_qry);
// determine effective icon // determine functional icon
if($tablerow["period_effective"]==1) { if($tablerow["functional"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">"; $func_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"$functional_yes\" alt=\"$functional_yes_short\">";
} else { } else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">"; $func_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"$functional_no\" alt=\"$functional_no_short\">";
} }
// determine status indicator // determine status indicator
@@ -918,8 +925,10 @@ if ($search) {
// convert device number to name // convert device number to name
$dname=dblookup($drs_db,"devices","id","name",$tablerow["device"]); $dname=dblookup($drs_db,"devices","id","name",$tablerow["device"]);
// convert period number to times // convert discovered number to description
$ptimes=dblookup($drs_db,"periods","id","times",$tablerow["period"]); $discname=dblookup($drs_db,"discovered","id","whendiscoveredname",$tablerow["discovered"]);
// convert discovered number to description
$discdesc=dblookup($drs_db,"discovered","id","whendiscovereddesc",$tablerow["discovered"]);
// convert subsystem number to name // convert subsystem number to name
$ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]); $ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]);
$disc_txt="{$tablerow["discrepancy_text"]}"; $disc_txt="{$tablerow["discrepancy_text"]}";
@@ -958,12 +967,12 @@ if ($search) {
$tablerow["id"],$tablerow["id"], $tablerow["id"],$tablerow["id"],
$statusind, $statusind,
$tablerow["report_date"], $tablerow["report_date"],
$ptimes,$tablerow["period"], $discdesc,$discname,
$dname, $dname,
$ssname, $ssname,
$tablerow["reported_by"], $tablerow["reported_by"],
$disc_txt, $disc_txt,
$eff_icon $func_icon
); );
} }
} }

View File

@@ -2,7 +2,7 @@
/* /*
settings.php settings.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */

View File

@@ -2,7 +2,7 @@
/* /*
writeupdetail.php writeupdetail.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -39,8 +39,8 @@ $useredit=$incoming['useredit'];
$techedit=$incoming['techedit']; $techedit=$incoming['techedit'];
$id=$incoming['id']; $id=$incoming['id'];
$device=$incoming['device']; $device=$incoming['device'];
$period=$incoming['period']; $discovered=$incoming['discovered'];
$period_effective=$incoming['period_effective']; $functional=$incoming['functional'];
$reported_by=$incoming['reported_by']; $reported_by=$incoming['reported_by'];
$report_date=$incoming['report_date']; $report_date=$incoming['report_date'];
$report_time=$incoming['report_time']; $report_time=$incoming['report_time'];
@@ -66,6 +66,9 @@ $role=dblookup($drs_db,"users","id","role",$userid);
framework("begin","$appname","Writeup Detail",$print); framework("begin","$appname","Writeup Detail",$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);
// ******** begin database manipulation ******** // ******** begin database manipulation ********
@@ -89,7 +92,7 @@ if ($usersave) {
$clean_reported_by=mysqli_real_escape_string($drs_db,$reported_by); $clean_reported_by=mysqli_real_escape_string($drs_db,$reported_by);
// update the record in writeups // update the record in writeups
mysqli_query($drs_db,"update writeups set device=\"$device\",period=\"$period\",period_effective=\"$period_effective\",reported_by=\"$clean_reported_by\",report_date=\"$report_date\",report_time=\"$report_time\",subsystem=\"$subsystem\",discrepancy_text=\"$clean_discrepancy_text\" where id=\"$id\""); mysqli_query($drs_db,"update writeups set device=\"$device\",discovered=\"$discovered\",functional=\"$functional\",reported_by=\"$clean_reported_by\",report_date=\"$report_date\",report_time=\"$report_time\",subsystem=\"$subsystem\",discrepancy_text=\"$clean_discrepancy_text\" where id=\"$id\"");
} }
} }
elseif ($techsave) { elseif ($techsave) {
@@ -115,8 +118,8 @@ elseif ($techsave) {
// get current writeup data from database to populate fields // get current writeup data from database to populate fields
$writeupdata=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from writeups where id=\"$id\"")); $writeupdata=mysqli_fetch_assoc(mysqli_query($drs_db,"select * from writeups where id=\"$id\""));
$device=$writeupdata['device']; $device=$writeupdata['device'];
$period=$writeupdata['period']; $discovered=$writeupdata['discovered'];
$period_effective=$writeupdata['period_effective']; $functional=$writeupdata['functional'];
$reported_by=$writeupdata['reported_by']; $reported_by=$writeupdata['reported_by'];
$report_date=$writeupdata['report_date']; $report_date=$writeupdata['report_date'];
$report_time=$writeupdata['report_time']; $report_time=$writeupdata['report_time'];
@@ -195,7 +198,7 @@ echo "
<td align=\"left\">Writeup ID<br> <td align=\"left\">Writeup ID<br>
<table border=\"1\" width=\"100%\"><tr><td><center>$id</center></td></tr></table> <table border=\"1\" width=\"100%\"><tr><td><center>$id</center></td></tr></table>
</td> </td>
<td align=\"left\">Device<br> <td align=\"left\">$device_term<br>
"; ";
if ($useredit) { if ($useredit) {
echo " echo "
@@ -248,41 +251,49 @@ echo "
</td> </td>
</tr> </tr>
<tr> <tr>
<td align=\"left\">Period<br> <td align=\"left\">$discovered_term<br>
"; ";
if ($useredit) { if ($useredit) {
echo " echo "
<select name=\"period\" id=\"period\"> <select name=\"discovered\" id=\"discoveredselect\">
"; ";
$prow=mysqli_query($drs_db,"select * from periods where active is true order by times asc"); if ($disc_drop_data=="Name") {
while ($pitem=mysqli_fetch_assoc($prow)) { $discddtitle="whendiscovereddesc";
if ($period==$pitem["id"]) { $discddtext="whendiscoveredname";
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$pitem["id"],$pitem["times"],$pitem["id"]); } else if ($disc_drop_data=="Desc") {
$discddtitle="whendiscoveredname";
$discddtext="whendiscovereddesc";
}
$discrow=mysqli_query($drs_db,"select * from discovered where active is true order by whendiscoveredname asc");
while ($discitem=mysqli_fetch_assoc($discrow)) {
if ($discovered==$discitem["id"]) {
printf("<option value=\"%s\" title=\"%s\" selected>%s</option>",$discitem["id"],$discitem["$discddtitle"],$discitem["$discddtext"]);
} else { } else {
printf("<option value=\"%s\" title=\"%s\">%s</option>",$pitem["id"],$pitem["times"],$pitem["id"]); printf("<option value=\"%s\" title=\"%s\">%s</option>",$discitem["id"],$discitem["$discddtitle"],$discitem["$discddtext"]);
} }
} }
echo " echo "
</select> </select>
"; ";
} else { } else {
$pertimes=dblookup($drs_db,"periods","id","times",$period); $discname=dblookup($drs_db,"discovered","id","whendiscoveredname",$discovered);
$discdesc=dblookup($drs_db,"discovered","id","whendiscovereddesc",$discovered);
echo " echo "
<table border=\"1\" width=\"100%\"><tr><td><font title=\"$pertimes\">$period</font></td></tr></table> <table border=\"1\" width=\"100%\"><tr><td><font title=\"$discdesc\">$discname</font></td></tr></table>
"; ";
} }
echo " echo "
</td> </td>
"; ";
$effstate=$nefstate=""; $funcyesstate=$funcnostate="";
if($period_effective==1) { if($functional==1) {
$effstate="checked"; $funcyesstate="checked";
$eff_ind="Effective"; $func_ind="$functional_yes";
} }
if($period_effective==0) { if($functional==0) {
$nefstate="checked"; $funcnostate="checked";
$eff_ind="Non-Effective"; $func_ind="$functional_no";
} }
$openstate=$closedstate=$deferredstate=""; $openstate=$closedstate=$deferredstate="";
@@ -340,16 +351,16 @@ if ($useredit) {
"; ";
} }
echo " echo "
<td align=\"left\">Sim period effective? &nbsp; <img src=\"icons/question.png\" title=\"" . PERIOD_EFF_HELP_TXT . "\"><br> <td align=\"left\">$functional_term? &nbsp; <img src=\"icons/question.png\" title=\"" . FUNCTIONAL_HELP_TXT . "\"><br>
"; ";
if ($useredit) { if ($useredit) {
echo " echo "
<input type=\"radio\" name=\"period_effective\" value=\"1\" $effstate> Yes &nbsp;&nbsp;&nbsp;&nbsp; <input type=\"radio\" name=\"functional\" value=\"1\" $funcyesstate> Yes &nbsp;&nbsp;&nbsp;&nbsp;
<input type=\"radio\" name=\"period_effective\" value=\"0\" $nefstate> No <input type=\"radio\" name=\"functional\" value=\"0\" $funcnostate> No
"; ";
} else { } else {
echo " echo "
<table border=\"1\" width=\"100%\"><tr><td><font title=\"$eff_title\">$eff_ind</font></td></tr></table> <table border=\"1\" width=\"100%\"><tr><td><font title=\"" . FUNCTIONAL_HELP_TXT . "\">$func_ind</font></td></tr></table>
"; ";
} }
echo " echo "

View File

@@ -2,7 +2,7 @@
/* /*
writeups.php writeups.php
OpenDRS Online Discrepancy Reporting System OpenDRS Online Discrepancy Reporting System
Copyright (C) 2020 Rod Wright Copyright (C) 2021 Rod Wright
SPDX-License-Identifier: GPL-2.0 SPDX-License-Identifier: GPL-2.0
*/ */
@@ -52,6 +52,13 @@ $role=dblookup($drs_db,"users","id","role",$userid);
// define local functions // define local functions
function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") { function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") {
// grab some important global variables
global $device_term;
global $discovered_term, $discovered_term_short, $disc_drop_data;
global $functional_term, $functional_term_short;
global $functional_yes, $functional_no;
global $functional_yes_short, $functional_no_short;
// show date range selector // show date range selector
echo " echo "
<form method=post action=\"writeups.php\"> <form method=post action=\"writeups.php\">
@@ -71,7 +78,7 @@ function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") {
echo " echo "
</form> </form>
"; ";
$writeup=mysqli_query($drs_db,"select * from writeups where status=".STAT_OPEN." and report_date between \"$start_date\" and \"$end_date\" order by report_date desc,period desc,report_time desc"); $writeup=mysqli_query($drs_db,"select * from writeups where status=".STAT_OPEN." and report_date between \"$start_date\" and \"$end_date\" order by report_date desc,report_time desc");
if (mysqli_num_rows($writeup)) { if (mysqli_num_rows($writeup)) {
$now=date("H:i l"); $now=date("H:i l");
echo " echo "
@@ -80,20 +87,20 @@ function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") {
<tr> <tr>
<th style=\"width:1%;\">ID</th> <th style=\"width:1%;\">ID</th>
<th style=\"width:100px;\">Date</th> <th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th> <th style=\"width:1%;\">$discovered_term_short</th>
<th style=\"width:1%;\">Device</th> <th style=\"width:1%;\">$device_term</th>
<th style=\"width:1%;\">Subsystem</th> <th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th> <th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th> <th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th> <th style=\"width:1%;\">$functional_term_short</th>
</tr> </tr>
"; ";
while ($tablerow = mysqli_fetch_assoc($writeup)) { while ($tablerow = mysqli_fetch_assoc($writeup)) {
// determine effective icon // determine effective icon
if($tablerow["period_effective"]==1) { if($tablerow["functional"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">"; $funcind="<img src=\"icons/tick.png\" border=\"0\" title=\"$functional_yes\" alt=\"$functional_yes_short\">";
} else { } else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">"; $funcind="<img src=\"icons/cross.png\" border=\"0\" title=\"$functional_no\" alt=\"$functional_no_short\">";
} }
// convert device number to name // convert device number to name
@@ -102,8 +109,12 @@ function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") {
// convert subsystem number to name // convert subsystem number to name
$ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]); $ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]);
// determine times for period // convert subsystem number to description
$ptimes=mysqli_fetch_row(mysqli_query($drs_db,"select times from periods where id=\"{$tablerow['period']}\""))[0]; $ssdesc=dblookup($drs_db,"subsystems","id","description",$tablerow["subsystem"]);
// determine values for when discovered
$whendiscdesc=mysqli_fetch_row(mysqli_query($drs_db,"select whendiscovereddesc from discovered where id=\"{$tablerow['discovered']}\""))[0];
$whendiscname=mysqli_fetch_row(mysqli_query($drs_db,"select whendiscoveredname from discovered where id=\"{$tablerow['discovered']}\""))[0];
$disc_txt="{$tablerow['discrepancy_text']}"; $disc_txt="{$tablerow['discrepancy_text']}";
@@ -133,19 +144,19 @@ function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") {
<td valign=\"top\">%s</td> <td valign=\"top\">%s</td>
<td valign=\"top\"><font title=\"%s\">%s</font></td> <td valign=\"top\"><font title=\"%s\">%s</font></td>
<td valign=\"top\">%s</td> <td valign=\"top\">%s</td>
<td valign=\"top\">%s</td> <td valign=\"top\"><font title=\"%s\">%s</td>
<td valign=\"top\">%s</td> <td valign=\"top\">%s</td>
<td valign=\"top\">%s</td> <td valign=\"top\">%s</td>
<td align=\"center\" valign=\"top\">%s</td> <td align=\"center\" valign=\"top\">%s</td>
</tr>\n", </tr>\n",
$tablerow["id"],$tablerow["id"], $tablerow["id"],$tablerow["id"],
$tablerow["report_date"], $tablerow["report_date"],
$ptimes, $tablerow["period"], $whendiscdesc, $whendiscname,
$dname, $dname,
$ssname, $ssdesc, $ssname,
$tablerow["reported_by"], $tablerow["reported_by"],
$disc_txt, $disc_txt,
$eff_icon $funcind
); );
} }
echo "</table>\n"; echo "</table>\n";
@@ -164,6 +175,13 @@ function opentable($start_date,$end_date,$print,$drs_db,$viewtype="summary") {
} }
function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$role) { function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$role) {
// grab some important global variables
global $device_term;
global $discovered_term, $discovered_term_short, $disc_drop_data;
global $functional_term, $functional_term_short;
global $functional_yes, $functional_no;
global $functional_yes_short, $functional_no_short;
// show date range selector // show date range selector
$summarystat=$detailstat=""; $summarystat=$detailstat="";
if ($viewtype=="detail") { if ($viewtype=="detail") {
@@ -196,7 +214,7 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
<br><br> <br><br>
"; ";
} }
$writeup=mysqli_query($drs_db,"select * from writeups where report_date between \"$start_date\" and \"$end_date\" order by report_date desc,period desc,report_time desc"); $writeup=mysqli_query($drs_db,"select * from writeups where report_date between \"$start_date\" and \"$end_date\" order by report_date desc,report_time desc");
if (mysqli_num_rows($writeup)) { if (mysqli_num_rows($writeup)) {
$now=date("H:i l"); $now=date("H:i l");
if ($viewtype == "summary") { if ($viewtype == "summary") {
@@ -213,20 +231,20 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
<th style=\"width:1%;\">ID</th> <th style=\"width:1%;\">ID</th>
<th style=\"width:1%;\">Status</th> <th style=\"width:1%;\">Status</th>
<th style=\"width:100px;\">Date</th> <th style=\"width:100px;\">Date</th>
<th style=\"width:1%;\">Period</th> <th style=\"width:1%;\">$discovered_term_short</th>
<th style=\"width:1%;\">Device</th> <th style=\"width:1%;\">$device_term</th>
<th style=\"width:1%;\">Subsystem</th> <th style=\"width:1%;\">Subsystem</th>
<th style=\"width:1%;\">Reported by</th> <th style=\"width:1%;\">Reported by</th>
<th>Discrepancy</th> <th>Discrepancy</th>
<th style=\"width:1%;\">Msn Eff</th> <th style=\"width:1%;\">$functional_term_short</th>
</tr> </tr>
"; ";
while ($tablerow = mysqli_fetch_assoc($writeup)) { while ($tablerow = mysqli_fetch_assoc($writeup)) {
// determine effective icon // determine effective icon
if($tablerow["period_effective"]==1) { if($tablerow["functional"]==1) {
$eff_icon="<img src=\"icons/tick.png\" border=\"0\" title=\"Period Effective\" alt=\"Period Effective\">"; $funcind="<img src=\"icons/tick.png\" border=\"0\" title=\"$functional_yes\" alt=\"$functional_yes_short\">";
} else { } else {
$eff_icon="<img src=\"icons/cross.png\" border=\"0\" title=\"Period Non-effective\" alt=\"Period Non-effective\">"; $funcind="<img src=\"icons/cross.png\" border=\"0\" title=\"$functional_no\" alt=\"$functional_no_short\">";
} }
// determine status indicator // determine status indicator
@@ -240,8 +258,10 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
// convert subsystem number to name // convert subsystem number to name
$ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]); $ssname=dblookup($drs_db,"subsystems","id","name",$tablerow["subsystem"]);
// determine times for period // determine values for when discovered
$ptimes=mysqli_fetch_row(mysqli_query($drs_db,"select times from periods where id=\"{$tablerow['period']}\""))[0]; $whendiscdesc=mysqli_fetch_row(mysqli_query($drs_db,"select whendiscovereddesc from discovered where id=\"{$tablerow['discovered']}\""))[0];
$whendiscname=mysqli_fetch_row(mysqli_query($drs_db,"select whendiscoveredname from discovered where id=\"{$tablerow['discovered']}\""))[0];
$disc_txt="{$tablerow['discrepancy_text']}"; $disc_txt="{$tablerow['discrepancy_text']}";
// determine if this is a member of a group // determine if this is a member of a group
@@ -286,12 +306,12 @@ function viewtable($start_date,$end_date,$print,$drs_db,$viewtype="summary",$rol
$tablerow["id"],$tablerow["id"], $tablerow["id"],$tablerow["id"],
$statusind, $statusind,
$tablerow["report_date"], $tablerow["report_date"],
$ptimes, $tablerow["period"], $whendiscdesc, $whendiscname,
$dname, $dname,
$ssname, $ssname,
$tablerow["reported_by"], $tablerow["reported_by"],
$disc_txt, $disc_txt,
$eff_icon $funcind
); );
} }
echo "</table>\n"; echo "</table>\n";
@@ -360,7 +380,9 @@ if ($view) {
} }
framework("begin","$appname",$pgtitle,$print); framework("begin","$appname",$pgtitle,$print);
//echo "_REQUEST array <br>";
//var_dump($_REQUEST); //var_dump($_REQUEST);
//echo "<br><hr> incoming array <br>";
//var_dump($incoming); //var_dump($incoming);

View File

@@ -85,7 +85,7 @@ then
# delete all existing installation files except db.php # delete all existing installation files except db.php
find $install_path/ -mindepth 1 -not -name 'db.php' -delete find $install_path/ -mindepth 1 -not -name 'db.php' -delete
# apply database updates # apply database updates
mysql -u"$curr_username" $curr_dbname < opendrs-update.sql >/dev/null 2>&1 mysql -u"$curr_username" -f -D $curr_dbname < opendrs-update.sql >/dev/null 2>&1
# apply updates to existing db.php # apply updates to existing db.php
./opendrs-update.sh $install_path ./opendrs-update.sh $install_path
# copy distribution to install location # copy distribution to install location
@@ -158,6 +158,7 @@ else
echo "What would you like to call this installation of OpenDRS? If you accept" echo "What would you like to call this installation of OpenDRS? If you accept"
echo "the default, it will be called OpenDRS. If you will be running multiple" echo "the default, it will be called OpenDRS. If you will be running multiple"
echo "instances of OpenDRS on this server, you should choose a distinctive name." echo "instances of OpenDRS on this server, you should choose a distinctive name."
echo "This can be changed later in the application itself."
echo -n "Installation name [OpenDRS]: " echo -n "Installation name [OpenDRS]: "
read new_inst_name read new_inst_name
echo "" echo ""

View File

@@ -37,7 +37,12 @@ CREATE TABLE `banners` (
LOCK TABLES `banners` WRITE; LOCK TABLES `banners` WRITE;
/*!40000 ALTER TABLE `banners` DISABLE KEYS */; /*!40000 ALTER TABLE `banners` DISABLE KEYS */;
INSERT INTO `banners` VALUES (1,'no banner','#000000','#000000'),(2,'UNCLASSIFIED','#009900','#FFFFFF'),(3,'CONFIDENTIAL','#000099','#FFFFFF'),(4,'SECRET','#990000','#FFFFFF'),(5,'TOP SECRET','#FF6600','#FFFFFF'); INSERT INTO `banners` VALUES
(1,'no banner','#000000','#000000'),
(2,'UNCLASSIFIED','#009900','#FFFFFF'),
(3,'CONFIDENTIAL','#000099','#FFFFFF'),
(4,'SECRET','#990000','#FFFFFF'),
(5,'TOP SECRET','#FF6600','#FFFFFF');
/*!40000 ALTER TABLE `banners` ENABLE KEYS */; /*!40000 ALTER TABLE `banners` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
@@ -63,7 +68,38 @@ CREATE TABLE `config` (
LOCK TABLES `config` WRITE; LOCK TABLES `config` WRITE;
/*!40000 ALTER TABLE `config` DISABLE KEYS */; /*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES (1,'drs_version','1.1.2','1.1.2'),(5,'app_name','OpenDRS - Discrepancy Reporting System','OpenDRS Discrepancy Reporting System'),(6,'banner','1','1'),(7,'background_color','0B3144','0B3144'),(8,'p_background_color','FFFFFF','FFFFFF'),(11,'menubg_color','000000','000000'),(12,'p_menubg_color','FFFFFF','FFFFFF'),(13,'text_color','FFFFFF','FFFFFF'),(14,'p_text_color','000000','000000'),(15,'link_color','79EFEA','79EFEA'),(16,'p_link_color','000000','000000'),(17,'vlink_color','79EFEA','79EFEA'),(18,'p_vlink_color','000000','000000'),(19,'heading_color','5AE2B3','5AE2B3'),(20,'p_heading_color','000000','000000'),(21,'footer_message','Please report bugs to Rod Wright (software@rodsplace.net)','Please report bugs to Rod Wright (software@rodsplace.net)'),(26,'unix_server_session_dir','/tmp/opendrs/opendrs/sessions','/tmp/opendrs/opendrs/sessions'),(27,'win_server_session_dir','c:\\Windows\\Temp\\opendrs\\opendrs\\sessions','c:\\Windows\\Temp\\opendrs\\opendrs\\sessions'),(28,'session_ttl_days','30','30'),(29,'period_eff_help_txt','If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.','If maintenance issues prevented the training objectives from being achieved and you will have to come back and redo the same training, answer Non-effective. Otherwise, answer Effective.'); INSERT INTO `config` VALUES
(1,'drs_version','1.2.0','1.2.0'),
(5,'app_name','OpenDRS - Discrepancy Reporting System','OpenDRS Discrepancy Reporting System'),
(6,'banner','1','1'),
(7,'background_color','0B3144','0B3144'),
(8,'p_background_color','FFFFFF','FFFFFF'),
(11,'menubg_color','000000','000000'),
(12,'p_menubg_color','FFFFFF','FFFFFF'),
(13,'text_color','FFFFFF','FFFFFF'),
(14,'p_text_color','000000','000000'),
(15,'link_color','79EFEA','79EFEA'),
(16,'p_link_color','000000','000000'),
(17,'vlink_color','79EFEA','79EFEA'),
(18,'p_vlink_color','000000','000000'),
(19,'heading_color','5AE2B3','5AE2B3'),
(20,'p_heading_color','000000','000000'),
(21,'footer_message','Please report bugs to Rod Wright (software@rodsplace.net)','Please report bugs to Rod Wright (software@rodsplace.net)'),
(26,'unix_server_session_dir','/tmp/opendrs/opendrs/sessions','/tmp/opendrs/opendrs/sessions'),
(27,'win_server_session_dir','c:\\Windows\\Temp\\opendrs\\opendrs\\sessions','c:\\Windows\\Temp\\opendrs\\opendrs\\sessions'),
(28,'session_ttl_days','30','30'),
(29,'functional_help_txt','If this discrepancy renders the device unusable, answer No. Otherwise, answer Yes.',
'If this discrepancy renders the device unusable, answer No. Otherwise, answer Yes.'),
(30,'device_term','Device','Device'),
(31,'discovered_term','When Discovered','When Discovered'),
(32,'discovered_term_short','When Disc','When Disc'),
(33,'functional_term','Functional','Functional'),
(34,'functional_term_short','Func','Func'),
(35,'functional_yes','Functional','Functional'),
(36,'functional_no','Non-functional','Non-functional'),
(37,'functional_yes_short','OK','OK'),
(38,'functional_no_short','INOP','INOP'),
(39,'disc_drop_data','Name','Name');
/*!40000 ALTER TABLE `config` ENABLE KEYS */; /*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
@@ -115,28 +151,28 @@ LOCK TABLES `links` WRITE;
UNLOCK TABLES; UNLOCK TABLES;
-- --
-- Table structure for table `periods` -- Table structure for table `discovered`
-- --
DROP TABLE IF EXISTS `periods`; DROP TABLE IF EXISTS `discovered`;
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `periods` ( CREATE TABLE `discovered` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL AUTO_INCREMENT,
`times` text NOT NULL, `whendiscoveredname` text NOT NULL,
`whendiscovereddesc` text NOT NULL,
`active` tinyint(1) NOT NULL, `active` tinyint(1) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
-- Dumping data for table `periods` -- Dumping data for table `discovered`
-- --
LOCK TABLES `periods` WRITE; LOCK TABLES `discovered` WRITE;
/*!40000 ALTER TABLE `periods` DISABLE KEYS */; /*!40000 ALTER TABLE `discovered` DISABLE KEYS */;
INSERT INTO `periods` VALUES (1,'0600 brief, 0645 box, 0830 debrief, 0930 end',1),(2,'0745 brief, 0830 box, 1015 debrief, 1115 end',1),(3,'0930 brief, 1015 box, 1200 debrief, 1300 end',1),(4,'1115 brief, 1200 box, 1345 debrief, 1445 end',1),(5,'1300 brief, 1345 box, 1530 debrief, 1630 end',1),(6,'1445 brief, 1530 box, 1715 debrief, 1815 end',1),(7,'1630 brief, 1715 box, 1900 debrief, 2000 end',1),(8,'1815 brief, 1900 box, 2045 debrief, 2145 end',1); /*!40000 ALTER TABLE `discovered` ENABLE KEYS */;
/*!40000 ALTER TABLE `periods` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
-- --
@@ -278,8 +314,8 @@ DROP TABLE IF EXISTS `writeups`;
CREATE TABLE `writeups` ( CREATE TABLE `writeups` (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`device` int(11) NOT NULL, `device` int(11) NOT NULL,
`period` int(11) NOT NULL, `discovered` int(11) NOT NULL,
`period_effective` tinyint(1) NOT NULL, `functional` tinyint(1) NOT NULL,
`reported_by` tinytext NOT NULL, `reported_by` tinytext NOT NULL,
`report_date` date NOT NULL, `report_date` date NOT NULL,
`report_time` time NOT NULL, `report_time` time NOT NULL,

View File

@@ -39,3 +39,174 @@ UPDATE config SET defaultvalue="c:\Windows\Temp\opendrs\opendrs\sessions" WHERE
-- Update version number -- Update version number
UPDATE config SET value="1.1.2",defaultvalue="1.1.2" WHERE name="drs_version"; UPDATE config SET value="1.1.2",defaultvalue="1.1.2" WHERE name="drs_version";
-- -------------------------------------- -- --------------------------------------
-- ---------- version 1.2.0 -------------
-- Update version number
UPDATE config SET value="1.2.0",defaultvalue="1.2.0" WHERE name="drs_version";
-- Add device_term to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'device_term',
'Device' AS wval,
'Device' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT name FROM config WHERE name = 'device_term'
) LIMIT 1
;
-- Add discovered_term to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'discovered_term',
'When Discovered' AS wval,
'When Discovered' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT name FROM config WHERE name = 'discovered_term'
) LIMIT 1
;
-- Add discovered_term_short to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'discovered_term_short',
'When Disc' AS wval,
'When Disc' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT name FROM config WHERE name = 'discovered_term_short'
) LIMIT 1
;
-- Add disc_drop_data to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'disc_drop_data',
'Name' AS wval,
'Name' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT name FROM config WHERE name = 'disc_drop_data'
) LIMIT 1
;
-- Add functional_term to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'functional_term',
'Functional' AS wval,
'Functional' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT `name` FROM `config` WHERE `name` = "functional_term"
) LIMIT 1
;
-- Add functional_term_short to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'functional_term_short',
'Func' AS wval,
'Func' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT `name` FROM `config` WHERE `name` = "functional_term_short"
) LIMIT 1
;
-- Add functional_yes to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'functional_yes',
'Functional' AS wval,
'Functional' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT `name` FROM `config` WHERE `name` = "functional_yes"
) LIMIT 1
;
-- Add functional_no to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'functional_no',
'Non-functional' AS wval,
'Non-functional' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT `name` FROM `config` WHERE `name` = "functional_no"
) LIMIT 1
;
-- Add functional_yes_short to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'functional_yes_short',
'OK' AS wval,
'OK' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT `name` FROM `config` WHERE `name` = "functional_yes_short"
) LIMIT 1
;
-- Add functional_no_short to config table
INSERT INTO config(name,value,defaultvalue)
SELECT * FROM
(SELECT 'functional_no_short',
'INOP' AS wval,
'INOP' AS dval
)
AS tmp
WHERE NOT EXISTS
(
SELECT `name` FROM `config` WHERE `name` = "functional_no_short"
) LIMIT 1
;
-- Rename period_eff_help_txt config to functional_help_txt
UPDATE `config` SET name="functional_help_txt" WHERE name="period_eff_help_txt";
-- Change the default value of functional_help_text
UPDATE `config` SET defaultvalue="If this discrepancy renders the device unusable, answer No. Otherwise, answer Yes." WHERE name="function_help_txt";
-- Rename periods table to discovered
RENAME TABLE `periods` TO `discovered`;
-- Add whendiscoveredname column to discovered table
ALTER TABLE `discovered` ADD COLUMN `whendiscoveredname` text NOT NULL AFTER id;
-- Copy the contents of the id column to the whendiscoveredname column where whendiscoveredname is empty
UPDATE `discovered` SET `whendiscoveredname`=`id` WHERE `whendiscoveredname`="";
-- Rename times column of discovered table to whendiscovereddesc
ALTER TABLE `discovered` CHANGE COLUMN `times` `whendiscovereddesc` text not null;
-- Add auto_increment flag to id column
ALTER TABLE `discovered` CHANGE COLUMN `id` `id` text not null auto_increment;
-- Rename period column of writeups table to discovered
ALTER TABLE `writeups` CHANGE COLUMN `period` `discovered` int not null;
-- Rename period_effective column of writeups table to functional
ALTER TABLE `writeups` CHANGE COLUMN `period_effective` `functional` tinyint(1) not null;